++ struct
, class
, public:
private:
. , struct A {};
, , A
, struct
:
A* b = (1 == 1) ? new A : new A;
OP, struct A
new
. new
. cppreference.com:
new int + 1 // syntactically okay, '+1' offsets the pointer returned by 'new int'
new int * 1 // error, type (int *) is assumed and 1 doesn't make sense in '(new (int *)) 1'
, class A
, , , (class A : public base_class
), , error: redefinition of 'A'
.
: , :
1 ? new (struct A) : new struct A;
, struct A
, , , .