2016-08-05から1日間の記事一覧

Boost.Hana を使って名前付き引数

C++

Boost.Hana を使って名前付き引数(っぽいの)をやってみた。 [コード] #include <iostream> #include <boost/hana.hpp> template<typename T> void print(T t){ std::cout << t[BOOST_HANA_STRING("name")] << ":" << t[BOOST_HANA_STRING("age")] << std::endl; } int main(){ using namespace bo</typename></boost/hana.hpp></iostream>…