|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r67588 - trunk/boost/ratio/mpl
From: vicente.botet_at_[hidden]
Date: 2011-01-02 15:25:00
Author: viboes
Date: 2011-01-02 15:24:58 EST (Sun, 02 Jan 2011)
New Revision: 67588
URL: http://svn.boost.org/trac/boost/changeset/67588
Log:
Boost.Ratio: Added some mpl arithmetic operations + cleanup
Added:
trunk/boost/ratio/mpl/divides.hpp (contents, props changed)
trunk/boost/ratio/mpl/minus.hpp (contents, props changed)
trunk/boost/ratio/mpl/plus.hpp (contents, props changed)
trunk/boost/ratio/mpl/times.hpp (contents, props changed)
Text files modified:
trunk/boost/ratio/mpl/rational_c_tag.hpp | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
Added: trunk/boost/ratio/mpl/divides.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/ratio/mpl/divides.hpp 2011-01-02 15:24:58 EST (Sun, 02 Jan 2011)
@@ -0,0 +1,30 @@
+// divides.hpp
+//
+// (C) Copyright 2011 Vicente J. Botet Escriba
+// Use, modification and distribution are subject to 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_RATIO_MPL_DIVIDES_HPP
+#define BOOST_RATIO_MPL_DIVIDES_HPP
+
+#include <boost/ratio.hpp>
+#include <boost/ratio/mpl/numeric_cast.hpp>
+#include <boost/mpl/divides.hpp>
+
+namespace boost {
+namespace mpl {
+
+template<>
+struct divides_impl< rational_c_tag,rational_c_tag >
+{
+ template< typename R1, typename R2 > struct apply
+ : ratio_divide<R1, R2>
+ {
+ };
+};
+}
+}
+
+#endif // BOOST_RATIO_MPL_DIVIDES_HPP
Added: trunk/boost/ratio/mpl/minus.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/ratio/mpl/minus.hpp 2011-01-02 15:24:58 EST (Sun, 02 Jan 2011)
@@ -0,0 +1,30 @@
+// minus.hpp
+//
+// (C) Copyright 2011 Vicente J. Botet Escriba
+// Use, modification and distribution are subject to 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_RATIO_MPL_MINUS_HPP
+#define BOOST_RATIO_MPL_MINUS_HPP
+
+#include <boost/ratio.hpp>
+#include <boost/ratio/mpl/numeric_cast.hpp>
+#include <boost/mpl/minus.hpp>
+
+namespace boost {
+namespace mpl {
+
+template<>
+struct minus_impl< rational_c_tag,rational_c_tag >
+{
+ template< typename R1, typename R2 > struct apply
+ : ratio_subtract<R1, R2>
+ {
+ };
+};
+}
+}
+
+#endif // BOOST_RATIO_MPL_MINUS_HPP
Added: trunk/boost/ratio/mpl/plus.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/ratio/mpl/plus.hpp 2011-01-02 15:24:58 EST (Sun, 02 Jan 2011)
@@ -0,0 +1,30 @@
+// plus.hpp
+//
+// (C) Copyright 2011Vicente J. Botet Escriba
+// Use, modification and distribution are subject to 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_RATIO_MPL_PLUS_HPP
+#define BOOST_RATIO_MPL_PLUS_HPP
+
+#include <boost/ratio.hpp>
+#include <boost/ratio/mpl/numeric_cast.hpp>
+#include <boost/mpl/plus.hpp>
+
+namespace boost {
+namespace mpl {
+
+template<>
+struct plus_impl< rational_c_tag,rational_c_tag >
+{
+ template< typename R1, typename R2 > struct apply
+ : ratio_add<R1, R2>
+ {
+ };
+};
+}
+}
+
+#endif // BOOST_RATIO_MPL_PLUS_HPP
Modified: trunk/boost/ratio/mpl/rational_c_tag.hpp
==============================================================================
--- trunk/boost/ratio/mpl/rational_c_tag.hpp (original)
+++ trunk/boost/ratio/mpl/rational_c_tag.hpp 2011-01-02 15:24:58 EST (Sun, 02 Jan 2011)
@@ -16,7 +16,7 @@
namespace boost {
namespace mpl {
-struct rational_c_tag : mpl::int_<10> {};
+struct rational_c_tag : int_<10> {};
}
}
Added: trunk/boost/ratio/mpl/times.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/ratio/mpl/times.hpp 2011-01-02 15:24:58 EST (Sun, 02 Jan 2011)
@@ -0,0 +1,30 @@
+// times.hpp
+//
+// (C) Copyright 2011 Vicente J. Botet Escriba
+// Use, modification and distribution are subject to 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_RATIO_MPL_TIMES_HPP
+#define BOOST_RATIO_MPL_TIMES_HPP
+
+#include <boost/ratio.hpp>
+#include <boost/ratio/mpl/numeric_cast.hpp>
+#include <boost/mpl/times.hpp>
+
+namespace boost {
+namespace mpl {
+
+template<>
+struct times_impl< rational_c_tag,rational_c_tag >
+{
+ template< typename R1, typename R2 > struct apply
+ : ratio_multiply<R1, R2>
+ {
+ };
+};
+}
+}
+
+#endif // BOOST_RATIO_MPL_TIMES_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