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");
74 template <
typename T,
bool is_array>
78 boost::conditional<boost::is_const<T>::value,
79 typename boost::add_const<
88 throw std::logic_error(
"VectorView: this cannot be accessed");
92 throw std::logic_error(
"VectorView: this cannot be accessed");
101 boost::conditional<boost::is_const<T>::value,
102 typename boost::add_const<
123 template <
typename T>
127 boost::conditional<boost::is_const<T>::value,
128 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_type_helper< is_vector< T >::value, T >::type type
scalar_t & operator[](int i) const
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
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[].
scalar_t & operator[](int i) const