Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59112 - sandbox/numeric_bindings/boost/numeric/bindings
From: rutger_at_[hidden]
Date: 2010-01-18 03:20:19


Author: rutger
Date: 2010-01-18 03:20:18 EST (Mon, 18 Jan 2010)
New Revision: 59112
URL: http://svn.boost.org/trac/boost/changeset/59112

Log:
added has_rank<T,N> meta-function

Added:
   sandbox/numeric_bindings/boost/numeric/bindings/has_rank.hpp (contents, props changed)
Text files modified:
   sandbox/numeric_bindings/boost/numeric/bindings/rank.hpp | 4 ++--
   1 files changed, 2 insertions(+), 2 deletions(-)

Added: sandbox/numeric_bindings/boost/numeric/bindings/has_rank.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/boost/numeric/bindings/has_rank.hpp 2010-01-18 03:20:18 EST (Mon, 18 Jan 2010)
@@ -0,0 +1,36 @@
+//
+// 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_HAS_RANK_HPP
+#define BOOST_NUMERIC_BINDINGS_HAS_RANK_HPP
+
+#include <boost/numeric/bindings/detail/adaptor.hpp>
+#include <boost/mpl/equal_to.hpp>
+
+namespace boost {
+namespace numeric {
+namespace bindings {
+
+template< typename T, int N, typename Enable = void >
+struct has_rank {};
+
+template< typename T, int N >
+struct has_rank<
+ T, N,
+ typename boost::enable_if< detail::is_adaptable<T> >::type
+ >:
+ mpl::equal_to<
+ typename detail::property_at< T, tag::entity >::type,
+ mpl::int_< N >
+ > {};
+
+} // namespace bindings
+} // namespace numeric
+} // namespace boost
+
+#endif

Modified: sandbox/numeric_bindings/boost/numeric/bindings/rank.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/rank.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/rank.hpp 2010-01-18 03:20:18 EST (Mon, 18 Jan 2010)
@@ -6,8 +6,8 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 //
 
-#ifndef BOOST_NUMERIC_BINDINGS_TENSOR_RANK_HPP
-#define BOOST_NUMERIC_BINDINGS_TENSOR_RANK_HPP
+#ifndef BOOST_NUMERIC_BINDINGS_RANK_HPP
+#define BOOST_NUMERIC_BINDINGS_RANK_HPP
 
 #include <boost/numeric/bindings/detail/adaptor.hpp>
 


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