C++11/14/17 std::optional with functional-style extensions and reference support
Single header implementation of std::optional
with functional-style extensions and support for references.
Clang + GCC:
MSVC:
std::optional
is the preferred way to represent an object which may or may not have a value. Unfortunately, chaining together many computations which may or may not produce a value can be verbose, as empty-checking code will be mixed in with the actual programming logic. This implementation provides a number of utilities to make coding with optional
cleaner.
For example, instead of writing this code:
Requires (1)
Tests
Builds
toolchain |
public-0.16.0 |
target |
x86_64-apple-darwin22.5.0 |
tgt config |
macos_13-gcc_13_homebrew-static_O3 |
timestamp |
2024-04-17 14:35:19 UTC (16:57:33 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-apple-darwin22.5.0 |
tgt config |
macos_13-gcc_13_homebrew-O3 |
timestamp |
2024-04-17 14:34:42 UTC (16:58:10 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-apple-darwin22.5.0 |
tgt config |
macos_13-gcc_13_homebrew |
timestamp |
2024-04-17 14:34:00 UTC (16:58:52 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-clang_15.0_libc++ |
timestamp |
2024-04-17 10:47:38 UTC (20:45:15 hours ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-clang_15.0 |
timestamp |
2024-04-17 10:45:09 UTC (20:47:44 hours ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_fedora_38-gcc_13-bindist |
timestamp |
2024-04-17 09:46:55 UTC (21:45:57 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_fedora_37-gcc_12.2-bindist |
timestamp |
2024-04-17 03:56:38 UTC (01 03:36:14 days ago) |
result |
success | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-w64-mingw32 |
tgt config |
windows_10-gcc_12.2_mingw_w64 |
timestamp |
2024-04-17 03:21:56 UTC (01 04:10:56 days ago) |
result |
success | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-w64-mingw32 |
tgt config |
windows_10-gcc_12.2_mingw_w64-static_O2 |
timestamp |
2024-04-17 03:15:53 UTC (01 04:16:59 days ago) |
result |
success | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-w64-mingw32 |
tgt config |
windows_10-gcc_12.2_mingw_w64-O2 |
timestamp |
2024-04-17 03:14:16 UTC (01 04:18:36 days ago) |
result |
success | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-gcc_12-bindist |
timestamp |
2024-04-17 03:11:22 UTC (01 04:21:30 days ago) |
result |
success | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-gcc_13.1-static_O3 |
timestamp |
2024-04-17 03:07:50 UTC (01 04:25:03 days ago) |
result |
success | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-gcc_13.1-ndebug_O3 |
timestamp |
2024-04-17 03:06:49 UTC (01 04:26:03 days ago) |
result |
success | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-gcc_13.1-O3 |
timestamp |
2024-04-17 03:05:26 UTC (01 04:27:26 days ago) |
result |
success | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-gcc_13.1 |
timestamp |
2024-04-17 03:02:11 UTC (01 04:30:41 days ago) |
result |
success | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_11-gcc_12.1 |
timestamp |
2024-04-17 03:01:20 UTC (01 04:31:32 days ago) |
result |
success | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-microsoft-win32-msvc14.3 |
tgt config |
windows_10-clang_16.0_llvm_msvc_17.6-static_O2 |
timestamp |
2024-04-16 15:08:19 UTC (01 16:24:33 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-microsoft-win32-msvc14.3 |
tgt config |
windows_10-clang_16.0_llvm_msvc_17.6-O2 |
timestamp |
2024-04-16 15:07:40 UTC (01 16:25:12 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-microsoft-win32-msvc14.3 |
tgt config |
windows_10-clang_16.0_llvm_msvc_17.6 |
timestamp |
2024-04-16 15:06:56 UTC (01 16:25:56 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-clang_16.0_libc++-static_O3 |
timestamp |
2024-04-16 14:56:08 UTC (01 16:36:44 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-clang_16.0-O3 |
timestamp |
2024-04-16 14:55:16 UTC (01 16:37:37 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-clang_16.0_libc++-O3 |
timestamp |
2024-04-16 14:54:44 UTC (01 16:38:08 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-clang_16.0-static_O3 |
timestamp |
2024-04-16 14:54:03 UTC (01 16:38:49 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-clang_16.0_libc++ |
timestamp |
2024-04-16 14:52:59 UTC (01 16:39:54 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-clang_16.0 |
timestamp |
2024-04-16 14:52:09 UTC (01 16:40:43 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-freebsd13.2 |
tgt config |
freebsd_13-clang_14.0 |
timestamp |
2024-04-16 12:01:13 UTC (01 19:31:39 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-microsoft-win32-msvc14.3 |
tgt config |
windows_10-msvc_17.6-static_O2 |
timestamp |
2024-04-16 11:53:35 UTC (01 19:39:18 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-microsoft-win32-msvc14.3 |
tgt config |
windows_10-msvc_17.6-O2 |
timestamp |
2024-04-16 11:51:08 UTC (01 19:41:44 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-microsoft-win32-msvc14.3 |
tgt config |
windows_10-msvc_17.6 |
timestamp |
2024-04-16 11:49:10 UTC (01 19:43:42 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-freebsd13.2 |
tgt config |
freebsd_13-clang_14.0-static_O3 |
timestamp |
2024-04-16 11:47:34 UTC (01 19:45:18 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-freebsd13.2 |
tgt config |
freebsd_13-clang_14.0-O3 |
timestamp |
2024-04-16 11:46:58 UTC (01 19:45:55 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-microsoft-win32-msvc14.3 |
tgt config |
windows_10-clang_15.0_msvc_msvc_17.6 |
timestamp |
2024-04-16 11:42:18 UTC (01 19:50:35 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-microsoft-win32-msvc14.3 |
tgt config |
windows_10-msvc_17.5 |
timestamp |
2024-04-16 11:31:00 UTC (01 20:01:52 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-freebsd12.4 |
tgt config |
freebsd_12-clang_13.0 |
timestamp |
2024-04-16 11:24:02 UTC (01 20:08:50 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-apple-darwin22.5.0 |
tgt config |
macos_13-clang_14.0-static_O3 |
timestamp |
2024-04-16 08:38:11 UTC (01 22:54:41 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-apple-darwin22.5.0 |
tgt config |
macos_13-clang_14.0-O3 |
timestamp |
2024-04-16 08:36:55 UTC (01 22:55:57 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-apple-darwin22.5.0 |
tgt config |
macos_13-clang_14.0 |
timestamp |
2024-04-16 08:33:34 UTC (01 22:59:18 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-gcc_13-static_O3 |
timestamp |
2024-04-16 06:34:04 UTC (02 00:58:48 days ago) |
result |
success | log | rebuild |
toolchain |
public-0.16.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-gcc_13-O3 |
timestamp |
2024-04-16 06:28:23 UTC (02 01:04:29 days ago) |
result |
success | log | rebuild |
toolchain |
public-0.16.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-gcc_13-ndebug_O3 |
timestamp |
2024-04-16 06:25:46 UTC (02 01:07:06 days ago) |
result |
success | log | rebuild |
toolchain |
public-0.16.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-gcc_13 |
timestamp |
2024-04-16 06:21:39 UTC (02 01:11:13 days ago) |
result |
success | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-apple-darwin22.5.0 |
tgt config |
macos_13-clang_15.0-static_O3 |
timestamp |
2024-04-16 01:24:22 UTC (02 06:08:30 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-apple-darwin22.5.0 |
tgt config |
macos_13-clang_15.0-O3 |
timestamp |
2024-04-16 01:22:59 UTC (02 06:09:53 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
x86_64-apple-darwin22.5.0 |
tgt config |
macos_13-clang_15.0 |
timestamp |
2024-04-16 01:14:45 UTC (02 06:18:07 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-clang_16_libc++-static_O3 |
timestamp |
2024-04-15 16:13:45 UTC (02 15:19:07 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-clang_16_libc++-O3 |
timestamp |
2024-04-15 16:11:17 UTC (02 15:21:35 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-clang_16_libc++ |
timestamp |
2024-04-15 16:09:08 UTC (02 15:23:44 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-clang_16-O3 |
timestamp |
2024-04-15 16:09:02 UTC (02 15:23:50 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-clang_16-static_O3 |
timestamp |
2024-04-15 16:07:58 UTC (02 15:24:55 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-clang_16 |
timestamp |
2024-04-15 16:04:21 UTC (02 15:28:31 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_11-gcc_12 |
timestamp |
2024-04-15 13:37:41 UTC (02 17:55:11 days ago) |
result |
success | log | rebuild |
toolchain |
public-0.16.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-clang_15_libc++ |
timestamp |
2024-04-15 12:03:45 UTC (02 19:29:07 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |
toolchain |
public-0.16.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-clang_15 |
timestamp |
2024-04-15 12:01:41 UTC (02 19:31:11 days ago) |
result |
warning (test) | warning (test-installed) | log | rebuild |