What types are there beyond built-in and compound?

F

fl

Hi,
I read book: C++ primer. On Chapter 12, it says that: If aclass contains data members of build in or compund type, then the class should not rely on the synthesized default constructor, It snould define its own constructor to initialize these members.

My question is: What type can use synthesized constructor?
It mentions that class without constructor can use the synthesized constructor, but I doubt that whether class is a compound type?

What types are left after build-in, compound? I do not get the categories of the types yet.

Thanks,
 
V

Victor Bazarov

I read book: C++ primer. On Chapter 12, it says that: If aclass
contains data members of build in or compund type, then the class should
not rely on the synthesized default constructor, It snould define its
own constructor to initialize these members.
My question is: What type can use synthesized constructor?

I would venture a guess that a class with data members of types with
their own default c-tors (like a few std::string members, for instance)
could rely on their initialization by a synthesized c-tor.
It mentions that class without constructor can use the synthesized
constructor, but I doubt that whether class is a compound type?
What types are left after build-in, compound? I do not get the
categories of the types yet.

Classes, like standard containers.

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top