vector_traits.h

Go to the documentation of this file.
00001 /* -*- C++ -*- ------------------------------------------------------------
00002  
00003 Copyright (c) 2007 Jesse Anders and Demian Nave http://cmldev.net/
00004 
00005 The Configurable Math Library (CML) is distributed under the terms of the
00006 Boost Software License, v1.0 (see cml/LICENSE for details).
00007 
00008  *-----------------------------------------------------------------------*/
00013 #ifndef vector_traits_h
00014 #define vector_traits_h
00015 
00016 #include <cml/et/traits.h>
00017 
00018 namespace cml {
00019 namespace et {
00020 
00022 template<typename E, class AT>
00023 struct ExprTraits< cml::vector<E,AT> >
00024 {
00025     typedef typename cml::vector<E,AT>::expr_type expr_type;
00026     typedef typename expr_type::value_type value_type;
00027     typedef typename expr_type::expr_reference reference;
00028     typedef typename expr_type::expr_const_reference const_reference;
00029     typedef typename expr_type::result_tag result_tag;
00030     typedef typename expr_type::size_tag size_tag;
00031     typedef typename expr_type::resizing_tag resizing_tag;
00032     typedef typename expr_type::assignable_tag assignable_tag;
00033     typedef expr_type result_type;
00034     typedef expr_leaf_tag node_tag;
00035 
00036     value_type get(const expr_type& v, size_t i) const { return v[i]; }
00037     size_t size(const expr_type& v) const { return v.size(); }
00038 };
00039 
00040 } // namespace et
00041 } // namespace cml
00042 
00043 
00044 #endif
00045 
00046 // -------------------------------------------------------------------------
00047 // vim:ft=cpp

Generated on Sat Jul 18 19:35:36 2009 for CML 1.0 by  doxygen 1.5.9