[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 112
  • Last Modified:

28. Could we change operations priority while overloading?

Could we change operations priority while overloading?
0
Nusrat Nuriyev
Asked:
Nusrat Nuriyev
  • 2
  • 2
2 Solutions
 
jkrCommented:
I am not quite sure what you mean here. Could you explain a bit more?
0
 
phoffricCommented:
Are you talking about operator precedence? If so, then the answer is no. Overload as you wish, but the precedence of the operator is fixed in C++.
0
 
phoffricCommented:
I should have added that when two operators have the same precedence, then their associativity rules come into play, and that you cannot change those rules as well. (You know that to change the associativity, you use parenthesis.)
0
 
Nusrat NuriyevAuthor Commented:
operators has priorities, can we change them at overloading?
0
 
jkrCommented:
No, operator precedence is - as phoffric wrote above - 'carved in stone', See e.g. http://en.cppreference.com/w/cpp/language/operator_precedence 

Operator precedence is unaffected by operator overloading.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now