If I have these 2 constructors for MyClass:
MyClass(int n1);
MyClass(int n1, int n2);
and an overloaded (non-member) operator+:
MyClass operator+(MyClass m1, const MyClass& m2);
This enables me to write code like this:
MyClass m;
5 + m:
which I guess uses implicit cast through the defined constructor, correct?
Is there anyway to do this implicit cast with the constructor taking 2 arguments? With code looking something like this:
MyClass m;
{15, 8} + m:
?
Or maybe just do an explicit cast from {9, 4} to a MyClass-object?