On 06.11.2016 07:08, Shiyao Ma wrote:
> Overloading operator without at least a single param of enum [or] class
> type is forbidden, but where in the standard says so?
C++11 §13.5/6 (over.oper/6): “An operator function shall either be a
non-static member function or be a non-member function and have at least
one parameter whose type is a class, a reference to a class, an
enumeration, or a reference to an enumeration”
> Put in to other words, defining `int operator(char, int)' violates
> what rule in the standard?
>
> I need someone to refer to me the exact paragraph in the standard.
You'll get more familiar with it over time.
But it is one heck of an inaccessible document. ;-)
Cheers & hth.,
- Alf