Skip to content

Commit a79eed9

Browse files
authored
Feature/c++23 (#76)
* Make separate branch for C++23 * Fix merge errors from develop * ci: update to clang-18 via pkgx This should resolve the build failure for updating to C++23. clang-17 didn't support std::expected, but clang-18 should. * ci: Fix checking twice on PRs and pushes * ci: Fix Travis and AppVeyor * ci: Fix clang on Travis-CI * ci: Don't double build PR pushes on Travis-CI
1 parent cc17bc1 commit a79eed9

21 files changed

+114
-42
lines changed

.github/workflows/asan.yml

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
- main
77
- develop
88
pull_request:
9+
branches:
10+
- develop
911
workflow_dispatch:
1012

1113
concurrency:

.github/workflows/clang-format-check.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
name: clang-format Check
2-
on: [push, pull_request]
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- develop
7+
pull_request:
8+
branches:
9+
- develop
310

411
jobs:
512
formatting-check:

.github/workflows/codeql-analysis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ on:
1717
- main
1818
- develop
1919
pull_request:
20+
branches:
21+
- develop
2022
schedule:
2123
- cron: '26 7 * * 0'
2224
workflow_dispatch:

.github/workflows/cpp-linter.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
name: cpp-linter
22

3-
on: [push, pull_request, workflow_dispatch]
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
pull_request:
9+
branches:
10+
- develop
11+
workflow_dispatch:
412

513
jobs:
614
cpp-linter:

.github/workflows/cppcheck.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
name: Cppcheck
22

3-
on: [push, pull_request, workflow_dispatch]
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
pull_request:
9+
branches:
10+
- develop
11+
workflow_dispatch:
412

513
concurrency:
614
group: ${{ github.workflow }}-${{ github.ref }}

.github/workflows/linux-clang.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
name: Linux Clang
22

3-
on: [push, pull_request, workflow_dispatch]
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
pull_request:
9+
branches:
10+
- develop
11+
workflow_dispatch:
412

513
concurrency:
614
group: ${{ github.workflow }}-${{ github.ref }}

.github/workflows/linux-gcc.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
name: Linux GCC
22

3-
on: [push, pull_request, workflow_dispatch]
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
pull_request:
9+
branches:
10+
- develop
11+
workflow_dispatch:
412

513
concurrency:
614
group: ${{ github.workflow }}-${{ github.ref }}

.github/workflows/lsan.yml

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
- main
77
- develop
88
pull_request:
9+
branches:
10+
- develop
911
workflow_dispatch:
1012

1113
concurrency:

.github/workflows/msan.yml

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
- main
77
- develop
88
pull_request:
9+
branches:
10+
- develop
911
workflow_dispatch:
1012

1113
concurrency:

.github/workflows/sonarcloud.yml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
- main
77
- develop
88
pull_request:
9+
types: [opened, synchronize, reopened]
910
workflow_dispatch:
1011

1112
concurrency:

.github/workflows/tsan.yml

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
- main
77
- develop
88
pull_request:
9+
branches:
10+
- develop
911
workflow_dispatch:
1012

1113
concurrency:

.github/workflows/valgrind.yml

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
- main
77
- develop
88
pull_request:
9+
branches:
10+
- develop
911
workflow_dispatch:
1012

1113
concurrency:

.github/workflows/whitespace.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
name: Whitespace
22

3-
on: [push, pull_request, workflow_dispatch]
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
pull_request:
9+
branches:
10+
- develop
11+
workflow_dispatch:
412

513
jobs:
614
whitespace:

.travis.yml

+15-5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ cache:
88
- $TRAVIS_BUILD_DIR/vcpkg
99
- $HOME/.cache/vcpkg/archives
1010

11+
# Don't double build branch PRs
12+
branches:
13+
except:
14+
- /^pr\..*/
15+
1116
addons:
1217
apt:
1318
update: true
@@ -21,21 +26,21 @@ addons:
2126
- yasm
2227
- gcc-12
2328
- g++-12
24-
- clang-15
2529
- ninja-build
2630
- cppcheck
2731
- doxygen
2832
- graphviz
2933
- lcov
3034
- valgrind
3135
- ccache
36+
- wget
3237

3338
os:
3439
- linux
3540

3641
compiler:
3742
- g++-12
38-
- clang-15
43+
- clang-19
3944

4045
jobs:
4146
fast_finish: true
@@ -141,9 +146,14 @@ before_install:
141146
fi
142147
- |
143148
if [[ "$CXX" == "clang++" ]]; then
144-
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-15 90
145-
sudo update-alternatives --config clang
146-
export CXX="clang++-15" CC="clang-15"
149+
wget https://apt.llvm.org/llvm.sh
150+
chmod +x llvm.sh
151+
sudo ./llvm.sh 19
152+
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-19 100
153+
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-19 100
154+
export CXX="clang++-19" CC="clang-19"
155+
clang --version
156+
clang++ --version
147157
fi
148158
149159
install:

CMakeLists.txt

+5-3
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ set(ENV{CGAL_DATA_DIR} CMAKE_BINARY_DIR/Data)
7373
# add_compile_options(/DNOMINMAX)
7474
#endif()
7575

76+
if (MSVC)
77+
# Add /utf-8 flag for MSVC
78+
add_compile_options(/utf-8)
79+
endif()
80+
7681
# Project vcpkg dependencies
7782

7883
# https://github.com/CGAL/cgal
@@ -109,9 +114,6 @@ find_package(spdlog CONFIG REQUIRED)
109114
# https://github.com/intel/tbb
110115
find_package(TBB CONFIG REQUIRED)
111116

112-
# https://github.com/TartanLlama/expected
113-
find_package(tl-expected CONFIG REQUIRED)
114-
115117
# https://github.com/TartanLlama/function_ref
116118
find_package(tl-function-ref CONFIG REQUIRED)
117119

CMakePresets.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"binaryDir": "${sourceDir}/build",
3636
"cacheVariables": {
3737
"CMAKE_CXX_EXTENSIONS": "OFF",
38-
"CMAKE_CXX_STANDARD": "20",
38+
"CMAKE_CXX_STANDARD": "23",
3939
"CMAKE_CXX_STANDARD_REQUIRED": "ON"
4040
}
4141
},

