has_key_impl.hpp 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifndef BOOST_MPL_SET_AUX_HAS_KEY_IMPL_HPP_INCLUDED
  2. #define BOOST_MPL_SET_AUX_HAS_KEY_IMPL_HPP_INCLUDED
  3. // Copyright Aleksey Gurtovoy 2003-2004
  4. // Copyright David Abrahams 2003-2004
  5. //
  6. // Distributed under the Boost Software License, Version 1.0.
  7. // (See accompanying file LICENSE_1_0.txt or copy at
  8. // http://www.boost.org/LICENSE_1_0.txt)
  9. //
  10. // See http://www.boost.org/libs/mpl for documentation.
  11. // $Id$
  12. // $Date$
  13. // $Revision$
  14. #include <boost/mpl/set/aux_/tag.hpp>
  15. #include <boost/mpl/has_key_fwd.hpp>
  16. #include <boost/mpl/bool.hpp>
  17. #include <boost/mpl/aux_/overload_names.hpp>
  18. #include <boost/mpl/aux_/static_cast.hpp>
  19. #include <boost/mpl/aux_/yes_no.hpp>
  20. #include <boost/mpl/aux_/type_wrapper.hpp>
  21. #include <boost/mpl/aux_/config/workaround.hpp>
  22. #include <boost/mpl/aux_/config/static_constant.hpp>
  23. namespace boost { namespace mpl {
  24. template<>
  25. struct has_key_impl< aux::set_tag >
  26. {
  27. template< typename Set, typename T > struct apply
  28. #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) \
  29. || BOOST_WORKAROUND(__EDG_VERSION__, <= 245)
  30. {
  31. BOOST_STATIC_CONSTANT(bool, value =
  32. ( sizeof( BOOST_MPL_AUX_OVERLOAD_CALL_IS_MASKED(
  33. Set
  34. , BOOST_MPL_AUX_STATIC_CAST(aux::type_wrapper<T>*, 0)
  35. ) ) == sizeof(aux::no_tag) )
  36. );
  37. typedef bool_<value> type;
  38. #else // ISO98 C++
  39. : bool_<
  40. ( sizeof( BOOST_MPL_AUX_OVERLOAD_CALL_IS_MASKED(
  41. Set
  42. , BOOST_MPL_AUX_STATIC_CAST(aux::type_wrapper<T>*, 0)
  43. ) ) == sizeof(aux::no_tag) )
  44. >
  45. {
  46. #endif
  47. };
  48. };
  49. }}
  50. #endif // BOOST_MPL_SET_AUX_HAS_KEY_IMPL_HPP_INCLUDED