guanaqo 1.0.0-alpha.24
Utilities for scientific software
Loading...
Searching...
No Matches
guanaqo::shared_any_ptr Class Reference

#include <guanaqo/any-ptr.hpp>

Detailed Description

Like std::any, but storing a shared_ptr, to allow for move-only types.

Definition at line 49 of file any-ptr.hpp.

Collaboration diagram for guanaqo::shared_any_ptr:

Public Member Functions

 shared_any_ptr ()=default
template<class T>
 shared_any_ptr (std::shared_ptr< T > ptr) noexcept
 shared_any_ptr (const shared_any_ptr &)=default
 shared_any_ptr (shared_any_ptr &&) noexcept=default
shared_any_ptroperator= (const shared_any_ptr &)=default
shared_any_ptroperator= (shared_any_ptr &&) noexcept=default
template<class T>
T * cast () const
bool has_value () const noexcept
bool is_immutable () const noexcept
const std::type_info & type () const noexcept

Private Attributes

std::shared_ptr< void > ptr
const std::type_info * ptr_type = &typeid(void)
bool is_const = true

Constructor & Destructor Documentation

◆ shared_any_ptr() [1/4]

guanaqo::shared_any_ptr::shared_any_ptr ( )
default
Here is the caller graph for this function:

◆ shared_any_ptr() [2/4]

template<class T>
guanaqo::shared_any_ptr::shared_any_ptr ( std::shared_ptr< T > ptr)
inlinenoexcept

Definition at line 53 of file any-ptr.hpp.

◆ shared_any_ptr() [3/4]

guanaqo::shared_any_ptr::shared_any_ptr ( const shared_any_ptr & )
default
Here is the call graph for this function:

◆ shared_any_ptr() [4/4]

guanaqo::shared_any_ptr::shared_any_ptr ( shared_any_ptr && )
defaultnoexcept
Here is the call graph for this function:

Member Function Documentation

◆ operator=() [1/2]

shared_any_ptr & guanaqo::shared_any_ptr::operator= ( const shared_any_ptr & )
default
Here is the call graph for this function:

◆ operator=() [2/2]

shared_any_ptr & guanaqo::shared_any_ptr::operator= ( shared_any_ptr && )
defaultnoexcept
Here is the call graph for this function:

◆ cast()

template<class T>
T * guanaqo::shared_any_ptr::cast ( ) const
inline

Definition at line 63 of file any-ptr.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ has_value()

bool guanaqo::shared_any_ptr::has_value ( ) const
inlinenodiscardnoexcept

Definition at line 73 of file any-ptr.hpp.

◆ is_immutable()

bool guanaqo::shared_any_ptr::is_immutable ( ) const
inlinenodiscardnoexcept

Definition at line 74 of file any-ptr.hpp.

◆ type()

const std::type_info & guanaqo::shared_any_ptr::type ( ) const
inlinenodiscardnoexcept

Definition at line 75 of file any-ptr.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ ptr

std::shared_ptr<void> guanaqo::shared_any_ptr::ptr
private

Definition at line 80 of file any-ptr.hpp.

◆ ptr_type

const std::type_info* guanaqo::shared_any_ptr::ptr_type = &typeid(void)
private

Definition at line 81 of file any-ptr.hpp.

◆ is_const

bool guanaqo::shared_any_ptr::is_const = true
private

Definition at line 82 of file any-ptr.hpp.


The documentation for this class was generated from the following file: