Printing Compiler Flags used for C++

There isn’t a built-in way to have C++ tell what compiler flags were used to compile a library or executable. Fortran has intrinsic function compiler_options that can be used to print the compiler options used to compile a Fortran program. This example C++ program demonstrates how to print the compiler flags used to compile the C++ program or library itself