cpdocs-cxx-standards API documentation
Project documentation Docs

File: include/demo/standard_demo.hpp

1// --------------------------------------------------------------------------------------------------2// SPDX-License-Identifier: Apache-2.03// SPDX-FileCopyrightText: 2026 cpdocs developers4// --------------------------------------------------------------------------------------------------5#pragma once6 7/// An API whose available declarations change with the configured C++ standard.8namespace demo {9 10/// Available in C++17, C++20, and C++23.11int always();12 13/// The integer overload is available in all configured C++ standards.14int convert(int value);15 16#if __cplusplus < 202002L17/// Available only in C++17; removed from the public API in C++20.18int legacy_only();19#endif20 21#if __cplusplus >= 202002L22/// Introduced in C++20, also available in C++23.23int cxx20_only();24 25/// The double overload is available from C++20 onward.26int convert(double value);27#endif28 29#if __cplusplus >= 202302L30/// Introduced in C++23; absent from the C++17 and C++20 manifests.31int cxx23_only();32 33/// The long double overload is available in C++23.34int convert(long double value);35#endif36 37} // namespace demo