struct Foo { Foo &operator =(double const val); }; struct Bar : public Foo { }; int main(int const argc, char const *const argv[]) { Bar a; Foo b(a); b = 4.5; // No issue a = 4.5; // error C2679: binary '=' : no operator found which takes a right-hand // operand of type 'double' (or there is no acceptable conversion) return 0; }
a
Foo
Foo "="
Bar
Stack Overflow
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)