Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #8456 > unrolled thread

Optiamlly resolve user defined class used in header file

Started byAmi <ver_amitabh@yahoo.com>
First post2011-08-04 00:45 -0700
Last post2011-08-04 20:02 +1200
Articles 2 — 2 participants

Back to article view | Back to comp.lang.c++


Contents

  Optiamlly resolve user defined class used in header file Ami <ver_amitabh@yahoo.com> - 2011-08-04 00:45 -0700
    Re: Optiamlly resolve user defined class used in header file Ian Collins <ian-news@hotmail.com> - 2011-08-04 20:02 +1200

#8456 — Optiamlly resolve user defined class used in header file

FromAmi <ver_amitabh@yahoo.com>
Date2011-08-04 00:45 -0700
SubjectOptiamlly resolve user defined class used in header file
Message-ID<90b233d6-fa8e-4457-b70b-843b038a783c@glegroupsg2000goo.googlegroups.com>
Hi All,
   I have a header file(my_derived.h) in which I derive a class from another user defined class which exists in another header file (my_base.h). Is it possible to avoid including my_base.h in my_derived.h and still can resolve the reference?
My intention is to keep my_derived.h free of any include<> s.
When I include my_base.h in my_derived.cpp, I get 
error C2504: 'my_base_class' : base class undefined

I am using Visual studio 2010 as IDE.
Any better suggestion to keep header files clean are highly appreciated.
Thanks in advance.

[toc] | [next] | [standalone]


#8457

FromIan Collins <ian-news@hotmail.com>
Date2011-08-04 20:02 +1200
Message-ID<99v20tFar7U7@mid.individual.net>
In reply to#8456
On 08/ 4/11 07:45 PM, Ami wrote:
> Hi All,
>     I have a header file(my_derived.h) in which I derive a class from another user defined class which exists in another header file (my_base.h). Is it possible to avoid including my_base.h in my_derived.h and still can resolve the reference?

No.

> My intention is to keep my_derived.h free of any include<>  s.

Why?

-- 
Ian Collins

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.c++


csiph-web