What's the correct way of creating an instance of class in D?

Steven Schveighoffer schveiguy at gmail.com
Thu Nov 3 19:16:10 UTC 2022


On 11/3/22 1:46 PM, Tejas wrote:

> Check my post, `A& a;` refuses to compile in C++20 atleast, asking to be 
> explicitly initialized, thus averting the problem altogether

That's different, `A&` cannot be rebound in C++, whereas a class 
reference can.

Try `A* a;` and see if it compiles

-Steve


More information about the Digitalmars-d-learn mailing list