Страница 1 из 1

Не могу побороть амбигус

Добавлено: 24 ноя 2015, 16:26
Сионист
Есть потомок

Код: Выделить всё

std: :o fstream
, f - экземпляр этого потомка. Ругается на строку

Код: Выделить всё

f<<std::boolalpha;
, пишет
D:\Projects\cpp\MCSP\MCSP\WinMain.cpp|19|error: ambiguous overload for 'operator<<' (operand types are 'TUTF8FileStream' and 'std::ios_base&(std::ios_base&)')
. При

Код: Выделить всё

MyStream & MyStream: :o perator << (const std::ios_base Base)
{
 (*((std: :o fstream*)this))<<Base;
 return *this;
}
и при

Код: Выделить всё

MyStream & MyStream: :o perator << (const std::ios_base &Base)
{
 (*((std: :o fstream*)this))<<Base;
 return *this;
}
ругается на строку

Код: Выделить всё

(*((std: :o fstream*)this))<<Base;
, пишет
156|error: cannot bind 'std::basic_ostream<char>' lvalue to 'std::basic_ostream<char>&&'|