0

I got this code from boost::hana:

template <typename Storage>
struct KeyAtIndex {
    template <std::size_t i>
    using apply = decltype(hana::first(hana::at_c<i>(std::declval<Storage>())));
};

template <typename ...Pairs>
struct make_map_type {
    using Storage = hana::basic_tuple<Pairs...>;
    using HashTable = typename detail::make_hash_table<
        detail::KeyAtIndex<Storage>::template apply, sizeof...(Pairs)
    >::type;
    using type = detail::map_impl<HashTable, Storage>;
};

I wonder what's the mean of detail::KeyAtIndex<Storage>::template, why the template keyword is used here? Is there something in c++ iso standard can explain the use?

John Smith
  • 283
  • 1
  • 9
  • 2
    Look at [where-and-why-do-i-have-to-put-the-template-and-typename-keywords](http://stackoverflow.com/questions/610245/where-and-why-do-i-have-to-put-the-template-and-typename-keywords) – Jarod42 Apr 21 '17 at 08:08
  • @Jarod42 Thans a lot. – John Smith Apr 21 '17 at 08:52

0 Answers0