Skip to content

Commit

Permalink
Update Beman.Optional26 docs and do tree cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
neatudarius committed Jun 11, 2024
1 parent 709765a commit 4705d36
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 50 deletions.
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
cmake.bld
/papers/generated/
compile_commands.json
.vscode/
.build/
.update-submodules
.use-docker
/papers/.venv/
Expand All @@ -24,3 +26,4 @@ compile_commands.json
/papers/_minted-optional_ref_wording/
/.cache/
*.pyg

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 = [email protected]:steve-downey/docker-cxx-dev.git
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, 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
## Building Beman.Optional26

### 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 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 ++-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

## 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.

0 comments on commit 4705d36

Please sign in to comment.