template <typename T, T V>
struct foo {};
foo<bool, true>
MSVC accepts it happily, but that's never a reliable indicator.
What about:
template <typename T>
struct foo {
template <T V>
struct bar {};
};
foo<bool>::bar<true>
Thanks.
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Yes.
>
> What about:
>
> template <typename T>
> struct foo {
> template <T V>
> struct bar {};
>
> };
>
> foo<bool>::bar<true>
>
And yes.
I'm pretty sure I remember that something in Boost uses this
construct.
Sebastian
You're probably thinking of integral_constant, which is also present
in the C++0x draft.
template <typename T, T Value>
struct integral_constant
{
static const value_type value = Value;
// and stuff
};