diff options
Diffstat (limited to 'example')
| -rw-r--r-- | example/hash_crc32_example/example.cpp | 6 | ||||
| -rw-r--r-- | example/option_example/example.cpp | 21 | ||||
| -rw-r--r-- | example/smart_ptr_example/example.cpp | 12 |
3 files changed, 20 insertions, 19 deletions
diff --git a/example/hash_crc32_example/example.cpp b/example/hash_crc32_example/example.cpp index 95a3077..345f610 100644 --- a/example/hash_crc32_example/example.cpp +++ b/example/hash_crc32_example/example.cpp @@ -9,15 +9,15 @@ int main(int argc, char** argv) { - if (argc != 2) + if (argc != 2) { ocl::io::print("Hello, World!\n"_crc32); return EXIT_SUCCESS; } - std::hash<ocl::crc_hash_trait> hash{}; + std::hash<ocl::crc_hash_trait> hash{}; - ocl::io::enable_stdio_sync(false); + ocl::io::enable_stdio_sync(false); ocl::io::print(hash.operator()<true, false>(argv[1])); return EXIT_SUCCESS; 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; } diff --git a/example/smart_ptr_example/example.cpp b/example/smart_ptr_example/example.cpp index fbf8f3d..61903f5 100644 --- a/example/smart_ptr_example/example.cpp +++ b/example/smart_ptr_example/example.cpp @@ -10,11 +10,11 @@ /// \brief Smart pointer example. auto main(int argc, char** argv) -> int { - ocl::shared_ptr<std::ostream> smart = ocl::delete_ptr(&std::cout); - *smart << "hello, world\n"; + ocl::shared_ptr<std::ostream> smart = ocl::delete_ptr(&std::cout); + *smart << "hello, world\n"; - ocl::tracked_ptr<int> tracked = ocl::make_tracked<int>(10); - *smart << *tracked << "\n"; - - return EXIT_SUCCESS; + ocl::tracked_ptr<int> tracked = ocl::make_tracked<int>(10); + *smart << *tracked << "\n"; + + return EXIT_SUCCESS; } |
