#ifndef BOOST_MPL_GCD_HPP_INCLUDED #define BOOST_MPL_GCD_HPP_INCLUDED #include "boost/mpl/minus.hpp" #include "boost/mpl/modulus.hpp" #include "boost/mpl/equal_to.hpp" /* mpl 'types' implementation of greatest common denominator */ // after "boost/math/common_factor_ct.hpp" which is... // (C) Copyright Daryle Walker and Stephen Cleary 2001-2002. // (C) Copyright Andy Little 2005 // 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) namespace boost{namespace mpl{ template struct gcd; namespace detail{ template< typename T> struct zero_type : minus {}; template struct is_zero : equal_to< T, zero_type >{}; template < typename Lhs, typename Rhs, bool Tail = is_zero::value > struct gcd_impl; template < typename Lhs, typename Rhs > struct gcd_impl : gcd_impl< Rhs, typename mpl::modulus::type >{ }; template < typename Lhs, typename Rhs > struct gcd_impl : Lhs {}; }//detail template struct gcd : detail::gcd_impl< typename Lhs::type, typename Rhs::type >{}; }}// boost::mpl #endif