.
( ):
template<typename T>
struct Foo_temp;
namespace A {
struct tag;
using Foo = Foo_temp<tag>;
}
namespace B {
struct tag;
using Foo = Foo_temp<tag>;
}
namespace C {
struct tag;
using Foo = Foo_temp<tag>;
}
template<>
struct Foo_temp<A::tag> { };
template<>
struct Foo_temp<B::tag> { };
template<>
struct Foo_temp<C::tag> { };
template<typename T>
struct is_Foo : public std::false_type {};
template<typename T>
struct is_Foo<Foo_temp<T>> : public std::true_type {};
, Foo . , , , .., , is_Foo . , , , is_Foo (, Foo Foo), ( ), .
Foo (, ), .
, Foo_test , Foo_test, A,B,C. , , .
namespace A {
struct tag;
struct Foo_impl { };
using Foo = Foo_temp<tag>;
}
template<>
struct Foo_temp<A::tag> : A::Foo_impl {};
.
, Foo_temp tag (Foo_impl). , , , . , . a Bar.
, , , , , (, , ). : tag, , , .
template<typename T>
struct array<tag::dense, T> { };
template<typename T>
struct array<tag::sparse, T> { };
, is_array . . (. ). , . tag::lazy , .