Trigraphs not compiling with MS compiler?

157 views Asked by At

I have a C++14 project withe the Microsoft compiler in Visual Studio 2019 and I'm trying to understand Digraphs and Trigraphs, so my code is a bit weird:

#include "Trigraphs.h"

void Trigraphs::assert_graphs()
??<
    // How does this ever compile ????/
    ouch!
??>

Reading about the /Zc:trigraphs switch

Through C++14, trigraphs are supported as in C. The C++17 standard removes trigraphs from the C++ language.

I understand that trigraphs should be supported until C++14 because they were removed in C++17 only. Yet, the above code does not compile with C++14 settings until I add the additional command line switch. I am not a native English speaker, did I get something wrong about the sentence that trigraphs are supported until C++14?

1

There are 1 answers

0
Thomas Weller On BEST ANSWER

MSDN also says:

The /Zc:trigraphs option is off by default

and that seems to apply for C++14 already. Although that results in a non 100% conformant C++ compilation, most programmers will actually prefer not dealing with the strange symbols of C++ trigraphs.