// Compiled by Visual Studio 2012
struct A
{
bool operator ==(const A& other) const
{
for (decltype(this->n) i = 0; i < n; ++i) // OK
{}
return true;
}
protected
decltypeの結果をC++ 11で比較する方法はありますか?つまり は、なぜこのコードは無効です: template<typename T, typename U>
void func(T& t, U& u) {
if(decltype(t) == decltype(u)) {
// Some optimised version for this case
}