MCPcopy Create free account
hub / github.com/boostorg/asio / test_future

Function test_future

example/cpp20/operations/callback_wrapper.cpp:135–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133//------------------------------------------------------------------------------
134
135void test_future()
136{
137 // Test our asynchronous operation using the use_future completion token.
138 // This token causes the operation's initiating function to return a future,
139 // which may be used to synchronously wait for the result of the operation.
140 std::future<std::string> f =
141 async_read_input("Enter your name", boost::asio::use_future);
142
143 std::string result = f.get();
144 std::cout << "Hello " << result << "\n";
145}
146
147//------------------------------------------------------------------------------
148

Callers 1

mainFunction · 0.70

Calls 2

async_read_inputFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected