19 Ref() noexcept : _impl{
nullptr} {}
20 Ref(T& impl) noexcept : _impl{std::addressof(impl)} {}
25 bool operator==(
const Ref& other)
const noexcept {
return _impl == other._impl; }
26 bool operator==(
const T* impl)
const noexcept {
return _impl == impl; }
28 Ref& operator=(
const Ref&) & =
default;
29 Ref& operator=(
const Ref&) && =
delete;
30 Ref& operator=(
Ref&&) & =
default;
31 Ref& operator=(
Ref&&) && =
delete;
33 explicit operator bool()
const noexcept {
return _impl !=
nullptr; }
48 template<
typename T>
static constexpr
bool is_ref_v = std::is_standard_layout_v<T> &&
sizeof(T) ==
sizeof(
void*);
A lightweight reference wrapper for objects of type T.