Skip to content

Commit 51bb4c6

Browse files
authored
Merge pull request #102 from steve-downey/remove-26
Rename Optional26 to Optional
2 parents 8db85ce + fa78a64 commit 51bb4c6

37 files changed

+1739
-1743
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
- name: Install
112112
run: |
113113
set -x
114-
cmake --install .build --config RelWithDebInfo --component beman_optional26_development --verbose
114+
cmake --install .build --config RelWithDebInfo --component beman_optional_development --verbose
115115
- name: CMake Gcov Build
116116
if: matrix.config.coverage
117117
run: |

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
cff-version: 1.0.0
22
message: "If you use this software, please cite it as below."
3-
title: "beman.optional26"
4-
url: "https://github.com/bemanproject/optional26"
3+
title: "beman.optional"
4+
url: "https://github.com/bemanproject/optional"

CMakeLists.txt

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
cmake_minimum_required(VERSION 3.27)
66

7-
project(beman_optional26 VERSION 0.0.0 LANGUAGES CXX)
7+
project(beman_optional VERSION 0.0.0 LANGUAGES CXX)
88

99
# Includes
1010
include(CTest)
@@ -13,13 +13,13 @@ include(FetchContent)
1313
set(TARGETS_EXPORT_NAME ${CMAKE_PROJECT_NAME}Targets)
1414

1515
option(
16-
OPTIONAL26_ENABLE_TESTING
16+
OPTIONAL_ENABLE_TESTING
1717
"Enable building tests and test infrastructure"
1818
${PROJECT_IS_TOP_LEVEL}
1919
)
2020

