2011-11-08から1日間の記事一覧

戻り値型を書かない関数定義

C++

\(^o^)/ [ソース] #include <iostream> #include <boost/function.hpp> #include <boost/bind.hpp> static const auto plus = [](int a, int b){ return a + b; }; static const auto bind1st = [](boost::function<int(int, int)> f, int a){ return boost::bind(f, a, _1); }; int main(){ auto n = plus(1, 3); std::c</int(int,></boost/bind.hpp></boost/function.hpp></iostream>…