Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > base class member init in derived class

Reply
Thread Tools

base class member init in derived class

 
 
Chris Forone
Guest
Posts: n/a
 
      03-22-2008
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
 
Reply With Quote
 
 
 
 
Ian Collins
Guest
Posts: n/a
 
      03-22-2008
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.
 
Reply With Quote
 
 
 
 
Chris Forone
Guest
Posts: n/a
 
      03-22-2008
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Derived::Derived(const Base&) and Derived& operator=(const Base&) developereo@hotmail.com C++ 1 05-23-2007 01:44 PM
Derived::Derived(const Base&) and Derived& operator=(const Base&) developereo@hotmail.com C++ 1 05-23-2007 12:07 AM
derived class and base class, member assignment, which goes first user C++ 1 07-11-2005 04:25 AM
When is a base class protected member not visible in a derived class? Andy Lomax C++ 5 06-30-2005 04:34 AM
Can Derived class static member access protected member from base class? Siemel Naran C++ 4 01-12-2005 06:46 PM



Advertisments