Stan Math Library
5.0.0
Automatic Differentiation
|
unsafe_chainable_object
hold another object and is useful for connecting the lifetime of a specific object to the chainable stack.
This class differs from chainable_object
in that this class does not evaluate expressions.
unsafe_chainable_object
objects should only be allocated with new
. unsafe_chainable_object
objects allocated on the stack will result in a double free (obj_
will get destructed once when the unsafe_chainable_object
leaves scope and once when the chainable stack memory is recovered).
T | type of object to hold |
Definition at line 78 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> | |
unsafe_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 | |
std::decay_t< T > | obj_ |