Go to the documentation of this file.
22 template <
typename T,
typename... Args>
23 constexpr
auto size(
const T&, Args&&... ) noexcept {
24 static_assert(
sizeof...( Args ) == 0,
"No extra args please" );
31 virtual std::optional<std::size_t>
size()
const = 0;
34 void const* m_ptr =
nullptr;
39 Ptr( T
const*
t ) : m_ptr{
t }, m_type{
typeid( T ) } {}
41 operator void const*()
const {
return m_ptr; }
45 T
const*
get()
const {
46 if ( std::is_void_v<T> || m_type ==
std::type_index(
typeid( T ) ) )
return static_cast<T const*
>( m_ptr );
48 throw bad_AnyDataWrapper_Ptr_cast{};
66 const T&
getData()
const {
return m_data; }
69 std::optional<std::size_t>
size()
const override {
71 return size( getData() );
77 template <
typename ViewType,
typename OwnedType>
constexpr auto size(const T &, Args &&...) noexcept
AnyDataWrapper & operator=(AnyDataWrapper &&)=delete
const T & getData() const
AnyDataWithViewWrapper(AnyDataWithViewWrapper &&)=delete
AnyDataWithViewWrapper & operator=(AnyDataWithViewWrapper &&)=delete
AnyDataWrapper(AnyDataWrapper &&)=delete
std::optional< std::size_t > size() const override
AnyDataWrapper & operator=(AnyDataWrapper const &)=delete
virtual Ptr payload() const =0
AnyDataWrapper(AnyDataWrapper const &)=delete
std::type_index type() const
AnyDataWithViewWrapper(AnyDataWithViewWrapper const &)=delete
Ptr payload() const override
AnyDataWithViewWrapper & operator=(AnyDataWithViewWrapper const &)=delete
AnyDataWithViewWrapper(OwnedType &&data)
virtual std::optional< std::size_t > size() const =0