Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

c++ Is there still a need to provide default constructors to use STL containers

class MyClass {
public: 
    MyClass(int x) {}
};
int main() {
    vector<MyClass> v; 
    MyClass test{1}; 
    v.push_back(test);
}
 
PREVIOUS NEXT
Tagged: #Is #provide #default #constructors #STL #containers
ADD COMMENT
Topic
Name
1+7 =