Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • otb otb
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 204
    • Issues 204
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 11
    • Merge requests 11
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Main Repositories
  • otbotb
  • Merge requests
  • !799

Switch to c++17

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Julien Osman requested to merge cpp17 into develop Feb 23, 2021
  • Overview 9
  • Commits 11
  • Pipelines 18
  • Changes 9

Summary

Upgrade to the C++ 2017 standard

Rationale

OTB is currently compiled with c++14. Now that the c++17 standard is well implemented by the compilers, we could upgrad to c++17. This would come with a lot of advantages:

  • There are a lot of TODOs in the code telling that when we switch to c++17 we will be able to simplify that part of code.
  • The new std::clamp is useful (and could simplify !797 (merged)).
  • We will be able to remove the homemade emulation of the string_view, and use the standard one.
  • A bunch of new algorithms and mathematical functions.
  • Some new features concerning the templates
  • The new if constexpr will be handful to simplify the code.
  • Many other goodies.

This update means we drop support for older compilers (like VisualC++14).

Implementation Details

Modify CMAKE_CXX_STANDARD to 17 in main CMakeFiles.txt.

Remove the REGISTER keyword from 6S code.

Copyright

The copyright owner is CNES and has signed the ORFEO ToolBox Contributor License Agreement.


Check before merging:

  • All discussions are resolved
  • At least 2 👍 votes from core developers, no 👎 vote.
  • The feature branch is (reasonably) up-to-date with the base branch
  • Dashboard is green
  • Copyright owner has signed the ORFEO ToolBox Contributor License Agreement
  • Optionally, run git diff develop... -U0 --no-color | clang-format-diff.py -p1 -i on latest changes and commit
Edited Feb 23, 2021 by Julien Osman
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: cpp17