cmake/StandardProjectSettings.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ endif()
3939
set(BOOST_MIN_VERSION "1.75.0")
4040

4141
# Use C++20
42-
set(CMAKE_CXX_STANDARD 20)
42+
set(CMAKE_CXX_STANDARD 23)
4343
set(CMAKE_CXX_STANDARD_REQUIRED ON)
4444
set(CMAKE_CXX_EXTENSIONS OFF)
4545

include/Apply_move.hpp

+12-12
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,27 @@
1313

1414
#include <spdlog/spdlog.h>
1515

16+
#include <expected>
1617
#include <string>
17-
#include <tl/expected.hpp>
1818
#include <tl/function_ref.hpp>
1919

20-
/// @brief An applicative function similar to std::apply, but on manifolds
21-
/// @tparam ManifoldType The type (topology, dimensionality) of manifold
22-
/// @tparam ExpectedType The result of the move on the manifold
23-
/// @tparam FunctionType The type of move applied to the manifold
24-
/// @param t_manifold The manifold on which to make the Pachner move
25-
/// @param t_move The Pachner move
26-
/// @returns The expected or unexpected result in a tl::expected<T,E>
27-
/// @see https://tl.tartanllama.xyz/en/latest/api/function_ref.html
28-
/// @see https://tl.tartanllama.xyz/en/latest/api/expected.html
20+
/**
21+
* \brief An applicative function similar to std::apply on a manifold
22+
* \tparam ManifoldType The type (topology, dimensionality) of manifold
23+
* \tparam ExpectedType The result type of the move on the manifold
24+
* \tparam FunctionType The type of move applied to the manifold
25+
* \param t_manifold The manifold on which to make the Pachner move
26+
* \param t_move The Pachner move
27+
* \return The expected or unexpected result in a std::expected<T,E>
28+
*/
2929
template <typename ManifoldType,
30-
typename ExpectedType = tl::expected<ManifoldType, std::string>,
30+
typename ExpectedType = std::expected<ManifoldType, std::string>,
3131
typename FunctionType = tl::function_ref<ExpectedType(ManifoldType&)>>
3232
auto constexpr apply_move(ManifoldType&& t_manifold,
3333
FunctionType t_move) noexcept -> decltype(auto)
3434
{
3535
if (auto result = std::invoke(t_move, std::forward<ManifoldType>(t_manifold));
36-
result)
36+
result.has_value())
3737
{
3838
return result;
3939
}

0 commit comments

Comments
 (0)