问题
I know about Macro's Stringizing operator (#
) and I recently learned about the (##
) Concatenation operator: Preprocessor Stringizing Operator with String Literal Prefixes
Are there any other macro operators that are available to me?
I know that Boost has a pretty extensive suite that they've put together, however for the purposes of this question I'm just asking about Macro operator support defined by the standard.
回答1:
As is mentioned by Cyber's comment the Sringizing ( #
) and Concatenation Operators ( ##
) are the only macro operators defined in C++: Macro Operator List
This link also illiterates the list of predefined macros that the standard defines. Which are also available for use in macros, though they're not actually operators.
If you're not into cross platform compatibility it may also be worth noting that Visual C++ provides one non-standard operator, the Charizing Operator ( #@
): https://msdn.microsoft.com/en-us/library/91tt6dfs.aspx
来源:https://stackoverflow.com/questions/30031175/macro-operator-list