2013-08-09から1日間の記事一覧

コンパイル時toupperとtolower

見たまんまですね。 文字列リテラル又はsprout::stringから処理を施したsprout::stringを生成します。 C++1yならdecltypeの部分は無くても動きますが、C++11対応のため。 #include <type_traits> #include <sprout/string.hpp> #include <sprout/index_tuple.hpp> template<class T, std::size_t size, sprout::index_t... indexes> constexpr auto toupper_impl(const T (&str</class></sprout/index_tuple.hpp></sprout/string.hpp></type_traits>…