« first day (2469 days earlier)      last day (1633 days later) » 

 
2 hours later…
 
2 hours later…
 
7:37 PM
@ViníciusMagalhãesHorta Think carefully about what those do, especially in terms of what they do that could fail. A variant basically contains a pointer to any one of a number of types of things. The default ctor makes that a nullptr. A move ctor just copies the pointer from one variant to another (and sets the original to a nullptr). A convert just stores the address of the source object into the pointer. All easy to guarantee won't throw, regardless of what the pointer could point at.
The copy constructor, however, has to create a copy of the pointee object, which can throw.
 
7:59 PM
2 messages moved from Lounge<C++>
 

« first day (2469 days earlier)      last day (1633 days later) »