Boost logo

Boost :

From: Howard Hinnant (hinnant_at_[hidden])
Date: 2003-05-12 08:31:18

On Monday, May 12, 2003, at 04:59 AM, Hubert Holin wrote:

> I welcome any suggestion on that matter (and would most welcome
> somebody showing me what I got wrong :-) ).

To be honest I haven't tried it with template template overloads. But
it looks like you're looking for restricted templates for 1 and 2
(especially 1). Search the newsgroups for "restrict_to" and
"enable_if" and/or see the June '03 CUJ feature article.


template <bool b, class T = void> struct restrict_to {};
template <class T> struct restrict_to<true, T> {typedef
T type;};

template<typename T>
typename restrict_to
f(T x)
    ::std::cout << "Plain vanilla templated function (for floating point
types only)" << ::std::endl;


Boost list run by bdawes at, gregod at, cpdaniel at, john at