spy v2.0.0
Denise Bloch
 
Loading...
Searching...
No Matches

◆ cpp_standard

constexpr _::cpp_standard_t< 0 > spy::cpp_standard {}
inlineconstexpr

C++ standard version reporting value.

The spy::current_standard object can be compared to any other current_standard related value to verify if the code being compiled with a specific version of the C++ standard.

Example

#include <spy/spy.hpp>
#include <iostream>
int main()
{
std::cout << "This code compiled with " << spy::cpp_standard << ".\n";
// Version checks
using namespace spy::literal;
if constexpr(spy::cpp_standard == 20_cpp) std::cout << "This code compiled with C++ 20.\n";
if constexpr(spy::cpp_standard == 20) std::cout << "This code compiled with C++ 20.\n";
if constexpr(spy::cpp_standard >= 17_cpp)
std::cout << "This code compiled with C++ 17 or ulterior.\n";
if constexpr(spy::cpp_standard >= 17)
std::cout << "This code compiled with C++ 17 or ulterior.\n";
}
constexpr _::cpp_standard_t< 0 > cpp_standard
C++ standard version reporting value.
Definition standard.hpp:75