template <class... T_values>
class Thing {
public:
void something(T_values... values) {
tuple_ = std::tuple<T_values...>(values...);
}
void do_something_with_values() {
call_yadda_with_tuple(tuple_,
std::index_sequence_for<T_value...>())
}
void yadda(T... values);
private:
//The helper method.
template<std::size_t... Is>
void call_yadda_with_tuple(const std::tuple<T_values...>& tuple,
std::index_sequence<Is...>) {
yadda(std::get<Is>(tuple)...);
}
std::tuple<T_values...> tuple_;
};
Above sourcecode comes from: http://ift.tt/1LNyrjf
I would like to ask some questions:
- What does return
std::index_sequence_for<T_value...>())
? - Why in
yadda(std::get<Is>(tuple)...);
there isIs
instead ofIs...
? Therefore, what does it meanIs
?Is...
in unpacked ( expanded ) types pack but what isIs
. - Especially, which
std::get
fits from (1)-(8) (http://ift.tt/1MPYEjt) - Why
call_yadda_with_tuple
getsstd::index_sequence<Is...>
. After all, this argument is nameless so it is useless. I suppose that it is connected with deduction types but I cannot see how does it help?
Aucun commentaire:
Enregistrer un commentaire