empty.hpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #ifndef BOOST_MPL_VECTOR_AUX_EMPTY_HPP_INCLUDED
  2. #define BOOST_MPL_VECTOR_AUX_EMPTY_HPP_INCLUDED
  3. // Copyright Aleksey Gurtovoy 2000-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/empty_fwd.hpp>
  14. #include <boost/mpl/bool.hpp>
  15. #include <boost/mpl/vector/aux_/tag.hpp>
  16. #include <boost/mpl/aux_/config/typeof.hpp>
  17. #include <boost/mpl/aux_/config/ctps.hpp>
  18. #include <boost/type_traits/is_same.hpp>
  19. namespace boost { namespace mpl {
  20. #if defined(BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES)
  21. template<>
  22. struct empty_impl< aux::vector_tag >
  23. {
  24. template< typename Vector > struct apply
  25. : is_same<
  26. typename Vector::lower_bound_
  27. , typename Vector::upper_bound_
  28. >
  29. {
  30. };
  31. };
  32. #else
  33. template<>
  34. struct empty_impl< aux::vector_tag<0> >
  35. {
  36. template< typename Vector > struct apply
  37. : true_
  38. {
  39. };
  40. };
  41. #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
  42. template< long N >
  43. struct empty_impl< aux::vector_tag<N> >
  44. {
  45. template< typename Vector > struct apply
  46. : false_
  47. {
  48. };
  49. };
  50. #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
  51. #endif // BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES
  52. }}
  53. #endif // BOOST_MPL_VECTOR_AUX_EMPTY_HPP_INCLUDED