【C++】template 統合スレ -- STL/Boost/Loki, etc.
■ このスレッドは過去ログ倉庫に格納されています
0550デフォルトの名無しさん
NGNG簡単なものだから、自分で書いちゃっても。
これは要するに
f(x) = x
となるような恒等変換をする関数オブジェクト。
namespace std {
template <typename T>
struct identity : public unary_function<T, T>
{
T& operator()(T& x) const { return x; }
const T& operator()(const T& x) const { return x; }
};
}
■ このスレッドは過去ログ倉庫に格納されています