WPILibC++ 2025.1.1
Loading...
Searching...
No Matches
ebo_storage.hpp
Go to the documentation of this file.
1// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors
2// SPDX-License-Identifier: Zlib
3
4#ifndef WPI_MEMORY_DETAIL_EBO_STORAGE_HPP_INCLUDED
5#define WPI_MEMORY_DETAIL_EBO_STORAGE_HPP_INCLUDED
6
7#include "utility.hpp"
8#include "../config.hpp"
9
10namespace wpi
11{
12 namespace memory
13 {
14 namespace detail
15 {
16 template <int Tag, typename T>
17 class ebo_storage : T
18 {
19 protected:
20 ebo_storage(const T& t) : T(t) {}
21
22 ebo_storage(T&& t) noexcept(std::is_nothrow_move_constructible<T>::value)
23 : T(detail::move(t))
24 {
25 }
26
27 T& get() noexcept
28 {
29 return *this;
30 }
31
32 const T& get() const noexcept
33 {
34 return *this;
35 }
36 };
37 } // namespace detail
38 } // namespace memory
39} // namespace wpi
40
41#endif // WPI_MEMORY_DETAIL_EBO_STORAGE_HPP_INCLUDED
Definition ebo_storage.hpp:18
T & get() noexcept
Definition ebo_storage.hpp:27
ebo_storage(const T &t)
Definition ebo_storage.hpp:20
ebo_storage(T &&t) noexcept(std::is_nothrow_move_constructible< T >::value)
Definition ebo_storage.hpp:22
const T & get() const noexcept
Definition ebo_storage.hpp:32
Configuration macros.
detail namespace with internal helper functions
Definition input_adapters.h:32
std::remove_reference< T >::type && move(T &&arg) noexcept
Definition utility.hpp:25
Memory namespace.
Definition heap_allocator.hpp:20
Foonathan namespace.
Definition ntcore_cpp.h:26