Я ударился головой о следующий код:
template<class... Ts> struct typelist{};
template<class S> struct Fun;
template<template<class...> class S, class... Ts>
struct Fun<S<Ts...>> {
std::tuple<Ts...> _fun;
};
template<class S, class P> struct Gun;
template<template<class...> class S, class... Ts, class P>
struct Gun<S<Ts...>, P>: Fun<S<Ts...>>{
auto hun(){
std::cout << std::get<0>(_fun); // error: use of undeclared identifier '_fun'
}
};
auto main(int /*argc*/, char* /*argv*/[])-> int {
auto gun = Gun<typelist<int>, float>{};
gun.hun();
return 0;
}
Я не понимаю, что здесь происходит и почему я получаю эту ошибку.Там должно быть что-то очевидное, я не вижу ...