summaryrefslogtreecommitdiffhomepage
path: root/example/option_example/example.cpp
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2026-01-04 07:56:21 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2026-01-04 07:56:21 +0100
commit149a5998b5ec6f825998a27a305d972022271888 (patch)
tree981ff51c3ed77b8447631a86e916d590eb6e0e8d /example/option_example/example.cpp
parent8e2394ed661dd223fb02b3a63fb03ca869bad44c (diff)
core: tracked_ptr: Update public API.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'example/option_example/example.cpp')
-rw-r--r--example/option_example/example.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/example/option_example/example.cpp b/example/option_example/example.cpp
index b2c3f95..c2fc2ca 100644
--- a/example/option_example/example.cpp
+++ b/example/option_example/example.cpp
@@ -7,22 +7,23 @@
#include <ocl/print.hpp>
#include <ocl/option.hpp>
-struct invalid_callable {
- explicit invalid_callable() = default;
- void operator()(const char* reason)
- {
- ocl::detail::throw_runtime_error();
- }
+struct invalid_callable
+{
+ explicit invalid_callable() = default;
+ void operator()(const char* reason)
+ {
+ ocl::detail::throw_runtime_error();
+ }
};
/// \brief Option Monad example
int main(int argc, char** argv)
{
- ocl::option opt{ocl::eval_eq(nullptr, nullptr)};
- opt.expect("option::incorrect");
+ ocl::option opt{ocl::eval_eq(nullptr, nullptr)};
+ opt.expect("option::incorrect");
- ocl::option opt2{ocl::eval_eq(argv, nullptr)};
- opt2.expect<invalid_callable>("option::incorrect");
+ ocl::option opt2{ocl::eval_eq(argv, nullptr)};
+ opt2.expect<invalid_callable>("option::incorrect");
return 0;
}