diff --git a/doc/ratio.qbk b/doc/ratio.qbk index 629b792..c1a0ed4 100644 --- a/doc/ratio.qbk +++ b/doc/ratio.qbk @@ -104,8 +104,6 @@ [def __Rational_Constant [link ratio.reference.mpl.rational_constant Rational Constant]] -[/warning Ratio is not part of the Boost libraries.] - [/===============] [section Overview] [/===============] @@ -137,7 +135,9 @@ Finally, you can mentally add the following to any code fragments in this docume [section Motivation] [/=================] -__Boost_Ratio aims to implement the compile time ratio facility in C++0x, as proposed in [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2661.htm [*N2661 - A Foundation to Sleep On]]. That document provides background and motivation for key design decisions and is the source of a good deal of information in this documentation. +__Boost_Ratio aimed to implement the compile time ratio facility in C++11, as proposed in [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2661.htm [*N2661 - A Foundation to Sleep On]]. That document provides background and motivation for key design decisions and is the source of a good deal of information in this documentation. + +Since C++11 is now universally available, this library is only retained for backward compatibility, and starting with Boost 1.84, it's implemented in terms of the standard `` header. [endsect] @@ -151,8 +151,6 @@ The __Boost_Ratio library provides: * It provides a textual representation of `boost::ratio` in the form of a `std::basic_string` which can be useful for I/O. -* Some extension related to the __Rational_Constant concept enabling the use of __ratio<> in the context of [*Boost.MPL] numeric metafunctions. - [endsect] [endsect] @@ -174,17 +172,7 @@ The __Boost_Ratio library provides: [heading Getting Boost.Ratio ] [/=================================] -Boost.Ratio is in the latest Boost release in the folder `/boost/ratio`. Documentation, tests and examples folder are at `boost/libs/ratio/`. - -You can also access the latest (unstable?) state from the [@http://svn.boost.org/svn/boost/trunk Boost trunk] directories `boost/ratio` and `libs/ratio`. - -Just go to [@http://svn.boost.org/trac/boost/wiki/BoostSubversion the wiki] and follow the instructions there for anonymous SVN access. - -[/==========================================] -[heading Where to install Boost.Ratio? ] -[/==========================================] - -The simple way is to decompress (or checkout from SVN) the files in your BOOST_ROOT directory. +__Boost_Ratio is part of Boost, so you get it as part of the Boost release. [/=================================] [heading Building Boost.Ratio ] @@ -193,36 +181,6 @@ The simple way is to decompress (or checkout from SVN) the files in your BOOST_R __Boost_Ratio is a header only library, so no need to compile anything, you just need to `include `. -[/===================] -[heading Requirements] -[/===================] - -__Boost_Ratio depends on some Boost libraries. For these specific parts you must use either Boost version 1.39.0 or later (even older versions may work). - -In particular, __Boost_Ratio depends on: - -[variablelist -[ - [[@http://www.boost.org/libs/config [*Boost.Config]]] [for configuration purposes, ...] -] -[ - [[@http://www.boost.org/libs/integer [*Boost.Integer]]] [for cstdint conformance, and integer traits ...] -] -[ - [[@http://www.boost.org/libs/mpl [*Boost.MPL]]] [for MPL Assert and bool, logical ...] -] -[ - [[@http://www.boost.org/libs/static_assert [*Boost.StaticAssert]]] [for STATIC_ASSERT, ...] -] -[ - [[@http://www.boost.org/libs/type_traits [*Boost.TypeTraits]]] [for is_base, is_convertible ...] -] -[ - [[@http://www.boost.org/libs/utility [*Boost.Utility/EnableIf]]] [for enable_if, ...] -] -] - - [/=========================================================] [heading Building an executable that uses __Boost_Ratio ] [/=========================================================] @@ -242,59 +200,11 @@ All functions in the library are exception-neutral, providing the strong excepti All functions in the library are thread-unsafe except when noted explicitly. -[/========================] -[heading Tested compilers ] -[/========================] - -__Boost_Ratio should work with an C++03 conforming compiler. The current version has been tested on: - -Windows with - -* MSVC 10.0 - -MinGW with - -* GCC 4.5.0 -* GCC 4.5.0 -std=c++0x -* GCC 4.5.2 -* GCC 4.5.2 -std=c++0x -* GCC 4.6.0 -* GCC 4.6.0 -std=c++0x - -Ubuntu with -* GCC 4.4.6 -* GCC 4.4.6 -std=c++0x -* GCC 4.5.4 -* GCC 4.5.4 -std=c++0x -* GCC 4.6.1 -* GCC 4.6.1 -std=c++0x -* Intel 12.1.3 -* Intel 12.1.3 -std=c++0x - -OsX with - -* GCC 4.1.2 -* GCC 4.6.2 -* GCC 4.6.2 -std=c++0x -* GCC 4.7.0 -* GCC 4.7.0 -std=c++0x -* GCC 4.7.1 -* GCC 4.7.1 -std=c++0x -* clang 1.6 -* clang 2.9 -* clang 2.9 -std=c++0x -* clang 3.0 -* clang 3.0 -std=c++0x -* clang 3.1 -* clang 3.1 -std=c++0x -* clang 3.1 -std=c++0x -stdlib=libc++ -* clang 3.2 -* clang 3.2 -std=c++11 -* clang 3.2 -std=c++11 -stdlib=libc++ - -[note Please let us know how this works on other platforms/compilers.] - -[note Please send any questions, comments and bug reports to boost lists boost org.] +[/===========================] +[heading Supported compilers ] +[/===========================] + +__Boost_Ratio should work with any C++11 conforming compiler. [endsect] [endsect] @@ -380,16 +290,6 @@ The output will be ratio_string, char>::symbol() = [2/3] -[heading Ratio MPL Numeric Metafunctions] - -With the view of the _ratio class as a __Rational_Constant we can mix _ratio<> and [*Boost.MPL] Integral Constants in the same expression, as in - - typedef mpl::times, giga>::type _5giga; - // _5giga::num == 5000000000, _5giga::den == 1 - - typedef mpl::times, nano>::type _5nano; - // _5nano::num == 1, _5nano::den == 200000000 - [endsect] [/===============] @@ -659,74 +559,7 @@ Finally, we can exercise what we've created, even using custom time durations (` [section:reference Reference ] [/=================] -[/=================================================] -[section:config_hpp Header ``] -[/=================================================] - - - // Configuration macros - #define __BOOST_RATIO_VERSION - #define __BOOST_RATIO_EXTENSIONS - #define __BOOST_RATIO_PROVIDES_DEPRECATED_FEATURES_SINCE_V2_0_0 - #define __BOOST_RATIO_DONT_PROVIDE_DEPRECATED_FEATURES_SINCE_V2_0_0 - #define __BOOST_RATIO_USES_STATIC_ASSERT - #define __BOOST_RATIO_USES_MPL_ASSERT - #define __BOOST_RATIO_USES_ARRAY_ASSERT - - -[section:ext Extensions] - -When __BOOST_RATIO_EXTENSIONS is defined, __Boost_Ratio provides in addition some extension to the C++ standard, see below. - -[note Support for `BOOST_RATIO_EXTENSIONS` is deprecated and will eventually be removed when Boost.Ratio is -implemented in terms of the standard C++11 `` header.] - -[endsect] -[section:deprecated Deprecated] - -When __BOOST_RATIO_PROVIDES_DEPRECATED_FEATURES_SINCE_V2_0_0 is defined the deprecated features stated as DEPRECATED V2 are provided. - -When __BOOST_RATIO_DONT_PROVIDE_DEPRECATED_FEATURES_SINCE_V2_0_0 is defined the deprecated features stated as DEPRECATED V2 are NOT provided. - -[endsect] -[section:version Version] - -__BOOST_RATIO_VERSION stands for the Boost.Ratio version which can be 1 or 2. The default up to 1.55 is version 1. Since 1.56 it will be 2. - -When __BOOST_RATIO_VERSION is 1 __BOOST_RATIO_PROVIDES_DEPRECATED_FEATURES_SINCE_V2_0_0 is defined by default. - -When __BOOST_RATIO_VERSION is 2 __BOOST_RATIO_DONT_PROVIDE_DEPRECATED_FEATURES_SINCE_V2_0_0 is defined by default. - -[endsect] -[section:assert Static Assert] - -When BOOST_NO_CXX11_STATIC_ASSERT is defined, the user can select the way static assertions are reported. Define - -* __BOOST_RATIO_USES_STATIC_ASSERT to use Boost.StaticAssert. -* __BOOST_RATIO_USES_MPL_ASSERT to use [*Boost.MPL] static assertions. -* __BOOST_RATIO_USES_ARRAY_ASSERT to use __Boost_Ratio internal static assertions. - -The default behavior is as if __BOOST_RATIO_USES_ARRAY_ASSERT was defined. - -When __BOOST_RATIO_USES_MPL_ASSERT is not defined the following symbols are defined as shown: - - #define BOOST_RATIO_OVERFLOW_IN_ADD "overflow in ratio add" - #define BOOST_RATIO_OVERFLOW_IN_SUB "overflow in ratio sub" - #define BOOST_RATIO_OVERFLOW_IN_MUL "overflow in ratio mul" - #define BOOST_RATIO_OVERFLOW_IN_DIV "overflow in ratio div" - #define BOOST_RATIO_NUMERATOR_IS_OUT_OF_RANGE "ratio numerator is out of range" - #define BOOST_RATIO_DIVIDE_BY_0 "ratio divide by 0" - #define BOOST_RATIO_DENOMINATOR_IS_OUT_OF_RANGE "ratio denominator is out of range" - -Depending upon the static assertion system used, a hint as to the failing assertion will appear in some form in the compiler diagnostic output. - - -[endsect] -[endsect] - -[/=================================================] -[section:std C++0x Recommendation] -[/=================================================] +[section:std Standard C++11 Functionality] [/=================================================] [section:ratio_ratio_hpp Header ``] @@ -736,7 +569,6 @@ This header includes all the ratio related header files #include #include - #include [endsect] @@ -748,21 +580,14 @@ This header provides forward declarations for the `` file namespace boost { - template class __ratio; + template class __ratio; // ratio arithmetic - template struct __ratio_add; - template struct __ratio_subtract; - template struct __ratio_multiply; - template struct __ratio_divide; - #ifdef BOOST_RATIO_EXTENSIONS - template struct __ratio_power; - template struct __ratio_negate; - template struct __ratio_sign; - template struct __ratio_abs; - template struct __ratio_gcd; - template struct __ratio_lcm; - #endif + template using __ratio_add = /* ... */; + template using __ratio_subtract = /* ... */; + template using __ratio_multiply = /* ... */; + template using __ratio_divide = /* ... */; + template using __ratio_gcd = /* ... */; // ratio comparison template struct __ratio_equal; @@ -789,16 +614,6 @@ This header provides forward declarations for the `` file typedef ratio< 1000000000000LL, 1LL> __tera; typedef ratio< 1000000000000000LL, 1LL> __peta; typedef ratio<1000000000000000000LL, 1LL> __exa; - - #ifdef BOOST_RATIO_EXTENSIONS - // convenience IEC typedefs - typedef ratio< 1024LL> __kibi; - typedef ratio< 1024LL*1024LL> __mebi; - typedef ratio< 1024LL*1024LL*1024LL> __gibi; - typedef ratio< 1024LL*1024LL*1024LL*1024LL> __tebi; - typedef ratio< 1024LL*1024LL*1024LL*1024LL*1024LL> __pebi; - typedef ratio<1024LL*1024LL*1024LL*1024LL*1024LL*1024LL> __exbi; - #endif } [endsect] @@ -812,30 +627,12 @@ __ratio is a facility which is useful in specifying compile-time rational consta [section:ratio Class Template `ratio<>`] - template + template class ratio { public: - static const boost::intmax_t num; - static const boost::intmax_t den; + static constexpr std::intmax_t num; + static constexpr std::intmax_t den; typedef ratio type; - - #ifdef __BOOST_RATIO_EXTENSIONS - typedef mpl::rational_c_tag tag; - typedef boost::rational value_type; - typedef boost::intmax_t num_type; - typedef boost::intmax_t den_type; - - ratio() = default; - - template - ratio(const ratio<_N2, _D2>&); - - template - ratio& operator=(const ratio<_N2, _D2>&); - - static value_type value(); - value_type operator()() const; - #endif }; A diagnostic will be emitted if __ratio is instantiated with `D == 0`, or if the absolute value of `N` or `D` cannot be represented. [*Note:] These rules ensure that infinite ratios are avoided and that for any negative input, there exists a representable value of its absolute value which is positive. In a two's complement representation, this excludes the most negative value. @@ -851,61 +648,6 @@ used when the normalized form of the template arguments are required, since the Two __ratio classes `__ratio` and `__ratio` have the same normalized form if `__ratio::type` is the same type as `__ratio::type` -[section:ca Construction and Assignment] - -Included only if __BOOST_RATIO_EXTENSIONS is defined. - -[heading Default Constructor] - - ratio()=default; - -[*Effects:] Constructs a __ratio object. - -[heading Copy Constructor] - - template - ratio(const __ratio& r); - -[*Effects:] Constructs a __ratio object. - -[*Remarks:] This constructor will not participate in overload resolution unless `r` has the same normalized form as `*this`. - -[heading Assignement] - - template - __ratio& operator=(const __ratio& r); - -[*Effects:] Assigns a __ratio object. - -[*Returns:] *this. - -[*Remarks:] This operator will not participate in overload resolution unless `r` has the same normalized form as `*this`. - -[endsect] - -[section:mpl MPL Numeric Metafunctions] - -Included only if __BOOST_RATIO_EXTENSIONS is defined. - -In order to work with [*Boost.MPL] numeric metafunctions as a __Rational_Constant, the following has beed added: - - typedef mpl::rational_c_tag tag; - typedef boost::rational value_type; - typedef boost::intmax_t num_type; - typedef boost::intmax_t den_type; -[endsect] - -[section:obs Observers] - -Included only if __BOOST_RATIO_EXTENSIONS is defined. - - static value_type value(); - value_type operator()() const; - -[*Returns:] value_type(num,den); - -[endsect] - [endsect] @@ -915,106 +657,35 @@ For each of the class templates in this section, each template parameter refers [heading `ratio_add<>`] - template struct ratio_add { - typedef [/see below] type; - }; + template using ratio_add = /* see below */; -The nested typedef `type` is a synonym for `__ratio::type`. +`ratio_add` is a synonym for `__ratio::type`. [heading `ratio_subtract<>`] - template struct ratio_subtract { - typedef [/see below] type; - }; + template using ratio_subtract = /* see below */; -The nested typedef `type` is a synonym for `__ratio::type`. +`ratio_subtract` is a synonym for `__ratio::type`. [heading `ratio_multiply<>`] - template struct ratio_multiply { - typedef [/see below] type; - }; + template using ratio_multiply = /* see below */; -The nested typedef `type` is a synonym for `__ratio::type`. +`ratio_multiply` is a synonym for `__ratio::type`. [heading `ratio_divide<>`] - template struct ratio_divide { - typedef [/see below] type; - }; - -The nested typedef `type` is a synonym for `__ratio::type`. - -[heading `ratio_power<>`] - -Included only if __BOOST_RATIO_EXTENSIONS is defined. - - template struct ratio_power { - typedef [/see below] type; - }; - -The nested typedef `type` is a synonym for `R* *R` P times. - -[heading `ratio_negate<>`] - -Included only if __BOOST_RATIO_EXTENSIONS is defined. - -This extension of the C++ standard helps in the definition of some [*Boost.MPL] numeric metafunctions. - - - template struct ratio_negate { - typedef [/see below] type; - }; - -The nested typedef `type` is a synonym for `__ratio<-R::num, R::den>::type`. - -[heading `ratio_abs<>`] - -Included only if __BOOST_RATIO_EXTENSIONS is defined. - -This extension of the C++ standard helps in the definition of some [*Boost.MPL] numeric metafunctions. - - template struct ratio_abs { - typedef [/see below] type; - }; - -The nested typedef `type` is a synonym for `__ratio::value, R::den>::type`. + template using ratio_divide = /* see below */; -[heading `ratio_sign<>`] - -Included only if __BOOST_RATIO_EXTENSIONS is defined. - -This extension of the C++ standard helps in the definition of some [*Boost.MPL] numeric metafunctions. - - template struct ratio_sign { - typedef [/see below] type; - }; - -The nested typedef `type` is a synonym for `sign_c::type`. +`ratio_divide` is a synonym for `__ratio::type`. [heading `ratio_gcd<>`] -Included only if __BOOST_RATIO_EXTENSIONS is defined. - -This extension of the C++ standard helps in the definition of some [*Boost.MPL] numeric metafunctions. - - template struct ratio_gcd { - typedef [/see below] type; - }; - -The nested typedef `type` is a synonym for `ratio::value, mpl::lcm_c::value>::type`. - -[heading `ratio_lcm<>`] +This extension of the C++ standard is used by Boost.Chrono. -Included only if __BOOST_RATIO_EXTENSIONS is defined. + template using ratio_gcd = /* see below */; -This extension of the C++ standard helps in the definition of some [*Boost.MPL] numeric metafunctions. - - template struct ratio_lcm { - typedef [/see below] type; - }; - -The nested typedef `type` is a synonym for `ratio::value, gcd_c::value>::type`. +`ratio_gcd` is a synonym for `ratio::type`. [endsect] @@ -1023,37 +694,37 @@ The nested typedef `type` is a synonym for `ratio`] template struct ratio_equal - : public boost::integral_constant {}; + : public std::integral_constant {}; -If R1::num == R2::num && R1::den == R2::den, ratio_equal derives from true_type, else derives from false_type. +If `R1::num == R2::num && R1::den == R2::den`, `ratio_equal` derives from `true_type`, else derives from `false_type`. [heading `ratio_not_equal<>`] template struct ratio_not_equal - : public boost::integral_constant::value> {}; + : public std::integral_constant::value> {}; [heading `ratio_less<>`] template struct ratio_less - : public boost::integral_constant {}; + : public std::integral_constant {}; -If R1::num * R2::den < R2::num * R1::den, ratio_less derives from true_type, else derives from false_type. +If `R1::num * R2::den < R2::num * R1::den`, `ratio_less` derives from `true_type`, else derives from `false_type`. [heading `ratio_less_equal<>`] template struct ratio_less_equal - : public boost::integral_constant::value> {}; + : public std::integral_constant::value> {}; [heading `ratio_greater<>`] template struct ratio_greater - : public boost::integral_constant::value> {}; + : public std::integral_constant::value> {}; [heading `ratio_greater_equal<>`] template struct ratio_greater_equal - : public boost::integral_constant::value> {}; + : public std::integral_constant::value> {}; [endsect] @@ -1082,46 +753,10 @@ The [@http://en.wikipedia.org/wiki/SI_prefix#List_of_SI_prefixes International S [endsect] -[section:ratio_iec_typedefs IEC typedefs] - -Included only if __BOOST_RATIO_EXTENSIONS is defined. - -The [@http://http://en.wikipedia.org/wiki/Binary_prefix#Specific_units_of_IEC_60027-2_A.2_and_ISO.2FIEC_80000 Specific units of IEC 60027-2 A.2 and ISO/IEC 80000] specifies height IEC prefixes. __Boost_Ratio defines all except `zebi` and `yobi` - - // convenience ETC typedefs - typedef ratio< 1024LL> kibi; - typedef ratio< 1024LL*1024LL> mebi; - typedef ratio< 1024LL*1024LL*1024LL> gibi; - typedef ratio< 1024LL*1024LL*1024LL*1024LL> tebi; - typedef ratio< 1024LL*1024LL*1024LL*1024LL*1024LL> pebi; - typedef ratio<1024LL*1024LL*1024LL*1024LL*1024LL*1024LL> exbi; - -[endsect] - - - -[section:limitations Limitations] - -The following are limitations of Boost.Ratio relative to the specification in the C++0x draft standard: - -* Four of the SI units typedefs -- `yocto`, `zepto`, `zetta`, and `yotta` -- are to be conditionally supported, if the range of `intmax_t` allows, but are not supported by __Boost_Ratio. -* Ratio values should be of type static `constexpr intmax_t` (see [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3135.html#1122 Ratio values should be constexpr]), but for compiler not supporting `constexpr` today, __Boost_Ratio uses `static const intmax_t` instead. -* Rational arithmetic should use template aliases (see [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3134.html#921 Rational Arithmetic should use template aliases]), but those are not available in C++03, so inheritance is used instead. - [endsect] -[section:extensions Extensions] - -When __BOOST_RATIO_EXTENSIONS is defined __Boost_Ratio provides the following extensions: - -* Extends the requirements of the C++0x draft standard by making the copy constructor and copy assignment operator have the same normalized form (see [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3133.html#1281 copy constructor and assignment between ratios having the same normalized form]). -* More C++ standard like metafunctions applied to ratio types, like __static_abs or __static_negate. -* An __Boost_Mpl rational constant concept and the associated __Boost_Mpl arithmetic and comparison specializations including __numeric_cast, __plus, __equal_to between others. - [endsect] -[endsect] -[endsect] [section:io Ratio I/O] [/=======================================================] @@ -1281,24 +916,6 @@ The primary template provides generic strings. Specializations provide the same [*Returns]: prefix(). -[endsect] -[section:long_name Static Member function `long_name()` DEPRECATED V2] - - template - basic_string - ratio_string::long_name(); - -[*Returns]: prefix(). - -[endsect] -[section:short_name Static Member function `short_name()` DEPRECATED V2] - - template - basic_string - ratio_string::short_name(); - -[*Returns]: symbol(). - [endsect] [endsect] @@ -1397,551 +1014,6 @@ For each specialization the table gives the return value for `prefix()` and `sym [endsect] [endsect] -[endsect] -[section:mpl Rational Constant] - -[/===========================================] -[section:rational_constant Rational Constant Concept] -[/===========================================] - -[heading Description] - -A __Rational_Constant is a holder class for a compile-time value of a rational type. Every __Rational_Constant is also a nullary Metafunction, returning itself. A rational constant object is implicitly convertible to the corresponding run-time value of the rational type. - -[heading Expression requirements] - -In the following table and subsequent specifications, r is a model of __Rational_Constant. - -[table - [[Expression][Type] [Complexity]] - [[`r::tag`][`rational_c_tag`] [Constant time]] - [[`r::value_type`][A rational type] [Constant time]] - [[`r::num_type`][An integral type] [Constant time]] - [[`r::den_type`][An integral type] [Constant time]] - [[`r::num`][An Integral constant expression] [Constant time]] - [[`r::den`][An Integral constant expression] [Constant time]] - [[`r::type`][__Rational_Constant] [Constant time]] - [[`r::value_type const c=r()`][] [Constant time]] -] - -[heading Expression semantics] - -[table - [[Expression][Semantics]] - [[`r::tag`][r's tag type; r::tag::value is r's conversion rank.]] - [[`r::value_type`][A cv-unqualified type of `r()`]] - [[`r::num_type`][A cv-unqualified type of `r::num`]] - [[`r::den_type`][A cv-unqualified type of `r::den`]] - [[`r::num`][The numerator of the rational constant]] - [[`r::den`][The denominator of the rational constant]] - [[`r::type`][equal_to::value == true.]] - [[`r::value_type const c=r()`][`r::value_type const c=r::value_type(r::num,r::den)`]] -] - -[heading Models] - -* __ratio<> - -[endsect] - -[/===========================================] -[section:rational_constant_hpp Header ``] -[/===========================================] - -This header includes all the rational constant related header files - - #include - #include - #include - #include - - -[endsect] [/section:rational_constant_hpp Header ``] - -[/===========================================] -[section:mpl_rational_c_tag_hpp Header ``] -[/===========================================] - - namespace boost { - namespace mpl { - - struct rational_c_tag : int_<10> {}; - - } - } - -[endsect] [/section:mpl_rational_c_tag_hpp Header ``] - -[/===========================================] -[section:mpl_numeric_cast_hpp Header ``] -[/===========================================] - - namespace boost { - namespace mpl { - - template<> struct numeric_cast< integral_c_tag,rational_c_tag >; - - } - } - -[section:numeric_cast `mpl::numeric_cast<>` Specialization] - -A Integral Constant is seen as a ratio with numerator the Integral Constant value and denominator 1. - - template<> struct numeric_cast< integral_c_tag,rational_c_tag > - { - template< typename N > struct apply - : ratio< N::value, 1 > - { - }; - }; - -[endsect] [/section:numeric_cast `mpl::numeric_cast<>` Specialization] - -[endsect] [/section:mpl_numeric_cast_hpp Header ``] - -[/===========================================] -[section:mpl_arithmetic_hpp Header ``] -[/===========================================] - -This header includes all the rational constant arithmetic MPL specializations. - - #include - #include - #include - #include - #include - #include - #include - #include - #include - - -[endsect] [/section:mpl_arithmetic_hpp Header ``] - -[/===========================================] -[section:mpl_plus_hpp Header ``] -[/===========================================] - - namespace boost { - namespace mpl { - template<> - struct plus_impl< rational_c_tag,rational_c_tag >; - } - } - -[section:plus_impl `mpl::plus_impl<>` Specialization] - -The specialization relays on the __ratio_add template class. - - template<> - struct plus_impl< rational_c_tag,rational_c_tag > - { - template< typename R1, typename R2 > struct apply - : __ratio_add - { - }; - }; - -[endsect] [/section:plus_impl `mpl::plus_impl<>` Specialization] -[endsect] [/section:mpl_plus_hpp Header ``] - -[/===========================================] -[section:mpl_minus_hpp Header ``] -[/===========================================] - - namespace boost { - namespace mpl { - template<> - struct minus_impl< rational_c_tag,rational_c_tag >; - } - } - -[section:minus_impl `mpl::minus_impl<>` Specialization] - -The specialization relays on the __ratio_subtract template class. - - template<> - struct plus_impl< rational_c_tag,rational_c_tag > - { - template< typename R1, typename R2 > struct apply - : __ratio_subtract - { - }; - }; - -[endsect] [/section:minus_impl `mpl::minus_impl<>` Specialization] -[endsect] [/section:mpl_minus_hpp Header ``] - -[/===========================================] -[section:mpl_times_hpp Header ``] -[/===========================================] - - namespace boost { - namespace mpl { - template<> - struct times_impl< rational_c_tag,rational_c_tag >; - } - } - -[section:times_impl `mpl::times_impl<>` Specialization] - -The specialization relays on the __ratio_multiply template class. - - template<> - struct times_impl< rational_c_tag,rational_c_tag > - { - template< typename R1, typename R2 > struct apply - : __ratio_multiply - { - }; - }; - -[endsect] [/section:times_impl `mpl::times_impl<>` Specialization] -[endsect] [/section:mpl_times_hpp Header ``] - -[/===========================================] -[section:mpl_divides_hpp Header ``] -[/===========================================] - - namespace boost { - namespace mpl { - template<> - struct divides_impl< rational_c_tag,rational_c_tag >; - } - } - -[section:divides_impl `mpl::divides_impl<>` Specialization] - -The specialization relays on the __ratio_divide template class. - - template<> - struct divides_impl< rational_c_tag,rational_c_tag > - { - template< typename R1, typename R2 > struct apply - : __ratio_divide - { - }; - }; - -[endsect] [/section:divides_impl `mpl::divides_impl<>` Specialization] -[endsect] [/section:mpl_divides_hpp Header ``] - -[/===========================================] -[section:mpl_gcd_hpp Header ``] -[/===========================================] - - namespace boost { - namespace mpl { - template<> - struct gcd_impl< rational_c_tag,rational_c_tag >; - } - } - -[section:gcd_impl `mpl::gcd_impl<>` Specialization] - -The specialization relays on the __ratio_gcd template class. - - template<> - struct gcd_impl< rational_c_tag,rational_c_tag > - { - template< typename R1, typename R2 > struct apply - : __ratio_gcd - { - }; - }; - -[endsect] [/section:gcd_impl `mpl::gcd_impl<>` Specialization] -[endsect] [/section:mpl_gcd_hpp Header ``] - -[/===========================================] -[section:mpl_lcm_hpp Header ``] -[/===========================================] - - namespace boost { - namespace mpl { - template<> - struct lcm_impl< rational_c_tag,rational_c_tag >; - } - } - -[section:lcm_impl `mpl::lcm_impl<>` Specialization] - -The specialization relays on the __ratio_lcm template class. - - template<> - struct lcm_impl< rational_c_tag,rational_c_tag > - { - template< typename R1, typename R2 > struct apply - : __ratio_lcm - { - }; - }; - -[endsect] [/section:lcm_impl `mpl::lcm_impl<>` Specialization] -[endsect] [/section:mpl_lcm_hpp Header ``] - -[/===========================================] -[section:mpl_negate_hpp Header ``] -[/===========================================] - - namespace boost { - namespace mpl { - template<> - struct negate_impl< rational_c_tag >; - } - } - -[section:negate_impl `mpl::negate_impl<>` Specialization] - -The specialization relays on the __ratio_negate template class. - - template<> - struct negate_impl< rational_c_tag > - { - template< typename R > struct apply - : __ratio_negate - { - }; - }; - -[endsect] [/section:negate_impl `mpl::negate_impl<>` Specialization] -[endsect] [/section:mpl_negate_hpp Header ``] - -[/===========================================] -[section:mpl_abs_hpp Header ``] -[/===========================================] - - namespace boost { - namespace mpl { - template<> - struct abs_impl< rational_c_tag >; - } - } - -[section:abs_impl `mpl::abs_impl<>` Specialization] - -The specialization relays on the __ratio_abs template class. - - template<> - struct abs_impl< rational_c_tag > - { - template< typename R > struct apply - : __ratio_abs - { - }; - }; - -[endsect] [/section:abs_impl `mpl::abs_impl<>` Specialization] -[endsect] [/section:mpl_abs_hpp Header ``] - -[/===========================================] -[section:mpl_sign_hpp Header ``] -[/===========================================] - - namespace boost { - namespace mpl { - template<> - struct sign_impl< rational_c_tag >; - } - } - -[section:sign_impl `mpl::sign_impl<>` Specialization] - -The specialization relays on the __ratio_sign template class. - - template<> - struct sign_impl< rational_c_tag > - { - template< typename R > struct apply - : __ratio_sign - { - }; - }; - -[endsect] [/section:sign_impl `mpl::sign_impl<>` Specialization] -[endsect] [/section:mpl_sign_hpp Header ``] - -[/===========================================] -[section:mpl_comparison_hpp Header ``] -[/===========================================] - -This header includes all the rational constant comparison MPL specializations. - - #include - #include - #include - #include - #include - #include - - -[endsect] [/section:mpl_comparison_hpp Header ``] - -[/===========================================] -[section:mpl_equal_to_hpp Header ``] -[/===========================================] - - namespace boost { - namespace mpl { - template<> - struct equal_to_impl< rational_c_tag,rational_c_tag >; - } - } - -[section:equal_to `mpl::equal_to_impl<>` Specialization] - -The specialization relays on the __ratio_equal template class. - - template<> - struct equal_to_impl< rational_c_tag,rational_c_tag > - { - template< typename R1, typename R2 > struct apply - : __ratio_equal - { - }; - }; - -[endsect] [/section:equal_to `mpl::equal_to_impl<>` Specialization] -[endsect] [/section:mpl_equal_to_hpp Header ``] - -[/===========================================] -[section:mpl_not_equal_to_hpp Header ``] -[/===========================================] - - namespace boost { - namespace mpl { - template<> - struct not_equal_to_impl< rational_c_tag,rational_c_tag >; - } - } - -[section:not_equal_to `mpl::not_equal_to_impl<>` Specialization] - -The specialization relays on the __ratio_not_equal template class. - - template<> - struct not_equal_to_impl< rational_c_tag,rational_c_tag > - { - template< typename R1, typename R2 > struct apply - : __ratio_not_equal - { - }; - }; - -[endsect] [/section:not_equal_to `mpl::not_equal_to_impl<>` Specialization] -[endsect] [/section:mpl_not_equal_to_hpp Header ``] - -[/===========================================] -[section:mpl_less_hpp Header ``] -[/===========================================] - - namespace boost { - namespace mpl { - template<> - struct less_impl< rational_c_tag,rational_c_tag >; - } - } - -[section:less `mpl::less_impl<>` Specialization] - -The specialization relays on the __ratio_less template class. - - template<> - struct less_impl< rational_c_tag,rational_c_tag > - { - template< typename R1, typename R2 > struct apply - : ratio_less - { - }; - }; - -[endsect] [/section:less `mpl::less_impl<>` Specialization] -[endsect] [/section:mpl_less_hpp Header ``] - -[/===========================================] -[section:mpl_less_equal_hpp Header ``] -[/===========================================] - - namespace boost { - namespace mpl { - template<> - struct less_equal_impl< rational_c_tag,rational_c_tag >; - } - } - -[section:less_equal `mpl::less_equal_impl<>` Specialization] - -The specialization relays on the __ratio_less_equal template class. - - template<> - struct less_equal_impl< rational_c_tag,rational_c_tag > - { - template< typename R1, typename R2 > struct apply - : ratio_less_equal - { - }; - }; - -[endsect] [/section:less_equal `mpl::less_equal_impl<>` Specialization] -[endsect] [/section:mpl_less_equal_hpp Header ``] - -[/===========================================] -[section:mpl_greater_hpp Header ``] -[/===========================================] - - namespace boost { - namespace mpl { - template<> - struct greater_impl< rational_c_tag,rational_c_tag >; - } - } - -[section:greater `mpl::greater_impl<>` Specialization] - -The specialization relays on the __ratio_greater template class. - - template<> - struct greater_impl< rational_c_tag,rational_c_tag > - { - template< typename R1, typename R2 > struct apply - : ratio_greater - { - }; - }; - -[endsect] [/section:greater `mpl::greater_impl<>` Specialization] -[endsect] [/section:mpl_greater_hpp Header ``] - - -[/===========================================] -[section:mpl_greater_equal_hpp Header ``] -[/===========================================] - - namespace boost { - namespace mpl { - template<> - struct greater_equal_impl< rational_c_tag,rational_c_tag >; - } - } - -[section:greater_equal `mpl::greater_equal_impl<>` Specialization] - -The specialization relays on the __ratio_greater_equal template class. - - template<> - struct greater_equal_impl< rational_c_tag,rational_c_tag > - { - template< typename R1, typename R2 > struct apply - : ratio_greater_equal - { - }; - }; - -[endsect] [/section:greater_equal `mpl::greater_equal_impl<>` Specialization] -[endsect] [/section:mpl_greater_equal_hpp Header ``] - - [endsect] [endsect]