views:

22

answers:

1

boost::mpl::integral_c is declared as:

template <typename T, T N>
struct integral_c;

Is it possible to register this sort of template with Boost.Typeof:

  • For any T?
  • For some T's?
A: 

N is a template parameter so it can only be a numeric type, therefore it only allows numeric types of T, the sort for which you can have template parameters.

Note that template parameters can be member pointer-to-function types or member pointer-to-data types but these are also considered types.

CashCow
You can also pass in reference types, at least in MSVC, provided that it fits the other requirements for being a template parameter and a few others.
DeadMG