Note: Clause [expr] defines the syntax, order of evaluation, and meaning of expressions.62
The precedence of operators is not directly specified, but it can be derived from the syntax.
So, I wonder how to conclude the precedence of these operators according to the International standard?(ignore the cppreference and assume we only have the international standard guide)
#include <iostream>
struct A{
A(){}
A& operator+(int index){
return *this;
}
};
struct B{
friend B const& operator << (B const& b,A const&){
printf("1\n");
return b;
}
};
int main(){
B{} << A{} + 1;
}