Skip to content

Commit 45c17bb

Browse files
committed
Upgrade language level to C++20
1 parent 65b568f commit 45c17bb

File tree

22 files changed

+39
-38
lines changed

22 files changed

+39
-38
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ geometry for path-based OpenSim components (e.g., `Muscle`, `PathSpring`, etc.).
3434
performance and stability in wrapping solutions.
3535
- Implemented `generateDecorations()` for `Station` to allow visualization in the Simbody visualizer. (#4169)
3636
- Added `Component::removeComponent` and `Component::extractComponent` methods, which enable removing subcomponents that were previously added via `Component::addComponent` or the `<components>` XML element (#4174).
37-
37+
- Updated required language level to C++20. (#3929)
3838

3939
v4.5.2
4040
======

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -608,10 +608,10 @@ if (NOT OPENSIM_PYTHON_CONDA)
608608
include(InstallRequiredSystemLibraries)
609609
endif()
610610

611-
# C++17
611+
# C++20
612612
# -----
613-
set(CMAKE_CXX_STANDARD 17)
614-
# Using C++17 is not optional.
613+
set(CMAKE_CXX_STANDARD 20)
614+
# Using C++20 is not optional.
615615
set(CMAKE_CXX_STANDARD_REQUIRED ON)
616616

617617

OpenSim/Common/Object.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1676,7 +1676,7 @@ std::string Object::dump() const {
16761676
updateXMLNode(elem);
16771677
Object::setSerializeAllDefaults(false);
16781678
doc.getRootElement().node_begin()->writeToString(outString);
1679-
return std::move(outString);
1679+
return outString;
16801680
}
16811681

16821682

OpenSim/Common/Reporter.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,8 @@ class ConsoleReporter_ : public Reporter<T> {
331331
const auto& nSigFigs = chan->getOutput().getNumberOfSignificantDigits();
332332
// Print `value` right-justified in a column with width `_width`,
333333
// using `nSigFigs`: {:>{_width}.{nSigFigs}g}
334-
msg += fmt::format("{:>{}.{}g}| ", value, _width, nSigFigs);
334+
msg += fmt::format(fmt::runtime("{:>{}.{}g}| "), value, _width,
335+
nSigFigs);
335336
}
336337
log_cout(msg);
337338

OpenSim/Examples/BuildDynamicWalker/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
cmake_minimum_required(VERSION 3.2)
44
project(BuildDynamicWalker)
55

6-
# OpenSim requires a compiler that supports C++17.
7-
set(CMAKE_CXX_STANDARD 17)
6+
# OpenSim requires a compiler that supports C++20.
7+
set(CMAKE_CXX_STANDARD 20)
88
set(CMAKE_CXX_STANDARD_REQUIRED ON)
99

1010
# Find the OpenSim libraries and header files.

OpenSim/Examples/ControllerExample/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ cmake_minimum_required(VERSION 3.2)
66
# ---------
77
set(TARGET exampleController CACHE TYPE STRING)
88

9-
# OpenSim uses C++17 language features.
10-
set(CMAKE_CXX_STANDARD 17)
9+
# OpenSim uses C++20 language features.
10+
set(CMAKE_CXX_STANDARD 20)
1111
set(CMAKE_CXX_STANDARD_REQUIRED ON)
1212

1313
# Find and hook up to OpenSim.

OpenSim/Examples/CustomActuatorExample/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ cmake_minimum_required(VERSION 3.2)
66
# ---------
77
set(TARGET exampleCustomActuator CACHE TYPE STRING)
88

9-
# OpenSim uses C++17 language features.
10-
set(CMAKE_CXX_STANDARD 17)
9+
# OpenSim uses C++20 language features.
10+
set(CMAKE_CXX_STANDARD 20)
1111
set(CMAKE_CXX_STANDARD_REQUIRED ON)
1212

1313
# Find and hook up to OpenSim.

OpenSim/Examples/ExampleCMakeListsToInstall.txt.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.2)
22
project(OpenSim_@_example_name@)
33

4-
set(CMAKE_CXX_STANDARD 17)
4+
set(CMAKE_CXX_STANDARD 20)
55

66
find_package(OpenSim REQUIRED HINTS
77
"${CMAKE_SOURCE_DIR}/@_opensim_install_hint@")

OpenSim/Examples/ExampleLuxoMuscle/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ cmake_minimum_required(VERSION 3.2)
66
# ---------
77
set(TARGET exampleLuxoMuscle CACHE TYPE STRING)
88

9-
# OpenSim uses C++17 language features.
10-
set(CMAKE_CXX_STANDARD 17)
9+
# OpenSim uses C++20 language features.
10+
set(CMAKE_CXX_STANDARD 20)
1111
set(CMAKE_CXX_STANDARD_REQUIRED ON)
1212

1313
# Find and hook up to OpenSim.

OpenSim/Examples/ExampleMain/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ cmake_minimum_required(VERSION 3.2)
66
# ---------
77
set(TARGET exampleMain CACHE TYPE STRING)
88

9-
# OpenSim uses C++17 language features.
10-
set(CMAKE_CXX_STANDARD 17)
9+
# OpenSim uses C++20 language features.
10+
set(CMAKE_CXX_STANDARD 20)
1111
set(CMAKE_CXX_STANDARD_REQUIRED ON)
1212

1313
# Find and hook up to OpenSim.

0 commit comments

Comments
 (0)