annotate DEPENDENCIES/generic/include/boost/math/special_functions/detail/iconv.hpp @ 125:34e428693f5d vext

Vext -> Repoint
author Chris Cannam
date Thu, 14 Jun 2018 11:15:39 +0100
parents 2665513ce2d3
children
rev   line source
Chris@16 1 // Copyright (c) 2009 John Maddock
Chris@16 2 // Use, modification and distribution are subject to the
Chris@16 3 // Boost Software License, Version 1.0. (See accompanying file
Chris@16 4 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Chris@16 5
Chris@16 6 #ifndef BOOST_MATH_ICONV_HPP
Chris@16 7 #define BOOST_MATH_ICONV_HPP
Chris@16 8
Chris@16 9 #ifdef _MSC_VER
Chris@16 10 #pragma once
Chris@16 11 #endif
Chris@16 12
Chris@16 13 #include <boost/math/special_functions/round.hpp>
Chris@16 14 #include <boost/type_traits/is_convertible.hpp>
Chris@16 15
Chris@16 16 namespace boost { namespace math { namespace detail{
Chris@16 17
Chris@16 18 template <class T, class Policy>
Chris@16 19 inline int iconv_imp(T v, Policy const&, mpl::true_ const&)
Chris@16 20 {
Chris@16 21 return static_cast<int>(v);
Chris@16 22 }
Chris@16 23
Chris@16 24 template <class T, class Policy>
Chris@16 25 inline int iconv_imp(T v, Policy const& pol, mpl::false_ const&)
Chris@16 26 {
Chris@16 27 BOOST_MATH_STD_USING
Chris@16 28 return iround(v, pol);
Chris@16 29 }
Chris@16 30
Chris@16 31 template <class T, class Policy>
Chris@16 32 inline int iconv(T v, Policy const& pol)
Chris@16 33 {
Chris@16 34 typedef typename boost::is_convertible<T, int>::type tag_type;
Chris@16 35 return iconv_imp(v, pol, tag_type());
Chris@16 36 }
Chris@16 37
Chris@16 38
Chris@16 39 }}} // namespaces
Chris@16 40
Chris@16 41 #endif // BOOST_MATH_ICONV_HPP
Chris@16 42