Skip to content

Commit 173633f

Browse files
committed
Merge expected-over-references: conformant std::expected implementation
Complete beman::expected implementation with all conformance fixes: - expected<T,E> primary template - expected<void,E> specialization - unexpected<E>, bad_expected_access<E> - Monadic operations (and_then, or_else, transform, transform_error) - Trivial special member functions - Hardened preconditions (BEMAN_EXPECTED_HARDENED) - 253 tests passing
2 parents bb6f7ca + 7d56a62 commit 173633f

74 files changed

Lines changed: 20250 additions & 270 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.copier-answers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ maintainer: steve-downey
66
minimum_cpp_build_version: '20'
77
paper: PnnnnRr
88
project_name: expected
9-
unit_test_library: gtest
9+
unit_test_library: catch2
1010
# Hidden variables manually tracked because 'when: false' omits them from _copier_answers
1111
generating_exemplar: false
1212
owner: "bemanproject"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@
2121
/.update-submodules
2222
/uv.lock
2323
.build
24+
/.claude/

CMakeLists.txt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,14 @@ beman_install_library(beman.expected TARGETS beman.expected)
8282
configure_build_telemetry()
8383

8484
if(BEMAN_EXPECTED_BUILD_TESTS)
85-
find_package(GTest CONFIG REQUIRED)
86-
endif()
87-
88-
if(BEMAN_EXPECTED_BUILD_TESTS)
89-
find_package(GTest CONFIG REQUIRED)
85+
find_package(Catch2 CONFIG REQUIRED)
86+
# When Catch2 is fetched via FetchContent, its extras dir needs to be on the module path.
87+
# FetchContent_GetProperties reads global state set during fetch, so works from any scope.
88+
include(FetchContent)
89+
FetchContent_GetProperties(catch2)
90+
if(catch2_POPULATED AND catch2_SOURCE_DIR)
91+
list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras)
92+
endif()
9093
endif()
9194

9295
if(BEMAN_EXPECTED_BUILD_TESTS)

cmake/gcc-flags.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
include_guard(GLOBAL)
22

3-
set(CMAKE_CXX_STANDARD 20)
3+
set(CMAKE_CXX_STANDARD 26)
44

5-
set(CMAKE_CXX_FLAGS "-Wall -Wextra -std=gnu++20" CACHE STRING "CXX_FLAGS" FORCE)
5+
set(CMAKE_CXX_FLAGS "-Wall -Wextra -std=gnu++26" CACHE STRING "CXX_FLAGS" FORCE)
66

77
set(CMAKE_CXX_FLAGS_DEBUG
88
"-O0 -fno-inline -g3"

0 commit comments

Comments
 (0)