What types are there beyond built-in and compound?

Discussion in 'C++' started by fl, Jan 20, 2013.

  1. fl

    fl Guest

    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,
     
    fl, Jan 20, 2013
    #1
    1. Advertising

  2. On 1/20/2013 11:52 AM, fl wrote:
    > 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
    --
    I do not respond to top-posted replies, please don't ask
     
    Victor Bazarov, Jan 20, 2013
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ma740988
    Replies:
    6
    Views:
    418
    ma740988
    Aug 26, 2004
  2. Alona
    Replies:
    2
    Views:
    658
  3. Replies:
    2
    Views:
    346
    Gabriel Genellina
    May 12, 2007
  4. rantingrick
    Replies:
    4
    Views:
    267
    rantingrick
    Jul 28, 2011
  5. fl
    Replies:
    2
    Views:
    208
Loading...

Share This Page