From 0745b058c1fd373a10210c8d9397008b145d82bd Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Wed, 18 Mar 2026 06:51:01 +0100 Subject: [CHORE] Update examples for Asio and AllocOp. Signed-off-by: Amlal El Mahrouss --- example/asio_example/example.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'example/asio_example/example.cpp') diff --git a/example/asio_example/example.cpp b/example/asio_example/example.cpp index d5abe0a..7b7fc16 100644 --- a/example/asio_example/example.cpp +++ b/example/asio_example/example.cpp @@ -8,9 +8,9 @@ #include #include -constexpr long int operator ""_USD(long double n) +constexpr long int operator""_USD(long double n) { - return n * 1000.0; + return n * 1000.0; } /// @brief Wrap OCL in ASIO calls. @@ -19,19 +19,18 @@ int main() boost::asio::io_context ioc{1}; auto spawn_strand = boost::asio::make_strand(ioc); - ocl::allocator int_alloc; + ocl::allocator int_alloc; - boost::asio::co_spawn(spawn_strand, [&int_alloc]() -> boost::asio::awaitable { + boost::asio::co_spawn(spawn_strand, [&int_alloc]() -> boost::asio::awaitable { auto balance = int_alloc.construct_array<1>(); *balance = operator ""_USD(150); ocl::io::println("Balance USD: ", *balance); - co_return; - }, boost::asio::detached); + co_return; }, boost::asio::detached); - auto balances = int_alloc.construct_array<5>(); + auto balances = int_alloc.construct_array<5>(); - ocl::asio::run<[]() { (void)0; }>(ioc); + ocl::asio::run<[]() { (void)0; }>(ioc); - return EXIT_SUCCESS; + return EXIT_SUCCESS; } -- cgit v1.2.3