get part of std::tuple

With help of a compile-time integer list: #include <cstdlib> template <size_t… n> struct ct_integers_list { template <size_t m> struct push_back { typedef ct_integers_list<n…, m> type; }; }; template <size_t max> struct ct_iota_1 { typedef typename ct_iota_1<max-1>::type::template push_back<max>::type type; }; template <> struct ct_iota_1<0> { typedef ct_integers_list<> type; }; We could construct the tail simply by … Read more

get part of std::tuple

With help of a compile-time integer list: #include <cstdlib> template <size_t… n> struct ct_integers_list { template <size_t m> struct push_back { typedef ct_integers_list<n…, m> type; }; }; template <size_t max> struct ct_iota_1 { typedef typename ct_iota_1<max-1>::type::template push_back<max>::type type; }; template <> struct ct_iota_1<0> { typedef ct_integers_list<> type; }; We could construct the tail simply by … Read more

How should I use g++’s -finput-charset compiler option correctly in order to compile a non-UTF-8 source file?

Encoding Blues You cannot use UTF-16 for source code files; because the header you are including, <iostream>, is not UTF-16-encoded. As #include includes the files verbatim, this means that you suddenly have an UTF-16-encoded file with a large chunk (approximately 4k, apparently) of invalid data. There is almost no good reason to ever use UTF-16 … Read more