From 666a3eca2d9ab68bdfa7e8dcef2e98fad9f06bc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20J=C3=A4rvi?= Date: Wed, 10 Dec 2003 19:15:05 +0000 Subject: [PATCH] patch by Jim Apple to fix things here and there [SVN r21213] --- include/boost/lambda/algorithm.hpp | 422 +++++++++++++++-------------- 1 file changed, 213 insertions(+), 209 deletions(-) diff --git a/include/boost/lambda/algorithm.hpp b/include/boost/lambda/algorithm.hpp index c11e5b2..5bd998e 100644 --- a/include/boost/lambda/algorithm.hpp +++ b/include/boost/lambda/algorithm.hpp @@ -38,9 +38,9 @@ struct for_each { >::type type; }; - template + template C - operator()(A a, B b, C c) const + operator()(A a, A b, C c) const { return ::std::for_each(a, b, c); } }; @@ -55,9 +55,9 @@ struct find { >::type type; }; - template + template A - operator()(A a, B b, const C& c) const + operator()(A a, A b, const C& c) const { return ::std::find(a, b, c); } }; @@ -73,9 +73,9 @@ struct find_if { >::type type; }; - template + template A - operator()(A a, B b, C c) const + operator()(A a, A b, C c) const { return ::std::find_if(a, b, c); } }; @@ -90,14 +90,14 @@ struct find_end { >::type type; }; - template + template A - operator()(A a, B b, C c, D d) const + operator()(A a, A b, C c, C d) const { return ::std::find_end(a, b, c, d); } - template + template A - operator()(A a, B b, C c, D d, E e) const + operator()(A a, A b, C c, C d, E e) const { return ::std::find_end(a, b, c, d, e); } }; @@ -113,14 +113,14 @@ struct find_first_of { >::type type; }; - template + template A - operator()(A a, B b, C c, D d) const + operator()(A a, A b, C c, C d) const { return ::std::find_first_of(a, b, c, d); } - template + template A - operator()(A a, B b, C c, D d, E e) const + operator()(A a, A b, C c, C d, E e) const { return ::std::find_first_of(a, b, c, d, e); } }; @@ -136,14 +136,14 @@ struct adjacent_find { >::type type; }; - template + template A - operator()(A a, B b) const + operator()(A a, A b) const { return ::std::adjacent_find(a, b); } - template + template A - operator()(A a, B b, C c) const + operator()(A a, A b, C c) const { return ::std::adjacent_find(a, b, c); } }; @@ -161,10 +161,10 @@ struct count { >::difference_type type; }; - template + template typename ::std::iterator_traits::difference_type - operator()(A a, B b) const - { return ::std::count(a, b); } + operator()(A a, A b, const C& c) const + { return ::std::count(a, b, c); } }; // count_if --------------------------------- @@ -180,9 +180,9 @@ struct count_if { >::difference_type type; }; - template + template typename ::std::iterator_traits::difference_type - operator()(A a, B b, C c) const + operator()(A a, A b, C c) const { return ::std::count_if(a, b, c); } }; @@ -195,21 +195,25 @@ struct mismatch { struct sig { typedef typename boost::remove_const< typename boost::tuples::element<1, Args>::type - >::type element_type; + >::type element1_type; - typedef ::std::pair< element_type, element_type > type; + typedef typename boost::remove_const< + typename boost::tuples::element<3, Args>::type + >::type element2_type; + + typedef ::std::pair< element1_type, element2_type > type; }; - template - ::std::pair - operator()(A a, B b) const - { return ::std::mismatch(a, b); } - - template - ::std::pair - operator()(A a, B b, C c) const + template + ::std::pair + operator()(A a, A b, C c) const { return ::std::mismatch(a, b, c); } + template + ::std::pair + operator()(A a, A b, C c, D d) const + { return ::std::mismatch(a, b, c, d); } + }; // equal --------------------------------- @@ -221,14 +225,14 @@ struct equal { typedef bool type; }; - template + template bool - operator()(A a, B b, C c) const + operator()(A a, A b, C c) const { return ::std::equal(a, b, c); } - template + template bool - operator()(A a, B b, C c, D d) const + operator()(A a, A b, C c, D d) const { return ::std::equal(a, b, c, d); } }; @@ -244,14 +248,14 @@ struct search { >::type type; }; - template + template A - operator()(A a, B b, C c, D d) const + operator()(A a, A b, C c, C d) const { return std::search(a, b, c, d);} - template + template A - operator()(A a, B b, C c, D d, E e) + operator()(A a, A b, C c, C d, E e) const { return std::search(a, b, c, d, e);} }; @@ -267,9 +271,9 @@ struct copy { >::type type; }; - template + template C - operator()(A a, B b, C c) const + operator()(A a, A b, C c) const { return ::std::copy(a, b, c); } }; @@ -285,9 +289,9 @@ struct copy_backward { >::type type; }; - template + template C - operator()(A a, B b, C c) const + operator()(A a, A b, C c) const { return ::std::copy_backward(a, b, c); } }; @@ -301,9 +305,9 @@ struct swap { typedef void type; }; - template + template void - operator()(A a, B b) const + operator()(A a, A b) const { ::std::swap(a, b); } }; @@ -319,9 +323,9 @@ struct swap_ranges { >::type type; }; - template + template C - operator()(A a, B b, C c) const + operator()(A a, A b, C c) const { return ::std::swap_ranges(a, b, c); } }; @@ -335,9 +339,9 @@ struct iter_swap { typedef void type; }; - template + template void - operator()(A a, B b) const + operator()(A a, A b) const { ::std::iter_swap(a, b); } }; @@ -357,14 +361,14 @@ struct transform { >::type type; }; - template + template C - operator()(A a, B b, C c, D d) const + operator()(A a, A b, C c, D d) const { return std::transform(a, b, c, d);} - template + template D - operator()(A a, B b, C c, D d, E e) + operator()(A a, A b, C c, D d, E e) const { return std::transform(a, b, c, d, e);} }; @@ -378,9 +382,9 @@ struct replace { typedef void type; }; - template + template void - operator()(A a, B b, C c, D d) const + operator()(A a, A b, const C& c, const C& d) const { ::std::replace(a, b, c, d); } }; @@ -394,9 +398,9 @@ struct replace_if { typedef void type; }; - template + template void - operator()(A a, B b, C c, D d) const + operator()(A a, A b, C c, const D& d) const { ::std::replace_if(a, b, c, d); } }; @@ -412,9 +416,9 @@ struct replace_copy { >::type type; }; - template + template C - operator()(A a, B b, C c, D d, E e) const + operator()(A a, A b, C c, const D& d, const D& e) const { return ::std::replace_copy(a, b, c, d, e); } }; @@ -430,9 +434,9 @@ struct replace_copy_if { >::type type; }; - template + template C - operator()(A a, B b, C c, D d, E e) const + operator()(A a, A b, C c, D d, const E& e) const { return ::std::replace_copy_if(a, b, c, d, e); } }; @@ -446,9 +450,9 @@ struct fill { typedef void type; }; - template + template void - operator()(A a, B b, C c) const + operator()(A a, A b, const C& c) const { ::std::fill(a, b, c); } }; @@ -464,7 +468,7 @@ struct fill_n { template void - operator()(A a, B b, C c) const + operator()(A a, B b, const C& c) const { ::std::fill_n(a, b, c); } }; @@ -478,9 +482,9 @@ struct generate { typedef void type; }; - template + template void - operator()(A a, B b, C c) const + operator()(A a, A b, C c) const { ::std::generate(a, b, c); } }; @@ -512,9 +516,9 @@ struct remove { >::type type; }; - template + template A - operator()(A a, B b, C c) const + operator()(A a, A b, const C& c) const { return ::std::remove(a, b, c); } }; @@ -529,9 +533,9 @@ struct remove_if { >::type type; }; - template + template A - operator()(A a, B b, C c) const + operator()(A a, A b, C c) const { return ::std::remove_if(a, b, c); } }; @@ -546,9 +550,9 @@ struct remove_copy { >::type type; }; - template + template C - operator()(A a, B b, C c, D d) const + operator()(A a, A b, C c, const D& d) const { return ::std::remove_copy(a, b, c, d); } }; @@ -563,9 +567,9 @@ struct remove_copy_if { >::type type; }; - template + template C - operator()(A a, B b, C c, D d) const + operator()(A a, A b, C c, D d) const { return ::std::remove_copy_if(a, b, c, d); } }; @@ -580,14 +584,14 @@ struct unique { >::type type; }; - template + template A - operator()(A a, B b) const + operator()(A a, A b) const { return ::std::unique(a, b); } - template + template A - operator()(A a, B b, C c) const + operator()(A a, A b, C c) const { return ::std::unique(a, b, c); } }; @@ -603,14 +607,14 @@ struct unique_copy { >::type type; }; - template + template C - operator()(A a, B b, C c) const + operator()(A a, A b, C c) const { return ::std::unique_copy(a, b, c); } - template + template C - operator()(A a, B b, C c, D d) const + operator()(A a, A b, C c, D d) const { return ::std::unique_copy(a, b, c, d); } }; @@ -624,9 +628,9 @@ struct reverse { typedef void type; }; - template + template void - operator()(A a, B b) const + operator()(A a, A b) const { ::std::reverse(a, b); } }; @@ -642,9 +646,9 @@ struct reverse_copy { >::type type; }; - template + template C - operator()(A a, B b, C c) const + operator()(A a, A b, C c) const { return ::std::reverse_copy(a, b, c); } }; @@ -658,9 +662,9 @@ struct rotate { typedef void type; }; - template + template void - operator()(A a, B b, C c) const + operator()(A a, A b, A c) const { ::std::rotate(a, b, c); } }; @@ -676,9 +680,9 @@ struct rotate_copy { >::type type; }; - template - C - operator()(A a, B b, C c, D d) const + template + D + operator()(A a, A b, A c, D d) const { return ::std::rotate_copy(a, b, c, d); } }; @@ -692,14 +696,14 @@ struct random_shuffle { typedef void type; }; - template + template void - operator()(A a, B b) const + operator()(A a, A b) const { ::std::random_shuffle(a, b); } - template + template void - operator()(A a, B b, C c) const + operator()(A a, A b, const C& c) const { ::std::random_shuffle(a, b, c); } }; @@ -716,9 +720,9 @@ struct partition { >::type type; }; - template + template A - operator()(A a, B b, C c) const + operator()(A a, A b, C c) const { return ::std::partition(a, b, c); } }; @@ -734,9 +738,9 @@ struct stable_partition { >::type type; }; - template + template A - operator()(A a, B b, C c) const + operator()(A a, A b, C c) const { return ::std::stable_partition(a, b, c); } }; @@ -750,14 +754,14 @@ struct sort { typedef void type; }; - template + template void - operator()(A a, B b) const + operator()(A a, A b) const { ::std::sort(a, b); } - template + template void - operator()(A a, B b, C c) const + operator()(A a, A b, C c) const { ::std::sort(a, b, c); } }; @@ -771,14 +775,14 @@ struct stable_sort { typedef void type; }; - template + template void - operator()(A a, B b) const + operator()(A a, A b) const { ::std::stable_sort(a, b); } - template + template void - operator()(A a, B b, C c) const + operator()(A a, A b, C c) const { ::std::stable_sort(a, b, c); } }; @@ -792,14 +796,14 @@ struct partial_sort { typedef void type; }; - template + template void - operator()(A a, B b, C c) const + operator()(A a, A b, A c) const { ::std::partial_sort(a, b, c); } - template + template void - operator()(A a, B b, C c, D d) const + operator()(A a, A b, A c, D d) const { ::std::partial_sort(a, b, c, d); } }; @@ -815,14 +819,14 @@ struct partial_sort_copy { >::type type; }; - template + template C - operator()(A a, B b, C c, D d) const + operator()(A a, A b, C c, C d) const { return ::std::partial_sort_copy(a, b, c, d); } - template + template C - operator()(A a, B b, C c, D d, E e) const + operator()(A a, A b, C c, C d, E e) const { return ::std::partial_sort_copy(a, b, c, d, e); } }; @@ -835,14 +839,14 @@ struct nth_element { typedef void type; }; - template + template void - operator()(A a, B b, C c) const + operator()(A a, A b, A c) const { ::std::nth_element(a, b, c); } - template + template void - operator()(A a, B b, C c, D d) const + operator()(A a, A b, A c, D d) const { ::std::nth_element(a, b, c, d); } }; @@ -858,14 +862,14 @@ struct lower_bound { >::type type; }; - template + template A - operator()(A a, B b, C c) const + operator()(A a, A b, const C& c) const { return ::std::lower_bound(a, b, c); } - template + template A - operator()(A a, B b, C c, D d) const + operator()(A a, A b, const C& c, D d) const { return ::std::lower_bound(a, b, c, d); } }; @@ -881,14 +885,14 @@ struct upper_bound { >::type type; }; - template + template A - operator()(A a, B b, C c) const + operator()(A a, A b, const C& c) const { return ::std::upper_bound(a, b, c); } - template + template A - operator()(A a, B b, C c, D d) const + operator()(A a, A b, const C& c, D d) const { return ::std::upper_bound(a, b, c, d); } }; @@ -906,14 +910,14 @@ struct equal_range { typedef ::std::pair< element_type, element_type > type; }; - template + template ::std::pair - operator()(A a, B b, C c) const + operator()(A a, A b, const C& c) const { return ::std::equal_range(a, b, c); } - template + template ::std::pair - operator()(A a, B b, C c, D d) const + operator()(A a, A b, const C& c, D d) const { return ::std::equal_range(a, b, c, d); } }; @@ -927,14 +931,14 @@ struct binary_search { typedef bool type; }; - template + template bool - operator()(A a, B b, C c) const + operator()(A a, A b, const C& c) const { return ::std::binary_search(a, b, c); } - template + template bool - operator()(A a, B b, C c, D d) const + operator()(A a, A b, const C& c, D d) const { return ::std::binary_search(a, b, c, d); } }; @@ -950,14 +954,14 @@ struct merge { >::type type; }; - template + template E - operator()(A a, B b, C c, D d, E e) const + operator()(A a, A b, C c, C d, E e) const { return std::merge(a, b, c, d, e);} - template + template E - operator()(A a, B b, C c, D d, E e, F f) + operator()(A a, A b, C c, C d, E e, F f) const { return std::merge(a, b, c, d, e, f);} }; @@ -971,14 +975,14 @@ struct inplace_merge { typedef void type; }; - template + template void - operator()(A a, B b, C c) const + operator()(A a, A b, A c) const { ::std::inplace_merge(a, b, c); } - template + template void - operator()(A a, B b, C c, D d) const + operator()(A a, A b, A c, D d) const { ::std::inplace_merge(a, b, c, d); } }; @@ -992,14 +996,14 @@ struct includes { typedef bool type; }; - template + template bool - operator()(A a, B b, C c, D d) const + operator()(A a, A b, C c, C d) const { return ::std::includes(a, b, c, d); } - template + template bool - operator()(A a, B b, C c, D d, E e) const + operator()(A a, A b, C c, C d, E e) const { return ::std::includes(a, b, c, d, e); } }; @@ -1015,14 +1019,14 @@ struct set_union { >::type type; }; - template + template E - operator()(A a, B b, C c, D d, E e) const + operator()(A a, A b, C c, C d, E e) const { return std::set_union(a, b, c, d, e);} - template + template E - operator()(A a, B b, C c, D d, E e, F f) + operator()(A a, A b, C c, C d, E e, F f) const { return std::set_union(a, b, c, d, e, f);} }; @@ -1038,14 +1042,14 @@ struct set_intersection { >::type type; }; - template + template E - operator()(A a, B b, C c, D d, E e) const + operator()(A a, A b, C c, C d, E e) const { return std::set_intersection(a, b, c, d, e);} - template + template E - operator()(A a, B b, C c, D d, E e, F f) + operator()(A a, A b, C c, C d, E e, F f) const { return std::set_intersection(a, b, c, d, e, f);} }; @@ -1061,14 +1065,14 @@ struct set_difference { >::type type; }; - template + template E - operator()(A a, B b, C c, D d, E e) const + operator()(A a, A b, C c, C d, E e) const { return std::set_difference(a, b, c, d, e);} - template + template E - operator()(A a, B b, C c, D d, E e, F f) + operator()(A a, A b, C c, C d, E e, F f) const { return std::set_difference(a, b, c, d, e, f);} }; @@ -1085,14 +1089,14 @@ struct set_symmetric_difference { >::type type; }; - template + template E - operator()(A a, B b, C c, D d, E e) const + operator()(A a, A b, C c, C d, E e) const { return std::set_symmetric_difference(a, b, c, d, e);} - template + template E - operator()(A a, B b, C c, D d, E e, F f) + operator()(A a, A b, C c, C d, E e, F f) const { return std::set_symmetric_difference(a, b, c, d, e, f);} }; @@ -1106,14 +1110,14 @@ struct push_heap { typedef void type; }; - template + template void - operator()(A a, B b) const + operator()(A a, A b) const { ::std::push_heap(a, b); } - template + template void - operator()(A a, B b, C c) const + operator()(A a, A b, C c) const { ::std::push_heap(a, b, c); } }; @@ -1127,14 +1131,14 @@ struct pop_heap { typedef void type; }; - template + template void - operator()(A a, B b) const + operator()(A a, A b) const { ::std::pop_heap(a, b); } - template + template void - operator()(A a, B b, C c) const + operator()(A a, A b, C c) const { ::std::pop_heap(a, b, c); } }; @@ -1149,14 +1153,14 @@ struct make_heap { typedef void type; }; - template + template void - operator()(A a, B b) const + operator()(A a, A b) const { ::std::make_heap(a, b); } - template + template void - operator()(A a, B b, C c) const + operator()(A a, A b, C c) const { ::std::make_heap(a, b, c); } }; @@ -1170,14 +1174,14 @@ struct sort_heap { typedef void type; }; - template + template void - operator()(A a, B b) const + operator()(A a, A b) const { ::std::sort_heap(a, b); } - template + template void - operator()(A a, B b, C c) const + operator()(A a, A b, C c) const { ::std::sort_heap(a, b, c); } }; @@ -1193,14 +1197,14 @@ struct min { >::type type; }; - template + template A - operator()(A a, B b) const + operator()(const A& a, const A& b) const { return ::std::min(a, b); } - template + template A - operator()(A a, B b, C c) const + operator()(const A& a, const A& b, C c) const { return ::std::min(a, b, c); } }; @@ -1216,14 +1220,14 @@ struct max { >::type type; }; - template + template A - operator()(A a, B b) const + operator()(const A& a, const A& b) const { return ::std::max(a, b); } - template + template A - operator()(A a, B b, C c) const + operator()(const A& a, const A& b, C c) const { return ::std::max(a, b, c); } }; @@ -1237,14 +1241,14 @@ struct min_element { >::type type; }; - template + template A - operator()(A a, B b) const + operator()(A a, A b) const { return ::std::min_element(a, b); } - template + template A - operator()(A a, B b, C c) const + operator()(A a, A b, C c) const { return ::std::min_element(a, b, c); } }; @@ -1260,14 +1264,14 @@ struct max_element { >::type type; }; - template + template A - operator()(A a, B b) const + operator()(A a, A b) const { return ::std::max_element(a, b); } - template + template A - operator()(A a, B b, C c) const + operator()(A a, A b, C c) const { return ::std::max_element(a, b, c); } }; @@ -1282,14 +1286,14 @@ struct lexicographical_compare { typedef bool type; }; - template + template bool - operator()(A a, B b, C c, D d) const + operator()(A a, A b, C c, C d) const { return ::std::lexicographical_compare(a, b, c, d); } - template + template bool - operator()(A a, B b, C c, D d, E e) const + operator()(A a, A b, C c, C d, E e) const { return ::std::lexicographical_compare(a, b, c, d, e); } }; @@ -1303,14 +1307,14 @@ struct next_permutation { typedef bool type; }; - template + template bool - operator()(A a, B b) const + operator()(A a, A b) const { return ::std::next_permutation(a, b); } - template + template bool - operator()(A a, B b, C c) const + operator()(A a, A b, C c) const { return ::std::next_permutation(a, b, c); } }; @@ -1324,14 +1328,14 @@ struct prev_permutation { typedef bool type; }; - template + template bool - operator()(A a, B b) const + operator()(A a, A b) const { return ::std::prev_permutation(a, b); } - template + template bool - operator()(A a, B b, C c) const + operator()(A a, A b, C c) const { return ::std::prev_permutation(a, b, c); } };