alpaqa develop
Nonconvex constrained optimization
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
any_ptr Class Reference

#include <alpaqa/util/any-ptr.hpp>

Detailed Description

Like std::any, but storing just the pointer, without any dynamic allocation.

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

+ Collaboration diagram for any_ptr:

Public Member Functions

 any_ptr ()=default
 
template<class T >
 any_ptr (T *ptr)
 
template<class T >
Tcast () const
 

Private Attributes

voidptr = nullptr
 
const std::type_info * ptr_type = nullptr
 
bool is_const = true
 

Constructor & Destructor Documentation

◆ any_ptr() [1/2]

any_ptr ( )
default

◆ any_ptr() [2/2]

template<class T >
any_ptr ( T ptr)
inline

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

Member Function Documentation

◆ cast()

template<class T >
T * cast ( ) const
inline

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

Member Data Documentation

◆ ptr

void* ptr = nullptr
private

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

◆ ptr_type

const std::type_info* ptr_type = nullptr
private

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

◆ is_const

bool is_const = true
private

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


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