Trexquant·Software Engineer·Technical Phone Screen
- Under what conditions will the compiler implicitly declare a default constructor for a class, and when does that implicitly-declared constructor end up being defined as deleted?
- How do user-declared special member functions like copy/move constructors, copy/move assignment operators, and destructors affect whether a default constructor gets generated at all?
- What happens to the implicit default constructor when a class has members or base classes with no default constructor, or when members are references or const-qualified?
- Can you give concrete examples of a class that gets an implicit default constructor, one that does not get one at all, and one that gets one but it is defined as deleted?
“Two-part question that sounds like one.”