【C++】template 統合スレ -- STL/Boost/Loki, etc.
■ このスレッドは過去ログ倉庫に格納されています
0642デフォルトの名無しさん
NGNGいいのでしょうか?
コンパイルできるのですがワーニングが出ます。gcc3.2.1(MinGW)です。
template <typename T>
class A {
T value;
public:
A(double d = 0) {
value = d;
}
friend std::ostream& operator<<(std::ostream& os, const A<T>& a);
};
std::ostream& operator<<(std::ostream& os, const A<double>& a)
{
os << a.value;
return os;
}
int main()
{
A<double> a(1.23);
std::cout << a << std::endl;
}
■ このスレッドは過去ログ倉庫に格納されています