21-
# Build the tests if enabled via the option OPTIONAL26_ENABLE_TESTING
22-
if(OPTIONAL26_ENABLE_TESTING)
21+
# Build the tests if enabled via the option OPTIONAL_ENABLE_TESTING
22+
if(OPTIONAL_ENABLE_TESTING)
2323
# Fetch GoogleTest
2424
FetchContent_Declare(
2525
googletest
@@ -33,29 +33,26 @@ endif()
3333

3434
set(CMAKE_VERIFY_INTERFACE_HEADER_SETS ON)
3535

36-
# Create the library target and named header set for beman_optional26
37-
add_library(beman_optional26 INTERFACE)
36+
# Create the library target and named header set for beman_optional
37+
add_library(beman_optional INTERFACE)
3838
target_sources(
39-
beman_optional26
40-
PUBLIC FILE_SET beman_optional26_headers TYPE HEADERS BASE_DIRS include
39+
beman_optional
40+
PUBLIC FILE_SET beman_optional_headers TYPE HEADERS BASE_DIRS include
4141
)
4242

43-
if(OPTIONAL26_ENABLE_TESTING)
44-
# Create the library target and named header set for testing beman_optional26
43+
if(OPTIONAL_ENABLE_TESTING)
44+
# Create the library target and named header set for testing beman_optional
4545
# and mark the set private
46-
add_executable(beman_optional26_test)
46+
add_executable(beman_optional_test)
4747
target_sources(
48-
beman_optional26_test
49-
PRIVATE
50-
FILE_SET beman_optional26_test_headers
51-
TYPE HEADERS
52-
BASE_DIRS src
48+
beman_optional_test
49+
PRIVATE FILE_SET beman_optional_test_headers TYPE HEADERS BASE_DIRS src
5350
)
5451

55-
add_subdirectory(src/beman/optional26/tests)
52+
add_subdirectory(src/beman/optional/tests)
5653
endif()
5754

58-
add_subdirectory(include/beman/optional26)
55+
add_subdirectory(include/beman/optional)
5956

6057
add_subdirectory(examples)
6158

@@ -65,17 +62,17 @@ include(CMakePackageConfigHelpers)
6562
set(cmakeModulesDir cmake/beman)
6663
configure_package_config_file(
6764
cmake/Config.cmake.in
68-
BemanOptional26Config.cmake
69-
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/beman/optional26/
65+
BemanOptionalConfig.cmake
66+
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/beman/optional/
7067
PATH_VARS cmakeModulesDir
7168
NO_SET_AND_CHECK_MACRO
7269
NO_CHECK_REQUIRED_COMPONENTS_MACRO
7370
)
7471

7572
install(
76-
FILES ${CMAKE_CURRENT_BINARY_DIR}/BemanOptional26Config.cmake
77-
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/beman/optional26/
78-
COMPONENT beman_optional26_development
73+
FILES ${CMAKE_CURRENT_BINARY_DIR}/BemanOptionalConfig.cmake
74+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/beman/optional/
75+
COMPONENT beman_optional_development
7976
)
8077

8178
# Coverage

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ compile: $(_build_path)/CMakeCache.txt ## Compile the project
6565
cmake --build $(_build_path) --config $(CONFIG) --target all -- -k 0
6666

6767
install: $(_build_path)/CMakeCache.txt compile ## Install the project
68-
cmake --install $(_build_path) --config $(CONFIG) --component beman_optional26_development --verbose
68+
cmake --install $(_build_path) --config $(CONFIG) --component beman_optional_development --verbose
6969

7070
ctest: $(_build_path)/CMakeCache.txt ## Run CTest on current build
7171
cd $(_build_path) && ctest --output-on-failure -C $(CONFIG)

README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# beman.optional26: C++26 Extensions for std::optional
1+
# beman.optional: C++26 Extensions for std::optional
22

33
<!--
44
SPDX-License-Identifier: 2.0 license with LLVM exceptions
55
-->
66

77
<!-- markdownlint-disable -->
8-
<img src="https://github.com/bemanproject/beman/blob/main/images/logos/beman_logo-beman_library_production_ready_api_may_undergo_changes.png" style="width:5%; height:auto;"> ![CI Tests](https://github.com/bemanproject/optional26/actions/workflows/ci.yml/badge.svg) [![Coverage](https://coveralls.io/repos/github/bemanproject/optional26/badge.svg?branch=main)](https://coveralls.io/github/bemanproject/optional26?branch=main)
8+
<img src="https://github.com/bemanproject/beman/blob/main/images/logos/beman_logo-beman_library_production_ready_api_may_undergo_changes.png" style="width:5%; height:auto;"> ![CI Tests](https://github.com/bemanproject/optional/actions/workflows/ci.yml/badge.svg) [![Coverage](https://coveralls.io/repos/github/bemanproject/optional/badge.svg?branch=main)](https://coveralls.io/github/bemanproject/optional?branch=main)
99
<!-- markdownlint-enable -->
1010

11-
This repository implements `std::optional` extensions targeting C++26. The `beman.optional26` library aims to evaluate
11+
This repository implements `std::optional` extensions targeting C++26. The `beman.optional` library aims to evaluate
1212
the stability, the usability, and the performance of these proposed changes before they are officially adopted by WG21
1313
into the C++ Working Draft. Additionally, it allows developers to use these new features before they are implemented in
1414
major standard library compilers.
@@ -44,18 +44,18 @@ Full runable examples can be found in `examples/` - please check [./examples/REA
4444
The next code snippet shows optional range support added in [Give *std::optional* Range Support(P3168R2)](https://wg21.link/P3168R2):
4545

4646
```cpp
47-
#include <beman/optional26/optional.hpp>
47+
#include <beman/optional/optional.hpp>
4848
...
4949

5050
// Example from P3168R2: basic range loop over C++26 optional.
5151

52-
beman::optional26::optional<int> empty_opt{};
52+
beman::optional::optional<int> empty_opt{};
5353
for ([[maybe_unused]] const auto& i : empty_opt) {
5454
// Should not see this in console.
5555
std::cout << "\"for each loop\" over C++26 optional: empty_opt\n";
5656
}
5757

58-
beman::optional26::optional<int> opt{26};
58+
beman::optional::optional<int> opt{26};
5959
for (const auto& i : opt) {
6060
// Should see this in console.
6161
std::cout << "\"for each loop\" over C++26 optional: opt = " << i << "\n";
@@ -71,13 +71,13 @@ The next code snippet shows optional reference support added in [`std::optional<
7171
(P2988R5)](https://wg21.link/P2988R5):
7272

7373
```cpp
74-
#include <beman/optional26/optional.hpp>
74+
#include <beman/optional/optional.hpp>
7575
...
7676

7777
{
7878
// Empty optional example.
7979
std::optional<int> std_empty_opt;
80-
beman::optional26::optional<int> beman_empty_opt;
80+
beman::optional::optional<int> beman_empty_opt;
8181
assert(!std_empty_opt.has_value() &&
8282
!beman_empty_opt.has_value()); // or assert(!std_empty_opt && !beman_empty_opt);
8383
std::cout << "std_vs_beman: .has_value() matches?: "
@@ -87,7 +87,7 @@ The next code snippet shows optional reference support added in [`std::optional<
8787
{
8888
// Optional with value example.
8989
std::optional<int> std_opt = 26;
90-
beman::optional26::optional<int> beman_opt = 26;
90+
beman::optional::optional<int> beman_opt = 26;
9191
assert(std_opt.has_value() && beman_opt.has_value()); // or assert(std_opt && beman_opt);
9292
assert(std_opt.value() == beman_opt.value()); // or assert(*std_opt == *beman_opt);
9393
std::cout << "std_vs_beman: .value() matches?: " << (std_opt.value() == beman_opt.value() ? "yes" : "no")
@@ -135,7 +135,7 @@ Full set of supported toolchains can be found in [.github/workflows/ci.yml](.git
135135
#### Preset CMake Flows
136136

137137
This project strives to be as normal and simple a CMake project as possible. This build workflow in particular will
138-
work, producing a static `beman_optional26` library, ready to package:
138+
work, producing a static `beman_optional` library, ready to package:
139139

140140
```shell
141141
# List available preset configurations:
@@ -185,14 +185,14 @@ This should build and run the tests with GCC 14 with the address and undefined b
185185
CI current build and test flows:
186186

187187
```shell
188-
# Configure build: default build production code + tests (OPTIONAL26_ENABLE_TESTING=ON by default).
188+
# Configure build: default build production code + tests (OPTIONAL_ENABLE_TESTING=ON by default).
189189
$ cmake -G "Ninja Multi-Config" \
190190
-DCMAKE_CONFIGURATION_TYPES="RelWithDebInfo;Asan" \
191191
-DCMAKE_TOOLCHAIN_FILE=etc/clang-19-toolchain.cmake \
192192
-B .build -S .
193193
-- The CXX compiler identification is Clang 19.0.0
194194
...
195-
-- Build files have been written to: /path/to/optional26/.build
195+
-- Build files have been written to: /path/to/optional/.build
196196

197197
# Build.
198198
$ cmake --build .build --config Asan --target all -- -k 0
@@ -201,8 +201,8 @@ $ cmake --build .build --config Asan --target all -- -k 0
201201

202202
# Run tests.
203203
$ ctest --build-config Asan --output-on-failure --test-dir .build
204-
Internal ctest changing into directory: /path/to/optional26/.build
205-
Test project /path/to/optional26/.build
204+
Internal ctest changing into directory: /path/to/optional/.build
205+
Test project /path/to/optional/.build
206206
...
207207
100% tests passed, 0 tests failed out of 82
208208

@@ -211,18 +211,18 @@ Total Test time (real) = 0.67 sec
211211

212212
##### Build Production, but Skip Tests
213213

214-
By default, we build and run tests. You can provide `-DOPTIONAL26_ENABLE_TESTING=OFF` and completely disable building tests:
214+
By default, we build and run tests. You can provide `-DOPTIONAL_ENABLE_TESTING=OFF` and completely disable building tests:
215215

216216
```shell
217-
# Configure build: build production code, skip tests (OPTIONAL26_ENABLE_TESTING=OFF).
217+
# Configure build: build production code, skip tests (OPTIONAL_ENABLE_TESTING=OFF).
218218
$ cmake -G "Ninja Multi-Config" \
219219
-DCMAKE_CONFIGURATION_TYPES="RelWithDebInfo;Asan" \
220220
-DCMAKE_TOOLCHAIN_FILE=etc/clang-19-toolchain.cmake \
221-
-DOPTIONAL26_ENABLE_TESTING=OFF \
221+
-DOPTIONAL_ENABLE_TESTING=OFF \
222222
-B .build -S .
223223
-- The CXX compiler identification is Clang 19.0.0
224224
...
225-
-- Build files have been written to: /path/to/optional26/.build
225+
-- Build files have been written to: /path/to/optional/.build
226226

227227
# Build.
228228
$ cmake --build .build --config Asan --target all -- -k 0
@@ -231,8 +231,8 @@ $ cmake --build .build --config Asan --target all -- -k 0
231231

232232
# Check that tests are not built/installed.
233233
$ ctest --build-config Asan --output-on-failure --test-dir .build
234-
Internal ctest changing into directory: /path/to/beman.optional26/.build
235-
Test project /path/to/beman.optional26/.build
234+
Internal ctest changing into directory: /path/to/beman.optional/.build
235+
Test project /path/to/beman.optional/.build
236236
No tests were found!!!
237237
```
238238

cmake/gcovr.cfg.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ gcov-parallel = yes
77
html-theme = github.dark-blue
88
html-self-contained = yes
99
print-summary = yes
10-
filter = .*/beman/optional26/.*
10+
filter = .*/beman/optional/.*
1111
exclude = .*\.t\.cpp
1212
coveralls = coverage.json
1313
coveralls-pretty = yes

docs/debug-ci.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Stage Job ID Job name Workflow name Workflow file Events
2323
0 build ${{ matrix.config.name }} CI Tests ci.yml pull_request,push
2424

2525
# Run all CI jobs
26-
optional26 $ sudo act -P ubuntu-24.04=ghcr.io/catthehacker/ubuntu:full-24.04 --container-architecture linux/amd64 push
26+
optional $ sudo act -P ubuntu-24.04=ghcr.io/catthehacker/ubuntu:full-24.04 --container-architecture linux/amd64 push
2727
[CI Tests/Ubuntu Clang 18-2] 🚀 Start image=ghcr.io/catthehacker/ubuntu:full-24.04
2828
[CI Tests/Ubuntu Clang 19-3] 🚀 Start image=ghcr.io/catthehacker/ubuntu:full-24.04
2929
[CI Tests/Ubuntu Clang 17-1] 🚀 Start image=ghcr.io/catthehacker/ubuntu:full-24.04

examples/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44
# cmake-format: on
55

6-
set(BEMAN_OPTIONAL26_LIBRARY "beman_optional26")
6+
set(BEMAN_OPTIONAL_LIBRARY "beman_optional")
77

88
include(GNUInstallDirs)
99

@@ -25,14 +25,14 @@ foreach(example ${EXAMPLES})
2525
target_sources(${example} PRIVATE ${example}.cpp)
2626

2727
# Link example with the library.
28-
target_link_libraries(${example} "${BEMAN_OPTIONAL26_LIBRARY}")
28+
target_link_libraries(${example} "${BEMAN_OPTIONAL_LIBRARY}")
2929

3030
# Install .
3131
install(
3232
TARGETS
3333
${example}
3434
COMPONENT
35-
beman_optional26_examples
35+
beman_optional_examples
3636
DESTINATION
3737
${CMAKE_INSTALL_BINDIR}
3838
)

examples/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# Examples for beman.optional26
1+
# Examples for beman.optional
22

33
<!--
44
SPDX-License-Identifier: 2.0 license with LLVM exceptions
55
-->
66

7-
List of usage examples for `beman.optional26`.
7+
List of usage examples for `beman.optional`.
88

99
## Samples
1010

11-
Check basic `beman.optional26` library usages:
11+
Check basic `beman.optional` library usages:
1212

1313
* local [./sample.cpp](./sample.cpp) or [sample.cpp@Compiler Explorer](https://godbolt.org/z/47vGje65x)
1414
* local [./std_vs_beman.cpp](./std_vs_beman.cpp) or [std_vs_beman.cpp@Compiler Explorer](https://godbolt.org/z/ds5MvfGe6)

examples/concept_checks.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
33

44
#include <optional>
5-
#include <beman/optional26/optional.hpp>
5+
#include <beman/optional/optional.hpp>
66

77
#include <concepts>
88

@@ -85,13 +85,13 @@ int main() {
8585
}
8686

8787
{
88-
// beman::optional26::optional meets range concepts.
89-
test_concepts_enabled(beman::optional26::optional<int>{});
90-
test_concepts_enabled(beman::optional26::optional<int*>{});
91-
test_concepts_enabled(beman::optional26::optional<test::empty>{});
92-
test_concepts_enabled(beman::optional26::optional<test::no_default_ctor>{});
93-
test_concepts_enabled(beman::optional26::optional<test::base>{});
94-
test_concepts_enabled(beman::optional26::optional<test::derived>{});
88+
// beman::optional::optional meets range concepts.
89+
test_concepts_enabled(beman::optional::optional<int>{});
90+
test_concepts_enabled(beman::optional::optional<int*>{});
91+
test_concepts_enabled(beman::optional::optional<test::empty>{});
92+
test_concepts_enabled(beman::optional::optional<test::no_default_ctor>{});
93+
test_concepts_enabled(beman::optional::optional<test::base>{});
94+
test_concepts_enabled(beman::optional::optional<test::derived>{});
9595
}
9696

9797
return 0;

0 commit comments

Comments
 (0)