summaryrefslogtreecommitdiffhomepage
path: root/example/option_example/example.cpp
diff options
context:
space:
mode:
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;
}