sl@0: /* Boost interval/policies.hpp template implementation file sl@0: * sl@0: * Copyright 2003 Guillaume Melquiond sl@0: * sl@0: * Distributed under the Boost Software License, Version 1.0. sl@0: * (See accompanying file LICENSE_1_0.txt or sl@0: * copy at http://www.boost.org/LICENSE_1_0.txt) sl@0: */ sl@0: sl@0: #ifndef BOOST_NUMERIC_INTERVAL_POLICIES_HPP sl@0: #define BOOST_NUMERIC_INTERVAL_POLICIES_HPP sl@0: sl@0: #include sl@0: sl@0: namespace boost { sl@0: namespace numeric { sl@0: namespace interval_lib { sl@0: sl@0: /* sl@0: * policies class sl@0: */ sl@0: sl@0: template sl@0: struct policies sl@0: { sl@0: typedef Rounding rounding; sl@0: typedef Checking checking; sl@0: }; sl@0: sl@0: /* sl@0: * policies switching classes sl@0: */ sl@0: sl@0: template sl@0: class change_rounding sl@0: { sl@0: typedef typename OldInterval::base_type T; sl@0: typedef typename OldInterval::traits_type p; sl@0: typedef typename p::checking checking; sl@0: public: sl@0: typedef interval > type; sl@0: }; sl@0: sl@0: template sl@0: class change_checking sl@0: { sl@0: typedef typename OldInterval::base_type T; sl@0: typedef typename OldInterval::traits_type p; sl@0: typedef typename p::rounding rounding; sl@0: public: sl@0: typedef interval > type; sl@0: }; sl@0: sl@0: /* sl@0: * Protect / unprotect: control whether the rounding mode is set/reset sl@0: * at each operation, rather than once and for all. sl@0: */ sl@0: sl@0: template sl@0: class unprotect sl@0: { sl@0: typedef typename OldInterval::base_type T; sl@0: typedef typename OldInterval::traits_type p; sl@0: typedef typename p::rounding r; sl@0: typedef typename r::unprotected_rounding newRounding; sl@0: public: sl@0: typedef typename change_rounding::type type; sl@0: }; sl@0: sl@0: } // namespace interval_lib sl@0: } // namespace numeric sl@0: } // namespace boost sl@0: sl@0: sl@0: #endif // BOOST_NUMERIC_INTERVAL_POLICIES_HPP