24 #include <seastar/util/concepts.hh>
25 #include <seastar/util/std-compat.hh>
26 #include <seastar/util/modules.hh>
27 #ifndef SEASTAR_MODULE
30 #include <type_traits>
38 concept OptimizableOptional =
39 std::is_default_constructible_v<T>
40 && std::is_nothrow_move_assignable_v<T>
41 && requires(
const T& obj) {
42 { bool(obj) } noexcept;
62 _object = std::move(*obj);
74 operator=(U&& obj) noexcept {
75 _object = std::forward<U>(obj);
81 explicit operator bool()
const noexcept {
85 T* operator->() noexcept {
return &_object; }
86 const T* operator->()
const noexcept {
return &_object; }
88 T& operator*() noexcept {
return _object; }
89 const T& operator*()
const noexcept {
return _object; }
92 return _object == other._object;
95 return _object != other._object;
Definition: optimized_optional.hh:53
Seastar API namespace.
Definition: abort_on_ebadf.hh:26