os/ossrv/ossrv_pub/boost_apis/boost/numeric/interval/policies.hpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/ossrv_pub/boost_apis/boost/numeric/interval/policies.hpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,75 @@
     1.4 +/* Boost interval/policies.hpp template implementation file
     1.5 + *
     1.6 + * Copyright 2003 Guillaume Melquiond
     1.7 + *
     1.8 + * Distributed under the Boost Software License, Version 1.0.
     1.9 + * (See accompanying file LICENSE_1_0.txt or
    1.10 + * copy at http://www.boost.org/LICENSE_1_0.txt)
    1.11 + */
    1.12 +
    1.13 +#ifndef BOOST_NUMERIC_INTERVAL_POLICIES_HPP
    1.14 +#define BOOST_NUMERIC_INTERVAL_POLICIES_HPP
    1.15 +
    1.16 +#include <boost/numeric/interval/interval.hpp>
    1.17 +
    1.18 +namespace boost {
    1.19 +namespace numeric {
    1.20 +namespace interval_lib {
    1.21 +
    1.22 +/*
    1.23 + * policies class
    1.24 + */
    1.25 +
    1.26 +template<class Rounding, class Checking>
    1.27 +struct policies
    1.28 +{
    1.29 +  typedef Rounding rounding;
    1.30 +  typedef Checking checking;
    1.31 +};
    1.32 +
    1.33 +/*
    1.34 + * policies switching classes
    1.35 + */
    1.36 +
    1.37 +template<class OldInterval, class NewRounding>
    1.38 +class change_rounding
    1.39 +{
    1.40 +  typedef typename OldInterval::base_type T;
    1.41 +  typedef typename OldInterval::traits_type p;
    1.42 +  typedef typename p::checking checking;
    1.43 +public:
    1.44 +  typedef interval<T, policies<NewRounding, checking> > type;
    1.45 +};
    1.46 +
    1.47 +template<class OldInterval, class NewChecking>
    1.48 +class change_checking
    1.49 +{
    1.50 +  typedef typename OldInterval::base_type T;
    1.51 +  typedef typename OldInterval::traits_type p;
    1.52 +  typedef typename p::rounding rounding;
    1.53 +public:
    1.54 +  typedef interval<T, policies<rounding, NewChecking> > type;
    1.55 +};
    1.56 +
    1.57 +/*
    1.58 + * Protect / unprotect: control whether the rounding mode is set/reset
    1.59 + * at each operation, rather than once and for all.
    1.60 + */
    1.61 +
    1.62 +template<class OldInterval>
    1.63 +class unprotect
    1.64 +{
    1.65 +  typedef typename OldInterval::base_type T;
    1.66 +  typedef typename OldInterval::traits_type p;
    1.67 +  typedef typename p::rounding r;
    1.68 +  typedef typename r::unprotected_rounding newRounding;
    1.69 +public:
    1.70 +  typedef typename change_rounding<OldInterval, newRounding>::type type;
    1.71 +};
    1.72 +
    1.73 +} // namespace interval_lib
    1.74 +} // namespace numeric
    1.75 +} // namespace boost
    1.76 +
    1.77 +
    1.78 +#endif // BOOST_NUMERIC_INTERVAL_POLICIES_HPP