12ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 22ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh// Use, modification, and distribution is subject to the Boost Software 32ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 42ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh// http://www.boost.org/LICENSE_1_0.txt) 52ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh 62ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh// See library home page at http://www.boost.org/libs/numeric/conversion 72ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh// 82ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh// Contact the author at: fernando_cacciola@hotmail.com 92ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh// 102ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh#ifndef BOOST_NUMERIC_CONVERSION_CONVERTER_FLC_12NOV2002_HPP 112ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh#define BOOST_NUMERIC_CONVERSION_CONVERTER_FLC_12NOV2002_HPP 122ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh 132ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh#include "boost/numeric/conversion/conversion_traits.hpp" 142ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh#include "boost/numeric/conversion/converter_policies.hpp" 152ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh 162ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh#include "boost/numeric/conversion/detail/converter.hpp" 172ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh 182ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsiehnamespace boost { namespace numeric 192ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh{ 202ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh 212ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsiehtemplate<class T, 222ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh class S, 232ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh class Traits = conversion_traits<T,S>, 242ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh class OverflowHandler = def_overflow_handler, 252ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh class Float2IntRounder = Trunc< BOOST_DEDUCED_TYPENAME Traits::source_type> , 262ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh class RawConverter = raw_converter<Traits>, 272ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh class UserRangeChecker = UseInternalRangeChecker 282ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh > 292ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsiehstruct converter : convdetail::get_converter_impl<Traits, 302ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh OverflowHandler, 312ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh Float2IntRounder, 322ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh RawConverter, 332ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh UserRangeChecker 342ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh >::type 352ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh{ 362ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh typedef Traits traits ; 372ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh 382ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh typedef typename Traits::argument_type argument_type ; 392ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh typedef typename Traits::result_type result_type ; 402ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh 412ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh result_type operator() ( argument_type s ) const { return this->convert(s) ; } 422ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh} ; 432ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh 442ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh 452ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh 462ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsiehtemplate<class S, 472ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh class OverflowHandler = def_overflow_handler, 482ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh class Float2IntRounder = Trunc<S> , 492ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh class UserRangeChecker = UseInternalRangeChecker 502ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh > 512ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsiehstruct make_converter_from 522ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh{ 532ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh template<class T, 542ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh class Traits = conversion_traits<T,S>, 552ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh class RawConverter = raw_converter<Traits> 562ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh > 572ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh struct to 582ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh { 592ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh typedef converter<T,S,Traits,OverflowHandler,Float2IntRounder,RawConverter,UserRangeChecker> type ; 602ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh } ; 612ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh 622ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh} ; 632ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh 642ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh} } // namespace boost::numeric 652ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh 662ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh#endif 672ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh 682ca0e41376e99ad53c02fdb5333339ad3dcad19fAndrew Hsieh 69