no-arg ctor needed]most c++ classes

In practice, your custom class should have either no ctor or at least a no-arg ctor. This is practical advice in [[c++ primer]]

The array-new operator, vector and other containers all require that
– either your class has no ctor
– or you provide a no-arg.

In other words, no-arg is the first ctor to be provided.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s