Мне нужно получить параметр шаблона из вложенного типа. Вот простой пример, чтобы показать тип, который мне нужно извлечь.Тип признака для извлечения параметра шаблона из вложенного типа
#include <iostream>
#include <typeinfo>
template<typename T>
void function(T) {
// T = 'struct A<int>::B'
//
// Here I want to get the template value type e.g. 'int' from T
// so that this would print 'int'. How can this be done?
std::cout << typeid(T).name() << std::endl;
}
template<typename T>
struct A {
using B = struct { int f; };
};
int main() {
function(A<int>::B{});
return 0;
}
Вы можете добавить 'ЬурейеЕ 'внутри' B'? – Jarod42