From 4bb690a8196eec6acab032dcfeccab1f6e41b887 Mon Sep 17 00:00:00 2001 From: Paul Mensonides Date: Thu, 3 Oct 2002 22:13:37 +0000 Subject: [PATCH] lib cleanup [SVN r15693] --- doc/acknowledgements.html | 55 ++ doc/bibliography.html | 55 ++ doc/blank.html | 9 + doc/contents.html | 20 + doc/data.html | 15 + doc/data/arrays.html | 43 + doc/data/lists.html | 36 + doc/data/tuples.html | 32 + doc/examples.html | 18 + doc/examples/out.cpp | 16 - doc/headers.html | 165 ++++ doc/headers/arithmetic.hpp.html | 25 + doc/headers/array.hpp.html | 21 + doc/headers/assert_msg.hpp.html | 20 + doc/headers/cat.hpp.html | 19 + doc/headers/comma.hpp.html | 20 + doc/headers/comma_if.hpp.html | 20 + doc/headers/comparison.hpp.html | 24 + doc/headers/control.hpp.html | 24 + doc/headers/debug.hpp.html | 20 + doc/headers/dec.hpp.html | 20 + doc/headers/empty.hpp.html | 20 + doc/headers/enum.hpp.html | 20 + doc/headers/enum_params.hpp.html | 20 + .../enum_params_with_a_default.hpp.html | 20 + .../enum_params_with_defaults.hpp.html | 20 + doc/headers/enum_shifted.hpp.html | 20 + doc/headers/enum_shifted_params.hpp.html | 20 + doc/headers/expand.hpp.html | 20 + doc/headers/expr_if.hpp.html | 20 + doc/headers/facilities.hpp.html | 23 + doc/headers/for.hpp.html | 20 + doc/headers/identity.hpp.html | 20 + doc/headers/if.hpp.html | 20 + doc/headers/inc.hpp.html | 20 + doc/headers/iterate.hpp.html | 20 + doc/headers/iteration.hpp.html | 21 + doc/headers/library.hpp.html | 15 + doc/headers/limits.hpp.html | 20 + doc/headers/list.hpp.html | 35 + doc/headers/logical.hpp.html | 29 + doc/headers/max.hpp.html | 20 + doc/headers/min.hpp.html | 20 + doc/headers/preprocessor.hpp.html | 15 + doc/headers/punctuation.hpp.html | 22 + doc/headers/repeat.hpp.html | 20 + doc/headers/repeat_2nd.hpp.html | 20 + doc/headers/repeat_3rd.hpp.html | 20 + doc/headers/repeat_from_to.hpp.html | 20 + doc/headers/repeat_from_to_2nd.hpp.html | 20 + doc/headers/repeat_from_to_3rd.hpp.html | 20 + doc/headers/repetition.hpp.html | 33 + doc/headers/selection.hpp.html | 20 + doc/headers/slot.hpp.html | 19 + doc/headers/stringize.hpp.html | 19 + doc/headers/tuple.hpp.html | 23 + doc/headers/while.hpp.html | 20 + doc/index.html | 13 + doc/miscellanea.html | 15 + doc/ref.html | 217 +++++ doc/ref/add.html | 57 ++ doc/ref/add_d.html | 79 ++ doc/ref/and.html | 53 + doc/ref/apply.html | 53 + doc/ref/array_data.html | 38 + doc/ref/array_elem.html | 40 + doc/ref/array_size.html | 34 + doc/ref/assert.html | 103 ++ doc/ref/assert_msg.html | 55 ++ doc/ref/assign_slot.html | 50 + doc/ref/bitand.html | 54 + doc/ref/bitnor.html | 54 + doc/ref/bitor.html | 54 + doc/ref/bitxor.html | 55 ++ doc/ref/bool.html | 43 + doc/ref/cat.html | 46 + doc/ref/comma.html | 32 + doc/ref/comma_if.html | 49 + doc/ref/compl.html | 47 + doc/ref/config_extended_line_info.html | 33 + doc/ref/dec.html | 43 + doc/ref/deduce_d.html | 71 ++ doc/ref/deduce_r.html | 37 + doc/ref/deduce_z.html | 37 + doc/ref/div.html | 52 + doc/ref/div_d.html | 74 ++ doc/ref/empty.html | 36 + doc/ref/enum.html | 69 ++ doc/ref/enum_binary_params.html | 65 ++ doc/ref/enum_binary_params_z.html | 82 ++ doc/ref/enum_params.html | 58 ++ doc/ref/enum_params_with_a_default.html | 72 ++ doc/ref/enum_params_with_defaults.html | 73 ++ doc/ref/enum_params_z.html | 71 ++ doc/ref/enum_shifted.html | 71 ++ doc/ref/enum_shifted_params.html | 62 ++ doc/ref/enum_shifted_params_z.html | 68 ++ doc/ref/enum_shifted_z.html | 82 ++ doc/ref/enum_trailing.html | 72 ++ doc/ref/enum_trailing_binary_params.html | 72 ++ doc/ref/enum_trailing_binary_params_z.html | 56 ++ doc/ref/enum_trailing_params.html | 55 ++ doc/ref/enum_trailing_params_z.html | 70 ++ doc/ref/enum_trailing_z.html | 85 ++ doc/ref/enum_z.html | 85 ++ doc/ref/equal.html | 53 + doc/ref/equal_d.html | 58 ++ doc/ref/expand.html | 56 ++ doc/ref/expr_if.html | 59 ++ doc/ref/expr_iif.html | 56 ++ doc/ref/filename_x.html | 41 + doc/ref/for.html | 94 ++ doc/ref/for_r.html | 144 +++ doc/ref/frame_finish.html | 31 + doc/ref/frame_flags.html | 31 + doc/ref/frame_iteration.html | 62 ++ doc/ref/frame_start.html | 31 + doc/ref/greater.html | 54 + doc/ref/greater_d.html | 58 ++ doc/ref/greater_equal.html | 54 + doc/ref/greater_equal_d.html | 58 ++ doc/ref/identity.html | 46 + doc/ref/if.html | 52 + doc/ref/iif.html | 54 + doc/ref/inc.html | 43 + doc/ref/include_self.html | 90 ++ doc/ref/indirect_self.html | 34 + doc/ref/intercept.html | 40 + doc/ref/is_iterating.html | 27 + doc/ref/is_selfish.html | 27 + doc/ref/iterate.html | 72 ++ doc/ref/iteration.html | 44 + doc/ref/iteration_depth.html | 57 ++ doc/ref/iteration_finish.html | 46 + doc/ref/iteration_flags.html | 57 ++ doc/ref/iteration_limits.html | 48 + doc/ref/iteration_params_x.html | 66 ++ doc/ref/iteration_start.html | 46 + doc/ref/less.html | 54 + doc/ref/less_d.html | 59 ++ doc/ref/less_equal.html | 54 + doc/ref/less_equal_d.html | 59 ++ doc/ref/limit_dim.html | 24 + doc/ref/limit_for.html | 23 + doc/ref/limit_iteration.html | 23 + doc/ref/limit_iteration_dim.html | 23 + doc/ref/limit_mag.html | 23 + doc/ref/limit_repeat.html | 23 + doc/ref/limit_slot_count.html | 23 + doc/ref/limit_slot_sig.html | 23 + doc/ref/limit_tuple.html | 23 + doc/ref/limit_while.html | 23 + doc/ref/line.html | 101 ++ doc/ref/list_append.html | 58 ++ doc/ref/list_append_d.html | 85 ++ doc/ref/list_at.html | 50 + doc/ref/list_at_d.html | 52 + doc/ref/list_cat.html | 47 + doc/ref/list_cat_d.html | 56 ++ doc/ref/list_cons.html | 76 ++ doc/ref/list_enum.html | 51 + doc/ref/list_enum_r.html | 58 ++ doc/ref/list_filter.html | 65 ++ doc/ref/list_filter_d.html | 75 ++ doc/ref/list_first.html | 51 + doc/ref/list_first_n.html | 51 + doc/ref/list_first_n_d.html | 60 ++ doc/ref/list_fold_left.html | 64 ++ doc/ref/list_fold_left_2nd.html | 64 ++ doc/ref/list_fold_left_2nd_d.html | 75 ++ doc/ref/list_fold_left_d.html | 70 ++ doc/ref/list_fold_left_d_old.html | 75 ++ doc/ref/list_fold_right.html | 68 ++ doc/ref/list_fold_right_2nd.html | 68 ++ doc/ref/list_fold_right_2nd_d.html | 75 ++ doc/ref/list_fold_right_d.html | 70 ++ doc/ref/list_fold_right_d_old.html | 79 ++ doc/ref/list_for_each.html | 64 ++ doc/ref/list_for_each_i.html | 64 ++ doc/ref/list_for_each_i_r.html | 71 ++ doc/ref/list_for_each_product.html | 75 ++ doc/ref/list_for_each_product_r.html | 107 ++ doc/ref/list_for_each_r.html | 70 ++ doc/ref/list_is_cons.html | 40 + doc/ref/list_is_nil.html | 40 + doc/ref/list_nil.html | 57 ++ doc/ref/list_rest.html | 51 + doc/ref/list_rest_n.html | 51 + doc/ref/list_rest_n_d.html | 60 ++ doc/ref/list_reverse.html | 44 + doc/ref/list_reverse_d.html | 52 + doc/ref/list_size.html | 44 + doc/ref/list_size_d.html | 56 ++ doc/ref/list_to_tuple.html | 51 + doc/ref/list_to_tuple_r.html | 58 ++ doc/ref/list_transform.html | 67 ++ doc/ref/list_transform_d.html | 75 ++ doc/ref/local_iterate.html | 51 + doc/ref/local_limits.html | 69 ++ doc/ref/local_macro.html | 53 + doc/ref/lparen.html | 41 + doc/ref/lparen_if.html | 50 + doc/ref/max.html | 53 + doc/ref/max_d.html | 59 ++ doc/ref/min.html | 53 + doc/ref/min_d.html | 59 ++ doc/ref/mod.html | 52 + doc/ref/mod_d.html | 64 ++ doc/ref/mul.html | 57 ++ doc/ref/mul_d.html | 80 ++ doc/ref/nil.html | 30 + doc/ref/nor.html | 53 + doc/ref/not.html | 48 + doc/ref/not_equal.html | 53 + doc/ref/not_equal_d.html | 58 ++ doc/ref/or.html | 53 + doc/ref/relative_finish.html | 35 + doc/ref/relative_flags.html | 35 + doc/ref/relative_iteration.html | 90 ++ doc/ref/relative_start.html | 35 + doc/ref/repeat.html | 69 ++ doc/ref/repeat_1st.html | 71 ++ doc/ref/repeat_2nd.html | 71 ++ doc/ref/repeat_3rd.html | 71 ++ doc/ref/repeat_from_to.html | 91 ++ doc/ref/repeat_from_to_1st.html | 80 ++ doc/ref/repeat_from_to_2nd.html | 80 ++ doc/ref/repeat_from_to_3rd.html | 80 ++ doc/ref/repeat_from_to_d.html | 72 ++ doc/ref/repeat_from_to_d_z.html | 73 ++ doc/ref/repeat_from_to_z.html | 94 ++ doc/ref/repeat_z.html | 89 ++ doc/ref/rparen.html | 42 + doc/ref/rparen_if.html | 50 + doc/ref/slot.html | 49 + doc/ref/stringize.html | 39 + doc/ref/sub.html | 52 + doc/ref/sub_d.html | 74 ++ doc/ref/tuple_eat.html | 47 + doc/ref/tuple_elem.html | 54 + doc/ref/tuple_rem.html | 41 + doc/ref/tuple_reverse.html | 45 + doc/ref/tuple_to_list.html | 46 + doc/ref/value.html | 26 + doc/ref/while.html | 105 ++ doc/ref/while_d.html | 118 +++ doc/ref/xor.html | 53 + doc/resources.html | 15 + doc/styles.css | 79 ++ doc/syntax.html | 215 ++++ doc/terms.html | 14 + doc/terms/evaluated.html | 16 + doc/terms/named_external.html | 14 + doc/top.html | 27 + doc/topics.html | 20 + doc/topics/evaluated_slots.html | 146 +++ doc/topics/file_iteration.html | 921 ++++++++++++++++++ doc/topics/incompatible.html | 129 +++ doc/topics/local_iteration.html | 149 +++ doc/topics/motivation.html | 100 ++ doc/topics/problems.html | 124 +++ doc/topics/reentrancy.html | 253 +++++ doc/topics/techniques.html | 336 +++++++ 263 files changed, 14965 insertions(+), 16 deletions(-) create mode 100644 doc/acknowledgements.html create mode 100644 doc/bibliography.html create mode 100644 doc/blank.html create mode 100644 doc/contents.html create mode 100644 doc/data.html create mode 100644 doc/data/arrays.html create mode 100644 doc/data/lists.html create mode 100644 doc/data/tuples.html create mode 100644 doc/examples.html delete mode 100644 doc/examples/out.cpp create mode 100644 doc/headers.html create mode 100644 doc/headers/arithmetic.hpp.html create mode 100644 doc/headers/array.hpp.html create mode 100644 doc/headers/assert_msg.hpp.html create mode 100644 doc/headers/cat.hpp.html create mode 100644 doc/headers/comma.hpp.html create mode 100644 doc/headers/comma_if.hpp.html create mode 100644 doc/headers/comparison.hpp.html create mode 100644 doc/headers/control.hpp.html create mode 100644 doc/headers/debug.hpp.html create mode 100644 doc/headers/dec.hpp.html create mode 100644 doc/headers/empty.hpp.html create mode 100644 doc/headers/enum.hpp.html create mode 100644 doc/headers/enum_params.hpp.html create mode 100644 doc/headers/enum_params_with_a_default.hpp.html create mode 100644 doc/headers/enum_params_with_defaults.hpp.html create mode 100644 doc/headers/enum_shifted.hpp.html create mode 100644 doc/headers/enum_shifted_params.hpp.html create mode 100644 doc/headers/expand.hpp.html create mode 100644 doc/headers/expr_if.hpp.html create mode 100644 doc/headers/facilities.hpp.html create mode 100644 doc/headers/for.hpp.html create mode 100644 doc/headers/identity.hpp.html create mode 100644 doc/headers/if.hpp.html create mode 100644 doc/headers/inc.hpp.html create mode 100644 doc/headers/iterate.hpp.html create mode 100644 doc/headers/iteration.hpp.html create mode 100644 doc/headers/library.hpp.html create mode 100644 doc/headers/limits.hpp.html create mode 100644 doc/headers/list.hpp.html create mode 100644 doc/headers/logical.hpp.html create mode 100644 doc/headers/max.hpp.html create mode 100644 doc/headers/min.hpp.html create mode 100644 doc/headers/preprocessor.hpp.html create mode 100644 doc/headers/punctuation.hpp.html create mode 100644 doc/headers/repeat.hpp.html create mode 100644 doc/headers/repeat_2nd.hpp.html create mode 100644 doc/headers/repeat_3rd.hpp.html create mode 100644 doc/headers/repeat_from_to.hpp.html create mode 100644 doc/headers/repeat_from_to_2nd.hpp.html create mode 100644 doc/headers/repeat_from_to_3rd.hpp.html create mode 100644 doc/headers/repetition.hpp.html create mode 100644 doc/headers/selection.hpp.html create mode 100644 doc/headers/slot.hpp.html create mode 100644 doc/headers/stringize.hpp.html create mode 100644 doc/headers/tuple.hpp.html create mode 100644 doc/headers/while.hpp.html create mode 100644 doc/index.html create mode 100644 doc/miscellanea.html create mode 100644 doc/ref.html create mode 100644 doc/ref/add.html create mode 100644 doc/ref/add_d.html create mode 100644 doc/ref/and.html create mode 100644 doc/ref/apply.html create mode 100644 doc/ref/array_data.html create mode 100644 doc/ref/array_elem.html create mode 100644 doc/ref/array_size.html create mode 100644 doc/ref/assert.html create mode 100644 doc/ref/assert_msg.html create mode 100644 doc/ref/assign_slot.html create mode 100644 doc/ref/bitand.html create mode 100644 doc/ref/bitnor.html create mode 100644 doc/ref/bitor.html create mode 100644 doc/ref/bitxor.html create mode 100644 doc/ref/bool.html create mode 100644 doc/ref/cat.html create mode 100644 doc/ref/comma.html create mode 100644 doc/ref/comma_if.html create mode 100644 doc/ref/compl.html create mode 100644 doc/ref/config_extended_line_info.html create mode 100644 doc/ref/dec.html create mode 100644 doc/ref/deduce_d.html create mode 100644 doc/ref/deduce_r.html create mode 100644 doc/ref/deduce_z.html create mode 100644 doc/ref/div.html create mode 100644 doc/ref/div_d.html create mode 100644 doc/ref/empty.html create mode 100644 doc/ref/enum.html create mode 100644 doc/ref/enum_binary_params.html create mode 100644 doc/ref/enum_binary_params_z.html create mode 100644 doc/ref/enum_params.html create mode 100644 doc/ref/enum_params_with_a_default.html create mode 100644 doc/ref/enum_params_with_defaults.html create mode 100644 doc/ref/enum_params_z.html create mode 100644 doc/ref/enum_shifted.html create mode 100644 doc/ref/enum_shifted_params.html create mode 100644 doc/ref/enum_shifted_params_z.html create mode 100644 doc/ref/enum_shifted_z.html create mode 100644 doc/ref/enum_trailing.html create mode 100644 doc/ref/enum_trailing_binary_params.html create mode 100644 doc/ref/enum_trailing_binary_params_z.html create mode 100644 doc/ref/enum_trailing_params.html create mode 100644 doc/ref/enum_trailing_params_z.html create mode 100644 doc/ref/enum_trailing_z.html create mode 100644 doc/ref/enum_z.html create mode 100644 doc/ref/equal.html create mode 100644 doc/ref/equal_d.html create mode 100644 doc/ref/expand.html create mode 100644 doc/ref/expr_if.html create mode 100644 doc/ref/expr_iif.html create mode 100644 doc/ref/filename_x.html create mode 100644 doc/ref/for.html create mode 100644 doc/ref/for_r.html create mode 100644 doc/ref/frame_finish.html create mode 100644 doc/ref/frame_flags.html create mode 100644 doc/ref/frame_iteration.html create mode 100644 doc/ref/frame_start.html create mode 100644 doc/ref/greater.html create mode 100644 doc/ref/greater_d.html create mode 100644 doc/ref/greater_equal.html create mode 100644 doc/ref/greater_equal_d.html create mode 100644 doc/ref/identity.html create mode 100644 doc/ref/if.html create mode 100644 doc/ref/iif.html create mode 100644 doc/ref/inc.html create mode 100644 doc/ref/include_self.html create mode 100644 doc/ref/indirect_self.html create mode 100644 doc/ref/intercept.html create mode 100644 doc/ref/is_iterating.html create mode 100644 doc/ref/is_selfish.html create mode 100644 doc/ref/iterate.html create mode 100644 doc/ref/iteration.html create mode 100644 doc/ref/iteration_depth.html create mode 100644 doc/ref/iteration_finish.html create mode 100644 doc/ref/iteration_flags.html create mode 100644 doc/ref/iteration_limits.html create mode 100644 doc/ref/iteration_params_x.html create mode 100644 doc/ref/iteration_start.html create mode 100644 doc/ref/less.html create mode 100644 doc/ref/less_d.html create mode 100644 doc/ref/less_equal.html create mode 100644 doc/ref/less_equal_d.html create mode 100644 doc/ref/limit_dim.html create mode 100644 doc/ref/limit_for.html create mode 100644 doc/ref/limit_iteration.html create mode 100644 doc/ref/limit_iteration_dim.html create mode 100644 doc/ref/limit_mag.html create mode 100644 doc/ref/limit_repeat.html create mode 100644 doc/ref/limit_slot_count.html create mode 100644 doc/ref/limit_slot_sig.html create mode 100644 doc/ref/limit_tuple.html create mode 100644 doc/ref/limit_while.html create mode 100644 doc/ref/line.html create mode 100644 doc/ref/list_append.html create mode 100644 doc/ref/list_append_d.html create mode 100644 doc/ref/list_at.html create mode 100644 doc/ref/list_at_d.html create mode 100644 doc/ref/list_cat.html create mode 100644 doc/ref/list_cat_d.html create mode 100644 doc/ref/list_cons.html create mode 100644 doc/ref/list_enum.html create mode 100644 doc/ref/list_enum_r.html create mode 100644 doc/ref/list_filter.html create mode 100644 doc/ref/list_filter_d.html create mode 100644 doc/ref/list_first.html create mode 100644 doc/ref/list_first_n.html create mode 100644 doc/ref/list_first_n_d.html create mode 100644 doc/ref/list_fold_left.html create mode 100644 doc/ref/list_fold_left_2nd.html create mode 100644 doc/ref/list_fold_left_2nd_d.html create mode 100644 doc/ref/list_fold_left_d.html create mode 100644 doc/ref/list_fold_left_d_old.html create mode 100644 doc/ref/list_fold_right.html create mode 100644 doc/ref/list_fold_right_2nd.html create mode 100644 doc/ref/list_fold_right_2nd_d.html create mode 100644 doc/ref/list_fold_right_d.html create mode 100644 doc/ref/list_fold_right_d_old.html create mode 100644 doc/ref/list_for_each.html create mode 100644 doc/ref/list_for_each_i.html create mode 100644 doc/ref/list_for_each_i_r.html create mode 100644 doc/ref/list_for_each_product.html create mode 100644 doc/ref/list_for_each_product_r.html create mode 100644 doc/ref/list_for_each_r.html create mode 100644 doc/ref/list_is_cons.html create mode 100644 doc/ref/list_is_nil.html create mode 100644 doc/ref/list_nil.html create mode 100644 doc/ref/list_rest.html create mode 100644 doc/ref/list_rest_n.html create mode 100644 doc/ref/list_rest_n_d.html create mode 100644 doc/ref/list_reverse.html create mode 100644 doc/ref/list_reverse_d.html create mode 100644 doc/ref/list_size.html create mode 100644 doc/ref/list_size_d.html create mode 100644 doc/ref/list_to_tuple.html create mode 100644 doc/ref/list_to_tuple_r.html create mode 100644 doc/ref/list_transform.html create mode 100644 doc/ref/list_transform_d.html create mode 100644 doc/ref/local_iterate.html create mode 100644 doc/ref/local_limits.html create mode 100644 doc/ref/local_macro.html create mode 100644 doc/ref/lparen.html create mode 100644 doc/ref/lparen_if.html create mode 100644 doc/ref/max.html create mode 100644 doc/ref/max_d.html create mode 100644 doc/ref/min.html create mode 100644 doc/ref/min_d.html create mode 100644 doc/ref/mod.html create mode 100644 doc/ref/mod_d.html create mode 100644 doc/ref/mul.html create mode 100644 doc/ref/mul_d.html create mode 100644 doc/ref/nil.html create mode 100644 doc/ref/nor.html create mode 100644 doc/ref/not.html create mode 100644 doc/ref/not_equal.html create mode 100644 doc/ref/not_equal_d.html create mode 100644 doc/ref/or.html create mode 100644 doc/ref/relative_finish.html create mode 100644 doc/ref/relative_flags.html create mode 100644 doc/ref/relative_iteration.html create mode 100644 doc/ref/relative_start.html create mode 100644 doc/ref/repeat.html create mode 100644 doc/ref/repeat_1st.html create mode 100644 doc/ref/repeat_2nd.html create mode 100644 doc/ref/repeat_3rd.html create mode 100644 doc/ref/repeat_from_to.html create mode 100644 doc/ref/repeat_from_to_1st.html create mode 100644 doc/ref/repeat_from_to_2nd.html create mode 100644 doc/ref/repeat_from_to_3rd.html create mode 100644 doc/ref/repeat_from_to_d.html create mode 100644 doc/ref/repeat_from_to_d_z.html create mode 100644 doc/ref/repeat_from_to_z.html create mode 100644 doc/ref/repeat_z.html create mode 100644 doc/ref/rparen.html create mode 100644 doc/ref/rparen_if.html create mode 100644 doc/ref/slot.html create mode 100644 doc/ref/stringize.html create mode 100644 doc/ref/sub.html create mode 100644 doc/ref/sub_d.html create mode 100644 doc/ref/tuple_eat.html create mode 100644 doc/ref/tuple_elem.html create mode 100644 doc/ref/tuple_rem.html create mode 100644 doc/ref/tuple_reverse.html create mode 100644 doc/ref/tuple_to_list.html create mode 100644 doc/ref/value.html create mode 100644 doc/ref/while.html create mode 100644 doc/ref/while_d.html create mode 100644 doc/ref/xor.html create mode 100644 doc/resources.html create mode 100644 doc/styles.css create mode 100644 doc/syntax.html create mode 100644 doc/terms.html create mode 100644 doc/terms/evaluated.html create mode 100644 doc/terms/named_external.html create mode 100644 doc/top.html create mode 100644 doc/topics.html create mode 100644 doc/topics/evaluated_slots.html create mode 100644 doc/topics/file_iteration.html create mode 100644 doc/topics/incompatible.html create mode 100644 doc/topics/local_iteration.html create mode 100644 doc/topics/motivation.html create mode 100644 doc/topics/problems.html create mode 100644 doc/topics/reentrancy.html create mode 100644 doc/topics/techniques.html diff --git a/doc/acknowledgements.html b/doc/acknowledgements.html new file mode 100644 index 0000000..e9ef104 --- /dev/null +++ b/doc/acknowledgements.html @@ -0,0 +1,55 @@ + + + acknowledgements.html + + + +

Acknowledgements

+
+ The following are a few acknowledgements of people that contributed to + or were instrumental in the development of the library by Vesa Karnoven and myself. +
+

Vesa Karvonen

+
+ The original idea of passing two extra parameters to REPEAT, which makes it possible to create preprocessor code on top of it, + was due to Aleksey Gurtovoy.  + The invokeable IDENTITY macro was invented by him.  + He also suggested the name for the library.  + Many thanks to Aleksey for his insights! +
+
+ Thanks to everyone who participated in the review:  David Abrahams, Beman Dawes, Ronald Garcia, Douglas Gregor, Aleksey Gurtovoy, Jeremy Siek, and Daryle Walker. +
+
+ Thanks to Chris Little and Mat Marcus for providing help with MWCW. +
+
+ The original automatic recursion technique, which makes many of the library + primitives easier to use, was invented by Paul Mensonides. +
+
+ The PREPROCESSOR library has been developed by Vesa Karvonen. +
+

Paul Mensonides

+
+ Thanks to Vesa Karvonen for the original conception of the library.  + His work, his help, and his opinions are all much appreciated. +
+
+ Thanks also to David Abrahams for his observations and continued support. +
+
+ The help of several other Boost developers is also greatly appreciated.  + In particular, thanks to Aleksey Gurtovoy for his suggestions and to Ralf W. Grosse-Kunstleve for providing + access to several compilers for testing. +
+
+
+ © Copyright Housemarque Oy 2002 +
+
+Permission to copy, use, modify, sell and distribute this document is granted provided this copyright notice appears in all copies.  +This document is provided "as is" without express or implied warranty and with no claim as to its suitability for any purpose. +
+ + diff --git a/doc/bibliography.html b/doc/bibliography.html new file mode 100644 index 0000000..02eab34 --- /dev/null +++ b/doc/bibliography.html @@ -0,0 +1,55 @@ + + + bibliography.html + + + +

Bibliography

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
[Stroustrup]Stroustrup:  The Design and Evolution of C++, ISBN 0201543303
[Czarnecki]Czarnecki, Eisenecker:  Generative Programming, ISBN 0201309777
[Barton]Barton, Nackman:  Scientific and Engineering C++, ISBN 0201533936
[McConnell]McConnell:  Code Complete, ISBN 1556154844
[Std]ISO/IEC 14882:1998 Programming Languages - C++
[Thompson]Thompson:  Haskell:  The Craft of Functional Programming, ISBN 0201342758
[Okasaki]Okasaki:  Purely Functional Data Structures, ISBN 0521663504
[Cousineau]Cousineau, Mauny:  The Functional Approach to Programming, ISBN 0521576814
[Abelson]Abelson, Sussman, Sussman:  Structure and Interpretation of Computer Programs, ISBN 0521576814
+
+
+ © Copyright Housemarque Oy 2002 +
+
+Permission to copy, use, modify, sell and distribute this document is granted provided this copyright notice appears in all copies.  +This document is provided "as is" without express or implied warranty and with no claim as to its suitability for any purpose. +
+ + diff --git a/doc/blank.html b/doc/blank.html new file mode 100644 index 0000000..05e6d82 --- /dev/null +++ b/doc/blank.html @@ -0,0 +1,9 @@ + + + blank.html + + + + + + diff --git a/doc/contents.html b/doc/contents.html new file mode 100644 index 0000000..0aae6e7 --- /dev/null +++ b/doc/contents.html @@ -0,0 +1,20 @@ + + + contents.html + + + + + +

Topics

+

Terminology

+

Data Types

+

Reference

+

Headers

+

Examples

+

Miscellanea

+ + + diff --git a/doc/data.html b/doc/data.html new file mode 100644 index 0000000..f1dc401 --- /dev/null +++ b/doc/data.html @@ -0,0 +1,15 @@ + + + data.html + + + + +

Data Types [back]

+ + + diff --git a/doc/data/arrays.html b/doc/data/arrays.html new file mode 100644 index 0000000..6274eb2 --- /dev/null +++ b/doc/data/arrays.html @@ -0,0 +1,43 @@ + + + arrays.html + + + + +

Arrays

+
+ An array is a data structure consisting of a two-element tuple.  + The first element is the number of elements in the array.  + The second element is another tuple of the elements in the array.  + For example, +
+
+ (3, (a, b, c)) +
+
+ ...is an array of 3 elements--a, b, and c. +
+
+ The primary strength of arrays is that they store their own size.  + Because of this, access to elements does not require the size.  + It only requires that an element exists at a certain index. +
+
+ This allows macro parameters to be variable in size and allows data states to change + size without the user explicitly keeping track of the size independently. +
+
+ Elements of an array can be extracted with BOOST_PP_ARRAY_ELEM, + an array's size can be extracted with BOOST_PP_ARRAY_SIZE, and + an array can be converted to the more primitive tuple data structure + with BOOST_PP_ARRAY_DATA. +
+

Primitives

+ + + diff --git a/doc/data/lists.html b/doc/data/lists.html new file mode 100644 index 0000000..3f0fabb --- /dev/null +++ b/doc/data/lists.html @@ -0,0 +1,36 @@ + + + lists.html + + + + +

Lists

+
+ A list is a simple cons-style list with a head and a tail.  + The head of a list is an element, + and the tail is either another list or BOOST_PP_NIL. + For example, +
+
+ (a, (b, (c, BOOST_PP_NIL))) +
+
+ ...is a list of 3 elements--a, b, and c. +
+
+ This allows macro parameters to be variable in size and allows data states to change + size without the user explicitly keeping track of the size independently. +
+
+ Elements of a list can be extracted with + BOOST_PP_LIST_FIRST and BOOST_PP_LIST_REST.  +
+

Primitives

+ + + diff --git a/doc/data/tuples.html b/doc/data/tuples.html new file mode 100644 index 0000000..ca01b2e --- /dev/null +++ b/doc/data/tuples.html @@ -0,0 +1,32 @@ + + + tuples.html + + + + +

Tuples

+
+ A tuple is a simple comma-separated list of elements inside parenthesis.  + For example, +
+
+ (a, b, c) +
+
+ ...is a tuple of 3 elements--a, b, and c. +
+
+ Tuples are fast and easy to use.  + However, all access to tuples requires knowledge of its size. +
+
+ Elements of a tuple can be extracted with + BOOST_PP_TUPLE_ELEM. +
+

Primitives

+ + + diff --git a/doc/examples.html b/doc/examples.html new file mode 100644 index 0000000..97482db --- /dev/null +++ b/doc/examples.html @@ -0,0 +1,18 @@ + + + topics.html + + + + +

Examples [back]

+ + + diff --git a/doc/examples/out.cpp b/doc/examples/out.cpp deleted file mode 100644 index 4fe5bc1..0000000 --- a/doc/examples/out.cpp +++ /dev/null @@ -1,16 +0,0 @@ - - -extern "C" { - - void _assert(const char*, const char*, unsigned); - -} - -int main(void) { - int i = 0; - do { int duffs_device_initial_cnt = (0); if (duffs_device_initial_cnt > 0) { int duffs_device_running_cnt = (duffs_device_initial_cnt + (16 - 1)) / 16; switch (duffs_device_initial_cnt % 16) { do { case (0 ? 16 - 0 : 0): { ++i; }; case (1 ? 16 - 1 : 0): { ++i; }; case (2 ? 16 - 2 : 0): { ++i; }; case (3 ? 16 - 3 : 0): { ++i; }; case (4 ? 16 - 4 : 0): { ++i; }; case (5 ? 16 - 5 : 0): { ++i; }; case (6 ? 16 - 6 : 0): { ++i; }; case (7 ? 16 - 7 : 0): { ++i; }; case (8 ? 16 - 8 : 0): { ++i; }; case (9 ? 16 - 9 : 0): { ++i; }; case (10 ? 16 - 10 : 0): { ++i; }; case (11 ? 16 - 11 : 0): { ++i; }; case (12 ? 16 - 12 : 0): { ++i; }; case (13 ? 16 - 13 : 0): { ++i; }; case (14 ? 16 - 14 : 0): { ++i; }; case (15 ? 16 - 15 : 0): { ++i; }; } while (--duffs_device_running_cnt); } } } while (0); - (void)( (i == 0) || (_assert("i == 0", "duffs_device.c", 58), 0) ); - do { int duffs_device_initial_cnt = (1000); if (duffs_device_initial_cnt > 0) { int duffs_device_running_cnt = (duffs_device_initial_cnt + (16 - 1)) / 16; switch (duffs_device_initial_cnt % 16) { do { case (0 ? 16 - 0 : 0): { ++i; }; case (1 ? 16 - 1 : 0): { ++i; }; case (2 ? 16 - 2 : 0): { ++i; }; case (3 ? 16 - 3 : 0): { ++i; }; case (4 ? 16 - 4 : 0): { ++i; }; case (5 ? 16 - 5 : 0): { ++i; }; case (6 ? 16 - 6 : 0): { ++i; }; case (7 ? 16 - 7 : 0): { ++i; }; case (8 ? 16 - 8 : 0): { ++i; }; case (9 ? 16 - 9 : 0): { ++i; }; case (10 ? 16 - 10 : 0): { ++i; }; case (11 ? 16 - 11 : 0): { ++i; }; case (12 ? 16 - 12 : 0): { ++i; }; case (13 ? 16 - 13 : 0): { ++i; }; case (14 ? 16 - 14 : 0): { ++i; }; case (15 ? 16 - 15 : 0): { ++i; }; } while (--duffs_device_running_cnt); } } } while (0); - (void)( (i == 1000) || (_assert("i == N", "duffs_device.c", 60), 0) ); - return 0; -} diff --git a/doc/headers.html b/doc/headers.html new file mode 100644 index 0000000..2d00a7e --- /dev/null +++ b/doc/headers.html @@ -0,0 +1,165 @@ + + + headers.html + + + + + +

Headers [back]

+ + + diff --git a/doc/headers/arithmetic.hpp.html b/doc/headers/arithmetic.hpp.html new file mode 100644 index 0000000..29a8bfd --- /dev/null +++ b/doc/headers/arithmetic.hpp.html @@ -0,0 +1,25 @@ + + + arithmetic.hpp + + + +
+ The arithmetic.hpp includes the headers in the arithmetic folder. +
+

Usage

+
+ #include <boost/preprocessor/arithmetic.hpp> +
+

Includes

+ + + diff --git a/doc/headers/array.hpp.html b/doc/headers/array.hpp.html new file mode 100644 index 0000000..11f5c6b --- /dev/null +++ b/doc/headers/array.hpp.html @@ -0,0 +1,21 @@ + + + array.hpp + + + +
+ The array.hpp includes the headers in the array folder. +
+

Usage

+
+ #include <boost/preprocessor/array.hpp> +
+

Includes

+ + + diff --git a/doc/headers/assert_msg.hpp.html b/doc/headers/assert_msg.hpp.html new file mode 100644 index 0000000..51610b7 --- /dev/null +++ b/doc/headers/assert_msg.hpp.html @@ -0,0 +1,20 @@ + + + assert_msg.hpp + + + +
+ The assert_msg.hpp is a jumper header for backwards compatibility.  + This header is deprecated. +
+

Usage

+
+ #include <boost/preprocessor/assert_msg.hpp> +
+

Includes

+ + + diff --git a/doc/headers/cat.hpp.html b/doc/headers/cat.hpp.html new file mode 100644 index 0000000..55be6d1 --- /dev/null +++ b/doc/headers/cat.hpp.html @@ -0,0 +1,19 @@ + + + cat.hpp + + + +
+ The cat.hpp header defines a concatenation macro. +
+

Usage

+
+ #include <boost/preprocessor/cat.hpp> +
+

Contents

+ + + diff --git a/doc/headers/comma.hpp.html b/doc/headers/comma.hpp.html new file mode 100644 index 0000000..3682824 --- /dev/null +++ b/doc/headers/comma.hpp.html @@ -0,0 +1,20 @@ + + + comma.hpp + + + +
+ The comma.hpp is a jumper header for backwards compatibility.  + This header is deprecated. +
+

Usage

+
+ #include <boost/preprocessor/comma.hpp> +
+

Includes

+ + + diff --git a/doc/headers/comma_if.hpp.html b/doc/headers/comma_if.hpp.html new file mode 100644 index 0000000..02c15e2 --- /dev/null +++ b/doc/headers/comma_if.hpp.html @@ -0,0 +1,20 @@ + + + comma_if.hpp + + + +
+ The comma_if.hpp is a jumper header for backwards compatibility.  + This header is deprecated. +
+

Usage

+
+ #include <boost/preprocessor/comma_if.hpp> +
+

Includes

+ + + diff --git a/doc/headers/comparison.hpp.html b/doc/headers/comparison.hpp.html new file mode 100644 index 0000000..066f290 --- /dev/null +++ b/doc/headers/comparison.hpp.html @@ -0,0 +1,24 @@ + + + comparison.hpp + + + +
+ The comparison.hpp includes the headers in the comparison folder. +
+

Usage

+
+ #include <boost/preprocessor/comparison.hpp> +
+

Includes

+ + + diff --git a/doc/headers/control.hpp.html b/doc/headers/control.hpp.html new file mode 100644 index 0000000..6be634c --- /dev/null +++ b/doc/headers/control.hpp.html @@ -0,0 +1,24 @@ + + + control.hpp + + + +
+ The control.hpp includes the headers in the control folder. +
+

Usage

+
+ #include <boost/preprocessor/control.hpp> +
+

Includes

+ + + diff --git a/doc/headers/debug.hpp.html b/doc/headers/debug.hpp.html new file mode 100644 index 0000000..3acc7b4 --- /dev/null +++ b/doc/headers/debug.hpp.html @@ -0,0 +1,20 @@ + + + debug.hpp + + + +
+ The debug.hpp includes the headers in the debug folder. +
+

Usage

+
+ #include <boost/preprocessor/debug.hpp> +
+

Includes

+ + + diff --git a/doc/headers/dec.hpp.html b/doc/headers/dec.hpp.html new file mode 100644 index 0000000..b6a024e --- /dev/null +++ b/doc/headers/dec.hpp.html @@ -0,0 +1,20 @@ + + + dec.hpp + + + +
+ The dec.hpp is a jumper header for backwards compatibility.  + This header is deprecated. +
+

Usage

+
+ #include <boost/preprocessor/dec.hpp> +
+

Includes

+ + + diff --git a/doc/headers/empty.hpp.html b/doc/headers/empty.hpp.html new file mode 100644 index 0000000..ef6827c --- /dev/null +++ b/doc/headers/empty.hpp.html @@ -0,0 +1,20 @@ + + + empty.hpp + + + +
+ The empty.hpp is a jumper header for backwards compatibility.  + This header is deprecated. +
+

Usage

+
+ #include <boost/preprocessor/empty.hpp> +
+

Includes

+ + + diff --git a/doc/headers/enum.hpp.html b/doc/headers/enum.hpp.html new file mode 100644 index 0000000..8c9e9d3 --- /dev/null +++ b/doc/headers/enum.hpp.html @@ -0,0 +1,20 @@ + + + enum.hpp + + + +
+ The enum.hpp is a jumper header for backwards compatibility.  + This header is deprecated. +
+

Usage

+
+ #include <boost/preprocessor/enum.hpp> +
+

Includes

+ + + diff --git a/doc/headers/enum_params.hpp.html b/doc/headers/enum_params.hpp.html new file mode 100644 index 0000000..323f119 --- /dev/null +++ b/doc/headers/enum_params.hpp.html @@ -0,0 +1,20 @@ + + + enum_params.hpp + + + +
+ The enum_params.hpp is a jumper header for backwards compatibility.  + This header is deprecated. +
+

Usage

+
+ #include <boost/preprocessor/enum_params.hpp> +
+

Includes

+ + + diff --git a/doc/headers/enum_params_with_a_default.hpp.html b/doc/headers/enum_params_with_a_default.hpp.html new file mode 100644 index 0000000..bd08d72 --- /dev/null +++ b/doc/headers/enum_params_with_a_default.hpp.html @@ -0,0 +1,20 @@ + + + enum_params_with_a_default.hpp + + + +
+ The enum_params_with_a_default.hpp is a jumper header for backwards compatibility.  + This header is deprecated. +
+

Usage

+
+ #include <boost/preprocessor/enum_params_with_a_default.hpp> +
+

Includes

+ + + diff --git a/doc/headers/enum_params_with_defaults.hpp.html b/doc/headers/enum_params_with_defaults.hpp.html new file mode 100644 index 0000000..118ae99 --- /dev/null +++ b/doc/headers/enum_params_with_defaults.hpp.html @@ -0,0 +1,20 @@ + + + enum_params_with_defaults.hpp + + + +
+ The enum_params_with_defaults.hpp is a jumper header for backwards compatibility.  + This header is deprecated. +
+

Usage

+
+ #include <boost/preprocessor/enum_params_with_defaults.hpp> +
+

Includes

+ + + diff --git a/doc/headers/enum_shifted.hpp.html b/doc/headers/enum_shifted.hpp.html new file mode 100644 index 0000000..2635bbd --- /dev/null +++ b/doc/headers/enum_shifted.hpp.html @@ -0,0 +1,20 @@ + + + enum_shifted.hpp + + + +
+ The enum_shifted.hpp is a jumper header for backwards compatibility.  + This header is deprecated. +
+

Usage

+
+ #include <boost/preprocessor/enum_shifted.hpp> +
+

Includes

+ + + diff --git a/doc/headers/enum_shifted_params.hpp.html b/doc/headers/enum_shifted_params.hpp.html new file mode 100644 index 0000000..65314ce --- /dev/null +++ b/doc/headers/enum_shifted_params.hpp.html @@ -0,0 +1,20 @@ + + + enum_shifted_params.hpp + + + +
+ The enum_shifted_params.hpp is a jumper header for backwards compatibility.  + This header is deprecated. +
+

Usage

+
+ #include <boost/preprocessor/enum_shifted_params.hpp> +
+

Includes

+ + + diff --git a/doc/headers/expand.hpp.html b/doc/headers/expand.hpp.html new file mode 100644 index 0000000..7cf8695 --- /dev/null +++ b/doc/headers/expand.hpp.html @@ -0,0 +1,20 @@ + + + expand.hpp + + + +
+ The expand.hpp is a jumper header for backwards compatibility.  + This header is deprecated. +
+

Usage

+
+ #include <boost/preprocessor/expand.hpp> +
+

Includes

+ + + diff --git a/doc/headers/expr_if.hpp.html b/doc/headers/expr_if.hpp.html new file mode 100644 index 0000000..b48973e --- /dev/null +++ b/doc/headers/expr_if.hpp.html @@ -0,0 +1,20 @@ + + + expr_if.hpp + + + +
+ The expr_if.hpp is a jumper header for backwards compatibility.  + This header is deprecated. +
+

Usage

+
+ #include <boost/preprocessor/expr_if.hpp> +
+

Includes

+ + + diff --git a/doc/headers/facilities.hpp.html b/doc/headers/facilities.hpp.html new file mode 100644 index 0000000..0add972 --- /dev/null +++ b/doc/headers/facilities.hpp.html @@ -0,0 +1,23 @@ + + + facilities.hpp + + + +
+ The facilities.hpp includes the headers in the facilities folder. +
+

Usage

+
+ #include <boost/preprocessor/facilities.hpp> +
+

Includes

+ + + diff --git a/doc/headers/for.hpp.html b/doc/headers/for.hpp.html new file mode 100644 index 0000000..cc74959 --- /dev/null +++ b/doc/headers/for.hpp.html @@ -0,0 +1,20 @@ + + + for.hpp + + + +
+ The for.hpp is a jumper header for backwards compatibility.  + This header is deprecated. +
+

Usage

+
+ #include <boost/preprocessor/for.hpp> +
+

Includes

+ + + diff --git a/doc/headers/identity.hpp.html b/doc/headers/identity.hpp.html new file mode 100644 index 0000000..98ed139 --- /dev/null +++ b/doc/headers/identity.hpp.html @@ -0,0 +1,20 @@ + + + identity.hpp + + + +
+ The identity.hpp is a jumper header for backwards compatibility.  + This header is deprecated. +
+

Usage

+
+ #include <boost/preprocessor/identity.hpp> +
+

Includes

+ + + diff --git a/doc/headers/if.hpp.html b/doc/headers/if.hpp.html new file mode 100644 index 0000000..e72b200 --- /dev/null +++ b/doc/headers/if.hpp.html @@ -0,0 +1,20 @@ + + + if.hpp + + + +
+ The if.hpp is a jumper header for backwards compatibility.  + This header is deprecated. +
+

Usage

+
+ #include <boost/preprocessor/if.hpp> +
+

Includes

+ + + diff --git a/doc/headers/inc.hpp.html b/doc/headers/inc.hpp.html new file mode 100644 index 0000000..db35475 --- /dev/null +++ b/doc/headers/inc.hpp.html @@ -0,0 +1,20 @@ + + + inc.hpp + + + +
+ The inc.hpp is a jumper header for backwards compatibility.  + This header is deprecated. +
+

Usage

+
+ #include <boost/preprocessor/inc.hpp> +
+

Includes

+ + + diff --git a/doc/headers/iterate.hpp.html b/doc/headers/iterate.hpp.html new file mode 100644 index 0000000..a2f3dde --- /dev/null +++ b/doc/headers/iterate.hpp.html @@ -0,0 +1,20 @@ + + + iterate.hpp + + + +
+ The iterate.hpp is a jumper header for backwards compatibility.  + This header is deprecated. +
+

Usage

+
+ #include <boost/preprocessor/iterate.hpp> +
+

Includes

+ + + diff --git a/doc/headers/iteration.hpp.html b/doc/headers/iteration.hpp.html new file mode 100644 index 0000000..9f394e2 --- /dev/null +++ b/doc/headers/iteration.hpp.html @@ -0,0 +1,21 @@ + + + iteration.hpp + + + +
+ The iteration.hpp includes the headers in the iteration folder. +
+

Usage

+
+ #include <boost/preprocessor/iteration.hpp> +
+

Includes

+ + + diff --git a/doc/headers/library.hpp.html b/doc/headers/library.hpp.html new file mode 100644 index 0000000..7b3e955 --- /dev/null +++ b/doc/headers/library.hpp.html @@ -0,0 +1,15 @@ + + + library.hpp + + + +
+ The library.hpp includes the entire library. +
+

Usage

+
+ #include <boost/preprocessor/library.hpp> +
+ + diff --git a/doc/headers/limits.hpp.html b/doc/headers/limits.hpp.html new file mode 100644 index 0000000..fe22153 --- /dev/null +++ b/doc/headers/limits.hpp.html @@ -0,0 +1,20 @@ + + + limits.hpp + + + +
+ The limits.hpp is a jumper header for backwards compatibility.  + This header is deprecated. +
+

Usage

+
+ #include <boost/preprocessor/limits.hpp> +
+

Includes

+ + + diff --git a/doc/headers/list.hpp.html b/doc/headers/list.hpp.html new file mode 100644 index 0000000..0583bcf --- /dev/null +++ b/doc/headers/list.hpp.html @@ -0,0 +1,35 @@ + + + list.hpp + + + +
+ The list.hpp includes the headers in the list folder. +
+

Usage

+
+ #include <boost/preprocessor/list.hpp> +
+

Includes

+ + + diff --git a/doc/headers/logical.hpp.html b/doc/headers/logical.hpp.html new file mode 100644 index 0000000..c347646 --- /dev/null +++ b/doc/headers/logical.hpp.html @@ -0,0 +1,29 @@ + + + logical.hpp + + + +
+ The logical.hpp includes the headers in the logical folder. +
+

Usage

+
+ #include <boost/preprocessor/logical.hpp> +
+

Includes

+ + + diff --git a/doc/headers/max.hpp.html b/doc/headers/max.hpp.html new file mode 100644 index 0000000..5034f06 --- /dev/null +++ b/doc/headers/max.hpp.html @@ -0,0 +1,20 @@ + + + max.hpp + + + +
+ The max.hpp is a jumper header for backwards compatibility.  + This header is deprecated. +
+

Usage

+
+ #include <boost/preprocessor/max.hpp> +
+

Includes

+ + + diff --git a/doc/headers/min.hpp.html b/doc/headers/min.hpp.html new file mode 100644 index 0000000..c4bb66d --- /dev/null +++ b/doc/headers/min.hpp.html @@ -0,0 +1,20 @@ + + + min.hpp + + + +
+ The min.hpp is a jumper header for backwards compatibility.  + This header is deprecated. +
+

Usage

+
+ #include <boost/preprocessor/min.hpp> +
+

Includes

+ + + diff --git a/doc/headers/preprocessor.hpp.html b/doc/headers/preprocessor.hpp.html new file mode 100644 index 0000000..b63c449 --- /dev/null +++ b/doc/headers/preprocessor.hpp.html @@ -0,0 +1,15 @@ + + + preprocessor.hpp + + + +
+ The preprocessor.hpp includes the entire library. +
+

Usage

+
+ #include <boost/preprocessor.hpp> +
+ + diff --git a/doc/headers/punctuation.hpp.html b/doc/headers/punctuation.hpp.html new file mode 100644 index 0000000..b05d7e7 --- /dev/null +++ b/doc/headers/punctuation.hpp.html @@ -0,0 +1,22 @@ + + + punctuation.hpp + + + +
+ The punctuation.hpp includes the headers in the punctuation folder. +
+

Usage

+
+ #include <boost/preprocessor/punctuation.hpp> +
+

Includes

+ + + diff --git a/doc/headers/repeat.hpp.html b/doc/headers/repeat.hpp.html new file mode 100644 index 0000000..9445fc9 --- /dev/null +++ b/doc/headers/repeat.hpp.html @@ -0,0 +1,20 @@ + + + repeat.hpp + + + +
+ The repeat.hpp is a jumper header for backwards compatibility.  + This header is deprecated. +
+

Usage

+
+ #include <boost/preprocessor/repeat.hpp> +
+

Includes

+ + + diff --git a/doc/headers/repeat_2nd.hpp.html b/doc/headers/repeat_2nd.hpp.html new file mode 100644 index 0000000..6511226 --- /dev/null +++ b/doc/headers/repeat_2nd.hpp.html @@ -0,0 +1,20 @@ + + + repeat_2nd.hpp + + + +
+ The repeat_2nd.hpp is a jumper header for backwards compatibility.  + This header is deprecated. +
+

Usage

+
+ #include <boost/preprocessor/repeat_2nd.hpp> +
+

Includes

+ + + diff --git a/doc/headers/repeat_3rd.hpp.html b/doc/headers/repeat_3rd.hpp.html new file mode 100644 index 0000000..8e84c27 --- /dev/null +++ b/doc/headers/repeat_3rd.hpp.html @@ -0,0 +1,20 @@ + + + repeat_3rd.hpp + + + +
+ The repeat_3rd.hpp is a jumper header for backwards compatibility.  + This header is deprecated. +
+

Usage

+
+ #include <boost/preprocessor/repeat_3rd.hpp> +
+

Includes

+ + + diff --git a/doc/headers/repeat_from_to.hpp.html b/doc/headers/repeat_from_to.hpp.html new file mode 100644 index 0000000..6755551 --- /dev/null +++ b/doc/headers/repeat_from_to.hpp.html @@ -0,0 +1,20 @@ + + + repeat_from_to.hpp + + + +
+ The repeat_from_to.hpp is a jumper header for backwards compatibility.  + This header is deprecated. +
+

Usage

+
+ #include <boost/preprocessor/repeat_from_to.hpp> +
+

Includes

+ + + diff --git a/doc/headers/repeat_from_to_2nd.hpp.html b/doc/headers/repeat_from_to_2nd.hpp.html new file mode 100644 index 0000000..f7ad95b --- /dev/null +++ b/doc/headers/repeat_from_to_2nd.hpp.html @@ -0,0 +1,20 @@ + + + repeat_from_to_2nd.hpp + + + +
+ The repeat_from_to_2nd.hpp is a jumper header for backwards compatibility.  + This header is deprecated. +
+

Usage

+
+ #include <boost/preprocessor/repeat_from_to_2nd.hpp> +
+

Includes

+ + + diff --git a/doc/headers/repeat_from_to_3rd.hpp.html b/doc/headers/repeat_from_to_3rd.hpp.html new file mode 100644 index 0000000..4573718 --- /dev/null +++ b/doc/headers/repeat_from_to_3rd.hpp.html @@ -0,0 +1,20 @@ + + + repeat_from_to_3rd.hpp + + + +
+ The repeat_from_to_3rd.hpp is a jumper header for backwards compatibility.  + This header is deprecated. +
+

Usage

+
+ #include <boost/preprocessor/repeat_from_to_3rd.hpp> +
+

Includes

+ + + diff --git a/doc/headers/repetition.hpp.html b/doc/headers/repetition.hpp.html new file mode 100644 index 0000000..d57a2af --- /dev/null +++ b/doc/headers/repetition.hpp.html @@ -0,0 +1,33 @@ + + + repetition.hpp + + + +
+ The repetition.hpp includes the headers in the repetition folder. +
+

Usage

+
+ #include <boost/preprocessor/repetition.hpp> +
+

Includes

+ + + diff --git a/doc/headers/selection.hpp.html b/doc/headers/selection.hpp.html new file mode 100644 index 0000000..6b61935 --- /dev/null +++ b/doc/headers/selection.hpp.html @@ -0,0 +1,20 @@ + + + selection.hpp + + + +
+ The selection.hpp includes the headers in the selection folder. +
+

Usage

+
+ #include <boost/preprocessor/selection.hpp> +
+

Includes

+ + + diff --git a/doc/headers/slot.hpp.html b/doc/headers/slot.hpp.html new file mode 100644 index 0000000..4e13c7b --- /dev/null +++ b/doc/headers/slot.hpp.html @@ -0,0 +1,19 @@ + + + slot.hpp + + + +
+ The slot.hpp includes the headers in the slot folder. +
+

Usage

+
+ #include <boost/preprocessor/slot.hpp> +
+

Includes

+ + + diff --git a/doc/headers/stringize.hpp.html b/doc/headers/stringize.hpp.html new file mode 100644 index 0000000..2945d06 --- /dev/null +++ b/doc/headers/stringize.hpp.html @@ -0,0 +1,19 @@ + + + stringize.hpp + + + +
+ The stringize.hpp header defines a stringizing macro. +
+

Usage

+
+ #include <boost/preprocessor/stringize.hpp> +
+

Contents

+ + + diff --git a/doc/headers/tuple.hpp.html b/doc/headers/tuple.hpp.html new file mode 100644 index 0000000..2926b21 --- /dev/null +++ b/doc/headers/tuple.hpp.html @@ -0,0 +1,23 @@ + + + tuple.hpp + + + +
+ The tuple.hpp includes the headers in the tuple folder. +
+

Usage

+
+ #include <boost/preprocessor/tuple.hpp> +
+

Includes

+ + + diff --git a/doc/headers/while.hpp.html b/doc/headers/while.hpp.html new file mode 100644 index 0000000..a972367 --- /dev/null +++ b/doc/headers/while.hpp.html @@ -0,0 +1,20 @@ + + + while.hpp + + + +
+ The while.hpp is a jumper header for backwards compatibility.  + This header is deprecated. +
+

Usage

+
+ #include <boost/preprocessor/while.hpp> +
+

Includes

+ + + diff --git a/doc/index.html b/doc/index.html new file mode 100644 index 0000000..b509b64 --- /dev/null +++ b/doc/index.html @@ -0,0 +1,13 @@ + + + Boost.Preprocessor + + + + + + + + .. + + diff --git a/doc/miscellanea.html b/doc/miscellanea.html new file mode 100644 index 0000000..d738746 --- /dev/null +++ b/doc/miscellanea.html @@ -0,0 +1,15 @@ + + + miscellanea.html + + + + +

Miscellanea [back]

+ + + diff --git a/doc/ref.html b/doc/ref.html new file mode 100644 index 0000000..a66a943 --- /dev/null +++ b/doc/ref.html @@ -0,0 +1,217 @@ + + + ref.html + + + + +

Reference [back]

+ + + \ No newline at end of file diff --git a/doc/ref/add.html b/doc/ref/add.html new file mode 100644 index 0000000..42c7d02 --- /dev/null +++ b/doc/ref/add.html @@ -0,0 +1,57 @@ + + + BOOST_PP_ADD + + + +
+ The BOOST_PP_ADD macro expands to the sum of its arguments. +
+

Usage

+
+ BOOST_PP_ADD(x, y) +
+

Arguments

+
+
x
+
+ The first addend of the operation.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
y
+
+ The second addend of the operation.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ If the sum of x and y is greater than BOOST_PP_LIMIT_MAG, the result is saturated to BOOST_PP_LIMIT_MAG. +
+
+ Previously, this macro could not be used inside BOOST_PP_WHILE.  + There is no longer any such restriction.  + It is more efficient, however, to use BOOST_PP_ADD_D in such a situation. +
+
+ This macro is the most efficient when x is less than or equal to y.  + However, the efficiency gain is not worth actually comparing the two arguments prior to invocation.  + In other words, x should be the addend that is most likely to be the largest of the two operands. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/arithmetic/add.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/arithmetic/add.hpp>
+
+BOOST_PP_ADD(4, 3) // expands to 7
+
+ + diff --git a/doc/ref/add_d.html b/doc/ref/add_d.html new file mode 100644 index 0000000..df2af3a --- /dev/null +++ b/doc/ref/add_d.html @@ -0,0 +1,79 @@ + + + BOOST_PP_ADD_D + + + +
+ The BOOST_PP_ADD_D macro expands to the sum of its second and third arguments.  + It reenters BOOST_PP_WHILE with maximum efficiency. +
+

Usage

+
+ BOOST_PP_ADD_D(d, x, y) +
+

Arguments

+
+
d
+
+ The next available BOOST_PP_WHILE iteration.  +
+
x
+
+ The first addend of the operation.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
y
+
+ The second addend of the operation.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ If the sum of x and y is greater than BOOST_PP_LIMIT_MAG, the result is saturated to BOOST_PP_LIMIT_MAG. +
+
+ This macro is the most efficient when x is less than or equal to y.  + However, the efficiency gain is not worth actually comparing the two arguments prior to invocation.  + In other words, x should be the addend that is most likely to be the largest of the two operands. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/arithmetic/add.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/arithmetic/add.hpp>
+#include <boost/preprocessor/arithmetic/dec.hpp>
+#include <boost/preprocessor/control/while.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+
+#define PRED(d, data) BOOST_PP_TUPLE_ELEM(2, 0, data)
+
+#define OP(d, data) \
+   ( \
+      BOOST_PP_DEC( \
+         BOOST_PP_TUPLE_ELEM(2, 0, data) \
+      ), \
+      BOOST_PP_ADD_D( \
+         d, \
+         BOOST_PP_TUPLE_ELEM(2, 1, data), \
+         2 \
+      ) \
+   ) \
+   /**/
+
+// increment 'x' by 2 'n' times
+#define STRIDE(x, n) BOOST_PP_TUPLE_ELEM(2, 1, BOOST_PP_WHILE(PRED, OP, (n, x)))
+
+STRIDE(10, 2) // expands to 14
+STRIDE(51, 6) // expands to 63
+
+ + diff --git a/doc/ref/and.html b/doc/ref/and.html new file mode 100644 index 0000000..bfcde95 --- /dev/null +++ b/doc/ref/and.html @@ -0,0 +1,53 @@ + + + BOOST_PP_AND + + + +
+ The BOOST_PP_AND macro expands to the logical AND of its operands. +
+

Usage

+
+ BOOST_PP_AND(p, q) +
+

Arguments

+
+
p
+
+ The left operand of the operation.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
q
+
+ The right operand of the operation.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ If both p and q are non-zero, this macro expands to 1.  + Otherwise, it expands to 0. +
+
+ This macro performs a boolean conversion on each operand before performing the logical AND operation.  + If that conversion is not necessary, use BOOST_PP_BITAND instead. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/logical/and.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/logical/and.hpp>
+
+BOOST_PP_AND(4, 3) // expands to 1
+BOOST_PP_AND(5, 0) // expands to 0
+
+ + diff --git a/doc/ref/apply.html b/doc/ref/apply.html new file mode 100644 index 0000000..82bcb11 --- /dev/null +++ b/doc/ref/apply.html @@ -0,0 +1,53 @@ + + + BOOST_PP_APPLY + + + +
+ The BOOST_PP_APPLY macro abstracts the difference between an argument and nothing. +
+

Usage

+
+ BOOST_PP_APPLY(x) +
+

Arguments

+
+
x
+
+ The abstracted argument.  + This argument must be either BOOST_PP_NIL or a tuple with one element--such as (arg) or ((a, b)). +
+
+

Remarks

+
+ If x is BOOST_PP_NIL, this macro expands to nothing.  + If x is a one element tuple, it expands to the contents of that tuple. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/facilities/apply.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/facilities/apply.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+
+#define CV(i) \
+   BOOST_PP_APPLY( \
+      BOOST_PP_TUPLE_ELEM( \
+         4, i, \
+         (BOOST_PP_NIL, (const), (volatile), (const volatile)) \
+      ) \
+   ) \
+   /**/
+
+CV(0) // expands to nothing
+CV(1) // expands to const
+
+ + diff --git a/doc/ref/array_data.html b/doc/ref/array_data.html new file mode 100644 index 0000000..75798c0 --- /dev/null +++ b/doc/ref/array_data.html @@ -0,0 +1,38 @@ + + + BOOST_PP_ARRAY_DATA + + + +
+ The BOOST_PP_ARRAY_DATA macro extracts the tuple data from an array. +
+

Usage

+
+ BOOST_PP_ARRAY_DATA(array) +
+

Arguments

+
+
array
+
+ An array to be converted to a tuple. +
+
+

Remarks

+
+ This macro expands to the data portion of an array which is a tuple. +
+

Requirements

+
+ Header:  <boost/preprocessor/array/data.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/array/data.hpp>
+
+#define ARRAY (3, (x, y, z))
+
+BOOST_PP_ARRAY_DATA(ARRAY) // expands to (x, y, z)
+
+ + diff --git a/doc/ref/array_elem.html b/doc/ref/array_elem.html new file mode 100644 index 0000000..7e5d700 --- /dev/null +++ b/doc/ref/array_elem.html @@ -0,0 +1,40 @@ + + + BOOST_PP_ARRAY_ELEM + + + +
+ The BOOST_PP_ARRAY_ELEM macro extracts an element from a array. +
+

Usage

+
+ BOOST_PP_ARRAY_ELEM(i, array) +
+

Arguments

+
+
i
+
+ The zero-based index into the array of the element to be extracted.  +
+
array
+
+ The array from which an element is to be extracted.  + This array must contain at least i + 1 elements. +
+
+

Requirements

+
+ Header:  <boost/preprocessor/array/elem.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/array/elem.hpp>
+
+#define ARRAY (4, (a, b, c, d))
+
+BOOST_PP_ARRAY_ELEM(0, ARRAY) // expands to a
+BOOST_PP_ARRAY_ELEM(3, ARRAY) // expands to d
+
+ + diff --git a/doc/ref/array_size.html b/doc/ref/array_size.html new file mode 100644 index 0000000..20cec76 --- /dev/null +++ b/doc/ref/array_size.html @@ -0,0 +1,34 @@ + + + BOOST_PP_ARRAY_SIZE + + + +
+ The BOOST_PP_ARRAY_SIZE macro expands to the size of the array passed to it. +
+

Usage

+
+ BOOST_PP_ARRAY_SIZE(array) +
+

Arguments

+
+
array
+
+ An array whose size is to be extracted. +
+
+

Requirements

+
+ Header:  <boost/preprocessor/array/size.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/array/size.hpp>
+
+#define ARRAY (3, (x, y, z))
+
+BOOST_PP_ARRAY_SIZE(ARRAY) // expands to 3
+
+ + diff --git a/doc/ref/assert.html b/doc/ref/assert.html new file mode 100644 index 0000000..5beb721 --- /dev/null +++ b/doc/ref/assert.html @@ -0,0 +1,103 @@ + + + BOOST_PP_ASSERT + + + +
+ The BOOST_PP_ASSERT macro conditionally causes a preprocessing error. +
+

Usage

+
+ BOOST_PP_ASSERT(cond) +
+

Arguments

+
+
cond
+
+ A condition that determines whether an assertion occurs.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ If cond expands to 0, this macro causes a preprocessing error.  + Otherwise, it expands to nothing. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/debug/assert.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/debug/assert.hpp>
+#include <boost/preprocessor/logical/bitnor.hpp>
+#include <boost/preprocessor/logical/compl.hpp>
+
+// The is BOOST_PP_IS_NULLARY macro is not part of
+// the public interface of the library because it
+// doesn't work on Borland preprocessors.  It is
+// only used here to illustrate assertions.  In
+// effect, it detects whether an argument is empty
+// parenthesis or some text.
+
+#include <boost/preprocessor/detail/is_nullary.hpp>
+
+#define IS_EDISON_DESIGN_GROUP() \
+   BOOST_PP_COMPL( \
+      BOOST_PP_IS_NULLARY( \
+         BOOST_PP_CAT(IS_EDG_CHECK, __EDG_VERSION) \
+      ) \
+   ) \
+   /**/
+#define IS_EDG_CHECK__EDG_VERSION ()
+
+#define IS_METROWERKS() \
+   BOOST_PP_COMPL( \
+      BOOST_PP_IS_NULLARY( \
+         BOOST_PP_CAT(IS_MWERKS_CHECK, __MWERKS__) \
+      ) \
+   ) \
+   /**/
+#define IS_MWERKS_CHECK__MWERKS__ ()
+
+#define IS_MICROSOFT() \
+   BOOST_PP_BITNOR( \
+      IS_MICROSOFT_ROOT(), \
+      IS_EDISON_DESIGN_GROUP() \
+   ) \
+   /**/
+#define IS_MICROSOFT_ROOT() \
+   BOOST_PP_IS_NULLARY( \
+      BOOST_PP_CAT(IS_MSVC_CHECK, _MSC_VER) \
+   ) \
+   /**/
+#define IS_MSVC_CHECK_MS_VER ()
+
+// this macro doesn't work on EDG...
+// (this is just an example)
+
+#define MACRO(n) \
+   BOOST_PP_CAT( \
+      MACRO_, \
+      IS_EDISON_DESIGN_GROUP() \
+   )(n) \
+   /**/
+
+#define MACRO_1(n) \
+   BOOST_PP_ASSERT(0) \
+   "Edison Design Group is not supported" \
+   /**/
+
+#define MACRO_0(n) normal mode: n
+
+MACRO(10)
+
+ + diff --git a/doc/ref/assert_msg.html b/doc/ref/assert_msg.html new file mode 100644 index 0000000..3b53122 --- /dev/null +++ b/doc/ref/assert_msg.html @@ -0,0 +1,55 @@ + + + BOOST_PP_ASSERT_MSG + + + +
+ The BOOST_PP_ASSERT_MSG macro conditionally inserts debugging text. +
+

Usage

+
+ BOOST_PP_ASSERT_MSG(cond, msg) +
+

Arguments

+
+
cond
+
+ A condition that determines whether an assertion occurs.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
msg
+
+ A message to display if cond evaluates to 0. +
+
+

Remarks

+
+ If cond expands to 0, this macro expands to msg.  + Otherwise, it expands to nothing. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/debug/assert.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/comparison/equal.hpp>
+#include <boost/preprocessor/debug/assert.hpp>
+
+// lines are supposed to be counted
+// in translation phase 1
+
+#line 9
+BOOST_PP_ASSERT_MSG( \
+   BOOST_PP_EQUAL(__LINE__, 9), \
+   "incorrect line numbering detected" \
+)
+
+ + diff --git a/doc/ref/assign_slot.html b/doc/ref/assign_slot.html new file mode 100644 index 0000000..9f76220 --- /dev/null +++ b/doc/ref/assign_slot.html @@ -0,0 +1,50 @@ + + + BOOST_PP_ASSIGN_SLOT + + + +
+ The BOOST_PP_ASSIGN_SLOT macro fully evaluates a numeric macro or expression. +
+

Usage

+
+ #include BOOST_PP_ASSIGN_SLOT(i) +
+

Arguments

+
+
i
+
+ The slot index that is to be assigned.  + This value must be in the range of 1 to BOOST_PP_LIMIT_SLOT_COUNT. +
+
+

Remarks

+
+ Prior to use, the named external argument BOOST_PP_VALUE must be defined.  + Also, it must expand to a numeric value that is in the range of 0 to 2^32 - 1. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/slot/slot.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/slot/slot.hpp>
+
+#define X() 4
+
+#define BOOST_PP_VALUE 1 + 2 + 3 + X()
+#include BOOST_PP_ASSIGN_SLOT(1)
+
+#undef X
+
+BOOST_PP_SLOT(1) // expands to 10
+
+ + diff --git a/doc/ref/bitand.html b/doc/ref/bitand.html new file mode 100644 index 0000000..a3f427f --- /dev/null +++ b/doc/ref/bitand.html @@ -0,0 +1,54 @@ + + + BOOST_PP_BITAND + + + +
+ The BOOST_PP_BITAND macro expands to the bitwise AND of its operands. +
+

Usage

+
+ BOOST_PP_BITAND(x, y) +
+

Arguments

+
+
x
+
+ The left operand of the operation.  + This value must expand to 0 or 1. +
+
y
+
+ The right operand of the operation.  + This value must expand to 0 or 1. +
+
+

Remarks

+
+ If both x and y are 1, this macro expands to 1.  + Otherwise, it expands to 0. +
+
+ This macro does not perform a boolean conversion on either operand before performing the bitwise AND operation.  + If that conversion is necessary, use BOOST_PP_AND instead. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/logical/bitand.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/logical/bitand.hpp>
+
+BOOST_PP_BITAND(0, 0) // expands to 0
+BOOST_PP_BITAND(0, 1) // expands to 0
+BOOST_PP_BITAND(1, 0) // expands to 0
+BOOST_PP_BITAND(1, 1) // expands to 1
+
+ + diff --git a/doc/ref/bitnor.html b/doc/ref/bitnor.html new file mode 100644 index 0000000..ec18fdf --- /dev/null +++ b/doc/ref/bitnor.html @@ -0,0 +1,54 @@ + + + BOOST_PP_BITNOR + + + +
+ The BOOST_PP_BITNOR macro expands to the bitwise NOR of its operands. +
+

Usage

+
+ BOOST_PP_BITNOR(x, y) +
+

Arguments

+
+
x
+
+ The left operand of the operation.  + This value must expand to 0 or 1. +
+
y
+
+ The right operand of the operation.  + This value must expand to 0 or 1. +
+
+

Remarks

+
+ If neither x nor y is 1, this macro expands to 1.  + Otherwise, it expands to 0. +
+
+ This macro does not perform a boolean conversion on either operand before performing the bitwise NOR operation.  + If that conversion is necessary, use BOOST_PP_NOR instead. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/logical/bitnor.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/logical/bitnor.hpp>
+
+BOOST_PP_BITNOR(0, 0) // expands to 1
+BOOST_PP_BITNOR(0, 1) // expands to 0
+BOOST_PP_BITNOR(1, 0) // expands to 0
+BOOST_PP_BITNOR(1, 1) // expands to 0
+
+ + diff --git a/doc/ref/bitor.html b/doc/ref/bitor.html new file mode 100644 index 0000000..a0136e3 --- /dev/null +++ b/doc/ref/bitor.html @@ -0,0 +1,54 @@ + + + BOOST_PP_BITOR + + + +
+ The BOOST_PP_BITOR macro expands to the bitwise OR of its operands. +
+

Usage

+
+ BOOST_PP_BITOR(x, y) +
+

Arguments

+
+
x
+
+ The left operand of the operation.  + This value must expand to 0 or 1. +
+
y
+
+ The right operand of the operation.  + This value must expand to 0 or 1. +
+
+

Remarks

+
+ If either x or y is 1, this macro expands to 1.  + Otherwise, it expands to 0. +
+
+ This macro does not perform a boolean conversion on either operand before performing the bitwise OR operation.  + If that conversion is necessary, use BOOST_PP_OR instead. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/logical/bitor.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/logical/bitor.hpp>
+
+BOOST_PP_BITOR(0, 0) // expands to 0
+BOOST_PP_BITOR(0, 1) // expands to 1
+BOOST_PP_BITOR(1, 0) // expands to 1
+BOOST_PP_BITOR(1, 1) // expands to 1
+
+ + diff --git a/doc/ref/bitxor.html b/doc/ref/bitxor.html new file mode 100644 index 0000000..7ae0520 --- /dev/null +++ b/doc/ref/bitxor.html @@ -0,0 +1,55 @@ + + + BOOST_PP_BITXOR + + + + +
+ The BOOST_PP_BITXOR macro expands to the bitwise XOR of its operands. +
+

Usage

+
+ BOOST_PP_BITXOR(x, y) +
+

Arguments

+
+
x
+
+ The left operand of the operation.  + This value must expand to 0 or 1. +
+
y
+
+ The right operand of the operation.  + This value must expand to 0 or 1. +
+
+

Remarks

+
+ If either x or y is 1 exclusively, this macro expands to 1.  + Otherwise, it expands to 0. +
+
+ This macro does not perform a boolean conversion on either operand before performing the bitwise OR operation.  + If that conversion is necessary, use BOOST_PP_XOR instead. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/logical/bitxor.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/logical/bitxor.hpp>
+
+BOOST_PP_BITXOR(0, 0) // expands to 0
+BOOST_PP_BITXOR(0, 1) // expands to 1
+BOOST_PP_BITXOR(1, 0) // expands to 1
+BOOST_PP_BITXOR(1, 1) // expands to 0
+
+ + diff --git a/doc/ref/bool.html b/doc/ref/bool.html new file mode 100644 index 0000000..2dec091 --- /dev/null +++ b/doc/ref/bool.html @@ -0,0 +1,43 @@ + + + BOOST_PP_BOOL + + + +
+ The BOOST_PP_BOOL macro performs a boolean conversion on its operand. +
+

Usage

+
+ BOOST_PP_BOOL(x) +
+

Arguments

+
+
x
+
+ The value to be converted.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ If x is 0, this macro expands to 0.  + Otherwise it expands to 1. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/logical/bool.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/logical/bool.hpp>
+
+BOOST_PP_BOOL(6) // expands to 1
+BOOST_PP_BOOL(0) // expands to 0
+
+ + diff --git a/doc/ref/cat.html b/doc/ref/cat.html new file mode 100644 index 0000000..caeb938 --- /dev/null +++ b/doc/ref/cat.html @@ -0,0 +1,46 @@ + + + BOOST_PP_CAT + + + +
+ The BOOST_PP_CAT macro concatenates its arguments after they have been expanded. +
+

Usage

+
+ BOOST_PP_CAT(a, b) +
+

Arguments

+
+
a
+
+ The left operand of the concatenation. +
+
b
+
+ The right operand of the concatenation. +
+
+

Remarks

+
+ The preprocessor token-pasting operator (##) prevents arguments from expanding.  + This macro allows its arguments to expand before concatenation. +
+
+ Concatenation must not result in an invocation of a macro that uses BOOST_PP_CAT.  + If that happens, BOOST_PP_CAT will not expand the second time. +
+ +

Requirements

+
+ Header:  <boost/preprocessor/cat.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/cat.hpp>
+
+BOOST_PP_CAT(x, BOOST_PP_CAT(y, z)) // expands to xyz
+
+ + diff --git a/doc/ref/comma.html b/doc/ref/comma.html new file mode 100644 index 0000000..9187274 --- /dev/null +++ b/doc/ref/comma.html @@ -0,0 +1,32 @@ + + + BOOST_PP_COMMA + + + +
+ The BOOST_PP_COMMA macro expands to a comma. +
+

Usage

+
+ BOOST_PP_COMMA() +
+

Remarks

+
+ The preprocessor interprets commas as argument separators in macro invocations.  + Because of this, commas require special handling. +
+

Requirements

+
+ Header:  <boost/preprocessor/punctuation/comma.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/control/if.hpp>
+#include <boost/preprocessor/facilities/empty.hpp>
+#include <boost/preprocessor/punctuation/comma.hpp>
+
+BOOST_PP_IF(1, BOOST_PP_COMMA, BOOST_PP_EMPTY)() // expands to ,
+
+ + diff --git a/doc/ref/comma_if.html b/doc/ref/comma_if.html new file mode 100644 index 0000000..76998ef --- /dev/null +++ b/doc/ref/comma_if.html @@ -0,0 +1,49 @@ + + + BOOST_PP_COMMA_IF + + + +
+ The BOOST_PP_COMMA_IF macro conditionally expands to a comma. +
+

Usage

+
+ BOOST_PP_COMMA_IF(cond) +
+

Arguments

+
+
cond
+
+ The condition that determines if a the macro expands to a comma or nothing.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ If cond expands to 0, this macro expands to nothing.  + Otherwise, it expands to a comma. +
+
+ The preprocessor interprets commas as argument separators in macro invocations.  + Because of this, commas require special handling. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/punctuation/comma_if.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/punctuation/comma_if.hpp>
+#include <boost/preprocessor/repetition/repeat.hpp>
+
+#define MACRO(z, n, text) BOOST_PP_COMMA_IF(n) text
+
+BOOST_PP_REPEAT(3, MACRO, class) // expands to class, class, class
+
+ + diff --git a/doc/ref/compl.html b/doc/ref/compl.html new file mode 100644 index 0000000..52a12fd --- /dev/null +++ b/doc/ref/compl.html @@ -0,0 +1,47 @@ + + + BOOST_PP_COMPL + + + +
+ The BOOST_PP_COMPL macro performs a bitwise inversion (bitwise NOT or one's complement) on its operand. +
+

Usage

+
+ BOOST_PP_COMPL(x) +
+

Arguments

+
+
x
+
+ The value to be converted.  + This value must expand to 0 or 1. +
+
+

Remarks

+
+ If x is 0, this macro expands to 1.  + If x is 1, this it expands to 0. +
+
+ This macro does not perform a boolean conversion on its operand before performing the inversion OR operation.  + If that conversion is necessary, use BOOST_PP_NOT instead. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/logical/compl.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/logical/compl.hpp>
+
+BOOST_PP_COMPL(1) // expands to 0
+BOOST_PP_COMPL(0) // expands to 1
+
+ + diff --git a/doc/ref/config_extended_line_info.html b/doc/ref/config_extended_line_info.html new file mode 100644 index 0000000..9ff752f --- /dev/null +++ b/doc/ref/config_extended_line_info.html @@ -0,0 +1,33 @@ + + + BOOST_PP_CONFIG_EXTENDED_LINE_INFO + + + + +
+ The BOOST_PP_CONFIG_EXTENDED_LINE_INFO is a user-defined macro that determines whether BOOST_PP_LINE outputs extended file-iteration state information. +
+

Usage

+
+ #define BOOST_PP_CONFIG_EXTENDED_LINE_INFO n +
+

Arguments

+
+
n
+
+ The value that determines if BOOST_PP_LINE outputs extended file-iteration information.  + This value must be 0 or 1. +
+
+

Remarks

+
+ If n is 1, BOOST_PP_LINE will output extended data.  + By default, this macro is set to 0. +
+

See Also

+ + + diff --git a/doc/ref/dec.html b/doc/ref/dec.html new file mode 100644 index 0000000..99b97fe --- /dev/null +++ b/doc/ref/dec.html @@ -0,0 +1,43 @@ + + + BOOST_PP_DEC + + + +
+ The BOOST_PP_DEC macro expands to one less than its argument. +
+

Usage

+
+ BOOST_PP_DEC(x) +
+

Arguments

+
+
x
+
+ The value to be decremented.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ If x is 0, the result is saturated to 0. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/arithmetic/dec.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/arithmetic/dec.hpp>
+
+BOOST_PP_DEC(BOOST_PP_DEC(6)) // expands to 4
+BOOST_PP_DEC(0) // expands to 0
+
+ + diff --git a/doc/ref/deduce_d.html b/doc/ref/deduce_d.html new file mode 100644 index 0000000..d304ddf --- /dev/null +++ b/doc/ref/deduce_d.html @@ -0,0 +1,71 @@ + + + BOOST_PP_DEDUCE_D + + + +
+ The BOOST_PP_DEDUCE_D macro manually deduces the state of the BOOST_PP_WHILE construct. +
+

Usage

+
+ BOOST_PP_DEDUCE_D() +
+

Remarks

+
+ This macro is intended to avoid the use of automatic-recursion at deep expansion depths.  + Automatic-recursion at such depths can be inefficient on some preprocessors.  + It is not intended to be used directly with the invocation of macros with a _D suffix such as: +
+ BOOST_PP_ADD_D(BOOST_PP_DEDUCE_D(), x, y) +
+ If it is used in this context, the _D macro will fail.  + The _D macros directly concatenate to the d parameter that is passed to them, + which would prevent BOOST_PP_DEDUCE_D() from expanding.  + Furthermore, it is pointless to use this macro in a situation such as this + because it would already be too late to gain any efficiency. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/control/deduce_d.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/arithmetic/add.hpp>
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/arithmetic/sub.hpp>
+#include <boost/preprocessor/control/deduce_d.hpp>
+#include <boost/preprocessor/punctuation/comma_if.hpp>
+#include <boost/preprocessor/repetition/repeat.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+
+#define RANGE(first, last) \
+   BOOST_PP_REPEAT( \
+      BOOST_PP_INC( \
+         BOOST_PP_SUB(last, first) \
+      , \
+      RANGE_M, \
+      (first, BOOST_PP_DEDUCE_D()) \
+   ) \
+   /**/
+
+#define RANGE_M(z, n, data) \
+   RANGE_M_2( \
+      n, \
+      BOOST_PP_TUPLE_ELEM(2, 0, data), \
+      BOOST_PP_TUPLE_ELEM(2, 1, data) \
+   ) \
+   /**/
+
+#define RANGE_M_2(n, first, d) \
+   BOOST_PP_COMMA_IF(n) BOOST_PP_ADD_D(d, n, first) \
+   /**/
+
+RANGE(5, 10) // expands to 5, 6, 7, 8, 9, 10
+
+ + diff --git a/doc/ref/deduce_r.html b/doc/ref/deduce_r.html new file mode 100644 index 0000000..370f98a --- /dev/null +++ b/doc/ref/deduce_r.html @@ -0,0 +1,37 @@ + + + BOOST_PP_DEDUCE_R + + + +
+ The BOOST_PP_DEDUCE_R macro manually deduces the state of the BOOST_PP_FOR construct. +
+

Usage

+
+ BOOST_PP_DEDUCE_R() +
+

Remarks

+
+ This macro is intended to avoid the use of automatic-recursion at deep expansion depths.  + Automatic-recursion at such depths can be inefficient on some preprocessors.  + It is not intended to be used directly with the invocation of macros with a _R suffix such as: +
+ BOOST_PP_LIST_ENUM_R(BOOST_PP_DEDUCE_R(), (a, (b, (c, BOOST_PP_NIL)))) +
+ If it is used in this context, the _R macro will fail.  + The _R macros directly concatenate to the r parameter that is passed to them, + which would prevent BOOST_PP_DEDUCE_R() from expanding.  + Furthermore, it is pointless to use this macro in a situation such as this + because it would already be too late to gain any efficiency. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/deduce_r.hpp> +
+ + diff --git a/doc/ref/deduce_z.html b/doc/ref/deduce_z.html new file mode 100644 index 0000000..8078306 --- /dev/null +++ b/doc/ref/deduce_z.html @@ -0,0 +1,37 @@ + + + BOOST_PP_DEDUCE_Z + + + +
+ The BOOST_PP_DEDUCE_Z macro manually deduces the state of the BOOST_PP_REPEAT construct. +
+

Usage

+
+ BOOST_PP_DEDUCE_Z() +
+

Remarks

+
+ This macro is intended to avoid the use of automatic-recursion at deep expansion depths.  + Automatic-recursion at such depths can be inefficient on some preprocessors.  + It is not intended to be used directly with the invocation of macros with a _Z suffix such as: +
+ BOOST_PP_ENUM_PARAMS_Z(BOOST_PP_DEDUCE_Z(), (a, (b, (c, BOOST_PP_NIL)))) +
+ If it is used in this context, the _Z macro will fail.  + The _Z macros directly concatenate to the r parameter that is passed to them, + which would prevent BOOST_PP_DEDUCE_Z() from expanding.  + Furthermore, it is pointless to use this macro in a situation such as this + because it would already be too late to gain any efficiency. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/deduce_z.hpp> +
+ + diff --git a/doc/ref/div.html b/doc/ref/div.html new file mode 100644 index 0000000..c182019 --- /dev/null +++ b/doc/ref/div.html @@ -0,0 +1,52 @@ + + + BOOST_PP_DIV + + + +
+ The BOOST_PP_DIV macro expands to the quotient of its arguments. +
+

Usage

+
+ BOOST_PP_DIV(x, y) +
+

Arguments

+
+
x
+
+ The dividend (numerator) of the operation.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
y
+
+ The divisor (denominator) of the operation.  + Valid values range from 1 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ Previously, this macro could not be used inside BOOST_PP_WHILE.  + There is no longer any such restriction.  + It is more efficient, however, to use BOOST_PP_DIV_D in such a situation. +
+
+ If y is 0, the result is undefined. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/arithmetic/div.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/arithmetic/div.hpp>
+
+BOOST_PP_DIV(11, 5) // expands to 2
+
+ + diff --git a/doc/ref/div_d.html b/doc/ref/div_d.html new file mode 100644 index 0000000..283a5bf --- /dev/null +++ b/doc/ref/div_d.html @@ -0,0 +1,74 @@ + + + BOOST_PP_DIV_D + + + +
+ The BOOST_PP_DIV_D macro expands to the quotient of its second and third arguments.  + It reenters BOOST_PP_WHILE with maximum efficiency. +
+

Usage

+
+ BOOST_PP_DIV_D(d, x, y) +
+

Arguments

+
+
d
+
+ The next available BOOST_PP_WHILE iteration.  +
+
x
+
+ The dividend (numerator) of the operation.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
y
+
+ The divisor (denominator) of the operation.  + Valid values range from 1 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ If y is 0, the result is undefined. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/arithmetic/div.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/arithmetic/dec.hpp>
+#include <boost/preprocessor/arithmetic/div.hpp>
+#include <boost/preprocessor/control/while.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+
+#define PRED(d, data) BOOST_PP_TUPLE_ELEM(2, 0, data)
+
+#define OP(d, data) \
+   ( \
+      BOOST_PP_DEC( \
+         BOOST_PP_TUPLE_ELEM(2, 0, data) \
+      ), \
+      BOOST_PP_DIV_D( \
+         d, \
+         BOOST_PP_TUPLE_ELEM(2, 1, data), \
+         2 \
+      ) \
+   ) \
+   /**/
+
+// halve 'x' 'n' times
+#define HALVE(x, n) BOOST_PP_TUPLE_ELEM(2, 1, BOOST_PP_WHILE(PRED, OP, (n, x)))
+
+HALVE(8, 2) // expands to 2
+HALVE(16, 1) // expands to 8
+
+ + diff --git a/doc/ref/empty.html b/doc/ref/empty.html new file mode 100644 index 0000000..48e8dbe --- /dev/null +++ b/doc/ref/empty.html @@ -0,0 +1,36 @@ + + + BOOST_PP_EMPTY + + + + +
+ The BOOST_PP_EMPTY macro is a nullary utility macro that expands to nothing. +
+

Usage

+
+ BOOST_PP_EMPTY() +
+

Remarks

+
+ This macro is helps avoid inefficient macro-expansion.  + It is primarily useful as arguments to BOOST_PP_IF or BOOST_PP_IIF. +
+

Requirements

+
+ Header:  <boost/preprocessor/facilities/empty.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/control/if.hpp>
+#include <boost/preprocessor/facilities/empty.hpp>
+
+#define X() result
+#define MACRO(c) BOOST_PP_IF(c, X, BOOST_PP_EMPTY)()
+
+MACRO(0) // expands to nothing
+MACRO(1) // expands to result
+
+ + diff --git a/doc/ref/enum.html b/doc/ref/enum.html new file mode 100644 index 0000000..d5941a0 --- /dev/null +++ b/doc/ref/enum.html @@ -0,0 +1,69 @@ + + + BOOST_PP_ENUM + + + +
+ The BOOST_PP_ENUM macro generates a comma-separated list. +
+

Usage

+
+ BOOST_PP_ENUM(count, macro, data) +
+

Arguments

+
+
count
+
+ The number of repetitious calls to macro.  + Valid values range from 0 to BOOST_PP_LIMIT_REPEAT. +
+
macro
+
+ A ternary operation of the form macro(z, n, data).  + This macro is expanded by BOOST_PP_ENUM with the next available repetition depth, + the current repetition number, and the auxiliary data argument.  +
+
data
+
+ Auxiliary data passed to macro. +
+
+

Remarks

+
+ This macro expands to the comma-separated sequence: +
+ macro(z, 0, data), macro(z, 1, data), ... macro(z, count - 1, data) +
+
+
+ The z value that is passed to macro represents the next available repetition dimension.  + Other macros that have _Z suffix variants internally use BOOST_PP_REPEAT--for example, BOOST_PP_ENUM_PARAMS and BOOST_PP_ENUM_PARAMS_Z.  + Using these _Z versions is not strictly necessary, but passing the z value (that is passed to macro) to these macros allows them to reenter BOOST_PP_REPEAT with maximum efficiency. +
+
+ To directly use this z value, rather than simply passing it to another macro, see BOOST_PP_ENUM_z. +
+
+ Previously, this macro could not be used recursively inside BOOST_PP_REPEAT.  + This limitation no longer exists, as the library can automatically detect the next available repetition depth. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/enum.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/repetition/enum.hpp>
+
+#define TEXT(z, n, text) text
+
+BOOST_PP_ENUM(4, TEXT, class) // expands to class, class, class, class
+
+ + diff --git a/doc/ref/enum_binary_params.html b/doc/ref/enum_binary_params.html new file mode 100644 index 0000000..01fae48 --- /dev/null +++ b/doc/ref/enum_binary_params.html @@ -0,0 +1,65 @@ + + + BOOST_PP_ENUM_BINARY_PARAMS + + + +
+ The BOOST_PP_ENUM_BINARY_PARAMS macro generates a comma-separated list of binary parameters. +
+

Usage

+
+ BOOST_PP_ENUM_BINARY_PARAMS(count, p1, p2) +
+

Arguments

+
+
count
+
+ The number of parameters to generate.  + Valid values range from 0 to BOOST_PP_LIMIT_REPEAT. +
+
p1
+
+ The text of the first part of the parameter.  + BOOST_PP_ENUM_BINARY_PARAMS concatenates numbers ranging from 0 to count - 1 + to generate parameters. +
+
p2
+
+ The text of the first part of the parameter.  + BOOST_PP_ENUM_BINARY_PARAMS concatenates numbers ranging from 0 to count - 1 + to generate parameters. +
+
+

Remarks

+
+ This macro expands to the comma-separated sequence: +
+ p1 ## 0 p2 ## 0, p1 ## 1 p2 ## 1, ... p1 ## count - 1 p2 ## count - 1 +
+
+
+ To use the z parameter passed from other macros that use BOOST_PP_REPEAT, see BOOST_PP_ENUM_BINARY_PARAMS_Z. +
+
+ This macro is a replacement for both BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT and BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/enum_binary_params.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/repetition/enum_binary_params.hpp>
+
+BOOST_PP_ENUM_BINARY_PARAMS(3, T, p) // expands to T0 p0, T1 p1, T2 p2
+
+ + diff --git a/doc/ref/enum_binary_params_z.html b/doc/ref/enum_binary_params_z.html new file mode 100644 index 0000000..dcb95c0 --- /dev/null +++ b/doc/ref/enum_binary_params_z.html @@ -0,0 +1,82 @@ + + + BOOST_PP_ENUM_BINARY_PARAMS_Z + + + +
+ The BOOST_PP_ENUM_BINARY_PARAMS_Z macro generates a comma-separated list of binary parameters.  + It reenters BOOST_PP_REPEAT with maximum efficiency. +
+

Usage

+
+ BOOST_PP_ENUM_BINARY_PARAMS_Z(z, count, p1, p2) +
+

Arguments

+
+
z
+
+ The next available BOOST_PP_REPEAT dimension. +
+
count
+
+ The number of parameters to generate.  + Valid values range from 0 to BOOST_PP_LIMIT_REPEAT. +
+
p1
+
+ The text of the first part of the parameter.  + BOOST_PP_ENUM_BINARY_PARAMS concatenates numbers ranging from 0 to count - 1 + to generate parameters. +
+
p2
+
+ The text of the first part of the parameter.  + BOOST_PP_ENUM_BINARY_PARAMS concatenates numbers ranging from 0 to count - 1 + to generate parameters. +
+
+

Remarks

+
+ This macro expands to the comma-separated sequence: +
+ p1 ## 0 p2 ## 0, p1 ## 1 p2 ## 1, ... p1 ## count - 1 p2 ## count - 1 +
+
+
+ This macro is a replacement for both BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT and BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/enum_binary_params.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/repetition/enum_binary_params.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+
+#define FUNCTION(z, n, _) \
+   template<BOOST_PP_ENUM_PARAMS_Z(z, BOOST_PP_INC(n), class T)> \
+   void f(BOOST_PP_ENUM_BINARY_PARAMS_Z(z, BOOST_PP_INC(n), T, p)) { \
+      /* ... */ \
+   } \
+   /**/
+
+BOOST_PP_REPEAT(2, FUNCTION, nil)
+/*
+   expands to...
+
+   template<class T0> void f(T0 p0) { }
+   template<class T0, class T1> void f(T0 p0, T1 p1) { }
+*/
+
+ + diff --git a/doc/ref/enum_params.html b/doc/ref/enum_params.html new file mode 100644 index 0000000..af24b40 --- /dev/null +++ b/doc/ref/enum_params.html @@ -0,0 +1,58 @@ + + + BOOST_PP_ENUM_PARAMS + + + +
+ The BOOST_PP_ENUM_PARAMS macro generates a comma-separated list of parameters. +
+

Usage

+
+ BOOST_PP_ENUM_PARAMS(count, param) +
+

Arguments

+
+
count
+
+ The number of parameters to generate.  + Valid values range from 0 to BOOST_PP_LIMIT_REPEAT. +
+
param
+
+ The text of the parameter.  + BOOST_PP_ENUM_PARAMS concatenates numbers ranging from 0 to count - 1 + to generate parameters. +
+
+

Remarks

+
+ This macro expands to the comma-separated sequence: +
+ param ## 0, param ## 1, ... param ## count - 1 +
+
+
+ To use the z parameter passed from other macros that use BOOST_PP_REPEAT, see BOOST_PP_ENUM_PARAMS_Z. +
+
+ Previously, this macro could not be used recursively inside BOOST_PP_REPEAT.  + This limitation no longer exists, as the library can automatically detect the next available repetition depth. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/enum_params.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/repetition/enum_params.hpp>
+
+BOOST_PP_ENUM_PARAMS(3, class T) // expands to class T0, class T1, class T2
+
+ + diff --git a/doc/ref/enum_params_with_a_default.html b/doc/ref/enum_params_with_a_default.html new file mode 100644 index 0000000..e46a3c7 --- /dev/null +++ b/doc/ref/enum_params_with_a_default.html @@ -0,0 +1,72 @@ + + + BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT + + + +
+ The BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT macro generates a comma-separated list of parameters with a default argument. +
+

Usage

+
+ BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(count, param, def) +
+

Arguments

+
+
count
+
+ The number of parameters to generate.  + Valid values range from 0 to BOOST_PP_LIMIT_REPEAT. +
+
param
+
+ The text of the parameter.  + BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT concatenates numbers ranging from 0 to count - 1 + to generate parameters. +
+
def
+
+ The default value that trails each parameter. +
+
+

Remarks

+
+ This macro expands to the comma-separated sequence: +
+ param ## 0 = def, param ## 1 = def, ... param ## count - 1 = def +
+
+
+ Previously, this macro could not be used recursively inside BOOST_PP_REPEAT.  + This limitation no longer exists, as the library can automatically detect the next available repetition depth. +
+
+ This macro is deprecated.  + It only exists for backward compatibility.  + Use BOOST_PP_ENUM_BINARY_PARAMS with BOOST_PP_INTERCEPT instead: +
+ BOOST_PP_ENUM_BINARY_PARAMS(count, param, = def BOOST_PP_INTERCEPT) +
+
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/enum_params_with_a_default.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
+
+BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(3, class T, int)
+   // expands to T0 = int, T1 = int, T2 = int
+
+BOOST_PP_ENUM_BINARY_PARAMS(3, class T, = int BOOST_PP_INTERCEPT)
+   // expands to T0 = int, T1 = int, T2 = int
+
+ + diff --git a/doc/ref/enum_params_with_defaults.html b/doc/ref/enum_params_with_defaults.html new file mode 100644 index 0000000..334e7ec --- /dev/null +++ b/doc/ref/enum_params_with_defaults.html @@ -0,0 +1,73 @@ + + + BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS + + + +
+ The BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS macro generates a comma-separated list of parameters with default arguments. +
+

Usage

+
+ BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS(count, param, def) +
+

Arguments

+
+
count
+
+ The number of parameters to generate.  + Valid values range from 0 to BOOST_PP_LIMIT_REPEAT. +
+
param
+
+ The text of the parameter.  + BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS concatenates numbers ranging from 0 to count - 1 + to generate parameters. +
+
def
+
+ The default value that trails each parameter. + BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS concatenates numbers ranging from 0 to count - 1 + to generate default arguments. +
+
+

Remarks

+
+ This macro expands to the comma-separated sequence: +
+ param ## 0 = def ## 0, param ## 1 = def ## 1, ... param ## count - 1 = def ## count - 1 +
+
+
+ Previously, this macro could not be used recursively inside BOOST_PP_REPEAT.  + This limitation no longer exists, as the library can automatically detect the next available repetition depth. +
+
+ This macro is deprecated.  + It only exists for backward compatibility.  + Use BOOST_PP_ENUM_BINARY_PARAMS instead: +
+ BOOST_PP_ENUM_BINARY_PARAMS(count, param, = def) +
+
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/enum_params_with_defaults.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/repetition/enum_params_with_defaults.hpp>
+
+BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS(3, class T, U)
+   // expands to T0 = U0, T1 = U1, T2 = U2
+
+BOOST_PP_ENUM_BINARY_PARAMS(3, class T, = U)
+   // expands to T0 = U0, T1 = U1, T2 = U2
+
+ + diff --git a/doc/ref/enum_params_z.html b/doc/ref/enum_params_z.html new file mode 100644 index 0000000..c065e33 --- /dev/null +++ b/doc/ref/enum_params_z.html @@ -0,0 +1,71 @@ + + + BOOST_PP_ENUM_PARAMS_Z + + + +
+ The BOOST_PP_ENUM_PARAMS_Z macro generates a comma-separated list of parameters.  + It reenters BOOST_PP_REPEAT with maximum efficiency. +
+

Usage

+
+ BOOST_PP_ENUM_PARAMS_Z(z, count, param) +
+

Arguments

+
+
z
+
+ The next available BOOST_PP_REPEAT dimension. +
+
count
+
+ The number of parameters to generate.  + Valid values range from 0 to BOOST_PP_LIMIT_REPEAT. +
+
param
+
+ The text of the parameter.  + BOOST_PP_ENUM_PARAMS_Z concatenates numbers ranging from 0 to count - 1 + to generate parameters. +
+
+

Remarks

+
+ This macro expands to the comma-separated sequence: +
+ param ## 0, param ## 1, ... param ## count - 1 +
+
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/enum_params.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/repeat.hpp>
+
+#define MACRO(z, n, _) \
+   template< \
+      BOOST_PP_ENUM_PARAMS_Z(z, BOOST_PP_INC(n), class T) \
+   > class X ## n { \
+      /* ... */ \
+   }; \
+   /**/
+
+BOOST_PP_REPEAT(2, MACRO, nil)
+/*
+   expands to...
+   template<class T0> class X0 { };
+   template<class T0, class T1> class X1 { };
+*/
+
+ + diff --git a/doc/ref/enum_shifted.html b/doc/ref/enum_shifted.html new file mode 100644 index 0000000..a44a929 --- /dev/null +++ b/doc/ref/enum_shifted.html @@ -0,0 +1,71 @@ + + + BOOST_PP_ENUM_SHIFTED + + + +
+ The BOOST_PP_ENUM_SHIFTED macro generates a comma-separated, shifted list. +
+

Usage

+
+ BOOST_PP_ENUM_SHIFTED(count, macro, data) +
+

Arguments

+
+
count
+
+ The number of repetitious calls to macro.  + Valid values range from 0 to BOOST_PP_LIMIT_REPEAT. +
+
macro
+
+ A ternary operation of the form macro(z, n, data).  + This macro is expanded by BOOST_PP_ENUM_SHIFTED with the next available repetition depth, + the current repetition number, and the auxiliary data argument.  +
+
data
+
+ Auxiliary data passed to macro. +
+
+

Remarks

+
+ This macro expands to the comma-separated sequence: +
+ macro(z, 1, data), ... macro(z, count - 1, data) +
+
+
+ The z value that is passed to macro represents the next available repetition dimension.  + Other macros that have _Z suffix variants internally use BOOST_PP_REPEAT--for example, BOOST_PP_ENUM_PARAMS and BOOST_PP_ENUM_PARAMS_Z.  + Using these _Z versions is not strictly necessary, but passing the z value (that is passed to macro) to these macros allows them to reenter BOOST_PP_REPEAT with maximum efficiency. +
+
+ To directly use this z value, rather than simply passing it to another macro, see BOOST_PP_ENUM_SHIFTED_z. +
+
+ Previously, this macro could not be used recursively inside BOOST_PP_REPEAT.  + This limitation no longer exists, as the library can automatically detect the next available repetition depth. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/enum_shifted.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/repetition/enum.hpp>
+#include <boost/preprocessor/repetition/enum_shifted.hpp>
+
+#define TYPE(z, n, type) type
+
+BOOST_PP_ENUM(5, TYPE, int) // expands to int, int, int, int, int
+BOOST_PP_ENUM_SHIFTED(5, TYPE, int) // expands to int, int, int, int
+
+ + diff --git a/doc/ref/enum_shifted_params.html b/doc/ref/enum_shifted_params.html new file mode 100644 index 0000000..03d921c --- /dev/null +++ b/doc/ref/enum_shifted_params.html @@ -0,0 +1,62 @@ + + + BOOST_PP_ENUM_SHIFTED_PARAMS + + + +
+ The BOOST_PP_ENUM_SHIFTED_PARAMS macro generates a comma-separated, shifted list of parameters. +
+

Usage

+
+ BOOST_PP_ENUM_SHIFTED_PARAMS(count, param) +
+

Arguments

+
+
count
+
+ The number of parameters to generate.  + Valid values range from 0 to BOOST_PP_LIMIT_REPEAT. +
+
param
+
+ The text of the parameter.  + BOOST_PP_ENUM_SHIFTED_PARAMS concatenates numbers ranging from 1 to count - 1 + to generate parameters. +
+
+

Remarks

+
+ This macro expands to the comma-separated sequence: +
+ param ## 1, ... param ## count - 1 +
+
+
+ This macro facilitates a typical usage of the library.  + Shifted parameter lists are common in template metaprograms. +
+
+ To use the z parameter passed from other macros that use BOOST_PP_REPEAT, see BOOST_PP_ENUM_SHIFTED_PARAMS_Z. +
+
+ Previously, this macro could not be used recursively inside BOOST_PP_REPEAT.  + This limitation no longer exists, as the library can automatically detect the next available repetition depth. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/enum_shifted_params.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/repetition/enum_shifted_params.hpp>
+
+BOOST_PP_ENUM_SHIFTED_PARAMS(3, class T) // expands to class T1, class T2
+
+ + diff --git a/doc/ref/enum_shifted_params_z.html b/doc/ref/enum_shifted_params_z.html new file mode 100644 index 0000000..3750336 --- /dev/null +++ b/doc/ref/enum_shifted_params_z.html @@ -0,0 +1,68 @@ + + + BOOST_PP_ENUM_SHIFTED_PARAMS_Z + + + +
+ The BOOST_PP_ENUM_SHIFTED_PARAMS_Z macro generates a comma-separated, shifted list of parameters.  + It reenters BOOST_PP_REPEAT with maximum efficiency. +
+

Usage

+
+ BOOST_PP_ENUM_SHIFTED_PARAMS_Z(z, count, param) +
+

Arguments

+
+
z
+
+ The next available BOOST_PP_REPEAT dimension. +
+
count
+
+ The number of parameters to generate.  + Valid values range from 0 to BOOST_PP_LIMIT_REPEAT. +
+
param
+
+ The text of the parameter.  + BOOST_PP_ENUM_SHIFTED_PARAMS_Z concatenates numbers ranging from 1 to count - 1 + to generate parameters. +
+
+

Remarks

+
+ This macro expands to the comma-separated sequence: +
+ param ## 1, ... param ## count - 1 +
+
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/enum_shifted_params.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/enum_shifted_params.hpp>
+#include <boost/preprocessor/repetition/repeat.hpp>
+
+int add(void) {
+   return 0;
+}
+
+#define ADD_F(z, n, _) \
+   int add_f(BOOST_PP_ENUM_PARAMS_Z(z, BOOST_PP_INC(n), int p)) { \
+      return p0 + add_f(BOOST_PP_ENUM_SHIFTED_PARAMS_Z(z, BOOST_PP_INC(n), p)); \
+   } \
+   /**/
+
+BOOST_PP_REPEAT(5, ADD_F, nil)
+
+ + diff --git a/doc/ref/enum_shifted_z.html b/doc/ref/enum_shifted_z.html new file mode 100644 index 0000000..12e605c --- /dev/null +++ b/doc/ref/enum_shifted_z.html @@ -0,0 +1,82 @@ + + + BOOST_PP_ENUM_SHIFTED_z + + + +
+ The BOOST_PP_ENUM_SHIFTED_z macro represents a reentry into the BOOST_PP_ENUM_SHIFTED repetition construct. +
+

Usage

+
+ BOOST_PP_ENUM_SHIFTED_ ## z(count, macro, data) +
+

Arguments

+
+
z
+
+ The next available BOOST_PP_REPEAT dimension. +
+
count
+
+ The number of repetitious calls to macro.  + Valid values range from 0 to BOOST_PP_LIMIT_REPEAT. +
+
macro
+
+ A ternary operation of the form macro(z, n, data).  + This macro is expanded by BOOST_PP_ENUM_SHIFTED with the next available repetition depth, + the current repetition number, and the auxiliary data argument.  +
+
data
+
+ Auxiliary data passed to macro. +
+
+

Remarks

+
+ This macro expands to the sequence: +
+ macro(z, 1, data), ... macro(z, count - 1, data) +
+
+
+ At certain times, it may be necessary to perform the concatenation with BOOST_PP_CAT rather than the preprocessor token-pasting operator.  + This happens when the z value is a macro invocation itself.  + It needs a delay to allow it to expand.  + The syntax in such a scenario becomes: +
+ BOOST_PP_CAT(BOOST_PP_ENUM_SHIFTED_, z)(count, macro, data). +
+
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/enum_shifted.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/repetition/enum_shifted.hpp>
+#include <boost/preprocessor/repetition/repeat.hpp>
+
+#define TEXT(z, n, text) text
+
+#define MACRO(z, n, data) \
+   ( \
+      BOOST_PP_ENUM_SHIFTED_ ## z( \
+         BOOST_PP_INC(n), \
+         TEXT, data \
+      ) \
+   ) \
+   /**/
+
+BOOST_PP_REPEAT(3, MACRO, class) // expands to () (class) (class, class)
+
+ + diff --git a/doc/ref/enum_trailing.html b/doc/ref/enum_trailing.html new file mode 100644 index 0000000..9346a2a --- /dev/null +++ b/doc/ref/enum_trailing.html @@ -0,0 +1,72 @@ + + + BOOST_PP_ENUM_TRAILING + + + +
+ The BOOST_PP_ENUM_TRAILING macro generates a comma-separated list with a leading comma. +
+

Usage

+
+ BOOST_PP_ENUM_TRAILING(count, macro, data) +
+

Arguments

+
+
count
+
+ The number of repetitious calls to macro.  + Valid values range from 0 to BOOST_PP_LIMIT_REPEAT. +
+
macro
+
+ A ternary operation of the form macro(z, n, data).  + This macro is expanded by BOOST_PP_ENUM with the next available repetition depth, + the current repetition number, and the auxiliary data argument.  +
+
data
+
+ Auxiliary data passed to macro. +
+
+

Remarks

+
+ This macro expands to the comma-separated sequence: +
+ , macro(z, 0, data), macro(z, 1, data), ... macro(z, count - 1, data) +
+
+
+ The z value that is passed to macro represents the next available repetition dimension.  + Other macros that have _Z suffix variants internally use BOOST_PP_REPEAT--for example, BOOST_PP_ENUM_PARAMS and BOOST_PP_ENUM_PARAMS_Z.  + Using these _Z versions is not strictly necessary, but passing the z value (that is passed to macro) to these macros allows them to reenter BOOST_PP_REPEAT with maximum efficiency. +
+
+ To directly use this z value, rather than simply passing it to another macro, see BOOST_PP_ENUM_TRAILING_z. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/enum_trailing.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/repetition/enum_trailing.hpp>
+
+#define TEXT(z, n, text) text
+
+template<class BOOST_PP_ENUM_TRAILING(3, TEXT, class)>
+class X { };
+/*
+   expands to...
+
+template<class, class, class, class>
+class X { };
+*/
+
+ + diff --git a/doc/ref/enum_trailing_binary_params.html b/doc/ref/enum_trailing_binary_params.html new file mode 100644 index 0000000..5c871f0 --- /dev/null +++ b/doc/ref/enum_trailing_binary_params.html @@ -0,0 +1,72 @@ + + + BOOST_PP_ENUM_TRAILING_BINARY_PARAMS + + + +
+ The BOOST_PP_ENUM_TRAILING_BINARY_PARAMS macro generates a comma-separated list of binary parameters with a leading comma. +
+

Usage

+
+ BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(count, p1, p2) +
+

Arguments

+
+
count
+
+ The number of parameters to generate.  + Valid values range from 0 to BOOST_PP_LIMIT_REPEAT. +
+
p1
+
+ The text of the first part of the parameter.  + BOOST_PP_ENUM_TRAILING_BINARY_PARAMS concatenates numbers ranging from 0 to count - 1 + to generate parameters. +
+
p2
+
+ The text of the first part of the parameter.  + BOOST_PP_ENUM_TRAILING_BINARY_PARAMS concatenates numbers ranging from 0 to count - 1 + to generate parameters. +
+
+

Remarks

+
+ This macro expands to the comma-separated sequence: +
+ , p1 ## 0 p2 ## 0, p1 ## 1 p2 ## 1, ... p1 ## count - 1 p2 ## count - 1 +
+
+
+ To use the z parameter passed from other macros that use BOOST_PP_REPEAT, see BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/enum_trailing_binary_params.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/facilities/intercept.hpp>
+#include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp>
+
+template<class X BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(4, class A, = X BOOST_PP_INTERCEPT)>
+struct sample {
+   // ...
+};
+
+/* expands to...
+
+template<class X, class A0 = X, class A1 = X, class A2 = X, class A3 = X>
+struct sample {
+   // ...
+}
+*/
+
+ + diff --git a/doc/ref/enum_trailing_binary_params_z.html b/doc/ref/enum_trailing_binary_params_z.html new file mode 100644 index 0000000..ac9c88b --- /dev/null +++ b/doc/ref/enum_trailing_binary_params_z.html @@ -0,0 +1,56 @@ + + + BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z + + + +
+ The BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z macro generates a comma-separated list of binary parameters with a leading comma.  + It reenters BOOST_PP_REPEAT with maximum efficiency. +
+

Usage

+
+ BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z(z, count, p1, p2) +
+

Arguments

+
+
z
+
+ The next available BOOST_PP_REPEAT dimension. +
+
count
+
+ The number of parameters to generate.  + Valid values range from 0 to BOOST_PP_LIMIT_REPEAT. +
+
p1
+
+ The text of the first part of the parameter.  + BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z concatenates numbers ranging from 0 to count - 1 + to generate parameters. +
+
p2
+
+ The text of the first part of the parameter.  + BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z concatenates numbers ranging from 0 to count - 1 + to generate parameters. +
+
+

Remarks

+
+ This macro expands to the comma-separated sequence: +
+ , p1 ## 0 p2 ## 0, p1 ## 1 p2 ## 1, ... p1 ## count - 1 p2 ## count - 1 +
+
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/enum_trailing_binary_params.hpp> +
+ + diff --git a/doc/ref/enum_trailing_params.html b/doc/ref/enum_trailing_params.html new file mode 100644 index 0000000..ce3449b --- /dev/null +++ b/doc/ref/enum_trailing_params.html @@ -0,0 +1,55 @@ + + + BOOST_PP_ENUM_TRAILING_PARAMS + + + +
+ The BOOST_PP_ENUM_TRAILING_PARAMS macro generates a comma-separated list of parameters with a leading comma. +
+

Usage

+
+ BOOST_PP_ENUM_TRAILING_PARAMS(count, param) +
+

Arguments

+
+
count
+
+ The number of parameters to generate.  + Valid values range from 0 to BOOST_PP_LIMIT_REPEAT. +
+
param
+
+ The text of the parameter.  + BOOST_PP_ENUM_TRAILING_PARAMS concatenates numbers ranging from 0 to count - 1 + to generate parameters. +
+
+

Remarks

+
+ This macro expands to the comma-separated sequence: +
+ , param ## 0, param ## 1, ... param ## count - 1 +
+
+
+ To use the z parameter passed from other macros that use BOOST_PP_REPEAT, see BOOST_PP_ENUM_TRAILING_PARAMS_Z. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/enum_trailing_params.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
+
+class X BOOST_PP_ENUM_TRAILING_PARAMS(2, class T)
+   // expands to class X, class T0, class T1, class T2
+
+ + diff --git a/doc/ref/enum_trailing_params_z.html b/doc/ref/enum_trailing_params_z.html new file mode 100644 index 0000000..129b2e2 --- /dev/null +++ b/doc/ref/enum_trailing_params_z.html @@ -0,0 +1,70 @@ + + + BOOST_PP_ENUM_TRAILING_PARAMS_Z + + + +
+ The BOOST_PP_ENUM_TRAILING_PARAMS_Z macro generates a comma-separated list of parameters with a leading comma.  + It reenters BOOST_PP_REPEAT with maximum efficiency. +
+

Usage

+
+ BOOST_PP_ENUM_TRAILING_PARAMS_Z(z, count, param) +
+

Arguments

+
+
z
+
+ The next available BOOST_PP_REPEAT dimension. +
+
count
+
+ The number of parameters to generate.  + Valid values range from 0 to BOOST_PP_LIMIT_REPEAT. +
+
param
+
+ The text of the parameter.  + BOOST_PP_ENUM_TRAILING_PARAMS_Z concatenates numbers ranging from 0 to count - 1 + to generate parameters. +
+
+

Remarks

+
+ This macro expands to the comma-separated sequence: +
+ , param ## 0, param ## 1, ... param ## count - 1 +
+
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/enum_trailing_params.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
+#include <boost/preprocessor/repetition/repeat.hpp>
+
+#define MACRO(z, n, _) \
+   template< \
+      class BOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, class T) \
+   > class X ## n { \
+      /* ... */ \
+   }; \
+   /**/
+
+BOOST_PP_REPEAT(2, MACRO, nil)
+/*
+   expands to...
+   template<class> class X0 { };
+   template<class, class T0> class X1 { };
+*/
+
+ + diff --git a/doc/ref/enum_trailing_z.html b/doc/ref/enum_trailing_z.html new file mode 100644 index 0000000..c49131f --- /dev/null +++ b/doc/ref/enum_trailing_z.html @@ -0,0 +1,85 @@ + + + BOOST_PP_ENUM_TRAILING_z + + + +
+ The BOOST_PP_ENUM_TRAILING_z macro represents a reentry into the BOOST_PP_ENUM_TRAILING repetition construct. +
+

Usage

+
+ BOOST_PP_ENUM_TRAILING_ ## z(count, macro, data) +
+

Arguments

+
+
z
+
+ The next available BOOST_PP_REPEAT dimension. +
+
count
+
+ The number of repetitious calls to macro.  + Valid values range from 0 to BOOST_PP_LIMIT_REPEAT. +
+
macro
+
+ A ternary operation of the form macro(z, n, data).  + This macro is expanded by BOOST_PP_ENUM with the next available repetition depth, + the current repetition number, and the auxiliary data argument.  +
+
data
+
+ Auxiliary data passed to macro. +
+
+

Remarks

+
+ This macro expands to the sequence: +
+ , macro(z, 0, data), macro(z, 1, data), ... macro(z, count - 1, data) +
+
+
+ At certain times, it may be necessary to perform the concatenation with BOOST_PP_CAT rather than the preprocessor token-pasting operator.  + This happens when the z value is a macro invocation itself.  + It needs a delay to allow it to expand.  + The syntax in such a scenario becomes: +
+ BOOST_PP_CAT(BOOST_PP_ENUM_TRAILING_, z)(count, macro, data) +
+
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/enum_trailing.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/repetition/enum.hpp>
+#include <boost/preprocessor/repetition/enum_trailing.hpp>
+
+#define TEXT(z, n, text) text
+
+#define TTP(z, n, _) \
+   template< \
+      class BOOST_PP_ENUM_TRAILING_ ## z(n, TEXT, class) \
+   > \
+   class T ## n \
+   /**/
+
+BOOST_PP_ENUM(3, TTP, nil)
+   /*
+      expands to...
+      template<class> class T0,
+      template<class, class> class T1,
+      template<class, class, class> class T2
+   */
+
+ + diff --git a/doc/ref/enum_z.html b/doc/ref/enum_z.html new file mode 100644 index 0000000..9140126 --- /dev/null +++ b/doc/ref/enum_z.html @@ -0,0 +1,85 @@ + + + BOOST_PP_ENUM_z + + + +
+ The BOOST_PP_ENUM_z macro represents a reentry into the BOOST_PP_ENUM repetition construct. +
+

Usage

+
+ BOOST_PP_ENUM_ ## z(count, macro, data) +
+

Arguments

+
+
z
+
+ The next available BOOST_PP_REPEAT dimension. +
+
count
+
+ The number of repetitious calls to macro.  + Valid values range from 0 to BOOST_PP_LIMIT_REPEAT. +
+
macro
+
+ A ternary operation of the form macro(z, n, data).  + This macro is expanded by BOOST_PP_ENUM with the next available repetition depth, + the current repetition number, and the auxiliary data argument.  +
+
data
+
+ Auxiliary data passed to macro. +
+
+

Remarks

+
+ This macro expands to the sequence: +
+ macro(z, 0, data), macro(z, 1, data), ... macro(z, count - 1, data) +
+
+
+ At certain times, it may be necessary to perform the concatenation with BOOST_PP_CAT rather than the preprocessor token-pasting operator.  + This happens when the z value is a macro invocation itself.  + It needs a delay to allow it to expand.  + The syntax in such a scenario becomes: +
+ BOOST_PP_CAT(BOOST_PP_ENUM_, z)(count, macro, data) +
+
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/enum.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/repetition/enum.hpp>
+
+#define TEXT(z, n, text) text
+
+#define TTP(z, n, _) \
+   template< \
+      BOOST_PP_ENUM_ ## z(BOOST_PP_INC(n), TEXT, class) \
+   > \
+   class T ## n \
+   /**/
+
+BOOST_PP_ENUM(3, TTP, nil)
+   /*
+      expands to...
+      template<class> class T0,
+      template<class, class> class T1,
+      template<class, class, class> class T2
+   */
+
+ + diff --git a/doc/ref/equal.html b/doc/ref/equal.html new file mode 100644 index 0000000..87eb6ee --- /dev/null +++ b/doc/ref/equal.html @@ -0,0 +1,53 @@ + + + BOOST_PP_EQUAL + + + +
+ The BOOST_PP_EQUAL macro compares two values for equality. +
+

Usage

+
+ BOOST_PP_EQUAL(x, y) +
+

Arguments

+
+
x
+
+ The left operand of the comparison.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
y
+
+ The right operand of the comparison.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ If x is equal to y, this macro expands to 1.  + Otherwise, it expands to 0. +
+
+ Previously, this macro could not be used inside BOOST_PP_WHILE.  + There is no longer any such restriction because this macro no longer uses BOOST_PP_WHILE. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/comparison/equal.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/comparison/equal.hpp>
+
+BOOST_PP_EQUAL(4, 3) // expands to 0
+BOOST_PP_EQUAL(5, 5) // expands to 1
+
+ + diff --git a/doc/ref/equal_d.html b/doc/ref/equal_d.html new file mode 100644 index 0000000..f2ae907 --- /dev/null +++ b/doc/ref/equal_d.html @@ -0,0 +1,58 @@ + + + BOOST_PP_EQUAL_D + + + +
+ The BOOST_PP_EQUAL_D macro compares two values for equality. +
+

Usage

+
+ BOOST_PP_EQUAL_D(d, x, y) +
+

Arguments

+
+
d
+
+ This argument is ignored. +
+
x
+
+ The left operand of the comparison.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
y
+
+ The right operand of the comparison.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ If x is equal to y, this macro expands to 1.  + Otherwise, it expands to 0. +
+
+ This macro is deprecated.  + It only exists for backward compatibility.  + Use BOOST_PP_EQUAL instead. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/comparison/equal.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/comparison/equal.hpp>
+
+BOOST_PP_EQUAL_D(1, 4, 3) // expands to 0
+BOOST_PP_EQUAL_D(1, 5, 5) // expands to 1
+
+ + diff --git a/doc/ref/expand.html b/doc/ref/expand.html new file mode 100644 index 0000000..13d859c --- /dev/null +++ b/doc/ref/expand.html @@ -0,0 +1,56 @@ + + + BOOST_PP_EXPAND + + + +
+ The BOOST_PP_EXPAND macro performs a double macro-expansion on its argument. +
+

Usage

+
+ BOOST_PP_EXPAND(x) +
+

Arguments

+
+
x
+
+ The argument to be expanded twice. +
+
+

Remarks

+
+ This macro is useful when a delay is necessary to produce the correct semantics of a macro invocation.  + For example, when a macro expands to an argument list to another macro.  + This macro will expand the the argument list on the first pass, and then rescan to expand any more macros. +
+

Requirements

+
+ Header:  <boost/preprocessor/facilities/expand.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/control/if.hpp>
+#include <boost/preprocessor/facilities/expand.hpp>
+
+#define MACRO(a, b, c) (a)(b)(c)
+#define ARGS() (1, 2, 3)
+
+BOOST_PP_EXPAND(MACRO ARGS) // expands to (1)(2)(3)
+
+#define SAMPLE(n) \
+   BOOST_PP_EXPAND( \
+      MACRO, \
+      BOOST_PP_IF( \
+         n, \
+         (x, y, z), \
+         (a, b, c) \
+      ) \
+   ) \
+   /**/
+
+SAMPLE(0) // expands to (a)(b)(c)
+SAMPLE(1) // expands to (x)(y)(z)
+
+ + diff --git a/doc/ref/expr_if.html b/doc/ref/expr_if.html new file mode 100644 index 0000000..e9ab9e1 --- /dev/null +++ b/doc/ref/expr_if.html @@ -0,0 +1,59 @@ + + + BOOST_PP_EXPR_IF + + + +
+ The BOOST_PP_EXPR_IF macro expands to its second argument if its first argument is non-zero or expands to nothing otherwise. +
+

Usage

+
+ BOOST_PP_EXPR_IF(cond, expr) +
+

Arguments

+
+
cond
+
+ The condition that determines if the result is expr or nothing.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
expr
+
+ The result of the expansion if cond is non-zero. +
+
+

Remarks

+
+ This macro performs a boolean conversion on its first argument.  + If that conversion is unnecessary, use BOOST_PP_EXPR_IIF instead. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/control/expr_if.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/control/expr_if.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+
+#define CV(n) \
+   BOOST_PP_EXPR_IF( \
+      n, \
+      BOOST_PP_TUPLE_ELEM( \
+         4, n, \
+         (..., const, volatile, const volatile) \
+      ) \
+   ) \
+   /**/
+
+CV(0) // expands to nothing
+CV(1) // expands to const
+
+ + diff --git a/doc/ref/expr_iif.html b/doc/ref/expr_iif.html new file mode 100644 index 0000000..dc4653d --- /dev/null +++ b/doc/ref/expr_iif.html @@ -0,0 +1,56 @@ + + + BOOST_PP_EXPR_IIF + + + +
+ The BOOST_PP_EXPR_IIF macro expands to its second argument if its first argument is 1 and expands to nothing if its first argument is 0. +
+

Usage

+
+ BOOST_PP_EXPR_IIF(bit, expr) +
+

Arguments

+
+
bit
+
+ The condition that determines if the result is expr or nothing.  + This value must expand to 0 or 1. +
+
expr
+
+ The result of the expansion if bit is 1. +
+
+

Remarks

+
+ This macro does not perform a boolean conversion on its first argument.  + If that conversion is necessary, use BOOST_PP_EXPR_IF instead. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/control/expr_iif.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/comparison/and.hpp>
+#include <boost/preprocessor/control/expr_iif.hpp>
+
+#define INSERT_AND(p, q, text) \
+   BOOST_PP_EXPR_IIF( \
+      BOOST_PP_AND(p, q), \
+      text \
+   ) \
+   /**/
+
+INSERT_AND(2, 3, abc) // expands to abc
+INSERT_AND(0, 7, xyz) // expands to nothing
+
+ + diff --git a/doc/ref/filename_x.html b/doc/ref/filename_x.html new file mode 100644 index 0000000..c7dcb1f --- /dev/null +++ b/doc/ref/filename_x.html @@ -0,0 +1,41 @@ + + + BOOST_PP_FILENAME_x + + + +
+ The BOOST_PP_FILENAME_x macro is a user-defined named external argument used by BOOST_PP_ITERATE.  + It denotes the file to be iterated over. +
+

Usage

+
+ #define BOOST_PP_FILENAME_x filename +
+

Arguments

+
+
x
+
+ The iteration depth of the next file-iteration.  + This value must be the current iteration depth + 1. +
+
filename
+
+ A quoted or angle-bracketed filename to used as the target of a file-iteration. +
+
+

Remarks

+
+ This macro is part of the secondary method of passing arguments to BOOST_PP_ITERATE.  + The other part is BOOST_PP_ITERATION_LIMITS. +
+
+ This macro is automatically undefined for reuse by a call to BOOST_PP_ITERATE. +
+

See Also

+ + + diff --git a/doc/ref/for.html b/doc/ref/for.html new file mode 100644 index 0000000..2f88afc --- /dev/null +++ b/doc/ref/for.html @@ -0,0 +1,94 @@ + + + BOOST_PP_FOR + + + +
+ The BOOST_PP_FOR macro represents a generalized horizontal repetition construct. +
+

Usage

+
+ BOOST_PP_FOR(state, pred, op, macro) +
+

Arguments

+
+
state
+
+ The initial state. +
+
pred
+
+ A binary predicate of the form pred(r, state).  + This macro must expand to an integer in the range of 0 to BOOST_PP_LIMIT_MAG.  + BOOST_PP_FOR repeatedly expands macro while this predicate returns non-zero.  + This macro is called with the next available BOOST_PP_FOR repetition and the current state. +
+
op
+
+ A binary operation of the form op(r, state).  + This operation is expanded by BOOST_PP_FOR with the next available BOOST_PP_FOR repetition and the current state.  + This macro is repeatedly applied to the state, each time producing a new state, until pred returns 0. +
+
macro
+
+ A binary macro of the form macro(r, state).  + This macro is expanded by BOOST_PP_FOR with the next available BOOST_PP_FOR repetition and the current state.  + This macro is is repeated by BOOST_PP_FOR until pred returns 0. +
+
+

Remarks

+
+ This macro expands to the sequence: +
+ macro(r, state) macro(r, op(r, state)) ... macro(r, op(r, ... op(r, state) ... )) +
+
+
+ The r value that is passed to pred, op, and macro represents the next available BOOST_PP_FOR repetition.  + Other macros that have _R suffix variants internally use BOOST_PP_FOR--for example, BOOST_PP_LIST_FOR_EACH and BOOST_PP_LIST_FOR_EACH_R.  + Using these _R versions is not strictly necessary, but passing the r value (that is passed to pred, op, and macro) to these macros allows them to reenter BOOST_PP_FOR with maximum efficiency. +
+
+ To directly use this r value, rather than simply passing it to another macro, see BOOST_PP_FOR_r. +
+
+ Previously, this macro could not be used recursively inside BOOST_PP_FOR.  + This limitation no longer exists, as the library can automatically detect the next available BOOST_PP_FOR repetition. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/for.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/comparison/not_equal.hpp>
+#include <boost/preprocessor/repetition/for.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+
+#define PRED(r, state) \
+   BOOST_PP_NOT_EQUAL( \
+      BOOST_PP_TUPLE_ELEM(2, 0, state), \
+      BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(2, 1, state)) \
+   ) \
+   /**/
+
+#define OP(r, state) \
+   ( \
+      BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(2, 0, state)), \
+      BOOST_PP_TUPLE_ELEM(2, 1, state) \
+   ) \
+   /**/
+
+#define MACRO(r, state) BOOST_PP_TUPLE_ELEM(2, 0, state)
+
+BOOST_PP_FOR((5, 10), PRED, OP, MACRO) // expands to 5 6 7 8 9 10
+
+ + diff --git a/doc/ref/for_r.html b/doc/ref/for_r.html new file mode 100644 index 0000000..0a3f1f0 --- /dev/null +++ b/doc/ref/for_r.html @@ -0,0 +1,144 @@ + + + BOOST_PP_FOR_r + + + +
+ The BOOST_PP_FOR_r macro represents a reentry into the BOOST_PP_FOR repetition construct. +
+

Usage

+
+ BOOST_PP_FOR_ ## r(state, pred, op, macro) +
+

Arguments

+
+
r
+
+ The next available BOOST_PP_FOR repetition. +
+
state
+
+ The initial state. +
+
pred
+
+ A binary predicate of the form pred(r, state).  + This macro must expand to an integer in the range of 0 to BOOST_PP_LIMIT_MAG.  + BOOST_PP_FOR repeatedly expands macro while this predicate returns non-zero.  + This macro is called with the next available BOOST_PP_FOR repetition and the current state. +
+
op
+
+ A binary operation of the form op(r, state).  + This operation is expanded by BOOST_PP_FOR with the next available BOOST_PP_FOR repetition and the current state.  + This macro is repeatedly applied to the state, each time producing a new state, until pred returns 0. +
+
macro
+
+ A binary macro of the form macro(r, state).  + This macro is expanded by BOOST_PP_FOR with the next available BOOST_PP_FOR repetition and the current state.  + This macro is is repeated by BOOST_PP_FOR until pred returns 0. +
+
+

Remarks

+
+ This macro expands to the sequence: +
+ macro(r, state) macro(r, op(r, state)) ... macro(r, op(r, ... op(r, state) ... )) +
+
+
+ At certain times, it may be necessary to perform the concatenation with BOOST_PP_CAT rather than the preprocessor token-pasting operator.  + This happens when the r value is a macro invocation itself.  + It needs a delay to allow it to expand.  + The syntax in such a scenario becomes: +
+ BOOST_PP_CAT(BOOST_PP_FOR_, r)(state, pred, op, macro) +
+
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/for.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/arithmetic/dec.hpp>
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/comparison/not_equal.hpp>
+#include <boost/preprocessor/punctuation/comma_if.hpp>
+#include <boost/preprocessor/repetition/for.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+
+#define PRED(r, state) \
+   BOOST_PP_NOT_EQUAL( \
+      BOOST_PP_TUPLE_ELEM(4, 0, state), \
+      BOOST_PP_INC( \
+         BOOST_PP_TUPLE_ELEM(4, 1, state) \
+      ) \
+   ) \
+   /**/
+
+#define OP(r, state) \
+   ( \
+      BOOST_PP_INC( \
+         BOOST_PP_TUPLE_ELEM(4, 0, state) \
+      ), \
+      BOOST_PP_TUPLE_ELEM(4, 1, state), \
+      BOOST_PP_TUPLE_ELEM(4, 2, state), \
+      BOOST_PP_INC( \
+         BOOST_PP_TUPLE_ELEM(4, 3, state) \
+      ) \
+   ) \
+   /**/
+
+#define MACRO(r, state) \
+   BOOST_PP_COMMA_IF( \
+      BOOST_PP_TUPLE_ELEM(4, 3, state) \
+   ) template< \
+      BOOST_PP_FOR_ ## r( \
+         (0, BOOST_PP_TUPLE_ELEM(4, 0, state), _, 0), \
+         PRED_2, OP, MACRO_2 \
+      ) \
+   > class BOOST_PP_CAT( \
+      BOOST_PP_TUPLE_ELEM(4, 2, state), \
+      BOOST_PP_TUPLE_ELEM(4, 0, state) \
+   ) \
+   /**/
+
+#define PRED_2(r, state) \
+   BOOST_PP_NOT_EQUAL( \
+      BOOST_PP_TUPLE_ELEM(4, 0, state), \
+      BOOST_PP_TUPLE_ELEM(4, 1, state) \
+   ) \
+   /**/
+
+#define MACRO_2(r, state) \
+   BOOST_PP_COMMA_IF( \
+      BOOST_PP_TUPLE_ELEM(4, 0, state) \
+   ) class \
+   /**/
+
+#define TEMPLATE_TEMPLATE(low, high, name) \
+   BOOST_PP_FOR( \
+      (low, high, name, 0), \
+      PRED, OP, MACRO \
+   ) \
+   /**/
+
+TEMPLATE_TEMPLATE(2, 4, T)
+/*
+   expands to...
+   template<class, class> class T2,
+   template<class, class, class> class T3,
+   template<class, class, class, class> class T4
+*/
+
+ + diff --git a/doc/ref/frame_finish.html b/doc/ref/frame_finish.html new file mode 100644 index 0000000..60fb6ee --- /dev/null +++ b/doc/ref/frame_finish.html @@ -0,0 +1,31 @@ + + + BOOST_PP_FRAME_FINISH + + + +
+ The BOOST_PP_FRAME_FINISH macro expands to the upper bound of an absolute file-iteration depth. +
+

Usage

+
+ BOOST_PP_FRAME_FINISH(i) +
+

Arguments

+
+
i
+
+ The absolute depth of the frame whose upper bound is to be retreived.  + Valid values range from 1 to BOOST_PP_ITERATION_DEPTH(). +
+
+

Remarks

+
+ This macro is only valid when a file-iteration is in progress. +
+

Requirements

+
+ Header:  <boost/preprocessor/iteration/iterate.hpp> +
+ + diff --git a/doc/ref/frame_flags.html b/doc/ref/frame_flags.html new file mode 100644 index 0000000..1024f6d --- /dev/null +++ b/doc/ref/frame_flags.html @@ -0,0 +1,31 @@ + + + BOOST_PP_FRAME_FLAGS + + + +
+ The BOOST_PP_FRAME_FLAGS macro expands to the flags associated with an absolute file-iteration depth. +
+

Usage

+
+ BOOST_PP_FRAME_FLAGS(i) +
+

Arguments

+
+
i
+
+ The absolute depth of the frame whose flags are to be retreived.  + Valid values range from 1 to BOOST_PP_ITERATION_DEPTH(). +
+
+

Remarks

+
+ This macro is only valid when a file-iteration is in progress. +
+

Requirements

+
+ Header:  <boost/preprocessor/iteration/iterate.hpp> +
+ + diff --git a/doc/ref/frame_iteration.html b/doc/ref/frame_iteration.html new file mode 100644 index 0000000..d73fff0 --- /dev/null +++ b/doc/ref/frame_iteration.html @@ -0,0 +1,62 @@ + + + BOOST_PP_FRAME_ITERATION + + + +
+ The BOOST_PP_FRAME_ITERATION macro expands to the iteration value of an absolute file-iteration depth. +
+

Usage

+
+ BOOST_PP_FRAME_ITERATION(i) +
+

Arguments

+
+
i
+
+ The absolute depth of the frame whose iteration value is to be retreived.  + Valid values range from 1 to BOOST_PP_ITERATION_DEPTH(). +
+
+

Remarks

+
+ This macro is only valid when a file-iteration is in progress. +
+

Requirements

+
+ Header:  <boost/preprocessor/iteration/iterate.hpp> +
+

Sample Code

+
+// file.h
+#if !BOOST_PP_IS_ITERATING
+
+   #ifndef FILE_H_
+   #define FILE_H_
+
+   #include <boost/preprocessor/iteration/iterate.hpp>
+
+   #define BOOST_PP_ITERATION_PARAMS_1 (3, (1, 10, "file.h"))
+   #include BOOST_PP_ITERATE()
+
+   #endif
+
+#elif BOOST_PP_ITERATION_DEPTH() == 1
+
+   --
+   #define BOOST_PP_ITERATION_PARAMS_2 \
+      (3, (1, BOOST_PP_ITERATION(), "file.h"))   \
+      /**/
+
+   #include BOOST_PP_ITERATE()
+
+#else
+
+   outer: BOOST_PP_FRAME_ITERATION(1)
+   inner: BOOST_PP_FRAME_ITERATION(2)
+
+#endif
+
+ + diff --git a/doc/ref/frame_start.html b/doc/ref/frame_start.html new file mode 100644 index 0000000..5e67299 --- /dev/null +++ b/doc/ref/frame_start.html @@ -0,0 +1,31 @@ + + + BOOST_PP_FRAME_START + + + +
+ The BOOST_PP_FRAME_START macro expands to the lower bound of an absolute file-iteration depth. +
+

Usage

+
+ BOOST_PP_FRAME_START(i) +
+

Arguments

+
+
i
+
+ The absolute depth of the frame whose lower bound is to be retreived.  + Valid values range from 1 to BOOST_PP_ITERATION_DEPTH(). +
+
+

Remarks

+
+ This macro is only valid when a file-iteration is in progress. +
+

Requirements

+
+ Header:  <boost/preprocessor/iteration/iterate.hpp> +
+ + diff --git a/doc/ref/greater.html b/doc/ref/greater.html new file mode 100644 index 0000000..6062256 --- /dev/null +++ b/doc/ref/greater.html @@ -0,0 +1,54 @@ + + + BOOST_PP_GREATER + + + +
+ The BOOST_PP_GREATER macro compares two values for greater magnitude. +
+

Usage

+
+ BOOST_PP_GREATER(x, y) +
+

Arguments

+
+
x
+
+ The left operand of the comparison.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
y
+
+ The right operand of the comparison.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ If x is greater than y, this macro expands to 1.  + Otherwise, it expands to 0. +
+
+ Previously, this macro could not be used inside BOOST_PP_WHILE.  + There is no longer any such restriction.  + It is more efficient, however, to use BOOST_PP_GREATER_D in such a situation. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/comparison/greater.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/comparison/greater.hpp>
+
+BOOST_PP_GREATER(4, 3) // expands to 1
+BOOST_PP_GREATER(5, 5) // expands to 0
+
+ + diff --git a/doc/ref/greater_d.html b/doc/ref/greater_d.html new file mode 100644 index 0000000..59cadc2 --- /dev/null +++ b/doc/ref/greater_d.html @@ -0,0 +1,58 @@ + + + BOOST_PP_GREATER_D + + + +
+ The BOOST_PP_GREATER_D macro compares two values for greater magnitude.  + It reenters BOOST_PP_WHILE with maximum efficiency. +
+

Usage

+
+ BOOST_PP_GREATER_D(d, x, y) +
+

Arguments

+
+
d
+
+ The next available BOOST_PP_WHILE iteration.  +
+
x
+
+ The left operand of the comparison.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
y
+
+ The right operand of the comparison.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ If x is greater than y, this macro expands to 1.  + Otherwise, it expands to 0. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/comparison/greater.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/comparison/greater.hpp>
+#include <boost/preprocessor/list/filter.hpp>
+
+#define LIST (1, (2, (3, (4, (5, BOOST_PP_NIL)))))
+
+#define PRED(d, _, num) BOOST_PP_GREATER_D(d, num, 2)
+
+BOOST_PP_LIST_FILTER(PRED, nil, LIST) // expands to (3, (4, (5, BOOST_PP_NIL)))
+
+ + diff --git a/doc/ref/greater_equal.html b/doc/ref/greater_equal.html new file mode 100644 index 0000000..026d6b4 --- /dev/null +++ b/doc/ref/greater_equal.html @@ -0,0 +1,54 @@ + + + BOOST_PP_GREATER_EQUAL + + + +
+ The BOOST_PP_GREATER_EQUAL macro compares two values for equality or greater magnitude. +
+

Usage

+
+ BOOST_PP_GREATER_EQUAL(x, y) +
+

Arguments

+
+
x
+
+ The left operand of the comparison.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
y
+
+ The right operand of the comparison.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ If x is greater than or equal to y, this macro expands to 1.  + Otherwise, it expands to 0. +
+
+ Previously, this macro could not be used inside BOOST_PP_WHILE.  + There is no longer any such restriction.  + It is more efficient, however, to use BOOST_PP_GREATER_EQUAL_D in such a situation. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/comparison/greater_equal.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/comparison/greater_equal.hpp>
+
+BOOST_PP_GREATER_EQUAL(4, 3) // expands to 1
+BOOST_PP_GREATER_EQUAL(5, 5) // expands to 1
+
+ + diff --git a/doc/ref/greater_equal_d.html b/doc/ref/greater_equal_d.html new file mode 100644 index 0000000..47e66e2 --- /dev/null +++ b/doc/ref/greater_equal_d.html @@ -0,0 +1,58 @@ + + + BOOST_PP_GREATER_EQUAL_D + + + +
+ The BOOST_PP_GREATER_EQUAL_D macro compares two values for equality or greater magnitude.  + It reenters BOOST_PP_WHILE with maximum efficiency. +
+

Usage

+
+ BOOST_PP_GREATER_EQUAL_D(d, x, y) +
+

Arguments

+
+
d
+
+ The next available BOOST_PP_WHILE iteration.  +
+
x
+
+ The left operand of the comparison.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
y
+
+ The right operand of the comparison.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ If x is greater than or equal to y, this macro expands to 1.  + Otherwise, it expands to 0. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/comparison/greater_equal.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/comparison/greater_equal.hpp>
+#include <boost/preprocessor/list/filter.hpp>
+
+#define LIST (1, (2, (3, (4, (5, BOOST_PP_NIL)))))
+
+#define PRED(d, _, num) BOOST_PP_GREATER_EQUAL_D(d, num, 4)
+
+BOOST_PP_LIST_FILTER(PRED, nil, LIST) // expands to (4, (5, BOOST_PP_NIL))
+
+ + diff --git a/doc/ref/identity.html b/doc/ref/identity.html new file mode 100644 index 0000000..f73df30 --- /dev/null +++ b/doc/ref/identity.html @@ -0,0 +1,46 @@ + + + BOOST_PP_IDENTITY + + + +
+ The BOOST_PP_IDENTITY macro expands to its argument when invoked. +
+

Usage

+
+ BOOST_PP_IDENTITY(item)() +
+

Arguments

+
+
item
+
+ The result of the expansion. +
+
+

Remarks

+
+ This macro is designed to be used with BOOST_PP_IF and BOOST_PP_IIF when only one of the clauses needs to be invoked. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/facilities/identity.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/control/if.hpp>
+#include <boost/preprocessor/facilities/empty.hpp>
+#include <boost/preprocessor/facilities/identity.hpp>
+
+#define MACRO(n) BOOST_PP_IF(n, BOOST_PP_IDENTITY(x), BOOST_PP_EMPTY)()
+
+MACRO(0) // expands to nothing
+MACRO(1) // expands to x
+
+ + diff --git a/doc/ref/if.html b/doc/ref/if.html new file mode 100644 index 0000000..0819753 --- /dev/null +++ b/doc/ref/if.html @@ -0,0 +1,52 @@ + + + BOOST_PP_IF + + + +
+ The BOOST_PP_IF macro chooses between to values based on a logical condition. +
+

Usage

+
+ BOOST_PP_IF(cond, t, f) +
+

Arguments

+
+
cond
+
+ The condition that determines if the result is expr or nothing.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
t
+
+ The result of the expansion if cond is non-zero. +
+
f
+
+ The result of the expansion if cond is 0. +
+
+

Remarks

+
+ This macro performs a boolean conversion on its first argument.  + If that conversion is unnecessary, use BOOST_PP_IIF instead. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/control/if.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/control/if.hpp>
+
+BOOST_PP_IF(10, a, b) // expands to a
+BOOST_PP_IF(0, a, b) // expands to b
+
+ + diff --git a/doc/ref/iif.html b/doc/ref/iif.html new file mode 100644 index 0000000..3b6e796 --- /dev/null +++ b/doc/ref/iif.html @@ -0,0 +1,54 @@ + + + BOOST_PP_IIF + + + +
+ The BOOST_PP_IIF macro chooses between to values based on a bitwise condition. +
+

Usage

+
+ BOOST_PP_IIF(bit, t, f) +
+

Arguments

+
+
bit
+
+ The condition that determines if the result is expr or nothing.  + This value must expand to 0 or 1. +
+
t
+
+ The result of the expansion if bit is 1. +
+
f
+
+ The result of the expansion if bit is 0. +
+
+

Remarks

+
+ This macro does not perform a boolean conversion on its first argument.  + If that conversion is necessary, use BOOST_PP_IF instead. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/control/iif.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/control/iif.hpp>
+
+#define OR_IF(p, q, t, f) BOOST_PP_IIF(BOOST_PP_OR(p, q), t, f)
+
+OR_IF(1, 0, abc, xyz) // expands to abc
+OF_IF(0, 0, abc, xyz) // expands to xyz
+
+ + diff --git a/doc/ref/inc.html b/doc/ref/inc.html new file mode 100644 index 0000000..521011a --- /dev/null +++ b/doc/ref/inc.html @@ -0,0 +1,43 @@ + + + BOOST_PP_INC + + + +
+ The BOOST_PP_INC macro expands to one more than its argument. +
+

Usage

+
+ BOOST_PP_INC(x) +
+

Arguments

+
+
x
+
+ The value to be incremented.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ If x is BOOST_PP_LIMIT_MAG, the result is saturated to BOOST_PP_LIMIT_MAG. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/arithmetic/inc.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/arithmetic/inc.hpp>
+
+BOOST_PP_INC(BOOST_PP_INC(6)) // expands to 8
+BOOST_PP_INC(4) // expands to 5
+
+ + diff --git a/doc/ref/include_self.html b/doc/ref/include_self.html new file mode 100644 index 0000000..25053d9 --- /dev/null +++ b/doc/ref/include_self.html @@ -0,0 +1,90 @@ + + + BOOST_PP_INCLUDE_SELF + + + +
+ The BOOST_PP_INCLUDE_SELF macro includes a file indirectly. +
+

Usage

+
+ #include BOOST_PP_INCLUDE_SELF() +
+

Arguments

+
+
filename
+
+ A quoted or angle-bracketed filename to be included by BOOST_PP_INCLUDE_SELF. +
+
+

Remarks

+
+ BOOST_PP_INDIRECT_SELF must be defined prior to using this macro. +
+
+ Most preprocessors will not allow a file to directly include itself--even when the file protects itself from such a scenario.  + This macro, in combination with BOOST_PP_INDIRECT_SELF allows a file to include itself indirectly. +
+
+ While BOOST_PP_INDIRECT_SELF is being included, BOOST_PP_INCLUDE_SELF defines the macro BOOST_PP_IS_SELFISH to 1.  + When it returns from the inclusion, BOOST_PP_IS_SELFISH is undefined. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/iteration/self.hpp> +
+

Sample Code

+
+// file.h
+#if !BOOST_PP_IS_SELFISH
+
+   #ifndef FILE_H_
+   #define FILE_H_
+
+   #include <boost/preprocessor/iteration/self.hpp>
+
+   #define NAME X
+   struct NAME {
+      // ...
+      #define BOOST_PP_INDIRECT_SELF "file.h"
+      #include BOOST_PP_INCLUDE_SELF()
+   };
+
+   #define NAME Y
+   struct NAME {
+      // ...
+      #define BOOST_PP_INDIRECT_SELF "file.h"
+      #include BOOST_PP_INCLUDE_SELF()
+   };
+
+   #define NAME Z
+   struct NAME {
+      // ...
+      #define BOOST_PP_INDIRECT_SELF "file.h"
+      #include BOOST_PP_INCLUDE_SELF()
+   };
+
+   #endif
+
+#else
+
+      inline bool validate(NAME* p) {
+         return true;
+      }
+
+      template<class T> bool validate(T* p) {
+         return dynamic_cast<NAME*>(p);
+      }
+
+   #undef NAME
+
+#endif
+
+ + diff --git a/doc/ref/indirect_self.html b/doc/ref/indirect_self.html new file mode 100644 index 0000000..5cbd2a9 --- /dev/null +++ b/doc/ref/indirect_self.html @@ -0,0 +1,34 @@ + + + BOOST_PP_INDIRECT_SELF + + + +
+ The BOOST_PP_INDIRECT_SELF macro is a user-defined named external argument used by BOOST_PP_INCLUDE_SELF.  +
+

Usage

+
+ #define BOOST_PP_INDIRECT_SELF filename +
+

Arguments

+
+
filename
+
+ A quoted or angle-bracketed filename to be included by BOOST_PP_INCLUDE_SELF. +
+
+

Remarks

+
+ Most preprocessors will not allow a file to directly include itself--even when the file protects itself from such a scenario.  + This macro, in combination with BOOST_PP_INCLUDE_SELF allows a file to include itself indirectly. +
+
+ This macro is automatically undefined for reuse by a call to BOOST_PP_INCLUDE_SELF. +
+

See Also

+ + + diff --git a/doc/ref/intercept.html b/doc/ref/intercept.html new file mode 100644 index 0000000..90b8dd9 --- /dev/null +++ b/doc/ref/intercept.html @@ -0,0 +1,40 @@ + + + BOOST_PP_INTERCEPT + + + +
+ The BOOST_PP_INTERCEPT macro intercepts a numeric concatenation and expands to nothing. +
+

Usage

+
+ BOOST_PP_INTERCEPT +
+

Remarks

+
+ This macro is used to intercept concatenations performed by various other library constructs.  + It is typically used after other text to prevent eat the concatenation expand to nothing.  + This macro can only intercept integer constants in the range of 0 to BOOST_PP_LIMIT_MAG. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/facilities/intercept.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/facilities/intercept.hpp>
+#include <boost/preprocessor/repetition/enum_binary_params.hpp>
+
+BOOST_PP_ENUM_BINARY_PARAMS(3, class T, = U)
+// expands to class T0 = U0, class T1 = U1, class T2 = U2
+
+BOOST_PP_ENUM_BINARY_PARAMS(3, class T, = int BOOST_PP_INTERCEPT)
+// expands to class T0 = int, class T1 = int, class T2 = int
+
+ + diff --git a/doc/ref/is_iterating.html b/doc/ref/is_iterating.html new file mode 100644 index 0000000..64f3cab --- /dev/null +++ b/doc/ref/is_iterating.html @@ -0,0 +1,27 @@ + + + BOOST_PP_IS_ITERATING + + + + +
+ The BOOST_PP_IS_ITERATING macro is defined when a file-iteration is in progress. +
+

Usage

+
+ #if !defined(BOOST_PP_IS_ITERATING) // ... +
+

Remarks

+
+ If a file-iteration is in progress, this macro is defined as 1.  + This means that the following will also work: +
+ #if !BOOST_PP_IS_ITERATING // ... +
+
+
+ This macro is defined to guard a file from infinite inclusion. +
+ + diff --git a/doc/ref/is_selfish.html b/doc/ref/is_selfish.html new file mode 100644 index 0000000..9a3158d --- /dev/null +++ b/doc/ref/is_selfish.html @@ -0,0 +1,27 @@ + + + BOOST_PP_IS_SELFISH + + + + +
+ The BOOST_PP_IS_SELFISH macro is defined when a self-inclusion is in progress. +
+

Usage

+
+ #if !defined(BOOST_PP_IS_SELFISH) // ... +
+

Remarks

+
+ If a self-inclusion is in progress, this macro is defined as 1.  + This means that the following will also work: +
+ #if !BOOST_PP_IS_SELFISH // ... +
+
+
+ This macro is defined to guard a file from infinite inclusion. +
+ + diff --git a/doc/ref/iterate.html b/doc/ref/iterate.html new file mode 100644 index 0000000..d2e5c13 --- /dev/null +++ b/doc/ref/iterate.html @@ -0,0 +1,72 @@ + + + BOOST_PP_ITERATE + + + +
+ The BOOST_PP_ITERATE macro initiates a file-iteration. +
+

Usage

+
+ #include BOOST_PP_ITERATE() +
+

Remarks

+
+ Arguments to this macro are passed as external named arguments in one of two + ways--either through BOOST_PP_FILENAME_x and BOOST_PP_ITERATION_LIMITS or + through BOOST_PP_ITERATION_PARAMS_x.  +
+
+ Three pieces of information are required to perform a file-iteration.  + First, the name of a file to iterate over.  + This is passed via BOOST_PP_FILENAME_x or as part of BOOST_PP_ITERATION_PARAMS_x.  + The file-iteration mechanism will repeatedly include this file with iteration values ranging from a lower bound to an upper bound--the second and third required parameters.  + These two boundaries are either passed through BOOST_PP_ITERATION_LIMITS or as part of BOOST_PP_ITERATION_PARAMS_x. +
+
+ Optionally, a fourth parameter may be passed that associates flags with an iteration.  + These flags are primarily useful to distinguish one iteration from another in the same file.  + This parameter can only be passed through BOOST_PP_ITERATION_PARAMS_x. +
+
+ While a file-iteration is in progress, BOOST_PP_IS_ITERATING is defined as 1. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/iteration/iterate.hpp> +
+

Sample Code

+
+// file.h
+#if !BOOST_PP_IS_ITERATING
+
+   #ifndef FILE_H_
+   #define FILE_H_
+
+   #include <boost/preprocessor/iteration/iterate.hpp>
+
+   #define BOOST_PP_ITERATION_PARAMS_1 (3, (1, 10, "file.h"))
+   #include BOOST_PP_ITERATE()
+
+   #define BOOST_PP_FILENAME_1 "file.h"
+   #define BOOST_PP_ITERATION_LIMITS (11, 20)
+   #include BOOST_PP_ITERATE()
+
+   #endif
+
+#else
+
+   current iteration value is BOOST_PP_ITERATION()
+
+#endif
+
+ + diff --git a/doc/ref/iteration.html b/doc/ref/iteration.html new file mode 100644 index 0000000..7b2136c --- /dev/null +++ b/doc/ref/iteration.html @@ -0,0 +1,44 @@ + + + BOOST_PP_ITERATION + + + +
+ The BOOST_PP_ITERATION macro expands to the iteration value of the current file-iteration depth. +
+

Usage

+
+ BOOST_PP_ITERATION() +
+

Remarks

+
+ This macro is only valid when a file-iteration is in progress. +
+

Requirements

+
+ Header:  <boost/preprocessor/iteration/iterate.hpp> +
+

Sample Code

+
+// file.h
+#if !BOOST_PP_IS_ITERATING
+
+   #ifndef FILE_H_
+   #define FILE_H_
+
+   #include <boost/preprocessor/iteration/iterate.hpp>
+
+   #define BOOST_PP_ITERATION_PARAMS_1 (3, (1, 3, "file.h"))
+   #include BOOST_PP_ITERATE()
+
+   #endif
+
+#elif BOOST_PP_ITERATION_DEPTH() == 1
+
+   value == BOOST_PP_ITERATION()
+
+#endif
+
+ + diff --git a/doc/ref/iteration_depth.html b/doc/ref/iteration_depth.html new file mode 100644 index 0000000..3a39c21 --- /dev/null +++ b/doc/ref/iteration_depth.html @@ -0,0 +1,57 @@ + + + BOOST_PP_ITERATION_DEPTH + + + +
+ The BOOST_PP_ITERATION_DEPTH macro expands to the current file-iteration depth. +
+

Usage

+
+ BOOST_PP_ITERATION_DEPTH() +
+

Remarks

+
+ If a file-iteration is not in progress, this macro expands to 0.  + Otherwise, it expands to the current depth of file-iteration. +
+

Requirements

+
+ Header:  <boost/preprocessor/iteration/iterate.hpp> +
+

Sample Code

+
+// file.h
+#if !BOOST_PP_IS_ITERATING
+
+   #ifndef FILE_H_
+   #define FILE_H_
+
+   #include <boost/preprocessor/iteration/iterate.hpp>
+
+   #define BOOST_PP_ITERATION_PARAMS_1 (3, (1, 3, "file.h"))
+   #include BOOST_PP_ITERATE()
+
+   #endif
+
+#elif BOOST_PP_ITERATION_DEPTH() == 1
+
+   + depth BOOST_PP_ITERATION_DEPTH()
+   // ...
+
+   #define BOOST_PP_ITERATION_PARAMS_2 \
+      (3, (1, BOOST_PP_ITERATION(), "file.h")) \
+      /**/
+
+   #include BOOST_PP_ITERATE()
+
+#elif BOOST_PP_ITERATION_DEPTH() == 2
+
+   - depth BOOST_PP_ITERATION_DEPTH()
+   // ...
+
+#endif
+
+ + diff --git a/doc/ref/iteration_finish.html b/doc/ref/iteration_finish.html new file mode 100644 index 0000000..28d543a --- /dev/null +++ b/doc/ref/iteration_finish.html @@ -0,0 +1,46 @@ + + + BOOST_PP_ITERATION_FINISH + + + +
+ The BOOST_PP_ITERATION_FINISH macro expands to the upper bound of the current file-iteration depth. +
+

Usage

+
+ BOOST_PP_ITERATION_FINISH() +
+

Remarks

+
+ This macro is only valid when a file-iteration is in progress. +
+

Requirements

+
+ Header:  <boost/preprocessor/iteration/iterate.hpp> +
+

Sample Code

+
+// file.h
+#if !BOOST_PP_IS_ITERATING
+
+   #ifndef FILE_H_
+   #define FILE_H_
+
+   #include <boost/preprocessor/iteration/iterate.hpp>
+
+   #define BOOST_PP_ITERATION_PARAMS_1 (3, (1, 10, "file.h"))
+   #include BOOST_PP_ITERATE()
+
+   #endif
+
+#elif BOOST_PP_ITERATION_DEPTH() == 1
+
+   start -> BOOST_PP_ITERATION_START()
+   iteration -> BOOST_PP_ITERATION()
+   finish -> BOOST_PP_ITERATION_FINISH()
+
+#endif
+
+ + diff --git a/doc/ref/iteration_flags.html b/doc/ref/iteration_flags.html new file mode 100644 index 0000000..ccd8b86 --- /dev/null +++ b/doc/ref/iteration_flags.html @@ -0,0 +1,57 @@ + + + BOOST_PP_ITERATION_FLAGS + + + +
+ The BOOST_PP_ITERATION_FLAGS macro retrieves flags associated with the current file-iteration depth. +
+

Usage

+
+ BOOST_PP_ITERATION_FLAGS() +
+

Remarks

+
+ This macro is only valid when a file-iteration is in progress. +
+

Requirements

+
+ Header:  <boost/preprocessor/iteration/iterate.hpp> +
+

Sample Code

+
+// file.h
+#if !BOOST_PP_IS_ITERATING
+
+   #ifndef FILE_H_
+   #define FILE_H_
+
+   #include <boost/preprocessor/iteration/iterate.hpp>
+
+   // 1st iteration:
+   #define BOOST_PP_ITERATION_PARAMS_1 (4, (1, 10, "file.h", 0x0001))
+   #include BOOST_PP_ITERATE()
+
+   // 2nd iteration:
+   #define BOOST_PP_ITERATION_PARAMS_1 (4, (1, 10, "file.h", 0x0002))
+   #include BOOST_PP_ITERATE()
+
+   #endif
+
+#elif BOOST_PP_ITERATION_DEPTH() == 1 \
+   && BOOST_PP_ITERATION_FLAGS() == 0x0001 \
+   /**/
+
+   { 1st }
+
+#elif BOOST_PP_ITERATION_DEPTH() == 1 \
+   && BOOST_PP_ITERATION_FLAGS() == 0x0002 \
+   /**/
+
+   { 2nd }
+
+#endif
+
+ + diff --git a/doc/ref/iteration_limits.html b/doc/ref/iteration_limits.html new file mode 100644 index 0000000..54af2a2 --- /dev/null +++ b/doc/ref/iteration_limits.html @@ -0,0 +1,48 @@ + + + BOOST_PP_ITERATION_LIMITS + + + + +
+ The BOOST_PP_ITERATION_LIMITS macro is a user-defined named external argument used by BOOST_PP_ITERATE.  + It denotes the lower and upper bounds of a file-iteration. +
+

Usage

+
+ #define BOOST_PP_ITERATION_LIMITS (start, finish) +
+

Arguments

+
+
start
+
+ The lower bound (inclusive) of a file-iteration.  + Valid values range from 0 to BOOST_PP_LIMIT_ITERATION. +
+
finish
+
+ The upper bound (inclusive) of a file-iteration.  + Valid values range from 0 to BOOST_PP_LIMIT_ITERATION. +
+
+

Remarks

+
+ Note that there is a whitespace character after the macro identifier. +
+
+ This macro is part of the secondary method of passing arguments to BOOST_PP_ITERATE.  + The other part is BOOST_PP_FILENAME_x. Both start and finish are evaluated parameters.  + This implies that they may include simple arithmetic. +
+
+ This macro is automatically undefined for reuse by a call to BOOST_PP_ITERATE. +
+

See Also

+ + + diff --git a/doc/ref/iteration_params_x.html b/doc/ref/iteration_params_x.html new file mode 100644 index 0000000..ea38437 --- /dev/null +++ b/doc/ref/iteration_params_x.html @@ -0,0 +1,66 @@ + + + BOOST_PP_ITERATION_PARAMS_x + + + + +
+ The BOOST_PP_ITERATION_PARAMS_x macro is a user-defined named external argument used by BOOST_PP_ITERATE.  + It denotes the lower bound, upper bound, and the filename of a file-iteration. It can optionally denote flags associated with a file-iteration as well. +
+

Usage

+
+ #define BOOST_PP_ITERATION_PARAMS_x (c, (start, finish, filename [, flags])) +
+

Arguments

+
+
x
+
+ The iteration depth of the next file-iteration.  + This value must be the current iteration depth + 1. +
+
c
+
+ The number of parameters.  + If flags is specified, this value must be 4.  + Otherwise, it must be 3. +
+
start
+
+ The lower bound (inclusive) of a file-iteration.  + Valid values range from 0 to BOOST_PP_LIMIT_ITERATION. +
+
finish
+
+ The upper bound (inclusive) of a file-iteration.  + Valid values range from 0 to BOOST_PP_LIMIT_ITERATION. +
+
filename
+
+ A quoted or angle-bracketed filename to used as the target of a file-iteration. +
+
[flags]
+
+ A quoted or angle-bracketed filename to used as the target of a file-iteration. +
+
+

Remarks

+
+ Note that there is a whitespace character after the macro identifier. +
+
+ This macro is must be defined as an array of arguments in one of the two formats above (with or without flags). + It is the primary method of passing arguments to BOOST_PP_ITERATE.  + Both start and finish are evaluated parameters, which implies that simple arithmetic can be used. +
+
+ This macro is automatically undefined for reuse by a call to BOOST_PP_ITERATE. +
+

See Also

+ + + diff --git a/doc/ref/iteration_start.html b/doc/ref/iteration_start.html new file mode 100644 index 0000000..770f4e1 --- /dev/null +++ b/doc/ref/iteration_start.html @@ -0,0 +1,46 @@ + + + BOOST_PP_ITERATION_START + + + +
+ The BOOST_PP_ITERATION_START macro expands to the lower bound of the current file-iteration depth. +
+

Usage

+
+ BOOST_PP_ITERATION_START() +
+

Remarks

+
+ This macro is only valid when a file-iteration is in progress. +
+

Requirements

+
+ Header:  <boost/preprocessor/iteration/iterate.hpp> +
+

Sample Code

+
+// file.h
+#if !BOOST_PP_IS_ITERATING
+
+   #ifndef FILE_H_
+   #define FILE_H_
+
+   #include <boost/preprocessor/iteration/iterate.hpp>
+
+   #define BOOST_PP_ITERATION_PARAMS_1 (3, (1, 10, "file.h"))
+   #include BOOST_PP_ITERATE()
+
+   #endif
+
+#elif BOOST_PP_ITERATION_DEPTH() == 1
+
+   start -> BOOST_PP_ITERATION_START()
+   iteration -> BOOST_PP_ITERATION()
+   finish -> BOOST_PP_ITERATION_FINISH()
+
+#endif
+
+ + diff --git a/doc/ref/less.html b/doc/ref/less.html new file mode 100644 index 0000000..835b950 --- /dev/null +++ b/doc/ref/less.html @@ -0,0 +1,54 @@ + + + BOOST_PP_LESS + + + +
+ The BOOST_PP_LESS macro compares two values for lesser magnitude. +
+

Usage

+
+ BOOST_PP_LESS(x, y) +
+

Arguments

+
+
x
+
+ The left operand of the comparison.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
y
+
+ The right operand of the comparison.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ If x is less than y, this macro expands to 1.  + Otherwise, it expands to 0. +
+
+ Previously, this macro could not be used inside BOOST_PP_WHILE.  + There is no longer any such restriction.  + It is more efficient, however, to use BOOST_PP_LESS_D in such a situation. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/comparison/less.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/comparison/less.hpp>
+
+BOOST_PP_LESS(4, 3) // expands to 0
+BOOST_PP_LESS(3, 4) // expands to 1
+
+ + diff --git a/doc/ref/less_d.html b/doc/ref/less_d.html new file mode 100644 index 0000000..68aa2fc --- /dev/null +++ b/doc/ref/less_d.html @@ -0,0 +1,59 @@ + + + BOOST_PP_LESS_D + + + +
+ The BOOST_PP_LESS_D macro compares two values for lesser magnitude.  + It reenters BOOST_PP_WHILE with maximum efficiency. +
+

Usage

+
+ BOOST_PP_LESS_D(d, x, y) +
+

Arguments

+
+
d
+
+ The next available BOOST_PP_WHILE iteration.  +
+
x
+
+ The left operand of the comparison.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
y
+
+ The right operand of the comparison.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ If x is less than y, this macro expands to 1.  + Otherwise, it expands to 0. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/comparison/less.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/comparison/less.hpp>
+#include <boost/preprocessor/list/filter.hpp>
+
+#define LIST (1, (2, (3, (4, (5, BOOST_PP_NIL)))))
+
+#define PRED(d, _, num) BOOST_PP_LESS_D(d, num, 3)
+
+BOOST_PP_LIST_FILTER(PRED, nil, LIST)
+   // expands to (1, (2, BOOST_PP_NIL))
+
+ + diff --git a/doc/ref/less_equal.html b/doc/ref/less_equal.html new file mode 100644 index 0000000..964a3a0 --- /dev/null +++ b/doc/ref/less_equal.html @@ -0,0 +1,54 @@ + + + BOOST_PP_LESS_EQUAL + + + +
+ The BOOST_PP_LESS_EQUAL macro compares two values for equality or lesser magnitude. +
+

Usage

+
+ BOOST_PP_LESS_EQUAL(x, y) +
+

Arguments

+
+
x
+
+ The left operand of the comparison.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
y
+
+ The right operand of the comparison.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ If x is lesser than or equal to y, this macro expands to 1.  + Otherwise, it expands to 0. +
+
+ Previously, this macro could not be used inside BOOST_PP_WHILE.  + There is no longer any such restriction.  + It is more efficient, however, to use BOOST_PP_LESS_EQUAL_D in such a situation. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/comparison/less_equal.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/comparison/less_equal.hpp>
+
+BOOST_PP_LESS_EQUAL(4, 3) // expands to 0
+BOOST_PP_LESS_EQUAL(5, 5) // expands to 1
+
+ + diff --git a/doc/ref/less_equal_d.html b/doc/ref/less_equal_d.html new file mode 100644 index 0000000..ef35b8c --- /dev/null +++ b/doc/ref/less_equal_d.html @@ -0,0 +1,59 @@ + + + BOOST_PP_LESS_EQUAL_D + + + +
+ The BOOST_PP_LESS_EQUAL_D macro compares two values for equality or lesser magnitude.  + It reenters BOOST_PP_WHILE with maximum efficiency. +
+

Usage

+
+ BOOST_PP_LESS_EQUAL_D(d, x, y) +
+

Arguments

+
+
d
+
+ The next available BOOST_PP_WHILE iteration.  +
+
x
+
+ The left operand of the comparison.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
y
+
+ The right operand of the comparison.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ If x is less than or equal to y, this macro expands to 1.  + Otherwise, it expands to 0. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/comparison/less_equal.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/comparison/less_equal.hpp>
+#include <boost/preprocessor/list/filter.hpp>
+
+#define LIST (1, (2, (3, (4, (5, BOOST_PP_NIL)))))
+
+#define PRED(d, _, num) BOOST_PP_LESS_EQUAL_D(d, num, 4)
+
+BOOST_PP_LIST_FILTER(PRED, nil, LIST)
+   // expands to (1, (2, (3, (4, BOOST_PP_NIL))))
+
+ + diff --git a/doc/ref/limit_dim.html b/doc/ref/limit_dim.html new file mode 100644 index 0000000..23feed7 --- /dev/null +++ b/doc/ref/limit_dim.html @@ -0,0 +1,24 @@ + + + BOOST_PP_LIMIT_DIM + + + + +
+ The BOOST_PP_LIMIT_DIM macro defines the maximum number of available BOOST_PP_REPEAT dimensions. +
+

Usage

+
+ BOOST_PP_LIMIT_DIM +
+

Remarks

+
+ This macro currently expands to 3. +
+

Requirements

+
+ Header:  <boost/preprocessor/config/limits.hpp> +
+ + diff --git a/doc/ref/limit_for.html b/doc/ref/limit_for.html new file mode 100644 index 0000000..8753f01 --- /dev/null +++ b/doc/ref/limit_for.html @@ -0,0 +1,23 @@ + + + BOOST_PP_LIMIT_FOR + + + +
+ The BOOST_PP_LIMIT_FOR macro defines the maximum number of BOOST_PP_FOR repetitions. +
+

Usage

+
+ BOOST_PP_LIMIT_FOR +
+

Remarks

+
+ This macro currently expands to 256. +
+

Requirements

+
+ Header:  <boost/preprocessor/config/limits.hpp> +
+ + diff --git a/doc/ref/limit_iteration.html b/doc/ref/limit_iteration.html new file mode 100644 index 0000000..c73538c --- /dev/null +++ b/doc/ref/limit_iteration.html @@ -0,0 +1,23 @@ + + + BOOST_PP_LIMIT_ITERATION + + + +
+ The BOOST_PP_LIMIT_ITERATION macro defines the maximum number of local and file iterations. +
+

Usage

+
+ BOOST_PP_LIMIT_ITERATION +
+

Remarks

+
+ This macro currently expands to 256. +
+

Requirements

+
+ Header:  <boost/preprocessor/config/limits.hpp> +
+ + diff --git a/doc/ref/limit_iteration_dim.html b/doc/ref/limit_iteration_dim.html new file mode 100644 index 0000000..99cbe5e --- /dev/null +++ b/doc/ref/limit_iteration_dim.html @@ -0,0 +1,23 @@ + + + BOOST_PP_LIMIT_ITERATION_DIM + + + +
+ The BOOST_PP_LIMIT_ITERATION_DIM macro defines the maximum depth of file-iteration. +
+

Usage

+
+ BOOST_PP_LIMIT_ITERATION_DIM +
+

Remarks

+
+ This macro currently expands to 5. +
+

Requirements

+
+ Header:  <boost/preprocessor/config/limits.hpp> +
+ + diff --git a/doc/ref/limit_mag.html b/doc/ref/limit_mag.html new file mode 100644 index 0000000..4ed10e4 --- /dev/null +++ b/doc/ref/limit_mag.html @@ -0,0 +1,23 @@ + + + BOOST_PP_LIMIT_MAG + + + +
+ The BOOST_PP_LIMIT_MAG macro defines the maximum input and result magnitudes of arithmetic. +
+

Usage

+
+ BOOST_PP_LIMIT_MAG +
+

Remarks

+
+ This macro currently expands to 256. +
+

Requirements

+
+ Header:  <boost/preprocessor/config/limits.hpp> +
+ + diff --git a/doc/ref/limit_repeat.html b/doc/ref/limit_repeat.html new file mode 100644 index 0000000..59906bb --- /dev/null +++ b/doc/ref/limit_repeat.html @@ -0,0 +1,23 @@ + + + BOOST_PP_LIMIT_REPEAT + + + +
+ The BOOST_PP_LIMIT_REPEAT macro defines the maximum number of repetitions supported by each BOOST_PP_REPEAT dimension. +
+

Usage

+
+ BOOST_PP_LIMIT_REPEAT +
+

Remarks

+
+ This macro current expands to 256. +
+

Requirements

+
+ Header:  <boost/preprocessor/config/limits.hpp> +
+ + diff --git a/doc/ref/limit_slot_count.html b/doc/ref/limit_slot_count.html new file mode 100644 index 0000000..0f99311 --- /dev/null +++ b/doc/ref/limit_slot_count.html @@ -0,0 +1,23 @@ + + + BOOST_PP_LIMIT_SLOT_COUNT + + + +
+ The BOOST_PP_LIMIT_SLOT_COUNT macro defines the number of available evaluated slots. +
+

Usage

+
+ BOOST_PP_LIMIT_SLOT_COUNT +
+

Remarks

+
+ This macro currently expands to 5. +
+

Requirements

+
+ Header:  <boost/preprocessor/config/limits.hpp> +
+ + diff --git a/doc/ref/limit_slot_sig.html b/doc/ref/limit_slot_sig.html new file mode 100644 index 0000000..2fe5f39 --- /dev/null +++ b/doc/ref/limit_slot_sig.html @@ -0,0 +1,23 @@ + + + BOOST_PP_LIMIT_SLOT_SIG + + + +
+ The BOOST_PP_LIMIT_SLOT_SIG macro defines the number of significant base-10 digits that can be evaluated by the slot mechanism. +
+

Usage

+
+ BOOST_PP_LIMIT_SLOT_SIG +
+

Remarks

+
+ This macro currently expands to 10. +
+

Requirements

+
+ Header:  <boost/preprocessor/config/limits.hpp> +
+ + diff --git a/doc/ref/limit_tuple.html b/doc/ref/limit_tuple.html new file mode 100644 index 0000000..cf6f0f9 --- /dev/null +++ b/doc/ref/limit_tuple.html @@ -0,0 +1,23 @@ + + + BOOST_PP_LIMIT_TUPLE + + + +
+ The BOOST_PP_LIMIT_TUPLE macro defines the maximum tuple size supported by the library. +
+

Usage

+
+ BOOST_PP_LIMIT_TUPLE +
+

Remarks

+
+ This macro currently expands to 25. +
+

Requirements

+
+ Header:  <boost/preprocessor/config/limits.hpp> +
+ + diff --git a/doc/ref/limit_while.html b/doc/ref/limit_while.html new file mode 100644 index 0000000..940d151 --- /dev/null +++ b/doc/ref/limit_while.html @@ -0,0 +1,23 @@ + + + BOOST_PP_LIMIT_WHILE + + + +
+ The BOOST_PP_LIMIT_WHILE macro defines the maximum number of BOOST_PP_WHILE iterations. +
+

Usage

+
+ BOOST_PP_LIMIT_WHILE +
+

Remarks

+
+ This macro currently expands to 256. +
+

Requirements

+
+ Header:  <boost/preprocessor/config/limits.hpp> +
+ + diff --git a/doc/ref/line.html b/doc/ref/line.html new file mode 100644 index 0000000..227d15b --- /dev/null +++ b/doc/ref/line.html @@ -0,0 +1,101 @@ + + + BOOST_PP_LINE + + + +
+ The BOOST_PP_LINE macro places notes encoded as line directives in the preprocessing output. +
+

Usage

+
+ #line BOOST_PP_LINE(line, file) +
+

Arguments

+
+
line
+
+ The new line number of the trailing line.  + The predefined macro __LINE__ is commonly used. +
+
file
+
+ Typically the name of the current file.  + However, any informative text will work.  + This text is internally stringized, so quotation marks are unnecessary. +
+
+

Remarks

+
+ If the macro BOOST_PP_CONFIG_EXTENDED_LINE_INFO is defined as 1 and a file-iteration + is in progress, this macro will automatically insert debugging information about the state of file-iteration.  + This information will show the all of the current iteration values with the inner most iteration last. +
+
+ This information is useful when errors might be spanning multiple iterations of the same source text.  + Finding any errors is sometimes less than straightforward.  + Use of this macro can provide information to make this much easier.  + For example, instead of getting several errors like this: +
+ "file.hpp", line 2: error: expected a ";"
+ "file.hpp", line 4: error: improperly terminated macro invocation
+
+ You might get something like this instead.... +
+ "file.hpp [1]", line 2: error: expected a ";"
+ "file.hpp [5]", line 4: error: improperly terminated macro invocation
+
+ It is immediately evident that this error is spanning multiple iterations of the same source text.  + If it wasn't, the same errors would occur on each iteration. +
+
+ It must be noted however, that some compilers don't like filenames that aren't actually files.  + Those compilers typically issues warnings about the bad filename.  + This makes it a good idea to only define BOOST_PP_CONFIG_EXTENDED_LINE_INFO to 1 only when debugging. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/debug/line.hpp> +
+

Sample Code

+
+// sample.cpp
+#if !defined(BOOST_PP_IS_ITERATING)
+
+   #define BOOST_PP_CONFIG_EXTENDED_LINE_INFO 1
+
+   #include <boost/preprocessor/arithmetic/dec.hpp>
+   #include <boost/preprocessor/cat.hpp>
+   #include <boost/preprocessor/debug/line.hpp>
+   #include <boost/preprocessor/iteration/iterate.hpp>
+
+   namespace sample {
+
+   #define BOOST_PP_ITERATION_PARAMS_1 (3, (1, 5, "sample.cpp"))
+   #include BOOST_PP_ITERATE()
+
+   } // sample
+
+   int main(void) {
+      return 0;
+   }
+
+#else
+
+   #line BOOST_PP_LINE(1, sample.cpp)
+
+   int BOOST_PP_CAT(x, BOOST_PP_ITERATION())); // extra parenthesis
+   
+   struct BOOST_PP_CAT(s, BOOST_PP_DEC(BOOST_PP_ITERATION()) {
+      // missing a parenthesis
+      // ...
+   };
+
+#endif
+
+ + diff --git a/doc/ref/list_append.html b/doc/ref/list_append.html new file mode 100644 index 0000000..e7670ef --- /dev/null +++ b/doc/ref/list_append.html @@ -0,0 +1,58 @@ + + + BOOST_PP_LIST_APPEND + + + +
+ The BOOST_PP_LIST_APPEND macro appends two lists. +
+

Usage

+
+ BOOST_PP_LIST_APPEND(a, b) +
+

Arguments

+
+
a
+
+ The first list. +
+
b
+
+ The second list. +
+
+

Remarks

+
+ This macro appends two lists.  + For example, if a is (1, (2, (3, BOOST_PP_NIL))) and b is (4, (5, BOOST_PP_NIL)), + this macro will expand to: +
+ (1, (2, (3, (4, (5, BOOST_PP_NIL))))) +
+
+
+ Previously, this macro could not be used inside BOOST_PP_WHILE.  + There is no longer any such restriction.  + It is more efficient, however, to use BOOST_PP_LIST_APPEND_D in such a situation. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/append.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/list/append.hpp>
+
+#define L1 (a, (b, (c, BOOST_PP_NIL)))
+#define L2 (x, (y, (z, BOOST_PP_NIL)))
+
+BOOST_PP_LIST_APPENDe(L1, L2)
+   // expands to (a, (b, (c, (x, (y, (z, BOOST_PP_NIL))))))
+
+ + diff --git a/doc/ref/list_append_d.html b/doc/ref/list_append_d.html new file mode 100644 index 0000000..ffb3f47 --- /dev/null +++ b/doc/ref/list_append_d.html @@ -0,0 +1,85 @@ + + + BOOST_PP_LIST_APPEND_D + + + +
+ The BOOST_PP_LIST_APPEND_D macro appends two lists.  + It reenters BOOST_PP_WHILE with maximum efficiency. +
+

Usage

+
+ BOOST_PP_LIST_APPEND_D(d, a, b) +
+

Arguments

+
+
d
+
+ The next available BOOST_PP_WHILE iteration. +
+
a
+
+ The first list. +
+
b
+
+ The second list. +
+
+

Remarks

+
+ This macro appends two lists.  + For example, if a is (1, (2, (3, BOOST_PP_NIL))) and b is (4, (5, BOOST_PP_NIL)), + this macro will expand to: +
+ (1, (2, (3, (4, (5, BOOST_PP_NIL))))) +
+
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/append.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/arithmetic/dec.hpp>
+#include <boost/preprocessor/control/while.hpp>
+#include <boost/preprocessor/list/append.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+
+#define LIST (1, (2, (3, BOOST_PP_NIL)))
+
+#define PRED(d, state) BOOST_PP_TUPLE_ELEM(3, 1, state)
+
+#define OP(d, state) \
+   ( \
+      BOOST_PP_LIST_APPEND_D( \
+         d, BOOST_PP_TUPLE_ELEM(3, 0, state), \
+         BOOST_PP_TUPLE_ELEM(3, 2, state) \
+      ), \
+      BOOST_PP_DEC( \
+         BOOST_PP_TUPLE_ELEM(3, 1, state) \
+      ), \
+      BOOST_PP_TUPLE_ELEM(3, 2, state) \
+   ) \
+   /**/
+
+#define LIST_MULTIPLY(c, list) \
+   BOOST_PP_TUPLE_ELEM( \
+      3, 0, \
+      BOOST_PP_WHILE( \
+         PRED, OP, \
+         (BOOST_PP_NIL, c, list) \
+      ) \
+   ) \
+   /**/
+
+LIST_MULTIPLY(3, LIST)
+   // expands to (1, (2, (3, (1, (2, (3, (1, (2, (3, BOOST_PP_NIL)))))))))
+
+ + diff --git a/doc/ref/list_at.html b/doc/ref/list_at.html new file mode 100644 index 0000000..1011ce6 --- /dev/null +++ b/doc/ref/list_at.html @@ -0,0 +1,50 @@ + + + BOOST_PP_LIST_AT + + + +
+ The BOOST_PP_LIST_AT macro extracts an element in a list. +
+

Usage

+
+ BOOST_PP_LIST_AT(list, index) +
+

Arguments

+
+
list
+
+ The list from which a element is to be extracted.  + This list must have at least index + 1 elements. +
+
index
+
+ The zero-based position in the list of the element to be extracted. +
+
+

Remarks

+
+ Previously, this macro could not be used inside BOOST_PP_WHILE.  + There is no longer any such restriction.  + It is more efficient, however, to use BOOST_PP_LIST_AT_D in such a situation. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/at.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/list/at.hpp>
+
+#define LIST (a, (b, (c, BOOST_PP_NIL)))
+
+BOOST_PP_LIST_AT(LIST, 0) // expands to a
+BOOST_PP_LIST_AT(LIST, 2) // expands to c
+
+ + diff --git a/doc/ref/list_at_d.html b/doc/ref/list_at_d.html new file mode 100644 index 0000000..d21bce3 --- /dev/null +++ b/doc/ref/list_at_d.html @@ -0,0 +1,52 @@ + + + BOOST_PP_LIST_AT_D + + + +
+ The BOOST_PP_LIST_AT_D macro extracts an element in a list.  + It reenters BOOST_PP_WHILE with maximum efficiency. +
+

Usage

+
+ BOOST_PP_LIST_AT_D(d, list, index) +
+

Arguments

+
+
d
+
+ The next available BOOST_PP_WHILE iteration. +
+
list
+
+ The list from which a element is to be extracted.  + This list must have at least index + 1 elements. +
+
index
+
+ The zero-based position in the list of the element to be extracted. +
+
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/at.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/control/while.hpp>
+#include <boost/preprocessor/list/at.hpp>
+
+#define LIST (7, (2, (0, (1, BOOST_PP_NIL))))
+
+#define PRED(d, state) BOOST_PP_LIST_AT_D(d, state, 0)
+#define OP(d, state) BOOST_PP_LIST_REST(state)
+
+BOOST_PP_WHILE(PRED, OP, LIST) // expands to (0, (1, BOOST_PP_NIL))
+
+ + diff --git a/doc/ref/list_cat.html b/doc/ref/list_cat.html new file mode 100644 index 0000000..69a8323 --- /dev/null +++ b/doc/ref/list_cat.html @@ -0,0 +1,47 @@ + + + BOOST_PP_LIST_CAT + + + +
+ The BOOST_PP_LIST_CAT macro concatenates all elements in a list. +
+

Usage

+
+ BOOST_PP_LIST_CAT(list) +
+

Arguments

+
+
list
+
+ The list whose elements are to be concatenated. +
+
+

Remarks

+
+ Elements are concatenated left-to-right starting with index 0. +
+
+ Previously, this macro could not be used inside BOOST_PP_WHILE.  + There is no longer any such restriction.  + It is more efficient, however, to use BOOST_PP_LIST_CAT_D in such a situation. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/cat.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/list/cat.hpp>
+
+#define LIST (a, (b, (c, BOOST_PP_NIL)))
+
+BOOST_PP_LIST_CAT(LIST) // expands to abc
+
+ + diff --git a/doc/ref/list_cat_d.html b/doc/ref/list_cat_d.html new file mode 100644 index 0000000..9c9821e --- /dev/null +++ b/doc/ref/list_cat_d.html @@ -0,0 +1,56 @@ + + + BOOST_PP_LIST_CAT_D + + + +
+ The BOOST_PP_LIST_CAT_D macro concatenates all elements in a list.  + It reenters BOOST_PP_WHILE with maximum efficiency. +
+

Usage

+
+ BOOST_PP_LIST_CAT_D(d, list) +
+

Arguments

+
+
d
+
+ The next available BOOST_PP_WHILE iteration. +
+
list
+
+ The list whose elements are to be concatenated. +
+
+

Remarks

+
+ Elements are concatenated left-to-right starting with index 0. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/cat.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/list/cat.hpp>
+#include <boost/preprocessor/list/fold_left.hpp>
+
+#define LISTS \
+   ((a, (b, BOOST_PP_NIL)), \
+      ((d, (e, BOOST_PP_NIL)), \
+         ((e, (f, BOOST_PP_NIL)), \
+            BOOST_PP_NIL))) \
+   /**/
+
+#define OP(d, state, x) BOOST_PP_CAT(state, BOOST_PP_LIST_CAT_D(d, x))
+
+BOOST_PP_LIST_FOLD_LEFT(OP, _, LISTS) // expands to _abcdef
+
+ + diff --git a/doc/ref/list_cons.html b/doc/ref/list_cons.html new file mode 100644 index 0000000..85cdf7e --- /dev/null +++ b/doc/ref/list_cons.html @@ -0,0 +1,76 @@ + + + BOOST_PP_LIST_CONS + + + +
+ The BOOST_PP_LIST_CONS macro is a list constructor. +
+

Usage

+
+ BOOST_PP_LIST_CONS(head, tail) +
+

Arguments

+
+
head
+
+ An element in a list. +
+
tail
+
+ Either a list, BOOST_PP_LIST_NIL, or BOOST_PP_NIL. +
+
+

Remarks

+
+ This macro appends a new head to an existing list or creates a list from BOOST_PP_LIST_NIL. +
+
+ This macro is no longer necessary.  + For example... +
+ BOOST_PP_LIST_CONS(a, BOOST_PP_LIST_CONS(b, BOOST_PP_LIST_NIL))) +
+ ...is just an explicit way of writing the following: +
+ (a, (b, BOOST_PP_NIL)) +
+ Because of this, this macro is deprecated. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/adt.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/list/adt.hpp>
+
+#define OLD \
+   BOOST_PP_LIST_CONS( \
+      a, \
+      BOOST_PP_LIST_CONS( \
+         b, \
+         BOOST_PP_LIST_CONS( \
+            c, \
+            BOOST_PP_LIST_NIL \
+         ) \
+      ) \
+   ) \
+   /**/
+
+#define NEW (a, (b, (c, BOOST_PP_NIL)))
+
+BOOST_PP_LIST_FIRST(OLD) == BOOST_PP_LIST_FIRST(NEW)
+   // expands to a == a
+
+BOOST_PP_LIST_REST(OLD) == BOOST_PP_LIST_REST(NEW)
+   // expands to (b, (c, BOOST_PP_NIL)) == (b, (c, BOOST_PP_NIL))
+
+ + diff --git a/doc/ref/list_enum.html b/doc/ref/list_enum.html new file mode 100644 index 0000000..cb810ef --- /dev/null +++ b/doc/ref/list_enum.html @@ -0,0 +1,51 @@ + + + BOOST_PP_LIST_ENUM + + + +
+ The BOOST_PP_LIST_ENUM macro converts a list to a comma-separated list. +
+

Usage

+
+ BOOST_PP_LIST_ENUM(list) +
+

Arguments

+
+
list
+
+ The list to be converted. +
+
+

Remarks

+
+ If list is, for example, (a, (b, (c, BOOST_PP_NIL))), + this macro will produce: +
+ a, b, c +
+
+
+ Previously, this macro could not be used inside BOOST_PP_FOR.  + There is no longer any such restriction.  + It is more efficient, however, to use BOOST_PP_LIST_ENUM_R in such a situation. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/enum.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/list/enum.hpp>
+
+#define LIST (w, (x, (y, (z, BOOST_PP_NIL))))
+
+BOOST_PP_LIST_ENUM(LIST) // expands to w, x, y, z
+
+ + diff --git a/doc/ref/list_enum_r.html b/doc/ref/list_enum_r.html new file mode 100644 index 0000000..9ee0391 --- /dev/null +++ b/doc/ref/list_enum_r.html @@ -0,0 +1,58 @@ + + + BOOST_PP_LIST_ENUM_R + + + +
+ The BOOST_PP_LIST_ENUM_R macro converts a list to a comma-separated list.  + It reenters BOOST_PP_FOR with maximum efficiency. +
+

Usage

+
+ BOOST_PP_LIST_ENUM_R(r, list) +
+

Arguments

+
+
r
+
+ The next available BOOST_PP_FOR repetition. +
+
list
+
+ The list to be converted. +
+
+

Remarks

+
+ If list is, for example, (a, (b, (c, BOOST_PP_NIL))), + this macro will produce: +
+ a, b, c +
+
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/enum.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/list/adt.hpp>
+#include <boost/preprocessor/repetition/for.hpp>
+#include <boost/preprocessor/list/enum.hpp>
+
+#define LIST (x, (y, (z, BOOST_PP_NIL)))
+
+#define PRED(r, state) BOOST_PP_LIST_IS_CONS(state)
+#define OP(r, state) BOOST_PP_LIST_REST(state)
+#define MACRO(r, state) [ BOOST_PP_LIST_ENUM_R(r, state) ]
+
+BOOST_PP_FOR(LIST, PRED, OP, MACRO)
+   // expands to [x, y, z] [y, z] [z]
+
+ + diff --git a/doc/ref/list_filter.html b/doc/ref/list_filter.html new file mode 100644 index 0000000..e8166fc --- /dev/null +++ b/doc/ref/list_filter.html @@ -0,0 +1,65 @@ + + + BOOST_PP_LIST_FILTER + + + +
+ The BOOST_PP_LIST_FILTER macro filters a list according to a supplied criterion. +
+

Usage

+
+ BOOST_PP_LIST_FILTER(pred, data, list) +
+

Arguments

+
+
pred
+
+ A ternary predicate of the form pred(d, data, elem).  + This predicate is expanded by BOOST_PP_LIST_FILTER for each element in list with the next available BOOST_PP_WHILE iteration, + the auxiliary data, and the current element in list.  + This macro must return a integral value in the range of 0 to BOOST_PP_LIMIT_MAG.  + If this predicate expands to non-zero for a certain element, that element is included in the resulting list. +
+
data
+
+ Auxiliary data passed to pred. +
+
list
+
+ The list to be filtered. +
+
+

Remarks

+
+ This macro expands pred for each element in list.  + It builds a new list out of each element for which pred returns non-zero. +
+
+ Previously, this macro could not be used inside BOOST_PP_WHILE.  + There is no longer any such restriction.  + It is more efficient, however, to use BOOST_PP_LIST_FILTER_D in such a situation. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/filter.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/comparison/less_equal.hpp>
+#include <boost/preprocessor/list/filter.hpp>
+
+#define LIST (1, (3, (2, (5, BOOST_PP_NIL))))
+
+#define PRED(d, data, elem) BOOST_PP_LESS_EQUAL(elem, data)
+
+BOOST_PP_LIST_FILTER(PRED, 3, LIST)
+   // expands to (1, (3, (2, BOOST_PP_NIL)))
+
+ + diff --git a/doc/ref/list_filter_d.html b/doc/ref/list_filter_d.html new file mode 100644 index 0000000..2ccda15 --- /dev/null +++ b/doc/ref/list_filter_d.html @@ -0,0 +1,75 @@ + + + BOOST_PP_LIST_FILTER_D + + + +
+ The BOOST_PP_LIST_FILTER_D macro filters a list according to a supplied criterion.  + It reenters BOOST_PP_WHILE with maximum efficiency. +
+

Usage

+
+ BOOST_PP_LIST_FILTER_D(d, pred, data, list) +
+

Arguments

+
+
d
+
+ The next available BOOST_PP_WHILE iteration. +
+
pred
+
+ A ternary predicate of the form pred(d, data, elem).  + This predicate is expanded by BOOST_PP_LIST_FILTER for each element in list with the next available BOOST_PP_WHILE iteration, + the auxiliary data, and the current element in list.  + This macro must return a integral value in the range of 0 to BOOST_PP_LIMIT_MAG.  + If this predicate expands to non-zero for a certain element, that element is included in the resulting list. +
+
data
+
+ Auxiliary data passed to pred. +
+
list
+
+ The list to be filtered. +
+
+

Remarks

+
+ This macro expands pred for each element in list.  + It builds a new list out of each element for which pred returns non-zero. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/filter.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/comparison/less_equal.hpp>
+#include <boost/preprocessor/list/filter.hpp>
+#include <boost/preprocessor/list/fold_right.hpp>
+
+#define A (1, (2, (3, (4, BOOST_PP_NIL))))
+#define B (A, (A, (A, (A, BOOST_PP_NIL))))
+
+#define PRED(d, data, x) BOOST_PP_LESS_EQUAL(x, data)
+#define OP(d, state, x) (BOOST_PP_LIST_FILTER_D(d, PRED, 2, x), state)
+
+BOOST_PP_LIST_FOLD_RIGHT(OP, BOOST_PP_NIL, B)
+/*
+   expands to:
+   ((1, (2, BOOST_PP_NIL)), 
+   ((1, (2, BOOST_PP_NIL)), 
+   ((1, (2, BOOST_PP_NIL)), 
+   ((1, (2, BOOST_PP_NIL)), 
+      BOOST_PP_NIL))))
+*/
+
+ + diff --git a/doc/ref/list_first.html b/doc/ref/list_first.html new file mode 100644 index 0000000..7b10152 --- /dev/null +++ b/doc/ref/list_first.html @@ -0,0 +1,51 @@ + + + BOOST_PP_LIST_FIRST + + + +
+ The BOOST_PP_LIST_FIRST macro expands to the head of a list. +
+

Usage

+
+ BOOST_PP_LIST_FIRST(list) +
+

Arguments

+
+
list
+
+ A non-nil list. +
+
+

Requirements

+
+ Header:  <boost/preprocessor/list/adt.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/list/adt.hpp>
+
+#define OLD \
+   BOOST_PP_LIST_CONS( \
+      a, \
+      BOOST_PP_LIST_CONS( \
+         b, \
+         BOOST_PP_LIST_CONS( \
+            c, \
+            BOOST_PP_LIST_NIL \
+         ) \
+      ) \
+   ) \
+   /**/
+
+#define NEW (a, (b, (c, BOOST_PP_NIL)))
+
+BOOST_PP_LIST_FIRST(OLD) == BOOST_PP_LIST_FIRST(NEW)
+   // expands to a == a
+
+BOOST_PP_LIST_REST(OLD) == BOOST_PP_LIST_REST(NEW)
+   // expands to (b, (c, BOOST_PP_NIL)) == (b, (c, BOOST_PP_NIL))
+
+ + diff --git a/doc/ref/list_first_n.html b/doc/ref/list_first_n.html new file mode 100644 index 0000000..6aa3cc2 --- /dev/null +++ b/doc/ref/list_first_n.html @@ -0,0 +1,51 @@ + + + BOOST_PP_LIST_FIRST_N + + + +
+ The BOOST_PP_LIST_FIRST_N macro expands to a list of the first count elements of a list. +
+

Usage

+
+ BOOST_PP_LIST_FIRST_N(count, list) +
+

Arguments

+
+
count
+
+ The number of elements to extract. +
+
list
+
+ The list from which the elements are extracted. +
+
+

Remarks

+
+ This macro extracts count elements from the beginning of list and returns them as a list +
+
+ Previously, this macro could not be used inside BOOST_PP_WHILE.  + There is no longer any such restriction.  + It is more efficient, however, to use BOOST_PP_LIST_FIRST_N_D in such a situation. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/first_n.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/list/first_n.hpp>
+
+#define LIST (a, (b, (c, BOOST_PP_NIL)))
+
+BOOST_PP_LIST_FIRST_N(2, LIST) // expands to (a, (b, BOOST_PP_NIL))
+
+ + diff --git a/doc/ref/list_first_n_d.html b/doc/ref/list_first_n_d.html new file mode 100644 index 0000000..d8eb277 --- /dev/null +++ b/doc/ref/list_first_n_d.html @@ -0,0 +1,60 @@ + + + BOOST_PP_LIST_FIRST_N_D + + + +
+ The BOOST_PP_LIST_FIRST_N_D macro expands to a list of the first count elements of a list.  + It reenters BOOST_PP_WHILE with maximum efficiency. +
+

Usage

+
+ BOOST_PP_LIST_FIRST_N_D(d, count, list) +
+

Arguments

+
+
d
+
+ The next available BOOST_PP_WHILE iteration. +
+
count
+
+ The number of elements to extract. +
+
list
+
+ The list from which the elements are extracted. +
+
+

Remarks

+
+ This macro extracts count elements from the beginning of list and returns them as a list +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/first_n.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/list/first_n.hpp>
+#include <boost/preprocessor/list/fold_right.hpp>
+
+#define L1 (a, (b, (c, (d, BOOST_PP_NIL))))
+#define L2 (L1, (L1, (L1, BOOST_PP_NIL)))
+
+#define OP(d, state, x) (BOOST_PP_LIST_FIRST_N_D(d, 2, x), state)
+
+BOOST_PP_LIST_FOLD_RIGHT(OP, BOOST_PP_NIL, L2)
+/*
+   expands to...
+   ((a, (b, BOOST_PP_NIL)), ((a, (b, BOOST_PP_NIL)),
+   ((a, (b, BOOST_PP_NIL)) , BOOST_PP_NIL )))
+*/
+
+ + diff --git a/doc/ref/list_fold_left.html b/doc/ref/list_fold_left.html new file mode 100644 index 0000000..ca8a314 --- /dev/null +++ b/doc/ref/list_fold_left.html @@ -0,0 +1,64 @@ + + + BOOST_PP_LIST_FOLD_LEFT + + + +
+ The BOOST_PP_LIST_FOLD_LEFT macro folds (or accumulates) the elements of a list left-to-right. +
+

Usage

+
+ BOOST_PP_LIST_FOLD_LEFT(op, state, list) +
+

Arguments

+
+
op
+
+ A ternary operation of the form op(d, state, elem).  + This macro is called for each element in list--each time returning a new state.  + This operation is expanded by BOOST_PP_LIST_FOLD_LEFT with the next available BOOST_PP_WHILE iteration, + the current state, and the current element. +
+
state
+
+ The initial state of the fold. +
+
list
+
+ The list to be folded. +
+
+

Remarks

+
+ For the list, (0, (1, (2, BOOST_PP_NIL))), this macro expands to: +
+ op(d, op(d, op(d, state, 0), 1), 2) +
+
+
+ Previously, this macro could not be used inside BOOST_PP_WHILE.  + There is no longer any such restriction.  + It is more efficient, however, to use BOOST_PP_LIST_FOLD_LEFT_d in such a situation. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/fold_left.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/list/fold_left.hpp>
+
+#define LIST (a, (b, (c, BOOST_PP_NIL)))
+
+#define OP(d, state, x) BOOST_PP_CAT(state, x)
+
+BOOST_PP_LIST_FOLD_LEFT(OP, _, LIST) // expands to _abc
+
+ + diff --git a/doc/ref/list_fold_left_2nd.html b/doc/ref/list_fold_left_2nd.html new file mode 100644 index 0000000..7284430 --- /dev/null +++ b/doc/ref/list_fold_left_2nd.html @@ -0,0 +1,64 @@ + + + BOOST_PP_LIST_FOLD_LEFT_2ND + + + +
+ The BOOST_PP_LIST_FOLD_LEFT_2ND macro folds (or accumulates) the elements of a list left-to-right. +
+

Usage

+
+ BOOST_PP_LIST_FOLD_LEFT_2ND(op, state, list) +
+

Arguments

+
+
op
+
+ A ternary operation of the form op(d, state, elem).  + This macro is called for each element in list--each time returning a new state.  + This operation is expanded by BOOST_PP_LIST_FOLD_LEFT with the next available BOOST_PP_WHILE iteration, + the current state, and the current element. +
+
state
+
+ The initial state of the fold. +
+
list
+
+ The list to be folded. +
+
+

Remarks

+
+ For the list, (0, (1, (2, BOOST_PP_NIL))), this macro expands to: +
+ op(d, op(d, op(d, state, 0), 1), 2) +
+
+
+ This macro is deprecated.  + Use BOOST_PP_LIST_FOLD_LEFT_d instead. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/fold_left.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/list/fold_left.hpp>
+
+#define LIST (a, (b, (c, BOOST_PP_NIL)))
+
+#define OP(d, state, x) BOOST_PP_CAT(state, x)
+
+BOOST_PP_LIST_FOLD_LEFT_2ND(OP, _, LIST) // expands to _abc
+
+ + diff --git a/doc/ref/list_fold_left_2nd_d.html b/doc/ref/list_fold_left_2nd_d.html new file mode 100644 index 0000000..3a5a597 --- /dev/null +++ b/doc/ref/list_fold_left_2nd_d.html @@ -0,0 +1,75 @@ + + + BOOST_PP_LIST_FOLD_LEFT_2ND_D + + + +
+ The BOOST_PP_LIST_FOLD_LEFT_2ND_D macro folds (or accumulates) the elements of a list left-to-right.  + It reenters BOOST_PP_WHILE with maximum efficiency. +
+

Usage

+
+ BOOST_PP_LIST_FOLD_LEFT_2ND_D(d, op, state, list) +
+

Arguments

+
+
d
+
+ The next available BOOST_PP_WHILE iteration. +
+
op
+
+ A ternary operation of the form op(d, state, elem).  + This macro is called for each element in list--each time returning a new state.  + This operation is expanded by BOOST_PP_LIST_FOLD_LEFT with the next available BOOST_PP_WHILE iteration, + the current state, and the current element. +
+
state
+
+ The initial state of the fold. +
+
list
+
+ The list to be folded. +
+
+

Remarks

+
+ For the list, (0, (1, (2, BOOST_PP_NIL))), this macro expands to: +
+ op(d, op(d, op(d, state, 0), 1), 2) +
+
+
+ This macro has been superceded by BOOST_PP_LIST_FOLD_LEFT_d and is deprecated.  + It only allows a single reentry into BOOST_PP_LIST_FOLD_LEFT. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/fold_left.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/list/fold_left.hpp>
+
+#define L1 (a, (b, (c, BOOST_PP_NIL)))
+#define L2 (L1, (L1, (L1, BOOST_PP_NIL)))
+
+#define OP(d, state, x) (BOOST_PP_LIST_FOLD_LEFT_2ND_D(d, OP_2, _, x), state)
+#define OP_2(d, state, x) BOOST_PP_CAT(state, x)
+
+BOOST_PP_LIST_FOLD_LEFT(OP, BOOST_PP_NIL, L2)
+/*
+   expands to:
+   (_abc , (_abc , (_abc , BOOST_PP_NIL)))
+*/
+
+ + diff --git a/doc/ref/list_fold_left_d.html b/doc/ref/list_fold_left_d.html new file mode 100644 index 0000000..d24e5e7 --- /dev/null +++ b/doc/ref/list_fold_left_d.html @@ -0,0 +1,70 @@ + + + BOOST_PP_LIST_FOLD_LEFT_d + + + +
+ The BOOST_PP_LIST_FOLD_LEFT_d macro folds (or accumulates) the elements of a list left-to-right.  + It reenters BOOST_PP_WHILE with maximum efficiency. +
+

Usage

+
+ BOOST_PP_LIST_FOLD_LEFT_ ## d(op, state, list) +
+

Arguments

+
+
d
+
+ The next available BOOST_PP_WHILE iteration. +
+
op
+
+ A ternary operation of the form op(d, state, elem).  + This macro is called for each element in list--each time returning a new state.  + This operation is expanded by BOOST_PP_LIST_FOLD_LEFT with the next available BOOST_PP_WHILE iteration, + the current state, and the current element. +
+
state
+
+ The initial state of the fold. +
+
list
+
+ The list to be folded. +
+
+

Remarks

+
+ For the list, (0, (1, (2, BOOST_PP_NIL))), this macro expands to: +
+ op(d, op(d, op(d, state, 0), 1), 2) +
+
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/fold_left.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/list/fold_left.hpp>
+
+#define L1 (a, (b, (c, BOOST_PP_NIL)))
+#define L2 (L1, (L1, (L1, BOOST_PP_NIL)))
+
+#define OP(d, state, x) (BOOST_PP_LIST_FOLD_LEFT_ ## d(OP_2, _, x), state)
+#define OP_2(d, state, x) BOOST_PP_CAT(state, x)
+
+BOOST_PP_LIST_FOLD_LEFT(OP, BOOST_PP_NIL, L2)
+/*
+   expands to:
+   (_abc, (_abc, (_abc, BOOST_PP_NIL)))
+*/
+
+ + diff --git a/doc/ref/list_fold_left_d_old.html b/doc/ref/list_fold_left_d_old.html new file mode 100644 index 0000000..d56d4e4 --- /dev/null +++ b/doc/ref/list_fold_left_d_old.html @@ -0,0 +1,75 @@ + + + BOOST_PP_LIST_FOLD_LEFT_D + + + +
+ The BOOST_PP_LIST_FOLD_LEFT_D macro folds (or accumulates) the elements of a list left-to-right.  + It reenters BOOST_PP_WHILE with maximum efficiency. +
+

Usage

+
+ BOOST_PP_LIST_FOLD_LEFT_D(d, op, state, list) +
+

Arguments

+
+
d
+
+ The next available BOOST_PP_WHILE iteration. +
+
op
+
+ A ternary operation of the form op(d, state, elem).  + This macro is called for each element in list--each time returning a new state.  + This operation is expanded by BOOST_PP_LIST_FOLD_LEFT with the next available BOOST_PP_WHILE iteration, + the current state, and the current element. +
+
state
+
+ The initial state of the fold. +
+
list
+
+ The list to be folded. +
+
+

Remarks

+
+ For the list, (0, (1, (2, BOOST_PP_NIL))), this macro expands to: +
+ op(d, op(d, op(d, state, 0), 1), 2) +
+
+
+ This macro has been superceded by BOOST_PP_LIST_FOLD_LEFT_d and is deprecated.  + It only allows a single reentry into BOOST_PP_LIST_FOLD_LEFT. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/fold_left.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/list/fold_left.hpp>
+
+#define L1 (a, (b, (c, BOOST_PP_NIL)))
+#define L2 (L1, (L1, (L1, BOOST_PP_NIL)))
+
+#define OP(d, state, x) (BOOST_PP_LIST_FOLD_LEFT_D(d, OP_2, _, x), state)
+#define OP_2(d, state, x) BOOST_PP_CAT(state, x)
+
+BOOST_PP_LIST_FOLD_LEFT(OP, BOOST_PP_NIL, L2)
+/*
+   expands to:
+   (_abc, (_abc, (_abc, BOOST_PP_NIL)))
+*/
+
+ + diff --git a/doc/ref/list_fold_right.html b/doc/ref/list_fold_right.html new file mode 100644 index 0000000..991b41f --- /dev/null +++ b/doc/ref/list_fold_right.html @@ -0,0 +1,68 @@ + + + BOOST_PP_LIST_FOLD_RIGHT + + + +
+ The BOOST_PP_LIST_FOLD_RIGHT macro folds (or accumulates) the elements of a list right-to-left. +
+

Usage

+
+ BOOST_PP_LIST_FOLD_RIGHT(op, state, list) +
+

Arguments

+
+
op
+
+ A ternary operation of the form op(d, state, elem).  + This macro is called for each element in list--each time returning a new state.  + This operation is expanded by BOOST_PP_LIST_FOLD_RIGHT with the next available BOOST_PP_WHILE iteration, + the current state, and the current element. +
+
state
+
+ The initial state of the fold. +
+
list
+
+ The list to be folded. +
+
+

Remarks

+
+ This macro does not have the same signature as it previously did.  + The arguments have been swapped to provide a uniform interface with BOOST_PP_LIST_FOLD_LEFT. +
+
+ For the list, (0, (1, (2, BOOST_PP_NIL))), this macro expands to: +
+ op(d, op(d, op(d, state, 2), 1), 0) +
+
+
+ Previously, this macro could not be used inside BOOST_PP_WHILE.  + There is no longer any such restriction.  + It is more efficient, however, to use BOOST_PP_LIST_FOLD_RIGHT_d in such a situation. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/fold_right.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/list/fold_right.hpp>
+
+#define LIST (a, (b, (c, BOOST_PP_NIL)))
+
+#define OP(d, state, x) BOOST_PP_CAT(state, x)
+
+BOOST_PP_LIST_FOLD_RIGHT(OP, _, LIST) // expands to _cba
+
+ + diff --git a/doc/ref/list_fold_right_2nd.html b/doc/ref/list_fold_right_2nd.html new file mode 100644 index 0000000..7bcaee2 --- /dev/null +++ b/doc/ref/list_fold_right_2nd.html @@ -0,0 +1,68 @@ + + + BOOST_PP_LIST_FOLD_RIGHT_2ND + + + +
+ The BOOST_PP_LIST_FOLD_RIGHT_2ND macro folds (or accumulates) the elements of a list right-to-left. +
+

Usage

+
+ BOOST_PP_LIST_FOLD_RIGHT_2ND(op, state, list) +
+

Arguments

+
+
op
+
+ A ternary operation of the form op(d, state, elem).  + This macro is called for each element in list--each time returning a new state.  + This operation is expanded by BOOST_PP_LIST_FOLD_RIGHT with the next available BOOST_PP_WHILE iteration, + the current state, and the current element. +
+
state
+
+ The initial state of the fold. +
+
list
+
+ The list to be folded. +
+
+

Remarks

+
+ This macro does not have the same signature as it previously did.  + The arguments have been swapped to provide a uniform interface with BOOST_PP_LIST_FOLD_LEFT. +
+
+ For the list, (0, (1, (2, BOOST_PP_NIL))), this macro expands to: +
+ op(d, op(d, op(d, state, 0), 1), 2) +
+
+
+ This macro is deprecated.  + Use BOOST_PP_LIST_FOLD_RIGHT_d instead. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/fold_right.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/list/fold_right.hpp>
+
+#define LIST (a, (b, (c, BOOST_PP_NIL)))
+
+#define OP(d, state, x) BOOST_PP_CAT(state, x)
+
+BOOST_PP_LIST_FOLD_RIGHT_2ND(OP, _, LIST) // expands to _cba
+
+ + diff --git a/doc/ref/list_fold_right_2nd_d.html b/doc/ref/list_fold_right_2nd_d.html new file mode 100644 index 0000000..ece48e1 --- /dev/null +++ b/doc/ref/list_fold_right_2nd_d.html @@ -0,0 +1,75 @@ + + + BOOST_PP_LIST_FOLD_RIGHT_2ND_D + + + +
+ The BOOST_PP_LIST_FOLD_RIGHT_2ND_D macro folds (or accumulates) the elements of a list right-to-left.  + It reenters BOOST_PP_WHILE with maximum efficiency. +
+

Usage

+
+ BOOST_PP_LIST_FOLD_RIGHT_2ND_D(d, op, state, list) +
+

Arguments

+
+
d
+
+ The next available BOOST_PP_WHILE iteration. +
+
op
+
+ A ternary operation of the form op(d, state, elem).  + This macro is called for each element in list--each time returning a new state.  + This operation is expanded by BOOST_PP_LIST_FOLD_RIGHT with the next available BOOST_PP_WHILE iteration, + the current state, and the current element. +
+
state
+
+ The initial state of the fold. +
+
list
+
+ The list to be folded. +
+
+

Remarks

+
+ For the list, (0, (1, (2, BOOST_PP_NIL))), this macro expands to: +
+ op(d, op(d, op(d, state, 0), 1), 2) +
+
+
+ This macro has been superceded by BOOST_PP_LIST_FOLD_RIGHT_d and is deprecated.  + It only allows a single reentry into BOOST_PP_LIST_FOLD_RIGHT. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/fold_right.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/list/fold_right.hpp>
+
+#define L1 (a, (b, (c, BOOST_PP_NIL)))
+#define L2 (L1, (L1, (L1, BOOST_PP_NIL)))
+
+#define OP(d, state, x) (BOOST_PP_LIST_FOLD_RIGHT_2ND_D(d, OP_2, _, x), state)
+#define OP_2(d, state, x) BOOST_PP_CAT(state, x)
+
+BOOST_PP_LIST_FOLD_RIGHT(OP, BOOST_PP_NIL, L2)
+/*
+   expands to:
+   (_cba , (_cba , (_cba , BOOST_PP_NIL)))
+*/
+
+ + diff --git a/doc/ref/list_fold_right_d.html b/doc/ref/list_fold_right_d.html new file mode 100644 index 0000000..9555498 --- /dev/null +++ b/doc/ref/list_fold_right_d.html @@ -0,0 +1,70 @@ + + + BOOST_PP_LIST_FOLD_RIGHT_d + + + +
+ The BOOST_PP_LIST_FOLD_RIGHT_d macro folds (or accumulates) the elements of a list right-to-left.  + It reenters BOOST_PP_WHILE with maximum efficiency. +
+

Usage

+
+ BOOST_PP_LIST_FOLD_RIGHT_ ## d(op, state, list) +
+

Arguments

+
+
d
+
+ The next available BOOST_PP_WHILE iteration. +
+
op
+
+ A ternary operation of the form op(d, state, elem).  + This macro is called for each element in list--each time returning a new state.  + This operation is expanded by BOOST_PP_LIST_FOLD_RIGHT with the next available BOOST_PP_WHILE iteration, + the current state, and the current element. +
+
state
+
+ The initial state of the fold. +
+
list
+
+ The list to be folded. +
+
+

Remarks

+
+ For the list, (0, (1, (2, BOOST_PP_NIL))), this macro expands to: +
+ op(d, op(d, op(d, state, 2), 1), 0) +
+
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/fold_right.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/list/fold_right.hpp>
+
+#define L1 (a, (b, (c, BOOST_PP_NIL)))
+#define L2 (L1, (L1, (L1, BOOST_PP_NIL)))
+
+#define OP(d, state, x) (BOOST_PP_LIST_FOLD_RIGHT_ ## d(OP_2, _, x), state)
+#define OP_2(d, state, x) BOOST_PP_CAT(state, x)
+
+BOOST_PP_LIST_FOLD_RIGHT(OP, BOOST_PP_NIL, L2)
+/*
+   expands to:
+   (_cba, (_cba, (_cba, BOOST_PP_NIL)))
+*/
+
+ + diff --git a/doc/ref/list_fold_right_d_old.html b/doc/ref/list_fold_right_d_old.html new file mode 100644 index 0000000..c13256f --- /dev/null +++ b/doc/ref/list_fold_right_d_old.html @@ -0,0 +1,79 @@ + + + BOOST_PP_LIST_FOLD_RIGHT_D + + + +
+ The BOOST_PP_LIST_FOLD_RIGHT_D macro folds (or accumulates) the elements of a list right-to-left.  + It reenters BOOST_PP_WHILE with maximum efficiency. +
+

Usage

+
+ BOOST_PP_LIST_FOLD_RIGHT_D(d, op, state, list) +
+

Arguments

+
+
d
+
+ The next available BOOST_PP_WHILE iteration. +
+
op
+
+ A ternary operation of the form op(d, state, elem).  + This macro is called for each element in list--each time returning a new state.  + This operation is expanded by BOOST_PP_LIST_FOLD_RIGHT with the next available BOOST_PP_WHILE iteration, + the current state, and the current element. +
+
state
+
+ The initial state of the fold. +
+
list
+
+ The list to be folded. +
+
+

Remarks

+
+ This macro does not have the same signature as it previously did.  + The arguments have been swapped to provide a uniform interface with BOOST_PP_LIST_FOLD_LEFT. +
+
+ For the list, (0, (1, (2, BOOST_PP_NIL))), this macro expands to: +
+ op(d, op(d, op(d, state, 2), 1), 0) +
+
+
+ This macro has been superceded by BOOST_PP_LIST_FOLD_RIGHT_d and is deprecated.  + It only allows a single reentry into BOOST_PP_LIST_FOLD_RIGHT. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/fold_right.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/list/fold_right.hpp>
+
+#define L1 (a, (b, (c, BOOST_PP_NIL)))
+#define L2 (L1, (L1, (L1, BOOST_PP_NIL)))
+
+#define OP(d, state, x) (BOOST_PP_LIST_FOLD_RIGHT_D(d, OP_2, _, x), state)
+#define OP_2(d, state, x) BOOST_PP_CAT(state, x)
+
+BOOST_PP_LIST_FOLD_RIGHT(OP, BOOST_PP_NIL, L2)
+/*
+   expands to:
+   (_cba, (_cba, (_cba, BOOST_PP_NIL)))
+*/
+
+ + diff --git a/doc/ref/list_for_each.html b/doc/ref/list_for_each.html new file mode 100644 index 0000000..0ac7953 --- /dev/null +++ b/doc/ref/list_for_each.html @@ -0,0 +1,64 @@ + + + BOOST_PP_LIST_FOR_EACH + + + +
+ The BOOST_PP_LIST_FOR_EACH macro repeats a macro for each element in a list. +
+

Usage

+
+ BOOST_PP_LIST_FOR_EACH(macro, data, list) +
+

Arguments

+
+
macro
+
+ A ternary macro of the form macro(r, data, elem).  + This macro is expanded by BOOST_PP_LIST_FOR_EACH with each element in list.  + It is expanded with the next available BOOST_PP_FOR repetition, the auxiliary data, and the current element. +
+
data
+
+ Auxiliary data passed to macro. +
+
list
+
+ The list for which macro will be invoked on each element. +
+
+

Remarks

+
+ This macro is a repetition construct.  + If list is (a, (b, (c, BOOST_PP_NIL))), it expands to the sequence: +
+ macro(r, data, a) macro(r, data, b) macro(r, data, c) +
+
+
+ Previously, this macro could not be used inside BOOST_PP_FOR.  + There is no longer any such restriction.  + It is more efficient, however, to use BOOST_PP_LIST_FOR_EACH_R in such a situation. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/for_each.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/list/for_each.hpp>
+
+#define LIST (w, (x, (y, (z, BOOST_PP_NIL))))
+
+#define MACRO(r, data, elem) BOOST_PP_CAT(elem, data)
+
+BOOST_PP_LIST_FOR_EACH(MACRO, _, LIST) // expands to w_ x_ y_ z_
+
+ + diff --git a/doc/ref/list_for_each_i.html b/doc/ref/list_for_each_i.html new file mode 100644 index 0000000..99a5464 --- /dev/null +++ b/doc/ref/list_for_each_i.html @@ -0,0 +1,64 @@ + + + BOOST_PP_LIST_FOR_EACH_I + + + +
+ The BOOST_PP_LIST_FOR_EACH_I macro repeats a macro for each element in a list. +
+

Usage

+
+ BOOST_PP_LIST_FOR_EACH_I(macro, data, list) +
+

Arguments

+
+
macro
+
+ A macro of the form macro(r, data, i, elem).  + This macro is expanded by BOOST_PP_LIST_FOR_EACH with each element in list.  + It is expanded with the next available BOOST_PP_FOR repetition, the auxiliary data, the index of the current element, and the current element. +
+
data
+
+ Auxiliary data passed to macro. +
+
list
+
+ The list for which macro will be invoked on each element. +
+
+

Remarks

+
+ This macro is a repetition construct.  + If list is (a, (b, (c, BOOST_PP_NIL))), it expands to the sequence: +
+ macro(r, data, 0, a) macro(r, data, 1, b) macro(r, data, 2, c) +
+
+
+ Previously, this macro could not be used inside BOOST_PP_FOR.  + There is no longer any such restriction.  + It is more efficient, however, to use BOOST_PP_LIST_FOR_EACH_I_R in such a situation. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/for_each_i.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/list/for_each_i.hpp>
+
+#define LIST (w, (x, (y, (z, BOOST_PP_NIL))))
+
+#define MACRO(r, data, i, elem) BOOST_PP_CAT(elem, BOOST_PP_CAT(data, i))
+
+BOOST_PP_LIST_FOR_EACH_I(MACRO, _, LIST) // expands to w_0 x_1 y_2 z_3
+
+ + diff --git a/doc/ref/list_for_each_i_r.html b/doc/ref/list_for_each_i_r.html new file mode 100644 index 0000000..5bf0b33 --- /dev/null +++ b/doc/ref/list_for_each_i_r.html @@ -0,0 +1,71 @@ + + + BOOST_PP_LIST_FOR_EACH_I_R + + + +
+ The BOOST_PP_LIST_FOR_EACH_I_R macro repeats a macro for each element in a list.  + It reenters BOOST_PP_FOR with maximum efficiency. +
+

Usage

+
+ BOOST_PP_LIST_FOR_EACH_I_R(r, macro, data, list) +
+

Arguments

+
+
r
+
+ The next available BOOST_PP_FOR repetition. +
+
macro
+
+ A macro of the for macro(r, data, i, elem).  + This macro is expanded by BOOST_PP_LIST_FOR_EACH_I with each element in list.  + It is expanded with the next available BOOST_PP_FOR repetition, the auxiliary data, the index of the current element, and the current element. +
+
data
+
+ Auxiliary data passed to macro. +
+
list
+
+ The list for which macro will be invoked on each element. +
+
+

Remarks

+
+ This macro is a repetition construct.  + If list is (a, (b, (c, BOOST_PP_NIL))), it expands to the sequence: +
+ macro(r, data, 0, a) macro(r, data, 1, b) macro(r, data, 2, c) +
+
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/for_each_i.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/list/adt.hpp>
+#include <boost/preprocessor/list/for_each_i.hpp>
+#include <boost/preprocessor/repetition/for.hpp>
+
+#define LIST (x, (y, (z, BOOST_PP_NIL)))
+
+#define MACRO_2(r, data, i, elem) BOOST_PP_CAT(elem, i)
+
+#define PRED(r, state) BOOST_PP_LIST_IS_CONS(state)
+#define OP(r, state) BOOST_PP_LIST_REST(state)
+#define MACRO(r, state) [ BOOST_PP_LIST_FOR_EACH_I_R(r, MACRO_2, _, state) ]
+
+BOOST_PP_FOR(LIST, PRED, OP, MACRO)
+   // expands to [x0 y1 z2] [y0 z1] [z0]
+
+ + diff --git a/doc/ref/list_for_each_product.html b/doc/ref/list_for_each_product.html new file mode 100644 index 0000000..8b67736 --- /dev/null +++ b/doc/ref/list_for_each_product.html @@ -0,0 +1,75 @@ + + + BOOST_PP_LIST_FOR_EACH_PRODUCT + + + +
+ The BOOST_PP_LIST_FOR_EACH_PRODUCT macro repeats a macro for each cartesian product of several lists. +
+

Usage

+
+ BOOST_PP_LIST_FOR_EACH_PRODUCT(macro, size, tuple) +
+

Arguments

+
+
macro
+
+ The binary macro of the form macro(r, product).  + This macro is expanded by BOOST_PP_FOR_EACH_PRODUCT with each cartesian product in tuple.  + It is expanded with the next available BOOST_PP_FOR repetition and a tuple containing a cartesian product.  + This tuple will have size elements. +
+
size
+
+ The size of tuple. +
+
tuple
+
+ A tuple of lists from which cartesian products are obtained. +
+
+

Remarks

+
+ This macro is a repetition construct.  + If two lists are (a, (b, (c, BOOST_PP_NIL))) and (x, (y, (z, BOOST_PP_NIL))), + this macro will produce the following sequence: +
+ macro(r, (a, x)) + macro(r, (a, y)) + macro(r, (a, z))
+ macro(r, (b, x)) + macro(r, (b, y)) + macro(r, (b, z))
+ macro(r, (c, x)) + macro(r, (c, y)) + macro(r, (c, z)) +
+
+
+ Previously, this macro could not be used inside BOOST_PP_FOR.  + There is no longer any such restriction.  + It is more efficient, however, to use BOOST_PP_LIST_FOR_EACH_PRODUCT_R in such a situation. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/for_each_product.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/list/for_each_product.hpp>
+
+#define L1 (a, (b, (c, BOOST_PP_NIL)))
+#define L2 (x, (y, (z, BOOST_PP_NIL)))
+
+#define MACRO(r, product) product
+
+BOOST_PP_LIST_FOR_EACH_PRODUCT(MACRO, 2, (L1, L2))
+   // expands to (a, x) (a, y) (a, z) (b, x) (b, y) (b, z) (c, x) (c, y) (c, z)
+
+ + diff --git a/doc/ref/list_for_each_product_r.html b/doc/ref/list_for_each_product_r.html new file mode 100644 index 0000000..7fcd84e --- /dev/null +++ b/doc/ref/list_for_each_product_r.html @@ -0,0 +1,107 @@ + + + BOOST_PP_LIST_FOR_EACH_PRODUCT_R + + + +
+ The BOOST_PP_LIST_FOR_EACH_PRODUCT_R macro repeats a macro for each cartesian product of several lists.  + It reenters BOOST_PP_FOR with maximum efficiency. +
+

Usage

+
+ BOOST_PP_LIST_FOR_EACH_PRODUCT_R(r, macro, size, tuple) +
+

Arguments

+
+
r
+
+ The next available BOOST_PP_FOR repetition. +
+
macro
+
+ The binary macro of the form macro(r, product).  + This macro is expanded by BOOST_PP_FOR_EACH_PRODUCT with each cartesian product in tuple.  + It is expanded with the next available BOOST_PP_FOR repetition and a tuple containing a cartesian product.  + This tuple will have size elements. +
+
size
+
+ The size of tuple. +
+
tuple
+
+ A tuple of lists from which cartesian products are obtained. +
+
+

Remarks

+
+ This macro is a repetition construct.  + If two lists are (a, (b, (c, BOOST_PP_NIL))) and (x, (y, (z, BOOST_PP_NIL))), + this macro will produce the following sequence: +
+ macro(r, (a, x)) + macro(r, (a, y)) + macro(r, (a, z))
+ macro(r, (b, x)) + macro(r, (b, y)) + macro(r, (b, z))
+ macro(r, (c, x)) + macro(r, (c, y)) + macro(r, (c, z)) +
+
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/for_each_product.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/arithmetic/dec.hpp>
+#include <boost/preprocessor/list/for_each_product.hpp>
+#include <boost/preprocessor/repetition/for.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+
+#define L1 (a, (b, BOOST_PP_NIL))
+#define L2 (x, (y, BOOST_PP_NIL))
+
+#define PRED(r, state) BOOST_PP_TUPLE_ELEM(2, 0, state)
+
+#define OP(r, state) \
+   ( \
+      BOOST_PP_DEC( \
+         BOOST_PP_TUPLE_ELEM(2, 0, state) \
+      ), \
+      BOOST_PP_TUPLE_ELEM(2, 1, state) \
+   ) \
+   /**/
+
+#define MACRO(r, state) \
+   MACRO_I( \
+      r, \
+      BOOST_PP_TUPLE_ELEM(2, 0, state), \
+      BOOST_PP_TUPLE_ELEM(2, 1, state) \
+   ) \
+   /**/
+
+#define MACRO_I(r, c, t) \
+   BOOST_PP_LIST_FOR_EACH_PRODUCT_R( \
+      r, MACRO_P, 2, \
+      ( \
+         BOOST_PP_TUPLE_ELEM(2, BOOST_PP_DEC(c), t), \
+         BOOST_PP_TUPLE_ELEM(2, BOOST_PP_DEC(c), t) \
+      ) \
+   ) \
+   /**/
+
+#define MACRO_P(r, product) product
+
+BOOST_PP_FOR((2, (L1, L2)), PRED, OP, MACRO)
+   // expands to (x, x) (x, y) (y, x) (y, y) (a, a) (a, b) (b, a) (b, b)
+
+ + diff --git a/doc/ref/list_for_each_r.html b/doc/ref/list_for_each_r.html new file mode 100644 index 0000000..53e5f3b --- /dev/null +++ b/doc/ref/list_for_each_r.html @@ -0,0 +1,70 @@ + + + BOOST_PP_LIST_FOR_EACH_R + + + +
+ The BOOST_PP_LIST_FOR_EACH_R macro repeats a macro for each element in a list.  + It reenters BOOST_PP_FOR with maximum efficiency. +
+

Usage

+
+ BOOST_PP_LIST_FOR_EACH_R(r, macro, data, list) +
+

Arguments

+
+
r
+
+ The next available BOOST_PP_FOR repetition. +
+
macro
+
+ A ternary macro of the form macro(r, data, elem).  + This macro is expanded by BOOST_PP_LIST_FOR_EACH with each element in list.  + It is expanded with the next available BOOST_PP_FOR repetition, the auxiliary data, and the current element. +
+
data
+
+ Auxiliary data passed to macro. +
+
list
+
+ The list for which macro will be invoked on each element. +
+
+

Remarks

+
+ This macro is a repetition construct.  + If list is (a, (b, (c, BOOST_PP_NIL))), it expands to the sequence: +
+ macro(r, data, a) macro(r, data, b) macro(r, data, c) +
+
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/for_each.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/list/adt.hpp>
+#include <boost/preprocessor/list/for_each.hpp>
+#include <boost/preprocessor/repetition/for.hpp>
+
+#define LIST (x, (y, (z, BOOST_PP_NIL)))
+
+#define MACRO_2(r, data, elem) elem
+
+#define PRED(r, state) BOOST_PP_LIST_IS_CONS(state)
+#define OP(r, state) BOOST_PP_LIST_REST(state)
+#define MACRO(r, state) [ BOOST_PP_LIST_FOR_EACH_R(r, MACRO_2, _, state) ]
+
+BOOST_PP_FOR(LIST, PRED, OP, MACRO)
+   // expands to [x y z] [y z] [z]
+
+ + diff --git a/doc/ref/list_is_cons.html b/doc/ref/list_is_cons.html new file mode 100644 index 0000000..4638218 --- /dev/null +++ b/doc/ref/list_is_cons.html @@ -0,0 +1,40 @@ + + + BOOST_PP_LIST_IS_CONS + + + +
+ The BOOST_PP_LIST_IS_CONS macro is a predicate that determines if a list not nil. +
+

Usage

+
+ BOOST_PP_LIST_IS_CONS(list) +
+

Arguments

+
+
list
+
+ A list. +
+
+

Remarks

+
+ If list is non-nil, this macro expands to 1.  + Otherwise, it expands to 0. +
+

Requirements

+
+ Header:  <boost/preprocessor/list/adt.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/list/adt.hpp>
+
+#define LIST (a, BOOST_PP_NIL)
+
+BOOST_PP_LIST_IS_CONS(LIST) // expands to 1
+BOOST_PP_LIST_IS_CONS(BOOST_PP_LIST_REST(LIST)) // expands to 0
+
+ + diff --git a/doc/ref/list_is_nil.html b/doc/ref/list_is_nil.html new file mode 100644 index 0000000..47d4ba6 --- /dev/null +++ b/doc/ref/list_is_nil.html @@ -0,0 +1,40 @@ + + + BOOST_PP_LIST_IS_NIL + + + +
+ The BOOST_PP_LIST_IS_NIL macro is a predicate that determines if a list is nil. +
+

Usage

+
+ BOOST_PP_LIST_IS_NIL(list) +
+

Arguments

+
+
list
+
+ A list. +
+
+

Remarks

+
+ If list is nil, this macro expands to 1.  + Otherwise, it expands to 0. +
+

Requirements

+
+ Header:  <boost/preprocessor/list/adt.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/list/adt.hpp>
+
+#define LIST (a, BOOST_PP_NIL)
+
+BOOST_PP_LIST_IS_NIL(LIST) // expands to 0
+BOOST_PP_LIST_IS_NIL(BOOST_PP_LIST_REST(LIST)) // expands to 1
+
+ + diff --git a/doc/ref/list_nil.html b/doc/ref/list_nil.html new file mode 100644 index 0000000..5400964 --- /dev/null +++ b/doc/ref/list_nil.html @@ -0,0 +1,57 @@ + + + BOOST_PP_LIST_NIL + + + +
+ The BOOST_PP_LIST_NIL macro is a nil list constructor. +
+

Usage

+
+ BOOST_PP_LIST_NIL +
+

Remarks

+
+ This macro represents the end of a list. +
+
+ This macro is no longer necessary.  + It simply expands to BOOST_PP_NIL.  + Because of this, this macro is deprecated. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/adt.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/list/adt.hpp>
+
+#define OLD \
+   BOOST_PP_LIST_CONS( \
+      a, \
+      BOOST_PP_LIST_CONS( \
+         b, \
+         BOOST_PP_LIST_CONS( \
+            c, \
+            BOOST_PP_LIST_NIL \
+         ) \
+      ) \
+   ) \
+   /**/
+
+#define NEW (a, (b, (c, BOOST_PP_NIL)))
+
+BOOST_PP_LIST_FIRST(OLD) == BOOST_PP_LIST_FIRST(NEW)
+   // expands to a == a
+
+BOOST_PP_LIST_REST(OLD) == BOOST_PP_LIST_RESTK(NEW)
+   // expands to (b, (c, BOOST_PP_NIL)) == (b, (c, BOOST_PP_NIL))
+
+ + diff --git a/doc/ref/list_rest.html b/doc/ref/list_rest.html new file mode 100644 index 0000000..d26f3cb --- /dev/null +++ b/doc/ref/list_rest.html @@ -0,0 +1,51 @@ + + + BOOST_PP_LIST_REST + + + +
+ The BOOST_PP_LIST_REST macro expands to the tail of a list. +
+

Usage

+
+ BOOST_PP_LIST_REST(list) +
+

Arguments

+
+
list
+
+ A non-nil list. +
+
+

Requirements

+
+ Header:  <boost/preprocessor/list/adt.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/list/adt.hpp>
+
+#define OLD \
+   BOOST_PP_LIST_CONS( \
+      a, \
+      BOOST_PP_LIST_CONS( \
+         b, \
+         BOOST_PP_LIST_CONS( \
+            c, \
+            BOOST_PP_LIST_NIL \
+         ) \
+      ) \
+   ) \
+   /**/
+
+#define NEW (a, (b, (c, BOOST_PP_NIL)))
+
+BOOST_PP_LIST_FIRST(OLD) == BOOST_PP_LIST_FIRST(NEW)
+   // expands to a == a
+
+BOOST_PP_LIST_REST(OLD) == BOOST_PP_LIST_REST(NEW)
+   // expands to (b, (c, BOOST_PP_NIL)) == (b, (c, BOOST_PP_NIL))
+
+ + diff --git a/doc/ref/list_rest_n.html b/doc/ref/list_rest_n.html new file mode 100644 index 0000000..097ae2d --- /dev/null +++ b/doc/ref/list_rest_n.html @@ -0,0 +1,51 @@ + + + BOOST_PP_LIST_REST_N + + + +
+ The BOOST_PP_LIST_REST_N macro expands to a list of all but the first count elements of a list. +
+

Usage

+
+ BOOST_PP_LIST_REST_N(count, list) +
+

Arguments

+
+
count
+
+ The number of elements to remove from the beginning of list. +
+
list
+
+ The list from which the elements are extracted. +
+
+

Remarks

+
+ This macro removes count elements from the beginning of list and returns the remainder as a list +
+
+ Previously, this macro could not be used inside BOOST_PP_WHILE.  + There is no longer any such restriction.  + It is more efficient, however, to use BOOST_PP_LIST_REST_N_D in such a situation. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/rest_n.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/list/rest_n.hpp>
+
+#define LIST (a, (b, (c, (d, BOOST_PP_NIL))))
+
+BOOST_PP_LIST_REST_N(2, LIST) // expands to (c, (d, BOOST_PP_NIL))
+
+ + diff --git a/doc/ref/list_rest_n_d.html b/doc/ref/list_rest_n_d.html new file mode 100644 index 0000000..b241f75 --- /dev/null +++ b/doc/ref/list_rest_n_d.html @@ -0,0 +1,60 @@ + + + BOOST_PP_LIST_REST_N_D + + + +
+ The BOOST_PP_LIST_REST_N_D macro expands to a list of all but the first count elements of a list.  + It reenters BOOST_PP_WHILE with maximum efficiency. +
+

Usage

+
+ BOOST_PP_LIST_REST_N_D(d, count, list) +
+

Arguments

+
+
d
+
+ The next available BOOST_PP_WHILE iteration. +
+
count
+
+ The number of elements to remove from the beginning of list. +
+
list
+
+ The list from which the elements are extracted. +
+
+

Remarks

+
+ This macro removes count elements from the beginning of list and returns the remainder as a list +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/rest_n.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/list/fold_right.hpp>
+#include <boost/preprocessor/list/rest_n.hpp>
+
+#define L1 (a, (b, (c, (d, BOOST_PP_NIL))))
+#define L2 (L1, (L1, (L1, BOOST_PP_NIL)))
+
+#define OP(d, state, x) (BOOST_PP_LIST_REST_N_D(d, 2, x), state)
+
+BOOST_PP_LIST_FOLD_RIGHT(OP, BOOST_PP_NIL, L2)
+/*
+   expands to...
+   ((c, (d, BOOST_PP_NIL)), ((c, (d, BOOST_PP_NIL)),
+   ((c, (d, BOOST_PP_NIL)), BOOST_PP_NIL)))
+*/
+
+ + diff --git a/doc/ref/list_reverse.html b/doc/ref/list_reverse.html new file mode 100644 index 0000000..c4bf9bb --- /dev/null +++ b/doc/ref/list_reverse.html @@ -0,0 +1,44 @@ + + + BOOST_PP_LIST_REVERSE + + + +
+ The BOOST_PP_LIST_REVERSE macro expands to the reverse a list. +
+

Usage

+
+ BOOST_PP_LIST_REVERSE(list) +
+

Arguments

+
+
list
+
+ A list to be reversed. +
+
+

Remarks

+
+ Previously, this macro could not be used inside BOOST_PP_WHILE.  + There is no longer any such restriction.  + It is more efficient, however, to use BOOST_PP_LIST_REVERSE_D in such a situation. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/reverse.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/list/reverse.hpp>
+
+#define LIST (0, (1, (2, (3, BOOST_PP_NIL))))
+
+BOOST_PP_LIST_REVERSE(LIST) // expands to (3, (2, (1, (0, BOOST_PP_NIL))))
+
+ + diff --git a/doc/ref/list_reverse_d.html b/doc/ref/list_reverse_d.html new file mode 100644 index 0000000..e3e0e91 --- /dev/null +++ b/doc/ref/list_reverse_d.html @@ -0,0 +1,52 @@ + + + BOOST_PP_LIST_REVERSE_D + + + +
+ The BOOST_PP_LIST_REVERSE_D macro expands to the reverse a list.  + It reenters BOOST_PP_WHILE with maximum efficiency. +
+

Usage

+
+ BOOST_PP_LIST_REVERSE_D(d, list) +
+

Arguments

+
+
d
+
+ The next available BOOST_PP_WHILE iteration. +
+
list
+
+ A list to be reversed. +
+
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/reverse.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/list/fold_right.hpp>
+#include <boost/preprocessor/list/reverse.hpp>
+
+#define L1 (a, (b, (c, (d, BOOST_PP_NIL))))
+#define L2 (L1, (L1, (L1, BOOST_PP_NIL)))
+
+#define OP(d, state, x) (BOOST_PP_LIST_REVERSE_D(d, x), state)
+
+BOOST_PP_LIST_FOLD_RIGHT(OP, BOOST_PP_NIL, L2)
+/*
+   expands to...
+   ((d, (c, (b, (a, BOOST_PP_NIL)))), ((d, (c, (b, (a, BOOST_PP_NIL)))),
+   ((d, (c, (b, (a, BOOST_PP_NIL)))), BOOST_PP_NIL)))
+*/
+
+ + diff --git a/doc/ref/list_size.html b/doc/ref/list_size.html new file mode 100644 index 0000000..1f0d4f9 --- /dev/null +++ b/doc/ref/list_size.html @@ -0,0 +1,44 @@ + + + BOOST_PP_LIST_SIZE + + + +
+ The BOOST_PP_LIST_SIZE macro expands to the size of a list. +
+

Usage

+
+ BOOST_PP_LIST_SIZE(list) +
+

Arguments

+
+
list
+
+ A list whose size is to be calculated. +
+
+

Remarks

+
+ Previously, this macro could not be used inside BOOST_PP_WHILE.  + There is no longer any such restriction.  + It is more efficient, however, to use BOOST_PP_LIST_SIZE_D in such a situation. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/size.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/list/size.hpp>
+
+#define LIST (0, (1, (2, (3, BOOST_PP_NIL))))
+
+BOOST_PP_LIST_SIZE(LIST) // expands to 4
+
+ + diff --git a/doc/ref/list_size_d.html b/doc/ref/list_size_d.html new file mode 100644 index 0000000..e912356 --- /dev/null +++ b/doc/ref/list_size_d.html @@ -0,0 +1,56 @@ + + + BOOST_PP_LIST_SIZE_D + + + +
+ The BOOST_PP_LIST_SIZE_D macro expands to the size of a list.  + It reenters BOOST_PP_WHILE with maximum efficiency. +
+

Usage

+
+ BOOST_PP_LIST_SIZE_D(d, list) +
+

Arguments

+
+
d
+
+ The next available BOOST_PP_WHILE iteration. +
+
list
+
+ A list whose size is to be calculated. +
+
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/size.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/arithmetic/add.hpp>
+#include <boost/preprocessor/list/fold_left.hpp>
+#include <boost/preprocessor/list/size.hpp>
+
+#define L1 (a, (b, (c, BOOST_PP_NIL)))
+#define L2 (x, (y, BOOST_PP_NIL))
+#define L3 (p, (q, BOOST_PP_NIL))
+
+#define LIST (L1, (L2, (L3, BOOST_PP_NIL)))
+
+#define OP(d, state, x) \
+   BOOST_PP_ADD_D( \
+      d, state, \
+      BOOST_PP_LIST_SIZE_D(d, x) \
+   ) \
+   /**/
+
+BOOST_PP_LIST_FOLD_LEFT(OP, 0, LIST) // expands to 7
+
+ + diff --git a/doc/ref/list_to_tuple.html b/doc/ref/list_to_tuple.html new file mode 100644 index 0000000..e93574c --- /dev/null +++ b/doc/ref/list_to_tuple.html @@ -0,0 +1,51 @@ + + + BOOST_PP_LIST_TO_TUPLE + + + +
+ The BOOST_PP_LIST_TO_TUPLE macro converts a list to a tuple. +
+

Usage

+
+ BOOST_PP_LIST_TO_TUPLE(list) +
+

Arguments

+
+
list
+
+ The list to be converted. +
+
+

Remarks

+
+ If list is, for example, (a, (b, (c, BOOST_PP_NIL))), + this macro will produce: +
+ (a, b, c) +
+
+
+ Previously, this macro could not be used inside BOOST_PP_FOR.  + There is no longer any such restriction.  + It is more efficient, however, to use BOOST_PP_LIST_TO_TUPLE_R in such a situation. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/to_tuple.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/list/to_tuple.hpp>
+
+#define LIST (w, (x, (y, (z, BOOST_PP_NIL))))
+
+BOOST_PP_LIST_TO_TUPLE(LIST) // expands to (w, x, y, z)
+
+ + diff --git a/doc/ref/list_to_tuple_r.html b/doc/ref/list_to_tuple_r.html new file mode 100644 index 0000000..402b980 --- /dev/null +++ b/doc/ref/list_to_tuple_r.html @@ -0,0 +1,58 @@ + + + BOOST_PP_LIST_TO_TUPLE_R + + + +
+ The BOOST_PP_LIST_TO_TUPLE_R macro converts a list to a tuple.  + It reenters BOOST_PP_FOR with maximum efficiency. +
+

Usage

+
+ BOOST_PP_LIST_TO_TUPLE_R(r, list) +
+

Arguments

+
+
r
+
+ The next available BOOST_PP_FOR repetition. +
+
list
+
+ The list to be converted. +
+
+

Remarks

+
+ If list is, for example, (a, (b, (c, BOOST_PP_NIL))), + this macro will produce: +
+ (a, b, c) +
+
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/to_tuple.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/list/adt.hpp>
+#include <boost/preprocessor/list/to_tuple.hpp>
+#include <boost/preprocessor/repetition/for.hpp>
+
+#define LIST (x, (y, (z, BOOST_PP_NIL)))
+
+#define PRED(r, state) BOOST_PP_LIST_IS_CONS(state)
+#define OP(r, state) BOOST_PP_LIST_REST(state)
+#define MACRO(r, state) BOOST_PP_LIST_TO_TUPLE_R(r, state)
+
+BOOST_PP_FOR(LIST, PRED, OP, MACRO)
+   // expands to (x, y, z) (y, z) (z)
+
+ + diff --git a/doc/ref/list_transform.html b/doc/ref/list_transform.html new file mode 100644 index 0000000..41e1422 --- /dev/null +++ b/doc/ref/list_transform.html @@ -0,0 +1,67 @@ + + + BOOST_PP_LIST_TRANSFORM + + + +
+ The BOOST_PP_LIST_TRANSFORM macro transforms each element in a list according to a supplied transformation. +
+

Usage

+
+ BOOST_PP_LIST_TRANSFORM(op, data, list) +
+

Arguments

+
+
op
+
+ A ternary predicate of the form op(d, data, elem).  + This transformation is expanded by BOOST_PP_LIST_TRANSFORM for each element in list with the next available BOOST_PP_WHILE iteration, + the auxiliary data, and the current element in list.  +
+
data
+
+ Auxiliary data passed to pred. +
+
list
+
+ The list to be transformed. +
+
+

Remarks

+
+ This macro expands op for each element in list.  + It builds a new list out of the results of each call.  + If, for example, list is (a, (b, (c, BOOST_PP_NIL))), + this macro expands to... +
+ (op(d, data, a), (op(d, data, b), (op(d, data, c), BOOST_PP_NIL))) +
+
+
+ Previously, this macro could not be used inside BOOST_PP_WHILE.  + There is no longer any such restriction.  + It is more efficient, however, to use BOOST_PP_LIST_TRANSFORM_D in such a situation. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/transform.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/arithmetic/dec.hpp>
+#include <boost/preprocessor/list/transform.hpp>
+
+#define LIST (1, (3, (2, (5, BOOST_PP_NIL))))
+
+#define OP(d, data, elem) BOOST_PP_DEC(elem)
+
+BOOST_PP_LIST_TRANSFORM(OP, 3, LIST)
+   // expands to (0, (2, (1, (4, BOOST_PP_NIL))))
+
+ + diff --git a/doc/ref/list_transform_d.html b/doc/ref/list_transform_d.html new file mode 100644 index 0000000..62ebd9f --- /dev/null +++ b/doc/ref/list_transform_d.html @@ -0,0 +1,75 @@ + + + BOOST_PP_LIST_TRANSFORM_D + + + +
+ The BOOST_PP_LIST_TRANSFORM_D macro transforms each element in a list according to a supplied transformation.  + It reenters BOOST_PP_WHILE with maximum efficiency. +
+

Usage

+
+ BOOST_PP_LIST_TRANSFORM_D(d, op, data, list) +
+

Arguments

+
+
d
+
+ The next available BOOST_PP_WHILE iteration. +
+
op
+
+ A ternary predicate of the form op(d, data, elem).  + This transformation is expanded by BOOST_PP_LIST_TRANSFORM for each element in list with the next available BOOST_PP_WHILE iteration, + the auxiliary data, and the current element in list.  +
+
data
+
+ Auxiliary data passed to pred. +
+
list
+
+ The list to be transformed. +
+
+

Remarks

+
+ This macro expands op for each element in list.  + It builds a new list out of the results of each call.  + If, for example, list is (a, (b, (c, BOOST_PP_NIL))), + this macro expands to... +
+ (op(d, data, a), (op(d, data, b), (op(d, data, c), BOOST_PP_NIL))) +
+
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/list/transform.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/list/fold_right.hpp>
+#include <boost/preprocessor/list/transform.hpp>
+
+#define A (1, (2, (3, (4, BOOST_PP_NIL))))
+#define B (A, (A, (A, (A, BOOST_PP_NIL))))
+
+#define OP_T(d, data, x) BOOST_PP_INC(x)
+#define OP(d, state, x) (BOOST_PP_LIST_TRANSFORM_D(d, OP_T, 2, x), state)
+
+BOOST_PP_LIST_FOLD_RIGHT(OP, BOOST_PP_NIL, B)
+/*
+   expands to:
+   ((2, (3, (4, (5, BOOST_PP_NIL)))), ((2, (3, (4, (5, BOOST_PP_NIL)))),
+   ((2, (3, (4, (5, BOOST_PP_NIL)))), ((2, (3, (4, (5, BOOST_PP_NIL)))),
+   BOOST_PP_NIL))))
+*/
+
+ + diff --git a/doc/ref/local_iterate.html b/doc/ref/local_iterate.html new file mode 100644 index 0000000..fdf3a0e --- /dev/null +++ b/doc/ref/local_iterate.html @@ -0,0 +1,51 @@ + + + BOOST_PP_LOCAL_ITERATE + + + +
+ The BOOST_PP_LOCAL_ITERATE macro initiates a local-iteration. +
+

Usage

+
+ #include BOOST_PP_LOCAL_ITERATE() +
+

Remarks

+
+ This macro causes the user-defined macro BOOST_PP_LOCAL_MACRO to be expanded vertically with values in the range specified by BOOST_PP_LOCAL_LIMITS. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/iteration/local.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/iteration/local.hpp>
+
+template<int> struct sample;
+
+#define BOOST_PP_LOCAL_MACRO(n) \
+   template<> struct sample<n> { \
+      enum { value = n }; \
+   }; \
+   /**/
+
+#define BOOST_PP_LOCAL_LIMITS (1, 5)
+
+#include BOOST_PP_LOCAL_ITERATE()
+/* expands to...
+template<> struct sample<1> { enum { value = 1 }; };
+template<> struct sample<2> { enum { value = 2 }; };
+template<> struct sample<3> { enum { value = 3 }; };
+template<> struct sample<4> { enum { value = 4 }; };
+template<> struct sample<5> { enum { value = 5 }; };
+*/
+
+ + diff --git a/doc/ref/local_limits.html b/doc/ref/local_limits.html new file mode 100644 index 0000000..cba4785 --- /dev/null +++ b/doc/ref/local_limits.html @@ -0,0 +1,69 @@ + + + BOOST_PP_LOCAL_LIMITS + + + +
+ The BOOST_PP_LOCAL_LIMITS macro is a user-defined named external argument used by BOOST_PP_LOCAL_ITERATE. +
+

Usage

+
+ #define BOOST_PP_LOCAL_LIMITS (start, finish) +
+

Arguments

+
+
start
+
+ The lower bound (inclusive) of a local iteration.  + Valid values range from 0 to BOOST_PP_LIMIT_ITERATION. +
+
finish
+
+ The upper bound (inclusive) of a local iteration.  + Valid values range from 0 to BOOST_PP_LIMIT_ITERATION. +
+
+

Remarks

+
+ Note that there is a whitespace character after the macro identifier. +
+
+ This macro must expand to a 2-element tuple.  + The elements of this tuple represent the lower and upper boundaries of a local iteration.  + Both start and finish are evaluated parameters.  + This implies that they can include simple arithmetic expressions (such as 1 + 3), etc.. +
+
+ This macro is automatically undefined for reuse by a call to BOOST_PP_LOCAL_ITERATE. +
+

See Also

+ +

Sample Code

+
+#include <boost/preprocessor/iteration/local.hpp>
+
+template<int> struct sample;
+
+#define BOOST_PP_LOCAL_MACRO(n) \
+   template<> struct sample<n> { \
+      enum { value = n }; \
+   }; \
+   /**/
+
+#define BOOST_PP_LOCAL_LIMITS (1, 5)
+
+#include BOOST_PP_LOCAL_ITERATE()
+/* expands to...
+template<> struct sample<1> { enum { value = 1 }; };
+template<> struct sample<2> { enum { value = 2 }; };
+template<> struct sample<3> { enum { value = 3 }; };
+template<> struct sample<4> { enum { value = 4 }; };
+template<> struct sample<5> { enum { value = 5 }; };
+*/
+
+ + diff --git a/doc/ref/local_macro.html b/doc/ref/local_macro.html new file mode 100644 index 0000000..92019c6 --- /dev/null +++ b/doc/ref/local_macro.html @@ -0,0 +1,53 @@ + + + BOOST_PP_LOCAL_MACRO + + + +
+ The BOOST_PP_LOCAL_MACRO macro is a user-defined named external argument used by BOOST_PP_LOCAL_ITERATE. +
+

Usage

+
+ #define BOOST_PP_LOCAL_MACRO(n) ... +
+

Arguments

+
+
n
+
+ The current iteration value received from the local-iteration mechanism. +
+
+

Remarks

+
+ This macro is automatically undefined for reuse by a call to BOOST_PP_LOCAL_ITERATE. +
+

See Also

+ +

Sample Code

+
+#include <boost/preprocessor/iteration/local.hpp>
+
+template<int> struct sample;
+
+#define BOOST_PP_LOCAL_MACRO(n) \
+   template<> struct sample<n> { \
+      enum { value = n }; \
+   }; \
+   /**/
+
+#define BOOST_PP_LOCAL_LIMITS (1, 5)
+
+#include BOOST_PP_LOCAL_ITERATE()
+/* expands to...
+template<> struct sample<1> { enum { value = 1 }; };
+template<> struct sample<2> { enum { value = 2 }; };
+template<> struct sample<3> { enum { value = 3 }; };
+template<> struct sample<4> { enum { value = 4 }; };
+template<> struct sample<5> { enum { value = 5 }; };
+*/
+
+ + diff --git a/doc/ref/lparen.html b/doc/ref/lparen.html new file mode 100644 index 0000000..e7f1d08 --- /dev/null +++ b/doc/ref/lparen.html @@ -0,0 +1,41 @@ + + + BOOST_PP_LPAREN + + + +
+ The BOOST_PP_LPAREN macro expands to a left parenthesis. +
+

Usage

+
+ BOOST_PP_LPAREN() +
+

Remarks

+
+ The preprocessor interprets parentheses as delimiters in macro invocations.  + Because of this, parentheses require special handling. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/punctuation/paren.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/punctuation/paren.hpp>
+
+#define X(x) x
+#define MACRO(p, x) X p x )
+
+MACRO(BOOST_PP_LPAREN(), abc) // expands to abc
+
+#define Y(x)
+
+MACRO((10) Y BOOST_PP_LPAREN(), result) // expands to 10
+
+ + diff --git a/doc/ref/lparen_if.html b/doc/ref/lparen_if.html new file mode 100644 index 0000000..729fb28 --- /dev/null +++ b/doc/ref/lparen_if.html @@ -0,0 +1,50 @@ + + + BOOST_PP_LPAREN_IF + + + +
+ The BOOST_PP_LPAREN_IF macro conditionally expands to a left parenthesis. +
+

Usage

+
+ BOOST_PP_LPAREN_IF(cond) +
+

Arguments

+
+
cond
+
+ The condition that determines if a the macro expands to a left parenthesis or nothing.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ If cond expands to 0, this macro expands to nothing.  + Otherwise, it expands to a left parenthesis. +
+
+ The preprocessor interprets parentheses as delimiters in macro invocations.  + Because of this, parentheses require special handling. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/punctuation/paren_if.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/punctuation/paren_if.hpp>
+
+#define MACRO(c, x) BOOST_PP_LPAREN_IF(c) x BOOST_PP_RPAREN_IF(c)
+
+MACRO(0, text) // expands to text
+MACRO(1, text) // expands to (text)
+
+ + diff --git a/doc/ref/max.html b/doc/ref/max.html new file mode 100644 index 0000000..08e473b --- /dev/null +++ b/doc/ref/max.html @@ -0,0 +1,53 @@ + + + BOOST_PP_MAX + + + +
+ The BOOST_PP_MAX macro expands to the greater of its two arguments. +
+

Usage

+
+ BOOST_PP_MAX(x, y) +
+

Arguments

+
+
x
+
+ The first operand.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
y
+
+ The second operand.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ This macro returns the greater of its two arguments or the value of both arguments if they are equal. +
+
+ Previously, this macro could not be used inside BOOST_PP_WHILE.  + There is no longer any such restriction.  + It is more efficient, however, to use BOOST_PP_MAX_D in such a situation. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/selection/max.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/selection/max.hpp>
+
+BOOST_PP_MAX(5, 7) // expands to 7
+BOOST_PP_MAX(3, 3) // expands to 3
+
+ + diff --git a/doc/ref/max_d.html b/doc/ref/max_d.html new file mode 100644 index 0000000..24bf134 --- /dev/null +++ b/doc/ref/max_d.html @@ -0,0 +1,59 @@ + + + BOOST_PP_MAX_D + + + +
+ The BOOST_PP_MAX_D macro expands to the greater of its second and third arguments.  + It reenters BOOST_PP_WHILE with maximum efficiency. +
+

Usage

+
+ BOOST_PP_MAX_D(d, x, y) +
+

Arguments

+
+
d
+
+ The next available BOOST_PP_WHILE iteration.  +
+
x
+
+ The first operand.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
y
+
+ The second operand.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ This macro returns the greater of its first and second arguments or the value of both arguments if they are equal. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/selection/max.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/list/fold_left.hpp>
+#include <boost/preprocessor/selection/max.hpp>
+
+#define LIST (1, (3, (5, (2, (4, BOOST_PP_NIL)))))
+
+#define OP(d, state, x) BOOST_PP_MAX_D(d, state, x)
+
+#define LIST_MAX(list) BOOST_PP_LIST_FOLD_LEFT(OP, 0, LIST)
+
+LIST_MAX(LIST) // expands to 5
+
+ + diff --git a/doc/ref/min.html b/doc/ref/min.html new file mode 100644 index 0000000..d480f51 --- /dev/null +++ b/doc/ref/min.html @@ -0,0 +1,53 @@ + + + BOOST_PP_MIN + + + +
+ The BOOST_PP_MIN macro expands to the lesser of its two arguments. +
+

Usage

+
+ BOOST_PP_MIN(x, y) +
+

Arguments

+
+
x
+
+ The first operand.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
y
+
+ The second operand.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ This macro returns the lesser of its two arguments or the value of both arguments if they are equal. +
+
+ Previously, this macro could not be used inside BOOST_PP_WHILE.  + There is no longer any such restriction.  + It is more efficient, however, to use BOOST_PP_MIN_D in such a situation. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/selection/min.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/selection/min.hpp>
+
+BOOST_PP_MIN(5, 7) // expands to 5
+BOOST_PP_MIN(3, 3) // expands to 3
+
+ + diff --git a/doc/ref/min_d.html b/doc/ref/min_d.html new file mode 100644 index 0000000..b833e77 --- /dev/null +++ b/doc/ref/min_d.html @@ -0,0 +1,59 @@ + + + BOOST_PP_MIN_D + + + +
+ The BOOST_PP_MIN_D macro expands to the lesser of its second and third arguments.  + It reenters BOOST_PP_WHILE with maximum efficiency. +
+

Usage

+
+ BOOST_PP_MIN_D(d, x, y) +
+

Arguments

+
+
d
+
+ The next available BOOST_PP_WHILE iteration.  +
+
x
+
+ The first operand.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
y
+
+ The second operand.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ This macro returns the lesser of its first and second arguments or the value of both arguments if they are equal. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/selection/min.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/list/fold_left.hpp>
+#include <boost/preprocessor/selection/min.hpp>
+
+#define LIST (1, (3, (5, (2, (4, BOOST_PP_NIL)))))
+
+#define OP(d, state, x) BOOST_PP_MIN_D(d, state, x)
+
+#define LIST_MAX(list) BOOST_PP_LIST_FOLD_LEFT(OP, 20, LIST)
+
+LIST_MIN(LIST) // expands to 1
+
+ + diff --git a/doc/ref/mod.html b/doc/ref/mod.html new file mode 100644 index 0000000..6bc3ca5 --- /dev/null +++ b/doc/ref/mod.html @@ -0,0 +1,52 @@ + + + BOOST_PP_MOD + + + +
+ The BOOST_PP_MOD macro expands to the modulus of its arguments. +
+

Usage

+
+ BOOST_PP_MOD(x, y) +
+

Arguments

+
+
x
+
+ The dividend (numerator) of the operation.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
y
+
+ The divisor (denominator) of the operation.  + Valid values range from 1 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ Previously, this macro could not be used inside BOOST_PP_WHILE.  + There is no longer any such restriction.  + It is more efficient, however, to use BOOST_PP_MOD_D in such a situation. +
+
+ If y is 0, the result is undefined. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/arithmetic/mod.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/arithmetic/mod.hpp>
+
+BOOST_PP_MOD(11, 5) // expands to 1
+
+ + diff --git a/doc/ref/mod_d.html b/doc/ref/mod_d.html new file mode 100644 index 0000000..3614ab3 --- /dev/null +++ b/doc/ref/mod_d.html @@ -0,0 +1,64 @@ + + + BOOST_PP_MOD_D + + + +
+ The BOOST_PP_MOD_D macro expands to the modulus of its second and third arguments.  + It reenters BOOST_PP_WHILE with maximum efficiency. +
+

Usage

+
+ BOOST_PP_MOD_D(d, x, y) +
+

Arguments

+
+
d
+
+ The next available BOOST_PP_WHILE iteration.  +
+
x
+
+ The dividend (numerator) of the operation.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
y
+
+ The divisor (denominator) of the operation.  + Valid values range from 1 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ If y is 0, the result is undefined. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/arithmetic/div.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/arithmetic/mod.hpp>
+#include <boost/preprocessor/list/filter.hpp>
+#include <boost/preprocessor/logical/not.hpp>
+
+#define LIST (1, (2, (3, (4, (5, BOOST_PP_NIL)))))
+
+#define EVEN_P(d, _, num) BOOST_PP_NOT(BOOST_PP_MOD_D(d, num, 2))
+#define EVEN(list) BOOST_PP_LIST_FILTER(EVEN_P, nil, list)
+
+EVEN(LIST) // expands to (2, (4, BOOST_PP_NIL))
+
+#define ODD_P(d, _, num) BOOST_PP_MOD_D(d, num, 2)
+#define ODD(list) BOOST_PP_LIST_FILTER(ODD_P, nil, list)
+
+ODD(LIST) // expands to (1, (3, (5, BOOST_PP_NIL)))
+
+ + diff --git a/doc/ref/mul.html b/doc/ref/mul.html new file mode 100644 index 0000000..175f23d --- /dev/null +++ b/doc/ref/mul.html @@ -0,0 +1,57 @@ + + + BOOST_PP_MUL + + + +
+ The BOOST_PP_MUL macro expands to the product of its arguments. +
+

Usage

+
+ BOOST_PP_MUL(x, y) +
+

Arguments

+
+
x
+
+ The multiplicand of the operation.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
y
+
+ The multiplier of the operation.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ If the product of x and y is greater than BOOST_PP_LIMIT_MAG, the result is saturated to BOOST_PP_LIMIT_MAG. +
+
+ Previously, this macro could not be used inside BOOST_PP_WHILE.  + There is no longer any such restriction.  + It is more efficient, however, to use BOOST_PP_MUL_D in such a situation. +
+
+ This macro is the most efficient when x is less than or equal to y.  + However, the efficiency gain is not worth actually comparing the two arguments prior to invocation.  + In other words, x should be the value that is most likely to be the largest of the two operands. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/arithmetic/mul.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/arithmetic/mul.hpp>
+
+BOOST_PP_MUL(4, 4) // expands to 16
+
+ + diff --git a/doc/ref/mul_d.html b/doc/ref/mul_d.html new file mode 100644 index 0000000..b726cc0 --- /dev/null +++ b/doc/ref/mul_d.html @@ -0,0 +1,80 @@ + + + BOOST_PP_MUL_D + + + +
+ The BOOST_PP_MUL_D macro expands to the product of its second and third arguments.  + It reenters BOOST_PP_WHILE with maximum efficiency. +
+

Usage

+
+ BOOST_PP_MUL_D(d, x, y) +
+

Arguments

+
+
d
+
+ The next available BOOST_PP_WHILE iteration.  +
+
x
+
+ The multiplicand of the operation.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
y
+
+ The multiplier of the operation.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ If the product of x and y is greater than BOOST_PP_LIMIT_MAG, the result is saturated to BOOST_PP_LIMIT_MAG. +
+
+ This macro is the most efficient when x is less than or equal to y.  + However, the efficiency gain is not worth actually comparing the two arguments prior to invocation.  + In other words, x should be the value that is most likely to be the largest of the two operands. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/arithmetic/mul.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/arithmetic/dec.hpp>
+#include <boost/preprocessor/arithmetic/mul.hpp>
+#include <boost/preprocessor/control/while.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+
+#define PRED(d, data) BOOST_PP_TUPLE_ELEM(3, 0, data)
+
+#define OP(d, data) \
+   ( \
+      BOOST_PP_DEC( \
+         BOOST_PP_TUPLE_ELEM(3, 0, data) \
+      ), \
+      BOOST_PP_TUPLE_ELEM(3, 1, data), \
+      BOOST_PP_MUL_D( \
+         d, \
+         BOOST_PP_TUPLE_ELEM(3, 2, data), \
+         BOOST_PP_TUPLE_ELEM(3, 1, data) \
+      ) \
+   ) \
+   /**/
+
+// raise 'x' to the 'n'-th power
+#define EXP(x, n) BOOST_PP_TUPLE_ELEM(3, 2, BOOST_PP_WHILE(PRED, OP, (n, x, 1)))
+
+EXP(4, 2) // expands to 16
+EXP(2, 3) // expands to 8
+
+ + diff --git a/doc/ref/nil.html b/doc/ref/nil.html new file mode 100644 index 0000000..bdbe847 --- /dev/null +++ b/doc/ref/nil.html @@ -0,0 +1,30 @@ + + + BOOST_PP_NIL + + + +
+ The BOOST_PP_NIL identifier is reserved by the library to indicate a non-macro. +
+

Usage

+
+ BOOST_PP_NIL +
+

Remarks

+
+ This identifier is not defined.  + Its purpose is to not be a macro.  + It is also used to terminate a list. +
+

Sample Code

+
+#include <boost/preprocessor/list/adt.hpp>
+
+#define LIST (x, (y, (z, BOOST_PP_NIL)))
+
+BOOST_PP_LIST_FIRST(x) // expands to x
+BOOST_PP_LIST_REST(x) // expands to (y, (z, BOOST_PP_NIL))
+
+ + diff --git a/doc/ref/nor.html b/doc/ref/nor.html new file mode 100644 index 0000000..dd8d7cf --- /dev/null +++ b/doc/ref/nor.html @@ -0,0 +1,53 @@ + + + BOOST_PP_NOR + + + +
+ The BOOST_PP_NOR macro expands to the logical NOR of its operands. +
+

Usage

+
+ BOOST_PP_NOR(p, q) +
+

Arguments

+
+
p
+
+ The left operand of the operation.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
q
+
+ The right operand of the operation.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ If both p and q are both 0, this macro expands to 1.  + Otherwise, it expands to 0. +
+
+ This macro performs a boolean conversion on each operand before performing the logical NOR operation.  + If that conversion is not necessary, use BOOST_PP_BITNOR instead. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/logical/nor.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/logical/nor.hpp>
+
+BOOST_PP_NOR(4, 0) // expands to 0
+BOOST_PP_NOR(0, 0) // expands to 1
+
+ + diff --git a/doc/ref/not.html b/doc/ref/not.html new file mode 100644 index 0000000..063d18e --- /dev/null +++ b/doc/ref/not.html @@ -0,0 +1,48 @@ + + + BOOST_PP_NOT + + + +
+ The BOOST_PP_NOT macro performs a logical NOT on its operand. +
+

Usage

+
+ BOOST_PP_NOT(x) +
+

Arguments

+
+
x
+
+ The value to be converted.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ If x is non-zero, this macro expands to 1.  + Otherwise, it expands to 0. +
+
+ This macro performs a boolean conversion on its operand before performing the logical NOT operation.  + If that conversion is not necessary, use BOOST_PP_COMPL instead. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/logical/not.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/logical/not.hpp>
+
+BOOST_PP_NOT(55) // expands to 0
+BOOST_PP_NOT(0) // expands to 1
+
+ + diff --git a/doc/ref/not_equal.html b/doc/ref/not_equal.html new file mode 100644 index 0000000..b5c4d16 --- /dev/null +++ b/doc/ref/not_equal.html @@ -0,0 +1,53 @@ + + + BOOST_PP_NOT_EQUAL + + + +
+ The BOOST_PP_NOT_EQUAL macro compares two values for inequality. +
+

Usage

+
+ BOOST_PP_NOT_EQUAL(x, y) +
+

Arguments

+
+
x
+
+ The left operand of the comparison.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
y
+
+ The right operand of the comparison.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ If x is equal to y, this macro expands to 0.  + Otherwise, it expands to 1. +
+
+ Previously, this macro could not be used inside BOOST_PP_WHILE.  + There is no longer any such restriction because this macro no longer uses BOOST_PP_WHILE. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/comparison/not_equal.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/comparison/not_equal.hpp>
+
+BOOST_PP_NOT_EQUAL(4, 3) // expands to 1
+BOOST_PP_NOT_EQUAL(5, 5) // expands to 0
+
+ + diff --git a/doc/ref/not_equal_d.html b/doc/ref/not_equal_d.html new file mode 100644 index 0000000..31eb0d0 --- /dev/null +++ b/doc/ref/not_equal_d.html @@ -0,0 +1,58 @@ + + + BOOST_PP_NOT_EQUAL_D + + + +
+ The BOOST_PP_NOT_EQUAL_D macro compares two values for inequality. +
+

Usage

+
+ BOOST_PP_NOT_EQUAL_D(d, x, y) +
+

Arguments

+
+
d
+
+ This argument is ignored. +
+
x
+
+ The left operand of the comparison.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
y
+
+ The right operand of the comparison.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ If x is equal to y, this macro expands to 0.  + Otherwise, it expands to 1. +
+
+ This macro is deprecated.  + It only exists for backward compatibility.  + Use BOOST_PP_NOT_EQUAL instead. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/comparison/not_equal.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/comparison/equal.hpp>
+
+BOOST_PP_NOT_EQUAL_D(1, 4, 3) // expands to 1
+BOOST_PP_NOT_EQUAL_D(1, 5, 5) // expands to 0
+
+ + diff --git a/doc/ref/or.html b/doc/ref/or.html new file mode 100644 index 0000000..a8706f8 --- /dev/null +++ b/doc/ref/or.html @@ -0,0 +1,53 @@ + + + BOOST_PP_OR + + + +
+ The BOOST_PP_OR macro expands to the logical OR of its operands. +
+

Usage

+
+ BOOST_PP_OR(p, q) +
+

Arguments

+
+
p
+
+ The left operand of the operation.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
q
+
+ The right operand of the operation.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ If either p or q is non-zero, this macro expands to 1.  + Otherwise, it expands to 0. +
+
+ This macro performs a boolean conversion on each operand before performing the logical OR operation.  + If that conversion is not necessary, use BOOST_PP_BITOR instead. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/logical/or.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/logical/or.hpp>
+
+BOOST_PP_OR(4, 3) // expands to 1
+BOOST_PP_OR(5, 0) // expands to 1
+
+ + diff --git a/doc/ref/relative_finish.html b/doc/ref/relative_finish.html new file mode 100644 index 0000000..a56afcc --- /dev/null +++ b/doc/ref/relative_finish.html @@ -0,0 +1,35 @@ + + + BOOST_PP_RELATIVE_FINISH + + + + +
+ The BOOST_PP_RELATIVE_FINISH macro expands to the upper bound of a file-iteration depth relative to the current depth. +
+

Usage

+
+ BOOST_PP_RELATIVE_FINISH(i) +
+

Arguments

+
+
i
+
+ The relative depth of the frame whose upper bound is to be retreived.  + Valid values range from 0 to BOOST_PP_ITERATION_DEPTH() - 1. +
+
+

Remarks

+
+ This macro is only valid when a file-iteration is in progress. +
+
+ The argument i is interpreted as the number of frames outward from the current frame. +
+

Requirements

+
+ Header:  <boost/preprocessor/iteration/iterate.hpp> +
+ + diff --git a/doc/ref/relative_flags.html b/doc/ref/relative_flags.html new file mode 100644 index 0000000..7d51aa6 --- /dev/null +++ b/doc/ref/relative_flags.html @@ -0,0 +1,35 @@ + + + BOOST_PP_RELATIVE_FLAGS + + + + +
+ The BOOST_PP_RELATIVE_FLAGS macro expands to the flags associated with a file-iteration depth relative to the current depth. +
+

Usage

+
+ BOOST_PP_RELATIVE_FLAGS(i) +
+

Arguments

+
+
i
+
+ The relative depth of the frame whose flags are to be retreived.  + Valid values range from 0 to BOOST_PP_ITERATION_DEPTH() - 1. +
+
+

Remarks

+
+ This macro is only valid when a file-iteration is in progress. +
+
+ The argument i is interpreted as the number of frames outward from the current frame. +
+

Requirements

+
+ Header:  <boost/preprocessor/iteration/iterate.hpp> +
+ + diff --git a/doc/ref/relative_iteration.html b/doc/ref/relative_iteration.html new file mode 100644 index 0000000..d6e5556 --- /dev/null +++ b/doc/ref/relative_iteration.html @@ -0,0 +1,90 @@ + + + BOOST_PP_RELATIVE_ITERATION + + + +
+ The BOOST_PP_RELATIVE_ITERATION macro expands to the iteration value of a file-iteration depth relative to the current depth. +
+

Usage

+
+ BOOST_PP_RELATIVE_ITERATION(i) +
+

Arguments

+
+
i
+
+ The relative depth of the frame whose iteration value is to be retreived.  + Valid values range from 0 to BOOST_PP_ITERATION_DEPTH() - 1. +
+
+

Remarks

+
+ This macro is only valid when a file-iteration is in progress. +
+
+ The argument i is interpreted as the number of frames outward from the current frame.  + Therefore, BOOST_PP_RELATIVE_ITERATION(0) is equivalent to BOOST_PP_ITERATION(). +
+

Requirements

+
+ Header:  <boost/preprocessor/iteration/iterate.hpp> +
+

Sample Code

+
+// file.h
+#if !BOOST_PP_IS_ITERATING
+
+   #ifndef FILE_H_
+   #define FILE_H_
+
+   #include <boost/preprocessor/iteration/iterate.hpp>
+
+1st iteration:
+   #define BOOST_PP_ITERATION_PARAMS_1 (4, (0, 3, "file.h", 0x0001))
+   #include BOOST_PP_ITERATE()
+
+2nd iteration:
+   #define BOOST_PP_ITERATION_PARAMS_1 (4, (1, 10, "file.h", 0x0002))
+   #include BOOST_PP_ITERATE()
+
+   #endif
+
+#elif BOOST_PP_ITERATION_DEPTH() == 1 \
+   && BOOST_PP_ITERATION_FLAGS() == 0x0001 \
+   /**/
+
+   --
+   #define BOOST_PP_ITERATION_PARAMS_2 (3, (1, 10, "file.h"))
+   #include BOOST_PP_ITERATE()
+
+#elif BOOST_PP_ITERATION_DEPTH() == 1 \
+   && BOOST_PP_ITERATION_FLAGS() == 0x0002 \
+   /**/
+
+   --
+   #define BOOST_PP_ITERATION_PARAMS_2 \
+      (3, (1, BOOST_PP_ITERATION(), "file.h")) \
+      /**/
+   #include BOOST_PP_ITERATE()
+
+#elif BOOST_PP_ITERATION_DEPTH() == 2 \
+   && BOOST_PP_FRAME_FLAGS(1) == 0x0001 \
+   /**/
+
+   --
+   #define BOOST_PP_ITERATION_PARAMS_3 \
+      (3, (1, BOOST_PP_ITERATION(), "file.h")) \
+      /**/
+   #include BOOST_PP_ITERATE()
+
+#else // used by both
+
+   previous: BOOST_PP_RELATIVE_ITERATION(1)
+   current: BOOST_PP_ITERATION()
+
+#endif
+
+ + diff --git a/doc/ref/relative_start.html b/doc/ref/relative_start.html new file mode 100644 index 0000000..d0c9593 --- /dev/null +++ b/doc/ref/relative_start.html @@ -0,0 +1,35 @@ + + + BOOST_PP_RELATIVE_START + + + + +
+ The BOOST_PP_RELATIVE_START macro expands to the lower bound of a file-iteration depth relative to the current depth. +
+

Usage

+
+ BOOST_PP_RELATIVE_START(i) +
+

Arguments

+
+
i
+
+ The relative depth of the frame whose lower bound is to be retreived.  + Valid values range from 0 to BOOST_PP_ITERATION_DEPTH() - 1. +
+
+

Remarks

+
+ This macro is only valid when a file-iteration is in progress. +
+
+ The argument i is interpreted as the number of frames outward from the current frame. +
+

Requirements

+
+ Header:  <boost/preprocessor/iteration/iterate.hpp> +
+ + diff --git a/doc/ref/repeat.html b/doc/ref/repeat.html new file mode 100644 index 0000000..a1c9559 --- /dev/null +++ b/doc/ref/repeat.html @@ -0,0 +1,69 @@ + + + BOOST_PP_REPEAT + + + +
+ The BOOST_PP_REPEAT macro represents a fast horizontal repetition construct. +
+

Usage

+
+ BOOST_PP_REPEAT(count, macro, data) +
+

Arguments

+
+
count
+
+ The number of repetitious calls to macro.  + Valid values range from 0 to BOOST_PP_LIMIT_REPEAT. +
+
macro
+
+ A ternary operation of the form macro(z, n, data).  + This macro is expanded by BOOST_PP_REPEAT with the next available repetition depth, + the current repetition number, and the auxiliary data argument.  +
+
data
+
+ Auxiliary data passed to macro. +
+
+

Remarks

+
+ This macro expands to the sequence: +
+ macro(z, 0, data) macro(z, 1, data) ... macro(z, count - 1, data) +
+
+
+ The z value that is passed to macro represents the next available repetition dimension.  + Other macros that have _Z suffix variants internally use BOOST_PP_REPEAT--for example, BOOST_PP_ENUM_PARAMS and BOOST_PP_ENUM_PARAMS_Z.  + Using these _Z versions is not strictly necessary, but passing the z value (that is passed to macro) to these macros allows them to reenter BOOST_PP_REPEAT with maximum efficiency. +
+
+ To directly use this z value, rather than simply passing it to another macro, see BOOST_PP_REPEAT_z. +
+
+ Previously, this macro could not be used recursively inside BOOST_PP_REPEAT.  + This limitation no longer exists, as the library can automatically detect the next available repetition depth. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/repeat.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/repetition/repeat.hpp>
+
+#define DECL(z, n, text) text ## n = n;
+
+BOOST_PP_REPEAT(5, DECL, int x)
+
+ + diff --git a/doc/ref/repeat_1st.html b/doc/ref/repeat_1st.html new file mode 100644 index 0000000..adca32c --- /dev/null +++ b/doc/ref/repeat_1st.html @@ -0,0 +1,71 @@ + + + BOOST_PP_REPEAT_1ST + + + +
+ The BOOST_PP_REPEAT_1ST macro represents the first dimension of BOOST_PP_REPEAT. +
+

Usage

+
+ BOOST_PP_REPEAT_1ST(count, macro, data) +
+

Arguments

+
+
count
+
+ The number of repetitious calls to macro.  + Valid values range from 0 to BOOST_PP_LIMIT_REPEAT. +
+
macro
+
+ A ternary operation of the form macro(z, n, data).  + This macro is expanded by BOOST_PP_REPEAT_1ST with the next available repetition depth, + the current repetition number, and the auxiliary data argument.  +
+
data
+
+ Auxiliary data passed to macro. +
+
+

Remarks

+
+ This macro expands to the sequence: +
+ macro(z, 0, data) macro(z, 1, data) ... macro(z, count - 1, data) +
+
+
+ The z value that is passed to macro represents the next available repetition dimension.  + Other macros that have _Z suffix variants internally use BOOST_PP_REPEAT--for example, BOOST_PP_ENUM_PARAMS and BOOST_PP_ENUM_PARAMS_Z.  + Using these _Z versions is not strictly necessary, but passing the z value (that is passed to macro) to these macros allows them to reenter BOOST_PP_REPEAT with maximum efficiency. +
+
+ To directly use this z value, rather than simply passing it to another macro, see BOOST_PP_REPEAT_z. +
+
+ This macro is deprecated.  + It only exists for backward compatibility.  + Use BOOST_PP_REPEAT instead. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/repeat.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/repetition/repeat.hpp>
+
+#define DECL(z, n, text) text ## n = n;
+
+BOOST_PP_REPEAT_1ST(5, DECL, int x)
+
+ + diff --git a/doc/ref/repeat_2nd.html b/doc/ref/repeat_2nd.html new file mode 100644 index 0000000..a2eda1e --- /dev/null +++ b/doc/ref/repeat_2nd.html @@ -0,0 +1,71 @@ + + + BOOST_PP_REPEAT_2ND + + + +
+ The BOOST_PP_REPEAT_2ND macro represents the second dimension of BOOST_PP_REPEAT. +
+

Usage

+
+ BOOST_PP_REPEAT_2ND(count, macro, data) +
+

Arguments

+
+
count
+
+ The number of repetitious calls to macro.  + Valid values range from 0 to BOOST_PP_LIMIT_REPEAT. +
+
macro
+
+ A ternary operation of the form macro(z, n, data).  + This macro is expanded by BOOST_PP_REPEAT_2ND with the next available repetition depth, + the current repetition number, and the auxiliary data argument.  +
+
data
+
+ Auxiliary data passed to macro. +
+
+

Remarks

+
+ This macro expands to the sequence: +
+ macro(z, 0, data) macro(z, 1, data) ... macro(z, count - 1, data) +
+
+
+ The z value that is passed to macro represents the next available repetition dimension.  + Other macros that have _Z suffix variants internally use BOOST_PP_REPEAT--for example, BOOST_PP_ENUM_PARAMS and BOOST_PP_ENUM_PARAMS_Z.  + Using these _Z versions is not strictly necessary, but passing the z value (that is passed to macro) to these macros allows them to reenter BOOST_PP_REPEAT with maximum efficiency. +
+
+ To directly use this z value, rather than simply passing it to another macro, see BOOST_PP_REPEAT_z. +
+
+ This macro is deprecated.  + It only exists for backward compatibility.  + Use BOOST_PP_REPEAT instead. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/repeat.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/repetition/repeat.hpp>
+
+#define DECL(z, n, text) text ## n = n;
+
+BOOST_PP_REPEAT_2ND(5, DECL, int x)
+
+ + diff --git a/doc/ref/repeat_3rd.html b/doc/ref/repeat_3rd.html new file mode 100644 index 0000000..ffb4c46 --- /dev/null +++ b/doc/ref/repeat_3rd.html @@ -0,0 +1,71 @@ + + + BOOST_PP_REPEAT_3RD + + + +
+ The BOOST_PP_REPEAT_3RD macro represents the third dimension of BOOST_PP_REPEAT. +
+

Usage

+
+ BOOST_PP_REPEAT_3RD(count, macro, data) +
+

Arguments

+
+
count
+
+ The number of repetitious calls to macro.  + Valid values range from 0 to BOOST_PP_LIMIT_REPEAT. +
+
macro
+
+ A ternary operation of the form macro(z, n, data).  + This macro is expanded by BOOST_PP_REPEAT_3RD with the next available repetition depth, + the current repetition number, and the auxiliary data argument.  +
+
data
+
+ Auxiliary data passed to macro. +
+
+

Remarks

+
+ This macro expands to the sequence: +
+ macro(z, 0, data) macro(z, 1, data) ... macro(z, count - 1, data) +
+
+
+ The z value that is passed to macro represents the next available repetition dimension.  + Other macros that have _Z suffix variants internally use BOOST_PP_REPEAT--for example, BOOST_PP_ENUM_PARAMS and BOOST_PP_ENUM_PARAMS_Z.  + Using these _Z versions is not strictly necessary, but passing the z value (that is passed to macro) to these macros allows them to reenter BOOST_PP_REPEAT with maximum efficiency. +
+
+ To directly use this z value, rather than simply passing it to another macro, see BOOST_PP_REPEAT_z. +
+
+ This macro is deprecated.  + It only exists for backward compatibility.  + Use BOOST_PP_REPEAT instead. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/repeat.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/repetition/repeat.hpp>
+
+#define DECL(z, n, text) text ## n = n;
+
+BOOST_PP_REPEAT_3RD(5, DECL, int x)
+
+ + diff --git a/doc/ref/repeat_from_to.html b/doc/ref/repeat_from_to.html new file mode 100644 index 0000000..b15a82d --- /dev/null +++ b/doc/ref/repeat_from_to.html @@ -0,0 +1,91 @@ + + + BOOST_PP_REPEAT_FROM_TO + + + +
+ The BOOST_PP_REPEAT_FROM_TO macro represents a fast horizontal repetition construct. +
+

Usage

+
+ BOOST_PP_REPEAT_FROM_TO(first, last, macro, data) +
+

Arguments

+
+
first
+
+ The lower bound of the repetition.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
last
+
+ The upper bound of the repetition. + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
macro
+
+ A ternary operation of the form macro(z, n, data).  + This macro is expanded by BOOST_PP_REPEAT with the next available repetition depth, + the current repetition number, and the auxiliary data argument.  +
+
data
+
+ Auxiliary data passed to macro. +
+
+

Remarks

+
+ This macro expands to the sequence: +
+ macro(z, first, data) macro(z, first + 1, data) ... macro(z, last - 1, data) +
+
+
+ The number of repetitions (i.e. last - first) must not exceed BOOST_PP_LIMIT_REPEAT. +
+
+ The z value that is passed to macro represents the next available repetition dimension.  + Other macros that have _Z suffix variants internally use BOOST_PP_REPEAT--for example, BOOST_PP_ENUM_PARAMS and BOOST_PP_ENUM_PARAMS_Z.  + Using these _Z versions is not strictly necessary, but passing the z value (that is passed to macro) to these macros allows them to reenter BOOST_PP_REPEAT with maximum efficiency. +
+
+ To directly use this z value, rather than simply passing it to another macro, see BOOST_PP_REPEAT_FROM_TO_z. +
+
+ Previously, this macro could not be used recursively inside BOOST_PP_REPEAT.  + This limitation no longer exists, as the library can automatically detect the next available repetition depth. +
+
+ This macro also uses BOOST_PP_WHILE.  + Because of this, there are also two variants of this macro for ideal reentrance into BOOST_PP_WHILE, + BOOST_PP_REPEAT_FROM_TO_D and BOOST_PP_REPEAT_FROM_TO_D_z. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/repeat_from_to.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/repetition/repeat_from_to.hpp>
+
+#define DECL(z, n, text) BOOST_PP_CAT(text, n) = n;
+
+BOOST_PP_REPEAT_FROM_TO(5, 10, DECL, int x)
+   /*
+      expands to:
+      int x5 = 5; int x6 = 6; int x7 = 7;
+      int x8 = 8; int x9 = 9;
+   */
+
+ + diff --git a/doc/ref/repeat_from_to_1st.html b/doc/ref/repeat_from_to_1st.html new file mode 100644 index 0000000..a153233 --- /dev/null +++ b/doc/ref/repeat_from_to_1st.html @@ -0,0 +1,80 @@ + + + BOOST_PP_REPEAT_FROM_TO_1ST + + + +
+ The BOOST_PP_REPEAT_FROM_TO_1ST macro represents the first dimension of BOOST_PP_REPEAT_FROM_TO. +
+

Usage

+
+ BOOST_PP_REPEAT_FROM_TO_1ST(first, last, macro, data) +
+

Arguments

+
+
first
+
+ The lower bound of the repetition.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
last
+
+ The upper bound of the repetition. + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
macro
+
+ A ternary operation of the form macro(z, n, data).  + This macro is expanded by BOOST_PP_REPEAT_FROM_TO_1ST with the next available repetition depth, + the current repetition number, and the auxiliary data argument.  +
+
data
+
+ Auxiliary data passed to macro. +
+
+

Remarks

+
+ This macro expands to the sequence: +
+ macro(z, first, data) macro(z, first + 1, data) ... macro(z, last - 1, data) +
+
+
+ The number of repetitions (i.e. last - first) must not exceed BOOST_PP_LIMIT_REPEAT. +
+
+ The z value that is passed to macro represents the next available repetition dimension.  + Other macros that have _Z suffix variants internally use BOOST_PP_REPEAT--for example, BOOST_PP_ENUM_PARAMS and BOOST_PP_ENUM_PARAMS_Z.  + Using these _Z versions is not strictly necessary, but passing the z value (that is passed to macro) to these macros allows them to reenter BOOST_PP_REPEAT with maximum efficiency. +
+
+ To directly use this z value, rather than simply passing it to another macro, see BOOST_PP_REPEAT_FROM_TO_z. +
+
+ This macro is deprecated.  + It only exists for backward compatibility.  + Use BOOST_PP_REPEAT_FROM_TO instead. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/repeat_from_to.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/repetition/repeat_from_to.hpp>
+
+#define MACRO(z, n, data) (n)
+
+BOOST_PP_REPEAT_FROM_TO_1ST(1, 6, MACRO, nil)
+   // expands to (1) (2) (3) (4) (5)
+
+ + diff --git a/doc/ref/repeat_from_to_2nd.html b/doc/ref/repeat_from_to_2nd.html new file mode 100644 index 0000000..5102b7d --- /dev/null +++ b/doc/ref/repeat_from_to_2nd.html @@ -0,0 +1,80 @@ + + + BOOST_PP_REPEAT_FROM_TO_2ND + + + +
+ The BOOST_PP_REPEAT_FROM_TO_2ND macro represents the second dimension of BOOST_PP_REPEAT_FROM_TO. +
+

Usage

+
+ BOOST_PP_REPEAT_FROM_TO_2ND(first, last, macro, data) +
+

Arguments

+
+
first
+
+ The lower bound of the repetition.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
last
+
+ The upper bound of the repetition. + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
macro
+
+ A ternary operation of the form macro(z, n, data).  + This macro is expanded by BOOST_PP_REPEAT_FROM_TO_2ND with the next available repetition depth, + the current repetition number, and the auxiliary data argument.  +
+
data
+
+ Auxiliary data passed to macro. +
+
+

Remarks

+
+ This macro expands to the sequence: +
+ macro(z, first, data) macro(z, first + 1, data) ... macro(z, last - 1, data) +
+
+
+ The number of repetitions (i.e. last - first) must not exceed BOOST_PP_LIMIT_REPEAT. +
+
+ The z value that is passed to macro represents the next available repetition dimension.  + Other macros that have _Z suffix variants internally use BOOST_PP_REPEAT--for example, BOOST_PP_ENUM_PARAMS and BOOST_PP_ENUM_PARAMS_Z.  + Using these _Z versions is not strictly necessary, but passing the z value (that is passed to macro) to these macros allows them to reenter BOOST_PP_REPEAT with maximum efficiency. +
+
+ To directly use this z value, rather than simply passing it to another macro, see BOOST_PP_REPEAT_FROM_TO_z. +
+
+ This macro is deprecated.  + It only exists for backward compatibility.  + Use BOOST_PP_REPEAT_FROM_TO instead. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/repeat_from_to.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/repetition/repeat_from_to.hpp>
+
+#define MACRO(z, n, data) (n)
+
+BOOST_PP_REPEAT_FROM_TO_2ND(1, 6, MACRO, nil)
+   // expands to (1) (2) (3) (4) (5)
+
+ + diff --git a/doc/ref/repeat_from_to_3rd.html b/doc/ref/repeat_from_to_3rd.html new file mode 100644 index 0000000..13d5258 --- /dev/null +++ b/doc/ref/repeat_from_to_3rd.html @@ -0,0 +1,80 @@ + + + BOOST_PP_REPEAT_FROM_TO_3RD + + + +
+ The BOOST_PP_REPEAT_FROM_TO_3RD macro represents the third dimension of BOOST_PP_REPEAT_FROM_TO. +
+

Usage

+
+ BOOST_PP_REPEAT_FROM_TO_3RD(first, last, macro, data) +
+

Arguments

+
+
first
+
+ The lower bound of the repetition.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
last
+
+ The upper bound of the repetition. + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
macro
+
+ A ternary operation of the form macro(z, n, data).  + This macro is expanded by BOOST_PP_REPEAT_FROM_TO_3RD with the next available repetition depth, + the current repetition number, and the auxiliary data argument.  +
+
data
+
+ Auxiliary data passed to macro. +
+
+

Remarks

+
+ This macro expands to the sequence: +
+ macro(z, first, data) macro(z, first + 1, data) ... macro(z, last - 1, data) +
+
+
+ The number of repetitions (i.e. last - first) must not exceed BOOST_PP_LIMIT_REPEAT. +
+
+ The z value that is passed to macro represents the next available repetition dimension.  + Other macros that have _Z suffix variants internally use BOOST_PP_REPEAT--for example, BOOST_PP_ENUM_PARAMS and BOOST_PP_ENUM_PARAMS_Z.  + Using these _Z versions is not strictly necessary, but passing the z value (that is passed to macro) to these macros allows them to reenter BOOST_PP_REPEAT with maximum efficiency. +
+
+ To directly use this z value, rather than simply passing it to another macro, see BOOST_PP_REPEAT_FROM_TO_z. +
+
+ This macro is deprecated.  + It only exists for backward compatibility.  + Use BOOST_PP_REPEAT_FROM_TO instead. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/repeat_from_to.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/repetition/repeat_from_to.hpp>
+
+#define MACRO(z, n, data) (n)
+
+BOOST_PP_REPEAT_FROM_TO_3RD(1, 6, MACRO, nil)
+   // expands to (1) (2) (3) (4) (5)
+
+ + diff --git a/doc/ref/repeat_from_to_d.html b/doc/ref/repeat_from_to_d.html new file mode 100644 index 0000000..5354a0d --- /dev/null +++ b/doc/ref/repeat_from_to_d.html @@ -0,0 +1,72 @@ + + + BOOST_PP_REPEAT_FROM_TO_D + + + +
+ The BOOST_PP_REPEAT_FROM_TO_D macro represents a fast horizontal repetition construct.  + It reenters BOOST_PP_WHILE with maximum efficiency. +
+

Usage

+
+ BOOST_PP_REPEAT_FROM_TO_D(d, first, last, macro, data) +
+

Arguments

+
+
d
+
+ The next available BOOST_PP_WHILE iteration. +
+
first
+
+ The lower bound of the repetition.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
last
+
+ The upper bound of the repetition. + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
macro
+
+ A ternary operation of the form macro(z, n, data).  + This macro is expanded by BOOST_PP_REPEAT with the next available repetition depth, + the current repetition number, and the auxiliary data argument.  +
+
data
+
+ Auxiliary data passed to macro. +
+
+

Remarks

+
+ This macro expands to the sequence: +
+ macro(z, first, data) macro(z, first + 1, data) ... macro(z, last - 1, data) +
+
+
+ The number of repetitions (i.e. last - first) must not exceed BOOST_PP_LIMIT_REPEAT. +
+
+ The z value that is passed to macro represents the next available repetition dimension.  + Other macros that have _Z suffix variants internally use BOOST_PP_REPEAT--for example, BOOST_PP_ENUM_PARAMS and BOOST_PP_ENUM_PARAMS_Z.  + Using these _Z versions is not strictly necessary, but passing the z value (that is passed to macro) to these macros allows them to reenter BOOST_PP_REPEAT with maximum efficiency. +
+
+ To directly use this z value, rather than simply passing it to another macro, see BOOST_PP_REPEAT_FROM_TO_D_z. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/repeat_from_to.hpp> +
+ + diff --git a/doc/ref/repeat_from_to_d_z.html b/doc/ref/repeat_from_to_d_z.html new file mode 100644 index 0000000..186763a --- /dev/null +++ b/doc/ref/repeat_from_to_d_z.html @@ -0,0 +1,73 @@ + + + BOOST_PP_REPEAT_FROM_TO_D_z + + + +
+ The BOOST_PP_REPEAT_FROM_TO_D_z macro represents a fast horizontal repetition construct.  + It reenters both BOOST_PP_REPEAT and BOOST_PP_WHILE with maximum efficiency. +
+

Usage

+
+ BOOST_PP_REPEAT_FROM_TO_D_z(d, first, last, macro, data) +
+

Arguments

+
+
z
+
+ The next available BOOST_PP_REPEAT dimension. +
+
d
+
+ The next available BOOST_PP_WHILE iteration. +
+
first
+
+ The lower bound of the repetition.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
last
+
+ The upper bound of the repetition. + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
macro
+
+ A ternary operation of the form macro(z, n, data).  + This macro is expanded by BOOST_PP_REPEAT with the next available repetition depth, + the current repetition number, and the auxiliary data argument.  +
+
data
+
+ Auxiliary data passed to macro. +
+
+

Remarks

+
+ This macro expands to the sequence: +
+ macro(z, first, data) macro(z, first + 1, data) ... macro(z, last - 1, data) +
+
+
+ The number of repetitions (i.e. last - first) must not exceed BOOST_PP_LIMIT_REPEAT. +
+
+ The z value that is passed to macro represents the next available repetition dimension.  + Other macros that have _Z suffix variants internally use BOOST_PP_REPEAT--for example, BOOST_PP_ENUM_PARAMS and BOOST_PP_ENUM_PARAMS_Z.  + Using these _Z versions is not strictly necessary, but passing the z value (that is passed to macro) to these macros allows them to reenter BOOST_PP_REPEAT with maximum efficiency. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/repeat_from_to.hpp> +
+ + diff --git a/doc/ref/repeat_from_to_z.html b/doc/ref/repeat_from_to_z.html new file mode 100644 index 0000000..3467529 --- /dev/null +++ b/doc/ref/repeat_from_to_z.html @@ -0,0 +1,94 @@ + + + BOOST_PP_REPEAT_FROM_TO_z + + + +
+ The BOOST_PP_REPEAT_FROM_TO_z macro represents a reentry into the BOOST_PP_REPEAT_FROM_TO repetition construct. +
+

Usage

+
+ BOOST_PP_REPEAT_FROM_TO_ ## z(first, last, macro, data) +
+

Arguments

+
+
z
+
+ The next available BOOST_PP_REPEAT dimension. +
+
first
+
+ The lower bound of the repetition.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
last
+
+ The upper bound of the repetition. + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
macro
+
+ A ternary operation of the form macro(z, n, data).  + This macro is expanded by BOOST_PP_REPEAT with the next available repetition depth, + the current repetition number, and the auxiliary data argument.  +
+
data
+
+ Auxiliary data passed to macro. +
+
+

Remarks

+
+ This macro expands to the sequence: +
+ macro(z, first, data) macro(z, first + 1, data) ... macro(z, last - 1, data) +
+
+
+ The number of repetitions (i.e. last - first) must not exceed BOOST_PP_LIMIT_REPEAT. +
+
+ At certain times, it may be necessary to perform the concatenation with BOOST_PP_CAT rather than the preprocessor token-pasting operator.  + This happens when the z value is a macro invocation itself.  + It needs a delay to allow it to expand.  + The syntax in such a scenario becomes: +
+ BOOST_PP_CAT(BOOST_PP_REPEAT_FROM_TO_, z)(count, macro, data). +
+
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/repeat_from_to.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/repetition/repeat_from_to.hpp>
+
+#define TEXT(z, n, data) n data
+
+#define MACRO(z, n, data) \
+  ( \
+     BOOST_PP_REPEAT_FROM_TO_ ## z( \
+        1, 4, \
+        TEXT, xyz \
+     ) \
+  ) \
+  /**/
+
+BOOST_PP_REPEAT(3, MACRO, _)
+   /*
+      expands to:
+      (1 xyz 2 xyz 3 xyz)
+      (1 xyz 2 xyz 3 xyz)
+      (1 xyz 2 xyz 3 xyz)
+   */
+
+ + diff --git a/doc/ref/repeat_z.html b/doc/ref/repeat_z.html new file mode 100644 index 0000000..b157bd5 --- /dev/null +++ b/doc/ref/repeat_z.html @@ -0,0 +1,89 @@ + + + BOOST_PP_REPEAT_z + + + +
+ The BOOST_PP_REPEAT_z macro represents a reentry into the BOOST_PP_REPEAT repetition construct. +
+

Usage

+
+ BOOST_PP_REPEAT_ ## z(count, macro, data) +
+

Arguments

+
+
z
+
+ The next available BOOST_PP_REPEAT dimension. +
+
count
+
+ The number of repetitious calls to macro.  + Valid values range from 0 to BOOST_PP_LIMIT_REPEAT. +
+
macro
+
+ A ternary operation of the form macro(z, n, data).  + This macro is expanded by BOOST_PP_REPEAT with the next available repetition depth, + the current repetition number, and the auxiliary data argument.  +
+
data
+
+ Auxiliary data passed to macro. +
+
+

Remarks

+
+ This macro expands to the sequence: +
+ macro(z, 0, data) macro(z, 1, data) ... macro(z, count - 1, data) +
+
+
+ At certain times, it may be necessary to perform the concatenation with BOOST_PP_CAT rather than the preprocessor token-pasting operator.  + This happens when the z value is a macro invocation itself.  + It needs a delay to allow it to expand.  + The syntax in such a scenario becomes: +
+ BOOST_PP_CAT(BOOST_PP_REPEAT_, z)(count, macro, data) +
+
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/repetition/repeat.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/punctuation/comma_if.hpp>
+#include <boost/preprocessor/repetition/repeat.hpp>
+
+#define TEXT(z, n, text) BOOST_PP_COMMA_IF(n) text
+
+#define TEMPLATE(z, n, _) \
+   BOOST_PP_COMMA_IF(n) \
+   template< \
+      BOOST_PP_REPEAT_ ## z( \
+         BOOST_PP_INC(n), \
+         TEXT, class \
+      ) \
+   > class T ## n \
+   /**/
+
+BOOST_PP_REPEAT(3, TEMPLATE, nil)
+   /*
+   expands to:
+      template<class> class T0,
+      template<class, class> class T1,
+      template<class, class, class> class T2
+   */
+
+ + diff --git a/doc/ref/rparen.html b/doc/ref/rparen.html new file mode 100644 index 0000000..a833ae8 --- /dev/null +++ b/doc/ref/rparen.html @@ -0,0 +1,42 @@ + + + BOOST_PP_RPAREN + + + +
+ The BOOST_PP_RPAREN macro expands to a right parenthesis. +
+

Usage

+
+ BOOST_PP_RPAREN() +
+

Remarks

+
+ The preprocessor interprets parentheses as delimiters in macro invocations.  + Because of this, parentheses require special handling. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/punctuation/paren.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/facilities/empty.hpp>
+#include <boost/preprocessor/punctuation/paren.hpp>
+
+#define X(x) x
+#define MACRO(x, p) X ( x p
+
+MACRO(abc, BOOST_PP_RPAREN()) // expands to abc
+
+#define Y(x)
+
+MACRO(BOOST_PP_EMPTY BOOST_PP_RPAREN()(), 10) // expands to 10
+
+ + diff --git a/doc/ref/rparen_if.html b/doc/ref/rparen_if.html new file mode 100644 index 0000000..db195b4 --- /dev/null +++ b/doc/ref/rparen_if.html @@ -0,0 +1,50 @@ + + + BOOST_PP_RPAREN_IF + + + +
+ The BOOST_PP_RPAREN_IF macro conditionally expands to a right parenthesis. +
+

Usage

+
+ BOOST_PP_RPAREN_IF(cond) +
+

Arguments

+
+
cond
+
+ The condition that determines if a the macro expands to a right parenthesis or nothing.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ If cond expands to 0, this macro expands to nothing.  + Otherwise, it expands to a right parenthesis. +
+
+ The preprocessor interprets parentheses as delimiters in macro invocations.  + Because of this, parentheses require special handling. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/punctuation/paren_if.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/punctuation/paren_if.hpp>
+
+#define MACRO(c, x) BOOST_PP_LPAREN_IF(c) x BOOST_PP_RPAREN_IF(c)
+
+MACRO(0, text) // expands to text
+MACRO(1, text) // expands to (text)
+
+ + diff --git a/doc/ref/slot.html b/doc/ref/slot.html new file mode 100644 index 0000000..1455477 --- /dev/null +++ b/doc/ref/slot.html @@ -0,0 +1,49 @@ + + + BOOST_PP_SLOT + + + +
+ The BOOST_PP_SLOT macro retrieves a value previously evaluated by BOOST_PP_ASSIGN_SLOT. +
+

Usage

+
+ #include BOOST_PP_SLOT(i) +
+

Arguments

+
+
i
+
+ The slot index to be retrieved.  + This value must be in the range of 1 to BOOST_PP_LIMIT_SLOT_COUNT. +
+
+

Remarks

+
+ Prior to use, the slot at index i must have been assigned with BOOST_PP_ASSIGN_SLOT. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/slot/slot.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/slot/slot.hpp>
+
+#define X() 4
+
+#define BOOST_PP_VALUE 1 + 2 + 3 + X()
+#include BOOST_PP_ASSIGN_SLOT(1)
+
+#undef X
+
+BOOST_PP_SLOT(1) // expands to 10
+
+ + diff --git a/doc/ref/stringize.html b/doc/ref/stringize.html new file mode 100644 index 0000000..160ff14 --- /dev/null +++ b/doc/ref/stringize.html @@ -0,0 +1,39 @@ + + + BOOST_PP_STRINGIZE + + + +
+ The BOOST_PP_STRINGIZE macro stringizes its argument after it has been expanded. +
+

Usage

+
+ BOOST_PP_STRINGIZE(text) +
+

Arguments

+
+
text
+
+ The text to be converted to a string literal. +
+
+

Remarks

+
+ The preprocessor stringizing operator (#) prevents arguments from expanding.  + This macro allows its argument to expand before it is stringized. +
+ +

Requirements

+
+ Header:  <boost/preprocessor/stringize.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/stringize.hpp>
+
+BOOST_PP_STRINGIZE(BOOST_PP_CAT(a, b)) // expands to "ab"
+
+ + diff --git a/doc/ref/sub.html b/doc/ref/sub.html new file mode 100644 index 0000000..7030124 --- /dev/null +++ b/doc/ref/sub.html @@ -0,0 +1,52 @@ + + + BOOST_PP_SUB + + + +
+ The BOOST_PP_SUB macro expands to the difference between its arguments. +
+

Usage

+
+ BOOST_PP_SUB(x, y) +
+

Arguments

+
+
x
+
+ The minuend of the operation.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
y
+
+ The subtrahend of the operation.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ If the difference between x and y is less than 0, the result is saturated to 0. +
+
+ Previously, this macro could not be used inside BOOST_PP_WHILE.  + There is no longer any such restriction.  + It is more efficient, however, to use BOOST_PP_SUB_D in such a situation. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/arithmetic/sub.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/arithmetic/sub.hpp>
+
+BOOST_PP_SUB(4, 3) // expands to 1
+
+ + diff --git a/doc/ref/sub_d.html b/doc/ref/sub_d.html new file mode 100644 index 0000000..11db2e2 --- /dev/null +++ b/doc/ref/sub_d.html @@ -0,0 +1,74 @@ + + + BOOST_PP_SUB_D + + + +
+ The BOOST_PP_SUB_D macro expands to the difference between its second and third arguments.  + It reenters BOOST_PP_WHILE with maximum efficiency. +
+

Usage

+
+ BOOST_PP_SUB_D(d, x, y) +
+

Arguments

+
+
d
+
+ The next available BOOST_PP_WHILE iteration.  +
+
x
+
+ The minuend of the operation.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
y
+
+ The subtrahend of the operation.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ If the difference between x and y is less than 0, the result is saturated to 0. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/arithmetic/sub.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/arithmetic/dec.hpp>
+#include <boost/preprocessor/arithmetic/sub.hpp>
+#include <boost/preprocessor/control/while.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+
+#define PRED(d, data) BOOST_PP_TUPLE_ELEM(2, 0, data)
+
+#define OP(d, data) \
+   ( \
+      BOOST_PP_DEC( \
+         BOOST_PP_TUPLE_ELEM(2, 0, data) \
+      ), \
+      BOOST_PP_SUB_D( \
+         d, \
+         BOOST_PP_TUPLE_ELEM(2, 1, data), \
+         2 \
+      ) \
+   ) \
+   /**/
+
+// decrement 'x' by 2 'n' times
+#define STRIDE(x, n) BOOST_PP_TUPLE_ELEM(2, 1, BOOST_PP_WHILE(PRED, OP, (n, x)))
+
+STRIDE(10, 2) // expands to 6
+STRIDE(14, 6) // expands to 2
+
+ + diff --git a/doc/ref/tuple_eat.html b/doc/ref/tuple_eat.html new file mode 100644 index 0000000..ac2b0f4 --- /dev/null +++ b/doc/ref/tuple_eat.html @@ -0,0 +1,47 @@ + + + BOOST_PP_TUPLE_EAT + + + +
+ The BOOST_PP_TUPLE_EAT macro expands to a macro that eats a tuple of the specified size. +
+

Usage

+
+ BOOST_PP_TUPLE_EAT(size) +
+

Arguments

+
+
size
+
+ The size of the tuple to be eaten.  + Valid tuple sizes range from 0 to BOOST_PP_LIMIT_TUPLE.  +
+
+

Remarks

+
+ The size argument must be the actual size of the tuple. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/tuple/eat.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/control/if.hpp>
+#include <boost/preprocessor/tuple/eat.hpp>
+
+#define OP(a, b) (a b)
+
+#define MACRO(n) BOOST_PP_IF(n, OP, BOOST_PP_TUPLE_EAT(2))(1, 2)
+
+MACRO(0) // expands to nothing
+MACRO(1) // expands to (1, 2)
+
+ + diff --git a/doc/ref/tuple_elem.html b/doc/ref/tuple_elem.html new file mode 100644 index 0000000..b561e74 --- /dev/null +++ b/doc/ref/tuple_elem.html @@ -0,0 +1,54 @@ + + + BOOST_PP_TUPLE_ELEM + + + +
+ The BOOST_PP_TUPLE_ELEM macro extracts an element from a tuple. +
+

Usage

+
+ BOOST_PP_TUPLE_ELEM(size, i, tuple) +
+

Arguments

+
+
size
+
+ The size of the tuple.  + Valid tuple sizes range from 0 to BOOST_PP_LIMIT_TUPLE.  +
+
i
+
+ The zero-based index into the tuple of the element to be extracted.  + Valid values range from 0 to size - 1. +
+
tuple
+
+ The tuple from which an element is to be extracted. +
+
+

Remarks

+
+ The size argument must be the actual size of the tuple, + and i must be less than the size of the tuple. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/tuple/elem.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/tuple/elem.hpp>
+
+#define TUPLE (a, b, c, d)
+
+BOOST_PP_TUPLE_ELEM(4, 0, TUPLE) // expands to a
+BOOST_PP_TUPLE_ELEM(4, 3, TUPLE) // expands to d
+
+ + diff --git a/doc/ref/tuple_rem.html b/doc/ref/tuple_rem.html new file mode 100644 index 0000000..779fbd4 --- /dev/null +++ b/doc/ref/tuple_rem.html @@ -0,0 +1,41 @@ + + + BOOST_PP_TUPLE_REM + + + +
+ The BOOST_PP_TUPLE_REM macro expands to a macro that removes the parentheses from a tuple of the specified size. +
+

Usage

+
+ BOOST_PP_TUPLE_REM(size) +
+

Arguments

+
+
size
+
+ The size of the tuple from which the parentheses are to be removed.  + Valid tuple sizes range from 0 to BOOST_PP_LIMIT_TUPLE.  +
+
+

Remarks

+
+ The size argument must be the actual size of the tuple. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/tuple/rem.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/tuple/rem.hpp>
+
+BOOST_PP_TUPLE_REM(3)(x, y, z) // expands to x, y, z
+
+ + diff --git a/doc/ref/tuple_reverse.html b/doc/ref/tuple_reverse.html new file mode 100644 index 0000000..3db79b6 --- /dev/null +++ b/doc/ref/tuple_reverse.html @@ -0,0 +1,45 @@ + + + BOOST_PP_TUPLE_REVERSE + + + +
+ The BOOST_PP_TUPLE_REVERSE macro reverses a tuple of the specified size. +
+

Usage

+
+ BOOST_PP_TUPLE_REVERSE(size, tuple) +
+

Arguments

+
+
size
+
+ The size of the tuple to be reversed.  + Valid tuple sizes range from 0 to BOOST_PP_LIMIT_TUPLE.  +
+
tuple
+
+ The tuple to be reversed. +
+
+

Remarks

+
+ The size argument must be the actual size of the tuple. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/tuple/reverse.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/tuple/reverse.hpp>
+
+BOOST_PP_TUPLE_REVERSE(3, (x, y, z)) // expands to (z, y, x)
+
+ + diff --git a/doc/ref/tuple_to_list.html b/doc/ref/tuple_to_list.html new file mode 100644 index 0000000..1104f7f --- /dev/null +++ b/doc/ref/tuple_to_list.html @@ -0,0 +1,46 @@ + + + BOOST_PP_TUPLE_TO_LIST + + + +
+ The BOOST_PP_TUPLE_TO_LIST macro converts a tuple to a list. +
+

Usage

+
+ BOOST_PP_TUPLE_TO_LIST(size, tuple) +
+

Arguments

+
+
size
+
+ The size of the tuple to be converted.  + Valid tuple sizes range from 0 to BOOST_PP_LIMIT_TUPLE.  +
+
tuple
+
+ The tuple to be converted. +
+
+

Remarks

+
+ The size argument must be the actual size of the tuple. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/tuple/to_list.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/tuple/to_list.hpp>
+
+BOOST_PP_TUPLE_TO_LIST(3, (x, y, z))
+   // expands to (x, (y, (z, BOOST_PP_NIL)))
+
+ + diff --git a/doc/ref/value.html b/doc/ref/value.html new file mode 100644 index 0000000..df87afa --- /dev/null +++ b/doc/ref/value.html @@ -0,0 +1,26 @@ + + + BOOST_PP_VALUE + + + +
+ The BOOST_PP_VALUE macro is a user-defined named external argument to BOOST_PP_ASSIGN_SLOT. +
+

Usage

+
+ #define BOOST_PP_VALUE value +
+

Arguments

+
+
value
+
+ An intergral constant expression to be evaluated by BOOST_PP_ASSIGN_SLOT. +
+
+

See Also

+ + + diff --git a/doc/ref/while.html b/doc/ref/while.html new file mode 100644 index 0000000..4536003 --- /dev/null +++ b/doc/ref/while.html @@ -0,0 +1,105 @@ + + + BOOST_PP_WHILE + + + +
+ The BOOST_PP_WHILE macro represents a looping construct. +
+

Usage

+
+ BOOST_PP_WHILE(pred, op, state) +
+

Arguments

+
+
pred
+
+ A binary predicate of the form pred(d, state).  + This predicate is expanded by BOOST_PP_WHILE with the next available + iteration d and the current state.  + This predicate must expand to value in the range of 0 to BOOST_PP_LIMIT_MAG. + The construct continues to loop until this predicate returns 0.  + When this predicate returns 0, BOOST_PP_WHILE returns the current state. +
+
op
+
+ A binary operation of the form op(d, state).  + This operation is expanded by BOOST_PP_WHILE with the next available + iteration d and the current state.  + This macro is repeatedly applied to the state, each time producing a new state, until pred returns 0. +
+
state
+
+ The initial state.  + Often this argument is a tuple. +
+
+

Remarks

+
+ This macro iterates op(d, state) while pred(d, state) is non-zero.  + In other words expands to: +
+ op(d, ... op(d, op(d, state)) ... ). +
+
+
+ The d value that is passed to both pred and op represents the next available iteration.  + Other macros that have _D suffix variants internally use BOOST_PP_WHILE--for example, BOOST_PP_ADD and BOOST_PP_ADD_D.  + Using these _D versions is not strictly necessary, but passing the d value (that passed to pred or op) to these macros allows them to reenter BOOST_PP_WHILE with maximum efficiency. +
+
+ To directly use this d value, rather than simply passing it to another macro, see BOOST_PP_WHILE_d. +
+
+ Previously, this macro could not be used recursively inside BOOST_PP_WHILE.  + This limitation no longer exists, as the library can automatically detect the next available iteration. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/control/while.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/arithmetic/add.hpp>
+#include <boost/preprocessor/control/while.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+
+#define PRED(n, state) BOOST_PP_TUPLE_ELEM(2, 1, state)
+
+#define OP(d, state) \
+   OP_D( \
+      d, \
+      BOOST_PP_TUPLE_ELEM(2, 0, state), \
+      BOOST_PP_TUPLE_ELEM(2, 1, state) \
+   ) \
+   /**/
+
+#define OP_D(d, res, c) \
+   ( \
+      BOOST_PP_ADD_D( \
+         d, \
+         res, \
+         BOOST_PP_DEC(c) \
+      ), \
+      BOOST_PP_DEC(c) \
+   ) \
+   /**/
+
+#define SUMMATION(n) \
+   BOOST_PP_TUPLE_ELEM( \
+      2, 0, \
+      BOOST_PP_WHILE(PRED, OP, (n, n)) \
+   ) \
+   /**/
+
+SUMMATION(3) // expands to 6
+SUMMATION(4) // expands to 10
+
+ + diff --git a/doc/ref/while_d.html b/doc/ref/while_d.html new file mode 100644 index 0000000..a186c2d --- /dev/null +++ b/doc/ref/while_d.html @@ -0,0 +1,118 @@ + + + BOOST_PP_WHILE_d + + + +
+ The BOOST_PP_WHILE_d macro represents a reentry into the BOOST_PP_WHILE looping construct. +
+

Usage

+
+ BOOST_PP_WHILE_ ## d(pred, op, state) +
+

Arguments

+
+
d
+
+ The next available BOOST_PP_WHILE iteration. +
+
pred
+
+ A binary predicate of the form pred(d, state).  + This predicate is expanded by BOOST_PP_WHILE with the next available + iteration d and the current state.  + This predicate must expand to value in the range of 0 to BOOST_PP_LIMIT_MAG. + The construct continues to loop until this predicate returns 0.  + When this predicate returns 0, BOOST_PP_WHILE returns the current state. +
+
op
+
+ A binary operation of the form op(d, state).  + This operation is expanded by BOOST_PP_WHILE with the next available + iteration d and the current state.  + This macro is repeatedly applied to the state, each time producing a new state, until pred returns 0. +
+
state
+
+ The initial state.  + Often this argument is a tuple. +
+
+

Remarks

+
+ This macro iterates op(d, state) while pred(d, state) is non-zero.  + In other words expands to: +
+ op(d, ... op(d, op(d, state)) ... ). +
+
+
+ At certain times, it may be necessary to perform the concatenation with BOOST_PP_CAT rather than the preprocessor token-pasting operator.  + This happens when the d value is a macro invocation itself.  + It needs a delay to allow it to expand.  + The syntax in such a scenario becomes: +
+ BOOST_PP_CAT(BOOST_PP_WHILE_, d)(pred, op, state). +
+
+
+ Previously, it was possible to concatenate d directly to BOOST_PP_WHILE (without the trailing underscore).  + This is no longer supported. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/control/while.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/arithmetic/add.hpp>
+#include <boost/preprocessor/arithmetic/dec.hpp>
+#include <boost/preprocessor/array/elem.hpp>
+#include <boost/preprocessor/array/size.hpp>
+#include <boost/preprocessor/control/while.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+
+#define PRED(d, data) BOOST_PP_TUPLE_ELEM(3, 1, data)
+
+#define OP(d, data) \
+   OP_D( \
+      d, \
+      BOOST_PP_TUPLE_ELEM(3, 0, data), \
+      BOOST_PP_TUPLE_ELEM(3, 1, data), \
+      BOOST_PP_TUPLE_ELEM(3, 2, data) \
+   ) \
+   /**/
+
+#define OP_D(d, res, i, array) \
+   ( \
+      BOOST_PP_ADD_D( \
+         d, res, \
+         BOOST_PP_ARRAY_ELEM(BOOST_PP_DEC(i), array)), \
+      BOOST_PP_DEC(i), \
+      array \
+   ) \
+   /**/
+
+#define ACCUMULATE_D(d, array) \
+   BOOST_PP_TUPLE_ELEM( \
+      3, 0, \
+      BOOST_PP_WHILE_ ## d( \
+         PRED, OP, \
+         (0, BOOST_PP_ARRAY_SIZE(array), array) \
+      ) \
+   ) \
+   /**/
+
+#define ARRAY (4, (1, 2, 3, 4))
+
+ACCUMULATE_D(1, ARRAY)// expands to 10
+
+ + diff --git a/doc/ref/xor.html b/doc/ref/xor.html new file mode 100644 index 0000000..84141e0 --- /dev/null +++ b/doc/ref/xor.html @@ -0,0 +1,53 @@ + + + BOOST_PP_XOR + + + +
+ The BOOST_PP_XOR macro expands to the logical XOR of its operands. +
+

Usage

+
+ BOOST_PP_XOR(p, q) +
+

Arguments

+
+
p
+
+ The left operand of the operation.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
q
+
+ The right operand of the operation.  + Valid values range from 0 to BOOST_PP_LIMIT_MAG. +
+
+

Remarks

+
+ If either p or q is non-zero exclusively, this macro expands to 1.  + Otherwise, it expands to 0. +
+
+ This macro performs a boolean conversion on each operand before performing the logical XOR operation.  + If that conversion is not necessary, use BOOST_PP_BITXOR instead. +
+

See Also

+ +

Requirements

+
+ Header:  <boost/preprocessor/logical/xor.hpp> +
+

Sample Code

+
+#include <boost/preprocessor/logical/xor.hpp>
+
+BOOST_PP_XOR(4, 3) // expands to 0
+BOOST_PP_XOR(5, 0) // expands to 1
+
+ + diff --git a/doc/resources.html b/doc/resources.html new file mode 100644 index 0000000..5945b32 --- /dev/null +++ b/doc/resources.html @@ -0,0 +1,15 @@ + + + resources.html + + + + +

Resources [back]

+ + + diff --git a/doc/styles.css b/doc/styles.css new file mode 100644 index 0000000..47d780e --- /dev/null +++ b/doc/styles.css @@ -0,0 +1,79 @@ +a { + color: black; + font-weight: normal; +} +a.na:link, a.na:visited { + color: #dddddd; + text-decoration: line-through; +} +a:link, a:visited, a:active { + color: gray; + text-decoration: none; +} +a.local { + font-weight: bold; +} +a:hover, a.na:hover { + color: blue; +} +body { + color: black; background-color: white; +} +.code { + color: black; background-color: #dddddd; + letter-spacing: 1px; + border: 1px solid; border-color: black; + padding-left: 12px; padding-right: 12px; padding-top: 5px; padding-bottom: 5px; + margin-left: 20px; +} +dd { + padding-left: 40px; + margin-left: 0px; margin-bottom: 10px; +} +div { + margin-top: 10px; margin-bottom: 10px; margin-left: 20px; +} +dl { + margin-top: 0px; margin-bottom: 0px; +} +dt { + font-style: italic; + padding-left: 20px; + margin-top: 10px; +} +h4, h5 { + margin-top: 10px; margin-bottom: 10px; +} +hr { + margin-top: 0px; margin-bottom: 0px; +} +.incompatibility { + color: red; +} +.indent { + margin-top: 0px; margin-bottom: 0px; +} +pre { + letter-spacing: 1px; + padding: 0px; + margin: 0px; +} +pre a:hover { + color: orange; +} +s { + color: #dddddd; +} +.sig { + font-style: italic; + color: #aaaaaa; + text-align: right; +} +span { + display: block; + margin: 0px; +} +ul { + margin-top: 10px; margin-bottom: 10px; margin-left: 20px; + padding-left: 17px; +} diff --git a/doc/syntax.html b/doc/syntax.html new file mode 100644 index 0000000..a50651d --- /dev/null +++ b/doc/syntax.html @@ -0,0 +1,215 @@ + + + syntax.html + + + +

Identifiers for Syntax Highlighting

+
+ADD
+ADD_D
+AND
+APPLY
+ARRAY_DATA
+ARRAY_ELEM
+ARRAY_SIZE
+ASSERT
+ASSERT_MSG
+ASSIGN_SLOT
+ +BITAND
+BITNOR
+BITOR
+BITXOR
+BOOL
+ +CAT
+COMMA
+COMMA_IF
+COMPL
+CONFIG_EXTENDED_LINE_INFO
+ +DEC
+DEDUCE_D
+DEDUCE_R
+DEDUCE_Z
+DIV
+DIV_D
+ +EMPTY
+ENUM
+ENUM_BINARY_PARAMS
+ENUM_BINARY_PARAMS_Z
+ENUM_PARAMS
+ENUM_PARAMS_WITH_A_DEFAULT
+ENUM_PARAMS_WITH_DEFAULTS
+ENUM_PARAMS_Z
+ENUM_SHIFTED
+ENUM_SHIFTED_PARAMS
+ENUM_SHIFTED_PARAMS_Z
+ENUM_SHIFTED_
+ENUM_TRAILING
+ENUM_TRAILING_BINARY_PARAMS
+ENUM_TRAILING_BINARY_PARAMS_Z
+ENUM_TRAILING_PARAMS
+ENUM_TRAILING_PARAMS_Z
+ENUM_TRAILING_
+ENUM_
+EQUAL
+EQUAL_D
+EXPAND
+EXPR_IF
+EXPR_IIF
+ +FILENAME_x
+FOR
+FOR_
+FRAME_FINISH
+FRAME_FLAGS
+FRAME_ITERATION
+FRAME_START
+ +GREATER
+GREATER_D
+GREATER_EQUAL
+GREATER_EQUAL_D
+ +IDENTITY
+IF
+IIF
+INC
+INCLUDE_SELF
+INDIRECT_SELF
+INTERCEPT
+IS_ITERATING
+IS_SELFISH
+ITERATE
+ITERATION
+ITERATION_DEPTH
+ITERATION_FINISH
+ITERATION_FLAGS
+ITERATION_LIMITS
+ITERATION_PARAMS_x
+ITERATION_START
+ +LESS
+LESS_D
+LESS_EQUAL
+LESS_EQUAL_D
+LIMIT_DIM
+LIMIT_FOR
+LIMIT_ITERATION
+LIMIT_ITERATION_DIM
+LIMIT_MAG
+LIMIT_REPEAT
+LIMIT_SLOT_COUNT
+LIMIT_SLOT_SIG
+LIMIT_TUPLE
+LIMIT_WHILE
+LINE
+LIST_APPEND
+LIST_APPEND_D
+LIST_AT
+LIST_AT_D
+LIST_CAT
+LIST_CAT_D
+LIST_CONS
+LIST_ENUM
+LIST_ENUM_R
+LIST_FILTER
+LIST_FILTER_D
+LIST_FIRST
+LIST_FIRST_N
+LIST_FIRST_N_D
+LIST_FOLD_LEFT
+LIST_FOLD_LEFT_2ND
+LIST_FOLD_LEFT_2ND_D
+LIST_FOLD_LEFT_
+LIST_FOLD_LEFT_D
+LIST_FOLD_RIGHT
+LIST_FOLD_RIGHT_2ND
+LIST_FOLD_RIGHT_2ND_D
+LIST_FOLD_RIGHT_
+LIST_FOLD_RIGHT_D
+LIST_FOR_EACH
+LIST_FOR_EACH_I
+LIST_FOR_EACH_I_R
+LIST_FOR_EACH_PRODUCT
+LIST_FOR_EACH_PRODUCT_R
+LIST_FOR_EACH_R
+LIST_IS_CONS
+LIST_IS_NIL
+LIST_NIL
+LIST_REST
+LIST_REST_N
+LIST_REST_N_D
+LIST_REVERSE
+LIST_REVERSE_D
+LIST_SIZE
+LIST_SIZE_D
+LIST_TO_TUPLE
+LIST_TO_TUPLE_R
+LIST_TRANSFORM
+LIST_TRANSFORM_D
+LOCAL_ITERATE
+LOCAL_LIMITS
+LOCAL_MACRO
+LPAREN
+LPAREN_IF
+ +MAX
+MAX_D
+MIN
+MIN_D
+MOD
+MOD_D
+MUL
+MUL_D
+ +NIL
+NOR
+NOT
+NOT_EQUAL
+NOT_EQUAL_D
+ +OR
+ +RELATIVE_FINISH
+RELATIVE_FLAGS
+RELATIVE_ITERATION
+RELATIVE_START
+REPEAT
+REPEAT_1ST
+REPEAT_2ND
+REPEAT_3RD
+REPEAT_FROM_TO
+REPEAT_FROM_TO_1ST
+REPEAT_FROM_TO_2ND
+REPEAT_FROM_TO_3RD
+REPEAT_FROM_TO_D
+REPEAT_FROM_TO_D_
+REPEAT_FROM_TO_
+REPEAT_
+RPAREN
+RPAREN_IF
+ +SLOT
+STRINGIZE
+SUB
+SUB_D
+ +TUPLE_EAT
+TUPLE_ELEM
+TUPLE_REM
+TUPLE_REVERSE
+TUPLE_TO_LIST
+ +VALUE
+ +WHILE
+WHILE_
+ +XOR
+
+ + diff --git a/doc/terms.html b/doc/terms.html new file mode 100644 index 0000000..d5e6f79 --- /dev/null +++ b/doc/terms.html @@ -0,0 +1,14 @@ + + + terms.html + + + + +

Terminology [back]

+ + + diff --git a/doc/terms/evaluated.html b/doc/terms/evaluated.html new file mode 100644 index 0000000..11507c3 --- /dev/null +++ b/doc/terms/evaluated.html @@ -0,0 +1,16 @@ + + + Evaluated Parameter + + + +

Evaluated Parameter

+
+ An evaluated parameter is a numeric value that is evaluated by the library as a constant expression.  + This means that the expression can include simple arithmetic, logical, and condition expressions.  + It also means that the value of the parameter no longer depends on the source of the parameter.  + In other words, if the value is dependent on some macro, it will no longer be dependent on that macro after it is evaluated.  + This disables the lazy-evaluation that the preprocessor normallly uses. +
+ + diff --git a/doc/terms/named_external.html b/doc/terms/named_external.html new file mode 100644 index 0000000..e1faf39 --- /dev/null +++ b/doc/terms/named_external.html @@ -0,0 +1,14 @@ + + + Named External Argument + + + +

Named External Argument

+
+ A named external argument is an argument to a macro that is included.  + There is no way to pass arguments to a file directly, so they must be passed to files in the form of macros with known names that are defined by the user.  + Every time that the library uses this idiom, the file that is included automatically undefines the macro in order to better simulate normal parameters. +
+ + diff --git a/doc/top.html b/doc/top.html new file mode 100644 index 0000000..e061a5b --- /dev/null +++ b/doc/top.html @@ -0,0 +1,27 @@ + + + top.html + + + + + + + + +
+ The Boost Library
+ Preprocessor Subset for C/C++ +
+ + diff --git a/doc/topics.html b/doc/topics.html new file mode 100644 index 0000000..76b938c --- /dev/null +++ b/doc/topics.html @@ -0,0 +1,20 @@ + + + topics.html + + + + +

Topics [back]

+ + + diff --git a/doc/topics/evaluated_slots.html b/doc/topics/evaluated_slots.html new file mode 100644 index 0000000..e0879b3 --- /dev/null +++ b/doc/topics/evaluated_slots.html @@ -0,0 +1,146 @@ + + + evaluated_slots.html + + + +

Evaluated Slots

+
+ The evaluated slot mechanism is a tool to fully evaluate a constant integral expression and avoid the lazy evaluation normally performed by the preprocessor. +
+

Tutorial

+
+ In order to understand the use of such a mechanism, I will start with a simple file-iteration example.  + Consider the following scenario.... +
+
+for (int i = 0; i < 10; ++i) {
+   for (int j = 0; j < i; ++j) {
+      // ... use i and j
+   }
+}
+
+
+ The above is a simple runtime model of the following multidimensional file-iteration.... +
+
+// file.hpp
+#if !BOOST_PP_IS_ITERATING
+   #ifndef FILE_HPP_
+   #define FILE_HPP_
+
+   #include <boost/preprocessor/iteration/iterate.hpp>
+
+   #define BOOST_PP_ITERATION_PARAMS_1 (3, (0, 9, "file.hpp"))
+   #include BOOST_PP_ITERATE()
+
+   #endif // FILE_HPP_
+#elif BOOST_PP_ITERATION_DEPTH() == 1
+   #define I BOOST_PP_ITERATION()
+
+   #define BOOST_PP_ITERATION_PARAMS_2 (3, (0, I, "file.hpp"))
+   #include BOOST_PP_ITERATE()
+
+   #undef I
+#elif BOOST_PP_ITERATION_DEPTH() == 2
+   #define J BOOST_PP_ITERATION()
+
+   // use I and J
+
+   #undef J
+#endif
+
+
+ There is a problem with the code above.  + The writer expected I to refer the previous iteration frame.  + However, that is not the case.  + When the user refers to I, he is actually referring to BOOST_PP_ITERATION(), + not the value of BOOST_PP_ITERATION() at the point of definition.  + Instead, it refers to exactly the same value to which J refers. +
+
+ The problem is that the preprocessor always evaluates everything with lazy evaluation.  + To solve the problem, we need I to be evaluated here: +
+
+// ...
+#elif BOOST_PP_ITERATION_DEPTH() == 1
+   #define I BOOST_PP_ITERATION()
+// ...
+
+
+ Fortunately, the library offers a mechanism to do just that:  evaluated slots.  + The following code uses this mechanism to "fix" the example above... +
+
+// ...
+#elif BOOST_PP_ITERATION_DEPTH() == 1
+   #define BOOST_PP_VALUE BOOST_PP_ITERATION()
+   #include BOOST_PP_ASSIGN_SLOT(1)
+   #define I BOOST_PP_SLOT(1)
+// ...
+
+
+ There are two steps to the assignment of an evaluated slot.  + First, the user must define the named external argument BOOST_PP_VALUE.  + This value must be an integral constant expression.  + Second, the user must include BOOST_PP_ASSIGN_SLOT(x), where x is the particular slot to be assigned to (1 to BOOST_PP_LIMIT_SLOT_COUNT).  + This will evaluate BOOST_PP_VALUE and assign the result to the slot at index x. +
+
+ To retrieve a slot's value, the user must use BOOST_PP_SLOT(x). +
+
+ In the case above, I is still lazily evaluated.  + However, it now evaluates to BOOST_PP_SLOT(1).  + This value will not change unless there is a subsequent call to BOOST_PP_ASSIGN_SLOT(1). +
+

Advanced Techniques

+
+ The slot mechanism can also be used to perform calculations: +
+
+#include <iostream>
+
+#include <boost/preprocessor/slot/slot.hpp>
+#include <boost/preprocessor/stringize.hpp>
+
+#define X() 4
+
+#define BOOST_PP_VALUE 1 + 2 + 3 + X()
+#include BOOST_PP_ASSIGN_SLOT(1)
+
+#undef X
+
+int main(void) {
+   std::cout
+      << BOOST_PP_STRINGIZE(BOOST_PP_SLOT(1))
+      << &std::endl;
+   return 0;
+}
+
+
+ In essence, anything that can be evaluated in an #if (or #elif) preprocessor directive is available except the defined operator. +
+
+ It is even possible to use a particular slot itself while reassigning it: +
+
+#define BOOST_PP_VALUE 20
+#include BOOST_PP_ASSIGN_SLOT(1)
+
+#define BOOST_PP_VALUE 2 * BOOST_PP_SLOT(1)
+#include BOOST_PP_ASSIGN_SLOT(1)
+
+BOOST_PP_SLOT(1) // 40
+
+

See Also

+ +
- Paul Mensonides
+ + diff --git a/doc/topics/file_iteration.html b/doc/topics/file_iteration.html new file mode 100644 index 0000000..6b72479 --- /dev/null +++ b/doc/topics/file_iteration.html @@ -0,0 +1,921 @@ + + + file_iteration.html + + + +

File Iteration

+
+ File iteration is a complex, but powerful, vertical repetition construct.  + It repeatedly includes a file for each number in a user-specified range. +
+

Tutorial

+
+ This mechanism requires two pieces of information to operate:  + a range to iterate over and a file to include on each iteration.  + It can optionally take a third piece of information that represents flags used to discriminate between + different iterations of the same file.  + This information is obtained by the mechanism through one or two named external arguments.  + These arguments are specified as user-defined macros named BOOST_PP_ITERATION_PARAMS_x + or the combination of BOOST_PP_FILENAME_x and BOOST_PP_ITERATION_LIMITS. +
+
+ BOOST_PP_ITERATION_LIMITS specifies the range of values to iterate over.  + It must expand to a tuple containing two elements--a lower and upper bound.  + Both the upper and lower bounds must be numeric values in the range of 0 to BOOST_PP_LIMIT_ITERATION.  + For example, if the user wishes a file to be included for numbers ranging from 0 to 10, + BOOST_PP_ITERATION_LIMITS would be defined like this: +
+
+#define BOOST_PP_ITERATION_LIMITS (0, 10)
+
+
+ Note that there is whitespace after the name of the macro.  + The macro does not take two arguments.  + In the case above, if there was no whitespace, a preprocessing error would occur because 0 and 10 + are invalid identifiers. +
+
+ Both the upper and lower bounds specified in the BOOST_PP_ITERATION_LIMITS macro are evaluated parameters.  + This implies that they can include simple arithmetic or logical expressions.  + For instance, the above definition could easily have been written like this: +
+
+#define N() 5
+#define BOOST_PP_ITERATION_LIMITS (0, N() + 5)
+
+
+ Because of this, if the whitespace after the macro name is elided, it is possible for the + definition to be syntactically valid: +
+
+#define A 0
+#define B 10
+#define BOOST_PP_ITERATION_LIMITS(A, B)
+   // note:  no whitespace       ^
+
+
+ If this happens, an error will occur inside the mechanism when it attempts to use this macro.  + The error messages that result may be obscure, so always remember to include the whitespace.  + A correct version of the above looks like this: +
+
+#define A 0
+#define B 10
+#define BOOST_PP_ITERATION_LIMITS (A, B)
+   // note:  has whitespace      ^
+
+
+ BOOST_PP_FILENAME_x specifies the file to iterate over.  + The x is a placeholder for the dimension of iteration.  + (For now, we'll assume this is 1--i.e. the first dimension, + so we are actually dealing with BOOST_PP_FILENAME_1.)  + This macro must expand to a valid filename--in quotes or in angle brackets depending on how the file is accessed: +
+
+#define BOOST_PP_FILENAME_1 "file.h"
+// -or-
+#define BOOST_PP_FILENAME_1 <file.h>
+
+
+ All that we need now to perform a simple file iteration is to invoke the mechanism: +
+
+??=include BOOST_PP_ITERATE()
+
+
+ (The ??= token is a trigraph for #.  + I use the trigraph to make it clear that I am including a file rather than defining or expanding a macro, but it is not necessary.  + Even the digraph version, %:, could be used.  + Some compilers do not readily accept trigraphs and digraphs, so keep that in mind.  + Other than that, use whichever one you prefer.) +
+
+ So, if we wish to iterate "file.h" from 1 to 10, we just need to put the pieces together: +
+
+#define BOOST_PP_ITERATION_LIMITS (1, 10)
+#define BOOST_PP_FILENAME_1 "file.h"
+??=include BOOST_PP_ITERATE()
+
+
+ The above code has the effect of including "file.h" ten times in succession.  +
+
+ Alternately, both the range and the file to iterate over can be expressed in one macro, BOOST_PP_ITERATION_PARAMS_x.  + Once again, the x is a placeholder for the dimension of iteration--which we'll assume is 1.  + This macro must expand to an array that includes the lower bound, upper bound, filename, and optional flags (in that order). +
+
+#define BOOST_PP_ITERATION_PARAMS_1 (3, (1, 10, "file.h"))
+??=include BOOST_PP_ITERATE()
+
+
+ This has the same effect as the previous version.  + Only one of these two ways to specify the parameters can be used at a time.  + (The reason that there are two different methods has to do with dimensional abstraction which I'll get to later.) +
+
+ There is nothing particularly useful about including a file ten times.  + The difference is that the current macro state changes each time.  + For example, the current "iteration value" is available with BOOST_PP_ITERATION().  + If "file.h" is defined like this... +
+
+// file.h
+template<> struct sample<BOOST_PP_ITERATION()> { };
+
+
+ ...and it is iterated as follows... +
+
+template<int> struct sample;
+
+#define BOOST_PP_ITERATION_PARAMS_1 (3, (1, 5, "file.h"))
+??=include BOOST_PP_ITERATE()
+
+
+ ...the result is different each time: +
+
+template<> struct sample<1> { };
+template<> struct sample<2> { };
+template<> struct sample<3> { };
+template<> struct sample<4> { };
+template<> struct sample<5> { };
+
+
+ There is no reason that a file can't iterate over itself.  + This has the advantage of keeping the code together.  + The problem is that you have to discriminate the "regular" section of the file from the iterated section of the file.  + The library provides the BOOST_PP_IS_ITERATING macro to help in this regard.  + This macro is defined as 1 if an iteration is in progress.  + For example, to merge the contents of "file.h" into the file that iterates it: +
+
+// sample.h
+#if !BOOST_PP_IS_ITERATING
+
+   #ifndef SAMPLE_H
+   #define SAMPLE_H
+
+   #include <boost/preprocessor/iteration/iterate.hpp>
+
+   template<int> struct sample;
+
+   #define BOOST_PP_ITERATION_PARAMS_1 (3, (1, 5, "sample.h"))
+   ??=include BOOST_PP_ITERATE()
+
+   #endif // SAMPLE_H
+
+#else
+
+   template<> struct sample<BOOST_PP_ITERATION()> { };
+
+#endif
+
+
+ Using the same file like this raises another issue.  + What happens when a file performs two separate file iterations over itself?  + This is the purpose of the optional flags parameter.  + It is used to discriminate between separate iterations. +
+
+// sample.h
+#if !BOOST_PP_IS_ITERATING
+
+   #ifndef SAMPLE_H
+   #define SAMPLE_H
+
+   #include <boost/preprocessor/iteration/iterate.hpp>
+   #include <boost/preprocessor/repetition/enum_params.hpp>
+   #include <boost/preprocessor/repetition/enum_shifted_params.hpp>
+
+   template<int> struct sample;
+
+   #define BOOST_PP_ITERATION_PARAMS_1 (4, (1, 5, "sample.h", 1))
+   ??=include BOOST_PP_ITERATE()
+
+   template<class T, class U> struct typelist_t {
+      typedef T head;
+      typedef U tail;
+   };
+
+   template<int> struct typelist;
+   struct null_t;
+
+   template<> struct typelist<1> {
+      template<class T0> struct args {
+         typedef typelist_t<T0, null_t> type;
+      };
+   };
+
+   #ifndef TYPELIST_MAX
+   #define TYPELIST_MAX 50
+   #endif
+
+   #define BOOST_PP_ITERATION_PARAMS_1 (4, (2, TYPELIST_MAX, "sample.h", 2))
+   ??=include BOOST_PP_ITERATE()
+
+   #endif // SAMPLE_H
+
+#elif BOOST_PP_ITERATION_FLAGS() == 1
+
+   template<> struct sample<BOOST_PP_ITERATION()> { };
+
+#elif BOOST_PP_ITERATION_FLAGS() == 2
+
+   #define N BOOST_PP_ITERATION()
+
+   template<> struct typelist<N> {
+      template<BOOST_PP_ENUM_PARAMS(N, class T)> struct args {
+         typedef typelist_t<
+            T0,
+            typename typelist<N - 1>::args<BOOST_PP_ENUM_SHIFTED_PARAMS(N, T)>::type
+         > type;
+      };
+   };
+
+   #undef N
+
+#endif
+
+
+ Notice the use of the "flags" parameter (which is accessed through BOOST_PP_ITERATION_FLAGS()).  + It discriminates between our recurring sample iteration and a typelist linearization iteration.  +
+
+ The second iteration illustrates the power of the file iteration mechanism.  + It generates typelist linearizations of the form typelist<3>::args<int, double, char>::type. +
+
+ Actually, to continue the typelist example, with the help of another iteration we can fully linearize typelist creation.... +
+
+// extract.h
+#if !BOOST_PP_IS_ITERATING
+
+   #ifndef EXTRACT_H
+   #define EXTRACT_H
+
+   #include <boost/preprocessor/iteration/iterate.hpp>
+   #include <boost/preprocessor/repetition/enum.hpp>
+   #include <boost/preprocessor/repetition/enum_params.hpp>
+   #include <boost/preprocessor/repetition/enum_trailing_params.hpp>
+
+   // certain types such as "void" can't be function argument types
+
+   template<class T> struct incomplete {
+      typedef T type;
+   };
+
+   template<class T> struct strip_incomplete {
+      typedef T type;
+   };
+
+   template<class T> struct strip_incomplete<incomplete<T> > {
+      typedef T type;
+   };
+
+   template<template<int> class output, class func_t> struct extract;
+
+   #ifndef EXTRACT_MAX
+   #define EXTRACT_MAX 50
+   #endif
+
+   #define BOOST_PP_ITERATION_PARAMS_1 (3, (1, EXTRACT_MAX, "extract.h"))
+   ??=include BOOST_PP_ITERATE()
+
+   #endif // EXTRACT_H
+
+#else
+
+   #define N BOOST_PP_ITERATION()
+   #define STRIP(z, n, _) \
+      typename strip_incomplete<T ## n>::type \
+      /**/
+
+   template<template<int> class output, class R BOOST_PP_ENUM_TRAILING_PARAMS(N, class T)>
+   struct extract<R (BOOST_PP_ENUM_PARAMS(N, T))> {
+      typedef typename output<N>::template args<BOOST_PP_ENUM(N, STRIP, nil)>::type type;
+   };
+
+   #undef STRIP
+   #undef N
+
+#endif
+
+
+ Now we can define a helper macro to finish the job: +
+
+#define TYPELIST(args) extract<typelist, void args>::type
+
+typedef TYPELIST((int, double, incomplete<void>)) xyz;
+
+
+ There are two minor caveats with this result.  + First, certain types like void can't be the type of an argument, so they have to be + wrapped with incomplete<T>.  + Second, the necessary double parenthesis is annoying.  + If and when C++ gets C99's variadic macros, TYPELIST can be redefined: +
+
+#define TYPELIST(...) extract<typelist, void (__VA_ARGS__)>::type
+
+typedef TYPELIST(int, double, short) xyz;
+
+
+ Note also that both the lower and upper bounds of an iteration are also accessible inside an iteration with + BOOST_PP_ITERATION_START() and BOOST_PP_ITERATION_FINISH(). +
+
+ It is my hope that the explanation and examples presented here demonstrate the power of file iteration.  + Even so, this is just the beginning.  + The file iteration mechanism also defines a full suite of facilities to support multidimensional iteration. +
+

Multiple Dimensions

+
+ The file iteration mechanism supports up to BOOST_PP_LIMIT_ITERATION_DIM dimensions.  + The first dimension (i.e. the outermost) we have already used above.  + In order to use the second dimension (inside the first), we simply have to replace the placeholder x + with 2 instead of 1. +
+
+#define BOOST_PP_ITERATION_PARAMS_2 /* ... */
+                                  ^
+
+
+...or... +
+
+#define BOOST_PP_FILENAME_2 /* ... */
+                          ^
+
+
+ Each dimension must be used in order starting with 1.  + Therefore, the above can only be valid immediately inside the first dimension.  +
+
+ At this point, further explanation is necessary regarding BOOST_PP_ITERATION, + BOOST_PP_ITERATION_START, and BOOST_PP_ITERATION_FINISH.  + BOOST_PP_ITERATION() expands to the iteration value of the current dimension--regardless + of what dimension that is.  + Likewise, BOOST_PP_ITERATION_START() and BOOST_PP_ITERATION_FINISH() expand to the lower + and upper bounds of the current dimension.  + Using the following pseudo-code as reference: +
+
+for (int i = start(1); i <= finish(1); ++i) {
+   // A
+   for (int j = start(2); j <= finish(2); ++j) {
+      // B
+   }
+   // C
+}
+
+
+ At point A, BOOST_PP_ITERATION() refers to i.  + BOOST_PP_ITERATION_START() and BOOST_PP_ITERATION_FINISH() + refer to start(1) and finish(1) respectively.  + At point B, however, BOOST_PP_ITERATION() refers to j--the current + iteration value at point B.  + The same is true for BOOST_PP_ITERATION_START() which refers to start(2), etc.. +
+
+ If separate files are used for each dimension, then there are no major problems, and using multiple dimensions is straightforward.  + However, if more than one dimension is located in the same file, they need to be distinguished from one another.  + The file iteration mechanism provides the macro BOOST_PP_ITERATION_DEPTH for this purpose: +
+
+// file.h
+#if !BOOST_PP_IS_ITERATING
+
+   #ifndef FILE_H
+   #define FILE_H
+
+   #include <boost/preprocessor/iteration/iterate.hpp>
+
+   #define BOOST_PP_ITERATION_PARAMS_1 (3, (1, 2, "file.h"))
+   ??=include BOOST_PP_ITERATE()
+
+   #endif // FILE_H
+
+#elif BOOST_PP_ITERATION_DEPTH() == 1
+
+   // A
+   + BOOST_PP_ITERATION()
+
+   #define BOOST_PP_ITERATION_PARAMS_2 (3, (1, 2, "file.h"))
+   ??=include BOOST_PP_ITERATE()
+
+   // C
+
+#elif BOOST_PP_ITERATION_DEPTH() == 2
+
+   // B
+   - BOOST_PP_ITERATION()
+
+#endif
+
+
+ This will result to the following: +
+
++ 1
+- 1
+- 2
++ 2
+- 1
+- 2
+
+
+ Multiple dimensions raise another question.  + How does one access the state of dimensions other than the current dimension?  + In other words, how does one access i at point A?  + Because of the preprocessor's lazy evaluation, this doesn't work.... +
+
+// ...
+
+#elif BOOST_PP_ITERATION_DEPTH() == 1
+
+   #define I BOOST_PP_ITERATION()
+
+   #define BOOST_PP_ITERATION_PARAMS_2 (3, (1, 2, "file.h"))
+   ??=include BOOST_PP_ITERATE()
+
+   #undef I
+
+#elif BOOST_PP_ITERATION_DEPTH() == 2
+
+   #define J BOOST_PP_ITERATION()
+
+   // use I and J
+
+   #undef I
+
+#endif
+
+
+ The problem here is that I refers to BOOST_PP_ITERATION(), + not to the value of BOOST_PP_ITERATION() at the point of I's definition. +
+
+ The library provides macros to access these values in two ways--absolutely or relatively.  + The first variety accesses a value of a specific iteration frame (i.e. dimension).  + To access the iteration value of the first dimension--from any dimension--BOOST_PP_FRAME_ITERATION(1) is used.  + To access the iteration value of the second dimension, BOOST_PP_FRAME_ITERATION(2) is used, and so on.  +
+
+ There are also frame versions to access the lower bound, the upper bound, and the flags of a dimension:  + BOOST_PP_FRAME_START, BOOST_PP_FRAME_FINISH, and BOOST_PP_FRAME_FLAGS. +
+
+ So, to fix the last example, we modify the definition of I.... +
+
+// ...
+
+#elif BOOST_PP_ITERATION_DEPTH() == 1
+
+   #define I BOOST_PP_FRAME_ITERATION(1)
+
+// ...
+
+
+ The library also provides macros to access values in dimensions relative to the current dimension (e.g. the previous dimension).  + These macros take an argument that is interpreted as an offset from the current frame.  + For example, BOOST_PP_RELATIVE_ITERATION(1) always refers to the outer dimension immediately previous to the current dimension.  + An argument of 0 is interpreted as an offset of 0 which causes + BOOST_PP_RELATIVE_ITERATION(0) to be equivalent to BOOST_PP_ITERATION().  + BOOST_PP_RELATIVE_ITERATION(2) refers to the iteration value of the dimension immediately preceding + the dimension that precedes the current dimension.  +
+
+ The lower and upper bounds of a dimension can be accessed in this fashion as well + with BOOST_PP_RELATIVE_START and BOOST_PP_RELATIVE_FINISH.  + The flags of a relative dimension can be accessed with BOOST_PP_RELATIVE_FLAGS. +
+

Relativity

+
+ I mentioned earlier that there is a reason that there are two ways to parametize the mechanism.  + The reason is dimensional abstraction.  + In certain situations the dimension is unknown by the code that is being iterated--possibly + because the code is reused at multiple, different dimensions.  + If that code needs to iterate again, it has to define the right parameters (based on the dimension) for the mechanism to consume.  +
+
+ All of the macro state maintained by the mechanism can be referred to in an indirect way relative to a dimension.  + This is the purpose of the BOOST_PP_RELATIVE_ accessors.  +
+
+ Likewise, the user-defined named external arguments can be defined this way as well--except the name of the file to iterate.  + Because the lower and upper boundaries are evaluated by the mechanism, the implementation no longer needs + the macro BOOST_PP_ITERATION_LIMITS, and the identifier can be reused for each dimension of iteration.  +
+
+ Unfortunately, the filename is a different story.  + The library has no way to evaluate the quoted (or angle-bracketed) text.  + Therefore, it has to use a different macro for each dimension.  + That is the purpose of the BOOST_PP_FILENAME_x macros.  + They exist to isolate the only non-abstractable piece of data required by the mechanism.  +
+
+ In order to define the filename in an abstract fashion, you need to do something like this: +
+
+#define UNIQUE_TO_FILE "some_file.h"
+
+#if BOOST_PP_ITERATION_DEPTH() == 0
+   #define BOOST_PP_FILENAME_1 UNIQUE_TO_FILE
+#elif BOOST_PP_ITERATION_DEPTH() == 1
+   #define BOOST_PP_FILENAME_2 UNIQUE_TO_FILE
+#elif BOOST_PP_ITERATION_DEPTH() == 2
+   #define BOOST_PP_FILENAME_3 UNIQUE_TO_FILE
+
+// ... up to BOOST_PP_LIMIT_ITERATION_DIM
+
+#endif
+
+
+ The intent is to avoid having to do this for anything but the filename.  + If this needs to be done more than once in a file + (BOOST_PP_FILENAME_x is undefined by the mechanism after it is used.), + consider using a separate file to make the proper definition: +
+
+# // detail/define_file_h.h
+# ifndef FILE_H
+#   error FILE_H is not defined
+# endif
+#
+# if BOOST_PP_ITERATION_DEPTH() == 0
+#   define BOOST_PP_FILENAME_1 FILE_H
+# elif BOOST_PP_ITERATION_DEPTH() == 1
+#   define BOOST_PP_FILENAME_2 FILE_H
+# elif BOOST_PP_ITERATION_DEPTH() == 2
+#   define BOOST_PP_FILENAME_3 FILE_H
+# elif BOOST_PP_ITERATION_DEPTH() == 3
+#   define BOOST_PP_FILENAME_4 FILE_H
+# elif BOOST_PP_ITERATION_DEPTH() == 4
+#   define BOOST_PP_FILENAME_5 FILE_H
+# else
+#   error unsupported iteration dimension
+# endif
+
+
+ And then use it like this.... +
+
+// file.h
+#if !BOOST_PP_IS_ITERATING
+
+   #ifndef FILE_H
+   #define FILE_H "file.h"
+
+   #define BOOST_PP_ITERATION_LIMITS (1, 10)
+   #include "detail/define_file_h.h"
+
+   ??=include BOOST_PP_ITERATE()
+
+#endif // FILE_H
+
+#else
+   // iterated portion
+#endif
+
+
+ With a little effort like this, it is possible to maintain the abstraction without the code bloat that would + otherwise be required.  + Unfortunately, this is not a completely general solution as it would need to be done for each unique filename, + but it is better than nothing. +
+

Conclusion

+
+ That about covers the facilities that are available from the mechanism.  + Using these facilities, let's implement a function_traits template to demonstrate a full-fledge + use of the mechanism. +
+

Function Traits - An Involved Example

+
+ Implementing a comprehensive function_traits template metafunction requires the use + of every major part of the file iteration mechanism.  +
+
+ (This example makes no attempt of work around compiler deficiencies and exists only to illustrate the mechanism.) +
+
+ The result should have the following features: +
+ +
+ There are a myriad of ways that this can be implemented.  + I'll give a brief summary here of what is happening in the implementation below.  +
+
+ The implementation inherently has to deal with function arity.  + Therefore, at minimum, we need to iterate over function arities and define partial specializations of + the primary template function_traits.  + The situation is further complicated by variadic functions (i.e. functions with an ellipsis).  + Therefore, for every arity, we need a variadic version as well. +
+
+ We also need to handle pointers-to-member-functions.  + This implies that we have to handle not just arity and variadics, but also cv-qualifications.  +
+
+ For the sake of clarity, the implementation below handles function types and pointers-to-member-functions + separately.  + They could be merged, but the result would be significantly messier. +
+
+ To handle function types, the implementation below iterates over function arities.  + For each arity, it iterates over each parameter to provide access to each individually.  + It then re-includes itself to define a variadic specialization of the same arity.  + It performs the rough equivalent of the following pseudo-code: +
+
+void make_spec(int i, bool variadic) {
+   :open function_traits<i, variadic>
+      for (int j = 0; j < i; ++j) {
+         :parameter<j>
+      }
+   :close
+   if (!variadic) {
+      make_spec(i, true);
+   }
+   return;
+}
+
+void function_types(int max_arity) {
+   for (int i = 0; i <= max_arity; ++i) {
+      make_spec(i, false);
+   }
+   return;
+}
+
+
+ The implementation of pointers-to-member-functions is a bit different.  + First, it iterates over cv-qualifiers.  + For each cv-qualifier, it iterates over function arities.  + For each function arity, it iterates again over each parameter.  + It then re-includes itself to define a variadic specialization of the same arity.... +
+
+void make_spec(int j, const char* cv, bool variadic) {
+   :open function_traits<j, cv, variadic>
+      for (int k = 0; k < j; ++k) {
+         parameter<k>
+      }
+   :close
+   if (!variadic) {
+      make_spec(j, cv, true);
+   }
+   return;
+}
+
+void gen_arities(const char* cv, int max_arity) {
+   for (int j = 0; j <= max_arity; ++j) {
+      make_spec(j, cv, false);
+   }
+   return;
+}
+
+void pointers_to_members(int max_arity) {
+   static const char* cv_qualifiers[] = { "", "const", "volatile", "const volatile" };
+   for (int i = 0; i < 4; ++i) {
+      gen_arities(cv_qualifiers[i], max_arity);
+   }
+   return;
+}
+
+
+ Here is the complete implementation.  + This example represents the power of the file iteration mechanism as well as the library in general, + so follow it carefully if you wish to fully understand what the mechanism does.... +
+
+// function_traits.hpp
+
+#if !BOOST_PP_IS_ITERATING
+
+#ifndef FUNCTION_TRAITS_HPP
+#define FUNCTION_TRAITS_HPP
+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/facilities/apply.hpp>
+#include <boost/preprocessor/iteration/iterate.hpp>
+#include <boost/preprocessor/iteration/self.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+
+// enable user-expansion
+#ifndef FUNCTION_TRAITS_MAX_ARITY
+   #define FUNCTION_TRAITS_MAX_ARITY 15
+#endif
+
+namespace detail {
+
+// avoid replication of "default" values
+struct function_traits_base {
+   static const bool is_plain = false;
+   static const bool is_pointer = false;
+   static const bool is_reference = false;
+   static const bool is_member = false;
+};
+
+} // detail
+
+// no definition
+template<class> struct function_traits;
+
+// extract ellipsis state
+#define ELLIPSIS(n) \
+   BOOST_PP_APPLY( \
+      BOOST_PP_TUPLE_ELEM(2, n, ELLIPSIS_I) \
+   ) \
+   /**/
+
+// iterate over function arities for function types
+#define BOOST_PP_ITERATION_PARAMS_1 \
+   (4, (0, FUNCTION_TRAITS_MAX_ARITY, "function_traits.hpp", 0)) \
+   /**/
+??=include BOOST_PP_ITERATE()
+
+// obtain a cv-qualifier by index
+#define QUALIFIER(n) \
+   BOOST_PP_APPLY( \
+      BOOST_PP_TUPLE_ELEM( \
+         4, n, \
+         (BOOST_PP_NIL, (const), (volatile), (const volatile)) \
+      ) \
+   ) \
+   /**/
+
+// iterate over cv-qualifiers for pointers-to-members
+#define BOOST_PP_ITERATION_PARAMS_1 \
+   (4, (0, 3, "function_traits.hpp", 1)) \
+   /**/
+??=include BOOST_PP_ITERATE()
+
+// remove temporary macros
+#undef QUALIFIER
+#undef ELLIPSIS
+
+// overriding jumper for pointers-to-functions
+template<class T> struct function_traits<T*> : function_traits<T> {
+   static const bool is_plain = false;
+   static const bool is_pointer = true;
+};
+
+// overriding jumper for references-to-functions
+template<class T> struct function_traits<T&> : function_traits<T> {
+   static const bool is_plain = false;
+   static const bool is_reference = true;
+};
+
+// eof
+#endif // FUNCTION_TRAITS_HPP
+
+// specializations for function types
+#elif BOOST_PP_ITERATION_DEPTH() == 1 \
+   && BOOST_PP_ITERATION_FLAGS() == 0 \
+   /**/
+
+   // define ellipsis state
+   #if BOOST_PP_IS_SELFISH
+      #define ELLIPSIS_I ((true), (...))
+   #else
+      #define ELLIPSIS_I ((false), BOOST_PP_NIL)
+   #endif
+
+   #define N BOOST_PP_ITERATION()
+
+   template<class R BOOST_PP_ENUM_TRAILING_PARAMS(N, class T)>
+   struct function_traits<R (BOOST_PP_ENUM_PARAMS(N, T) ELLIPSIS(1))>
+      : detail::function_traits_base {
+      static const bool is_plain = true;
+      typedef R function_type(BOOST_PP_ENUM_PARAMS(N, T) ELLIPSIS(1));
+      typedef function_type* pointer_type;
+      typedef function_type& reference_type;
+      static const bool has_ellipsis = ELLIPSIS(0);
+      typedef R return_type;
+      static const int parameter_count = N;
+      template<int, class D = int> struct parameter;
+      #if N
+         // iterate over parameters
+         #define BOOST_PP_ITERATION_PARAMS_2 \
+            (3, (0, N - 1, "function_traits.hpp")) \
+            /**/
+         ??=include BOOST_PP_ITERATE()
+      #endif
+   };
+
+   #undef N
+   #undef ELLIPSIS_I
+
+   // re-include this section for an ellipsis variant
+   #if !BOOST_PP_IS_SELFISH
+      #define BOOST_PP_INDIRECT_SELF "function_traits.hpp"
+      ??=include BOOST_PP_INCLUDE_SELF()
+   #endif
+
+// iteration over cv-qualifiers
+#elif BOOST_PP_ITERATION_DEPTH() == 1 \
+   && BOOST_PP_ITERATION_FLAGS() == 1 \
+   /**/
+
+   #define BOOST_PP_ITERATION_PARAMS_2 \
+      (3, (0, FUNCTION_TRAITS_MAX_ARITY, "function_traits.hpp")) \
+      /**/
+   ??=include BOOST_PP_ITERATE()
+
+// generate specializations for pointers-to-members
+#elif BOOST_PP_ITERATION_DEPTH() == 2 \
+   && BOOST_PP_FRAME_FLAGS(1) == 1 \
+
+   // define ellipsis state
+   #if BOOST_PP_IS_SELFISH
+      #define ELLIPSIS_I ((true), (...))
+   #else
+      #define ELLIPSIS_I ((false), BOOST_PP_NIL)
+   #endif
+
+   #define N BOOST_PP_ITERATION()
+   #define Q QUALIFIER(BOOST_PP_FRAME_ITERATION(1))
+
+   template<class R, class O BOOST_PP_ENUM_TRAILING_PARAMS(N, class T)>
+   struct function_traits<R (O::*)(BOOST_PP_ENUM_PARAMS(N, T) ELLIPSIS(1)) Q>
+      : detail::function_traits_base {
+      static const bool is_member = true;
+      typedef R (O::* pointer_to_member_type)(BOOST_PP_ENUM_PARAMS(N, T) ELLIPSIS(1)) Q;
+      typedef O class_type;
+      typedef Q O qualified_class_type;
+      static const bool has_ellipsis = ELLIPSIS(0);
+      static const bool is_const =
+         BOOST_PP_FRAME_ITERATION(1) == 1 || BOOST_PP_FRAME_ITERATION(1) == 3;
+      static const bool is_volatile =
+         BOOST_PP_FRAME_ITERATION(1) == 2 || BOOST_PP_FRAME_ITERATION(1) == 3;
+      typedef R return_type;
+      static const int parameter_count = N;
+      template<int, class D = int> struct parameter;
+      #if N
+         // iterate over parameters
+         #define BOOST_PP_ITERATION_PARAMS_3 \
+            (3, (0, N - 1, "function_traits.hpp")) \
+            /**/
+         ??=include BOOST_PP_ITERATE()
+      #endif
+   };
+
+   #undef Q
+   #undef N
+   #undef ELLIPSIS_I
+
+   // re-include this section for an ellipsis variant
+   #if !BOOST_PP_IS_SELFISH
+      #define BOOST_PP_INDIRECT_SELF "function_traits.hpp"
+      ??=include BOOST_PP_INCLUDE_SELF()
+   #endif
+
+// parameter specializations
+#else
+
+   #define X BOOST_PP_ITERATION()
+
+      template<class D> struct parameter<X, D> {
+         typedef BOOST_PP_CAT(T, X) type;
+      };
+
+   #undef X
+
+#endif
+
+
+ One problem that still exists is the lack of support for throw specifications.  + There is no way that we can completely handle it anyway because we cannot partially specialize + on throw specifications.  + However, we could accurately report the "actual" function type, etc., including the throw + specification (which the above implementation doesn't do, as it reconstructs those types).  + If you like, you can figure out how to do that on your own as an exercise.  +
+ +

See Also

+ +
- Paul Mensonides
+ + diff --git a/doc/topics/incompatible.html b/doc/topics/incompatible.html new file mode 100644 index 0000000..f1f76a0 --- /dev/null +++ b/doc/topics/incompatible.html @@ -0,0 +1,129 @@ + + + incompatible.html + + + +

Incompatibilities

+
+ There are several incompatibilities with the previous Boost release (1.28).  + These fall into roughly three categories:  +
+ +

Repetition Targets

+
+ First, and probably the most commonly used, is the target macros passed into BOOST_PP_REPEAT and the horizontal repetition contructs that use BOOST_PP_REPEAT.  + This includes all of the BOOST_PP_REPEAT_* primitives and all of the BOOST_PP_ENUM_* primitives that require a target macro. +
+
+ The incompatiblity is trivial, but it will require that the source be updated.  +
+
+ These target macros must now except a third parameter.  + This extra parameter becomes the first parameter in every target macro.  + It represents the next repetition dimension and brings BOOST_PP_REPEAT inline with rest of the library.  +
+
+ So, what once was: +
+
+ #define macro(n, data) ...
+ BOOST_PP_REPEAT(5, macro, data) +
+
+ ...is now: +
+
+ #define macro(z, n, data) ...
+ BOOST_PP_REPEAT(5, macro, data) +
+
+ This parameter can be used for highly efficient reentrance into the BOOST_PP_REPEAT mechanism.  + However, it is not necessary to use it as the library can automatically detect the next available repetition dimension. +
+

Dimensional Ordering

+
+ Because of this detection, however, it is unsafe to use BOOST_PP_REPEAT_1ST, BOOST_PP_REPEAT_2ND, and BOOST_PP_REPEAT_3RD out of order.  + These macros bypass the automatic-recursion mechanism, and the automatic-recursion mechanism relies on macros being used in the proper order.  + To clarify, if you use these bypass macros, the outer-most repetition must be BOOST_PP_REPEAT_1ST, then BOOST_PP_REPEAT_2ND, and finally BOOST_PP_REPEAT_3RD.  + Any other usage is not supported by the library.  + Sometimes it may work, and other times it won't. +
+

Reentrancy Syntax

+
+ Automatic-recursion brings with it another issue as well. Previously, the reentrancy syntax for BOOST_PP_WHILE (and similarly for BOOST_PP_FOR) was: +
+
+ BOOST_PP_WHILE ## d(pred, op, state) +
+
+ ...or: +
+
+ BOOST_PP_CAT(BOOST_PP_WHILE, d)(pred, op, state) +
+
+ Under the automatic-recursion model, the BOOST_PP_CAT version breaks.  + This is because BOOST_PP_CAT allows its arguments to expand prior to concatenation, + and BOOST_PP_WHILE is a macro that expands without arguments.  + The library makes it appear that it takes three parameters, but that is the trick of automatic-recursion.  + It works similarly to the following: +
+
+ #define A(x, y) ...
+ #define B A
+ // ...
+ B(2, 3) +
+
+ The syntax makes it look like the B macro above takes two arguments, but it doesn't.  + The automatic-recursion mechanism works in this fashion, except that the "B" macro deduces the next available "A" macro. +
+
+ Because some preprocessors are still slow, direct reentrancy (sans automatic-recursion) is still necessary in non-trivial cases.  + Consequently, the library uses a new syntax to handle reentrancy: +
+
+ BOOST_PP_FOR_ ## r(state, pred, op, macro)
+ BOOST_PP_REPEAT_ ## z(count, macro, data)
+ BOOST_PP_WHILE_ ## d(pred, op, state) +
+

Folding

+
+ Previously, the BOOST_PP_LIST_FOLD_RIGHT macros' arguments were the reverse of BOOST_PP_LIST_FOLD_LEFT.  + Also, the accumulation macro passed into BOOST_PP_LIST_FOLD_RIGHT was called with reversed parameters as well.  + This discrepancy has been eliminated. +
+
+ To illustrate, BOOST_PP_LIST_FOLD_RIGHT used to be used like this: +
+
+ #define macro(d, elem, state)
+ BOOST_PP_LIST_FOLD_RIGHT(macro, list, state) +
+
+ This signature has been replaced by... +
+
+ #define macro(d, state, elem)
+ BOOST_PP_LIST_FOLD_RIGHT(macro, state, list) +
+

Summary

+
+ The library has many new features not present in the 1.28 release, and this list does not attempt to enumerate them.  + This is simply a list of things that must change for code to be compatible with this new release. +
+

See Also

+ +
- Paul Mensonides
+ + diff --git a/doc/topics/local_iteration.html b/doc/topics/local_iteration.html new file mode 100644 index 0000000..32d6d5b --- /dev/null +++ b/doc/topics/local_iteration.html @@ -0,0 +1,149 @@ + + + local_iteration.html + + + +

Local Iteration

+
+ Local iteration is a simple vertical repetition construct.  + It expands a macro with each number in a user-specified range.  + Each expansion is on a separate line. +
+

Tutorial

+
+ This mechanism requires two pieces of information to operate:  + a range to iterate over and a macro to expand on each iteration.  + This information is obtained by the mechanism through two named external arguments.  + These arguments are specified as user-defined macros named BOOST_PP_LOCAL_LIMITS and BOOST_PP_LOCAL_MACRO. +
+
+ BOOST_PP_LOCAL_LIMITS specifies a range of values to iterate over.  + It must expand to a tuple containing two elements--a lower and upper bound.  + Both the upper and lower bounds must be numeric values in the range of 0 to BOOST_PP_LIMIT_ITERATION.  + For example, if the user wishes a macro to be expanded with numbers ranging from 0 to 10, + BOOST_PP_LOCAL_LIMITS would be defined like this: +
+
+#define BOOST_PP_LOCAL_LIMITS (0, 10)
+
+
+ Note that there is whitespace after the name of the macro.  + The macro does not take two arguments.  + In the case above, if there was no whitespace, a preprocessing error would occur because 0 and 10 are invalid identifiers. +
+
+ Both the upper and lower bounds specified in the BOOST_PP_LOCAL_LIMITS macro are evaluated parameters.  + This implies that they can include simple arithmetic or logical expressions.  + For instance, the above definition could easily have been written like this: +
+
+#define N() 5
+#define BOOST_PP_LOCAL_LIMITS (0, N() + 5)
+
+
+ Because of this, if the whitespace after the macro name is elided, it is possible for the definition to be syntactically valid: +
+
+#define A 0
+#define B 10
+#define BOOST_PP_LOCAL_LIMITS(A, B)
+   // note:  no whitespace   ^
+
+
+ If this happens, an error will occur inside the mechanism when it attempts to use this macro.  + The error messages that result may be obscure, so always remember to include the whitespace.  + A correct version of the above looks like this: +
+
+#define A 0
+#define B 10
+#define BOOST_PP_LOCAL_LIMITS (A, B)
+   // note:  has whitespace  ^
+
+
+ BOOST_PP_LOCAL_MACRO is the macro that is expanded by the mechanism.  + This macro is expanded on each iteration with the current number of the iteration.  + It must defined as a unary macro or result in a macro that can be called with one argument: +
+
+#define BOOST_PP_LOCAL_MACRO(n) \
+   template<> struct sample<n> { }; \
+   /**/
+
+
+ ...or... +
+
+#define SAMPLE(n) \
+   template<> struct sample<n> { }; \
+   /**/
+
+#define BOOST_PP_LOCAL_MACRO SAMPLE
+
+
+ Once these two macros are defined, the local iteration is initiated by including BOOST_PP_LOCAL_ITERATE(). +
+
+??=include BOOST_PP_LOCAL_ITERATE()
+
+
+ (The ??= token is a trigraph for #.  + I use the trigraph to make it clear that I am including a file rather than defining or expanding a macro, but it is not necessary.  + Even the digraph version, %:, could be used.  + Some compilers do not readily accept trigraphs and digraphs, so keep that in mind.  + Other than that, use whichever one you prefer.) +
+
+ In order to repeat the sample specialization, the pieces must be put together.... +
+
+#define BOOST_PP_LOCAL_MACRO(n) \
+   template<> struct sample<n> { }; \
+   /**/
+
+#define BOOST_PP_LOCAL_LIMITS (0, 10)
+??=include BOOST_PP_LOCAL_ITERATE()
+
+
+ This will result in a specialization of sample for each number in the range of 0 to 10.  + The output will look something like this: +
+
+template<> struct sample<0> { };
+template<> struct sample<1> { };
+template<> struct sample<2> { };
+
+// ...
+
+template<> struct sample<10> { };
+
+
+ After the local-iteration is complete, both BOOST_PP_LOCAL_LIMITS and BOOST_PP_LOCAL_MACRO are automatically undefined.  + If the values need to be retained for a future local-iteration, they must be defined indirectly: +
+
+#define LIMITS (0, 10)
+
+#define SAMPLE(n) \
+   template<> struct sample<n> { }; \
+   /**/
+
+#define BOOST_PP_LOCAL_LIMITS LIMITS
+#define BOOST_PP_LOCAL_MACRO(n) SAMPLE(n)
+
+??=include BOOST_PP_LOCAL_ITERATE()
+
+ +

See Also

+ +
- Paul Mensonides
+ + \ No newline at end of file diff --git a/doc/topics/motivation.html b/doc/topics/motivation.html new file mode 100644 index 0000000..e4e38f0 --- /dev/null +++ b/doc/topics/motivation.html @@ -0,0 +1,100 @@ + + + motivation.html + + + +

Motivation

+
+ The C++ function and template parameter lists are special syntactic constructs, and it is impossible to directly + manipulate or generate them using C++ constructs.  + This leads to unnecessary code repetition. +
+
+ Consider the implementation of the is_function<> metafunction is Boost.  + The implementation uses an overloaded is_function_tester() function that is used for testing if a type is convertible + to a pointer to a function.  + Because of the special treatment of parameter lists, it is not possible to directly match a function with an arbitrary parameter list.  + Instead, the is_function_tester() must be overloaded for every distinct number of parameters that is to be supported.  + For example: +
+
+template<class R>
+yes_type is_function_tester(R (*)());
+
+template<class R, class A0>
+yes_type is_function_tester(R (*)(A0));
+
+template<class R, class A0, class A1>
+yes_type is_function_tester(R (*)(A0, A1));
+
+template<class R, class A0, class A1, class A2>
+yes_type is_function_tester(R (*)(A0, A1, A2));
+
+// ...
+
+
+ The need for this kind of repetition occurs particularly frequently while implementing generic components or metaprogramming facilities, + but the need also manifests itself in many far simpler situations. +
+

Typical Solutions

+
+ Typically the repetition is done manually.  + Manual code repetition is highly unproductive, but sometimes more readable to the untrained eye. +
+
+ Another solution is to write an external program for generating the repeated code or use some other extra linguistic means such as a smart editor.  + Unfortunately, using external code generators has many disadvantages: +
    +
  • Writing the generator takes time.  (This could be helped by using a standard generator.)
  • +
  • It is no longer productive to manipulate C++ code directly.
  • +
  • Invoking the generator may be difficult.
  • +
  • Automating the invocation of the generator can be difficult in certain environments.  (Automatic invocation is desirable for active libraries.)
  • +
  • Porting and distributing the generator may be difficult or simply takes precious time.
  • +
+
+

What about the preprocessor?

+
+ Because C++ comes with a preprocessor, one would assume that it would support these kinds of needs directly.  + Using the preprocessor in this case is highly desirable because: +
    +
  • The preprocessor is highly portable.
  • +
  • The preprocessor is automatically invoked as part of the compilation process.
  • +
  • Preprocessor metacode can be directly embedded into the C++ source code.
  • +
  • Compilers generally allow viewing or outputting the preprocessed code, which can be used for debugging or to copy and paste the generated code.
  • +
+
+
+ Most unfortunately, the preprocessor is a very low level preprocessor that specifically does not support repetition or recursive macros.  + Library support is needed! +
+
+ For detailed information on the capabilities and limitations of the preprocessor, please refer to the C++ standard [Std]. +
+

The Motivation Example Revisited

+
+ Using the primitives of the preprocessor library, the is_function_tester()'s could be implemented like this: +
+
+#define IS_FUNCTION_TESTER(Z, N, _) \
+   template<class R BOOST_PP_COMMA_IF(N) BOOST_PP_ENUM_PARAMS(N, class A)> \
+   yes_type is_function_tester(R (*)(BOOST_PP_ENUM_PARAMS(N, A))); \
+   /**/
+
+BOOST_PP_REPEAT(BOOST_PP_INC(MAX_IS_FUNCTION_TESTER_PARAMS), IS_FUNCTION_TESTER, _)
+
+#undef IS_FUNCTION_TESTER
+
+
+ In order to change the maximum number of function parameters supported, you now simply change the MAX_IS_FUNCTION_TESTER_PARAMS definition and recompile. +
+
+
+ © Copyright Housemarque Oy 2002 +
+
+Permission to copy, use, modify, sell and distribute this document is granted provided this copyright notice appears in all copies.  +This document is provided "as is" without express or implied warranty and with no claim as to its suitability for any purpose. +
+ + diff --git a/doc/topics/problems.html b/doc/topics/problems.html new file mode 100644 index 0000000..cf5d53c --- /dev/null +++ b/doc/topics/problems.html @@ -0,0 +1,124 @@ + + + problems.html + + + +

Known Problems of the C/C++ Preprocessor

+
+ Preprocessor metaprogramming is subject to heated discussions.  + Part of this is caused by bad experiences with dangerous techniques, + such as defining inline functions using macros.  + As a rule of thumb, if you can find a clean and manageable way to do something + without the preprocessor, then you should do it that way. +
+
+ Let's survey some of the widely known problems of the preprocessor in a problem/solution format. +
+

Problem #1

+
+ The preprocessor does not respect scope, therefore macros can accidentally and sometimes silently replace code. +
+
+ Solution A +
+ Use all caps identifiers for macros and only macros.  + This practically eliminates the possibility that a macro might replace other kinds of code accidentally. +
+
+
+ Solution B +
+ Use the local macro idiom: +
+
+#define MACRO ...
+// use MACRO
+#undef MACRO
+
+
+ This makes sure that a macro cannot accidentally replace code outside of the scope of the local macro. +
+
+ A problem with this solution is that the #undef cannot be automated and may be forgotten.  + Experienced programmers generally write the #undef either immediately before (in time) + or immediately after writing the macro definition. +
+
+
+ Solution C +
+ Use the unique macro prefix idiom. +
+
+#define UMP_MACRO
+// use UMP_MACRO
+
+
+ This makes accidental substitution and collisions highly unlikely.  + Problems with this solution include: +
+
    +
  • There can still be naming collisions inside a large project.
  • +
  • Macros still pollute the global namespace.
  • +
+ By combining all solutions, whenever possible, the scope problem can be largely avoided. +
+

Problem #2

+
+ Preprocessor code is difficult to read.  + It requires an understanding of the basic process of how the preprocessor recursively expands macros, + finding macro definitions, and mentally substituting the parameters of the macro. +
+
+ Solution +
+ Any kind of programming requires a basic understanding of how the code is executed.  + Any parameterization technique, including simple functions and templates requires finding + the definition and mentally substituting parameters. +
+
+ However, it is good to know a few techniques: +
+
    +
  • By using as many local macros as reasonable, the bulk of the searching process can be eliminated.
  • +
  • Code browsers and text search tools make it easier to find the definitions.
  • +
  • The compiler can be used for generating the preprocessed source code in order to look for bugs.
  • +
  • + Before turning something into a preprocessor metaprogram, first implement a small scale version + of it without the preprocessor.  + The work bottom-up, replacing hand-written constructs by using the preprocessor.  + This way you can test the code incrementally.  + Experienced programmers often skip many stages, but if something proves too complex to write + directly, it is always possible to fall back to incremental methods. +
  • +
  • + If you insert a special symbol into the preprocessor code in places where there should be a line break, + you can make code readable after preprocessing simply by using a search and replace tool. +
  • +
+ An especially important thing to remember is to limit the use of the preprocessor to + structured, well-understood, and safe methods.  + Structure helps to understand complex systems [McConnell]. +
+

Problem #3

+
+ "I'd like to see Cpp abolished." - Bjarne Stroustrup in [Stroustrup]. +
+
+ Solution +
+ The C/C++ preprocessor will be here for a long time. +
+ In practice, preprocessor metaprogramming is far simpler and more portable than template metaprogramming [Czarnecki]. +
+
+
+ © Copyright Housemarque Oy 2002 +
+
+Permission to copy, use, modify, sell and distribute this document is granted provided this copyright notice appears in all copies.  +This document is provided "as is" without express or implied warranty and with no claim as to its suitability for any purpose. +
+ + diff --git a/doc/topics/reentrancy.html b/doc/topics/reentrancy.html new file mode 100644 index 0000000..1bdc0fa --- /dev/null +++ b/doc/topics/reentrancy.html @@ -0,0 +1,253 @@ + + + reentrancy.html + + + +

Reentrancy

+
+ Macro expansion in the preprocessor is entirely functional.  + Therefore, there is no iteration.  + Unfortunately, the preprocessor also disallows recursion.  + This means that the library must fake iteration or recursion by + defining sets of macros that are implemented similarly.  +
+
+ To illustrate, here is a simple concatenation macro: +
+
+#define CONCAT(a, b) CONCAT_D(a, b)
+#define CONCAT_D(a, b) a ## b
+
+CONCAT(a, CONCAT(b, c)) // abc
+
+
+ This is fine for a simple case like the above, but what happens in a scenario like the following: +
+
+#define AB(x, y) CONCAT(x, y)
+
+CONCAT(A, B(p, q)) // CONCAT(p, q)
+
+
+ Because there is no recursion, the example above expands to CONCAT(p, q) rather than pq. +
+
+ There are only two ways to "fix" the above.  + First, it can be documented that AB uses CONCAT and disallow usage similar to the above.  + Second, multiple concatenation macros can be provided.... +
+
+#define CONCAT_1(a, b) CONCAT_1_D(a, b)
+#define CONCAT_1_D(a, b) a ## b
+
+#define CONCAT_2(a, b) CONCAT_2_D(a, b)
+#define CONCAT_2_D(a, b) a ## b
+
+#define AB(x, y) CONCAT_2(x, y)
+
+CONCAT_1(A, B(p, q)) // pq
+
+
+ This solves the problem.  + However, it is now necessary to know that AB uses, not only a concatenation macro, + but CONCAT_2 specifically. +
+
+ A better solution is to abstract which concatenation macro is used.... +
+
+#define AB(c, x, y) CONCAT_ ## c(x, y)
+
+CONCAT_1(A, B(2, p, q)) // pq
+
+
+ This is an example of generic reentrance, in this case, into a fictional set of concatenation macros.  + The c parameter represents the "state" of the concatenation construct, + and as long as the user keeps track of this state, AB can be used inside of a concatenation macro. +
+
+ The library has the same choices.  + It either has to disallow a construct being inside itself or provide multiple, equivalent definitions of a construct + and provide a uniform way to reenter that construct.  + There are several contructs that require recursion (such as BOOST_PP_WHILE).  + Consequently, the library chooses to provide several sets of macros with mechanisms to reenter the set at a macro + that has not already been used. +
+
+ In particular, the library must provide reentrance for BOOST_PP_FOR, BOOST_PP_REPEAT, and BOOST_PP_WHILE.  + There are two mechanisms that are used to accomplish this:  state parameters (like the above concatenation example) and automatic recursion. +
+

State Parameters

+
+ Each of the above constructs (BOOST_PP_FOR, BOOST_PP_REPEAT, and BOOST_PP_WHILE) has an associated state.  + This state provides the means to reenter the respective construct. +
+
+ Several user-defined macros are passed to each of these constructs (for use as predicates, operations, etc.).  + Every time a user-defined macro is invoked, it is passed the current state of the construct that invoked it so that the macro can reenter + the respective set if necessary. +
+
+ These states are used in one of two ways--either by concatenating to or passing to another macro. +
+
+ There are three types of macros that use these state parameters.  + First, the set itself which is reentered through concatenation.  + Second, corresponding sets that act like they are a part of the the primary set.  + These are also reentered through concatenation.  + And third, macros that internally use the first or second type of macro.  + These macros take the state as an additional argument. +
+
+ The state of BOOST_PP_WHILE is symbolized by the letter D.  + Two user-defined macros are passed to BOOST_PP_WHILE--a predicate and an operation.  + When BOOST_PP_WHILE expands these macros, it passes along its state so that these macros + can reenter the BOOST_PP_WHILE set.  +
+
+ Consider the following multiplication implementation that illustrates this technique: +
+
+// The addition interface macro.
+// The _D signifies that it reenters
+// BOOST_PP_WHILE with concatenation.
+
+#define ADD_D(d, x, y) \
+   BOOST_PP_TUPLE_ELEM( \
+      2, 0, \
+      BOOST_PP_WHILE_ ## d(ADD_P, ADD_O, (x, y)) \
+   ) \
+   /**/
+
+// The predicate that is passed to BOOST_PP_WHILE.
+// It returns "true" until "y" becomes zero.
+
+#define ADD_P(d, xy) BOOST_PP_TUPLE_ELEM(2, 1, xy)
+
+// The operation that is passed to BOOST_PP_WHILE.
+// It increments "x" and decrements "y" which will
+// eventually cause "y" to equal zero and therefore
+// cause the predicate to return "false."
+
+#define ADD_O(d, xy) \
+   ( \
+      BOOST_PP_INC( \
+         BOOST_PP_TUPLE_ELEM(2, 0, xy) \
+      ), \
+      BOOST_PP_DEC( \
+         BOOST_PP_TUPLE_ELEM(2, 1, xy) \
+      ) \
+   ) \
+   /**/
+
+// The multiplication interface macro.
+
+#define MUL(x, y) \
+   BOOST_PP_TUPLE_ELEM( \
+      3, 0, \
+      BOOST_PP_WHILE(MUL_P, MUL_O, (0, x, y)) \
+   ) \
+   /**/
+
+// The predicate that is passed to BOOST_PP_WHILE.
+// It returns "true" until "y" becomes zero.
+
+#define MUL_P(d, rxy) BOOST_PP_TUPLE_ELEM(3, 2, rxy)
+
+// The operation that is passed to BOOST_PP_WHILE.
+// It adds "x" to "r" and decrements "y" which will
+// eventually cause "y" to equal zero and therefore
+// cause the predicate to return "false."
+
+#define MUL_O(d, rxy) \
+   ( \
+      ADD_D( \
+         d, /* pass the state on to ADD_D */ \
+         BOOST_PP_TUPLE_ELEM(3, 0, rxy), \
+         BOOST_PP_TUPLE_ELEM(3, 1, rxy) \
+      ), \
+      BOOST_PP_TUPLE_ELEM(3, 1, rxy), \
+      BOOST_PP_DEC( \
+         BOOST_PP_TUPLE_ELEM(3, 2, rxy) \
+      ) \
+   ) \
+   /**/
+
+MUL(3, 2) // expands to 6
+
+
+ There are a couple things to note in the above implementation.  + First, note how ADD_D reenters BOOST_PP_WHILE using the d state parameter.  + Second, note how MUL's operation, which is expanded by BOOST_PP_WHILE, passes the state + on to ADD_D.  + This illustrates state reentrance by both argument and concatenation. +
+
+ For every macro in the library that uses BOOST_PP_WHILE, + there is a state reentrant variant.  + If that variant uses an argument rather than concatenation, it is suffixed by _D to symbolize its + method of reentrance.  + Examples or this include the library's own BOOST_PP_ADD_D and BOOST_PP_MUL_D.  + If the variant uses concatenation, it is suffixed by an underscore.  + It is completed by concatenation of the state.  + This includes BOOST_PP_WHILE itself with BOOST_PP_WHILE_ ## d and, for example, + BOOST_PP_LIST_FOLD_LEFT with BOOST_PP_LIST_FOLD_LEFT_ ## d. +
+
+ The same set of conventions are used for BOOST_PP_FOR and BOOST_PP_REPEAT, but with the letters + R and Z, respectively, to symbolize their states. +
+
+ Also note that the above MUL implementation, though not immediately obvious, is using all three + types of reentrance.  + Not only is it using both types of state reentrance, it is also using automatic recursion.... +
+

Automatic Recursion

+
+ Automatic recursion is a technique that vastly simplifies the use of reentrant constructs.  + It is used by simply not using any state parameters at all. +
+
+ The MUL example above uses automatic recursion when it uses BOOST_PP_WHILE by itself.  + In other words, MUL can still be used inside BOOST_PP_WHILE even though it doesn't + reenter BOOST_PP_WHILE by concatenating the state to BOOST_PP_WHILE_. +
+
+ To accomplish this, the library uses a "trick."  + Despite what it looks like, the macro BOOST_PP_WHILE does not take three arguments.  + In fact, it takes no arguments at all.  + Instead, the BOOST_PP_WHILE macro expands to a macro that takes three arguments.  + It simply detects what the next available BOOST_PP_WHILE_ ## d macro is and returns it.  + This detection process is somewhat involved, so I won't go into how it works here, + but suffice to say it does work. +
+
+ Using automatic recursion to reenter various sets of macros is obviously much simpler.  + It completely hides the underlying implementation details.  + So, if it is so much easier to use, why do the state parameters still exist?  + The reason is simple as well.  + When state parameters are used, the state is known at all times.  + This is not the case when automatic recursion is used.  + The automatic recursion mechanism has to deduce the state at each point that it is used.  + This implies a cost in macro complexity that in some situations--notably at deep macro depths--will slow + some preprocessors to a crawl. +
+

Conclusion

+
+ It is really a tradeoff whether to use state parameters or automatic recursion for reentrancy.  + The strengths of automatic recursion are ease of use and implementation encapsulation.  + These come at a performance cost on some preprocessors in some situations.  + The primary strength of state parameters, on the other hand, is efficiency.  + Use of the state parameters is the only way to achieve maximum efficiency.  + This efficiency comes at the cost of both code complexity and exposition of implementation. +
+

See Also

+ +
- Paul Mensonides
+ + diff --git a/doc/topics/techniques.html b/doc/topics/techniques.html new file mode 100644 index 0000000..adf9869 --- /dev/null +++ b/doc/topics/techniques.html @@ -0,0 +1,336 @@ + + + techniques.html + + + + +

Techniques

+
+ The preprocessor metaprogramming techniques are presented in example format. +
+ +

Example - Use a local macro to avoid small scale repetition.

+
+#define BOOST_PP_DEF(op) /* ..................................... */ \
+   template<class T, int n>                                          \
+   vec<T, n> operator op ## =(vec<T, n> lhs, const vec<T, n>& rhs) { \
+      for (int i = 0; i < n; ++i) {                                  \
+         lhs(i) op ## = rhs(i);                                      \
+      }                                                              \
+   }                                                                 \
+   /**/
+
+BOOST_PP_DEF(+)
+BOOST_PP_DEF(-)
+BOOST_PP_DEF(*)
+BOOST_PP_DEF(/)
+
+#undef BOOST_PP_DEF
+
+
+ Tip:  It is usually okay to use a standard macro name like BOOST_PP_DEF for this kind of code + because the macro is both defined and undefined in the immediate site of its use. +
+
+ Tip:  It is easier to verify proper use of the line continuation operator when they are aligned. +
+
+ Notes:  You can extend this example by defining more and different kinds of operators.  + Before doing so, consider using the algebraic categories technique introduced in [Barton] + or a layered architecture (see for instance [Czarnecki]).  + However, at some point you must type the operator tokens *, /, +, -, etc., + because it is impossible to generate them using templates.  + The resulting categorical repetition of tokens can be eliminated by using preprocessor metaprogramming. +
+ +

Example - Use BOOST_PP_EMPTY as an unused parameter in local macro instantiations.

+
+#define BOOST_PP_DEF(cv) /* ... */ \
+   template<class base>            \
+   cv() typename implement_subscript_using_begin_subscript<base>::value_type& \
+   implement_subscript_using_begin_subscript<base>::operator[](index_type i) cv() { \
+      return base::begin()[i];     \
+   }                               \
+   /**/
+
+
+ How:  BOOST_PP_EMPTY() expands to nothing and can be used as an unused parameter. +
+
+ Note:  BOOST_PP_EMPTY with the () never gets expanded.  + The () is necessary to invoke a function-like macro. +
+
+ Caveat:  You cannot safely use concatenation while using BOOST_PP_EMPTY(). +
+
+ Tip:  Occasionally, one or two lines are considerably longer than the rest.  + It can often save some work to not align all the line continuation operators without making the code too unreadable. +
+
+ Tip:  Use syntax highlighting on preprocessor metaprogramming macro identifiers such as: +
    +
  • BOOST_PP_DEF
  • +
  • BOOST_PP_EMPTY
  • +
  • BOOST_PP_REPEAT
  • +
  • ...
  • +
+ It can greatly improve readability. +
+ +

Example - Use BOOST_PP_CAT instead of ## when necessary.

+
+#define STATIC_ASSERT(expr) \
+   enum { BOOST_PP_CAT(static_check_, __LINE__) = (expr) ? 1 : -1 }; \
+   typedef char \
+      BOOST_PP_CAT(static_assert_, __LINE__)[BOOST_PP_CAT(static_check_, __LINE__)] \
+   /**/
+
+// ...
+
+STATIC_ASSERT(sizeof(int) <= sizeof(long));
+
+
+ Why:  Macro expansion proceeds recursively in "layers."  + Token pasting prevents the preprocessor from performing macro expansion, + therefore it is often necessary to delay token concatenation. +
+ +

Example - Use BOOST_PP_STRINGIZE instead of # whenever necessary.

+
+#define NOTE(str) \
+   message(__FILE__ "(" BOOST_PP_STRINGIZE(__LINE__) ") : " str) \
+   /**/
+
+// ...
+
+#pragma NOTE("TBD!")
+
+
+ Why:  Macro expansion proceeds recursively in "layers."  + Stringization prevents the preprocessor from performing macro expansion, therefore it is often necessary to delay stringization. +
+ +

Example - Use BOOST_PP_ENUM_PARAMS (and its variants) or BOOST_PP_REPEAT and BOOST_PP_COMMA_IF to avoid O(n) repetition on lists in general.

+
+struct make_type_list_end;
+
+template<
+   BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
+      MAKE_TYPE_LIST_MAX_LENGTH, 
+      class T, 
+      make_type_list_end
+   )
+>
+struct make_type_list {
+   private:
+      enum { end = is_same<T0, make_type_list_end>::value };
+   public:
+      typedef typename type_if<
+         end, type_cons_empty,
+         type_cons<
+            T0,
+            typename type_inner_if<
+               end, type_identity<end>,
+               make_type_list<
+                  BOOST_PP_ENUM_SHIFTED_PARAMS(
+                     MAKE_TYPE_LIST_MAX_LENGTH,
+                     T
+                  )
+               >
+            >::type
+         >
+      >::type type;
+};
+
+
+ How:  BOOST_PP_REPEAT uses simulated recursion (pseudo code): +
+
+#define BOOST_PP_REPEAT(n, m, p) BOOST_PP_REPEAT ## n(m, p)
+
+#define BOOST_PP_REPEAT0(m, p)
+#define BOOST_PP_REPEAT1(m, p) m(0, p)
+#define BOOST_PP_REPEAT2(m, p) m(0, p) m(1, p)
+#define BOOST_PP_REPEAT3(m, p) BOOST_PP_REPEAT2(m, p) m(2, p)
+#define BOOST_PP_REPEAT4(m, p) BOOST_PP_REPEAT3(m, p) m(3, p)
+// ...
+
+
+ Note:  This is no longer how BOOST_PP_REPEAT is implemented, so the code above is illustrative only!  +
+
+ BOOST_PP_ENUM_PARAMS and its variations use BOOST_PP_REPEAT.  + BOOST_PP_COMMA_IF(I) expands to a comma if I != 0.  + BOOST_PP_INC(I) essentially expands to "I+1," and BOOST_PP_DEC(I) essentially expands to "I-1.". +
+ +

Example - Use a conditional macro definition to enable user configuration of code repetition based on need rather than some "reasonable" upper limit.

+
+#ifndef MAKE_TYPE_LIST_MAX_LENGTH
+#define MAKE_TYPE_LIST_MAX_LENGTH 8
+#endif
+
+
+ Now the user can configure the make_type_list primitive without modifying library code. +
+ +

Example - Use BOOST_PP_REPEAT and a token look-up function to eliminate categorical repetition.

+
+// CAVEAT:  My compiler is not standard on arithmetic types.
+#define ARITHMETIC_TYPE(I) ARITHMETIC_TYPE ## I
+
+#define ARITHMETIC_TYPE0    bool
+#define ARITHMETIC_TYPE1    char
+#define ARITHMETIC_TYPE2    signed char
+#define ARITHMETIC_TYPE3    unsigned char
+#define ARITHMETIC_TYPE4    short
+#define ARITHMETIC_TYPE5    unsigned short
+#define ARITHMETIC_TYPE6    int
+#define ARITHMETIC_TYPE7    unsigned int
+#define ARITHMETIC_TYPE8    long
+#define ARITHMETIC_TYPE9    unsigned long
+#define ARITHMETIC_TYPE10   float
+#define ARITHMETIC_TYPE11   double
+#define ARITHMETIC_TYPE12   long double
+
+#define ARITHMETIC_TYPE_CNT 13
+
+// ...
+
+#define BOOST_PP_DEF(z, I, _) /* ... */ \
+   catch (ARITHMETIC_TYPE(I) t) {       \
+      report_typeid(t);                 \
+      report_value(t);                  \
+   }                                    \
+   /**/
+
+BOOST_PP_REPEAT(ARITHMETIC_TYPE_CNT, BOOST_PP_DEF, _)
+
+#undef BOOST_PP_DEF
+
+
+ Note:  The repetition of the above example can be eliminated using template metaprogramming [Czarnecki] as well.  + However categorical repetition of operator tokens cannot be completely eliminated by using template metaprogramming. +
+ +

Example - Use BOOST_PP_REPEAT to avoid O(n*n) repetition.

+
+#ifndef MAX_VEC_ARG_CNT
+#define MAX_VEC_ARG_CNT 8
+#endif
+
+// ...
+
+#define ARG_FUN(z, i, _) BOOST_PP_COMMA_IF(i) T a ## i
+#define ASSIGN_FUN(z, i, ) (*this)[i] = a ## i;
+
+#define DEF_VEC_CTOR_FUN(z, i, _) /* ... */ \
+   vec(BOOST_PP_REPEAT(i, ARG_FUN, _)) { \
+      BOOST_PP_REPEAT(i, ASSIGN_FUN, _)  \
+   }                                     \
+   /**/
+
+BOOST_PP_REPEAT(BOOST_PP_INC(MAX_VEC_ARG_CNT), DEF_VEC_CTOR_FUN, _)
+
+#undef ARG_FUN
+#undef ASSIGN_FUN
+#undef DEF_VEC_CTOR_FUN
+
+// ...
+
+
+ How:  BOOST_PP_REPEAT is implemented is a special way to enable automatic recursion. +
+ +

Example - Use BOOST_PP_IF to implement special case for the first element.

+
+#define COMMA_IF(c) \
+   BOOST_PP_IF(c, BOOST_PP_COMMA, BOOST_PP_EMPTY)() \
+   /**/
+
+BOOST_PP_IF(0, true, false) == false;
+BOOST_PP_IF(1, true, false) == true;
+
+
+ BOOST_PP_IF enables convenient generation of lists using BOOST_PP_REPEAT. +
+
+ Note:  THEN and ELSE don't have to be macros.  + However, if at least one of them is a function-like macro, and you want it be expanded conditionally, + you have to make the other parameter a function-like macro too.  + This can often be done using BOOST_PP_IDENTITY.  + Consider the following example (by Aleksey Gurtovoy): +
+
+#define NUMBERED_EXPRESSION(i, x) /* ... */ \
+   BOOST_PP_IF(                             \
+      i,                                    \
+      BOOST_PP_IDENTITY(x ## i)             \
+      BOOST_PP_EMPTY                        \
+   )()                                      \
+   /**/
+
+
+ Note:  Like in the above implementation of COMMA_IF, the result of BOOST_PP_IF is often invoked and not the THEN and ELSE parameters.  + If the parameters were invoked, the code would not expand correctly, because the BOOST_PP_EMPTY parameter would get expanded + to nothing before the BOOST_PP_IF would be properly expanded. +
+
+ How:  BOOST_PP_IF is defined for the entire repeat range (psuedo code): +
+
+#define BOOST_PP_IF(c, THEN, ELSE) BOOST_PP_IF ## c(THEN, ELSE)
+
+#define BOOST_PP_IF0(THEN, ELSE) ELSE
+#define BOOST_PP_IF1(THEN, ELSE) THEN
+#define BOOST_PP_IF1(THEN, ELSE) THEN
+// ...
+
+ +

Example:  Use arithmetic, logical, and comparison operations when necessary.

+
+#define SPECIAL_NUMBERED_LIST(n, i, elem, special) \
+   BOOST_PP_ASSERT_MSG(                     \
+      BOOST_PP_LESS(i, n),                  \
+      bad params for SPECIAL_NUMBERED_LIST! \
+   )                                        \
+   BOOST_PP_ENUM_PARAMS(i, elem)            \
+   BOOST_PP_COMMA_IF(i) special             \
+   BOOST_PP_REPEAT(                         \
+      BOOST_PP_SUB(BOOST_PP_DEC(n), i),     \
+      SPECIAL_NUMBERED_LIST_HELPER,         \
+      (elem, i)                             \
+   )                                        \
+   /**/
+
+#define SPECIAL_NUMBERED_LIST_HELPER(z, i, elem_base) \
+   ,                                          \
+   BOOST_PP_CAT(                              \
+      BOOST_PP_TUPLE_ELEM(2, 0, elem_base),   \
+      BOOST_PP_ADD(                           \
+         i,                                   \
+         BOOST_PP_TUPLE_ELEM(2, 1, elem_base) \
+      )                                       \
+   )                                          \
+   /**/
+
+SPECIAL_NUMBERED_LIST(3, 0, E, S)
+SPECIAL_NUMBERED_LIST(3, 1, E, S)
+SPECIAL_NUMBERED_LIST(3, 2, E, S)
+SPECIAL_NUMBERED_LIST(3, 3, E, S)
+
+ +
+
+ © Copyright Housemarque Oy 2002 +
+
+Permission to copy, use, modify, sell and distribute this document is granted provided this copyright notice appears in all copies.  +This document is provided "as is" without express or implied warranty and with no claim as to its suitability for any purpose. +
+ +