lundi 2 octobre 2017

Function that accepts a tuple and returns another tuple

How do I write a function overload that takes a tuple of any size and returns another tuple of the same size where int becomes double (with 0.5 value added), char becomes string, and size_t becomes int (by becoming the opposite sign), and whatever other type changes we may want. For example the function foo takes tuple<int, char, size_t> and returns tuple<double, string, int>, while it takes tuple<size_t, char> and returns tuple<int, string>.

Aucun commentaire:

Enregistrer un commentaire