args_fwd.hpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Copyright David Abrahams 2002.
  2. // Distributed under the Boost Software License, Version 1.0. (See
  3. // accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. #ifndef ARGS_FWD_DWA2002927_HPP
  6. # define ARGS_FWD_DWA2002927_HPP
  7. # include <boost/python/detail/prefix.hpp>
  8. # include <boost/python/handle.hpp>
  9. # include <boost/config.hpp>
  10. # include <cstddef>
  11. # include <utility>
  12. namespace boost { namespace python {
  13. namespace detail
  14. {
  15. struct keyword
  16. {
  17. keyword(char const* name_=0)
  18. : name(name_)
  19. {}
  20. char const* name;
  21. handle<> default_value;
  22. };
  23. template <std::size_t nkeywords = 0> struct keywords;
  24. typedef std::pair<keyword const*, keyword const*> keyword_range;
  25. template <>
  26. struct keywords<0>
  27. {
  28. BOOST_STATIC_CONSTANT(std::size_t, size = 0);
  29. static keyword_range range() { return keyword_range(); }
  30. };
  31. namespace error
  32. {
  33. template <int keywords, int function_args>
  34. struct more_keywords_than_function_arguments
  35. {
  36. typedef char too_many_keywords[keywords > function_args ? -1 : 1];
  37. };
  38. }
  39. }
  40. }} // namespace boost::python
  41. #endif // ARGS_FWD_DWA2002927_HPP