Boost logo

Boost :

From: Arkadiy Vertleyb (vertleyb_at_[hidden])
Date: 2005-03-30 09:58:43


"David Abrahams" <dave_at_[hidden]> wrote
> > This actually makes it possible to properly implement remove_xxx for
> > VC6.5 and VC7.0 without any form of registration :)
>
> Whoa. That is *major*... at least for those
> hopefully-soon-to-be-obsolete compilers it is. Awesome! Is this a
> full replacement for partial specialization?

This implementtion doesn't use any template specialzation. It works pretty
much like this:

1) Pass expression into a function template;
2) Use VC bugfeature to instantiate a template, something like this:

struct blah<ID>
{
    typedef T type; // T is known inside the function template
};

3) return ID through the sizeof();
4) use blah<ID>::type

No specializations, no encoding -- nothing. Compiles in no time at all and
handles anything.

Regards,
Arkadiy


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