Stan Math Library
5.0.0
Automatic Differentiation
|
chainable_object
hold another object is useful for connecting the lifetime of a specific object to the chainable stack
chainable_object
objects should only be allocated with new
. chainable_object
objects allocated on the stack will result in a double free (obj_
will get destructed once when the chainable_object leaves scope and once when the chainable stack memory is recovered).
T | type of object to hold |
Definition at line 25 of file chainable_object.hpp.
#include <chainable_object.hpp>
Public Member Functions | |
template<typename S , require_same_t< plain_type_t< T >, plain_type_t< S > > * = nullptr> | |
chainable_object (S &&obj) | |
Construct chainable object from another object. | |
auto & | get () noexcept |
Return a reference to the underlying object. | |
const auto & | get () const noexcept |
Private Attributes | |
plain_type_t< T > | obj_ |