|
Boost Users : |
From: Andy Little (andy_at_[hidden])
Date: 2005-02-23 17:38:23
"Agoston Bejo" <gusz1_at_[hidden]> wrote in message
news:cr9kth$s8u$1_at_sea.gmane.org...
> Hi all,
> I am trying to enable only two version of a function. The caller may
> choose one
>
> of the two versions by specifying a template parameter. I've got two
> versions
>
> for the problem, both of them failing the same way.
> template<unsigned int N, typename T>
> enable_if_c<N==1>
> f(T t)
> {
> cout << 1 << endl;
> }
FWIW enable_if signature is required as follows:
template<unsigned int N, typename T>
//enable_if_c<N==1>
typename enable_if_c<N==1>::type
f(T t)
{
cout << 1 << endl;
}
//...etc
regards
Andy Little
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net