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

◆ static_select() [1/2]

template<bool Condition, typename T1 , typename T2 , std::enable_if_t< Condition > * = nullptr>
T1 stan::math::static_select ( T1 &&  a,
T2 &&  b 
)

Returns one of the arguments that can be of different type, depending on the compile time condition.

Can often be used in place of c++17 if constexpr.

Template Parameters
Conditioncondition
T1type of the first argument
T2type of the second argument
Parameters
afirst argument; returned if the Condition is true
bsecond argument; returned if the Condition is false
Returns
One of the arguemtns, depending on the Condition

Definition at line 24 of file static_select.hpp.