mirror of
https://github.com/boostorg/integer.git
synced 2026-04-29 18:33:19 +02:00
2nd draft with zero errors from Inspect.
This commit is contained in:
@@ -7,12 +7,12 @@
|
||||
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
//! \file
|
||||
//! \brief Evaluate Greatest Common Divisor at compile-time.
|
||||
//! \brief Evaluate Greatest Common Divisor and Least Common Multiple at compile-time.
|
||||
|
||||
#ifndef BOOST_INTEGER_COMMON_FACTOR_CT_HPP
|
||||
#define BOOST_INTEGER_COMMON_FACTOR_CT_HPP
|
||||
|
||||
//#include <boost/integer_fwd.hpp> // self include
|
||||
#include <boost/integer_fwd.hpp> // Include for declaration of static_gcd_type and static_gcd.
|
||||
#include <boost/config.hpp> // for BOOST_STATIC_CONSTANT, etc.
|
||||
#include <boost/cstdint.hpp> // for boost::uintmax_t
|
||||
|
||||
@@ -20,9 +20,7 @@ namespace boost
|
||||
{
|
||||
namespace integer
|
||||
{
|
||||
// Warning: this is from 1.58 in namespace boost::integer and no longer in namespace boost::math.
|
||||
|
||||
typedef boost::uintmax_t static_gcd_type;
|
||||
// Warning: From 1.58 this is in namespace boost::integer and no longer in namespace boost::math.
|
||||
|
||||
// Implementation details --------------------------------------------------//
|
||||
//! \cond DETAIL
|
||||
|
||||
@@ -17,35 +17,43 @@
|
||||
#ifndef BOOST_INTEGER_COMMON_FACTOR_RT_HPP
|
||||
#define BOOST_INTEGER_COMMON_FACTOR_RT_HPP
|
||||
|
||||
#include <boost/integer_fwd.hpp> // self include
|
||||
|
||||
#include <boost/config.hpp> // for BOOST_NESTED_TEMPLATE, etc.
|
||||
#include <boost/limits.hpp> // for std::numeric_limits
|
||||
#include <climits> // for CHAR_MIN
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#include <boost/integer_fwd.hpp> // Include for declarations of gcd_evaluator and lcm_evaluator.
|
||||
|
||||
#include <climits> // for CHAR_MIN
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4127 4244) // Conditional expression is constant
|
||||
#endif
|
||||
|
||||
// Warning: this is from 1.58 in namespace boost::integer and no longer in namespace boost::math.
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace integer
|
||||
{
|
||||
// Warning: this is from 1.58 in namespace boost::interger and no longer in namespace boost::math.
|
||||
// Forward declarations copied from <boost/math/common_factor_rt.hpp> at 1.58 -----//
|
||||
|
||||
// Forward declarations for function templates -----------------------------//
|
||||
|
||||
template < typename IntegerType >
|
||||
IntegerType gcd( IntegerType const &a, IntegerType const &b );
|
||||
IntegerType gcd( IntegerType const &a, IntegerType const &b );
|
||||
|
||||
template < typename IntegerType >
|
||||
IntegerType lcm( IntegerType const &a, IntegerType const &b );
|
||||
|
||||
IntegerType lcm( IntegerType const &a, IntegerType const &b );
|
||||
|
||||
// Greatest common divisor evaluator class declaration ---------------------//
|
||||
|
||||
template < typename IntegerType >
|
||||
class gcd_evaluator;
|
||||
|
||||
template < typename IntegerType >
|
||||
class lcm_evaluator;
|
||||
|
||||
template < typename IntegerType >
|
||||
class gcd_evaluator
|
||||
{
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include <boost/limits.hpp> // for std::numeric_limits
|
||||
#include <boost/cstdint.hpp> // For intmax_t
|
||||
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
@@ -160,6 +159,8 @@ template <static_min_max_unsigned_type Value1, static_min_max_unsigned_type Valu
|
||||
template <static_min_max_unsigned_type Value1, static_min_max_unsigned_type Value2>
|
||||
struct static_unsigned_max;
|
||||
|
||||
namespace integer
|
||||
{
|
||||
|
||||
// From <boost/integer/common_factor_ct.hpp>
|
||||
|
||||
@@ -182,6 +183,7 @@ template < typename IntegerType >
|
||||
template < typename IntegerType >
|
||||
class lcm_evaluator;
|
||||
|
||||
] // namespace integer
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
Reference in New Issue
Block a user