|
Boost : |
Subject: Re: [boost] [serialization] Proposal: make 'version' trait(andothers)enable_if-friendly
From: Robert Ramey (ramey_at_[hidden])
Date: 2012-12-06 18:13:28
Jeffrey Lee Hellrung, Jr. wrote:
> T is not in a deduced context, i.e., the compiler cannot deduce what
> T is. You can try it yourself if you don't believe me :)
I confess I still don't get it. Seems to me to be a special instance
of partial template specialization. Anyway
The following example works on both MSVC 9.0 and GCC 4.5.3
template<class T>
struct trait {
};
template<>
struct trait<int> {
};
template<class T>
struct outer {
struct inner {
};
};
template<class T>
struct indirect : public outer<T>::inner {
};
template<class U>
struct trait< indirect<U> > {
};
without the indirect it did indeed fail on both compilers.
I would seem to me that a variation on the above above could be
adapted to give the original poster
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk