CMake/Tests/CompileFeatures/cxx_inline_namespaces.cpp

26 lines
276 B
C++
Raw Normal View History

namespace Lib {
inline namespace Lib_1 {
template <typename T>
class A;
2014-04-06 12:07:19 +04:00
}
template <typename T>
void g(T);
2014-04-06 12:07:19 +04:00
}
struct MyClass
{
2014-04-06 12:07:19 +04:00
};
namespace Lib {
template <>
class A<MyClass>
2014-04-06 12:07:19 +04:00
{
};
}
void someFunc()
{
Lib::A<MyClass> a;
g(a); // ok, Lib is an associated namespace of A
2014-04-06 12:07:19 +04:00
}