1 #ifndef STAN_MATH_PRIM_SCAL_META_VECTORVIEW_HPP 2 #define STAN_MATH_PRIM_SCAL_META_VECTORVIEW_HPP 6 #include <boost/type_traits.hpp> 47 bool throw_if_accessed =
false>
51 boost::conditional<boost::is_const<T>::value,
52 typename boost::add_const<
58 throw std::logic_error(
"VectorView: the default template " 59 "specialization not implemented");
63 throw std::logic_error(
"VectorView: the default template " 64 "specialization not implemented");
68 throw std::logic_error(
"VectorView: the default template " 69 "specialization not implemented");
73 template <
typename T,
bool is_array>
77 boost::conditional<boost::is_const<T>::value,
78 typename boost::add_const<
87 throw std::logic_error(
"VectorView: this cannot be accessed");
91 throw std::logic_error(
"VectorView: this cannot be accessed");
100 boost::conditional<boost::is_const<T>::value,
101 typename boost::add_const<
121 template <
typename T>
125 boost::conditional<boost::is_const<T>::value,
126 typename boost::add_const<
boost::conditional< boost::is_const< T >::value, typename boost::add_const< typename scalar_type< T >::type >::type, typename scalar_type< T >::type >::type scalar_t
scalar_t & operator[](int i)
Template metaprogram indicates whether a type is vector_like.
boost::conditional< boost::is_const< T >::value, typename boost::add_const< typename scalar_type< T >::type >::type, typename scalar_type< T >::type >::type scalar_t
scalar_t & operator[](int i) const
scalar_type_helper< is_vector< T >::value, T >::type type
scalar_t & operator[](int i)
boost::conditional< boost::is_const< T >::value, typename boost::add_const< typename scalar_type< T >::type >::type, typename scalar_type< T >::type >::type scalar_t
scalar_t & operator[](int i) const
scalar_t & operator[](int i) const
boost::conditional< boost::is_const< T >::value, typename boost::add_const< typename scalar_type< T >::type >::type, typename scalar_type< T >::type >::type scalar_t
scalar_t & operator[](int i) const
scalar_t & operator[](int i)
scalar_t & operator[](int i)
VectorView is a template expression that is constructed with a container or scalar, which it then allows to be used as an array using operator[].