c++ - How does the priority of :: and (expr) matter? -
my c++ textbook says there's 18 priority classes operators in c++. topmost class contains 1 operator, "scope resolution" operator (double colon, ::
). "expression grouping" operator falls 2nd class, there's "function call" operator.
the priority ::
, name(arg)
(function call) seems clear me can think of a::b(c)
, should evaluated (a::b)(c)
. can't figure out when scope resolution operator , expression grouping operator can lead ambiguity if were in same priority class.
a * b + c * (b + c) // parentheses "expression grouping" operators
Comments
Post a Comment