From 185335e8efcac46e96e25e5a50e0d4b93152f983 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 21 Dec 2025 11:11:23 +0100 Subject: feat: New release of `OCL.Core`, standalone module. Signed-off-by: Amlal El Mahrouss --- example/option_example/example.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'example/option_example') diff --git a/example/option_example/example.cc b/example/option_example/example.cc index e35f73b..c784dec 100644 --- a/example/option_example/example.cc +++ b/example/option_example/example.cc @@ -1,15 +1,23 @@ #include #include #include -// #include +struct invalid_callable { + explicit invalid_callable() = default; + void operator()(const char* reason) + { + ocl::detail::throw_runtime_error(BOOST_CURRENT_LOCATION.to_string()); + } +}; + +/// \brief Option Monad example int main(int argc, char** argv) { ocl::option opt{ocl::eval_eq(nullptr, nullptr)}; - opt.expect("is incorrect"); + opt.expect("option::incorrect"); ocl::option opt2{ocl::eval_eq(argv, nullptr)}; - opt2.expect("is incorrect"); + opt2.expect("option::incorrect"); return 0; } -- cgit v1.2.3