是否有可能实现以下行为?
template<typename T>
struct X {
template<const bool Condition>
struct Y;
template<>
struct Y<true> {
typedef T Z;
};
};
template<typename T>
struct A {
typedef typename T::Y<true>::Z B; // Error
};
int main() {
X<float>::Y<true>::Z value = 5.0f; // OK
A<X<float>>::B value2 = 5.0f; // Desired behaviour
return 0;
}