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

Detailed Description

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

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

Template Parameters
Ttype of object to hold

Definition at line 25 of file chainable_object.hpp.

#include <chainable_object.hpp>

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

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_
 

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