We have a project that’s using many C++11 facilities, and we thought about this trick to make it compile on C++03.
#ifndef USE_CPP0X
# define override
#endif
As far as I know it’s forbidden to define C++ keywords, so is this legal?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It is somewhat frowned upon, but it’s certainly possible. A better and not so frowned upon variant is to define macros in all large letter, something like
Then remember to use
OVERRIDEinstead ofoverridewhere wanted.