00001 /* 00002 * 00003 * Copyright (c) 2002, 2003 Kresimir Fresl, Toon Knapen and Karl Meerbergen 00004 * 00005 * Distributed under the Boost Software License, Version 1.0. 00006 * (See accompanying file LICENSE_1_0.txt or copy at 00007 * http://www.boost.org/LICENSE_1_0.txt) 00008 * 00009 * KF acknowledges the support of the Faculty of Civil Engineering, 00010 * University of Zagreb, Croatia. 00011 * 00012 */ 00013 00014 #ifndef BOOST_NUMERIC_BINDINGS_TRAITS_STD_VECTOR_H 00015 #define BOOST_NUMERIC_BINDINGS_TRAITS_STD_VECTOR_H 00016 00017 #include <boost/numeric/bindings/traits/vector_traits.hpp> 00018 00019 #ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS 00020 00021 #include <vector> 00022 00023 00024 namespace boost { namespace numeric { namespace bindings { namespace traits { 00025 00026 // std::vector<> 00027 template <typename T, typename Alloc, typename V> 00028 struct vector_detail_traits<std::vector<T, Alloc>, V> 00029 : default_vector_traits< V, T > 00030 { 00031 00032 #ifndef BOOST_NUMERIC_BINDINGS_NO_SANITY_CHECK 00033 BOOST_STATIC_ASSERT( (boost::is_same< std::vector<T, Alloc>, typename boost::remove_const<V>::type >::value) ); 00034 #endif 00035 00036 typedef std::vector<T,Alloc> identifier_type; 00037 typedef V vector_type; 00038 typedef typename default_vector_traits< V, T >::pointer pointer; 00039 00040 static pointer storage (vector_type& v) { return &v.front(); } 00041 }; 00042 00043 }}}} 00044 00045 #endif // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS 00046 00047 #endif // BOOST_NUMERIC_BINDINGS_TRAITS_STD_VECTOR_H