Generic Programming with C++ Template
■ このスレッドは過去ログ倉庫に格納されています
0063デフォルトの名無しさん
NGNG//(2) operators : AddOp<T1,T2> and operator "+" overloading
template<typename T1, typename T2>
struct AddOp : public BinOp<T1,T2>
{
ContType operation (ContType a1, ContType a2)
{return (a1 + a2);}
}
template<typename T1, typename T2>
AddOp<T1,T2> operator+ (T1 a1, T2 a2)
{return (AddOp(a1, a2));}
■ このスレッドは過去ログ倉庫に格納されています