|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r67597 - trunk/boost/ratio/mpl
From: vicente.botet_at_[hidden]
Date: 2011-01-02 15:55:20
Author: viboes
Date: 2011-01-02 15:55:17 EST (Sun, 02 Jan 2011)
New Revision: 67597
URL: http://svn.boost.org/trac/boost/changeset/67597
Log:
Boost.Ratio: Added more mpl arithmetic operations
Added:
trunk/boost/ratio/mpl/abs.hpp (contents, props changed)
trunk/boost/ratio/mpl/gcd.hpp (contents, props changed)
trunk/boost/ratio/mpl/lcm.hpp (contents, props changed)
trunk/boost/ratio/mpl/negate.hpp (contents, props changed)
trunk/boost/ratio/mpl/sign.hpp (contents, props changed)
Added: trunk/boost/ratio/mpl/abs.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/ratio/mpl/abs.hpp 2011-01-02 15:55:17 EST (Sun, 02 Jan 2011)
@@ -0,0 +1,30 @@
+// abs.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_ABS_HPP
+#define BOOST_RATIO_MPL_ABS_HPP
+
+#include <boost/ratio.hpp>
+#include <boost/ratio/mpl/numeric_cast.hpp>
+#include <boost/mpl/abs.hpp>
+
+namespace boost {
+namespace mpl {
+
+template<>
+struct abs_impl< rational_c_tag >
+{
+ template< typename R > struct apply
+ : ratio_abs<R>
+ {
+ };
+};
+}
+}
+
+#endif // BOOST_RATIO_MPL_ABS_HPP
Added: trunk/boost/ratio/mpl/gcd.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/ratio/mpl/gcd.hpp 2011-01-02 15:55:17 EST (Sun, 02 Jan 2011)
@@ -0,0 +1,30 @@
+// gcd.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_GCD_HPP
+#define BOOST_RATIO_MPL_GCD_HPP
+
+#include <boost/ratio.hpp>
+#include <boost/ratio/mpl/numeric_cast.hpp>
+#include <boost/mpl/gcd.hpp>
+
+namespace boost {
+namespace mpl {
+
+template<>
+struct gcd_impl< rational_c_tag,rational_c_tag >
+{
+ template< typename R1, typename R2 > struct apply
+ : ratio_gcd<R1, R2>
+ {
+ };
+};
+}
+}
+
+#endif // BOOST_RATIO_MPL_GCD_HPP
Added: trunk/boost/ratio/mpl/lcm.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/ratio/mpl/lcm.hpp 2011-01-02 15:55:17 EST (Sun, 02 Jan 2011)
@@ -0,0 +1,30 @@
+// lcm.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_LCM_HPP
+#define BOOST_RATIO_MPL_LCM_HPP
+
+#include <boost/ratio.hpp>
+#include <boost/ratio/mpl/numeric_cast.hpp>
+#include <boost/mpl/lcm.hpp>
+
+namespace boost {
+namespace mpl {
+
+template<>
+struct lcm_impl< rational_c_tag,rational_c_tag >
+{
+ template< typename R1, typename R2 > struct apply
+ : ratio_lcm<R1, R2>
+ {
+ };
+};
+}
+}
+
+#endif // BOOST_RATIO_MPL_LCM_HPP
Added: trunk/boost/ratio/mpl/negate.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/ratio/mpl/negate.hpp 2011-01-02 15:55:17 EST (Sun, 02 Jan 2011)
@@ -0,0 +1,30 @@
+// negate.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_NEGATE_HPP
+#define BOOST_RATIO_MPL_NEGATE_HPP
+
+#include <boost/ratio.hpp>
+#include <boost/ratio/mpl/numeric_cast.hpp>
+#include <boost/mpl/negate.hpp>
+
+namespace boost {
+namespace mpl {
+
+template<>
+struct negate_impl< rational_c_tag >
+{
+ template< typename R > struct apply
+ : ratio_negate<R>
+ {
+ };
+};
+}
+}
+
+#endif // BOOST_RATIO_MPL_NEGATE_HPP
Added: trunk/boost/ratio/mpl/sign.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/ratio/mpl/sign.hpp 2011-01-02 15:55:17 EST (Sun, 02 Jan 2011)
@@ -0,0 +1,30 @@
+// sign.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_SIGN_HPP
+#define BOOST_RATIO_MPL_SIGN_HPP
+
+#include <boost/ratio.hpp>
+#include <boost/ratio/mpl/numeric_cast.hpp>
+#include <boost/mpl/sign.hpp>
+
+namespace boost {
+namespace mpl {
+
+template<>
+struct sign_impl< rational_c_tag >
+{
+ template< typename R > struct apply
+ : ratio_sign<R>
+ {
+ };
+};
+}
+}
+
+#endif // BOOST_RATIO_MPL_SIGN_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