config.hpp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Copyright (C) 2009-2012 Lorenzo Caminiti
  2. // Distributed under the Boost Software License, Version 1.0
  3. // (see accompanying file LICENSE_1_0.txt or a copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. // Home at http://www.boost.org/libs/functional/overloaded_function
  6. #ifndef BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_HPP_
  7. #define BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_HPP_
  8. /** @file
  9. @brief Change the compile-time configuration of this library.
  10. */
  11. /**
  12. @brief Specify the maximum number of arguments of the functions being
  13. overloaded.
  14. If this macro is left undefined by the user, it has a default value of 5
  15. (increasing this number might increase compilation time).
  16. When specified by the user, this macro must be a non-negative integer number.
  17. @See @RefSect{getting_started, Getting Started},
  18. @RefClass{boost::overloaded_function}.
  19. */
  20. #ifndef BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX
  21. # define BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX 5
  22. #endif
  23. /**
  24. @brief Specify the maximum number of functions that can be overloaded.
  25. If this macro is left undefined by the user, it has a default value of 5
  26. (increasing this number might increase compilation time).
  27. When defined by the user, this macro must be an integer number greater or
  28. equal than 2 (because at least two distinct functions need to be specified in
  29. order to define an overload).
  30. @See @RefSect{getting_started, Getting Started},
  31. @RefClass{boost::overloaded_function}.
  32. */
  33. #ifndef BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX
  34. # define BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX 5
  35. #endif
  36. #if BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX < 2
  37. # error "maximum overload macro cannot be less than 2"
  38. #endif
  39. #endif // #include guard