base class member init in derived class

Discussion in 'C++' started by Chris Forone, Mar 22, 2008.

  1. Chris Forone

    Chris Forone Guest

    hello group,

    i have a base class with a std::vector in protected area. is it possible
    to call an explizit ctor in derived class ctor initialization list?

    thanks & hand, chris
     
    Chris Forone, Mar 22, 2008
    #1
    1. Advertising

  2. Chris Forone

    Ian Collins Guest

    Chris Forone wrote:
    > hello group,
    >
    > i have a base class with a std::vector in protected area. is it possible
    > to call an explizit ctor in derived class ctor initialization list?
    >

    No, the only place you can initialise a base class member in an
    initialisation list is in a base class constructor.

    --
    Ian Collins.
     
    Ian Collins, Mar 22, 2008
    #2
    1. Advertising

  3. Chris Forone

    Chris Forone Guest

    Ian Collins schrieb:
    > Chris Forone wrote:
    >> hello group,
    >>
    >> i have a base class with a std::vector in protected area. is it possible
    >> to call an explizit ctor in derived class ctor initialization list?
    >>

    > No, the only place you can initialise a base class member in an
    > initialisation list is in a base class constructor.
    >

    Thanks a lot, chris
     
    Chris Forone, Mar 22, 2008
    #3
    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. Siemel Naran
    Replies:
    4
    Views:
    810
    Micah Cowan
    Jan 12, 2005
  2. Andy Lomax
    Replies:
    5
    Views:
    477
    John Carson
    Jun 30, 2005
  3. user
    Replies:
    1
    Views:
    405
    Jack Klein
    Jul 11, 2005
  4. Replies:
    1
    Views:
    397
    myork
    May 23, 2007
  5. Replies:
    1
    Views:
    390
    Victor Bazarov
    May 23, 2007
Loading...

Share This Page