/Src/Dependencies/Boost/boost/mpl/aux_/contains_impl.hpp

http://hadesmem.googlecode.com/ · C++ Header · 61 lines · 39 code · 11 blank · 11 comment · 0 complexity · 92b611e6db7c6bf865618e6bc0a0c044 MD5 · raw file

  1. #ifndef BOOST_MPL_AUX_CONTAINS_IMPL_HPP_INCLUDED
  2. #define BOOST_MPL_AUX_CONTAINS_IMPL_HPP_INCLUDED
  3. // Copyright Eric Friedman 2002
  4. // Copyright Aleksey Gurtovoy 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: contains_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
  12. // $Date: 2008-10-11 17:19:02 +1100 (Sat, 11 Oct 2008) $
  13. // $Revision: 49267 $
  14. #include <boost/mpl/contains_fwd.hpp>
  15. #include <boost/mpl/begin_end.hpp>
  16. #include <boost/mpl/find.hpp>
  17. #include <boost/mpl/not.hpp>
  18. #include <boost/mpl/aux_/traits_lambda_spec.hpp>
  19. #include <boost/mpl/aux_/config/forwarding.hpp>
  20. #include <boost/mpl/aux_/config/static_constant.hpp>
  21. #include <boost/type_traits/is_same.hpp>
  22. namespace boost { namespace mpl {
  23. template< typename Tag >
  24. struct contains_impl
  25. {
  26. template< typename Sequence, typename T > struct apply
  27. #if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
  28. : not_< is_same<
  29. typename find<Sequence,T>::type
  30. , typename end<Sequence>::type
  31. > >
  32. {
  33. #else
  34. {
  35. typedef not_< is_same<
  36. typename find<Sequence,T>::type
  37. , typename end<Sequence>::type
  38. > > type;
  39. BOOST_STATIC_CONSTANT(bool, value =
  40. (not_< is_same<
  41. typename find<Sequence,T>::type
  42. , typename end<Sequence>::type
  43. > >::value)
  44. );
  45. #endif
  46. };
  47. };
  48. BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(2,contains_impl)
  49. }}
  50. #endif // BOOST_MPL_AUX_CONTAINS_IMPL_HPP_INCLUDED