1 /* -*- C++ -*- ------------------------------------------------------------
3 Copyright (c) 2007 Jesse Anders and Demian Nave http://cmldev.net/
5 The Configurable Math Library (CML) is distributed under the terms of the
6 Boost Software License, v1.0 (see cml/LICENSE for details).
8 *-----------------------------------------------------------------------*/
13 #ifndef vector_traits_h
14 #define vector_traits_h
16 #include <cml/et/traits.h>
21 /** Expression traits for a vector<> type. */
22 template<typename E
, class AT
>
23 struct ExprTraits
< cml::vector
<E
,AT
> >
25 typedef typename
cml::vector
<E
,AT
>::expr_type expr_type
;
26 typedef typename
expr_type::value_type value_type
;
27 typedef typename
expr_type::expr_reference reference
;
28 typedef typename
expr_type::expr_const_reference const_reference
;
29 typedef typename
expr_type::result_tag result_tag
;
30 typedef typename
expr_type::size_tag size_tag
;
31 typedef typename
expr_type::resizing_tag resizing_tag
;
32 typedef typename
expr_type::assignable_tag assignable_tag
;
33 typedef expr_type result_type
;
34 typedef expr_leaf_tag node_tag
;
36 value_type
get(const expr_type
& v
, size_t i
) const { return v
[i
]; }
37 size_t size(const expr_type
& v
) const { return v
.size(); }
46 // -------------------------------------------------------------------------