【初心者歓迎】C/C++室 Ver.5【環境依存OK】
■ このスレッドは過去ログ倉庫に格納されています
0488デフォルトの名無しさん
NGNG>>485
using declaration を使う場合ってどうなるんでしょうか。
#include <functional>
template <typename T>
// 1 - gcc 3.3.1 ok / BCC 5.5.1 ok
struct foo: public std::unary_function<T, bool> {
typedef typename std::unary_function<T, bool>::result_type result_type;
typedef typename std::unary_function<T, bool>::argument_type argument_type;
result_type f;
result_type operator()(const argument_type & arg) { return f; }
};
// 2 - gcc 3.3.1 ok / BCC 5.5.1 error
template <typename T>
struct foo2: public std::unary_function<T, bool> {
typename foo2::result_type f;
typename foo2::result_type operator()(const typename foo2::argument_type & arg) { return f; }
};
// 3 - gcc 3.3.1 error / BCC 5.5.1 error
template <typename T>
struct foo3: public std::unary_function<T, bool> {
using typename std::unary_function<T, bool>::result_type;
using typename std::unary_function<T, bool>::argument_type;
result_type f;
result_type operator()(const argument_type & arg) { return f; }
};
■ このスレッドは過去ログ倉庫に格納されています