skip to content
Ivan's wiki
Site Tools
Search
Tools
Show pagesource
Backlinks
Recent Changes
Media Manager
Sitemap
>
Recent Changes
Media Manager
Sitemap
hpp-version
This page is read only. You can view the source, but not change it.
# <version> **[<version>](https://en.cppreference.com/w/cpp/header/version)** provides `__cpp_*` feature-test macros (C++20) that tell you which C++ features are available in your compiler and standard library. For example, `__cpp_concepts` is defined if C++20 concepts are supported. Use these in preprocessor conditionals to enable features selectively. This example uses feature-test macros to conditionally report whether C++20 concepts and ranges are supported by the compiler. ```cpp // compile: g++ -std=c++20 -o versionexample versionexample.cpp // run: ./versionexample // description: check for C++ features #include <version> #include <iostream> int main() { #ifdef __cpp_concepts std::cout << "concepts supported\n"; #endif #ifdef __cpp_ranges std::cout << "ranges supported\n"; #endif return 0; } ```
Page Tools
Show pagesource
Backlinks
Back to top