Skip to content

Allow newer C++ standards and fix missing headers #462

@yushill

Description

@yushill

Describe the current behavior

The CMake configuration strictly enforces C++11 with CMAKE_CXX_STANDARD and CMAKE_CXX_STANDARD_REQUIRED TRUE.
Some source files rely on transitive includes (e.g. for <cmath> or <functional>), which may not be available with newer standard library versions.
A test also includes <numbers>, which is only available in C++20, causing issues when compiling with older standards.

Describe the expected behavior

  • Allow newer C++ standards by unsetting CMAKE_CXX_STANDARD and CMAKE_CXX_STANDARD_REQUIRED
  • Add explicit includes for <cmath> and <functional> where needed.
  • Fix conditional inclusion of <numbers> to ensure compatibility with C++17 builds.

Describe the motivation

Improving compatibility with modern compilers and environments (e.g. C++17 or later).
Also prevents build errors caused by missing headers or incompatible standard versions.

Extra Information

Modification proposal:
main...yushill:powsybl-iidm4cpp:main

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions