Automatic Differentiation
 
Loading...
Searching...
No Matches
stan::math::unsafe_chainable_object< T > Class Template Reference

Detailed Description

template<typename T>
class stan::math::unsafe_chainable_object< T >

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).

Template Parameters
Ttype of object to hold

Definition at line 80 of file chainable_object.hpp.

#include <chainable_object.hpp>

+ Inheritance diagram for stan::math::unsafe_chainable_object< T >:

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_
 

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