1 #ifndef STAN_MATH_PRIM_FUN_IDENTITY_FREE_HPP 2 #define STAN_MATH_PRIM_FUN_IDENTITY_FREE_HPP 3 4 #include <stan/math/prim/meta.hpp> 5 6 namespace stan { 7 namespace math { 8 9 /** 10 * Returns the result of applying the inverse of the identity 11 * constraint transform to the input. This promotes the input to the least upper 12 * bound of the input types. 13 * 14 * 15 * @tparam T type of value to promote 16 * @tparam Types Other types. 17 * @param[in] x value to promote 18 * @return value 19 */ 20 template <typename T, typename... Types, 21 require_all_not_var_matrix_t<T, Types...>* = nullptr> identity_free(T && x,Types &&...)22inline auto identity_free(T&& x, Types&&... /* args */) { 23 return promote_scalar_t<return_type_t<T, Types...>, T>(x); 24 } 25 26 } // namespace math 27 } // namespace stan 28 29 #endif 30