Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Is it possible to write your own operators in c++ like and "AND" "OR" "NOT".
Posted

1 solution

You can provide AND, OR, and NOT operators for your own class: http://msdn.microsoft.com/en-us/library/5tk49fh2(v=VS.80).aspx[^] but you can't define new operators. You can't extend the language, which is what that would require. (Well, you could with careful use of #DEFINE but the result would not be intuitively obvious and might cause maintenance headaches later)
 
Share this answer
 
Comments
Filipe Marques 5-Mar-13 8:35am    
In CodeProect there is actually an article to teach "how to create" custom operators. http://www.codeproject.com/Articles/31783/Custom-User-Defined-Operators-in-C

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900