This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

forwad declaration for nested classes


Is it possible to declare a nested class forward in a handle class?
I have the following problem:

A class "DBActionImpl" has a method that returns a Pointer to a inner class
"DS" from class "CacheSubArtPromoGr".
The declaration in DBActionImpl is:
CacheSubArtPromoGr::DS* CacheSubArtPromoGrSub_GetSubArtPromoGr(short tHaeufigkeitImSet);
the appropriate include is "#include <CacheSubArtPromoGr.hh>"

In DBAction, my handle class, I want to have a method 

   CacheSubArtPromoGr::DS* CacheSubArtPromoGr_GetSubArtPromoGr(short tHaeufigkeitImSet);

the implemetation is simple:
    {
	return impl->CacheSubArtPromoGr_GetSubArtPromoGr(tHaeufigkeitImSet);
    }
where impl is the pointer to the implementatin class.

I have to publish "CacheSubArtPromoGr::DS" in the header file of the handle class.
But the declaration

class CacheSubArtPromoGr::DS;

is rejected by the compiler with:
DBAction.hh:7: aggregate `CacheSubArtPromoGr DS' has incomplete type and cannot 
   be initialized

Okay, I could include <CacheSubArtPromoGr.hh> in my handle class, but is there
a better way?

compiler: gcc3.0.1
platform: linux
lib:      g++-v3

-- 
PALOMA-system is a treasure, hanger or large item and stored in the wrong area (Loc. 1/K/99/91/1)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]