![]() |
Stan Math Library
2.20.0
reverse mode automatic differentiation
|
Template metaprogram to calculate the base scalar return type resulting from promoting all the scalar types of the template parameters. More...
#include <return_type.hpp>
Public Types | |
typedef boost::math::tools::promote_args< double, typename scalar_type< T >::type, typename return_type< Types_pack... >::type >::type | type |
Template metaprogram to calculate the base scalar return type resulting from promoting all the scalar types of the template parameters.
The metaprogram can take an arbitrary number of template parameters.
All C++ primitive types (except long double
) are automatically promoted to double
.
return_type<...>
is a class defining a single public typedef type
that is var
if there is a non-constant template argument and is double
otherwise. This is consistent with the Stan logic that if code receives var
as an input type, then the return type is var
. All other functions return double
.
Example usage:
return_type<int,double,float>::type
is double
return_type<double,var>::type
is var
T | (required) A type |
Types_pack | (optional) A parameter pack containing further types. |
Definition at line 33 of file return_type.hpp.
typedef boost::math::tools::promote_args< double, typename scalar_type<T>::type, typename return_type<Types_pack...>::type>::type stan::return_type< T, Types_pack >::type |
Definition at line 36 of file return_type.hpp.