A
Anna
I have two data types in my program:
Foo1 and
FooTD (which is a typedef of type Foo2)
Foo1 has an operator= function which takes a const& to Foo2 as input
and assigns it to a Foo1 type.
The statement
Foo1 f = getFooTD();
where getFooTD() returns a Foo2 doesn't compile. I get the 'no
user-defined conversion exists' error.
However, the following works:
Foo1 f;
f = getFooTD();
There's probably something very obvious that I'm missing here. Anyone
knows why I get the error?
Thanks.
Foo1 and
FooTD (which is a typedef of type Foo2)
Foo1 has an operator= function which takes a const& to Foo2 as input
and assigns it to a Foo1 type.
The statement
Foo1 f = getFooTD();
where getFooTD() returns a Foo2 doesn't compile. I get the 'no
user-defined conversion exists' error.
However, the following works:
Foo1 f;
f = getFooTD();
There's probably something very obvious that I'm missing here. Anyone
knows why I get the error?
Thanks.