Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Codeowners for reviews on PRs

* @camio
* @neatudarius
* @steve-downey
12 changes: 6 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
cmake.bld
/papers/**/generated/
compile_commands.json
.update-submodules
.use-docker
/.build/
/.cache/
*.pyg
/.vscode/
/papers/**/generated/
/papers/**/.venv/
/papers/**/_minted-*/
/papers/**/*.aux
Expand All @@ -22,6 +24,4 @@ compile_commands.json
/papers/**/.venv.work/
/papers/**/_minted-optional_ref/
/papers/**/_minted-optional_ref_wording/
/.cache/
*.pyg
/.build/
.update-submodules
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,3 @@
[submodule "extern/googletest"]
path = extern/googletest
url = https://github.com/google/googletest.git
[submodule "docker-inf/docker-cxx-dev"]
path = docker-inf/docker-cxx-dev
url = git@github.com:steve-downey/docker-cxx-dev.git
9 changes: 3 additions & 6 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
cff-version: 1.2.0
cff-version: 1.0.0
message: "If you use this software, please cite it as below."
authors:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@steve-downey , any idea what / if we should write here?

- family-names: "Downey"
given-names: "Stephen"
title: "smd::optional::optional<T&> "
url: "https://github.com/steve-downey/optional_ref"
title: "Beman.Optional26"
url: "https://github.com/beman-project/Optional26"
10 changes: 0 additions & 10 deletions Dockerfile

This file was deleted.

46 changes: 27 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# OPTIONAL<T&>
# Beman.Optional26: C++26 Extensions for std::optional

![](https://github.com/steve-downey/view_maybe/actions/workflows/ci.yml/badge.svg)
This implementation incorporates the C++26 extensions added for `std::optional`. The `Beman.Optional26` library aims to evaluate the stability, the usability, and the performance of these proposed changes before they are officially adopted by WG21 into the C++ Working Draft. Additionally, it allows developers to use these new features before they are implemented in major standard library compilers.

**Implements**:
* [`std::optional<T&>` (P2988R5)](https://wg21.link/P2988R5)
* [Give *std::optional* Range Support (P3168R1)](https://wg21.link/P3168R1).

A proof of concept for the std::optional<T&> proposal.

Source is licensed with the Apache 2.0 license with LLVM exceptions

Expand All @@ -18,49 +21,54 @@ The README itself is licesed with CC0 1.0 Universal. Copy the contents and incor

// SPDX-License-Identifier: CC0-1.0

## Building Optional
## How to Build

### Dependencies

This project is mainly tested on Ubuntu 22.04, but it should be as portable as CMake is.

This project has zero C or C++ depenendencies.
This project is mainly tested on `Ubuntu 22.04` and `Ubuntu 24.04`, but it should be as portable as CMake is. This project has zero C or C++ dependencies.

It does require two tools as build-time dependencies:
It does require few tools as build-time dependencies:

- `cmake`
- `cmake`
- `ninja`, `make`, or another CMake-supported build system
- CMake defaults to "Unix Makefiles" on POSIX systems

Compiling the paper requires a working LaTeX installation. See instructions for configuring your system at [C++ Standard Draft Sources](https://github.com/cplusplus/draft/blob/main/README.rst)
Example of installation on `Ubuntu 24.04`:
```shell
# install tools
apt-get install -y cmake make ninja-build

# example of toolchains
apt-get install g++-14 gcc-14 clang-18 clang++-18
```

### Instructions

Full set of supported toolchains can be found in [.github/workflows/ci.yml](#.github/workflows/ci.yml).

#### Basic Build

This project strives to be as normal and simple a CMake project as possible. This build workflow in particular will work, producing a static `example` library, ready to package:

```shell
cmake --workflow --preset gcc-14
```

This should build and run the tests with GCC 14 with the address and undefined behavior sanitizers enabled.

#### More complex cases

The CMake preset system suffers from combinitorial explosion. There is a makefile in the root of the repository to aid in running more configurations.

```shell
make -k TOOLCHAIN=clang-18 CONFIG=Tsan VERBOSE=1
```

The makefile will use your system compiler, `c++`, if no toolchain name is provided, otherwise it will use the toolchain in the etc/ directory to perform the build. The Ninja multi config generator is used, with configurations for RelWithDebugInfo, Debug, Tsan, and Asan configured by default.

#### Building P2988
The makefile will use your system compiler, `c++`, if no toolchain name is provided, otherwise it will use the toolchain in the etc/ directory to perform the build. The Ninja multi config generator is used, with configurations for `RelWithDebugInfo`, `Debug`, `Tsan`, and `Asan` configured by default.

The papers/ subdirectory has the LaTeX souces for P2988 and the supporting macro definitions. To build, run
```shell
make papers
```
## Papers

A working recent Python 3 is required to format the sources for the paper. A virtual env will be created in the papers subdirectory which the `minted` LaTeX package will use.
Latest revision(s) of the papers can be built / found at:
* [./papers/P2988/README.md](./papers/P2988/README.md) for `std::optional<T&> (P2988)`.
* [give-std-optional-range-support](https://github.com/neatudarius/give-std-optional-range-support/) for `Give *std::optional* Range Support (P3168)`

`
1 change: 0 additions & 1 deletion bld

This file was deleted.

16 changes: 0 additions & 16 deletions docker-compose.yml

This file was deleted.

1 change: 0 additions & 1 deletion docker-inf/docker-cxx-dev
Submodule docker-cxx-dev deleted from 451f09
12 changes: 12 additions & 0 deletions papers/P2988/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# P2988
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Content moved from root README.md


## Building P2988

Compiling the paper requires a working LaTeX installation. See instructions for configuring your system at [C++ Standard Draft Sources](https://github.com/cplusplus/draft/blob/main/README.rst)

The papers/ subdirectory has the LaTeX souces for P2988 and the supporting macro definitions. To build, run
```shell
make papers
```

A working recent Python 3 is required to format the sources for the paper. A virtual env will be created in the papers subdirectory which the `minted` LaTeX package will use.