24#include <seastar/util/modules.hh>
35concept OptimizableOptional =
36 std::is_default_constructible_v<T>
37 && std::is_nothrow_move_assignable_v<T>
38 &&
requires(
const T& obj) {
39 { bool(obj) }
noexcept;
57 _object = std::move(*obj);
69 operator=(U&& obj)
noexcept {
70 _object = std::forward<U>(obj);
76 explicit operator bool()
const noexcept {
80 T* operator->()
noexcept {
return &_object; }
81 const T* operator->()
const noexcept {
return &_object; }
83 T& operator*()
noexcept {
return _object; }
84 const T& operator*()
const noexcept {
return _object; }
87 return _object == other._object;
90 return _object != other._object;
103struct fmt::formatter<
seastar::optimized_optional<T>> : fmt::formatter<string_view> {
106 return fmt::format_to(ctx.out(),
"{}", *opt);
108 return fmt::format_to(ctx.out(),
"null");
Definition: optimized_optional.hh:48
Seastar API namespace.
Definition: abort_on_ebadf.hh:26