I have a basic #pragma message warning
#pragma message(__FILE__ "(" _CRT_STRINGIZE(__LINE__) ") : warning : T does not have an << operator.")
This is inside a Sfinae controlled overload testing for the presence of a << operator. This warning works and gets printed to the output window and added to the Error List in VS2019.
However it is missing the extra info that "native" warnings and errors give:
[ with T = int ]
And the extra stack/instantiation trace, allowing you to work out exactly which function call is causing the issue.
Is there a way to have my warning also display this extra useful info, as it stands my warning is unable to even tell the user what type triggered the warning, let alone which section of code/method call is causing the warning.
__PRETTY_FUNCTION__
for example does not work in #pragma message as it is a const char[] and #pragma message requires a constant string i.e. "bla bla".