Multiple Default Constructors

后端 未结 2 1106

From this stack overflow question the answer contains this quote:

... definition says that all default constructors (in case there are multiple) ...

2条回答
  •  盖世英雄少女心
    2021-01-13 21:12

    Here's an example of a class with two default constructors that can be default constructed:

    struct Foo
    {
        Foo(); // #1
    
        template 
        Foo(Args...); // #2
    };
    
    auto test()
    {
        Foo f{}; // ok calls #1
    }
    

提交回复
热议问题