C++14/C++1y
■ このスレッドは過去ログ倉庫に格納されています
0735デフォルトの名無しさん
2014/03/24(月) 22:27:29.45ID:uHELE/QG#include "stdafx.h"
template <class T>
struct double_trait {
typedef T type;
};
template <class T>
using dtype=typename double_trait<T>::type;
template <class T>
std::complex<T> operator + (dtype<T> c, const std::complex<T>& z) //�@
{
return c+z;
}
int main()
{
using namespace std;
complex<double> z(0,1);
char c=-1;
cout<<c+z<<endl;
cin.get();
return 0;
}
■ このスレッドは過去ログ倉庫に格納されています