real_cast.hpp 614 B

1234567891011121314151617181920212223242526272829
  1. // Copyright John Maddock 2006.
  2. // Use, modification and distribution are subject to the
  3. // Boost Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. #ifndef BOOST_MATH_TOOLS_REAL_CAST_HPP
  6. #define BOOST_MATH_TOOLS_REAL_CAST_HPP
  7. #ifdef _MSC_VER
  8. #pragma once
  9. #endif
  10. namespace boost{ namespace math
  11. {
  12. namespace tools
  13. {
  14. template <class To, class T>
  15. inline To real_cast(T t)
  16. {
  17. return static_cast<To>(t);
  18. }
  19. } // namespace tools
  20. } // namespace math
  21. } // namespace boost
  22. #endif // BOOST_MATH_TOOLS_REAL_CAST_HPP