Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58938 - sandbox/numeric_bindings/boost/numeric/bindings
From: rutger_at_[hidden]
Date: 2010-01-12 08:22:51


Author: rutger
Date: 2010-01-12 08:22:50 EST (Tue, 12 Jan 2010)
New Revision: 58938
URL: http://svn.boost.org/trac/boost/changeset/58938

Log:
added support for bandwidth( M, Tag ) with Tag either tag::upper, tag::lower

Text files modified:
   sandbox/numeric_bindings/boost/numeric/bindings/bandwidth.hpp | 22 ++++++++++++++++------
   1 files changed, 16 insertions(+), 6 deletions(-)

Modified: sandbox/numeric_bindings/boost/numeric/bindings/bandwidth.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/bandwidth.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/bandwidth.hpp 2010-01-12 08:22:50 EST (Tue, 12 Jan 2010)
@@ -38,10 +38,20 @@
 
 };
 
-template< typename T, typename Index >
-struct bandwidth_impl< T, Index,
+template< typename T >
+struct bandwidth_impl< T, tag::lower >:
+ bandwidth_impl< T, tag::index<1> > {};
+
+
+template< typename T >
+struct bandwidth_impl< T, tag::upper >:
+ bandwidth_impl< T, tag::index<2> > {};
+
+
+template< typename T, int N >
+struct bandwidth_impl< T, tag::index<N>,
         typename boost::enable_if< typename mpl::and_<
- mpl::greater< Index, rank<T> >,
+ mpl::greater< tag::index<N>, rank<T> >,
             is_same_at< T, tag::bandwidth_type<1>, std::ptrdiff_t >
>::type >::type > {
 
@@ -53,10 +63,10 @@
 
 };
 
-template< typename T, typename Index >
-struct bandwidth_impl< T, Index,
+template< typename T, int N >
+struct bandwidth_impl< T, tag::index<N>,
         typename boost::enable_if< typename mpl::and_<
- mpl::greater< Index, rank<T> >,
+ mpl::greater< tag::index<N>, rank<T> >,
             mpl::not_< is_same_at< T, tag::bandwidth_type<1>, std::ptrdiff_t > >
>::type >::type > {
 


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