- 386 名前:デフォルトの名無しさん mailto:sage [2008/04/24(木) 21:55:20 ]
- C++ならできるからg++使えってのはあり?
#include <boost/tr1/functional.hpp> #include <boost/utility/result_of.hpp> #include <cstdio> template<typename T> T g(T x) { return x + 1; } template<typename T> typename boost::result_of<T ()>::type f(T g) { return g(); } int main() { std::printf("%d\n", f(std::tr1::bind(g<int>, 1))); }
|

|