namespace ns1 { struct Foo { int value; }; } // namespace ns1 namespace ns2 { template struct Trait { static constexpr bool valid = false; }; template <> struct Trait { static constexpr bool valid = true; }; } // namespace ns2