Boost logo

Boost :

From: Pavol Droba (droba_at_[hidden])
Date: 2003-03-07 12:17:56


On Fri, Mar 07, 2003 at 10:09:40AM -0500, David Abrahams wrote:
> Pavol Droba <droba_at_[hidden]> writes:
>
> > I have tried to make forward declaration of std::vector and alike, but it does not work all the time,
> > and, I think it is even forbiden by some compilers.
>
> It's forbidden by the standard.
>
> > My question is:
> > Is there a correct way how to avoid these unwanted inclusions?
>
> Not if they're standard containers :(

not good :(

>
> > Or more specificaly:
> > How to define a partial specialization for a specific type, without including its full definition?
>
> That's a different question:
>
> template <class T> struct whatever;
>
> template <class T> struct whatever<boost::shared_ptr<T> >
> {
> //...
>
> };
>
> You never have to define the primary template, in fact.

I wanted to do something else:

        template <class T> struct trait_class
   {
   ....
   }

   template <class T> struct trait_class<std::vector<T> >
   {
   ....
   }

without #include <vector>

Is this possible? Or is there a way how to achieve the same efect, but without including <vector>?

I see, that is probably isn't ..

Pavol


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk