vendredi 21 avril 2017

c++ template specialization, a template keyword in angle brackets [duplicate]

This question already has an answer here:

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?

Aucun commentaire:

Enregistrer un commentaire