Re: [gem5-dev] Query on inheritance and virtual functions

2011-06-08 Thread Nilay Vaish
On Wed, 8 Jun 2011, Jack Harvard wrote: When you declare your function private, you can't use instance.function() to access it. Is it generating a compile time error? On 8 Jun 2011, at 00:31, Nilay Vaish wrote: Consider the following class declarations -- class A { public: virtual void

Re: [gem5-dev] Query on inheritance and virtual functions

2011-06-08 Thread Jack Harvard
On 8 Jun 2011, at 19:09, Nilay Vaish wrote: On Wed, 8 Jun 2011, Jack Harvard wrote: When you declare your function private, you can't use instance.function() to access it. Is it generating a compile time error? On 8 Jun 2011, at 00:31, Nilay Vaish wrote: Consider the following class

Re: [gem5-dev] Query on inheritance and virtual functions

2011-06-08 Thread Nilay Vaish
On Wed, 8 Jun 2011, Jack Harvard wrote: On 8 Jun 2011, at 19:09, Nilay Vaish wrote: On Wed, 8 Jun 2011, Jack Harvard wrote: When you declare your function private, you can't use instance.function() to access it. Is it generating a compile time error? On 8 Jun 2011, at 00:31, Nilay Vaish

Re: [gem5-dev] Query on inheritance and virtual functions

2011-06-08 Thread Jack Harvard
On 8 Jun 2011, at 23:28, Nilay Vaish wrote: On Wed, 8 Jun 2011, Jack Harvard wrote: On 8 Jun 2011, at 19:09, Nilay Vaish wrote: On Wed, 8 Jun 2011, Jack Harvard wrote: When you declare your function private, you can't use instance.function() to access it. Is it generating a

Re: [gem5-dev] Query on inheritance and virtual functions

2011-06-08 Thread Nilay Vaish
On Wed, 8 Jun 2011, Jack Harvard wrote: On 8 Jun 2011, at 23:28, Nilay Vaish wrote: On Wed, 8 Jun 2011, Jack Harvard wrote: On 8 Jun 2011, at 19:09, Nilay Vaish wrote: On Wed, 8 Jun 2011, Jack Harvard wrote: When you declare your function private, you can't use instance.function() to

Re: [gem5-dev] Query on inheritance and virtual functions

2011-06-08 Thread Jack Harvard
On 9 Jun 2011, at 00:10, Nilay Vaish wrote: On Wed, 8 Jun 2011, Jack Harvard wrote: On 8 Jun 2011, at 23:28, Nilay Vaish wrote: On Wed, 8 Jun 2011, Jack Harvard wrote: On 8 Jun 2011, at 19:09, Nilay Vaish wrote: On Wed, 8 Jun 2011, Jack Harvard wrote: When you declare your

[gem5-dev] Query on inheritance and virtual functions

2011-06-07 Thread Nilay Vaish
Consider the following class declarations -- class A { public: virtual void function() = 0; }; class B : public A { private: void function(); } int main() { B b; b.function(); } Will this code compile correctly? -- Nilay ___

Re: [gem5-dev] Query on inheritance and virtual functions

2011-06-07 Thread Jack Harvard
When you declare your function private, you can't use instance.function() to access it. Is it generating a compile time error? On 8 Jun 2011, at 00:31, Nilay Vaish wrote: Consider the following class declarations -- class A { public: virtual void function() = 0; }; class B :