2008-06-04から1日間の記事一覧

result_of わかんない

C++

これだとOKだけど #include <iostream> #include <boost/utility/result_of.hpp> using namespace std; struct hoge { typedef int result_type; int operator()(double d) const { return 0; } }; int main() { cout << typeid(boost::result_of<hoge(double)>::type).name() << endl; return 0; } これだとNG</hoge(double)></boost/utility/result_of.hpp></iostream>…

C++0x Default Move Functions

C++

move constructor と move assignment operator のデフォルトの書き方 class Derived : public Base { std::vector<int> vec; std::string name; public: // move constructor Derived(Derived&& x) : Base(std::forward<Base>(x)), vec(std::move(x.vec)), name(std::m</base></int>…