You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -790,8 +798,7 @@ as many as the number of non-optional parameters defined for the class's [constr
790
798
791
799
**Semantics**
792
800
793
-
The `new` operator creates an object that is an instance of
794
-
the class specified by *class-type-designator*.
801
+
The `new`*class-type-designator* forms create an object of the class type specified by *class-type-designator*. The `new class` forms create an object of an *anonymous class type*, a type that has an unspecified name. In all other respects, however, an anonymous class has the same capabilities as a named class type.
795
802
796
803
If the *class-type-designator* is an expression resulting in a string value,
797
804
that string is used as the class name. If the expression results in an object,
@@ -810,8 +817,10 @@ passing it the optional *argument-expression-list*. If the class has no
810
817
constructor, the constructor that class inherits (if any) is used. The class
811
818
can also specify no constructor definition, in this case the constructor call is omitted.
812
819
813
-
The result of an *object-creation-expression* is an object
814
-
of the type specified by *class-type-designator*.
820
+
The result of a named-type *object-creation-expression* is an object of the type specified by *class-type-designator*. The result of an anonymous class *object-creation-expression* is an object of unspecified type. However, this type will subtype all types
821
+
provided by *class-base-clause* and *class-interface-clause* and the *class-members* definition should follow the same inheritance and implementation rules as the regular [class declaration](14-classes.md#class-declarations) does.
822
+
823
+
Each distinct source code expression of the form `new class` results in the class type that is different from that of all other anonymous class types. However, multiple evaluations of the same source code expression of the form `new class` result in instances of the same class type.
815
824
816
825
Because a constructor call is a function call, the relevant parts of
817
826
[function call operator](#function-call-operator) section also apply.
0 commit comments