C++ template non-type parameter type deduction

Viewed 909

I'am trying to do this work:

template < typename T, T VALUE >
void            f()
{
    /* ... */
}

int             main()
{
    f<10>();    // implicit deduction of [ T = int ] ??
    return (0);
}

The purpose is to simplify a much more complex template.

After many searches, I don't find any way to do that on C++0x, so stackoverflow is my last resort.

  • without specify all type of T possible...
  • I am on g++ C++0x, so sexy stuff is allowed.
3 Answers
Related