Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ forward_as() [2/4]

template<typename T_desired , typename T_actual , typename = std::enable_if_t< !std::is_same<std::decay<T_actual>, std::decay<T_desired>>::value && (!is_eigen<T_desired>::value || !is_eigen<T_actual>::value)>>
T_desired stan::math::forward_as ( const T_actual &  a)
inline

Assume which type we get.

If actual type is not convertible to assumed type or in case of eigen types compile time rows and columns are not the same and desired sizes are not dynamic this has return type of T_desired, but it only throws. This version should only be used where it is optimized away so the throw should never happen.

This is intended to be used in compile time branches that would otherwise trigger compile error even though they are never executed.

Template Parameters
T_desiredtype of output we need to avoid compile time errors
T_actualactual type of the argument
Parameters
ainput value
Returns
nothing, this always throws
Exceptions
alwaysthrows std::runtime_error

Definition at line 61 of file forward_as.hpp.