Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59140 - sandbox/numeric_bindings/boost/numeric/bindings/boost
From: rutger_at_[hidden]
Date: 2010-01-19 10:05:52


Author: rutger
Date: 2010-01-19 10:05:51 EST (Tue, 19 Jan 2010)
New Revision: 59140
URL: http://svn.boost.org/trac/boost/changeset/59140

Log:
added support for Boost.Array

Added:
   sandbox/numeric_bindings/boost/numeric/bindings/boost/
   sandbox/numeric_bindings/boost/numeric/bindings/boost/array.hpp (contents, props changed)

Added: sandbox/numeric_bindings/boost/numeric/bindings/boost/array.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/boost/numeric/bindings/boost/array.hpp 2010-01-19 10:05:51 EST (Tue, 19 Jan 2010)
@@ -0,0 +1,47 @@
+//
+// Copyright (c) 2009 Rutger ter Borg
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_NUMERIC_BINDINGS_BOOST_ARRAY_HPP
+#define BOOST_NUMERIC_BINDINGS_BOOST_ARRAY_HPP
+
+#include <boost/numeric/bindings/detail/adaptor.hpp>
+#include <boost/array.hpp>
+
+namespace boost {
+namespace numeric {
+namespace bindings {
+namespace detail {
+
+template< typename T, std::size_t N, typename Id, typename Enable >
+struct adaptor< boost::array<T,N>, Id, Enable > {
+
+ typedef typename copy_const< Id, T >::type value_type;
+ typedef mpl::map<
+ mpl::pair< tag::value_type, value_type >,
+ mpl::pair< tag::entity, tag::vector >,
+ mpl::pair< tag::size_type<1>, mpl::int_<N> >,
+ mpl::pair< tag::data_structure, tag::linear_array >,
+ mpl::pair< tag::stride_type<1>, tag::contiguous >
+ > property_map;
+
+ static value_type* begin_value( Id& t ) {
+ return t.begin();
+ }
+
+ static value_type* end_value( Id& t ) {
+ return t.end();
+ }
+
+};
+
+} // namespace detail
+} // namespace bindings
+} // namespace numeric
+} // namespace boost
+
+#endif


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk