in upstream seastar, "SEASTAR_USE_STD_OPTIONAL_VARIANT_STRINGVIEW" is offered
as an option. if it is set to "1", std::option is used instead of
std::experimental::option. using std::option is more C++17 compliant and simpler.
but we are using a seastar version based on
https://github.com/hakuch/seastar/commits/jhk/better_cmake/v3 , which
enables "SEASTAR_USE_STD_OPTIONAL_VARIANT_STRINGVIEW" by default, if
C++17 is used.
Signed-off-by: Kefu Chai <kchai@redhat.com>
seastar::future<MessageRef> SocketConnection::read_message()
{
- namespace stdx = std::experimental;
-
return seastar::repeat_until_value([this] {
return do_read_message()
- .then([this] (MessageRef msg) -> stdx::optional<MessageRef> {
+ .then([this] (MessageRef msg) -> std::optional<MessageRef> {
if (!update_rx_seq(msg->get_seq())) {
// skip this request and read the next
- return stdx::nullopt;
+ return {};
}
return msg;
});