yes_no.hpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #ifndef BOOST_MPL_AUX_YES_NO_HPP_INCLUDED
  2. #define BOOST_MPL_AUX_YES_NO_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/aux_/nttp_decl.hpp>
  14. #include <boost/mpl/aux_/config/arrays.hpp>
  15. #include <boost/mpl/aux_/config/msvc.hpp>
  16. #include <boost/mpl/aux_/config/workaround.hpp>
  17. #include <cstddef>
  18. namespace boost { namespace mpl { namespace aux {
  19. typedef char (&no_tag)[1];
  20. typedef char (&yes_tag)[2];
  21. template< bool C_ > struct yes_no_tag
  22. {
  23. typedef no_tag type;
  24. };
  25. template<> struct yes_no_tag<true>
  26. {
  27. typedef yes_tag type;
  28. };
  29. template< BOOST_MPL_AUX_NTTP_DECL(std::size_t, n) > struct weighted_tag
  30. {
  31. #if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
  32. typedef char (&type)[n];
  33. #else
  34. char buf[n];
  35. typedef weighted_tag type;
  36. #endif
  37. };
  38. #if defined(BOOST_MPL_CFG_NO_DEPENDENT_ARRAY_TYPES)
  39. template<> struct weighted_tag<0>
  40. {
  41. typedef char (&type)[1];
  42. };
  43. #endif
  44. }}}
  45. #endif // BOOST_MPL_AUX_YES_NO_HPP_INCLUDED