numeric_cast.hpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef BOOST_MPL_NUMERIC_CAST_HPP_INCLUDED
  2. #define BOOST_MPL_NUMERIC_CAST_HPP_INCLUDED
  3. // Copyright Aleksey Gurtovoy 2003-2004
  4. //
  5. // Distributed under the Boost Software License, Version 1.0.
  6. // (See accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. //
  9. // See http://www.boost.org/libs/mpl for documentation.
  10. // $Id$
  11. // $Date$
  12. // $Revision$
  13. #include <boost/mpl/aux_/config/msvc.hpp>
  14. #include <boost/mpl/aux_/config/workaround.hpp>
  15. // agurt 21/sep/04: portability macro for the sake of MSVC 6.x-7.0;
  16. // resolves conflicts with 'boost::numeric_cast' function template.
  17. // use it in your own code _only_ if you care about compatibility with
  18. // these outdated compilers!
  19. #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) || BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x570) )
  20. # define BOOST_MPL_AUX_NUMERIC_CAST numeric_cast_
  21. #else
  22. # define BOOST_MPL_AUX_NUMERIC_CAST numeric_cast
  23. #endif
  24. namespace boost { namespace mpl {
  25. // no default implementation; the definition is needed to make MSVC happy
  26. template< typename SourceTag, typename TargetTag > struct BOOST_MPL_AUX_NUMERIC_CAST
  27. {
  28. template< typename N > struct apply;
  29. };
  30. }}
  31. #endif // BOOST_MPL_NUMERIC_CAST_HPP_INCLUDED