C++は難しすぎ 難易度:2at TECH
C++は難しすぎ 難易度:2 - 暇つぶし2ch649:デフォルトの名無しさん
06/05/25 13:51:00
>>648
普通のオーバーロードだとこれが動かない。
template <class T>
std::complex<T> operator+(std::complex<T> a1, std::complex<T> a2);

namespace std {
    template <class T>
    struct plus : public std::binary_function<T, T, T> {
        T operator()(const T &a1, const T &a2) const
        { return a1 + a2; }
    };
}

template <class T>
std::valarray<T> operator+(std::valarray<T> a1, std::valarray<T> a2);


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch