I've found this in some C++_11 code:
L"DLGCTRL_"L#dialog_control_id
What is a "L#" here? There is no # operator or concatenation so. Yes, there is nothing between the " and the L. How can be this allowed?
I get the error:
error C3688: invalid literal suffix 'L'; literal operator or literal operator template 'operator ""L' not found
I have Visual Studio 2015 and 2017 on Windows 10. It compiles normally on C++98 or 00
I assume this occurs inside a preprocessor macro otherwise the question makes no sense at all, e.g.:
#define X(dialog_control_id) L"DLGCTRL_"L#dialog_control_id
where it is intended that X(foo) expands to L"DLGCTRL_foo".
The code should be:
#define X(dialog_control_id) L"DLGCTRL_" #dialog_control_id
There are several problems in the original code:
L# is not allowed in ISO C++, it is an extension of the Microsoft preprocessor to produce a wide string literal.L was never necessary anyway, because a wide string literal can be concatenated with a narrow string literal (producing a wide string literal)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With