ptr_to_ref.hpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef BOOST_MPL_AUX_PTR_TO_REF_HPP_INCLUDED
  2. #define BOOST_MPL_AUX_PTR_TO_REF_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_/static_cast.hpp>
  14. #include <boost/mpl/aux_/config/msvc.hpp>
  15. #include <boost/mpl/aux_/config/workaround.hpp>
  16. #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) \
  17. || ( BOOST_WORKAROUND(__EDG_VERSION__, <= 245) \
  18. && !(defined(__STD_STRICT_ANSI) \
  19. || defined(__STD_STRICT_ANSI_ERRORS)) )
  20. # define BOOST_MPL_AUX_PTR_TO_REF(X) \
  21. *BOOST_MPL_AUX_STATIC_CAST(X*, 0) \
  22. /**/
  23. #else
  24. # define BOOST_MPL_AUX_PTR_TO_REF(X) \
  25. aux::ptr_to_ref(BOOST_MPL_AUX_STATIC_CAST(X*, 0)) \
  26. /**/
  27. #endif
  28. namespace boost { namespace mpl { namespace aux {
  29. template< typename T > static T const& ptr_to_ref(T*);
  30. }}}
  31. #endif // BOOST_MPL_AUX_PTR_TO_REF_HPP_INCLUDED