Actually I don’t know how to define this idioms.
In some code i have red something like:
ClassWithAMessage c = "This is the message";
where i expected to read:
ClassWithAMessage c("This is the message");
I don’t know how to reproduce this behavior, can someone provide some information or a toy example?
is copy initialization. A copy constructor must be available for this to work. First, a temporary
ClassWithAMessageis constructed using the conversion constructor from"This is the message". The temporary is then used with the copy constructor to constructc. This is subject to copy elision (the temp might not be there).is direct initialization. The conversion constructor is used directly.
Not really idioms, just different ways to construct an object.