[fusion][map] default construction semantics

Please see attached an example of constructing a fusion map, of which I would expect to give identical results. Or, does fusion deviate from the common expression for default construction in this case? Kind regards, Rutger ter Borg

Rutger ter Borg wrote:
Please see attached an example of constructing a fusion map, of which I would expect to give identical results.
Really?
// OK map_type map();
This looks like a function declaration to me (a function with name "map" that takes no arguments and returns a map_type), but C++ might be intelligent enough to see that it is a default initialization.
// Compiler error -- tries to copy map_type map;
This looks like a default initialization to me. I have no idea, whether this default initialization should compile without error. Regards, Thomas

Thomas Klimpel wrote:
This looks like a function declaration to me (a function with name "map" that takes no arguments and returns a map_type), but C++ might be intelligent enough to see that it is a default initialization.
Yes, my mistake.
// Compiler error -- tries to copy map_type map;
This looks like a default initialization to me. I have no idea, whether this default initialization should compile without error.
Well, the docs state that it would call the default constructor of all elements, which I think it does not, otherwise there would not be a boost::noncopyable block, or would there? Thanks, Rutger
participants (2)
-
Rutger ter Borg
-
Thomas Klimpel