Serving the Quantitative Finance Community

 
User avatar
countblessings
Topic Author
Posts: 0
Joined: June 7th, 2012, 11:05 am

Inheriting private members

August 28th, 2012, 2:16 pm

Please see below example:class A{ public: private: int x;}vector<A> a_vector;How can I make the vector a_vector inherit the private member x?
 
User avatar
Cuchulainn
Posts: 23029
Joined: July 16th, 2004, 7:38 am

Inheriting private members

August 28th, 2012, 2:32 pm

?
 
User avatar
dd3
Posts: 4
Joined: June 8th, 2010, 9:02 am

Inheriting private members

August 28th, 2012, 6:42 pm

QuoteOriginally posted by: countblessingsPlease see below example:class A{ public: private: int x;}vector<A> a_vector;How can I make the vector a_vector inherit the private member x?You would be better off on StackOverflow.com for beginner questions.However, your question really makes no sense and wouldn't last long there.
 
User avatar
lballabio
Posts: 0
Joined: January 19th, 2004, 12:34 pm

Inheriting private members

August 29th, 2012, 7:17 am

vector<A> doesn't inherit from A, so you can't expect it to inherit any members.What is it that you're really asking here? How would you like to use the vector?