Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 12 additions & 51 deletions include/boost/function.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,57 +10,18 @@
// William Kempf, Jesse Jones and Karl Nelson were all very helpful in the
// design of this library.

#include <functional> // unary_function, binary_function
// No include guards to allow include again with bigger
// BOOST_FUNCTION_MAX_ARGS

#include <boost/preprocessor/iterate.hpp>
#include <boost/detail/workaround.hpp>

#ifndef BOOST_FUNCTION_MAX_ARGS
# define BOOST_FUNCTION_MAX_ARGS 10
#endif // BOOST_FUNCTION_MAX_ARGS

// Include the prologue here so that the use of file-level iteration
// in anything that may be included by function_template.hpp doesn't break
#include <boost/function/detail/prologue.hpp>

// Older Visual Age C++ version do not handle the file iteration well
#if BOOST_WORKAROUND(__IBMCPP__, >= 500) && BOOST_WORKAROUND(__IBMCPP__, < 800)
# if BOOST_FUNCTION_MAX_ARGS >= 0
# include <boost/function/function0.hpp>
# endif
# if BOOST_FUNCTION_MAX_ARGS >= 1
# include <boost/function/function1.hpp>
# endif
# if BOOST_FUNCTION_MAX_ARGS >= 2
# include <boost/function/function2.hpp>
# endif
# if BOOST_FUNCTION_MAX_ARGS >= 3
# include <boost/function/function3.hpp>
# endif
# if BOOST_FUNCTION_MAX_ARGS >= 4
# include <boost/function/function4.hpp>
# endif
# if BOOST_FUNCTION_MAX_ARGS >= 5
# include <boost/function/function5.hpp>
# endif
# if BOOST_FUNCTION_MAX_ARGS >= 6
# include <boost/function/function6.hpp>
# endif
# if BOOST_FUNCTION_MAX_ARGS >= 7
# include <boost/function/function7.hpp>
# endif
# if BOOST_FUNCTION_MAX_ARGS >= 8
# include <boost/function/function8.hpp>
# endif
# if BOOST_FUNCTION_MAX_ARGS >= 9
# include <boost/function/function9.hpp>
# endif
# if BOOST_FUNCTION_MAX_ARGS >= 10
# include <boost/function/function10.hpp>
# endif
#ifndef BOOST_FUNCTION_MAX_ARGS_DEFINED
# include <boost/function/detail/function_expand.hpp>
#else
// What is the '3' for?
# define BOOST_PP_ITERATION_PARAMS_1 (3,(0,BOOST_FUNCTION_MAX_ARGS,<boost/function/detail/function_iterate.hpp>))
# include BOOST_PP_ITERATE()
# undef BOOST_PP_ITERATION_PARAMS_1
# ifndef BOOST_FUNCTION_MAX_ARGS
# include <boost/function/detail/function_expand.hpp>
# else
# if BOOST_FUNCTION_MAX_ARGS > BOOST_FUNCTION_MAX_ARGS_DEFINED
# include <boost/function/detail/function_expand.hpp>
# endif
# endif
#endif

91 changes: 91 additions & 0 deletions include/boost/function/detail/function_expand.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
// Boost.Function library

// Copyright Douglas Gregor 2001-2003. Use, modification and
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

// For more information, see http://www.boost.org/libs/function

// William Kempf, Jesse Jones and Karl Nelson were all very helpful in the
// design of this library.

// No include guards to allow include again with different
// BOOST_FUNCTION_MAX_ARGS

#include <functional> // unary_function, binary_function

#include <boost/preprocessor/iterate.hpp>
#include <boost/detail/workaround.hpp>

#ifndef BOOST_FUNCTION_MAX_ARGS
# define BOOST_FUNCTION_MAX_ARGS 10
#endif // BOOST_FUNCTION_MAX_ARGS

// Include the prologue here so that the use of file-level iteration
// in anything that may be included by function_template.hpp doesn't break
#include <boost/function/detail/prologue.hpp>

// Older Visual Age C++ version do not handle the file iteration well
#if BOOST_WORKAROUND(__IBMCPP__, >= 500) && BOOST_WORKAROUND(__IBMCPP__, < 800)
# if BOOST_FUNCTION_MAX_ARGS >= 0
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 0
# include <boost/function/function0.hpp>
# endif
# if BOOST_FUNCTION_MAX_ARGS >= 1
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 1
# include <boost/function/function1.hpp>
# endif
# if BOOST_FUNCTION_MAX_ARGS >= 2
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 2
# include <boost/function/function2.hpp>
# endif
# if BOOST_FUNCTION_MAX_ARGS >= 3
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 3
# include <boost/function/function3.hpp>
# endif
# if BOOST_FUNCTION_MAX_ARGS >= 4
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 4
# include <boost/function/function4.hpp>
# endif
# if BOOST_FUNCTION_MAX_ARGS >= 5
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 5
# include <boost/function/function5.hpp>
# endif
# if BOOST_FUNCTION_MAX_ARGS >= 6
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 6
# include <boost/function/function6.hpp>
# endif
# if BOOST_FUNCTION_MAX_ARGS >= 7
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 7
# include <boost/function/function7.hpp>
# endif
# if BOOST_FUNCTION_MAX_ARGS >= 8
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 8
# include <boost/function/function8.hpp>
# endif
# if BOOST_FUNCTION_MAX_ARGS >= 9
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 9
# include <boost/function/function9.hpp>
# endif
# if BOOST_FUNCTION_MAX_ARGS >= 10
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 10
# include <boost/function/function10.hpp>
# endif
#else
// What is the '3' for?
# define BOOST_PP_ITERATION_PARAMS_1 (3,(0,BOOST_FUNCTION_MAX_ARGS,<boost/function/detail/function_iterate.hpp>))
# include BOOST_PP_ITERATE()
# undef BOOST_PP_ITERATION_PARAMS_1
#endif
2 changes: 2 additions & 0 deletions include/boost/function/detail/gen_maybe_include.pl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
print OUT " BOOST_FUNCTION_NUM_ARGS == $on_arg\n";
print OUT "# ifndef BOOST_FUNCTION_$on_arg\n";
print OUT "# define BOOST_FUNCTION_$on_arg\n";
print OUT "# undef BOOST_FUNCTION_MAX_ARGS_DEFINED\n";
print OUT "# define BOOST_FUNCTION_MAX_ARGS_DEFINED $on_arg\n";
print OUT "# include <boost/function/function_template.hpp>\n";
print OUT "# endif\n";
}
Expand Down
Loading