views:

35

answers:

1

I'm looking to help users of some of my templated code by using BOOST_STATIC_ASSERT to let them know that they've used an incompatible type with a simpler compile error message than the monster than is currently produced with an incompatible type.

The example is a bit too complex to reproduce here, but hopefully this will capture the essence of what I want:

My question is how to format that last line, a "template template"?

template <typename P1, int P2, typename P3> 
class InterestingType

{
}

template<typename T>
struct is_interesting_type{
 static const bool value = false;
};

template<template<typename,int,typename> typename InterestingType> //No idea how to format this..
struct is_interesting_type{
 static const bool value = true;
};
+1  A: 

Change the code to

template <typename P1, int P2, typename P3> 
struct is_interesting_type<InterestingType<P1, P2, P3> >{
 static const bool value = true;
};
Pardeep
Excellent, thanks. Wasted quite a few hours on that... just one of those things.Looks so easy now :-)
Ken Moynihan