2012-04-27から1日間の記事一覧

C++ で関数名のエイリアス

C++

たまに欲しくなるので、ちょっと考えてみた。 [ソース] #include <numeric> #include <algorithm> #include <iterator> #include <iostream> #include <type_traits> #define FUNCNAME_ALIASES(target, name) \ struct { \ template<typename ...Args> \ auto \ operator ()(Args&&... args) const \ ->decltype(target(std::forward<Args>(</args></typename></type_traits></iostream></iterator></algorithm></numeric>…