cpdocs-cxx-standards API documentation
Project documentation Docs

File: src/standard_demo.cpp

1// --------------------------------------------------------------------------------------------------2// SPDX-License-Identifier: Apache-2.03// SPDX-FileCopyrightText: 2026 cpdocs developers4// --------------------------------------------------------------------------------------------------5#include "demo/standard_demo.hpp"6 7namespace demo {8 9int always() { return 17; }10int convert(int value) { return value; }11 12#if __cplusplus < 202002L13int legacy_only() { return 17; }14#endif15 16#if __cplusplus >= 202002L17int cxx20_only() { return 20; }18int convert(double value) { return static_cast<int>(value); }19#endif20 21#if __cplusplus >= 202302L22int cxx23_only() { return 23; }23int convert(long double value) { return static_cast<int>(value); }24#endif25 26} // namespace demo