|
Boost : |
From: Steven Watanabe (steven_at_[hidden])
Date: 2007-08-25 23:18:39
AMDG
Steven Watanabe <steven <at> providere-consulting.com> writes:
> Giovanni Piero Deretta <gpderetta <at> gmail.com> writes:
>
> > Does this actually work? Shouldn't enable/disable_if depend on some
> > template arguments of f (and f is not templated here)?
>
> Right. Never mind. We'll have to wait for concepts.
>
Ok. Here's a method that actually works
template<bool is_static, class Derived>
struct base;
template<class Derived>
struct base<true, Derived> {
static R f();
};
template<class Derived>
struct base<false, Derived> {
R f();
};
template<class T>
class C : base<f_is_static<T>::value, C<T> > {};
In Christ,
Steven Watanabe
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk