19 lines · cpp
1template <typename T> struct A {2};3 4template <> struct A<int> {5 struct B {6 int f;7 };8};9 10template <> struct A<bool> {11 struct B {12 int g;13 };14};15 16 17template <typename T> constexpr int f() { return 0; }18template <> constexpr int f<int>() { return 4; }19