summaryrefslogtreecommitdiff
path: root/boost
diff options
context:
space:
mode:
Diffstat (limited to 'boost')
-rw-r--r--boost/accumulators/framework/accumulators/droppable_accumulator.hpp11
-rw-r--r--boost/accumulators/statistics.hpp4
-rw-r--r--boost/accumulators/statistics/extended_p_square_quantile.hpp1
-rw-r--r--boost/accumulators/statistics/median.hpp2
-rw-r--r--boost/accumulators/statistics/p_square_cumul_dist.hpp260
-rw-r--r--boost/accumulators/statistics/p_square_cumulative_distribution.hpp259
-rw-r--r--boost/accumulators/statistics/weighted_median.hpp2
-rw-r--r--boost/accumulators/statistics/weighted_p_square_cumul_dist.hpp262
-rw-r--r--boost/accumulators/statistics/weighted_p_square_cumulative_distribution.hpp261
-rw-r--r--boost/accumulators/statistics/weighted_peaks_over_threshold.hpp1
-rw-r--r--boost/algorithm/clamp.hpp175
-rw-r--r--boost/algorithm/cxx11/all_of.hpp91
-rw-r--r--boost/algorithm/cxx11/any_of.hpp90
-rw-r--r--boost/algorithm/cxx11/copy_if.hpp133
-rw-r--r--boost/algorithm/cxx11/copy_n.hpp44
-rw-r--r--boost/algorithm/cxx11/find_if_not.hpp60
-rw-r--r--boost/algorithm/cxx11/iota.hpp74
-rw-r--r--boost/algorithm/cxx11/is_partitioned.hpp65
-rw-r--r--boost/algorithm/cxx11/is_permutation.hpp139
-rw-r--r--boost/algorithm/cxx11/is_sorted.hpp287
-rw-r--r--boost/algorithm/cxx11/none_of.hpp88
-rw-r--r--boost/algorithm/cxx11/one_of.hpp82
-rw-r--r--boost/algorithm/cxx11/partition_copy.hpp78
-rw-r--r--boost/algorithm/cxx11/partition_point.hpp72
-rw-r--r--boost/algorithm/hex.hpp265
-rw-r--r--boost/algorithm/searching/boyer_moore.hpp268
-rw-r--r--boost/algorithm/searching/boyer_moore_horspool.hpp194
-rw-r--r--boost/algorithm/searching/detail/bm_traits.hpp105
-rw-r--r--boost/algorithm/searching/detail/debugging.hpp30
-rw-r--r--boost/algorithm/searching/knuth_morris_pratt.hpp253
-rw-r--r--boost/algorithm/string/find.hpp8
-rw-r--r--boost/algorithm/string/iter_find.hpp6
-rw-r--r--boost/archive/basic_archive.hpp3
-rw-r--r--boost/archive/detail/basic_serializer_map.hpp2
-rw-r--r--boost/archive/detail/iserializer.hpp2
-rw-r--r--boost/archive/iterators/head_iterator.hpp4
-rw-r--r--boost/archive/iterators/remove_whitespace.hpp11
-rw-r--r--boost/archive/shared_ptr_helper.hpp2
-rw-r--r--boost/array.hpp13
-rw-r--r--boost/asio/basic_socket_iostream.hpp6
-rw-r--r--boost/asio/buffered_write_stream.hpp2
-rw-r--r--boost/asio/buffers_iterator.hpp4
-rw-r--r--boost/asio/detail/atomic_count.hpp3
-rw-r--r--boost/asio/detail/config.hpp33
-rw-r--r--boost/asio/detail/epoll_reactor.hpp2
-rw-r--r--boost/asio/detail/fenced_block.hpp6
-rw-r--r--boost/asio/detail/gcc_x86_fenced_block.hpp21
-rw-r--r--boost/asio/detail/impl/epoll_reactor.ipp50
-rw-r--r--boost/asio/detail/impl/socket_ops.ipp1
-rw-r--r--boost/asio/detail/impl/strand_service.hpp5
-rw-r--r--boost/asio/detail/impl/strand_service.ipp2
-rw-r--r--boost/asio/detail/impl/task_io_service.hpp2
-rw-r--r--boost/asio/detail/impl/task_io_service.ipp176
-rw-r--r--boost/asio/detail/keyword_tss_ptr.hpp72
-rw-r--r--boost/asio/detail/strand_service.hpp3
-rw-r--r--boost/asio/detail/task_io_service.hpp28
-rw-r--r--boost/asio/detail/tss_ptr.hpp6
-rw-r--r--boost/asio/detail/win_iocp_io_service.hpp16
-rw-r--r--boost/asio/ssl/detail/impl/engine.ipp10
-rw-r--r--boost/asio/ssl/detail/impl/openssl_init.ipp2
-rw-r--r--boost/asio/ssl/detail/openssl_types.hpp4
-rw-r--r--boost/asio/strand.hpp1
-rw-r--r--boost/asio/version.hpp2
-rw-r--r--boost/asio/windows/basic_object_handle.hpp6
-rw-r--r--boost/bimap/container_adaptor/list_map_adaptor.hpp1
-rw-r--r--boost/bimap/container_adaptor/map_adaptor.hpp1
-rw-r--r--boost/bimap/container_adaptor/multimap_adaptor.hpp1
-rw-r--r--boost/bimap/container_adaptor/unordered_map_adaptor.hpp1
-rw-r--r--boost/bimap/container_adaptor/unordered_multimap_adaptor.hpp1
-rw-r--r--boost/bimap/container_adaptor/vector_map_adaptor.hpp1
-rw-r--r--boost/bimap/detail/map_view_iterator.hpp6
-rw-r--r--boost/bimap/detail/set_view_iterator.hpp6
-rw-r--r--boost/bimap/relation/detail/mutant.hpp2
-rw-r--r--boost/bimap/relation/mutant_relation.hpp5
-rw-r--r--boost/bimap/views/unconstrained_map_view.hpp2
-rw-r--r--boost/bimap/views/unconstrained_set_view.hpp2
-rw-r--r--boost/chrono/config.hpp23
-rw-r--r--boost/chrono/detail/inlined/posix/process_cpu_clocks.hpp67
-rw-r--r--boost/chrono/detail/inlined/posix/thread_clock.hpp11
-rw-r--r--boost/chrono/detail/inlined/win/chrono.hpp1
-rw-r--r--boost/chrono/detail/inlined/win/process_cpu_clocks.hpp6
-rw-r--r--boost/chrono/detail/no_warning/signed_unsigned_cmp.hpp2
-rw-r--r--boost/chrono/detail/scan_keyword.hpp7
-rw-r--r--boost/chrono/detail/system.hpp5
-rw-r--r--boost/chrono/duration.hpp19
-rw-r--r--boost/chrono/process_cpu_clocks.hpp4
-rw-r--r--boost/chrono/system_clocks.hpp12
-rw-r--r--boost/chrono/thread_clock.hpp7
-rw-r--r--boost/chrono/time_point.hpp20
-rw-r--r--boost/concept_check.hpp10
-rw-r--r--boost/config/compiler/borland.hpp56
-rw-r--r--boost/config/compiler/clang.hpp66
-rw-r--r--boost/config/compiler/codegear.hpp39
-rw-r--r--boost/config/compiler/common_edg.hpp52
-rw-r--r--boost/config/compiler/cray.hpp46
-rw-r--r--boost/config/compiler/digitalmars.hpp50
-rw-r--r--boost/config/compiler/gcc.hpp60
-rw-r--r--boost/config/compiler/gcc_xml.hpp51
-rw-r--r--boost/config/compiler/hp_acc.hpp50
-rw-r--r--boost/config/compiler/intel.hpp50
-rw-r--r--boost/config/compiler/metrowerks.hpp52
-rw-r--r--boost/config/compiler/mpw.hpp52
-rw-r--r--boost/config/compiler/pathscale.hpp82
-rw-r--r--boost/config/compiler/pgi.hpp99
-rw-r--r--boost/config/compiler/sunpro_cc.hpp52
-rw-r--r--boost/config/compiler/vacpp.hpp62
-rw-r--r--boost/config/compiler/visualc.hpp137
-rw-r--r--boost/config/stdlib/dinkumware.hpp47
-rw-r--r--boost/config/stdlib/libcomo.hpp43
-rw-r--r--boost/config/stdlib/libcpp.hpp9
-rw-r--r--boost/config/stdlib/libstdcpp3.hpp58
-rw-r--r--boost/config/stdlib/modena.hpp43
-rw-r--r--boost/config/stdlib/msl.hpp43
-rw-r--r--boost/config/stdlib/roguewave.hpp43
-rw-r--r--boost/config/stdlib/sgi.hpp43
-rw-r--r--boost/config/stdlib/stlport.hpp47
-rw-r--r--boost/config/stdlib/vacpp.hpp43
-rw-r--r--boost/config/suffix.hpp329
-rw-r--r--boost/container/allocator/scoped_allocator.hpp651
-rw-r--r--boost/container/allocator_traits.hpp (renamed from boost/container/allocator/allocator_traits.hpp)131
-rw-r--r--boost/container/container_fwd.hpp32
-rw-r--r--boost/container/deque.hpp384
-rw-r--r--boost/container/detail/adaptive_node_pool_impl.hpp20
-rw-r--r--boost/container/detail/advanced_insert_int.hpp139
-rw-r--r--boost/container/detail/algorithms.hpp4
-rw-r--r--boost/container/detail/allocation_type.hpp4
-rw-r--r--boost/container/detail/config_begin.hpp3
-rw-r--r--boost/container/detail/config_end.hpp2
-rw-r--r--boost/container/detail/destroyers.hpp102
-rw-r--r--boost/container/detail/flat_tree.hpp353
-rw-r--r--boost/container/detail/function_detector.hpp6
-rw-r--r--boost/container/detail/iterators.hpp54
-rw-r--r--boost/container/detail/math_functions.hpp6
-rw-r--r--boost/container/detail/memory_util.hpp (renamed from boost/container/allocator/memory_util.hpp)2
-rw-r--r--boost/container/detail/mpl.hpp22
-rw-r--r--boost/container/detail/multiallocation_chain.hpp2
-rw-r--r--boost/container/detail/node_alloc_holder.hpp67
-rw-r--r--boost/container/detail/node_pool_impl.hpp22
-rw-r--r--boost/container/detail/pair.hpp121
-rw-r--r--boost/container/detail/pool_common.hpp2
-rw-r--r--boost/container/detail/preprocessor.hpp35
-rw-r--r--boost/container/detail/stored_ref.hpp2
-rw-r--r--boost/container/detail/transform_iterator.hpp8
-rw-r--r--boost/container/detail/tree.hpp254
-rw-r--r--boost/container/detail/type_traits.hpp13
-rw-r--r--boost/container/detail/utilities.hpp19
-rw-r--r--boost/container/detail/value_init.hpp8
-rw-r--r--boost/container/detail/variadic_templates_tools.hpp6
-rw-r--r--boost/container/detail/version_type.hpp4
-rw-r--r--boost/container/detail/workaround.hpp7
-rw-r--r--boost/container/flat_map.hpp823
-rw-r--r--boost/container/flat_set.hpp625
-rw-r--r--boost/container/list.hpp395
-rw-r--r--boost/container/map.hpp628
-rw-r--r--boost/container/scoped_allocator.hpp1466
-rw-r--r--boost/container/scoped_allocator_fwd.hpp83
-rw-r--r--boost/container/set.hpp560
-rw-r--r--boost/container/slist.hpp530
-rw-r--r--boost/container/stable_vector.hpp354
-rw-r--r--boost/container/string.hpp607
-rw-r--r--boost/container/vector.hpp484
-rw-r--r--boost/context/all.hpp14
-rw-r--r--boost/context/detail/config.hpp42
-rw-r--r--boost/context/detail/fcontext_arm.hpp66
-rw-r--r--boost/context/detail/fcontext_i386.hpp68
-rw-r--r--boost/context/detail/fcontext_i386_win.hpp83
-rw-r--r--boost/context/detail/fcontext_mips.hpp68
-rw-r--r--boost/context/detail/fcontext_ppc.hpp70
-rw-r--r--boost/context/detail/fcontext_x86_64.hpp66
-rw-r--r--boost/context/detail/fcontext_x86_64_win.hpp90
-rw-r--r--boost/context/fcontext.hpp82
-rw-r--r--boost/context/stack_allocator.hpp37
-rw-r--r--boost/context/stack_utils.hpp41
-rw-r--r--boost/date_time.hpp2
-rw-r--r--boost/date_time/adjust_functors.hpp2
-rw-r--r--boost/date_time/c_local_time_adjustor.hpp2
-rw-r--r--boost/date_time/c_time.hpp2
-rw-r--r--boost/date_time/compiler_config.hpp2
-rw-r--r--boost/date_time/constrained_value.hpp2
-rw-r--r--boost/date_time/date.hpp2
-rw-r--r--boost/date_time/date_clock_device.hpp2
-rw-r--r--boost/date_time/date_defs.hpp2
-rw-r--r--boost/date_time/date_duration.hpp2
-rw-r--r--boost/date_time/date_duration_types.hpp2
-rw-r--r--boost/date_time/date_facet.hpp2
-rw-r--r--boost/date_time/date_format_simple.hpp2
-rw-r--r--boost/date_time/date_formatting.hpp2
-rw-r--r--boost/date_time/date_formatting_limited.hpp2
-rw-r--r--boost/date_time/date_formatting_locales.hpp2
-rw-r--r--boost/date_time/date_generator_formatter.hpp2
-rw-r--r--boost/date_time/date_generator_parser.hpp2
-rw-r--r--boost/date_time/date_generators.hpp2
-rw-r--r--boost/date_time/date_iterator.hpp2
-rw-r--r--boost/date_time/date_names_put.hpp2
-rw-r--r--boost/date_time/date_parsing.hpp2
-rw-r--r--boost/date_time/dst_rules.hpp2
-rw-r--r--boost/date_time/filetime_functions.hpp2
-rw-r--r--boost/date_time/format_date_parser.hpp2
-rw-r--r--boost/date_time/gregorian/conversion.hpp2
-rw-r--r--boost/date_time/gregorian/formatters.hpp2
-rw-r--r--boost/date_time/gregorian/formatters_limited.hpp2
-rw-r--r--boost/date_time/gregorian/greg_calendar.hpp2
-rw-r--r--boost/date_time/gregorian/greg_date.hpp2
-rw-r--r--boost/date_time/gregorian/greg_day.hpp2
-rw-r--r--boost/date_time/gregorian/greg_day_of_year.hpp2
-rw-r--r--boost/date_time/gregorian/greg_duration.hpp2
-rw-r--r--boost/date_time/gregorian/greg_duration_types.hpp2
-rw-r--r--boost/date_time/gregorian/greg_facet.hpp2
-rw-r--r--boost/date_time/gregorian/greg_month.hpp2
-rw-r--r--boost/date_time/gregorian/greg_serialize.hpp29
-rw-r--r--boost/date_time/gregorian/greg_weekday.hpp2
-rw-r--r--boost/date_time/gregorian/greg_year.hpp2
-rw-r--r--boost/date_time/gregorian/greg_ymd.hpp2
-rw-r--r--boost/date_time/gregorian/gregorian.hpp2
-rw-r--r--boost/date_time/gregorian/gregorian_io.hpp2
-rw-r--r--boost/date_time/gregorian/gregorian_types.hpp2
-rw-r--r--boost/date_time/gregorian/parsers.hpp2
-rw-r--r--boost/date_time/gregorian_calendar.hpp2
-rw-r--r--boost/date_time/gregorian_calendar.ipp2
-rw-r--r--boost/date_time/int_adapter.hpp2
-rw-r--r--boost/date_time/iso_format.hpp2
-rw-r--r--boost/date_time/local_time/conversion.hpp2
-rw-r--r--boost/date_time/local_time/custom_time_zone.hpp2
-rw-r--r--boost/date_time/local_time/date_duration_operators.hpp2
-rw-r--r--boost/date_time/local_time/dst_transition_day_rules.hpp2
-rw-r--r--boost/date_time/local_time/local_date_time.hpp2
-rw-r--r--boost/date_time/local_time/local_time.hpp2
-rw-r--r--boost/date_time/local_time/local_time_io.hpp2
-rw-r--r--boost/date_time/local_time/local_time_types.hpp2
-rw-r--r--boost/date_time/local_time/posix_time_zone.hpp2
-rw-r--r--boost/date_time/local_time/tz_database.hpp2
-rw-r--r--boost/date_time/local_time_adjustor.hpp2
-rw-r--r--boost/date_time/local_timezone_defs.hpp2
-rw-r--r--boost/date_time/locale_config.hpp2
-rw-r--r--boost/date_time/microsec_time_clock.hpp2
-rw-r--r--boost/date_time/parse_format_base.hpp2
-rw-r--r--boost/date_time/period.hpp2
-rw-r--r--boost/date_time/period_formatter.hpp2
-rw-r--r--boost/date_time/period_parser.hpp2
-rw-r--r--boost/date_time/posix_time/conversion.hpp2
-rw-r--r--boost/date_time/posix_time/date_duration_operators.hpp2
-rw-r--r--boost/date_time/posix_time/posix_time.hpp2
-rw-r--r--boost/date_time/posix_time/posix_time_config.hpp2
-rw-r--r--boost/date_time/posix_time/posix_time_duration.hpp2
-rw-r--r--boost/date_time/posix_time/posix_time_io.hpp2
-rw-r--r--boost/date_time/posix_time/posix_time_legacy_io.hpp2
-rw-r--r--boost/date_time/posix_time/posix_time_system.hpp2
-rw-r--r--boost/date_time/posix_time/ptime.hpp2
-rw-r--r--boost/date_time/posix_time/time_formatters.hpp2
-rw-r--r--boost/date_time/posix_time/time_formatters_limited.hpp2
-rw-r--r--boost/date_time/posix_time/time_parsers.hpp2
-rw-r--r--boost/date_time/posix_time/time_period.hpp2
-rw-r--r--boost/date_time/posix_time/time_serialize.hpp2
-rw-r--r--boost/date_time/special_defs.hpp2
-rw-r--r--boost/date_time/special_values_formatter.hpp2
-rw-r--r--boost/date_time/string_convert.hpp2
-rw-r--r--boost/date_time/string_parse_tree.hpp2
-rw-r--r--boost/date_time/strings_from_facet.hpp2
-rw-r--r--boost/date_time/time.hpp2
-rw-r--r--boost/date_time/time_clock.hpp2
-rw-r--r--boost/date_time/time_defs.hpp2
-rw-r--r--boost/date_time/time_duration.hpp2
-rw-r--r--boost/date_time/time_facet.hpp2
-rw-r--r--boost/date_time/time_formatting_streams.hpp2
-rw-r--r--boost/date_time/time_iterator.hpp2
-rw-r--r--boost/date_time/time_parsing.hpp2
-rw-r--r--boost/date_time/time_resolution_traits.hpp2
-rw-r--r--boost/date_time/time_system_counted.hpp2
-rw-r--r--boost/date_time/time_system_split.hpp2
-rw-r--r--boost/date_time/time_zone_base.hpp2
-rw-r--r--boost/date_time/time_zone_names.hpp2
-rw-r--r--boost/date_time/tz_db_base.hpp2
-rw-r--r--boost/date_time/wrapping_int.hpp2
-rw-r--r--boost/date_time/year_month_day.hpp2
-rw-r--r--boost/detail/container_fwd.hpp15
-rw-r--r--boost/detail/scoped_enum_emulation.hpp349
-rw-r--r--boost/detail/utf8_codecvt_facet.ipp285
-rw-r--r--boost/exception/detail/attribute_noreturn.hpp2
-rw-r--r--boost/exception/detail/error_info_impl.hpp1
-rw-r--r--boost/exception/detail/exception_ptr.hpp9
-rw-r--r--boost/exception/error_info.hpp3
-rw-r--r--boost/exception/exception.hpp31
-rw-r--r--boost/exception/info.hpp2
-rw-r--r--boost/exception/info_tuple.hpp24
-rw-r--r--boost/filesystem.hpp29
-rw-r--r--boost/filesystem/config.hpp104
-rw-r--r--boost/filesystem/convenience.hpp67
-rw-r--r--boost/filesystem/exception.hpp40
-rw-r--r--boost/filesystem/fstream.hpp181
-rw-r--r--boost/filesystem/operations.hpp1095
-rw-r--r--boost/filesystem/path.hpp757
-rw-r--r--boost/filesystem/path_traits.hpp (renamed from boost/filesystem/v3/path_traits.hpp)20
-rw-r--r--boost/filesystem/v2/config.hpp106
-rw-r--r--boost/filesystem/v2/convenience.hpp339
-rw-r--r--boost/filesystem/v2/exception.hpp9
-rw-r--r--boost/filesystem/v2/fstream.hpp613
-rw-r--r--boost/filesystem/v2/operations.hpp1245
-rw-r--r--boost/filesystem/v2/path.hpp1571
-rw-r--r--boost/filesystem/v3/config.hpp85
-rw-r--r--boost/filesystem/v3/convenience.hpp74
-rw-r--r--boost/filesystem/v3/exception.hpp9
-rw-r--r--boost/filesystem/v3/fstream.hpp208
-rw-r--r--boost/filesystem/v3/operations.hpp1199
-rw-r--r--boost/filesystem/v3/path.hpp760
-rw-r--r--boost/foreach.hpp4
-rw-r--r--boost/foreach_fwd.hpp23
-rw-r--r--boost/functional/detail/container_fwd.hpp14
-rw-r--r--boost/functional/hash/detail/container_fwd_0x.hpp29
-rw-r--r--boost/functional/hash/detail/hash_float.hpp16
-rw-r--r--boost/functional/hash/extensions.hpp101
-rw-r--r--boost/functional/hash/hash.hpp172
-rw-r--r--boost/functional/overloaded_function.hpp311
-rw-r--r--boost/functional/overloaded_function/config.hpp50
-rw-r--r--boost/functional/overloaded_function/detail/base.hpp86
-rw-r--r--boost/functional/overloaded_function/detail/function_type.hpp85
-rw-r--r--boost/fusion/adapted/adt/detail/extension.hpp21
-rw-r--r--boost/fusion/adapted/std_tuple/detail/at_impl.hpp10
-rw-r--r--boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp10
-rw-r--r--boost/fusion/adapted/std_tuple/tag_of.hpp6
-rw-r--r--boost/fusion/adapted/struct.hpp1
-rw-r--r--boost/fusion/adapted/struct/define_struct_inline.hpp25
-rw-r--r--boost/fusion/adapted/struct/detail/define_struct_inline.hpp375
-rw-r--r--boost/fusion/algorithm/auxiliary/copy.hpp13
-rw-r--r--boost/fusion/algorithm/iteration/accumulate.hpp16
-rw-r--r--boost/fusion/algorithm/iteration/accumulate_fwd.hpp15
-rw-r--r--boost/fusion/algorithm/iteration/for_each.hpp16
-rw-r--r--boost/fusion/algorithm/iteration/for_each_fwd.hpp17
-rw-r--r--boost/fusion/algorithm/query/count.hpp9
-rw-r--r--boost/fusion/algorithm/query/count_if.hpp9
-rw-r--r--boost/fusion/algorithm/transformation/erase.hpp35
-rw-r--r--boost/fusion/algorithm/transformation/insert.hpp10
-rw-r--r--boost/fusion/algorithm/transformation/push_back.hpp9
-rw-r--r--boost/fusion/algorithm/transformation/push_front.hpp9
-rw-r--r--boost/fusion/algorithm/transformation/replace.hpp9
-rw-r--r--boost/fusion/algorithm/transformation/replace_if.hpp8
-rw-r--r--boost/fusion/algorithm/transformation/reverse.hpp9
-rw-r--r--boost/fusion/container/deque/back_extended_deque.hpp41
-rw-r--r--boost/fusion/container/deque/convert.hpp6
-rw-r--r--boost/fusion/container/deque/deque.hpp133
-rw-r--r--boost/fusion/container/deque/deque_fwd.hpp47
-rw-r--r--boost/fusion/container/deque/deque_iterator.hpp10
-rw-r--r--boost/fusion/container/deque/detail/as_deque.hpp2
-rw-r--r--boost/fusion/container/deque/detail/at_impl.hpp36
-rw-r--r--boost/fusion/container/deque/detail/begin_impl.hpp26
-rw-r--r--boost/fusion/container/deque/detail/convert_impl.hpp4
-rw-r--r--boost/fusion/container/deque/detail/cpp03_deque.hpp125
-rw-r--r--boost/fusion/container/deque/detail/cpp03_deque_fwd.hpp54
-rw-r--r--boost/fusion/container/deque/detail/cpp03_deque_keyed_values.hpp (renamed from boost/fusion/container/deque/detail/deque_keyed_values.hpp)6
-rw-r--r--boost/fusion/container/deque/detail/cpp11_deque_keyed_values.hpp56
-rw-r--r--boost/fusion/container/deque/detail/deque_forward_ctor.hpp8
-rw-r--r--boost/fusion/container/deque/detail/deque_initial_size.hpp6
-rw-r--r--boost/fusion/container/deque/detail/deque_keyed_values_call.hpp6
-rw-r--r--boost/fusion/container/deque/detail/end_impl.hpp26
-rw-r--r--boost/fusion/container/deque/detail/is_sequence_impl.hpp10
-rw-r--r--boost/fusion/container/deque/detail/keyed_element.hpp39
-rw-r--r--boost/fusion/container/deque/detail/value_at_impl.hpp22
-rw-r--r--boost/fusion/container/deque/front_extended_deque.hpp39
-rw-r--r--boost/fusion/container/deque/limits.hpp6
-rw-r--r--boost/fusion/container/list/detail/at_impl.hpp12
-rw-r--r--boost/fusion/container/map/detail/at_impl.hpp10
-rw-r--r--boost/fusion/container/map/detail/deref_data_impl.hpp9
-rw-r--r--boost/fusion/container/vector/detail/at_impl.hpp4
-rw-r--r--boost/fusion/container/vector/detail/deref_impl.hpp9
-rw-r--r--boost/fusion/container/vector/detail/preprocessed/vector10.hpp141
-rw-r--r--boost/fusion/container/vector/detail/preprocessed/vector20.hpp140
-rw-r--r--boost/fusion/container/vector/detail/preprocessed/vector30.hpp140
-rw-r--r--boost/fusion/container/vector/detail/preprocessed/vector40.hpp140
-rw-r--r--boost/fusion/container/vector/detail/preprocessed/vector50.hpp140
-rw-r--r--boost/fusion/container/vector/detail/vector_n.hpp19
-rw-r--r--boost/fusion/functional/adapter/unfused.hpp12
-rw-r--r--boost/fusion/functional/adapter/unfused_typed.hpp12
-rw-r--r--boost/fusion/include/define_struct_inline.hpp13
-rw-r--r--boost/fusion/include/repetitive_view.hpp (renamed from boost/fusion/include/repetetive_view.hpp)0
-rw-r--r--boost/fusion/sequence/comparison/detail/equal_to.hpp3
-rw-r--r--boost/fusion/sequence/comparison/detail/greater.hpp6
-rw-r--r--boost/fusion/sequence/comparison/detail/greater_equal.hpp6
-rw-r--r--boost/fusion/sequence/comparison/detail/less.hpp6
-rw-r--r--boost/fusion/sequence/comparison/detail/less_equal.hpp6
-rw-r--r--boost/fusion/sequence/comparison/detail/not_equal_to.hpp3
-rw-r--r--boost/fusion/support.hpp1
-rw-r--r--boost/fusion/support/as_const.hpp26
-rw-r--r--boost/fusion/support/detail/access.hpp4
-rw-r--r--boost/fusion/support/is_segmented.hpp7
-rw-r--r--boost/fusion/support/is_sequence.hpp6
-rw-r--r--boost/fusion/support/is_view.hpp7
-rw-r--r--boost/fusion/tuple/detail/preprocessed/make_tuple.hpp2
-rw-r--r--boost/fusion/tuple/detail/preprocessed/tuple_fwd.hpp2
-rw-r--r--boost/fusion/tuple/detail/preprocessed/tuple_tie.hpp2
-rw-r--r--boost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp14
-rw-r--r--boost/geometry/algorithms/area.hpp2
-rw-r--r--boost/geometry/algorithms/detail/for_each_range.hpp1
-rw-r--r--boost/geometry/algorithms/detail/get_left_turns.hpp367
-rw-r--r--boost/geometry/algorithms/detail/occupation_info.hpp329
-rw-r--r--boost/geometry/algorithms/detail/overlay/add_rings.hpp28
-rw-r--r--boost/geometry/algorithms/detail/overlay/assign_parents.hpp7
-rw-r--r--boost/geometry/algorithms/detail/overlay/calculate_distance_policy.hpp15
-rw-r--r--boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp4
-rw-r--r--boost/geometry/algorithms/detail/overlay/copy_segments.hpp6
-rw-r--r--boost/geometry/algorithms/detail/overlay/debug_turn_info.hpp2
-rw-r--r--boost/geometry/algorithms/detail/overlay/follow.hpp2
-rw-r--r--boost/geometry/algorithms/detail/overlay/get_ring.hpp2
-rw-r--r--boost/geometry/algorithms/detail/overlay/get_turn_info.hpp204
-rw-r--r--boost/geometry/algorithms/detail/overlay/get_turns.hpp13
-rw-r--r--boost/geometry/algorithms/detail/overlay/overlay.hpp2
-rw-r--r--boost/geometry/algorithms/detail/overlay/turn_info.hpp16
-rw-r--r--boost/geometry/algorithms/detail/partition.hpp24
-rw-r--r--boost/geometry/algorithms/detail/point_on_border.hpp9
-rw-r--r--boost/geometry/algorithms/detail/sections/sectionalize.hpp2
-rw-r--r--boost/geometry/algorithms/disjoint.hpp63
-rw-r--r--boost/geometry/algorithms/distance.hpp2
-rw-r--r--boost/geometry/algorithms/touches.hpp181
-rw-r--r--boost/geometry/algorithms/within.hpp2
-rw-r--r--boost/geometry/core/access.hpp161
-rw-r--r--boost/geometry/core/coordinate_dimension.hpp6
-rw-r--r--boost/geometry/core/coordinate_system.hpp15
-rw-r--r--boost/geometry/core/coordinate_type.hpp20
-rw-r--r--boost/geometry/core/point_type.hpp4
-rw-r--r--boost/geometry/core/tag.hpp5
-rw-r--r--boost/geometry/geometry.hpp1
-rw-r--r--boost/geometry/iterators/ever_circling_iterator.hpp126
-rw-r--r--boost/geometry/multi/algorithms/detail/overlay/copy_segment_point.hpp2
-rw-r--r--boost/geometry/multi/algorithms/detail/overlay/copy_segments.hpp2
-rw-r--r--boost/geometry/multi/algorithms/detail/overlay/get_ring.hpp2
-rw-r--r--boost/geometry/multi/algorithms/detail/point_on_border.hpp16
-rw-r--r--boost/geometry/multi/algorithms/detail/sections/range_by_section.hpp2
-rw-r--r--boost/geometry/multi/io/wkt/read.hpp66
-rw-r--r--boost/geometry/policies/relate/direction.hpp2
-rw-r--r--boost/geometry/policies/relate/intersection_points.hpp41
-rw-r--r--boost/geometry/policies/relate/tupled.hpp6
-rw-r--r--boost/geometry/strategies/cartesian/cart_intersect.hpp476
-rw-r--r--boost/geometry/strategies/cartesian/distance_projected_point.hpp22
-rw-r--r--boost/geometry/strategies/side_info.hpp87
-rw-r--r--boost/geometry/strategies/spherical/distance_cross_track.hpp47
-rw-r--r--boost/geometry/strategies/strategy_transform.hpp34
-rw-r--r--boost/geometry/util/bare_type.hpp38
-rw-r--r--boost/geometry/util/math.hpp56
-rw-r--r--boost/graph/adj_list_serialize.hpp3
-rw-r--r--boost/graph/adjacency_list.hpp179
-rw-r--r--boost/graph/adjacency_list_io.hpp10
-rw-r--r--boost/graph/adjacency_matrix.hpp462
-rw-r--r--boost/graph/astar_search.hpp3
-rw-r--r--boost/graph/bellman_ford_shortest_paths.hpp2
-rw-r--r--boost/graph/betweenness_centrality.hpp6
-rw-r--r--boost/graph/biconnected_components.hpp104
-rw-r--r--boost/graph/breadth_first_search.hpp79
-rw-r--r--boost/graph/bron_kerbosch_all_cliques.hpp3
-rw-r--r--boost/graph/chrobak_payne_drawing.hpp1
-rw-r--r--boost/graph/clustering_coefficient.hpp2
-rw-r--r--boost/graph/compressed_sparse_row_graph.hpp375
-rw-r--r--boost/graph/copy.hpp4
-rw-r--r--boost/graph/depth_first_search.hpp43
-rw-r--r--boost/graph/detail/adjacency_list.hpp165
-rw-r--r--boost/graph/detail/compressed_sparse_row_struct.hpp1
-rw-r--r--boost/graph/detail/histogram_sort.hpp5
-rw-r--r--boost/graph/detail/read_graphviz_spirit.hpp4
-rw-r--r--boost/graph/directed_graph.hpp44
-rw-r--r--boost/graph/distributed/adjacency_list.hpp24
-rw-r--r--boost/graph/distributed/adjlist/redistribute.hpp4
-rw-r--r--boost/graph/distributed/betweenness_centrality.hpp18
-rw-r--r--boost/graph/distributed/breadth_first_search.hpp2
-rw-r--r--boost/graph/distributed/compressed_sparse_row_graph.hpp299
-rw-r--r--boost/graph/distributed/dijkstra_shortest_paths.hpp11
-rw-r--r--boost/graph/distributed/page_rank.hpp1
-rw-r--r--boost/graph/eccentricity.hpp2
-rw-r--r--boost/graph/edmonds_karp_max_flow.hpp38
-rw-r--r--boost/graph/fruchterman_reingold.hpp7
-rw-r--r--boost/graph/graph_archetypes.hpp6
-rw-r--r--boost/graph/graph_test.hpp10
-rw-r--r--boost/graph/graph_traits.hpp44
-rw-r--r--boost/graph/graphml.hpp10
-rw-r--r--boost/graph/graphviz.hpp112
-rw-r--r--boost/graph/grid_graph.hpp5
-rw-r--r--boost/graph/is_kuratowski_subgraph.hpp5
-rw-r--r--boost/graph/is_straight_line_drawing.hpp15
-rw-r--r--boost/graph/isomorphism.hpp233
-rw-r--r--boost/graph/johnson_all_pairs_shortest.hpp2
-rw-r--r--boost/graph/make_connected.hpp2
-rw-r--r--boost/graph/matrix_as_graph.hpp2
-rw-r--r--boost/graph/max_cardinality_matching.hpp1
-rw-r--r--boost/graph/named_function_params.hpp336
-rw-r--r--boost/graph/named_graph.hpp49
-rw-r--r--boost/graph/neighbor_bfs.hpp7
-rw-r--r--boost/graph/planar_canonical_ordering.hpp2
-rw-r--r--boost/graph/planar_detail/boyer_myrvold_impl.hpp2
-rw-r--r--boost/graph/planar_face_traversal.hpp5
-rw-r--r--boost/graph/properties.hpp236
-rw-r--r--boost/graph/property_maps/null_property_map.hpp2
-rw-r--r--boost/graph/reverse_graph.hpp93
-rw-r--r--boost/graph/stanford_graph.hpp8
-rw-r--r--boost/graph/stoer_wagner_min_cut.hpp6
-rw-r--r--boost/graph/strong_components.hpp8
-rw-r--r--boost/graph/subgraph.hpp291
-rw-r--r--boost/graph/two_graphs_common_spanning_trees.hpp870
-rw-r--r--boost/graph/undirected_dfs.hpp7
-rw-r--r--boost/graph/undirected_graph.hpp77
-rw-r--r--boost/graph/vector_as_graph.hpp13
-rw-r--r--boost/heap/binomial_heap.hpp8
-rw-r--r--boost/heap/d_ary_heap.hpp18
-rw-r--r--boost/heap/detail/mutable_heap.hpp45
-rw-r--r--boost/heap/detail/stable_heap.hpp5
-rw-r--r--boost/heap/detail/tree_iterator.hpp10
-rw-r--r--boost/heap/fibonacci_heap.hpp18
-rw-r--r--boost/heap/pairing_heap.hpp7
-rw-r--r--boost/heap/skew_heap.hpp8
-rw-r--r--boost/icl/concept/interval_associator.hpp28
-rw-r--r--boost/icl/functors.hpp43
-rw-r--r--boost/icl/gregorian.hpp8
-rw-r--r--boost/icl/map.hpp2
-rw-r--r--boost/icl/ptime.hpp8
-rw-r--r--boost/integer.hpp34
-rw-r--r--boost/integer_traits.hpp2
-rw-r--r--boost/interprocess/allocators/adaptive_pool.hpp56
-rw-r--r--boost/interprocess/allocators/allocator.hpp22
-rw-r--r--boost/interprocess/allocators/cached_adaptive_pool.hpp32
-rw-r--r--boost/interprocess/allocators/cached_node_allocator.hpp28
-rw-r--r--boost/interprocess/allocators/detail/adaptive_node_pool.hpp4
-rw-r--r--boost/interprocess/allocators/detail/allocator_common.hpp54
-rw-r--r--boost/interprocess/allocators/detail/node_pool.hpp8
-rw-r--r--boost/interprocess/allocators/node_allocator.hpp56
-rw-r--r--boost/interprocess/allocators/private_adaptive_pool.hpp38
-rw-r--r--boost/interprocess/allocators/private_node_allocator.hpp40
-rw-r--r--boost/interprocess/anonymous_shared_memory.hpp12
-rw-r--r--boost/interprocess/detail/atomic.hpp355
-rw-r--r--boost/interprocess/detail/config_begin.hpp1
-rw-r--r--boost/interprocess/detail/file_locking_helpers.hpp298
-rw-r--r--boost/interprocess/detail/file_wrapper.hpp22
-rw-r--r--boost/interprocess/detail/in_place_interface.hpp2
-rw-r--r--boost/interprocess/detail/intermodule_singleton.hpp1148
-rw-r--r--boost/interprocess/detail/intermodule_singleton_common.hpp495
-rw-r--r--boost/interprocess/detail/intersegment_ptr.hpp120
-rw-r--r--boost/interprocess/detail/managed_global_memory.hpp115
-rw-r--r--boost/interprocess/detail/managed_memory_impl.hpp166
-rw-r--r--boost/interprocess/detail/managed_multi_shared_memory.hpp52
-rw-r--r--boost/interprocess/detail/managed_open_or_create_impl.hpp39
-rw-r--r--boost/interprocess/detail/math_functions.hpp4
-rw-r--r--boost/interprocess/detail/min_max.hpp4
-rw-r--r--boost/interprocess/detail/mpl.hpp20
-rw-r--r--boost/interprocess/detail/multi_segment_services.hpp2
-rw-r--r--boost/interprocess/detail/named_proxy.hpp24
-rw-r--r--boost/interprocess/detail/os_file_functions.hpp66
-rw-r--r--boost/interprocess/detail/os_thread_functions.hpp4
-rw-r--r--boost/interprocess/detail/pointer_type.hpp4
-rw-r--r--boost/interprocess/detail/portable_intermodule_singleton.hpp356
-rw-r--r--boost/interprocess/detail/posix_time_types_wrk.hpp2
-rw-r--r--boost/interprocess/detail/preprocessor.hpp32
-rw-r--r--boost/interprocess/detail/ptime_wrk.hpp2
-rw-r--r--boost/interprocess/detail/robust_emulation.hpp10
-rw-r--r--boost/interprocess/detail/segment_manager_helper.hpp48
-rw-r--r--boost/interprocess/detail/tmp_dir_helpers.hpp163
-rw-r--r--boost/interprocess/detail/transform_iterator.hpp8
-rw-r--r--boost/interprocess/detail/type_traits.hpp4
-rw-r--r--boost/interprocess/detail/utilities.hpp8
-rw-r--r--boost/interprocess/detail/variadic_templates_tools.hpp4
-rw-r--r--boost/interprocess/detail/win32_api.hpp766
-rw-r--r--boost/interprocess/detail/windows_intermodule_singleton.hpp306
-rw-r--r--boost/interprocess/detail/workaround.hpp133
-rw-r--r--boost/interprocess/detail/xsi_shared_memory_device.hpp10
-rw-r--r--boost/interprocess/detail/xsi_shared_memory_file_wrapper.hpp6
-rw-r--r--boost/interprocess/errors.hpp16
-rw-r--r--boost/interprocess/file_mapping.hpp20
-rw-r--r--boost/interprocess/indexes/iset_index.hpp22
-rw-r--r--boost/interprocess/indexes/iunordered_set_index.hpp28
-rw-r--r--boost/interprocess/indexes/map_index.hpp2
-rw-r--r--boost/interprocess/indexes/null_index.hpp2
-rw-r--r--boost/interprocess/indexes/unordered_map_index.hpp2
-rw-r--r--boost/interprocess/interprocess_fwd.hpp6
-rw-r--r--boost/interprocess/ipc/message_queue.hpp152
-rw-r--r--boost/interprocess/managed_external_buffer.hpp18
-rw-r--r--boost/interprocess/managed_heap_memory.hpp26
-rw-r--r--boost/interprocess/managed_mapped_file.hpp46
-rw-r--r--boost/interprocess/managed_shared_memory.hpp50
-rw-r--r--boost/interprocess/managed_windows_shared_memory.hpp32
-rw-r--r--boost/interprocess/managed_xsi_shared_memory.hpp36
-rw-r--r--boost/interprocess/mapped_region.hpp458
-rw-r--r--boost/interprocess/mem_algo/detail/mem_algo_common.hpp30
-rw-r--r--boost/interprocess/mem_algo/detail/simple_seq_fit_impl.hpp68
-rw-r--r--boost/interprocess/mem_algo/rbtree_best_fit.hpp98
-rw-r--r--boost/interprocess/mem_algo/simple_seq_fit.hpp4
-rw-r--r--boost/interprocess/offset_ptr.hpp70
-rw-r--r--boost/interprocess/segment_manager.hpp138
-rw-r--r--boost/interprocess/shared_memory_object.hpp26
-rw-r--r--boost/interprocess/smart_ptr/deleter.hpp6
-rw-r--r--boost/interprocess/smart_ptr/detail/shared_count.hpp6
-rw-r--r--boost/interprocess/smart_ptr/detail/sp_counted_impl.hpp6
-rw-r--r--boost/interprocess/smart_ptr/intrusive_ptr.hpp24
-rw-r--r--boost/interprocess/smart_ptr/scoped_ptr.hpp12
-rw-r--r--boost/interprocess/smart_ptr/shared_ptr.hpp63
-rw-r--r--boost/interprocess/smart_ptr/unique_ptr.hpp10
-rw-r--r--boost/interprocess/smart_ptr/weak_ptr.hpp16
-rw-r--r--boost/interprocess/streams/bufferstream.hpp38
-rw-r--r--boost/interprocess/streams/vectorstream.hpp50
-rw-r--r--boost/interprocess/sync/detail/condition_algorithm_8a.hpp316
-rw-r--r--boost/interprocess/sync/file_lock.hpp32
-rw-r--r--boost/interprocess/sync/interprocess_condition.hpp22
-rw-r--r--boost/interprocess/sync/interprocess_mutex.hpp12
-rw-r--r--boost/interprocess/sync/interprocess_recursive_mutex.hpp12
-rw-r--r--boost/interprocess/sync/interprocess_semaphore.hpp14
-rw-r--r--boost/interprocess/sync/interprocess_upgradable_mutex.hpp100
-rw-r--r--boost/interprocess/sync/mutex_family.hpp4
-rw-r--r--boost/interprocess/sync/named_condition.hpp34
-rw-r--r--boost/interprocess/sync/named_mutex.hpp33
-rw-r--r--boost/interprocess/sync/named_recursive_mutex.hpp20
-rw-r--r--boost/interprocess/sync/named_semaphore.hpp21
-rw-r--r--boost/interprocess/sync/named_upgradable_mutex.hpp64
-rw-r--r--boost/interprocess/sync/posix/condition.hpp18
-rw-r--r--boost/interprocess/sync/posix/mutex.hpp6
-rw-r--r--boost/interprocess/sync/posix/pthread_helpers.hpp22
-rw-r--r--boost/interprocess/sync/posix/recursive_mutex.hpp4
-rw-r--r--boost/interprocess/sync/posix/semaphore_wrapper.hpp8
-rw-r--r--boost/interprocess/sync/scoped_lock.hpp38
-rw-r--r--boost/interprocess/sync/sharable_lock.hpp20
-rw-r--r--boost/interprocess/sync/shm/named_condition.hpp47
-rw-r--r--boost/interprocess/sync/shm/named_creation_functor.hpp2
-rw-r--r--boost/interprocess/sync/shm/named_mutex.hpp6
-rw-r--r--boost/interprocess/sync/shm/named_recursive_mutex.hpp4
-rw-r--r--boost/interprocess/sync/shm/named_upgradable_mutex.hpp64
-rw-r--r--boost/interprocess/sync/spin/condition.hpp32
-rw-r--r--boost/interprocess/sync/spin/mutex.hpp8
-rw-r--r--boost/interprocess/sync/spin/recursive_mutex.hpp8
-rw-r--r--boost/interprocess/sync/upgradable_lock.hpp20
-rw-r--r--boost/interprocess/sync/windows/condition.hpp315
-rw-r--r--boost/interprocess/sync/windows/mutex.hpp63
-rw-r--r--boost/interprocess/sync/windows/named_condition.hpp334
-rw-r--r--boost/interprocess/sync/windows/named_mutex.hpp175
-rw-r--r--boost/interprocess/sync/windows/named_recursive_mutex.hpp58
-rw-r--r--boost/interprocess/sync/windows/named_semaphore.hpp178
-rw-r--r--boost/interprocess/sync/windows/named_sync.hpp215
-rw-r--r--boost/interprocess/sync/windows/semaphore.hpp63
-rw-r--r--boost/interprocess/sync/windows/sync_utils.hpp117
-rw-r--r--boost/interprocess/sync/windows/winapi_mutex_wrapper.hpp163
-rw-r--r--boost/interprocess/sync/windows/winapi_semaphore_wrapper.hpp198
-rw-r--r--boost/interprocess/sync/xsi/xsi_named_mutex.hpp16
-rw-r--r--boost/interprocess/windows_shared_memory.hpp45
-rw-r--r--boost/interprocess/xsi_shared_memory.hpp14
-rw-r--r--boost/intrusive/any_hook.hpp86
-rw-r--r--boost/intrusive/avl_set.hpp1066
-rw-r--r--boost/intrusive/avl_set_hook.hpp132
-rw-r--r--boost/intrusive/avltree.hpp562
-rw-r--r--boost/intrusive/avltree_algorithms.hpp253
-rw-r--r--boost/intrusive/bs_set_hook.hpp132
-rw-r--r--boost/intrusive/circular_list_algorithms.hpp176
-rw-r--r--boost/intrusive/circular_slist_algorithms.hpp136
-rw-r--r--boost/intrusive/derivation_value_traits.hpp8
-rw-r--r--boost/intrusive/detail/any_node_and_algorithms.hpp20
-rw-r--r--boost/intrusive/detail/assert.hpp4
-rw-r--r--boost/intrusive/detail/avltree_node.hpp8
-rw-r--r--boost/intrusive/detail/clear_on_destructor_base.hpp2
-rw-r--r--boost/intrusive/detail/common_slist_algorithms.hpp18
-rw-r--r--boost/intrusive/detail/config_begin.hpp6
-rw-r--r--boost/intrusive/detail/config_end.hpp2
-rw-r--r--boost/intrusive/detail/ebo_functor_holder.hpp2
-rw-r--r--boost/intrusive/detail/function_detector.hpp6
-rw-r--r--boost/intrusive/detail/generic_hook.hpp16
-rw-r--r--boost/intrusive/detail/has_member_function_callable_with.hpp30
-rw-r--r--boost/intrusive/detail/hashtable_node.hpp10
-rw-r--r--boost/intrusive/detail/is_stateful_value_traits.hpp2
-rw-r--r--boost/intrusive/detail/list_node.hpp28
-rw-r--r--boost/intrusive/detail/memory_util.hpp23
-rw-r--r--boost/intrusive/detail/mpl.hpp24
-rw-r--r--boost/intrusive/detail/parent_from_member.hpp38
-rw-r--r--boost/intrusive/detail/preprocessor.hpp4
-rw-r--r--boost/intrusive/detail/rbtree_node.hpp8
-rw-r--r--boost/intrusive/detail/slist_node.hpp24
-rw-r--r--boost/intrusive/detail/transform_iterator.hpp4
-rw-r--r--boost/intrusive/detail/tree_algorithms.hpp410
-rw-r--r--boost/intrusive/detail/tree_node.hpp30
-rw-r--r--boost/intrusive/detail/utilities.hpp20
-rw-r--r--boost/intrusive/detail/workaround.hpp2
-rw-r--r--boost/intrusive/hashtable.hpp480
-rw-r--r--boost/intrusive/intrusive_fwd.hpp2
-rw-r--r--boost/intrusive/linear_slist_algorithms.hpp108
-rw-r--r--boost/intrusive/link_mode.hpp6
-rw-r--r--boost/intrusive/list.hpp520
-rw-r--r--boost/intrusive/list_hook.hpp134
-rw-r--r--boost/intrusive/member_value_traits.hpp10
-rw-r--r--boost/intrusive/options.hpp12
-rw-r--r--boost/intrusive/parent_from_member.hpp6
-rw-r--r--boost/intrusive/pointer_plus_bits.hpp8
-rw-r--r--boost/intrusive/pointer_traits.hpp8
-rw-r--r--boost/intrusive/rbtree.hpp568
-rw-r--r--boost/intrusive/rbtree_algorithms.hpp275
-rw-r--r--boost/intrusive/set.hpp1078
-rw-r--r--boost/intrusive/set_hook.hpp136
-rw-r--r--boost/intrusive/sg_set.hpp1106
-rw-r--r--boost/intrusive/sgtree.hpp602
-rw-r--r--boost/intrusive/sgtree_algorithms.hpp247
-rw-r--r--boost/intrusive/slist.hpp680
-rw-r--r--boost/intrusive/slist_hook.hpp140
-rw-r--r--boost/intrusive/splay_set.hpp1098
-rw-r--r--boost/intrusive/splay_set_hook.hpp136
-rw-r--r--boost/intrusive/splaytree.hpp576
-rw-r--r--boost/intrusive/splaytree_algorithms.hpp251
-rw-r--r--boost/intrusive/treap.hpp594
-rw-r--r--boost/intrusive/treap_algorithms.hpp241
-rw-r--r--boost/intrusive/treap_set.hpp1166
-rw-r--r--boost/intrusive/trivial_value_traits.hpp6
-rw-r--r--boost/intrusive/unordered_set.hpp854
-rw-r--r--boost/intrusive/unordered_set_hook.hpp146
-rw-r--r--boost/iostreams/chain.hpp2
-rw-r--r--boost/iostreams/close.hpp2
-rw-r--r--boost/iostreams/combine.hpp8
-rw-r--r--boost/iostreams/compose.hpp4
-rw-r--r--boost/iostreams/detail/adapter/range_adapter.hpp2
-rw-r--r--boost/iostreams/detail/buffer.hpp4
-rw-r--r--boost/iostreams/detail/restrict_impl.hpp6
-rw-r--r--boost/iostreams/detail/streambuf/chainbuf.hpp2
-rw-r--r--boost/iostreams/filter/aggregate.hpp2
-rw-r--r--boost/iostreams/filter/counter.hpp2
-rw-r--r--boost/iostreams/filter/line.hpp2
-rw-r--r--boost/iostreams/invert.hpp4
-rw-r--r--boost/iostreams/stream.hpp8
-rw-r--r--boost/iostreams/tee.hpp4
-rw-r--r--boost/iterator/iterator_facade.hpp66
-rw-r--r--boost/iterator/transform_iterator.hpp2
-rw-r--r--boost/lexical_cast.hpp1172
-rw-r--r--boost/local_function.hpp459
-rw-r--r--boost/local_function/aux_/add_pointed_const.hpp33
-rw-r--r--boost/local_function/aux_/function.hpp330
-rw-r--r--boost/local_function/aux_/macro/code_/bind.hpp252
-rw-r--r--boost/local_function/aux_/macro/code_/functor.hpp892
-rw-r--r--boost/local_function/aux_/macro/code_/result.hpp107
-rw-r--r--boost/local_function/aux_/macro/decl.hpp65
-rw-r--r--boost/local_function/aux_/macro/name.hpp201
-rw-r--r--boost/local_function/aux_/macro/typeof.hpp22
-rw-r--r--boost/local_function/aux_/member.hpp51
-rw-r--r--boost/local_function/aux_/nobind.hpp32
-rw-r--r--boost/local_function/aux_/preprocessor/traits/bind.hpp46
-rw-r--r--boost/local_function/aux_/preprocessor/traits/decl.hpp29
-rw-r--r--boost/local_function/aux_/preprocessor/traits/decl_/append.hpp212
-rw-r--r--boost/local_function/aux_/preprocessor/traits/decl_/index.hpp21
-rw-r--r--boost/local_function/aux_/preprocessor/traits/decl_/nil.hpp39
-rw-r--r--boost/local_function/aux_/preprocessor/traits/decl_/set_error.hpp38
-rw-r--r--boost/local_function/aux_/preprocessor/traits/decl_/validate.hpp24
-rw-r--r--boost/local_function/aux_/preprocessor/traits/decl_/validate_/return_count.hpp32
-rw-r--r--boost/local_function/aux_/preprocessor/traits/decl_/validate_/this_count.hpp38
-rw-r--r--boost/local_function/aux_/preprocessor/traits/decl_binds.hpp35
-rw-r--r--boost/local_function/aux_/preprocessor/traits/decl_const_binds.hpp40
-rw-r--r--boost/local_function/aux_/preprocessor/traits/decl_error.hpp27
-rw-r--r--boost/local_function/aux_/preprocessor/traits/decl_params.hpp59
-rw-r--r--boost/local_function/aux_/preprocessor/traits/decl_returns.hpp22
-rw-r--r--boost/local_function/aux_/preprocessor/traits/decl_sign_/any_bind_type.hpp88
-rw-r--r--boost/local_function/aux_/preprocessor/traits/decl_sign_/sign.hpp138
-rw-r--r--boost/local_function/aux_/preprocessor/traits/decl_sign_/validate.hpp32
-rw-r--r--boost/local_function/aux_/preprocessor/traits/decl_sign_/validate_/defaults.hpp125
-rw-r--r--boost/local_function/aux_/preprocessor/traits/decl_sign_/validate_/this.hpp66
-rw-r--r--boost/local_function/aux_/preprocessor/traits/param.hpp36
-rw-r--r--boost/local_function/aux_/symbol.hpp50
-rw-r--r--boost/local_function/config.hpp114
-rw-r--r--boost/local_function/detail/preprocessor/keyword/auto.hpp58
-rw-r--r--boost/local_function/detail/preprocessor/keyword/bind.hpp58
-rw-r--r--boost/local_function/detail/preprocessor/keyword/const.hpp58
-rw-r--r--boost/local_function/detail/preprocessor/keyword/const_bind.hpp74
-rw-r--r--boost/local_function/detail/preprocessor/keyword/default.hpp58
-rw-r--r--boost/local_function/detail/preprocessor/keyword/facility/add.hpp25
-rw-r--r--boost/local_function/detail/preprocessor/keyword/facility/is.hpp51
-rw-r--r--boost/local_function/detail/preprocessor/keyword/facility/remove.hpp58
-rw-r--r--boost/local_function/detail/preprocessor/keyword/inline.hpp58
-rw-r--r--boost/local_function/detail/preprocessor/keyword/recursive.hpp60
-rw-r--r--boost/local_function/detail/preprocessor/keyword/register.hpp58
-rw-r--r--boost/local_function/detail/preprocessor/keyword/return.hpp58
-rw-r--r--boost/local_function/detail/preprocessor/keyword/this.hpp58
-rw-r--r--boost/local_function/detail/preprocessor/keyword/thisunderscore.hpp63
-rw-r--r--boost/local_function/detail/preprocessor/keyword/void.hpp58
-rw-r--r--boost/local_function/detail/preprocessor/line_counter.hpp23
-rw-r--r--boost/local_function/detail/preprocessor/void_list.hpp120
-rw-r--r--boost/locale/boundary/index.hpp39
-rw-r--r--boost/locale/utf.hpp36
-rw-r--r--boost/math/bindings/detail/big_lanczos.hpp11
-rw-r--r--boost/math/bindings/e_float.hpp5
-rw-r--r--boost/math/bindings/mpfr.hpp6
-rw-r--r--boost/math/bindings/rr.hpp11
-rw-r--r--boost/math/concepts/real_concept.hpp7
-rw-r--r--boost/math/concepts/real_type_concept.hpp1
-rw-r--r--boost/math/concepts/std_real_concept.hpp7
-rw-r--r--boost/math/constants/calculate_constants.hpp959
-rw-r--r--boost/math/constants/constants.hpp281
-rw-r--r--boost/math/constants/generate.hpp76
-rw-r--r--boost/math/constants/info.hpp163
-rw-r--r--boost/math/distributions/detail/inv_discrete_quantile.hpp10
-rw-r--r--boost/math/distributions/skew_normal.hpp716
-rw-r--r--boost/math/distributions/triangular.hpp2
-rw-r--r--boost/math/policies/error_handling.hpp34
-rw-r--r--boost/math/special_functions.hpp2
-rw-r--r--boost/math/special_functions/detail/bessel_i0.hpp30
-rw-r--r--boost/math/special_functions/detail/bessel_i1.hpp31
-rw-r--r--boost/math/special_functions/detail/bessel_j0.hpp30
-rw-r--r--boost/math/special_functions/detail/bessel_j1.hpp30
-rw-r--r--boost/math/special_functions/detail/bessel_jy.hpp16
-rw-r--r--boost/math/special_functions/detail/bessel_k0.hpp30
-rw-r--r--boost/math/special_functions/detail/bessel_k1.hpp30
-rw-r--r--boost/math/special_functions/detail/bessel_y0.hpp30
-rw-r--r--boost/math/special_functions/detail/bessel_y1.hpp30
-rw-r--r--boost/math/special_functions/detail/erf_inv.hpp40
-rw-r--r--boost/math/special_functions/detail/iconv.hpp2
-rw-r--r--boost/math/special_functions/detail/igamma_large.hpp1
-rw-r--r--boost/math/special_functions/detail/lanczos_sse2.hpp5
-rw-r--r--boost/math/special_functions/detail/lgamma_small.hpp8
-rw-r--r--boost/math/special_functions/digamma.hpp28
-rw-r--r--boost/math/special_functions/erf.hpp57
-rw-r--r--boost/math/special_functions/expint.hpp92
-rw-r--r--boost/math/special_functions/expm1.hpp43
-rw-r--r--boost/math/special_functions/gamma.hpp108
-rw-r--r--boost/math/special_functions/hankel.hpp178
-rw-r--r--boost/math/special_functions/lanczos.hpp55
-rw-r--r--boost/math/special_functions/log1p.hpp31
-rw-r--r--boost/math/special_functions/math_fwd.hpp52
-rw-r--r--boost/math/special_functions/nonfinite_num_facets.hpp153
-rw-r--r--boost/math/special_functions/owens_t.hpp1061
-rw-r--r--boost/math/special_functions/round.hpp2
-rw-r--r--boost/math/special_functions/trunc.hpp2
-rw-r--r--boost/math/special_functions/zeta.hpp47
-rw-r--r--boost/math/tools/big_constant.hpp20
-rw-r--r--boost/math/tools/config.hpp11
-rw-r--r--boost/math/tools/precision.hpp4
-rw-r--r--boost/math/tools/test.hpp68
-rw-r--r--boost/math/tools/test_data.hpp4
-rw-r--r--boost/math/tools/tuple.hpp2
-rw-r--r--boost/math/tr1.hpp2
-rw-r--r--boost/move/move.hpp89
-rw-r--r--boost/mpl/O1_size.hpp2
-rw-r--r--boost/mpl/O1_size_fwd.hpp2
-rw-r--r--boost/mpl/accumulate.hpp2
-rw-r--r--boost/mpl/advance.hpp2
-rw-r--r--boost/mpl/advance_fwd.hpp2
-rw-r--r--boost/mpl/alias.hpp2
-rw-r--r--boost/mpl/always.hpp2
-rw-r--r--boost/mpl/and.hpp2
-rw-r--r--boost/mpl/apply.hpp2
-rw-r--r--boost/mpl/apply_fwd.hpp2
-rw-r--r--boost/mpl/apply_wrap.hpp2
-rw-r--r--boost/mpl/arg.hpp2
-rw-r--r--boost/mpl/arg_fwd.hpp2
-rw-r--r--boost/mpl/arithmetic.hpp2
-rw-r--r--boost/mpl/as_sequence.hpp2
-rw-r--r--boost/mpl/assert.hpp2
-rw-r--r--boost/mpl/at.hpp2
-rw-r--r--boost/mpl/at_fwd.hpp2
-rw-r--r--boost/mpl/aux_/O1_size_impl.hpp2
-rw-r--r--boost/mpl/aux_/adl_barrier.hpp2
-rw-r--r--boost/mpl/aux_/advance_backward.hpp2
-rw-r--r--boost/mpl/aux_/advance_forward.hpp2
-rw-r--r--boost/mpl/aux_/apply_1st.hpp2
-rw-r--r--boost/mpl/aux_/arg_typedef.hpp2
-rw-r--r--boost/mpl/aux_/arithmetic_op.hpp2
-rw-r--r--boost/mpl/aux_/arity.hpp2
-rw-r--r--boost/mpl/aux_/arity_spec.hpp2
-rw-r--r--boost/mpl/aux_/at_impl.hpp2
-rw-r--r--boost/mpl/aux_/back_impl.hpp2
-rw-r--r--boost/mpl/aux_/basic_bind.hpp2
-rw-r--r--boost/mpl/aux_/begin_end_impl.hpp2
-rw-r--r--boost/mpl/aux_/clear_impl.hpp2
-rw-r--r--boost/mpl/aux_/common_name_wknd.hpp2
-rw-r--r--boost/mpl/aux_/comparison_op.hpp2
-rw-r--r--boost/mpl/aux_/config/adl.hpp2
-rw-r--r--boost/mpl/aux_/config/arrays.hpp2
-rw-r--r--boost/mpl/aux_/config/bind.hpp2
-rw-r--r--boost/mpl/aux_/config/compiler.hpp2
-rw-r--r--boost/mpl/aux_/config/ctps.hpp2
-rw-r--r--boost/mpl/aux_/config/dependent_nttp.hpp2
-rw-r--r--boost/mpl/aux_/config/dmc_ambiguous_ctps.hpp2
-rw-r--r--boost/mpl/aux_/config/dtp.hpp2
-rw-r--r--boost/mpl/aux_/config/eti.hpp2
-rw-r--r--boost/mpl/aux_/config/forwarding.hpp2
-rw-r--r--boost/mpl/aux_/config/gcc.hpp2
-rw-r--r--boost/mpl/aux_/config/has_apply.hpp2
-rw-r--r--boost/mpl/aux_/config/has_xxx.hpp2
-rw-r--r--boost/mpl/aux_/config/integral.hpp2
-rw-r--r--boost/mpl/aux_/config/intel.hpp2
-rw-r--r--boost/mpl/aux_/config/lambda.hpp2
-rw-r--r--boost/mpl/aux_/config/msvc.hpp2
-rw-r--r--boost/mpl/aux_/config/msvc_typename.hpp2
-rw-r--r--boost/mpl/aux_/config/nttp.hpp2
-rw-r--r--boost/mpl/aux_/config/operators.hpp2
-rw-r--r--boost/mpl/aux_/config/overload_resolution.hpp2
-rw-r--r--boost/mpl/aux_/config/pp_counter.hpp2
-rw-r--r--boost/mpl/aux_/config/preprocessor.hpp2
-rw-r--r--boost/mpl/aux_/config/static_constant.hpp2
-rw-r--r--boost/mpl/aux_/config/ttp.hpp2
-rw-r--r--boost/mpl/aux_/config/typeof.hpp2
-rw-r--r--boost/mpl/aux_/config/use_preprocessed.hpp2
-rw-r--r--boost/mpl/aux_/config/workaround.hpp2
-rw-r--r--boost/mpl/aux_/contains_impl.hpp2
-rw-r--r--boost/mpl/aux_/count_args.hpp2
-rw-r--r--boost/mpl/aux_/count_impl.hpp2
-rw-r--r--boost/mpl/aux_/empty_impl.hpp2
-rw-r--r--boost/mpl/aux_/erase_impl.hpp2
-rw-r--r--boost/mpl/aux_/erase_key_impl.hpp2
-rw-r--r--boost/mpl/aux_/filter_iter.hpp2
-rw-r--r--boost/mpl/aux_/fold_impl.hpp2
-rw-r--r--boost/mpl/aux_/fold_impl_body.hpp2
-rw-r--r--boost/mpl/aux_/fold_op.hpp2
-rw-r--r--boost/mpl/aux_/fold_pred.hpp2
-rw-r--r--boost/mpl/aux_/front_impl.hpp2
-rw-r--r--boost/mpl/aux_/full_lambda.hpp2
-rw-r--r--boost/mpl/aux_/has_apply.hpp2
-rw-r--r--boost/mpl/aux_/has_begin.hpp2
-rw-r--r--boost/mpl/aux_/has_key_impl.hpp2
-rw-r--r--boost/mpl/aux_/has_rebind.hpp2
-rw-r--r--boost/mpl/aux_/has_size.hpp2
-rw-r--r--boost/mpl/aux_/has_tag.hpp2
-rw-r--r--boost/mpl/aux_/has_type.hpp2
-rw-r--r--boost/mpl/aux_/include_preprocessed.hpp2
-rw-r--r--boost/mpl/aux_/insert_impl.hpp2
-rw-r--r--boost/mpl/aux_/insert_range_impl.hpp2
-rw-r--r--boost/mpl/aux_/inserter_algorithm.hpp2
-rw-r--r--boost/mpl/aux_/integral_wrapper.hpp2
-rw-r--r--boost/mpl/aux_/is_msvc_eti_arg.hpp2
-rw-r--r--boost/mpl/aux_/iter_apply.hpp2
-rw-r--r--boost/mpl/aux_/iter_fold_if_impl.hpp2
-rw-r--r--boost/mpl/aux_/iter_fold_impl.hpp2
-rw-r--r--boost/mpl/aux_/iter_push_front.hpp2
-rw-r--r--boost/mpl/aux_/joint_iter.hpp2
-rw-r--r--boost/mpl/aux_/lambda_arity_param.hpp2
-rw-r--r--boost/mpl/aux_/lambda_no_ctps.hpp2
-rw-r--r--boost/mpl/aux_/lambda_spec.hpp2
-rw-r--r--boost/mpl/aux_/lambda_support.hpp2
-rw-r--r--boost/mpl/aux_/largest_int.hpp2
-rw-r--r--boost/mpl/aux_/logical_op.hpp2
-rw-r--r--boost/mpl/aux_/msvc_dtw.hpp2
-rw-r--r--boost/mpl/aux_/msvc_eti_base.hpp2
-rw-r--r--boost/mpl/aux_/msvc_is_class.hpp2
-rw-r--r--boost/mpl/aux_/msvc_never_true.hpp2
-rw-r--r--boost/mpl/aux_/msvc_type.hpp2
-rw-r--r--boost/mpl/aux_/na.hpp2
-rw-r--r--boost/mpl/aux_/na_assert.hpp2
-rw-r--r--boost/mpl/aux_/na_fwd.hpp2
-rw-r--r--boost/mpl/aux_/na_spec.hpp2
-rw-r--r--boost/mpl/aux_/nested_type_wknd.hpp2
-rw-r--r--boost/mpl/aux_/nttp_decl.hpp2
-rw-r--r--boost/mpl/aux_/numeric_cast_utils.hpp2
-rw-r--r--boost/mpl/aux_/numeric_op.hpp2
-rw-r--r--boost/mpl/aux_/order_impl.hpp2
-rw-r--r--boost/mpl/aux_/overload_names.hpp2
-rw-r--r--boost/mpl/aux_/partition_op.hpp2
-rw-r--r--boost/mpl/aux_/pop_back_impl.hpp2
-rw-r--r--boost/mpl/aux_/pop_front_impl.hpp2
-rw-r--r--boost/mpl/aux_/preprocessor/add.hpp2
-rw-r--r--boost/mpl/aux_/preprocessor/def_params_tail.hpp2
-rw-r--r--boost/mpl/aux_/preprocessor/default_params.hpp2
-rw-r--r--boost/mpl/aux_/preprocessor/enum.hpp2
-rw-r--r--boost/mpl/aux_/preprocessor/ext_params.hpp2
-rw-r--r--boost/mpl/aux_/preprocessor/filter_params.hpp2
-rw-r--r--boost/mpl/aux_/preprocessor/is_seq.hpp2
-rw-r--r--boost/mpl/aux_/preprocessor/params.hpp2
-rw-r--r--boost/mpl/aux_/preprocessor/partial_spec_params.hpp2
-rw-r--r--boost/mpl/aux_/preprocessor/range.hpp2
-rw-r--r--boost/mpl/aux_/preprocessor/repeat.hpp2
-rw-r--r--boost/mpl/aux_/preprocessor/sub.hpp2
-rw-r--r--boost/mpl/aux_/preprocessor/token_equal.hpp2
-rw-r--r--boost/mpl/aux_/preprocessor/tuple.hpp2
-rw-r--r--boost/mpl/aux_/ptr_to_ref.hpp2
-rw-r--r--boost/mpl/aux_/push_back_impl.hpp2
-rw-r--r--boost/mpl/aux_/push_front_impl.hpp2
-rw-r--r--boost/mpl/aux_/range_c/O1_size.hpp2
-rw-r--r--boost/mpl/aux_/range_c/back.hpp2
-rw-r--r--boost/mpl/aux_/range_c/empty.hpp2
-rw-r--r--boost/mpl/aux_/range_c/front.hpp2
-rw-r--r--boost/mpl/aux_/range_c/iterator.hpp2
-rw-r--r--boost/mpl/aux_/range_c/size.hpp2
-rw-r--r--boost/mpl/aux_/range_c/tag.hpp2
-rw-r--r--boost/mpl/aux_/reverse_fold_impl.hpp2
-rw-r--r--boost/mpl/aux_/reverse_fold_impl_body.hpp2
-rw-r--r--boost/mpl/aux_/reverse_iter_fold_impl.hpp2
-rw-r--r--boost/mpl/aux_/sequence_wrapper.hpp2
-rw-r--r--boost/mpl/aux_/shift_op.hpp2
-rw-r--r--boost/mpl/aux_/single_element_iter.hpp2
-rw-r--r--boost/mpl/aux_/size_impl.hpp2
-rw-r--r--boost/mpl/aux_/sort_impl.hpp2
-rw-r--r--boost/mpl/aux_/static_cast.hpp2
-rw-r--r--boost/mpl/aux_/template_arity.hpp2
-rw-r--r--boost/mpl/aux_/template_arity_fwd.hpp2
-rw-r--r--boost/mpl/aux_/test.hpp2
-rw-r--r--boost/mpl/aux_/test/assert.hpp2
-rw-r--r--boost/mpl/aux_/test/data.hpp2
-rw-r--r--boost/mpl/aux_/test/test_case.hpp2
-rw-r--r--boost/mpl/aux_/traits_lambda_spec.hpp2
-rw-r--r--boost/mpl/aux_/transform_iter.hpp2
-rw-r--r--boost/mpl/aux_/type_wrapper.hpp2
-rw-r--r--boost/mpl/aux_/unwrap.hpp2
-rw-r--r--boost/mpl/aux_/value_wknd.hpp2
-rw-r--r--boost/mpl/aux_/yes_no.hpp2
-rw-r--r--boost/mpl/back.hpp2
-rw-r--r--boost/mpl/back_fwd.hpp2
-rw-r--r--boost/mpl/back_inserter.hpp2
-rw-r--r--boost/mpl/base.hpp2
-rw-r--r--boost/mpl/begin.hpp2
-rw-r--r--boost/mpl/begin_end.hpp2
-rw-r--r--boost/mpl/begin_end_fwd.hpp2
-rw-r--r--boost/mpl/bind.hpp2
-rw-r--r--boost/mpl/bind_fwd.hpp2
-rw-r--r--boost/mpl/bitand.hpp2
-rw-r--r--boost/mpl/bitor.hpp2
-rw-r--r--boost/mpl/bitwise.hpp2
-rw-r--r--boost/mpl/bitxor.hpp2
-rw-r--r--boost/mpl/bool.hpp2
-rw-r--r--boost/mpl/bool_fwd.hpp2
-rw-r--r--boost/mpl/clear.hpp2
-rw-r--r--boost/mpl/clear_fwd.hpp2
-rw-r--r--boost/mpl/comparison.hpp2
-rw-r--r--boost/mpl/contains.hpp2
-rw-r--r--boost/mpl/contains_fwd.hpp2
-rw-r--r--boost/mpl/copy.hpp2
-rw-r--r--boost/mpl/copy_if.hpp2
-rw-r--r--boost/mpl/count.hpp2
-rw-r--r--boost/mpl/count_fwd.hpp2
-rw-r--r--boost/mpl/count_if.hpp2
-rw-r--r--boost/mpl/deque.hpp2
-rw-r--r--boost/mpl/deref.hpp2
-rw-r--r--boost/mpl/distance.hpp2
-rw-r--r--boost/mpl/distance_fwd.hpp2
-rw-r--r--boost/mpl/divides.hpp2
-rw-r--r--boost/mpl/empty.hpp2
-rw-r--r--boost/mpl/empty_base.hpp2
-rw-r--r--boost/mpl/empty_fwd.hpp2
-rw-r--r--boost/mpl/empty_sequence.hpp2
-rw-r--r--boost/mpl/end.hpp2
-rw-r--r--boost/mpl/equal.hpp2
-rw-r--r--boost/mpl/equal_to.hpp2
-rw-r--r--boost/mpl/erase.hpp2
-rw-r--r--boost/mpl/erase_fwd.hpp2
-rw-r--r--boost/mpl/erase_key.hpp2
-rw-r--r--boost/mpl/erase_key_fwd.hpp2
-rw-r--r--boost/mpl/eval_if.hpp2
-rw-r--r--boost/mpl/filter_view.hpp2
-rw-r--r--boost/mpl/find.hpp2
-rw-r--r--boost/mpl/find_if.hpp2
-rw-r--r--boost/mpl/fold.hpp2
-rw-r--r--boost/mpl/for_each.hpp2
-rw-r--r--boost/mpl/front.hpp2
-rw-r--r--boost/mpl/front_fwd.hpp2
-rw-r--r--boost/mpl/front_inserter.hpp2
-rw-r--r--boost/mpl/greater.hpp2
-rw-r--r--boost/mpl/greater_equal.hpp2
-rw-r--r--boost/mpl/has_key.hpp2
-rw-r--r--boost/mpl/has_key_fwd.hpp2
-rw-r--r--boost/mpl/has_xxx.hpp2
-rw-r--r--boost/mpl/identity.hpp2
-rw-r--r--boost/mpl/if.hpp2
-rw-r--r--boost/mpl/index_if.hpp2
-rw-r--r--boost/mpl/index_of.hpp2
-rw-r--r--boost/mpl/inherit.hpp2
-rw-r--r--boost/mpl/inherit_linearly.hpp2
-rw-r--r--boost/mpl/insert.hpp2
-rw-r--r--boost/mpl/insert_fwd.hpp2
-rw-r--r--boost/mpl/insert_range.hpp2
-rw-r--r--boost/mpl/insert_range_fwd.hpp2
-rw-r--r--boost/mpl/inserter.hpp2
-rw-r--r--boost/mpl/int.hpp2
-rw-r--r--boost/mpl/int_fwd.hpp2
-rw-r--r--boost/mpl/integral_c.hpp2
-rw-r--r--boost/mpl/integral_c_fwd.hpp2
-rw-r--r--boost/mpl/integral_c_tag.hpp2
-rw-r--r--boost/mpl/is_placeholder.hpp2
-rw-r--r--boost/mpl/is_sequence.hpp2
-rw-r--r--boost/mpl/iter_fold.hpp2
-rw-r--r--boost/mpl/iter_fold_if.hpp2
-rw-r--r--boost/mpl/iterator_category.hpp2
-rw-r--r--boost/mpl/iterator_range.hpp2
-rw-r--r--boost/mpl/iterator_tags.hpp2
-rw-r--r--boost/mpl/joint_view.hpp2
-rw-r--r--boost/mpl/key_type.hpp2
-rw-r--r--boost/mpl/key_type_fwd.hpp2
-rw-r--r--boost/mpl/lambda.hpp2
-rw-r--r--boost/mpl/lambda_fwd.hpp2
-rw-r--r--boost/mpl/less.hpp2
-rw-r--r--boost/mpl/less_equal.hpp2
-rw-r--r--boost/mpl/limits/arity.hpp2
-rw-r--r--boost/mpl/limits/list.hpp2
-rw-r--r--boost/mpl/limits/map.hpp2
-rw-r--r--boost/mpl/limits/set.hpp2
-rw-r--r--boost/mpl/limits/unrolling.hpp2
-rw-r--r--boost/mpl/limits/vector.hpp2
-rw-r--r--boost/mpl/list.hpp2
-rw-r--r--boost/mpl/list/aux_/O1_size.hpp2
-rw-r--r--boost/mpl/list/aux_/begin_end.hpp2
-rw-r--r--boost/mpl/list/aux_/clear.hpp2
-rw-r--r--boost/mpl/list/aux_/empty.hpp2
-rw-r--r--boost/mpl/list/aux_/front.hpp2
-rw-r--r--boost/mpl/list/aux_/include_preprocessed.hpp2
-rw-r--r--boost/mpl/list/aux_/item.hpp2
-rw-r--r--boost/mpl/list/aux_/iterator.hpp2
-rw-r--r--boost/mpl/list/aux_/numbered.hpp2
-rw-r--r--boost/mpl/list/aux_/numbered_c.hpp2
-rw-r--r--boost/mpl/list/aux_/pop_front.hpp2
-rw-r--r--boost/mpl/list/aux_/push_back.hpp2
-rw-r--r--boost/mpl/list/aux_/push_front.hpp2
-rw-r--r--boost/mpl/list/aux_/size.hpp2
-rw-r--r--boost/mpl/list/aux_/tag.hpp2
-rw-r--r--boost/mpl/list/list0.hpp2
-rw-r--r--boost/mpl/list/list0_c.hpp2
-rw-r--r--boost/mpl/list/list10.hpp2
-rw-r--r--boost/mpl/list/list10_c.hpp2
-rw-r--r--boost/mpl/list/list20.hpp2
-rw-r--r--boost/mpl/list/list20_c.hpp2
-rw-r--r--boost/mpl/list/list30.hpp2
-rw-r--r--boost/mpl/list/list30_c.hpp2
-rw-r--r--boost/mpl/list/list40.hpp2
-rw-r--r--boost/mpl/list/list40_c.hpp2
-rw-r--r--boost/mpl/list/list50.hpp2
-rw-r--r--boost/mpl/list/list50_c.hpp2
-rw-r--r--boost/mpl/list_c.hpp2
-rw-r--r--boost/mpl/logical.hpp2
-rw-r--r--boost/mpl/long.hpp2
-rw-r--r--boost/mpl/long_fwd.hpp2
-rw-r--r--boost/mpl/lower_bound.hpp2
-rw-r--r--boost/mpl/map.hpp2
-rw-r--r--boost/mpl/map/aux_/at_impl.hpp2
-rw-r--r--boost/mpl/map/aux_/begin_end_impl.hpp2
-rw-r--r--boost/mpl/map/aux_/clear_impl.hpp2
-rw-r--r--boost/mpl/map/aux_/contains_impl.hpp2
-rw-r--r--boost/mpl/map/aux_/empty_impl.hpp2
-rw-r--r--boost/mpl/map/aux_/erase_impl.hpp2
-rw-r--r--boost/mpl/map/aux_/erase_key_impl.hpp2
-rw-r--r--boost/mpl/map/aux_/has_key_impl.hpp2
-rw-r--r--boost/mpl/map/aux_/include_preprocessed.hpp2
-rw-r--r--boost/mpl/map/aux_/insert_impl.hpp2
-rw-r--r--boost/mpl/map/aux_/item.hpp2
-rw-r--r--boost/mpl/map/aux_/iterator.hpp2
-rw-r--r--boost/mpl/map/aux_/key_type_impl.hpp2
-rw-r--r--boost/mpl/map/aux_/map0.hpp2
-rw-r--r--boost/mpl/map/aux_/numbered.hpp2
-rw-r--r--boost/mpl/map/aux_/size_impl.hpp2
-rw-r--r--boost/mpl/map/aux_/tag.hpp2
-rw-r--r--boost/mpl/map/aux_/value_type_impl.hpp2
-rw-r--r--boost/mpl/map/map0.hpp2
-rw-r--r--boost/mpl/map/map10.hpp2
-rw-r--r--boost/mpl/map/map20.hpp2
-rw-r--r--boost/mpl/map/map30.hpp2
-rw-r--r--boost/mpl/map/map40.hpp2
-rw-r--r--boost/mpl/map/map50.hpp2
-rw-r--r--boost/mpl/math/fixed_c.hpp2
-rw-r--r--boost/mpl/math/is_even.hpp2
-rw-r--r--boost/mpl/math/rational_c.hpp2
-rw-r--r--boost/mpl/max.hpp2
-rw-r--r--boost/mpl/max_element.hpp2
-rw-r--r--boost/mpl/min.hpp2
-rw-r--r--boost/mpl/min_element.hpp2
-rw-r--r--boost/mpl/min_max.hpp2
-rw-r--r--boost/mpl/minus.hpp2
-rw-r--r--boost/mpl/modulus.hpp2
-rw-r--r--boost/mpl/multiplies.hpp2
-rw-r--r--boost/mpl/multiset/aux_/count_impl.hpp2
-rw-r--r--boost/mpl/multiset/aux_/insert_impl.hpp2
-rw-r--r--boost/mpl/multiset/aux_/item.hpp2
-rw-r--r--boost/mpl/multiset/aux_/multiset0.hpp2
-rw-r--r--boost/mpl/multiset/aux_/tag.hpp2
-rw-r--r--boost/mpl/multiset/multiset0.hpp2
-rw-r--r--boost/mpl/negate.hpp2
-rw-r--r--boost/mpl/next.hpp2
-rw-r--r--boost/mpl/next_prior.hpp2
-rw-r--r--boost/mpl/not.hpp2
-rw-r--r--boost/mpl/not_equal_to.hpp2
-rw-r--r--boost/mpl/numeric_cast.hpp2
-rw-r--r--boost/mpl/or.hpp2
-rw-r--r--boost/mpl/order.hpp2
-rw-r--r--boost/mpl/order_fwd.hpp2
-rw-r--r--boost/mpl/pair.hpp2
-rw-r--r--boost/mpl/pair_view.hpp2
-rw-r--r--boost/mpl/partition.hpp2
-rw-r--r--boost/mpl/placeholders.hpp2
-rw-r--r--boost/mpl/plus.hpp2
-rw-r--r--boost/mpl/pop_back.hpp2
-rw-r--r--boost/mpl/pop_back_fwd.hpp2
-rw-r--r--boost/mpl/pop_front.hpp2
-rw-r--r--boost/mpl/pop_front_fwd.hpp2
-rw-r--r--boost/mpl/print.hpp2
-rw-r--r--boost/mpl/prior.hpp2
-rw-r--r--boost/mpl/protect.hpp2
-rw-r--r--boost/mpl/push_back.hpp2
-rw-r--r--boost/mpl/push_back_fwd.hpp2
-rw-r--r--boost/mpl/push_front.hpp2
-rw-r--r--boost/mpl/push_front_fwd.hpp2
-rw-r--r--boost/mpl/quote.hpp2
-rw-r--r--boost/mpl/range_c.hpp2
-rw-r--r--boost/mpl/remove.hpp2
-rw-r--r--boost/mpl/remove_if.hpp2
-rw-r--r--boost/mpl/replace.hpp2
-rw-r--r--boost/mpl/replace_if.hpp2
-rw-r--r--boost/mpl/reverse.hpp2
-rw-r--r--boost/mpl/reverse_fold.hpp2
-rw-r--r--boost/mpl/reverse_iter_fold.hpp2
-rw-r--r--boost/mpl/same_as.hpp2
-rw-r--r--boost/mpl/sequence_tag.hpp2
-rw-r--r--boost/mpl/sequence_tag_fwd.hpp2
-rw-r--r--boost/mpl/set.hpp2
-rw-r--r--boost/mpl/set/aux_/at_impl.hpp2
-rw-r--r--boost/mpl/set/aux_/begin_end_impl.hpp2
-rw-r--r--boost/mpl/set/aux_/clear_impl.hpp2
-rw-r--r--boost/mpl/set/aux_/empty_impl.hpp2
-rw-r--r--boost/mpl/set/aux_/erase_impl.hpp2
-rw-r--r--boost/mpl/set/aux_/erase_key_impl.hpp2
-rw-r--r--boost/mpl/set/aux_/has_key_impl.hpp2
-rw-r--r--boost/mpl/set/aux_/include_preprocessed.hpp2
-rw-r--r--boost/mpl/set/aux_/insert_impl.hpp2
-rw-r--r--boost/mpl/set/aux_/item.hpp2
-rw-r--r--boost/mpl/set/aux_/iterator.hpp2
-rw-r--r--boost/mpl/set/aux_/key_type_impl.hpp2
-rw-r--r--boost/mpl/set/aux_/numbered.hpp2
-rw-r--r--boost/mpl/set/aux_/numbered_c.hpp2
-rw-r--r--boost/mpl/set/aux_/set0.hpp2
-rw-r--r--boost/mpl/set/aux_/size_impl.hpp2
-rw-r--r--boost/mpl/set/aux_/tag.hpp2
-rw-r--r--boost/mpl/set/aux_/value_type_impl.hpp2
-rw-r--r--boost/mpl/set/set0.hpp2
-rw-r--r--boost/mpl/set/set0_c.hpp2
-rw-r--r--boost/mpl/set/set10.hpp2
-rw-r--r--boost/mpl/set/set10_c.hpp2
-rw-r--r--boost/mpl/set/set20.hpp2
-rw-r--r--boost/mpl/set/set20_c.hpp2
-rw-r--r--boost/mpl/set/set30.hpp2
-rw-r--r--boost/mpl/set/set30_c.hpp2
-rw-r--r--boost/mpl/set/set40.hpp2
-rw-r--r--boost/mpl/set/set40_c.hpp2
-rw-r--r--boost/mpl/set/set50.hpp2
-rw-r--r--boost/mpl/set/set50_c.hpp2
-rw-r--r--boost/mpl/set_c.hpp2
-rw-r--r--boost/mpl/shift_left.hpp2
-rw-r--r--boost/mpl/shift_right.hpp2
-rw-r--r--boost/mpl/single_view.hpp2
-rw-r--r--boost/mpl/size.hpp2
-rw-r--r--boost/mpl/size_fwd.hpp2
-rw-r--r--boost/mpl/size_t.hpp2
-rw-r--r--boost/mpl/size_t_fwd.hpp2
-rw-r--r--boost/mpl/sizeof.hpp2
-rw-r--r--boost/mpl/sort.hpp2
-rw-r--r--boost/mpl/stable_partition.hpp2
-rw-r--r--boost/mpl/switch.hpp2
-rw-r--r--boost/mpl/tag.hpp2
-rw-r--r--boost/mpl/times.hpp2
-rw-r--r--boost/mpl/transform.hpp2
-rw-r--r--boost/mpl/transform_view.hpp2
-rw-r--r--boost/mpl/unique.hpp2
-rw-r--r--boost/mpl/unpack_args.hpp2
-rw-r--r--boost/mpl/upper_bound.hpp2
-rw-r--r--boost/mpl/value_type.hpp2
-rw-r--r--boost/mpl/value_type_fwd.hpp2
-rw-r--r--boost/mpl/vector.hpp2
-rw-r--r--boost/mpl/vector/aux_/O1_size.hpp2
-rw-r--r--boost/mpl/vector/aux_/at.hpp2
-rw-r--r--boost/mpl/vector/aux_/back.hpp2
-rw-r--r--boost/mpl/vector/aux_/begin_end.hpp2
-rw-r--r--boost/mpl/vector/aux_/clear.hpp2
-rw-r--r--boost/mpl/vector/aux_/empty.hpp2
-rw-r--r--boost/mpl/vector/aux_/front.hpp2
-rw-r--r--boost/mpl/vector/aux_/include_preprocessed.hpp2
-rw-r--r--boost/mpl/vector/aux_/item.hpp2
-rw-r--r--boost/mpl/vector/aux_/iterator.hpp2
-rw-r--r--boost/mpl/vector/aux_/numbered.hpp2
-rw-r--r--boost/mpl/vector/aux_/numbered_c.hpp2
-rw-r--r--boost/mpl/vector/aux_/pop_back.hpp2
-rw-r--r--boost/mpl/vector/aux_/pop_front.hpp2
-rw-r--r--boost/mpl/vector/aux_/push_back.hpp2
-rw-r--r--boost/mpl/vector/aux_/push_front.hpp2
-rw-r--r--boost/mpl/vector/aux_/size.hpp2
-rw-r--r--boost/mpl/vector/aux_/tag.hpp2
-rw-r--r--boost/mpl/vector/aux_/vector0.hpp2
-rw-r--r--boost/mpl/vector/vector0.hpp2
-rw-r--r--boost/mpl/vector/vector0_c.hpp2
-rw-r--r--boost/mpl/vector/vector10.hpp2
-rw-r--r--boost/mpl/vector/vector10_c.hpp2
-rw-r--r--boost/mpl/vector/vector20.hpp2
-rw-r--r--boost/mpl/vector/vector20_c.hpp2
-rw-r--r--boost/mpl/vector/vector30.hpp2
-rw-r--r--boost/mpl/vector/vector30_c.hpp2
-rw-r--r--boost/mpl/vector/vector40.hpp2
-rw-r--r--boost/mpl/vector/vector40_c.hpp2
-rw-r--r--boost/mpl/vector/vector50.hpp2
-rw-r--r--boost/mpl/vector/vector50_c.hpp2
-rw-r--r--boost/mpl/vector_c.hpp2
-rw-r--r--boost/mpl/void.hpp2
-rw-r--r--boost/mpl/void_fwd.hpp2
-rw-r--r--boost/mpl/zip_view.hpp2
-rw-r--r--boost/msm/back/dispatch_table.hpp67
-rw-r--r--boost/msm/back/favor_compile_time.hpp2
-rw-r--r--boost/msm/back/metafunctions.hpp13
-rw-r--r--boost/msm/back/state_machine.hpp186
-rw-r--r--boost/msm/common.hpp2
-rw-r--r--boost/msm/event_traits.hpp36
-rw-r--r--boost/msm/front/euml/common.hpp143
-rw-r--r--boost/msm/front/euml/container.hpp102
-rw-r--r--boost/msm/front/euml/operator.hpp20
-rw-r--r--boost/msm/front/euml/state_grammar.hpp25
-rw-r--r--boost/msm/front/euml/transformation.hpp8
-rw-r--r--boost/msm/front/functor_row.hpp22
-rw-r--r--boost/msm/front/state_machine_def.hpp3
-rw-r--r--boost/msm/front/states.hpp11
-rw-r--r--boost/msm/msm_grammar.hpp40
-rw-r--r--boost/multi_array/base.hpp44
-rw-r--r--boost/multi_array/concept_checks.hpp1
-rw-r--r--boost/multi_array/iterator.hpp18
-rw-r--r--boost/multi_array/multi_array_ref.hpp1
-rw-r--r--boost/multi_array/view.hpp1
-rw-r--r--boost/numeric/conversion/converter_policies.hpp8
-rw-r--r--boost/numeric/interval/detail/msvc_rounding_control.hpp2
-rw-r--r--boost/parameter/aux_/cast.hpp44
-rw-r--r--boost/parameter/preprocessor.hpp3
-rw-r--r--boost/pending/detail/property.hpp139
-rw-r--r--boost/pending/property.hpp240
-rw-r--r--boost/pending/property_serialize.hpp2
-rw-r--r--boost/program_options/detail/cmdline.hpp12
-rw-r--r--boost/program_options/detail/config_file.hpp2
-rw-r--r--boost/program_options/detail/parsers.hpp6
-rw-r--r--boost/program_options/detail/value_semantic.hpp7
-rw-r--r--boost/program_options/errors.hpp454
-rw-r--r--boost/program_options/options_description.hpp10
-rw-r--r--boost/program_options/parsers.hpp30
-rw-r--r--boost/program_options/value_semantic.hpp18
-rw-r--r--boost/program_options/variables_map.hpp13
-rw-r--r--boost/property_map/dynamic_property_map.hpp63
-rw-r--r--boost/property_map/function_property_map.hpp66
-rw-r--r--boost/property_map/parallel/impl/distributed_property_map.ipp4
-rw-r--r--boost/property_map/transform_value_property_map.hpp67
-rw-r--r--boost/property_tree/detail/json_parser_read.hpp3
-rw-r--r--boost/property_tree/detail/ptree_implementation.hpp2
-rw-r--r--boost/proto/context/default.hpp4
-rw-r--r--boost/proto/context/detail/default_eval.hpp2
-rw-r--r--boost/proto/context/detail/preprocessed/default_eval.hpp16
-rw-r--r--boost/proto/debug.hpp3
-rw-r--r--boost/proto/detail/as_expr.hpp9
-rw-r--r--boost/proto/detail/as_lvalue.hpp9
-rw-r--r--boost/proto/detail/decltype.hpp9
-rw-r--r--boost/proto/detail/deduce_domain.hpp1
-rw-r--r--boost/proto/detail/dont_care.hpp9
-rw-r--r--boost/proto/detail/ignore_unused.hpp9
-rw-r--r--boost/proto/domain.hpp9
-rw-r--r--boost/proto/expr.hpp1
-rw-r--r--boost/proto/extends.hpp29
-rw-r--r--boost/proto/fusion.hpp21
-rw-r--r--boost/proto/generate.hpp9
-rw-r--r--boost/proto/make_expr.hpp7
-rw-r--r--boost/proto/matches.hpp18
-rw-r--r--boost/proto/operators.hpp25
-rw-r--r--boost/proto/proto_fwd.hpp26
-rw-r--r--boost/proto/traits.hpp13
-rw-r--r--boost/proto/transform/call.hpp33
-rw-r--r--boost/proto/transform/default.hpp4
-rw-r--r--boost/proto/transform/detail/call.hpp29
-rw-r--r--boost/proto/transform/detail/default_function_impl.hpp2
-rw-r--r--boost/proto/transform/detail/expand_pack.hpp46
-rw-r--r--boost/proto/transform/detail/lazy.hpp21
-rw-r--r--boost/proto/transform/detail/make.hpp24
-rw-r--r--boost/proto/transform/detail/pack.hpp97
-rw-r--r--boost/proto/transform/detail/pack_impl.hpp72
-rw-r--r--boost/proto/transform/detail/preprocessed/call.hpp200
-rw-r--r--boost/proto/transform/detail/preprocessed/default_function_impl.hpp16
-rw-r--r--boost/proto/transform/detail/preprocessed/expand_pack.hpp73
-rw-r--r--boost/proto/transform/detail/preprocessed/lazy.hpp180
-rw-r--r--boost/proto/transform/detail/preprocessed/make.hpp220
-rw-r--r--boost/proto/transform/detail/preprocessed/pack_impl.hpp442
-rw-r--r--boost/proto/transform/detail/preprocessed/when.hpp762
-rw-r--r--boost/proto/transform/detail/when.hpp77
-rw-r--r--boost/proto/transform/impl.hpp9
-rw-r--r--boost/proto/transform/lazy.hpp7
-rw-r--r--boost/proto/transform/make.hpp16
-rw-r--r--boost/proto/transform/pass_through.hpp9
-rw-r--r--boost/proto/transform/when.hpp59
-rw-r--r--boost/python/detail/config.hpp4
-rw-r--r--boost/python/extract.hpp1
-rw-r--r--boost/python/instance_holder.hpp2
-rw-r--r--boost/python/module_init.hpp2
-rw-r--r--boost/python/object/class.hpp1
-rw-r--r--boost/python/object_core.hpp12
-rw-r--r--boost/python/scope.hpp1
-rw-r--r--boost/random/detail/signed_unsigned_tools.hpp2
-rw-r--r--boost/random/discrete_distribution.hpp8
-rw-r--r--boost/random/piecewise_constant_distribution.hpp8
-rw-r--r--boost/random/piecewise_linear_distribution.hpp8
-rw-r--r--boost/random/seed_seq.hpp6
-rw-r--r--boost/range/algorithm/equal.hpp20
-rw-r--r--boost/range/algorithm/for_each.hpp1
-rw-r--r--boost/range/algorithm_ext/copy_n.hpp8
-rw-r--r--boost/range/as_literal.hpp2
-rw-r--r--boost/range/counting_range.hpp1
-rw-r--r--boost/range/detail/any_iterator.hpp1
-rw-r--r--boost/range/detail/any_iterator_buffer.hpp2
-rw-r--r--boost/range/detail/join_iterator.hpp2
-rw-r--r--boost/range/detail/size_type.hpp33
-rw-r--r--boost/range/has_range_iterator.hpp2
-rw-r--r--boost/range/numeric.hpp2
-rw-r--r--boost/range/size.hpp6
-rw-r--r--boost/range/size_type.hpp56
-rw-r--r--boost/ratio/detail/mpl/gcd.hpp45
-rw-r--r--boost/ratio/detail/mpl/lcm.hpp45
-rw-r--r--boost/ratio/detail/overflow_helpers.hpp4
-rw-r--r--boost/ratio/include.hpp3
-rw-r--r--boost/ratio/ratio_io.hpp250
-rw-r--r--boost/regex/concepts.hpp2
-rw-r--r--boost/regex/config.hpp5
-rw-r--r--boost/regex/pending/object_cache.hpp2
-rw-r--r--boost/regex/v4/basic_regex.hpp9
-rw-r--r--boost/regex/v4/basic_regex_creator.hpp65
-rw-r--r--boost/regex/v4/basic_regex_parser.hpp29
-rw-r--r--boost/regex/v4/instances.hpp5
-rw-r--r--boost/regex/v4/match_results.hpp5
-rw-r--r--boost/regex/v4/perl_matcher.hpp5
-rw-r--r--boost/regex/v4/perl_matcher_non_recursive.hpp8
-rw-r--r--boost/regex/v4/regex_format.hpp6
-rw-r--r--boost/regex/v4/regex_iterator.hpp2
-rw-r--r--boost/scope_exit.hpp1357
-rw-r--r--boost/serialization/detail/get_data.hpp14
-rw-r--r--boost/serialization/extended_type_info_no_rtti.hpp2
-rw-r--r--boost/serialization/extended_type_info_typeid.hpp2
-rw-r--r--boost/serialization/factory.hpp2
-rw-r--r--boost/serialization/force_include.hpp6
-rw-r--r--boost/serialization/valarray.hpp4
-rw-r--r--boost/serialization/vector.hpp9
-rw-r--r--boost/serialization/vector_135.hpp2
-rw-r--r--boost/signals2/detail/foreign_ptr.hpp19
-rw-r--r--boost/signals2/detail/variadic_slot_invoker.hpp20
-rw-r--r--boost/smart_ptr/detail/sp_counted_base.hpp6
-rw-r--r--boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp150
-rw-r--r--boost/smart_ptr/detail/spinlock_gcc_arm.hpp29
-rw-r--r--boost/spirit/actor.hpp27
-rw-r--r--boost/spirit/actor/assign_actor.hpp27
-rw-r--r--boost/spirit/actor/assign_key_actor.hpp27
-rw-r--r--boost/spirit/actor/clear_actor.hpp27
-rw-r--r--boost/spirit/actor/decrement_actor.hpp27
-rw-r--r--boost/spirit/actor/erase_actor.hpp27
-rw-r--r--boost/spirit/actor/increment_actor.hpp27
-rw-r--r--boost/spirit/actor/insert_at_actor.hpp27
-rw-r--r--boost/spirit/actor/insert_key_actor.hpp27
-rw-r--r--boost/spirit/actor/push_back_actor.hpp27
-rw-r--r--boost/spirit/actor/push_front_actor.hpp27
-rw-r--r--boost/spirit/actor/ref_actor.hpp27
-rw-r--r--boost/spirit/actor/ref_const_ref_actor.hpp27
-rw-r--r--boost/spirit/actor/ref_const_ref_const_ref_a.hpp27
-rw-r--r--boost/spirit/actor/ref_const_ref_value_actor.hpp27
-rw-r--r--boost/spirit/actor/ref_value_actor.hpp27
-rw-r--r--boost/spirit/actor/swap_actor.hpp27
-rw-r--r--boost/spirit/actor/typeof.hpp27
-rw-r--r--boost/spirit/attribute.hpp27
-rw-r--r--boost/spirit/attribute/closure.hpp27
-rw-r--r--boost/spirit/attribute/closure_context.hpp27
-rw-r--r--boost/spirit/attribute/closure_fwd.hpp27
-rw-r--r--boost/spirit/attribute/parametric.hpp27
-rw-r--r--boost/spirit/attribute/typeof.hpp27
-rw-r--r--boost/spirit/core.hpp27
-rw-r--r--boost/spirit/core/assert.hpp27
-rw-r--r--boost/spirit/core/composite/actions.hpp27
-rw-r--r--boost/spirit/core/composite/alternative.hpp27
-rw-r--r--boost/spirit/core/composite/composite.hpp27
-rw-r--r--boost/spirit/core/composite/difference.hpp27
-rw-r--r--boost/spirit/core/composite/directives.hpp27
-rw-r--r--boost/spirit/core/composite/epsilon.hpp27
-rw-r--r--boost/spirit/core/composite/exclusive_or.hpp27
-rw-r--r--boost/spirit/core/composite/intersection.hpp27
-rw-r--r--boost/spirit/core/composite/kleene_star.hpp27
-rw-r--r--boost/spirit/core/composite/list.hpp27
-rw-r--r--boost/spirit/core/composite/no_actions.hpp27
-rw-r--r--boost/spirit/core/composite/operators.hpp27
-rw-r--r--boost/spirit/core/composite/optional.hpp27
-rw-r--r--boost/spirit/core/composite/positive.hpp27
-rw-r--r--boost/spirit/core/composite/sequence.hpp27
-rw-r--r--boost/spirit/core/composite/sequential_and.hpp27
-rw-r--r--boost/spirit/core/composite/sequential_or.hpp27
-rw-r--r--boost/spirit/core/config.hpp27
-rw-r--r--boost/spirit/core/match.hpp27
-rw-r--r--boost/spirit/core/nil.hpp27
-rw-r--r--boost/spirit/core/non_terminal/grammar.hpp27
-rw-r--r--boost/spirit/core/non_terminal/parser_context.hpp27
-rw-r--r--boost/spirit/core/non_terminal/parser_id.hpp27
-rw-r--r--boost/spirit/core/non_terminal/rule.hpp27
-rw-r--r--boost/spirit/core/non_terminal/subrule.hpp27
-rw-r--r--boost/spirit/core/non_terminal/subrule_fwd.hpp27
-rw-r--r--boost/spirit/core/parser.hpp27
-rw-r--r--boost/spirit/core/primitives/numerics.hpp27
-rw-r--r--boost/spirit/core/primitives/numerics_fwd.hpp27
-rw-r--r--boost/spirit/core/primitives/primitives.hpp27
-rw-r--r--boost/spirit/core/safe_bool.hpp27
-rw-r--r--boost/spirit/core/scanner/scanner.hpp27
-rw-r--r--boost/spirit/core/scanner/scanner_fwd.hpp27
-rw-r--r--boost/spirit/core/scanner/skipper.hpp27
-rw-r--r--boost/spirit/core/scanner/skipper_fwd.hpp27
-rw-r--r--boost/spirit/core/typeof.hpp27
-rw-r--r--boost/spirit/debug.hpp27
-rw-r--r--boost/spirit/debug/debug_node.hpp27
-rw-r--r--boost/spirit/debug/minimal.hpp27
-rw-r--r--boost/spirit/debug/parser_names.hpp27
-rw-r--r--boost/spirit/debug/typeof.hpp27
-rw-r--r--boost/spirit/dynamic.hpp27
-rw-r--r--boost/spirit/dynamic/for.hpp27
-rw-r--r--boost/spirit/dynamic/if.hpp27
-rw-r--r--boost/spirit/dynamic/lazy.hpp27
-rw-r--r--boost/spirit/dynamic/rule_alias.hpp27
-rw-r--r--boost/spirit/dynamic/select.hpp27
-rw-r--r--boost/spirit/dynamic/stored_rule.hpp27
-rw-r--r--boost/spirit/dynamic/stored_rule_fwd.hpp27
-rw-r--r--boost/spirit/dynamic/switch.hpp27
-rw-r--r--boost/spirit/dynamic/typeof.hpp27
-rw-r--r--boost/spirit/dynamic/while.hpp27
-rw-r--r--boost/spirit/error_handling.hpp27
-rw-r--r--boost/spirit/error_handling/exceptions.hpp27
-rw-r--r--boost/spirit/error_handling/exceptions_fwd.hpp27
-rw-r--r--boost/spirit/error_handling/typeof.hpp27
-rw-r--r--boost/spirit/home/qi/detail/assign_to.hpp31
-rw-r--r--boost/spirit/home/support/detail/endian.hpp8
-rw-r--r--boost/spirit/home/support/utree/detail/utree_detail2.hpp2
-rw-r--r--boost/spirit/include/version.hpp4
-rw-r--r--boost/spirit/iterator.hpp27
-rw-r--r--boost/spirit/iterator/file_iterator.hpp27
-rw-r--r--boost/spirit/iterator/file_iterator_fwd.hpp27
-rw-r--r--boost/spirit/iterator/fixed_size_queue.hpp27
-rw-r--r--boost/spirit/iterator/multi_pass.hpp27
-rw-r--r--boost/spirit/iterator/multi_pass_fwd.hpp27
-rw-r--r--boost/spirit/iterator/position_iterator.hpp27
-rw-r--r--boost/spirit/iterator/position_iterator_fwd.hpp27
-rw-r--r--boost/spirit/iterator/typeof.hpp27
-rw-r--r--boost/spirit/meta.hpp27
-rw-r--r--boost/spirit/meta/as_parser.hpp27
-rw-r--r--boost/spirit/meta/fundamental.hpp27
-rw-r--r--boost/spirit/meta/parser_traits.hpp27
-rw-r--r--boost/spirit/meta/refactoring.hpp27
-rw-r--r--boost/spirit/meta/traverse.hpp27
-rw-r--r--boost/spirit/phoenix.hpp27
-rw-r--r--boost/spirit/phoenix/actor.hpp24
-rw-r--r--boost/spirit/phoenix/binders.hpp24
-rw-r--r--boost/spirit/phoenix/casts.hpp24
-rw-r--r--boost/spirit/phoenix/closures.hpp24
-rw-r--r--boost/spirit/phoenix/composite.hpp24
-rw-r--r--boost/spirit/phoenix/functions.hpp24
-rw-r--r--boost/spirit/phoenix/new.hpp24
-rw-r--r--boost/spirit/phoenix/operators.hpp24
-rw-r--r--boost/spirit/phoenix/primitives.hpp24
-rw-r--r--boost/spirit/phoenix/special_ops.hpp24
-rw-r--r--boost/spirit/phoenix/statements.hpp24
-rw-r--r--boost/spirit/phoenix/tuple_helpers.hpp24
-rw-r--r--boost/spirit/phoenix/tuples.hpp24
-rw-r--r--boost/spirit/repository/home/qi/directive/kwd.hpp689
-rw-r--r--boost/spirit/repository/home/qi/operator/detail/keywords.hpp634
-rw-r--r--boost/spirit/repository/home/qi/operator/keywords.hpp420
-rw-r--r--boost/spirit/repository/home/support/kwd.hpp2
-rw-r--r--boost/spirit/symbols.hpp27
-rw-r--r--boost/spirit/symbols/symbols.hpp27
-rw-r--r--boost/spirit/symbols/symbols_fwd.hpp27
-rw-r--r--boost/spirit/symbols/typeof.hpp27
-rw-r--r--boost/spirit/tree/ast.hpp27
-rw-r--r--boost/spirit/tree/ast_fwd.hpp27
-rw-r--r--boost/spirit/tree/common.hpp27
-rw-r--r--boost/spirit/tree/common_fwd.hpp27
-rw-r--r--boost/spirit/tree/parse_tree.hpp27
-rw-r--r--boost/spirit/tree/parse_tree_fwd.hpp27
-rw-r--r--boost/spirit/tree/parse_tree_utils.hpp27
-rw-r--r--boost/spirit/tree/parsetree.dtd21
-rw-r--r--boost/spirit/tree/tree_to_xml.hpp27
-rw-r--r--boost/spirit/tree/typeof.hpp27
-rw-r--r--boost/spirit/utility.hpp27
-rw-r--r--boost/spirit/utility/chset.hpp27
-rw-r--r--boost/spirit/utility/chset_operators.hpp27
-rw-r--r--boost/spirit/utility/confix.hpp27
-rw-r--r--boost/spirit/utility/confix_fwd.hpp27
-rw-r--r--boost/spirit/utility/distinct.hpp27
-rw-r--r--boost/spirit/utility/distinct_fwd.hpp27
-rw-r--r--boost/spirit/utility/escape_char.hpp27
-rw-r--r--boost/spirit/utility/escape_char_fwd.hpp27
-rw-r--r--boost/spirit/utility/flush_multi_pass.hpp27
-rw-r--r--boost/spirit/utility/functor_parser.hpp27
-rw-r--r--boost/spirit/utility/grammar_def.hpp27
-rw-r--r--boost/spirit/utility/grammar_def_fwd.hpp27
-rw-r--r--boost/spirit/utility/lists.hpp27
-rw-r--r--boost/spirit/utility/lists_fwd.hpp27
-rw-r--r--boost/spirit/utility/loops.hpp27
-rw-r--r--boost/spirit/utility/regex.hpp27
-rw-r--r--boost/spirit/utility/rule_parser.hpp27
-rw-r--r--boost/spirit/utility/scoped_lock.hpp27
-rw-r--r--boost/spirit/utility/typeof.hpp27
-rw-r--r--boost/system/config.hpp17
-rw-r--r--boost/thread/barrier.hpp8
-rw-r--r--boost/thread/cv_status.hpp26
-rw-r--r--boost/thread/detail/config.hpp113
-rw-r--r--boost/thread/detail/delete.hpp45
-rw-r--r--boost/thread/detail/memory.hpp54
-rw-r--r--boost/thread/detail/move.hpp182
-rw-r--r--boost/thread/detail/platform.hpp4
-rw-r--r--boost/thread/detail/thread.hpp340
-rw-r--r--boost/thread/detail/thread_interruption.hpp23
-rw-r--r--boost/thread/exceptions.hpp211
-rw-r--r--boost/thread/future.hpp970
-rw-r--r--boost/thread/locks.hpp899
-rw-r--r--boost/thread/once.hpp4
-rw-r--r--boost/thread/pthread/condition_variable.hpp171
-rw-r--r--boost/thread/pthread/condition_variable_fwd.hpp155
-rw-r--r--boost/thread/pthread/mutex.hpp100
-rw-r--r--boost/thread/pthread/once.hpp35
-rw-r--r--boost/thread/pthread/recursive_mutex.hpp97
-rw-r--r--boost/thread/pthread/shared_mutex.hpp252
-rw-r--r--boost/thread/pthread/thread_data.hpp57
-rw-r--r--boost/thread/reverse_lock.hpp58
-rw-r--r--boost/thread/shared_lock_guard.hpp52
-rw-r--r--boost/thread/shared_mutex.hpp9
-rw-r--r--boost/thread/thread.hpp3
-rw-r--r--boost/thread/v2/thread.hpp56
-rw-r--r--boost/thread/win32/basic_recursive_mutex.hpp42
-rw-r--r--boost/thread/win32/basic_timed_mutex.hpp60
-rw-r--r--boost/thread/win32/condition_variable.hpp181
-rw-r--r--boost/thread/win32/mutex.hpp10
-rw-r--r--boost/thread/win32/once.hpp55
-rw-r--r--boost/thread/win32/recursive_mutex.hpp9
-rw-r--r--boost/thread/win32/shared_mutex.hpp256
-rw-r--r--boost/thread/win32/thread_data.hpp51
-rw-r--r--boost/thread/win32/thread_heap_alloc.hpp90
-rw-r--r--boost/thread/win32/thread_primitives.hpp20
-rw-r--r--boost/thread/xtime.hpp12
-rw-r--r--boost/throw_exception.hpp17
-rw-r--r--boost/type_traits/detail/bool_trait_def.hpp2
-rw-r--r--boost/type_traits/detail/bool_trait_undef.hpp2
-rw-r--r--boost/type_traits/detail/size_t_trait_def.hpp2
-rw-r--r--boost/type_traits/detail/size_t_trait_undef.hpp2
-rw-r--r--boost/type_traits/detail/type_trait_def.hpp2
-rw-r--r--boost/type_traits/detail/type_trait_undef.hpp2
-rw-r--r--boost/type_traits/intrinsics.hpp7
-rw-r--r--boost/type_traits/is_virtual_base_of.hpp2
-rw-r--r--boost/units/conversion.hpp6
-rw-r--r--boost/units/detail/one.hpp11
-rw-r--r--boost/units/detail/static_rational_power.hpp4
-rw-r--r--boost/units/quantity.hpp36
-rw-r--r--boost/units/systems/detail/constants.hpp68
-rw-r--r--boost/unordered/detail/allocate.hpp1246
-rw-r--r--boost/unordered/detail/allocator_helpers.hpp523
-rw-r--r--boost/unordered/detail/buckets.hpp519
-rw-r--r--boost/unordered/detail/emplace_args.hpp480
-rw-r--r--boost/unordered/detail/equivalent.hpp322
-rw-r--r--boost/unordered/detail/extract_key.hpp12
-rw-r--r--boost/unordered/detail/fwd.hpp30
-rw-r--r--boost/unordered/detail/table.hpp319
-rw-r--r--boost/unordered/detail/unique.hpp272
-rw-r--r--boost/unordered/detail/util.hpp2
-rw-r--r--boost/unordered/unordered_map.hpp91
-rw-r--r--boost/unordered/unordered_map_fwd.hpp18
-rw-r--r--boost/unordered/unordered_set.hpp77
-rw-r--r--boost/unordered/unordered_set_fwd.hpp16
-rw-r--r--boost/utility.hpp1
-rw-r--r--boost/utility/declval.hpp9
-rw-r--r--boost/utility/identity_type.hpp46
-rw-r--r--boost/uuid/seed_rng.hpp11
-rw-r--r--boost/variant/detail/hash_variant.hpp48
-rw-r--r--boost/variant/detail/visitation_impl.hpp2
-rw-r--r--boost/variant/variant.hpp1
-rw-r--r--boost/version.hpp7
-rw-r--r--boost/wave.hpp2
-rw-r--r--boost/wave/cpp_context.hpp2
-rw-r--r--boost/wave/cpp_exceptions.hpp4
-rw-r--r--boost/wave/cpp_iteration_context.hpp62
-rw-r--r--boost/wave/cpp_throw.hpp2
-rw-r--r--boost/wave/cpplexer/convert_trigraphs.hpp2
-rw-r--r--boost/wave/cpplexer/cpp_lex_interface.hpp2
-rw-r--r--boost/wave/cpplexer/cpp_lex_interface_generator.hpp2
-rw-r--r--boost/wave/cpplexer/cpp_lex_iterator.hpp4
-rw-r--r--boost/wave/cpplexer/cpp_lex_token.hpp2
-rw-r--r--boost/wave/cpplexer/cpplexer_exceptions.hpp2
-rw-r--r--boost/wave/cpplexer/detect_include_guards.hpp2
-rw-r--r--boost/wave/cpplexer/re2clex/aq.hpp2
-rw-r--r--boost/wave/cpplexer/re2clex/cpp_re.hpp2
-rw-r--r--boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp4
-rw-r--r--boost/wave/cpplexer/re2clex/scanner.hpp4
-rw-r--r--boost/wave/cpplexer/token_cache.hpp2
-rw-r--r--boost/wave/cpplexer/validate_universal_char.hpp2
-rw-r--r--boost/wave/grammars/cpp_chlit_grammar.hpp2
-rw-r--r--boost/wave/grammars/cpp_defined_grammar.hpp2
-rw-r--r--boost/wave/grammars/cpp_defined_grammar_gen.hpp2
-rw-r--r--boost/wave/grammars/cpp_expression_grammar.hpp2
-rw-r--r--boost/wave/grammars/cpp_expression_grammar_gen.hpp2
-rw-r--r--boost/wave/grammars/cpp_expression_value.hpp2
-rw-r--r--boost/wave/grammars/cpp_grammar.hpp2
-rw-r--r--boost/wave/grammars/cpp_grammar_gen.hpp2
-rw-r--r--boost/wave/grammars/cpp_intlit_grammar.hpp2
-rw-r--r--boost/wave/grammars/cpp_literal_grammar_gen.hpp2
-rw-r--r--boost/wave/grammars/cpp_predef_macros_gen.hpp2
-rw-r--r--boost/wave/grammars/cpp_predef_macros_grammar.hpp2
-rw-r--r--boost/wave/grammars/cpp_value_error.hpp2
-rw-r--r--boost/wave/language_support.hpp39
-rw-r--r--boost/wave/preprocessing_hooks.hpp2
-rw-r--r--boost/wave/token_ids.hpp4
-rw-r--r--boost/wave/util/cpp_ifblock.hpp2
-rw-r--r--boost/wave/util/cpp_include_paths.hpp2
-rw-r--r--boost/wave/util/cpp_iterator.hpp644
-rw-r--r--boost/wave/util/cpp_macromap.hpp634
-rw-r--r--boost/wave/util/cpp_macromap_predef.hpp4
-rw-r--r--boost/wave/util/cpp_macromap_utils.hpp2
-rw-r--r--boost/wave/util/file_position.hpp2
-rw-r--r--boost/wave/util/filesystem_compatibility.hpp75
-rw-r--r--boost/wave/util/functor_input.hpp2
-rw-r--r--boost/wave/util/insert_whitespace_detection.hpp2
-rw-r--r--boost/wave/util/interpret_pragma.hpp2
-rw-r--r--boost/wave/util/iteration_context.hpp22
-rw-r--r--boost/wave/util/macro_definition.hpp2
-rw-r--r--boost/wave/util/macro_helpers.hpp2
-rw-r--r--boost/wave/util/pattern_parser.hpp2
-rw-r--r--boost/wave/util/symbol_table.hpp2
-rw-r--r--boost/wave/util/time_conversion_helper.hpp2
-rw-r--r--boost/wave/util/transform_iterator.hpp2
-rw-r--r--boost/wave/util/unput_queue_iterator.hpp2
-rw-r--r--boost/wave/wave_config.hpp6
-rw-r--r--boost/wave/wave_config_constant.hpp2
-rw-r--r--boost/wave/wave_version.hpp6
-rw-r--r--boost/wave/whitespace_handling.hpp4
-rw-r--r--boost/xpressive/detail/core/adaptor.hpp2
-rw-r--r--boost/xpressive/detail/static/type_traits.hpp55
-rw-r--r--boost/xpressive/detail/static/width_of.hpp19
-rw-r--r--boost/xpressive/regex_actions.hpp67
-rw-r--r--boost/xpressive/sub_match.hpp7
-rw-r--r--boost/xpressive/traits/cpp_regex_traits.hpp16
-rw-r--r--boost/xpressive/traits/detail/c_ctype.hpp12
-rw-r--r--boost/xpressive/xpressive_fwd.hpp2
1703 files changed, 59341 insertions, 35491 deletions
diff --git a/boost/accumulators/framework/accumulators/droppable_accumulator.hpp b/boost/accumulators/framework/accumulators/droppable_accumulator.hpp
index c0f512ffda..1beed664a3 100644
--- a/boost/accumulators/framework/accumulators/droppable_accumulator.hpp
+++ b/boost/accumulators/framework/accumulators/droppable_accumulator.hpp
@@ -115,6 +115,12 @@ namespace boost { namespace accumulators
{
}
+ droppable_accumulator_base(droppable_accumulator_base const &that)
+ : Accumulator(*static_cast<Accumulator const *>(&that))
+ , ref_count_(that.ref_count_)
+ {
+ }
+
template<typename Args>
void operator ()(Args const &args)
{
@@ -162,6 +168,11 @@ namespace boost { namespace accumulators
: droppable_accumulator::base(args)
{
}
+
+ droppable_accumulator(droppable_accumulator const &that)
+ : droppable_accumulator::base(*static_cast<typename droppable_accumulator::base const *>(&that))
+ {
+ }
};
//////////////////////////////////////////////////////////////////////////
diff --git a/boost/accumulators/statistics.hpp b/boost/accumulators/statistics.hpp
index 1d136e58eb..01786079a8 100644
--- a/boost/accumulators/statistics.hpp
+++ b/boost/accumulators/statistics.hpp
@@ -25,7 +25,7 @@
#include <boost/accumulators/statistics/peaks_over_threshold.hpp>
#include <boost/accumulators/statistics/pot_tail_mean.hpp>
#include <boost/accumulators/statistics/pot_quantile.hpp>
-#include <boost/accumulators/statistics/p_square_cumulative_distribution.hpp>
+#include <boost/accumulators/statistics/p_square_cumul_dist.hpp>
#include <boost/accumulators/statistics/p_square_quantile.hpp>
#include <boost/accumulators/statistics/skewness.hpp>
#include <boost/accumulators/statistics/stats.hpp>
@@ -45,7 +45,7 @@
#include <boost/accumulators/statistics/weighted_median.hpp>
#include <boost/accumulators/statistics/weighted_moment.hpp>
#include <boost/accumulators/statistics/weighted_peaks_over_threshold.hpp>
-#include <boost/accumulators/statistics/weighted_p_square_cumulative_distribution.hpp>
+#include <boost/accumulators/statistics/weighted_p_square_cumul_dist.hpp>
#include <boost/accumulators/statistics/weighted_p_square_quantile.hpp>
#include <boost/accumulators/statistics/weighted_skewness.hpp>
#include <boost/accumulators/statistics/weighted_sum.hpp>
diff --git a/boost/accumulators/statistics/extended_p_square_quantile.hpp b/boost/accumulators/statistics/extended_p_square_quantile.hpp
index b6c008d712..09ffef2963 100644
--- a/boost/accumulators/statistics/extended_p_square_quantile.hpp
+++ b/boost/accumulators/statistics/extended_p_square_quantile.hpp
@@ -10,6 +10,7 @@
#include <vector>
#include <functional>
+#include <boost/throw_exception.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/iterator_range.hpp>
diff --git a/boost/accumulators/statistics/median.hpp b/boost/accumulators/statistics/median.hpp
index 13ebb28621..919cf69e4f 100644
--- a/boost/accumulators/statistics/median.hpp
+++ b/boost/accumulators/statistics/median.hpp
@@ -19,7 +19,7 @@
#include <boost/accumulators/statistics/count.hpp>
#include <boost/accumulators/statistics/p_square_quantile.hpp>
#include <boost/accumulators/statistics/density.hpp>
-#include <boost/accumulators/statistics/p_square_cumulative_distribution.hpp>
+#include <boost/accumulators/statistics/p_square_cumul_dist.hpp>
namespace boost { namespace accumulators
{
diff --git a/boost/accumulators/statistics/p_square_cumul_dist.hpp b/boost/accumulators/statistics/p_square_cumul_dist.hpp
new file mode 100644
index 0000000000..b9e24f676c
--- /dev/null
+++ b/boost/accumulators/statistics/p_square_cumul_dist.hpp
@@ -0,0 +1,260 @@
+///////////////////////////////////////////////////////////////////////////////
+// p_square_cumulative_distribution.hpp
+//
+// Copyright 2005 Daniel Egloff, Olivier Gygi. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_ACCUMULATORS_STATISTICS_P_SQUARE_CUMUL_DIST_HPP_DE_01_01_2006
+#define BOOST_ACCUMULATORS_STATISTICS_P_SQUARE_CUMUL_DIST_HPP_DE_01_01_2006
+
+#include <vector>
+#include <functional>
+#include <boost/parameter/keyword.hpp>
+#include <boost/range.hpp>
+#include <boost/mpl/placeholders.hpp>
+#include <boost/accumulators/framework/accumulator_base.hpp>
+#include <boost/accumulators/framework/extractor.hpp>
+#include <boost/accumulators/numeric/functional.hpp>
+#include <boost/accumulators/framework/parameters/sample.hpp>
+#include <boost/accumulators/statistics_fwd.hpp>
+#include <boost/accumulators/statistics/count.hpp>
+
+namespace boost { namespace accumulators
+{
+///////////////////////////////////////////////////////////////////////////////
+// num_cells named parameter
+//
+BOOST_PARAMETER_NESTED_KEYWORD(tag, p_square_cumulative_distribution_num_cells, num_cells)
+
+namespace impl
+{
+ ///////////////////////////////////////////////////////////////////////////////
+ // p_square_cumulative_distribution_impl
+ // cumulative_distribution calculation (as histogram)
+ /**
+ @brief Histogram calculation of the cumulative distribution with the \f$P^2\f$ algorithm
+
+ A histogram of the sample cumulative distribution is computed dynamically without storing samples
+ based on the \f$ P^2 \f$ algorithm. The returned histogram has a specifiable amount (num_cells)
+ equiprobable (and not equal-sized) cells.
+
+ For further details, see
+
+ R. Jain and I. Chlamtac, The P^2 algorithmus for dynamic calculation of quantiles and
+ histograms without storing observations, Communications of the ACM,
+ Volume 28 (October), Number 10, 1985, p. 1076-1085.
+
+ @param p_square_cumulative_distribution_num_cells.
+ */
+ template<typename Sample>
+ struct p_square_cumulative_distribution_impl
+ : accumulator_base
+ {
+ typedef typename numeric::functional::average<Sample, std::size_t>::result_type float_type;
+ typedef std::vector<float_type> array_type;
+ typedef std::vector<std::pair<float_type, float_type> > histogram_type;
+ // for boost::result_of
+ typedef iterator_range<typename histogram_type::iterator> result_type;
+
+ template<typename Args>
+ p_square_cumulative_distribution_impl(Args const &args)
+ : num_cells(args[p_square_cumulative_distribution_num_cells])
+ , heights(num_cells + 1)
+ , actual_positions(num_cells + 1)
+ , desired_positions(num_cells + 1)
+ , positions_increments(num_cells + 1)
+ , histogram(num_cells + 1)
+ , is_dirty(true)
+ {
+ std::size_t b = this->num_cells;
+
+ for (std::size_t i = 0; i < b + 1; ++i)
+ {
+ this->actual_positions[i] = i + 1.;
+ this->desired_positions[i] = i + 1.;
+ this->positions_increments[i] = numeric::average(i, b);
+ }
+ }
+
+ template<typename Args>
+ void operator ()(Args const &args)
+ {
+ this->is_dirty = true;
+
+ std::size_t cnt = count(args);
+ std::size_t sample_cell = 1; // k
+ std::size_t b = this->num_cells;
+
+ // accumulate num_cells + 1 first samples
+ if (cnt <= b + 1)
+ {
+ this->heights[cnt - 1] = args[sample];
+
+ // complete the initialization of heights by sorting
+ if (cnt == b + 1)
+ {
+ std::sort(this->heights.begin(), this->heights.end());
+ }
+ }
+ else
+ {
+ // find cell k such that heights[k-1] <= args[sample] < heights[k] and adjust extreme values
+ if (args[sample] < this->heights[0])
+ {
+ this->heights[0] = args[sample];
+ sample_cell = 1;
+ }
+ else if (this->heights[b] <= args[sample])
+ {
+ this->heights[b] = args[sample];
+ sample_cell = b;
+ }
+ else
+ {
+ typename array_type::iterator it;
+ it = std::upper_bound(
+ this->heights.begin()
+ , this->heights.end()
+ , args[sample]
+ );
+
+ sample_cell = std::distance(this->heights.begin(), it);
+ }
+
+ // increment positions of markers above sample_cell
+ for (std::size_t i = sample_cell; i < b + 1; ++i)
+ {
+ ++this->actual_positions[i];
+ }
+
+ // update desired position of markers 2 to num_cells + 1
+ // (desired position of first marker is always 1)
+ for (std::size_t i = 1; i < b + 1; ++i)
+ {
+ this->desired_positions[i] += this->positions_increments[i];
+ }
+
+ // adjust heights of markers 2 to num_cells if necessary
+ for (std::size_t i = 1; i < b; ++i)
+ {
+ // offset to desire position
+ float_type d = this->desired_positions[i] - this->actual_positions[i];
+
+ // offset to next position
+ float_type dp = this->actual_positions[i + 1] - this->actual_positions[i];
+
+ // offset to previous position
+ float_type dm = this->actual_positions[i - 1] - this->actual_positions[i];
+
+ // height ds
+ float_type hp = (this->heights[i + 1] - this->heights[i]) / dp;
+ float_type hm = (this->heights[i - 1] - this->heights[i]) / dm;
+
+ if ( ( d >= 1. && dp > 1. ) || ( d <= -1. && dm < -1. ) )
+ {
+ short sign_d = static_cast<short>(d / std::abs(d));
+
+ // try adjusting heights[i] using p-squared formula
+ float_type h = this->heights[i] + sign_d / (dp - dm) * ( (sign_d - dm) * hp + (dp - sign_d) * hm );
+
+ if ( this->heights[i - 1] < h && h < this->heights[i + 1] )
+ {
+ this->heights[i] = h;
+ }
+ else
+ {
+ // use linear formula
+ if (d>0)
+ {
+ this->heights[i] += hp;
+ }
+ if (d<0)
+ {
+ this->heights[i] -= hm;
+ }
+ }
+ this->actual_positions[i] += sign_d;
+ }
+ }
+ }
+ }
+
+ template<typename Args>
+ result_type result(Args const &args) const
+ {
+ if (this->is_dirty)
+ {
+ this->is_dirty = false;
+
+ // creates a vector of std::pair where each pair i holds
+ // the values heights[i] (x-axis of histogram) and
+ // actual_positions[i] / cnt (y-axis of histogram)
+
+ std::size_t cnt = count(args);
+
+ for (std::size_t i = 0; i < this->histogram.size(); ++i)
+ {
+ this->histogram[i] = std::make_pair(this->heights[i], numeric::average(this->actual_positions[i], cnt));
+ }
+ }
+ //return histogram;
+ return make_iterator_range(this->histogram);
+ }
+
+ private:
+ std::size_t num_cells; // number of cells b
+ array_type heights; // q_i
+ array_type actual_positions; // n_i
+ array_type desired_positions; // n'_i
+ array_type positions_increments; // dn'_i
+ mutable histogram_type histogram; // histogram
+ mutable bool is_dirty;
+ };
+
+} // namespace detail
+
+///////////////////////////////////////////////////////////////////////////////
+// tag::p_square_cumulative_distribution
+//
+namespace tag
+{
+ struct p_square_cumulative_distribution
+ : depends_on<count>
+ , p_square_cumulative_distribution_num_cells
+ {
+ /// INTERNAL ONLY
+ ///
+ typedef accumulators::impl::p_square_cumulative_distribution_impl<mpl::_1> impl;
+ };
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// extract::p_square_cumulative_distribution
+//
+namespace extract
+{
+ extractor<tag::p_square_cumulative_distribution> const p_square_cumulative_distribution = {};
+
+ BOOST_ACCUMULATORS_IGNORE_GLOBAL(p_square_cumulative_distribution)
+}
+
+using extract::p_square_cumulative_distribution;
+
+// So that p_square_cumulative_distribution can be automatically substituted with
+// weighted_p_square_cumulative_distribution when the weight parameter is non-void
+template<>
+struct as_weighted_feature<tag::p_square_cumulative_distribution>
+{
+ typedef tag::weighted_p_square_cumulative_distribution type;
+};
+
+template<>
+struct feature_of<tag::weighted_p_square_cumulative_distribution>
+ : feature_of<tag::p_square_cumulative_distribution>
+{
+};
+
+}} // namespace boost::accumulators
+
+#endif
diff --git a/boost/accumulators/statistics/p_square_cumulative_distribution.hpp b/boost/accumulators/statistics/p_square_cumulative_distribution.hpp
index 437469c65b..5e08b51293 100644
--- a/boost/accumulators/statistics/p_square_cumulative_distribution.hpp
+++ b/boost/accumulators/statistics/p_square_cumulative_distribution.hpp
@@ -1,260 +1,19 @@
///////////////////////////////////////////////////////////////////////////////
// p_square_cumulative_distribution.hpp
//
-// Copyright 2005 Daniel Egloff, Olivier Gygi. Distributed under the Boost
+// Copyright 2012 Eric Niebler. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-#ifndef BOOST_ACCUMULATORS_STATISTICS_P_SQUARE_CUMULATIVE_DISTRIBUTION_HPP_DE_01_01_2006
-#define BOOST_ACCUMULATORS_STATISTICS_P_SQUARE_CUMULATIVE_DISTRIBUTION_HPP_DE_01_01_2006
+#ifndef BOOST_ACCUMULATORS_STATISTICS_P_SQUARE_CUMULATIVE_DISTRIBUTION_HPP_03_19_2012
+#define BOOST_ACCUMULATORS_STATISTICS_P_SQUARE_CUMULATIVE_DISTRIBUTION_HPP_03_19_2012
-#include <vector>
-#include <functional>
-#include <boost/parameter/keyword.hpp>
-#include <boost/range.hpp>
-#include <boost/mpl/placeholders.hpp>
-#include <boost/accumulators/framework/accumulator_base.hpp>
-#include <boost/accumulators/framework/extractor.hpp>
-#include <boost/accumulators/numeric/functional.hpp>
-#include <boost/accumulators/framework/parameters/sample.hpp>
-#include <boost/accumulators/statistics_fwd.hpp>
-#include <boost/accumulators/statistics/count.hpp>
-
-namespace boost { namespace accumulators
-{
-///////////////////////////////////////////////////////////////////////////////
-// num_cells named parameter
-//
-BOOST_PARAMETER_NESTED_KEYWORD(tag, p_square_cumulative_distribution_num_cells, num_cells)
-
-namespace impl
-{
- ///////////////////////////////////////////////////////////////////////////////
- // p_square_cumulative_distribution_impl
- // cumulative_distribution calculation (as histogram)
- /**
- @brief Histogram calculation of the cumulative distribution with the \f$P^2\f$ algorithm
-
- A histogram of the sample cumulative distribution is computed dynamically without storing samples
- based on the \f$ P^2 \f$ algorithm. The returned histogram has a specifiable amount (num_cells)
- equiprobable (and not equal-sized) cells.
-
- For further details, see
-
- R. Jain and I. Chlamtac, The P^2 algorithmus for dynamic calculation of quantiles and
- histograms without storing observations, Communications of the ACM,
- Volume 28 (October), Number 10, 1985, p. 1076-1085.
-
- @param p_square_cumulative_distribution_num_cells.
- */
- template<typename Sample>
- struct p_square_cumulative_distribution_impl
- : accumulator_base
- {
- typedef typename numeric::functional::average<Sample, std::size_t>::result_type float_type;
- typedef std::vector<float_type> array_type;
- typedef std::vector<std::pair<float_type, float_type> > histogram_type;
- // for boost::result_of
- typedef iterator_range<typename histogram_type::iterator> result_type;
-
- template<typename Args>
- p_square_cumulative_distribution_impl(Args const &args)
- : num_cells(args[p_square_cumulative_distribution_num_cells])
- , heights(num_cells + 1)
- , actual_positions(num_cells + 1)
- , desired_positions(num_cells + 1)
- , positions_increments(num_cells + 1)
- , histogram(num_cells + 1)
- , is_dirty(true)
- {
- std::size_t b = this->num_cells;
-
- for (std::size_t i = 0; i < b + 1; ++i)
- {
- this->actual_positions[i] = i + 1.;
- this->desired_positions[i] = i + 1.;
- this->positions_increments[i] = numeric::average(i, b);
- }
- }
-
- template<typename Args>
- void operator ()(Args const &args)
- {
- this->is_dirty = true;
-
- std::size_t cnt = count(args);
- std::size_t sample_cell = 1; // k
- std::size_t b = this->num_cells;
-
- // accumulate num_cells + 1 first samples
- if (cnt <= b + 1)
- {
- this->heights[cnt - 1] = args[sample];
-
- // complete the initialization of heights by sorting
- if (cnt == b + 1)
- {
- std::sort(this->heights.begin(), this->heights.end());
- }
- }
- else
- {
- // find cell k such that heights[k-1] <= args[sample] < heights[k] and adjust extreme values
- if (args[sample] < this->heights[0])
- {
- this->heights[0] = args[sample];
- sample_cell = 1;
- }
- else if (this->heights[b] <= args[sample])
- {
- this->heights[b] = args[sample];
- sample_cell = b;
- }
- else
- {
- typename array_type::iterator it;
- it = std::upper_bound(
- this->heights.begin()
- , this->heights.end()
- , args[sample]
- );
-
- sample_cell = std::distance(this->heights.begin(), it);
- }
-
- // increment positions of markers above sample_cell
- for (std::size_t i = sample_cell; i < b + 1; ++i)
- {
- ++this->actual_positions[i];
- }
-
- // update desired position of markers 2 to num_cells + 1
- // (desired position of first marker is always 1)
- for (std::size_t i = 1; i < b + 1; ++i)
- {
- this->desired_positions[i] += this->positions_increments[i];
- }
-
- // adjust heights of markers 2 to num_cells if necessary
- for (std::size_t i = 1; i < b; ++i)
- {
- // offset to desire position
- float_type d = this->desired_positions[i] - this->actual_positions[i];
-
- // offset to next position
- float_type dp = this->actual_positions[i + 1] - this->actual_positions[i];
-
- // offset to previous position
- float_type dm = this->actual_positions[i - 1] - this->actual_positions[i];
-
- // height ds
- float_type hp = (this->heights[i + 1] - this->heights[i]) / dp;
- float_type hm = (this->heights[i - 1] - this->heights[i]) / dm;
-
- if ( ( d >= 1. && dp > 1. ) || ( d <= -1. && dm < -1. ) )
- {
- short sign_d = static_cast<short>(d / std::abs(d));
-
- // try adjusting heights[i] using p-squared formula
- float_type h = this->heights[i] + sign_d / (dp - dm) * ( (sign_d - dm) * hp + (dp - sign_d) * hm );
-
- if ( this->heights[i - 1] < h && h < this->heights[i + 1] )
- {
- this->heights[i] = h;
- }
- else
- {
- // use linear formula
- if (d>0)
- {
- this->heights[i] += hp;
- }
- if (d<0)
- {
- this->heights[i] -= hm;
- }
- }
- this->actual_positions[i] += sign_d;
- }
- }
- }
- }
-
- template<typename Args>
- result_type result(Args const &args) const
- {
- if (this->is_dirty)
- {
- this->is_dirty = false;
-
- // creates a vector of std::pair where each pair i holds
- // the values heights[i] (x-axis of histogram) and
- // actual_positions[i] / cnt (y-axis of histogram)
-
- std::size_t cnt = count(args);
-
- for (std::size_t i = 0; i < this->histogram.size(); ++i)
- {
- this->histogram[i] = std::make_pair(this->heights[i], numeric::average(this->actual_positions[i], cnt));
- }
- }
- //return histogram;
- return make_iterator_range(this->histogram);
- }
-
- private:
- std::size_t num_cells; // number of cells b
- array_type heights; // q_i
- array_type actual_positions; // n_i
- array_type desired_positions; // n'_i
- array_type positions_increments; // dn'_i
- mutable histogram_type histogram; // histogram
- mutable bool is_dirty;
- };
-
-} // namespace detail
-
-///////////////////////////////////////////////////////////////////////////////
-// tag::p_square_cumulative_distribution
-//
-namespace tag
-{
- struct p_square_cumulative_distribution
- : depends_on<count>
- , p_square_cumulative_distribution_num_cells
- {
- /// INTERNAL ONLY
- ///
- typedef accumulators::impl::p_square_cumulative_distribution_impl<mpl::_1> impl;
- };
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// extract::p_square_cumulative_distribution
-//
-namespace extract
-{
- extractor<tag::p_square_cumulative_distribution> const p_square_cumulative_distribution = {};
-
- BOOST_ACCUMULATORS_IGNORE_GLOBAL(p_square_cumulative_distribution)
-}
-
-using extract::p_square_cumulative_distribution;
-
-// So that p_square_cumulative_distribution can be automatically substituted with
-// weighted_p_square_cumulative_distribution when the weight parameter is non-void
-template<>
-struct as_weighted_feature<tag::p_square_cumulative_distribution>
-{
- typedef tag::weighted_p_square_cumulative_distribution type;
-};
-
-template<>
-struct feature_of<tag::weighted_p_square_cumulative_distribution>
- : feature_of<tag::p_square_cumulative_distribution>
-{
-};
+#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
+# pragma message ("Warning: This header is deprecated. Please use: boost/accumulators/statistics/p_square_cumul_dist.hpp")
+#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
+# warning "This header is deprecated. Please use: boost/accumulators/statistics/p_square_cumul_dist.hpp"
+#endif
-}} // namespace boost::accumulators
+#include <boost/accumulators/statistics/p_square_cumul_dist.hpp>
#endif
diff --git a/boost/accumulators/statistics/weighted_median.hpp b/boost/accumulators/statistics/weighted_median.hpp
index 46880c88d1..b8b94f9f9f 100644
--- a/boost/accumulators/statistics/weighted_median.hpp
+++ b/boost/accumulators/statistics/weighted_median.hpp
@@ -20,7 +20,7 @@
#include <boost/accumulators/statistics/median.hpp>
#include <boost/accumulators/statistics/weighted_p_square_quantile.hpp>
#include <boost/accumulators/statistics/weighted_density.hpp>
-#include <boost/accumulators/statistics/weighted_p_square_cumulative_distribution.hpp>
+#include <boost/accumulators/statistics/weighted_p_square_cumul_dist.hpp>
namespace boost { namespace accumulators
{
diff --git a/boost/accumulators/statistics/weighted_p_square_cumul_dist.hpp b/boost/accumulators/statistics/weighted_p_square_cumul_dist.hpp
new file mode 100644
index 0000000000..832e231414
--- /dev/null
+++ b/boost/accumulators/statistics/weighted_p_square_cumul_dist.hpp
@@ -0,0 +1,262 @@
+///////////////////////////////////////////////////////////////////////////////
+// weighted_p_square_cumul_dist.hpp
+//
+// Copyright 2006 Daniel Egloff, Olivier Gygi. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_ACCUMULATORS_STATISTICS_WEIGHTED_P_SQUARE_CUMUL_DIST_HPP_DE_01_01_2006
+#define BOOST_ACCUMULATORS_STATISTICS_WEIGHTED_P_SQUARE_CUMUL_DIST_HPP_DE_01_01_2006
+
+#include <vector>
+#include <functional>
+#include <boost/parameter/keyword.hpp>
+#include <boost/mpl/placeholders.hpp>
+#include <boost/range.hpp>
+#include <boost/accumulators/framework/accumulator_base.hpp>
+#include <boost/accumulators/framework/extractor.hpp>
+#include <boost/accumulators/numeric/functional.hpp>
+#include <boost/accumulators/framework/parameters/sample.hpp>
+#include <boost/accumulators/statistics_fwd.hpp>
+#include <boost/accumulators/statistics/count.hpp>
+#include <boost/accumulators/statistics/sum.hpp>
+#include <boost/accumulators/statistics/p_square_cumul_dist.hpp> // for named parameter p_square_cumulative_distribution_num_cells
+
+namespace boost { namespace accumulators
+{
+
+namespace impl
+{
+ ///////////////////////////////////////////////////////////////////////////////
+ // weighted_p_square_cumulative_distribution_impl
+ // cumulative distribution calculation (as histogram)
+ /**
+ @brief Histogram calculation of the cumulative distribution with the \f$P^2\f$ algorithm for weighted samples
+
+ A histogram of the sample cumulative distribution is computed dynamically without storing samples
+ based on the \f$ P^2 \f$ algorithm for weighted samples. The returned histogram has a specifiable
+ amount (num_cells) equiprobable (and not equal-sized) cells.
+
+ Note that applying importance sampling results in regions to be more and other regions to be less
+ accurately estimated than without importance sampling, i.e., with unweighted samples.
+
+ For further details, see
+
+ R. Jain and I. Chlamtac, The P^2 algorithmus for dynamic calculation of quantiles and
+ histograms without storing observations, Communications of the ACM,
+ Volume 28 (October), Number 10, 1985, p. 1076-1085.
+
+ @param p_square_cumulative_distribution_num_cells
+ */
+ template<typename Sample, typename Weight>
+ struct weighted_p_square_cumulative_distribution_impl
+ : accumulator_base
+ {
+ typedef typename numeric::functional::multiplies<Sample, Weight>::result_type weighted_sample;
+ typedef typename numeric::functional::average<weighted_sample, std::size_t>::result_type float_type;
+ typedef std::vector<std::pair<float_type, float_type> > histogram_type;
+ typedef std::vector<float_type> array_type;
+ // for boost::result_of
+ typedef iterator_range<typename histogram_type::iterator> result_type;
+
+ template<typename Args>
+ weighted_p_square_cumulative_distribution_impl(Args const &args)
+ : num_cells(args[p_square_cumulative_distribution_num_cells])
+ , heights(num_cells + 1)
+ , actual_positions(num_cells + 1)
+ , desired_positions(num_cells + 1)
+ , histogram(num_cells + 1)
+ , is_dirty(true)
+ {
+ }
+
+ template<typename Args>
+ void operator ()(Args const &args)
+ {
+ this->is_dirty = true;
+
+ std::size_t cnt = count(args);
+ std::size_t sample_cell = 1; // k
+ std::size_t b = this->num_cells;
+
+ // accumulate num_cells + 1 first samples
+ if (cnt <= b + 1)
+ {
+ this->heights[cnt - 1] = args[sample];
+ this->actual_positions[cnt - 1] = args[weight];
+
+ // complete the initialization of heights by sorting
+ if (cnt == b + 1)
+ {
+ //std::sort(this->heights.begin(), this->heights.end());
+
+ // TODO: we need to sort the initial samples (in heights) in ascending order and
+ // sort their weights (in actual_positions) the same way. The following lines do
+ // it, but there must be a better and more efficient way of doing this.
+ typename array_type::iterator it_begin, it_end, it_min;
+
+ it_begin = this->heights.begin();
+ it_end = this->heights.end();
+
+ std::size_t pos = 0;
+
+ while (it_begin != it_end)
+ {
+ it_min = std::min_element(it_begin, it_end);
+ std::size_t d = std::distance(it_begin, it_min);
+ std::swap(*it_begin, *it_min);
+ std::swap(this->actual_positions[pos], this->actual_positions[pos + d]);
+ ++it_begin;
+ ++pos;
+ }
+
+ // calculate correct initial actual positions
+ for (std::size_t i = 1; i < b; ++i)
+ {
+ this->actual_positions[i] += this->actual_positions[i - 1];
+ }
+ }
+ }
+ else
+ {
+ // find cell k such that heights[k-1] <= args[sample] < heights[k] and adjust extreme values
+ if (args[sample] < this->heights[0])
+ {
+ this->heights[0] = args[sample];
+ this->actual_positions[0] = args[weight];
+ sample_cell = 1;
+ }
+ else if (this->heights[b] <= args[sample])
+ {
+ this->heights[b] = args[sample];
+ sample_cell = b;
+ }
+ else
+ {
+ typename array_type::iterator it;
+ it = std::upper_bound(
+ this->heights.begin()
+ , this->heights.end()
+ , args[sample]
+ );
+
+ sample_cell = std::distance(this->heights.begin(), it);
+ }
+
+ // increment positions of markers above sample_cell
+ for (std::size_t i = sample_cell; i < b + 1; ++i)
+ {
+ this->actual_positions[i] += args[weight];
+ }
+
+ // determine desired marker positions
+ for (std::size_t i = 1; i < b + 1; ++i)
+ {
+ this->desired_positions[i] = this->actual_positions[0]
+ + numeric::average((i-1) * (sum_of_weights(args) - this->actual_positions[0]), b);
+ }
+
+ // adjust heights of markers 2 to num_cells if necessary
+ for (std::size_t i = 1; i < b; ++i)
+ {
+ // offset to desire position
+ float_type d = this->desired_positions[i] - this->actual_positions[i];
+
+ // offset to next position
+ float_type dp = this->actual_positions[i + 1] - this->actual_positions[i];
+
+ // offset to previous position
+ float_type dm = this->actual_positions[i - 1] - this->actual_positions[i];
+
+ // height ds
+ float_type hp = (this->heights[i + 1] - this->heights[i]) / dp;
+ float_type hm = (this->heights[i - 1] - this->heights[i]) / dm;
+
+ if ( ( d >= 1. && dp > 1. ) || ( d <= -1. && dm < -1. ) )
+ {
+ short sign_d = static_cast<short>(d / std::abs(d));
+
+ // try adjusting heights[i] using p-squared formula
+ float_type h = this->heights[i] + sign_d / (dp - dm) * ( (sign_d - dm) * hp + (dp - sign_d) * hm );
+
+ if ( this->heights[i - 1] < h && h < this->heights[i + 1] )
+ {
+ this->heights[i] = h;
+ }
+ else
+ {
+ // use linear formula
+ if (d>0)
+ {
+ this->heights[i] += hp;
+ }
+ if (d<0)
+ {
+ this->heights[i] -= hm;
+ }
+ }
+ this->actual_positions[i] += sign_d;
+ }
+ }
+ }
+ }
+
+ template<typename Args>
+ result_type result(Args const &args) const
+ {
+ if (this->is_dirty)
+ {
+ this->is_dirty = false;
+
+ // creates a vector of std::pair where each pair i holds
+ // the values heights[i] (x-axis of histogram) and
+ // actual_positions[i] / sum_of_weights (y-axis of histogram)
+
+ for (std::size_t i = 0; i < this->histogram.size(); ++i)
+ {
+ this->histogram[i] = std::make_pair(this->heights[i], numeric::average(this->actual_positions[i], sum_of_weights(args)));
+ }
+ }
+
+ return make_iterator_range(this->histogram);
+ }
+
+ private:
+ std::size_t num_cells; // number of cells b
+ array_type heights; // q_i
+ array_type actual_positions; // n_i
+ array_type desired_positions; // n'_i
+ mutable histogram_type histogram; // histogram
+ mutable bool is_dirty;
+ };
+
+} // namespace detail
+
+///////////////////////////////////////////////////////////////////////////////
+// tag::weighted_p_square_cumulative_distribution
+//
+namespace tag
+{
+ struct weighted_p_square_cumulative_distribution
+ : depends_on<count, sum_of_weights>
+ , p_square_cumulative_distribution_num_cells
+ {
+ typedef accumulators::impl::weighted_p_square_cumulative_distribution_impl<mpl::_1, mpl::_2> impl;
+ };
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// extract::weighted_p_square_cumulative_distribution
+//
+namespace extract
+{
+ extractor<tag::weighted_p_square_cumulative_distribution> const weighted_p_square_cumulative_distribution = {};
+
+ BOOST_ACCUMULATORS_IGNORE_GLOBAL(weighted_p_square_cumulative_distribution)
+}
+
+using extract::weighted_p_square_cumulative_distribution;
+
+}} // namespace boost::accumulators
+
+#endif
diff --git a/boost/accumulators/statistics/weighted_p_square_cumulative_distribution.hpp b/boost/accumulators/statistics/weighted_p_square_cumulative_distribution.hpp
index 290f090fe5..918970e8dc 100644
--- a/boost/accumulators/statistics/weighted_p_square_cumulative_distribution.hpp
+++ b/boost/accumulators/statistics/weighted_p_square_cumulative_distribution.hpp
@@ -1,262 +1,19 @@
///////////////////////////////////////////////////////////////////////////////
// weighted_p_square_cumulative_distribution.hpp
//
-// Copyright 2006 Daniel Egloff, Olivier Gygi. Distributed under the Boost
+// Copyright 2012 Eric Niebler. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-#ifndef BOOST_ACCUMULATORS_STATISTICS_WEIGHTED_P_SQUARE_CUMULATIVE_DISTRIBUTION_HPP_DE_01_01_2006
-#define BOOST_ACCUMULATORS_STATISTICS_WEIGHTED_P_SQUARE_CUMULATIVE_DISTRIBUTION_HPP_DE_01_01_2006
+#ifndef BOOST_ACCUMULATORS_STATISTICS_WEIGHTED_P_SQUARE_CUMULATIVE_DISTRIBUTION_HPP_03_19_2012
+#define BOOST_ACCUMULATORS_STATISTICS_WEIGHTED_P_SQUARE_CUMULATIVE_DISTRIBUTION_HPP_03_19_2012
-#include <vector>
-#include <functional>
-#include <boost/parameter/keyword.hpp>
-#include <boost/mpl/placeholders.hpp>
-#include <boost/range.hpp>
-#include <boost/accumulators/framework/accumulator_base.hpp>
-#include <boost/accumulators/framework/extractor.hpp>
-#include <boost/accumulators/numeric/functional.hpp>
-#include <boost/accumulators/framework/parameters/sample.hpp>
-#include <boost/accumulators/statistics_fwd.hpp>
-#include <boost/accumulators/statistics/count.hpp>
-#include <boost/accumulators/statistics/sum.hpp>
-#include <boost/accumulators/statistics/p_square_cumulative_distribution.hpp> // for named parameter p_square_cumulative_distribution_num_cells
-
-namespace boost { namespace accumulators
-{
-
-namespace impl
-{
- ///////////////////////////////////////////////////////////////////////////////
- // weighted_p_square_cumulative_distribution_impl
- // cumulative distribution calculation (as histogram)
- /**
- @brief Histogram calculation of the cumulative distribution with the \f$P^2\f$ algorithm for weighted samples
-
- A histogram of the sample cumulative distribution is computed dynamically without storing samples
- based on the \f$ P^2 \f$ algorithm for weighted samples. The returned histogram has a specifiable
- amount (num_cells) equiprobable (and not equal-sized) cells.
-
- Note that applying importance sampling results in regions to be more and other regions to be less
- accurately estimated than without importance sampling, i.e., with unweighted samples.
-
- For further details, see
-
- R. Jain and I. Chlamtac, The P^2 algorithmus for dynamic calculation of quantiles and
- histograms without storing observations, Communications of the ACM,
- Volume 28 (October), Number 10, 1985, p. 1076-1085.
-
- @param p_square_cumulative_distribution_num_cells
- */
- template<typename Sample, typename Weight>
- struct weighted_p_square_cumulative_distribution_impl
- : accumulator_base
- {
- typedef typename numeric::functional::multiplies<Sample, Weight>::result_type weighted_sample;
- typedef typename numeric::functional::average<weighted_sample, std::size_t>::result_type float_type;
- typedef std::vector<std::pair<float_type, float_type> > histogram_type;
- typedef std::vector<float_type> array_type;
- // for boost::result_of
- typedef iterator_range<typename histogram_type::iterator> result_type;
-
- template<typename Args>
- weighted_p_square_cumulative_distribution_impl(Args const &args)
- : num_cells(args[p_square_cumulative_distribution_num_cells])
- , heights(num_cells + 1)
- , actual_positions(num_cells + 1)
- , desired_positions(num_cells + 1)
- , histogram(num_cells + 1)
- , is_dirty(true)
- {
- }
-
- template<typename Args>
- void operator ()(Args const &args)
- {
- this->is_dirty = true;
-
- std::size_t cnt = count(args);
- std::size_t sample_cell = 1; // k
- std::size_t b = this->num_cells;
-
- // accumulate num_cells + 1 first samples
- if (cnt <= b + 1)
- {
- this->heights[cnt - 1] = args[sample];
- this->actual_positions[cnt - 1] = args[weight];
-
- // complete the initialization of heights by sorting
- if (cnt == b + 1)
- {
- //std::sort(this->heights.begin(), this->heights.end());
-
- // TODO: we need to sort the initial samples (in heights) in ascending order and
- // sort their weights (in actual_positions) the same way. The following lines do
- // it, but there must be a better and more efficient way of doing this.
- typename array_type::iterator it_begin, it_end, it_min;
-
- it_begin = this->heights.begin();
- it_end = this->heights.end();
-
- std::size_t pos = 0;
-
- while (it_begin != it_end)
- {
- it_min = std::min_element(it_begin, it_end);
- std::size_t d = std::distance(it_begin, it_min);
- std::swap(*it_begin, *it_min);
- std::swap(this->actual_positions[pos], this->actual_positions[pos + d]);
- ++it_begin;
- ++pos;
- }
-
- // calculate correct initial actual positions
- for (std::size_t i = 1; i < b; ++i)
- {
- this->actual_positions[i] += this->actual_positions[i - 1];
- }
- }
- }
- else
- {
- // find cell k such that heights[k-1] <= args[sample] < heights[k] and adjust extreme values
- if (args[sample] < this->heights[0])
- {
- this->heights[0] = args[sample];
- this->actual_positions[0] = args[weight];
- sample_cell = 1;
- }
- else if (this->heights[b] <= args[sample])
- {
- this->heights[b] = args[sample];
- sample_cell = b;
- }
- else
- {
- typename array_type::iterator it;
- it = std::upper_bound(
- this->heights.begin()
- , this->heights.end()
- , args[sample]
- );
-
- sample_cell = std::distance(this->heights.begin(), it);
- }
-
- // increment positions of markers above sample_cell
- for (std::size_t i = sample_cell; i < b + 1; ++i)
- {
- this->actual_positions[i] += args[weight];
- }
-
- // determine desired marker positions
- for (std::size_t i = 1; i < b + 1; ++i)
- {
- this->desired_positions[i] = this->actual_positions[0]
- + numeric::average((i-1) * (sum_of_weights(args) - this->actual_positions[0]), b);
- }
-
- // adjust heights of markers 2 to num_cells if necessary
- for (std::size_t i = 1; i < b; ++i)
- {
- // offset to desire position
- float_type d = this->desired_positions[i] - this->actual_positions[i];
-
- // offset to next position
- float_type dp = this->actual_positions[i + 1] - this->actual_positions[i];
-
- // offset to previous position
- float_type dm = this->actual_positions[i - 1] - this->actual_positions[i];
-
- // height ds
- float_type hp = (this->heights[i + 1] - this->heights[i]) / dp;
- float_type hm = (this->heights[i - 1] - this->heights[i]) / dm;
-
- if ( ( d >= 1. && dp > 1. ) || ( d <= -1. && dm < -1. ) )
- {
- short sign_d = static_cast<short>(d / std::abs(d));
-
- // try adjusting heights[i] using p-squared formula
- float_type h = this->heights[i] + sign_d / (dp - dm) * ( (sign_d - dm) * hp + (dp - sign_d) * hm );
-
- if ( this->heights[i - 1] < h && h < this->heights[i + 1] )
- {
- this->heights[i] = h;
- }
- else
- {
- // use linear formula
- if (d>0)
- {
- this->heights[i] += hp;
- }
- if (d<0)
- {
- this->heights[i] -= hm;
- }
- }
- this->actual_positions[i] += sign_d;
- }
- }
- }
- }
-
- template<typename Args>
- result_type result(Args const &args) const
- {
- if (this->is_dirty)
- {
- this->is_dirty = false;
-
- // creates a vector of std::pair where each pair i holds
- // the values heights[i] (x-axis of histogram) and
- // actual_positions[i] / sum_of_weights (y-axis of histogram)
-
- for (std::size_t i = 0; i < this->histogram.size(); ++i)
- {
- this->histogram[i] = std::make_pair(this->heights[i], numeric::average(this->actual_positions[i], sum_of_weights(args)));
- }
- }
-
- return make_iterator_range(this->histogram);
- }
-
- private:
- std::size_t num_cells; // number of cells b
- array_type heights; // q_i
- array_type actual_positions; // n_i
- array_type desired_positions; // n'_i
- mutable histogram_type histogram; // histogram
- mutable bool is_dirty;
- };
-
-} // namespace detail
-
-///////////////////////////////////////////////////////////////////////////////
-// tag::weighted_p_square_cumulative_distribution
-//
-namespace tag
-{
- struct weighted_p_square_cumulative_distribution
- : depends_on<count, sum_of_weights>
- , p_square_cumulative_distribution_num_cells
- {
- typedef accumulators::impl::weighted_p_square_cumulative_distribution_impl<mpl::_1, mpl::_2> impl;
- };
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// extract::weighted_p_square_cumulative_distribution
-//
-namespace extract
-{
- extractor<tag::weighted_p_square_cumulative_distribution> const weighted_p_square_cumulative_distribution = {};
-
- BOOST_ACCUMULATORS_IGNORE_GLOBAL(weighted_p_square_cumulative_distribution)
-}
-
-using extract::weighted_p_square_cumulative_distribution;
+#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
+# pragma message ("Warning: This header is deprecated. Please use: boost/accumulators/statistics/weighted_p_square_cumul_dist.hpp")
+#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
+# warning "This header is deprecated. Please use: boost/accumulators/statistics/weighted_p_square_cumul_dist.hpp"
+#endif
-}} // namespace boost::accumulators
+#include <boost/accumulators/statistics/weighted_p_square_cumul_dist.hpp>
#endif
diff --git a/boost/accumulators/statistics/weighted_peaks_over_threshold.hpp b/boost/accumulators/statistics/weighted_peaks_over_threshold.hpp
index 6d3017b3ec..8ee2c56005 100644
--- a/boost/accumulators/statistics/weighted_peaks_over_threshold.hpp
+++ b/boost/accumulators/statistics/weighted_peaks_over_threshold.hpp
@@ -12,6 +12,7 @@
#include <limits>
#include <numeric>
#include <functional>
+#include <boost/throw_exception.hpp>
#include <boost/range.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/placeholders.hpp>
diff --git a/boost/algorithm/clamp.hpp b/boost/algorithm/clamp.hpp
new file mode 100644
index 0000000000..ae98d15d2f
--- /dev/null
+++ b/boost/algorithm/clamp.hpp
@@ -0,0 +1,175 @@
+/*
+ Copyright (c) Marshall Clow 2008-2012.
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+ Revision history:
+ 27 June 2009 mtc First version
+ 23 Oct 2010 mtc Added predicate version
+
+*/
+
+/// \file clamp.hpp
+/// \brief Clamp algorithm
+/// \author Marshall Clow
+///
+/// Suggested by olafvdspek in https://svn.boost.org/trac/boost/ticket/3215
+
+#ifndef BOOST_ALGORITHM_CLAMP_HPP
+#define BOOST_ALGORITHM_CLAMP_HPP
+
+#include <functional> // For std::less
+#include <iterator> // For std::iterator_traits
+#include <cassert>
+
+#include <boost/range/begin.hpp>
+#include <boost/range/end.hpp>
+#include <boost/mpl/identity.hpp> // for identity
+#include <boost/utility/enable_if.hpp> // for boost::disable_if
+
+namespace boost { namespace algorithm {
+
+/// \fn clamp ( T const& val,
+/// typename boost::mpl::identity<T>::type const& lo,
+/// typename boost::mpl::identity<T>::type const& hi, Pred p )
+/// \return the value "val" brought into the range [ lo, hi ]
+/// using the comparison predicate p.
+/// If p ( val, lo ) return lo.
+/// If p ( hi, val ) return hi.
+/// Otherwise, return the original value.
+///
+/// \param val The value to be clamped
+/// \param lo The lower bound of the range to be clamped to
+/// \param hi The upper bound of the range to be clamped to
+/// \param p A predicate to use to compare the values.
+/// p ( a, b ) returns a boolean.
+///
+ template<typename T, typename Pred>
+ T const & clamp ( T const& val,
+ typename boost::mpl::identity<T>::type const & lo,
+ typename boost::mpl::identity<T>::type const & hi, Pred p )
+ {
+// assert ( !p ( hi, lo )); // Can't assert p ( lo, hi ) b/c they might be equal
+ return p ( val, lo ) ? lo : p ( hi, val ) ? hi : val;
+ }
+
+
+/// \fn clamp ( T const& val,
+/// typename boost::mpl::identity<T>::type const& lo,
+/// typename boost::mpl::identity<T>::type const& hi )
+/// \return the value "val" brought into the range [ lo, hi ].
+/// If the value is less than lo, return lo.
+/// If the value is greater than "hi", return hi.
+/// Otherwise, return the original value.
+///
+/// \param val The value to be clamped
+/// \param lo The lower bound of the range to be clamped to
+/// \param hi The upper bound of the range to be clamped to
+///
+ template<typename T>
+ T const& clamp ( const T& val,
+ typename boost::mpl::identity<T>::type const & lo,
+ typename boost::mpl::identity<T>::type const & hi )
+ {
+ return (clamp) ( val, lo, hi, std::less<T>());
+ }
+
+/// \fn clamp_range ( InputIterator first, InputIterator last, OutputIterator out,
+/// std::iterator_traits<InputIterator>::value_type lo,
+/// std::iterator_traits<InputIterator>::value_type hi )
+/// \return clamp the sequence of values [first, last) into [ lo, hi ]
+///
+/// \param first The start of the range of values
+/// \param last One past the end of the range of input values
+/// \param out An output iterator to write the clamped values into
+/// \param lo The lower bound of the range to be clamped to
+/// \param hi The upper bound of the range to be clamped to
+///
+ template<typename InputIterator, typename OutputIterator>
+ OutputIterator clamp_range ( InputIterator first, InputIterator last, OutputIterator out,
+ typename std::iterator_traits<InputIterator>::value_type lo,
+ typename std::iterator_traits<InputIterator>::value_type hi )
+ {
+ // this could also be written with bind and std::transform
+ while ( first != last )
+ *out++ = clamp ( *first++, lo, hi );
+ return out;
+ }
+
+/// \fn clamp_range ( const Range &r, OutputIterator out,
+/// typename std::iterator_traits<typename boost::range_iterator<const Range>::type>::value_type lo,
+/// typename std::iterator_traits<typename boost::range_iterator<const Range>::type>::value_type hi )
+/// \return clamp the sequence of values [first, last) into [ lo, hi ]
+///
+/// \param r The range of values to be clamped
+/// \param out An output iterator to write the clamped values into
+/// \param lo The lower bound of the range to be clamped to
+/// \param hi The upper bound of the range to be clamped to
+///
+ template<typename Range, typename OutputIterator>
+ typename boost::disable_if_c<boost::is_same<Range, OutputIterator>::value, OutputIterator>::type
+ clamp_range ( const Range &r, OutputIterator out,
+ typename std::iterator_traits<typename boost::range_iterator<const Range>::type>::value_type lo,
+ typename std::iterator_traits<typename boost::range_iterator<const Range>::type>::value_type hi )
+ {
+ return clamp_range ( boost::begin ( r ), boost::end ( r ), out, lo, hi );
+ }
+
+
+/// \fn clamp_range ( InputIterator first, InputIterator last, OutputIterator out,
+/// std::iterator_traits<InputIterator>::value_type lo,
+/// std::iterator_traits<InputIterator>::value_type hi, Pred p )
+/// \return clamp the sequence of values [first, last) into [ lo, hi ]
+/// using the comparison predicate p.
+///
+/// \param first The start of the range of values
+/// \param last One past the end of the range of input values
+/// \param out An output iterator to write the clamped values into
+/// \param lo The lower bound of the range to be clamped to
+/// \param hi The upper bound of the range to be clamped to
+/// \param p A predicate to use to compare the values.
+/// p ( a, b ) returns a boolean.
+
+///
+ template<typename InputIterator, typename OutputIterator, typename Pred>
+ OutputIterator clamp_range ( InputIterator first, InputIterator last, OutputIterator out,
+ typename std::iterator_traits<InputIterator>::value_type lo,
+ typename std::iterator_traits<InputIterator>::value_type hi, Pred p )
+ {
+ // this could also be written with bind and std::transform
+ while ( first != last )
+ *out++ = clamp ( *first++, lo, hi, p );
+ return out;
+ }
+
+/// \fn clamp_range ( const Range &r, OutputIterator out,
+/// typename std::iterator_traits<typename boost::range_iterator<const Range>::type>::value_type lo,
+/// typename std::iterator_traits<typename boost::range_iterator<const Range>::type>::value_type hi,
+/// Pred p )
+/// \return clamp the sequence of values [first, last) into [ lo, hi ]
+/// using the comparison predicate p.
+///
+/// \param r The range of values to be clamped
+/// \param out An output iterator to write the clamped values into
+/// \param lo The lower bound of the range to be clamped to
+/// \param hi The upper bound of the range to be clamped to
+/// \param p A predicate to use to compare the values.
+/// p ( a, b ) returns a boolean.
+//
+// Disable this template if the first two parameters are the same type;
+// In that case, the user will get the two iterator version.
+ template<typename Range, typename OutputIterator, typename Pred>
+ typename boost::disable_if_c<boost::is_same<Range, OutputIterator>::value, OutputIterator>::type
+ clamp_range ( const Range &r, OutputIterator out,
+ typename std::iterator_traits<typename boost::range_iterator<const Range>::type>::value_type lo,
+ typename std::iterator_traits<typename boost::range_iterator<const Range>::type>::value_type hi,
+ Pred p )
+ {
+ return clamp_range ( boost::begin ( r ), boost::end ( r ), out, lo, hi, p );
+ }
+
+
+}}
+
+#endif // BOOST_ALGORITHM_CLAMP_HPP
diff --git a/boost/algorithm/cxx11/all_of.hpp b/boost/algorithm/cxx11/all_of.hpp
new file mode 100644
index 0000000000..b76cb3f010
--- /dev/null
+++ b/boost/algorithm/cxx11/all_of.hpp
@@ -0,0 +1,91 @@
+/*
+ Copyright (c) Marshall Clow 2008-2012.
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+/// \file all_of.hpp
+/// \brief Test ranges to see if all elements match a value or predicate.
+/// \author Marshall Clow
+
+#ifndef BOOST_ALGORITHM_ALL_OF_HPP
+#define BOOST_ALGORITHM_ALL_OF_HPP
+
+#include <algorithm> // for std::all_of, if available
+#include <boost/range/begin.hpp>
+#include <boost/range/end.hpp>
+
+namespace boost { namespace algorithm {
+
+#if __cplusplus >= 201103L
+// Use the C++11 versions of all_of if it is available
+using std::all_of; // Section 25.2.1
+#else
+/// \fn all_of ( InputIterator first, InputIterator last, Predicate p )
+/// \return true if all elements in [first, last) satisfy the predicate 'p'
+/// \note returns true on an empty range
+///
+/// \param first The start of the input sequence
+/// \param last One past the end of the input sequence
+/// \param p A predicate for testing the elements of the sequence
+///
+/// \note This function is part of the C++2011 standard library.
+/// We will use the standard one if it is available,
+/// otherwise we have our own implementation.
+template<typename InputIterator, typename Predicate>
+bool all_of ( InputIterator first, InputIterator last, Predicate p )
+{
+ for ( ; first != last; ++first )
+ if ( !p(*first))
+ return false;
+ return true;
+}
+#endif
+
+/// \fn all_of ( const Range &r, Predicate p )
+/// \return true if all elements in the range satisfy the predicate 'p'
+/// \note returns true on an empty range
+///
+/// \param r The input range
+/// \param p A predicate for testing the elements of the range
+///
+template<typename Range, typename Predicate>
+bool all_of ( const Range &r, Predicate p )
+{
+ return boost::algorithm::all_of ( boost::begin (r), boost::end (r), p );
+}
+
+/// \fn all_of_equal ( InputIterator first, InputIterator last, const T &val )
+/// \return true if all elements in [first, last) are equal to 'val'
+/// \note returns true on an empty range
+///
+/// \param first The start of the input sequence
+/// \param last One past the end of the input sequence
+/// \param val A value to compare against
+///
+template<typename InputIterator, typename T>
+bool all_of_equal ( InputIterator first, InputIterator last, const T &val )
+{
+ for ( ; first != last; ++first )
+ if ( val != *first )
+ return false;
+ return true;
+}
+
+/// \fn all_of_equal ( const Range &r, const T &val )
+/// \return true if all elements in the range are equal to 'val'
+/// \note returns true on an empty range
+///
+/// \param r The input range
+/// \param val A value to compare against
+///
+template<typename Range, typename T>
+bool all_of_equal ( const Range &r, const T &val )
+{
+ return boost::algorithm::all_of_equal ( boost::begin (r), boost::end (r), val );
+}
+
+}} // namespace boost and algorithm
+
+#endif // BOOST_ALGORITHM_ALL_OF_HPP
diff --git a/boost/algorithm/cxx11/any_of.hpp b/boost/algorithm/cxx11/any_of.hpp
new file mode 100644
index 0000000000..c3ab3ce59f
--- /dev/null
+++ b/boost/algorithm/cxx11/any_of.hpp
@@ -0,0 +1,90 @@
+/*
+ Copyright (c) Marshall Clow 2008-2012.
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+ For more information, see http://www.boost.org
+*/
+
+/// \file
+/// \brief Test ranges to see if any elements match a value or predicate.
+/// \author Marshall Clow
+
+#ifndef BOOST_ALGORITHM_ANY_OF_HPP
+#define BOOST_ALGORITHM_ANY_OF_HPP
+
+#include <algorithm> // for std::any_of, if available
+#include <boost/range/begin.hpp>
+#include <boost/range/end.hpp>
+
+namespace boost { namespace algorithm {
+
+// Use the C++11 versions of any_of if it is available
+#if __cplusplus >= 201103L
+using std::any_of; // Section 25.2.2
+#else
+/// \fn any_of ( InputIterator first, InputIterator last, Predicate p )
+/// \return true if any of the elements in [first, last) satisfy the predicate
+/// \note returns false on an empty range
+///
+/// \param first The start of the input sequence
+/// \param last One past the end of the input sequence
+/// \param p A predicate for testing the elements of the sequence
+///
+template<typename InputIterator, typename Predicate>
+bool any_of ( InputIterator first, InputIterator last, Predicate p )
+{
+ for ( ; first != last; ++first )
+ if ( p(*first))
+ return true;
+ return false;
+}
+#endif
+
+/// \fn any_of ( const Range &r, Predicate p )
+/// \return true if any elements in the range satisfy the predicate 'p'
+/// \note returns false on an empty range
+///
+/// \param r The input range
+/// \param p A predicate for testing the elements of the range
+///
+template<typename Range, typename Predicate>
+bool any_of ( const Range &r, Predicate p )
+{
+ return boost::algorithm::any_of (boost::begin (r), boost::end (r), p);
+}
+
+/// \fn any_of_equal ( InputIterator first, InputIterator last, const V &val )
+/// \return true if any of the elements in [first, last) are equal to 'val'
+/// \note returns false on an empty range
+///
+/// \param first The start of the input sequence
+/// \param last One past the end of the input sequence
+/// \param val A value to compare against
+///
+template<typename InputIterator, typename V>
+bool any_of_equal ( InputIterator first, InputIterator last, const V &val )
+{
+ for ( ; first != last; ++first )
+ if ( val == *first )
+ return true;
+ return false;
+}
+
+/// \fn any_of_equal ( const Range &r, const V &val )
+/// \return true if any of the elements in the range are equal to 'val'
+/// \note returns false on an empty range
+///
+/// \param r The input range
+/// \param val A value to compare against
+///
+template<typename Range, typename V>
+bool any_of_equal ( const Range &r, const V &val )
+{
+ return boost::algorithm::any_of_equal (boost::begin (r), boost::end (r), val);
+}
+
+}} // namespace boost and algorithm
+
+#endif // BOOST_ALGORITHM_ANY_OF_HPP
diff --git a/boost/algorithm/cxx11/copy_if.hpp b/boost/algorithm/cxx11/copy_if.hpp
new file mode 100644
index 0000000000..6d0ba00bae
--- /dev/null
+++ b/boost/algorithm/cxx11/copy_if.hpp
@@ -0,0 +1,133 @@
+/*
+ Copyright (c) Marshall Clow 2008-2012.
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+/// \file copy_if.hpp
+/// \brief Copy a subset of a sequence to a new sequence
+/// \author Marshall Clow
+
+#ifndef BOOST_ALGORITHM_COPY_IF_HPP
+#define BOOST_ALGORITHM_COPY_IF_HPP
+
+#include <algorithm> // for std::copy_if, if available
+#include <boost/range/begin.hpp>
+#include <boost/range/end.hpp>
+
+namespace boost { namespace algorithm {
+
+#if __cplusplus >= 201103L
+// Use the C++11 versions of copy_if if it is available
+using std::copy_if; // Section 25.3.1
+#else
+/// \fn copy_if ( InputIterator first, InputIterator last, OutputIterator result, Predicate p )
+/// \brief Copies all the elements from the input range that satisfy the
+/// predicate to the output range.
+/// \return The updated output iterator
+///
+/// \param first The start of the input sequence
+/// \param last One past the end of the input sequence
+/// \param result An output iterator to write the results into
+/// \param p A predicate for testing the elements of the range
+/// \note This function is part of the C++2011 standard library.
+/// We will use the standard one if it is available,
+/// otherwise we have our own implementation.
+template<typename InputIterator, typename OutputIterator, typename Predicate>
+OutputIterator copy_if ( InputIterator first, InputIterator last, OutputIterator result, Predicate p )
+{
+ for ( ; first != last; ++first )
+ if (p(*first))
+ *result++ = first;
+ return result;
+}
+#endif
+
+/// \fn copy_if ( const Range &r, OutputIterator result, Predicate p )
+/// \brief Copies all the elements from the input range that satisfy the
+/// predicate to the output range.
+/// \return The updated output iterator
+///
+/// \param r The input range
+/// \param result An output iterator to write the results into
+/// \param p A predicate for testing the elements of the range
+///
+template<typename Range, typename OutputIterator, typename Predicate>
+OutputIterator copy_if ( const Range &r, OutputIterator result, Predicate p )
+{
+ return boost::algorithm::copy_if (boost::begin (r), boost::end(r), result, p);
+}
+
+
+/// \fn copy_while ( InputIterator first, InputIterator last, OutputIterator result, Predicate p )
+/// \brief Copies all the elements at the start of the input range that
+/// satisfy the predicate to the output range.
+/// \return The updated output iterator
+///
+/// \param first The start of the input sequence
+/// \param last One past the end of the input sequence
+/// \param result An output iterator to write the results into
+/// \param p A predicate for testing the elements of the range
+///
+template<typename InputIterator, typename OutputIterator, typename Predicate>
+OutputIterator copy_while ( InputIterator first, InputIterator last,
+ OutputIterator result, Predicate p )
+{
+ for ( ; first != last && p(*first); ++first )
+ *result++ = first;
+ return result;
+}
+
+/// \fn copy_while ( const Range &r, OutputIterator result, Predicate p )
+/// \brief Copies all the elements at the start of the input range that
+/// satisfy the predicate to the output range.
+/// \return The updated output iterator
+///
+/// \param r The input range
+/// \param result An output iterator to write the results into
+/// \param p A predicate for testing the elements of the range
+///
+template<typename Range, typename OutputIterator, typename Predicate>
+OutputIterator copy_while ( const Range &r, OutputIterator result, Predicate p )
+{
+ return boost::algorithm::copy_while (boost::begin (r), boost::end(r), result, p);
+}
+
+
+/// \fn copy_until ( InputIterator first, InputIterator last, OutputIterator result, Predicate p )
+/// \brief Copies all the elements at the start of the input range that do not
+/// satisfy the predicate to the output range.
+/// \return The updated output iterator
+///
+/// \param first The start of the input sequence
+/// \param last One past the end of the input sequence
+/// \param result An output iterator to write the results into
+/// \param p A predicate for testing the elements of the range
+///
+template<typename InputIterator, typename OutputIterator, typename Predicate>
+OutputIterator copy_until ( InputIterator first, InputIterator last, OutputIterator result, Predicate p )
+{
+ for ( ; first != last && !p(*first); ++first )
+ *result++ = first;
+ return result;
+}
+
+/// \fn copy_until ( const Range &r, OutputIterator result, Predicate p )
+/// \brief Copies all the elements at the start of the input range that do not
+/// satisfy the predicate to the output range.
+/// \return The updated output iterator
+///
+/// \param r The input range
+/// \param result An output iterator to write the results into
+/// \param p A predicate for testing the elements of the range
+///
+template<typename Range, typename OutputIterator, typename Predicate>
+OutputIterator copy_until ( const Range &r, OutputIterator result, Predicate p )
+{
+ return boost::algorithm::copy_until (boost::begin (r), boost::end(r), result, p);
+}
+
+}} // namespace boost and algorithm
+
+#endif // BOOST_ALGORITHM_COPY_IF_HPP
diff --git a/boost/algorithm/cxx11/copy_n.hpp b/boost/algorithm/cxx11/copy_n.hpp
new file mode 100644
index 0000000000..0ea53bd23f
--- /dev/null
+++ b/boost/algorithm/cxx11/copy_n.hpp
@@ -0,0 +1,44 @@
+/*
+ Copyright (c) Marshall Clow 2011-2012.
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+/// \file copy_n.hpp
+/// \brief Copy n items from one sequence to another
+/// \author Marshall Clow
+
+#ifndef BOOST_ALGORITHM_COPY_N_HPP
+#define BOOST_ALGORITHM_COPY_N_HPP
+
+#include <algorithm> // for std::copy_n, if available
+
+namespace boost { namespace algorithm {
+
+#if __cplusplus >= 201103L
+// Use the C++11 versions of copy_n if it is available
+using std::copy_n; // Section 25.3.1
+#else
+/// \fn copy_n ( InputIterator first, Size n, OutputIterator result )
+/// \brief Copies exactly n (n > 0) elements from the range starting at first to
+/// the range starting at result.
+/// \return The updated output iterator
+///
+/// \param first The start of the input sequence
+/// \param n The number of elements to copy
+/// \param result An output iterator to write the results into
+/// \note This function is part of the C++2011 standard library.
+/// We will use the standard one if it is available,
+/// otherwise we have our own implementation.
+template <typename InputIterator, typename Size, typename OutputIterator>
+OutputIterator copy_n ( InputIterator first, Size n, OutputIterator result )
+{
+ for ( ; n > 0; --n, ++first, ++result )
+ *result = *first;
+ return result;
+}
+#endif
+}} // namespace boost and algorithm
+
+#endif // BOOST_ALGORITHM_COPY_IF_HPP
diff --git a/boost/algorithm/cxx11/find_if_not.hpp b/boost/algorithm/cxx11/find_if_not.hpp
new file mode 100644
index 0000000000..4beed00083
--- /dev/null
+++ b/boost/algorithm/cxx11/find_if_not.hpp
@@ -0,0 +1,60 @@
+/*
+ Copyright (c) Marshall Clow 2011-2012.
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+/// \file find_if_not.hpp
+/// \brief Find the first element in a sequence that does not satisfy a predicate.
+/// \author Marshall Clow
+
+#ifndef BOOST_ALGORITHM_FIND_IF_NOT_HPP
+#define BOOST_ALGORITHM_FIND_IF_NOT_HPP
+
+#include <algorithm> // for std::find_if_not, if it exists
+
+#include <boost/range/begin.hpp>
+#include <boost/range/end.hpp>
+
+namespace boost { namespace algorithm {
+
+#if __cplusplus >= 201103L
+// Use the C++11 versions of find_if_not if it is available
+using std::find_if_not; // Section 25.2.5
+#else
+/// \fn find_if_not(InputIterator first, InputIterator last, Predicate p)
+/// \brief Finds the first element in the sequence that does not satisfy the predicate.
+/// \return The iterator pointing to the desired element.
+///
+/// \param first The start of the input sequence
+/// \param last One past the end of the input sequence
+/// \param p A predicate for testing the elements of the range
+/// \note This function is part of the C++2011 standard library.
+/// We will use the standard one if it is available,
+/// otherwise we have our own implementation.
+template<typename InputIterator, typename Predicate>
+InputIterator find_if_not ( InputIterator first, InputIterator last, Predicate p )
+{
+ for ( ; first != last; ++first )
+ if ( !p(*first))
+ break;
+ return first;
+}
+#endif
+
+/// \fn find_if_not ( const Range &r, Predicate p )
+/// \brief Finds the first element in the sequence that does not satisfy the predicate.
+/// \return The iterator pointing to the desired element.
+///
+/// \param r The input range
+/// \param p A predicate for testing the elements of the range
+///
+template<typename Range, typename Predicate>
+typename boost::range_iterator<const Range>::type find_if_not ( const Range &r, Predicate p )
+{
+ return boost::algorithm::find_if_not (boost::begin (r), boost::end(r), p);
+}
+
+}}
+#endif // BOOST_ALGORITHM_FIND_IF_NOT_HPP
diff --git a/boost/algorithm/cxx11/iota.hpp b/boost/algorithm/cxx11/iota.hpp
new file mode 100644
index 0000000000..b4f0dafa6d
--- /dev/null
+++ b/boost/algorithm/cxx11/iota.hpp
@@ -0,0 +1,74 @@
+/*
+ Copyright (c) Marshall Clow 2008-2012.
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+/// \file iota.hpp
+/// \brief Generate an increasing series
+/// \author Marshall Clow
+
+#ifndef BOOST_ALGORITHM_IOTA_HPP
+#define BOOST_ALGORITHM_IOTA_HPP
+
+#include <numeric>
+
+#include <boost/range/begin.hpp>
+#include <boost/range/end.hpp>
+
+namespace boost { namespace algorithm {
+
+#if __cplusplus >= 201103L
+// Use the C++11 versions of iota if it is available
+using std::iota; // Section 26.7.6
+#else
+/// \fn iota ( ForwardIterator first, ForwardIterator last, T value )
+/// \brief Generates an increasing sequence of values, and stores them in [first, last)
+///
+/// \param first The start of the input sequence
+/// \param last One past the end of the input sequence
+/// \param value The initial value of the sequence to be generated
+/// \note This function is part of the C++2011 standard library.
+/// We will use the standard one if it is available,
+/// otherwise we have our own implementation.
+template <typename ForwardIterator, typename T>
+void iota ( ForwardIterator first, ForwardIterator last, T value )
+{
+ for ( ; first != last; ++first, ++value )
+ *first = value;
+}
+#endif
+
+/// \fn iota ( Range &r, T value )
+/// \brief Generates an increasing sequence of values, and stores them in the input Range.
+///
+/// \param r The input range
+/// \param value The initial value of the sequence to be generated
+///
+template <typename Range, typename T>
+void iota ( Range &r, T value )
+{
+ boost::algorithm::iota (boost::begin(r), boost::end(r), value);
+}
+
+
+/// \fn iota_n ( OutputIterator out, T value, std::size_t n )
+/// \brief Generates an increasing sequence of values, and stores them in the input Range.
+///
+/// \param out An output iterator to write the results into
+/// \param value The initial value of the sequence to be generated
+/// \param n The number of items to write
+///
+template <typename OutputIterator, typename T>
+OutputIterator iota_n ( OutputIterator out, T value, std::size_t n )
+{
+ while ( n-- > 0 )
+ *out++ = value++;
+
+ return out;
+}
+
+}}
+
+#endif // BOOST_ALGORITHM_IOTA_HPP
diff --git a/boost/algorithm/cxx11/is_partitioned.hpp b/boost/algorithm/cxx11/is_partitioned.hpp
new file mode 100644
index 0000000000..d647183a8a
--- /dev/null
+++ b/boost/algorithm/cxx11/is_partitioned.hpp
@@ -0,0 +1,65 @@
+/*
+ Copyright (c) Marshall Clow 2011-2012.
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+/// \file is_partitioned.hpp
+/// \brief Tell if a sequence is partitioned
+/// \author Marshall Clow
+
+#ifndef BOOST_ALGORITHM_IS_PARTITIONED_HPP
+#define BOOST_ALGORITHM_IS_PARTITIONED_HPP
+
+#include <algorithm> // for std::is_partitioned, if available
+
+#include <boost/range/begin.hpp>
+#include <boost/range/end.hpp>
+
+namespace boost { namespace algorithm {
+
+#if __cplusplus >= 201103L
+// Use the C++11 versions of is_partitioned if it is available
+using std::is_partitioned; // Section 25.3.13
+#else
+/// \fn is_partitioned ( InputIterator first, InputIterator last, UnaryPredicate p )
+/// \brief Tests to see if a sequence is partititioned according to a predicate
+///
+/// \param first The start of the input sequence
+/// \param last One past the end of the input sequence
+/// \param p The predicicate to test the values with
+/// \note This function is part of the C++2011 standard library.
+/// We will use the standard one if it is available,
+/// otherwise we have our own implementation.
+template <typename InputIterator, typename UnaryPredicate>
+bool is_partitioned ( InputIterator first, InputIterator last, UnaryPredicate p )
+{
+// Run through the part that satisfy the predicate
+ for ( ; first != last; ++first )
+ if ( !p (*first))
+ break;
+// Now the part that does not satisfy the predicate
+ for ( ; first != last; ++first )
+ if ( p (*first))
+ return false;
+ return true;
+}
+#endif
+
+/// \fn is_partitioned ( const Range &r, UnaryPredicate p )
+/// \brief Generates an increasing sequence of values, and stores them in the input Range.
+///
+/// \param r The input range
+/// \param p The predicicate to test the values with
+///
+template <typename Range, typename UnaryPredicate>
+bool is_partitioned ( const Range &r, UnaryPredicate p )
+{
+ return boost::algorithm::is_partitioned (boost::begin(r), boost::end(r), p);
+}
+
+
+}}
+
+#endif // BOOST_ALGORITHM_IS_PARTITIONED_HPP
diff --git a/boost/algorithm/cxx11/is_permutation.hpp b/boost/algorithm/cxx11/is_permutation.hpp
new file mode 100644
index 0000000000..33cb712378
--- /dev/null
+++ b/boost/algorithm/cxx11/is_permutation.hpp
@@ -0,0 +1,139 @@
+/*
+ Copyright (c) Marshall Clow 2011-2012.
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+/// \file is_permutation.hpp
+/// \brief Is a sequence a permutation of another sequence
+/// \author Marshall Clow
+
+#ifndef BOOST_ALGORITHM_IS_PERMUTATION_HPP
+#define BOOST_ALGORITHM_IS_PERMUTATION_HPP
+
+#include <algorithm> // for std::less, tie, mismatch and is_permutation (if available)
+#include <utility> // for std::make_pair
+#include <functional> // for std::equal_to
+#include <iterator>
+
+#include <boost/range/begin.hpp>
+#include <boost/range/end.hpp>
+#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/tr1/tr1/tuple> // for tie
+
+namespace boost { namespace algorithm {
+
+#if __cplusplus >= 201103L
+// Use the C++11 versions of is_permutation if it is available
+using std::is_permutation; // Section 25.2.12
+#else
+/// \cond DOXYGEN_HIDE
+namespace detail {
+ template <typename Predicate, typename Iterator>
+ struct value_predicate {
+ value_predicate ( Predicate p, Iterator it ) : p_ ( p ), it_ ( it ) {}
+
+ template <typename T1>
+ bool operator () ( const T1 &t1 ) const { return p_ ( *it_, t1 ); }
+ private:
+ Predicate &p_;
+ Iterator it_;
+ };
+}
+/// \endcond
+
+
+/// \fn is_permutation ( ForwardIterator1 first, ForwardIterator1 last, ForwardIterator2 first2, BinaryPredicate p )
+/// \brief Tests to see if a the sequence [first,last) is a permutation of the sequence starting at first2
+///
+/// \param first The start of the input sequence
+/// \param last One past the end of the input sequence
+/// \param first2 The start of the second sequence
+/// \param p The predicate to compare elements with
+///
+/// \note This function is part of the C++2011 standard library.
+/// We will use the standard one if it is available,
+/// otherwise we have our own implementation.
+template< class ForwardIterator1, class ForwardIterator2, class BinaryPredicate >
+bool is_permutation ( ForwardIterator1 first1, ForwardIterator1 last1,
+ ForwardIterator2 first2, BinaryPredicate p )
+{
+// Skip the common prefix (if any)
+// std::tie (first1, first2) = std::mismatch (first1, last1, first2, p);
+ std::pair<ForwardIterator1, ForwardIterator2> eq = std::mismatch (first1, last1, first2, p);
+ first1 = eq.first;
+ first2 = eq.second;
+ if ( first1 != last1 ) {
+ // Create last2
+ ForwardIterator2 last2 = first2;
+ std::advance ( last2, std::distance (first1, last1));
+
+ // for each unique value in the sequence [first1,last1), count how many times
+ // it occurs, and make sure it occurs the same number of times in [first2, last2)
+ for ( ForwardIterator1 iter = first1; iter != last1; ++iter ) {
+ detail::value_predicate<BinaryPredicate, ForwardIterator1> pred ( p, iter );
+
+ /* For each value we haven't seen yet... */
+ if ( std::find_if ( first1, iter, pred ) == iter ) {
+ std::size_t dest_count = std::count_if ( first2, last2, pred );
+ if ( dest_count == 0 || dest_count != (std::size_t) std::count_if ( iter, last1, pred ))
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
+
+/// \fn is_permutation ( ForwardIterator1 first, ForwardIterator1 last, ForwardIterator2 first2 )
+/// \brief Tests to see if a the sequence [first,last) is a permutation of the sequence starting at first2
+///
+/// \param first The start of the input sequence
+/// \param last One past the end of the input sequence
+/// \param first2 The start of the second sequence
+/// \note This function is part of the C++2011 standard library.
+/// We will use the standard one if it is available,
+/// otherwise we have our own implementation.
+template< class ForwardIterator1, class ForwardIterator2 >
+bool is_permutation ( ForwardIterator1 first, ForwardIterator1 last, ForwardIterator2 first2 )
+{
+// How should I deal with the idea that ForwardIterator1::value_type
+// and ForwardIterator2::value_type could be different? Define my own comparison predicate?
+ return boost::algorithm::is_permutation ( first, last, first2,
+ std::equal_to<typename std::iterator_traits<ForwardIterator1>::value_type> ());
+}
+
+#endif
+
+/// \fn is_permutation ( const Range &r, ForwardIterator first2 )
+/// \brief Tests to see if a the sequence [first,last) is a permutation of the sequence starting at first2
+///
+/// \param r The input range
+/// \param first2 The start of the second sequence
+template <typename Range, typename ForwardIterator>
+bool is_permutation ( const Range &r, ForwardIterator first2 )
+{
+ return boost::algorithm::is_permutation (boost::begin (r), boost::end (r), first2 );
+}
+
+/// \fn is_permutation ( const Range &r, ForwardIterator first2, BinaryPredicate pred )
+/// \brief Tests to see if a the sequence [first,last) is a permutation of the sequence starting at first2
+///
+/// \param r The input range
+/// \param first2 The start of the second sequence
+/// \param pred The predicate to compare elements with
+///
+// Disable this template when the first two parameters are the same type
+// That way the non-range version will be chosen.
+template <typename Range, typename ForwardIterator, typename BinaryPredicate>
+typename boost::disable_if_c<boost::is_same<Range, ForwardIterator>::value, bool>::type
+is_permutation ( const Range &r, ForwardIterator first2, BinaryPredicate pred )
+{
+ return boost::algorithm::is_permutation (boost::begin (r), boost::end (r), first2, pred );
+}
+
+}}
+
+#endif // BOOST_ALGORITHM_IS_PERMUTATION_HPP
diff --git a/boost/algorithm/cxx11/is_sorted.hpp b/boost/algorithm/cxx11/is_sorted.hpp
new file mode 100644
index 0000000000..c9bc65fbe9
--- /dev/null
+++ b/boost/algorithm/cxx11/is_sorted.hpp
@@ -0,0 +1,287 @@
+// Copyright (c) 2010 Nuovation System Designs, LLC
+// Grant Erickson <gerickson@nuovations.com>
+//
+// Reworked somewhat by Marshall Clow; August 2010
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/ for latest version.
+//
+
+#ifndef BOOST_ALGORITHM_ORDERED_HPP
+#define BOOST_ALGORITHM_ORDERED_HPP
+
+#include <algorithm>
+#include <functional>
+#include <iterator>
+
+#include <boost/range/begin.hpp>
+#include <boost/range/end.hpp>
+
+#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/mpl/identity.hpp>
+
+namespace boost { namespace algorithm {
+
+#if __cplusplus >= 201103L
+// Use the C++11 versions of is_sorted/is_sorted_until if they are available
+using std::is_sorted_until; // Section 25.4.1.5
+using std::is_sorted; // Section 25.4.1.5
+#else
+/// \fn is_sorted_until ( ForwardIterator first, ForwardIterator last, Pred p )
+/// \return the point in the sequence [first, last) where the elements are unordered
+/// (according to the comparison predicate 'p').
+///
+/// \param first The start of the sequence to be tested.
+/// \param last One past the end of the sequence
+/// \param p A binary predicate that returns true if two elements are ordered.
+///
+ template <typename ForwardIterator, typename Pred>
+ ForwardIterator is_sorted_until ( ForwardIterator first, ForwardIterator last, Pred p )
+ {
+ if ( first == last ) return last; // the empty sequence is ordered
+ ForwardIterator next = first;
+ while ( ++next != last )
+ {
+ if ( p ( *next, *first ))
+ return next;
+ first = next;
+ }
+ return last;
+ }
+
+/// \fn is_sorted_until ( ForwardIterator first, ForwardIterator last )
+/// \return the point in the sequence [first, last) where the elements are unordered
+///
+/// \param first The start of the sequence to be tested.
+/// \param last One past the end of the sequence
+///
+ template <typename ForwardIterator>
+ ForwardIterator is_sorted_until ( ForwardIterator first, ForwardIterator last )
+ {
+ typedef typename std::iterator_traits<ForwardIterator>::value_type value_type;
+ return boost::algorithm::is_sorted_until ( first, last, std::less<value_type>());
+ }
+
+
+/// \fn is_sorted ( ForwardIterator first, ForwardIterator last, Pred p )
+/// \return whether or not the entire sequence is sorted
+///
+/// \param first The start of the sequence to be tested.
+/// \param last One past the end of the sequence
+/// \param p A binary predicate that returns true if two elements are ordered.
+///
+ template <typename ForwardIterator, typename Pred>
+ bool is_sorted ( ForwardIterator first, ForwardIterator last, Pred p )
+ {
+ return boost::algorithm::is_sorted_until (first, last, p) == last;
+ }
+
+/// \fn is_sorted ( ForwardIterator first, ForwardIterator last )
+/// \return whether or not the entire sequence is sorted
+///
+/// \param first The start of the sequence to be tested.
+/// \param last One past the end of the sequence
+///
+ template <typename ForwardIterator>
+ bool is_sorted ( ForwardIterator first, ForwardIterator last )
+ {
+ return boost::algorithm::is_sorted_until (first, last) == last;
+ }
+#endif
+
+///
+/// -- Range based versions of the C++11 functions
+///
+
+/// \fn is_sorted_until ( const R &range, Pred p )
+/// \return the point in the range R where the elements are unordered
+/// (according to the comparison predicate 'p').
+///
+/// \param range The range to be tested.
+/// \param p A binary predicate that returns true if two elements are ordered.
+///
+ template <typename R, typename Pred>
+ typename boost::lazy_disable_if_c<
+ boost::is_same<R, Pred>::value,
+ typename boost::range_iterator<const R>
+ >::type is_sorted_until ( const R &range, Pred p )
+ {
+ return boost::algorithm::is_sorted_until ( boost::begin ( range ), boost::end ( range ), p );
+ }
+
+
+/// \fn is_sorted_until ( const R &range )
+/// \return the point in the range R where the elements are unordered
+///
+/// \param range The range to be tested.
+///
+ template <typename R>
+ typename boost::range_iterator<const R>::type is_sorted_until ( const R &range )
+ {
+ return boost::algorithm::is_sorted_until ( boost::begin ( range ), boost::end ( range ));
+ }
+
+/// \fn is_sorted ( const R &range, Pred p )
+/// \return whether or not the entire range R is sorted
+/// (according to the comparison predicate 'p').
+///
+/// \param range The range to be tested.
+/// \param p A binary predicate that returns true if two elements are ordered.
+///
+ template <typename R, typename Pred>
+ typename boost::lazy_disable_if_c< boost::is_same<R, Pred>::value, boost::mpl::identity<bool> >::type
+ is_sorted ( const R &range, Pred p )
+ {
+ return boost::algorithm::is_sorted ( boost::begin ( range ), boost::end ( range ), p );
+ }
+
+
+/// \fn is_sorted ( const R &range )
+/// \return whether or not the entire range R is sorted
+///
+/// \param range The range to be tested.
+///
+ template <typename R>
+ bool is_sorted ( const R &range )
+ {
+ return boost::algorithm::is_sorted ( boost::begin ( range ), boost::end ( range ));
+ }
+
+
+///
+/// -- Range based versions of the C++11 functions
+///
+
+/// \fn is_increasing ( ForwardIterator first, ForwardIterator last )
+/// \return true if the entire sequence is increasing; i.e, each item is greater than or
+/// equal to the previous one.
+///
+/// \param first The start of the sequence to be tested.
+/// \param last One past the end of the sequence
+///
+/// \note This function will return true for sequences that contain items that compare
+/// equal. If that is not what you intended, you should use is_strictly_increasing instead.
+ template <typename ForwardIterator>
+ bool is_increasing ( ForwardIterator first, ForwardIterator last )
+ {
+ typedef typename std::iterator_traits<ForwardIterator>::value_type value_type;
+ return boost::algorithm::is_sorted (first, last, std::less<value_type>());
+ }
+
+
+/// \fn is_increasing ( const R &range )
+/// \return true if the entire sequence is increasing; i.e, each item is greater than or
+/// equal to the previous one.
+///
+/// \param range The range to be tested.
+///
+/// \note This function will return true for sequences that contain items that compare
+/// equal. If that is not what you intended, you should use is_strictly_increasing instead.
+ template <typename R>
+ bool is_increasing ( const R &range )
+ {
+ return is_increasing ( boost::begin ( range ), boost::end ( range ));
+ }
+
+
+
+/// \fn is_decreasing ( ForwardIterator first, ForwardIterator last )
+/// \return true if the entire sequence is decreasing; i.e, each item is less than
+/// or equal to the previous one.
+///
+/// \param first The start of the sequence to be tested.
+/// \param last One past the end of the sequence
+///
+/// \note This function will return true for sequences that contain items that compare
+/// equal. If that is not what you intended, you should use is_strictly_decreasing instead.
+ template <typename ForwardIterator>
+ bool is_decreasing ( ForwardIterator first, ForwardIterator last )
+ {
+ typedef typename std::iterator_traits<ForwardIterator>::value_type value_type;
+ return boost::algorithm::is_sorted (first, last, std::greater<value_type>());
+ }
+
+/// \fn is_decreasing ( const R &range )
+/// \return true if the entire sequence is decreasing; i.e, each item is less than
+/// or equal to the previous one.
+///
+/// \param range The range to be tested.
+///
+/// \note This function will return true for sequences that contain items that compare
+/// equal. If that is not what you intended, you should use is_strictly_decreasing instead.
+ template <typename R>
+ bool is_decreasing ( const R &range )
+ {
+ return is_decreasing ( boost::begin ( range ), boost::end ( range ));
+ }
+
+
+
+/// \fn is_strictly_increasing ( ForwardIterator first, ForwardIterator last )
+/// \return true if the entire sequence is strictly increasing; i.e, each item is greater
+/// than the previous one
+///
+/// \param first The start of the sequence to be tested.
+/// \param last One past the end of the sequence
+///
+/// \note This function will return false for sequences that contain items that compare
+/// equal. If that is not what you intended, you should use is_increasing instead.
+ template <typename ForwardIterator>
+ bool is_strictly_increasing ( ForwardIterator first, ForwardIterator last )
+ {
+ typedef typename std::iterator_traits<ForwardIterator>::value_type value_type;
+ return boost::algorithm::is_sorted (first, last, std::less_equal<value_type>());
+ }
+
+/// \fn is_strictly_increasing ( const R &range )
+/// \return true if the entire sequence is strictly increasing; i.e, each item is greater
+/// than the previous one
+///
+/// \param range The range to be tested.
+///
+/// \note This function will return false for sequences that contain items that compare
+/// equal. If that is not what you intended, you should use is_increasing instead.
+ template <typename R>
+ bool is_strictly_increasing ( const R &range )
+ {
+ return is_strictly_increasing ( boost::begin ( range ), boost::end ( range ));
+ }
+
+
+/// \fn is_strictly_decreasing ( ForwardIterator first, ForwardIterator last )
+/// \return true if the entire sequence is strictly decreasing; i.e, each item is less than
+/// the previous one
+///
+/// \param first The start of the sequence to be tested.
+/// \param last One past the end of the sequence
+///
+/// \note This function will return false for sequences that contain items that compare
+/// equal. If that is not what you intended, you should use is_decreasing instead.
+ template <typename ForwardIterator>
+ bool is_strictly_decreasing ( ForwardIterator first, ForwardIterator last )
+ {
+ typedef typename std::iterator_traits<ForwardIterator>::value_type value_type;
+ return boost::algorithm::is_sorted (first, last, std::greater_equal<value_type>());
+ }
+
+/// \fn is_strictly_decreasing ( const R &range )
+/// \return true if the entire sequence is strictly decreasing; i.e, each item is less than
+/// the previous one
+///
+/// \param range The range to be tested.
+///
+/// \note This function will return false for sequences that contain items that compare
+/// equal. If that is not what you intended, you should use is_decreasing instead.
+ template <typename R>
+ bool is_strictly_decreasing ( const R &range )
+ {
+ return is_strictly_decreasing ( boost::begin ( range ), boost::end ( range ));
+ }
+
+}} // namespace boost
+
+#endif // BOOST_ALGORITHM_ORDERED_HPP
diff --git a/boost/algorithm/cxx11/none_of.hpp b/boost/algorithm/cxx11/none_of.hpp
new file mode 100644
index 0000000000..feae9919fc
--- /dev/null
+++ b/boost/algorithm/cxx11/none_of.hpp
@@ -0,0 +1,88 @@
+/*
+ Copyright (c) Marshall Clow 2008-2012.
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+/// \file none_of.hpp
+/// \brief Test ranges to see if no elements match a value or predicate.
+/// \author Marshall Clow
+
+#ifndef BOOST_ALGORITHM_NONE_OF_HPP
+#define BOOST_ALGORITHM_NONE_OF_HPP
+
+#include <algorithm> // for std::none_of, if available
+#include <boost/range/begin.hpp>
+#include <boost/range/end.hpp>
+
+namespace boost { namespace algorithm {
+
+// Use the C++11 versions of the none_of if it is available
+#if __cplusplus >= 201103L
+using std::none_of; // Section 25.2.3
+#else
+/// \fn none_of ( InputIterator first, InputIterator last, Predicate p )
+/// \return true if none of the elements in [first, last) satisfy the predicate 'p'
+/// \note returns true on an empty range
+///
+/// \param first The start of the input sequence
+/// \param last One past the end of the input sequence
+/// \param p A predicate for testing the elements of the sequence
+///
+template<typename InputIterator, typename Predicate>
+bool none_of ( InputIterator first, InputIterator last, Predicate p )
+{
+for ( ; first != last; ++first )
+ if ( p(*first))
+ return false;
+ return true;
+}
+#endif
+
+/// \fn none_of ( const Range &r, Predicate p )
+/// \return true if none of the elements in the range satisfy the predicate 'p'
+/// \note returns true on an empty range
+///
+/// \param r The input range
+/// \param p A predicate for testing the elements of the range
+///
+template<typename Range, typename Predicate>
+bool none_of ( const Range &r, Predicate p )
+{
+ return boost::algorithm::none_of (boost::begin (r), boost::end (r), p );
+}
+
+/// \fn none_of_equal ( InputIterator first, InputIterator last, const V &val )
+/// \return true if none of the elements in [first, last) are equal to 'val'
+/// \note returns true on an empty range
+///
+/// \param first The start of the input sequence
+/// \param last One past the end of the input sequence
+/// \param val A value to compare against
+///
+template<typename InputIterator, typename V>
+bool none_of_equal ( InputIterator first, InputIterator last, const V &val )
+{
+ for ( ; first != last; ++first )
+ if ( val == *first )
+ return false;
+ return true;
+}
+
+/// \fn none_of_equal ( const Range &r, const V &val )
+/// \return true if none of the elements in the range are equal to 'val'
+/// \note returns true on an empty range
+///
+/// \param r The input range
+/// \param val A value to compare against
+///
+template<typename Range, typename V>
+bool none_of_equal ( const Range &r, const V & val )
+{
+ return boost::algorithm::none_of_equal (boost::begin (r), boost::end (r), val);
+}
+
+}} // namespace boost and algorithm
+
+#endif // BOOST_ALGORITHM_NONE_OF_HPP
diff --git a/boost/algorithm/cxx11/one_of.hpp b/boost/algorithm/cxx11/one_of.hpp
new file mode 100644
index 0000000000..b6e8c77194
--- /dev/null
+++ b/boost/algorithm/cxx11/one_of.hpp
@@ -0,0 +1,82 @@
+/*
+ Copyright (c) Marshall Clow 2008-2012.
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+/// \file one_of.hpp
+/// \brief Test ranges to see if only one element matches a value or predicate.
+/// \author Marshall Clow
+
+#ifndef BOOST_ALGORITHM_ONE_OF_HPP
+#define BOOST_ALGORITHM_ONE_OF_HPP
+
+#include <algorithm> // for std::find and std::find_if
+#include <boost/algorithm/cxx11/none_of.hpp>
+
+#include <boost/range/begin.hpp>
+#include <boost/range/end.hpp>
+
+namespace boost { namespace algorithm {
+
+/// \fn one_of ( InputIterator first, InputIterator last, Predicate p )
+/// \return true if the predicate 'p' is true for exactly one item in [first, last).
+///
+/// \param first The start of the input sequence
+/// \param last One past the end of the input sequence
+/// \param p A predicate for testing the elements of the sequence
+///
+template<typename InputIterator, typename Predicate>
+bool one_of ( InputIterator first, InputIterator last, Predicate p )
+{
+ InputIterator i = std::find_if (first, last, p);
+ if (i == last)
+ return false; // Didn't occur at all
+ return boost::algorithm::none_of (++i, last, p);
+}
+
+/// \fn one_of ( const Range &r, Predicate p )
+/// \return true if the predicate 'p' is true for exactly one item in the range.
+///
+/// \param r The input range
+/// \param p A predicate for testing the elements of the range
+///
+template<typename Range, typename Predicate>
+bool one_of ( const Range &r, Predicate p )
+{
+ return boost::algorithm::one_of ( boost::begin (r), boost::end (r), p );
+}
+
+
+/// \fn one_of_equal ( InputIterator first, InputIterator last, const V &val )
+/// \return true if the value 'val' exists only once in [first, last).
+///
+/// \param first The start of the input sequence
+/// \param last One past the end of the input sequence
+/// \param val A value to compare against
+///
+template<typename InputIterator, typename V>
+bool one_of_equal ( InputIterator first, InputIterator last, const V &val )
+{
+ InputIterator i = std::find (first, last, val); // find first occurrence of 'val'
+ if (i == last)
+ return false; // Didn't occur at all
+ return boost::algorithm::none_of_equal (++i, last, val);
+}
+
+/// \fn one_of_equal ( const Range &r, const V &val )
+/// \return true if the value 'val' exists only once in the range.
+///
+/// \param r The input range
+/// \param val A value to compare against
+///
+template<typename Range, typename V>
+bool one_of_equal ( const Range &r, const V &val )
+{
+ return boost::algorithm::one_of_equal ( boost::begin (r), boost::end (r), val );
+}
+
+}} // namespace boost and algorithm
+
+#endif // BOOST_ALGORITHM_ALL_HPP
diff --git a/boost/algorithm/cxx11/partition_copy.hpp b/boost/algorithm/cxx11/partition_copy.hpp
new file mode 100644
index 0000000000..15c4dd68ab
--- /dev/null
+++ b/boost/algorithm/cxx11/partition_copy.hpp
@@ -0,0 +1,78 @@
+/*
+ Copyright (c) Marshall Clow 2011-2012.
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+/// \file partition_copy.hpp
+/// \brief Copy a subset of a sequence to a new sequence
+/// \author Marshall Clow
+
+#ifndef BOOST_ALGORITHM_PARTITION_COPY_HPP
+#define BOOST_ALGORITHM_PARTITION_COPY_HPP
+
+#include <algorithm> // for std::partition_copy, if available
+#include <utility> // for make_pair
+
+#include <boost/range/begin.hpp>
+#include <boost/range/end.hpp>
+
+namespace boost { namespace algorithm {
+
+#if __cplusplus >= 201103L
+// Use the C++11 versions of partition_copy if it is available
+using std::partition_copy; // Section 25.3.13
+#else
+/// \fn partition_copy ( InputIterator first, InputIterator last,
+/// OutputIterator1 out_true, OutputIterator2 out_false, UnaryPredicate p )
+/// \brief Copies the elements that satisfy the predicate p from the range [first, last)
+/// to the range beginning at d_first_true, and
+/// copies the elements that do not satisfy p to the range beginning at d_first_false.
+///
+///
+/// \param first The start of the input sequence
+/// \param last One past the end of the input sequence
+/// \param out_true An output iterator to write the elements that satisfy the predicate into
+/// \param out_false An output iterator to write the elements that do not satisfy the predicate into
+/// \param p A predicate for dividing the elements of the input sequence.
+///
+/// \note This function is part of the C++2011 standard library.
+/// We will use the standard one if it is available,
+/// otherwise we have our own implementation.
+template <typename InputIterator,
+ typename OutputIterator1, typename OutputIterator2, typename UnaryPredicate>
+std::pair<OutputIterator1, OutputIterator2>
+partition_copy ( InputIterator first, InputIterator last,
+ OutputIterator1 out_true, OutputIterator2 out_false, UnaryPredicate p )
+{
+ for ( ; first != last; ++first )
+ if ( p (*first))
+ *out_true++ = *first;
+ else
+ *out_false++ = *first;
+ return std::pair<OutputIterator1, OutputIterator2> ( out_true, out_false );
+}
+#endif
+
+/// \fn partition_copy ( const Range &r,
+/// OutputIterator1 out_true, OutputIterator2 out_false, UnaryPredicate p )
+///
+/// \param r The input range
+/// \param out_true An output iterator to write the elements that satisfy the predicate into
+/// \param out_false An output iterator to write the elements that do not satisfy the predicate into
+/// \param p A predicate for dividing the elements of the input sequence.
+///
+template <typename Range, typename OutputIterator1, typename OutputIterator2,
+ typename UnaryPredicate>
+std::pair<OutputIterator1, OutputIterator2>
+partition_copy ( const Range &r, OutputIterator1 out_true, OutputIterator2 out_false,
+ UnaryPredicate p )
+{
+ return boost::algorithm::partition_copy
+ (boost::begin(r), boost::end(r), out_true, out_false, p );
+}
+
+}} // namespace boost and algorithm
+
+#endif // BOOST_ALGORITHM_PARTITION_COPY_HPP
diff --git a/boost/algorithm/cxx11/partition_point.hpp b/boost/algorithm/cxx11/partition_point.hpp
new file mode 100644
index 0000000000..36d8384b57
--- /dev/null
+++ b/boost/algorithm/cxx11/partition_point.hpp
@@ -0,0 +1,72 @@
+/*
+ Copyright (c) Marshall Clow 2011-2012.
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+/// \file partition_point.hpp
+/// \brief Find the partition point in a sequence
+/// \author Marshall Clow
+
+#ifndef BOOST_ALGORITHM_PARTITION_POINT_HPP
+#define BOOST_ALGORITHM_PARTITION_POINT_HPP
+
+#include <algorithm> // for std::partition_point, if available
+
+#include <boost/range/begin.hpp>
+#include <boost/range/end.hpp>
+
+namespace boost { namespace algorithm {
+
+#if __cplusplus >= 201103L
+// Use the C++11 versions of partition_point if it is available
+using std::partition_point; // Section 25.3.13
+#else
+/// \fn partition_point ( ForwardIterator first, ForwardIterator last, Predicate p )
+/// \brief Given a partitioned range, returns the partition point, i.e, the first element
+/// that does not satisfy p
+///
+/// \param first The start of the input sequence
+/// \param last One past the end of the input sequence
+/// \param p The predicate to test the values with
+/// \note This function is part of the C++2011 standard library.
+/// We will use the standard one if it is available,
+/// otherwise we have our own implementation.
+template <typename ForwardIterator, typename Predicate>
+ForwardIterator partition_point ( ForwardIterator first, ForwardIterator last, Predicate p )
+{
+ std::size_t dist = std::distance ( first, last );
+ while ( first != last ) {
+ std::size_t d2 = dist / 2;
+ ForwardIterator ret_val = first;
+ std::advance (ret_val, d2);
+ if (p (*ret_val)) {
+ first = ++ret_val;
+ dist -= d2 + 1;
+ }
+ else {
+ last = ret_val;
+ dist = d2;
+ }
+ }
+ return first;
+}
+#endif
+
+/// \fn partition_point ( Range &r, Predicate p )
+/// \brief Given a partitioned range, returns the partition point
+///
+/// \param r The input range
+/// \param p The predicate to test the values with
+///
+template <typename Range, typename Predicate>
+typename boost::range_iterator<Range> partition_point ( Range &r, Predicate p )
+{
+ return boost::algorithm::partition_point (boost::begin(r), boost::end(r), p);
+}
+
+
+}}
+
+#endif // BOOST_ALGORITHM_PARTITION_POINT_HPP
diff --git a/boost/algorithm/hex.hpp b/boost/algorithm/hex.hpp
new file mode 100644
index 0000000000..3f3c0c694b
--- /dev/null
+++ b/boost/algorithm/hex.hpp
@@ -0,0 +1,265 @@
+/*
+ Copyright (c) Marshall Clow 2011-2012.
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+ Thanks to Nevin for his comments/help.
+*/
+
+/*
+ General problem - turn a sequence of integral types into a sequence of hexadecimal characters.
+ - and back.
+
+TO DO:
+ 1. these should really only work on integral types. (see the >> and << operations)
+ -- this is done, I think.
+ 2. The 'value_type_or_char' struct is really a hack.
+ -- but it's a better hack now that it works with back_insert_iterators
+*/
+
+/// \file hex.hpp
+/// \brief Convert sequence of integral types into a sequence of hexadecimal
+/// characters and back. Based on the MySQL functions HEX and UNHEX
+/// \author Marshall Clow
+
+#ifndef BOOST_ALGORITHM_HEXHPP
+#define BOOST_ALGORITHM_HEXHPP
+
+#include <iterator> // for std::iterator_traits
+#include <stdexcept>
+
+#include <boost/range/begin.hpp>
+#include <boost/range/end.hpp>
+#include <boost/exception/all.hpp>
+
+#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits/is_integral.hpp>
+
+
+namespace boost { namespace algorithm {
+
+/*!
+ \struct hex_decode_error
+ \brief Base exception class for all hex decoding errors
+
+ \struct non_hex_input
+ \brief Thrown when a non-hex value (0-9, A-F) encountered when decoding.
+ Contains the offending character
+
+ \struct not_enough_input
+ \brief Thrown when the input sequence unexpectedly ends
+
+*/
+struct hex_decode_error : virtual boost::exception, virtual std::exception {};
+struct not_enough_input : virtual hex_decode_error {};
+struct non_hex_input : virtual hex_decode_error {};
+typedef boost::error_info<struct bad_char_,char> bad_char;
+
+namespace detail {
+/// \cond DOXYGEN_HIDE
+
+ template <typename T, typename OutputIterator>
+ OutputIterator encode_one ( T val, OutputIterator out ) {
+ const std::size_t num_hex_digits = 2 * sizeof ( T );
+ char res [ num_hex_digits ];
+ char *p = res + num_hex_digits;
+ for ( std::size_t i = 0; i < num_hex_digits; ++i, val >>= 4 )
+ *--p = "0123456789ABCDEF" [ val & 0x0F ];
+ return std::copy ( res, res + num_hex_digits, out );
+ }
+
+ unsigned hex_char_to_int ( char c ) {
+ if ( c >= '0' && c <= '9' ) return c - '0';
+ if ( c >= 'A' && c <= 'F' ) return c - 'A' + 10;
+ if ( c >= 'a' && c <= 'f' ) return c - 'a' + 10;
+ BOOST_THROW_EXCEPTION (non_hex_input() << bad_char (c));
+ return 0; // keep dumb compilers happy
+ }
+
+
+// My own iterator_traits class.
+// It is here so that I can "reach inside" some kinds of output iterators
+// and get the type to write.
+ template <typename Iterator>
+ struct hex_iterator_traits {
+ typedef typename std::iterator_traits<Iterator>::value_type value_type;
+ };
+
+ template<typename Container>
+ struct hex_iterator_traits< std::back_insert_iterator<Container> > {
+ typedef typename Container::value_type value_type;
+ };
+
+ template<typename Container>
+ struct hex_iterator_traits< std::front_insert_iterator<Container> > {
+ typedef typename Container::value_type value_type;
+ };
+
+ template<typename Container>
+ struct hex_iterator_traits< std::insert_iterator<Container> > {
+ typedef typename Container::value_type value_type;
+ };
+
+// ostream_iterators have three template parameters.
+// The first one is the output type, the second one is the character type of
+// the underlying stream, the third is the character traits.
+// We only care about the first one.
+ template<typename T, typename charType, typename traits>
+ struct hex_iterator_traits< std::ostream_iterator<T, charType, traits> > {
+ typedef T value_type;
+ };
+
+ template <typename Iterator>
+ bool iter_end ( Iterator current, Iterator last ) { return current == last; }
+
+ template <typename T>
+ bool ptr_end ( const T* ptr, const T* /*end*/ ) { return *ptr == '\0'; }
+
+// What can we assume here about the inputs?
+// is std::iterator_traits<InputIterator>::value_type always 'char' ?
+// Could it be wchar_t, say? Does it matter?
+// We are assuming ASCII for the values - but what about the storage?
+ template <typename InputIterator, typename OutputIterator, typename EndPred>
+ typename boost::enable_if<boost::is_integral<typename hex_iterator_traits<OutputIterator>::value_type>, OutputIterator>::type
+ decode_one ( InputIterator &first, InputIterator last, OutputIterator out, EndPred pred ) {
+ typedef typename hex_iterator_traits<OutputIterator>::value_type T;
+ T res (0);
+
+ // Need to make sure that we get can read that many chars here.
+ for ( std::size_t i = 0; i < 2 * sizeof ( T ); ++i, ++first ) {
+ if ( pred ( first, last ))
+ BOOST_THROW_EXCEPTION (not_enough_input ());
+ res = ( 16 * res ) + hex_char_to_int (static_cast<char> (*first));
+ }
+
+ *out = res;
+ return ++out;
+ }
+/// \endcond
+ }
+
+
+/// \fn hex ( InputIterator first, InputIterator last, OutputIterator out )
+/// \brief Converts a sequence of integral types into a hexadecimal sequence of characters.
+///
+/// \param first The start of the input sequence
+/// \param last One past the end of the input sequence
+/// \param out An output iterator to the results into
+/// \return The updated output iterator
+/// \note Based on the MySQL function of the same name
+template <typename InputIterator, typename OutputIterator>
+typename boost::enable_if<boost::is_integral<typename detail::hex_iterator_traits<InputIterator>::value_type>, OutputIterator>::type
+hex ( InputIterator first, InputIterator last, OutputIterator out ) {
+ for ( ; first != last; ++first )
+ out = detail::encode_one ( *first, out );
+ return out;
+ }
+
+
+/// \fn hex ( const T *ptr, OutputIterator out )
+/// \brief Converts a sequence of integral types into a hexadecimal sequence of characters.
+///
+/// \param ptr A pointer to a 0-terminated sequence of data.
+/// \param out An output iterator to the results into
+/// \return The updated output iterator
+/// \note Based on the MySQL function of the same name
+template <typename T, typename OutputIterator>
+typename boost::enable_if<boost::is_integral<T>, OutputIterator>::type
+hex ( const T *ptr, OutputIterator out ) {
+ while ( *ptr )
+ out = detail::encode_one ( *ptr++, out );
+ return out;
+ }
+
+/// \fn hex ( const Range &r, OutputIterator out )
+/// \brief Converts a sequence of integral types into a hexadecimal sequence of characters.
+///
+/// \param r The input range
+/// \param out An output iterator to the results into
+/// \return The updated output iterator
+/// \note Based on the MySQL function of the same name
+template <typename Range, typename OutputIterator>
+typename boost::enable_if<boost::is_integral<typename detail::hex_iterator_traits<typename Range::iterator>::value_type>, OutputIterator>::type
+hex ( const Range &r, OutputIterator out ) {
+ return hex (boost::begin(r), boost::end(r), out);
+}
+
+
+/// \fn unhex ( InputIterator first, InputIterator last, OutputIterator out )
+/// \brief Converts a sequence of hexadecimal characters into a sequence of integers.
+///
+/// \param first The start of the input sequence
+/// \param last One past the end of the input sequence
+/// \param out An output iterator to the results into
+/// \return The updated output iterator
+/// \note Based on the MySQL function of the same name
+template <typename InputIterator, typename OutputIterator>
+OutputIterator unhex ( InputIterator first, InputIterator last, OutputIterator out ) {
+ while ( first != last )
+ out = detail::decode_one ( first, last, out, detail::iter_end<InputIterator> );
+ return out;
+ }
+
+
+/// \fn unhex ( const T *ptr, OutputIterator out )
+/// \brief Converts a sequence of hexadecimal characters into a sequence of integers.
+///
+/// \param ptr A pointer to a null-terminated input sequence.
+/// \param out An output iterator to the results into
+/// \return The updated output iterator
+/// \note Based on the MySQL function of the same name
+template <typename T, typename OutputIterator>
+OutputIterator unhex ( const T *ptr, OutputIterator out ) {
+ typedef typename detail::hex_iterator_traits<OutputIterator>::value_type OutputType;
+// If we run into the terminator while decoding, we will throw a
+// malformed input exception. It would be nicer to throw a 'Not enough input'
+// exception - but how much extra work would that require?
+ while ( *ptr )
+ out = detail::decode_one ( ptr, (const T *) NULL, out, detail::ptr_end<T> );
+ return out;
+ }
+
+
+/// \fn OutputIterator unhex ( const Range &r, OutputIterator out )
+/// \brief Converts a sequence of hexadecimal characters into a sequence of integers.
+///
+/// \param r The input range
+/// \param out An output iterator to the results into
+/// \return The updated output iterator
+/// \note Based on the MySQL function of the same name
+template <typename Range, typename OutputIterator>
+OutputIterator unhex ( const Range &r, OutputIterator out ) {
+ return unhex (boost::begin(r), boost::end(r), out);
+ }
+
+
+/// \fn String hex ( const String &input )
+/// \brief Converts a sequence of integral types into a hexadecimal sequence of characters.
+///
+/// \param input A container to be converted
+/// \return A container with the encoded text
+template<typename String>
+String hex ( const String &input ) {
+ String output;
+ output.reserve (input.size () * (2 * sizeof (typename String::value_type)));
+ (void) hex (input, std::back_inserter (output));
+ return output;
+ }
+
+/// \fn String unhex ( const String &input )
+/// \brief Converts a sequence of hexadecimal characters into a sequence of characters.
+///
+/// \param input A container to be converted
+/// \return A container with the decoded text
+template<typename String>
+String unhex ( const String &input ) {
+ String output;
+ output.reserve (input.size () / (2 * sizeof (typename String::value_type)));
+ (void) unhex (input, std::back_inserter (output));
+ return output;
+ }
+
+}}
+
+#endif // BOOST_ALGORITHM_HEXHPP
diff --git a/boost/algorithm/searching/boyer_moore.hpp b/boost/algorithm/searching/boyer_moore.hpp
new file mode 100644
index 0000000000..958f0b8d0c
--- /dev/null
+++ b/boost/algorithm/searching/boyer_moore.hpp
@@ -0,0 +1,268 @@
+/*
+ Copyright (c) Marshall Clow 2010-2012.
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+ For more information, see http://www.boost.org
+*/
+
+#ifndef BOOST_ALGORITHM_BOYER_MOORE_SEARCH_HPP
+#define BOOST_ALGORITHM_BOYER_MOORE_SEARCH_HPP
+
+#include <iterator> // for std::iterator_traits
+
+#include <boost/assert.hpp>
+#include <boost/static_assert.hpp>
+
+#include <boost/range/begin.hpp>
+#include <boost/range/end.hpp>
+
+#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+#include <boost/algorithm/searching/detail/bm_traits.hpp>
+#include <boost/algorithm/searching/detail/debugging.hpp>
+
+namespace boost { namespace algorithm {
+
+/*
+ A templated version of the boyer-moore searching algorithm.
+
+References:
+ http://www.cs.utexas.edu/users/moore/best-ideas/string-searching/
+ http://www.cs.utexas.edu/~moore/publications/fstrpos.pdf
+
+Explanations: boostinspect:noascii (test tool complains)
+ http://en.wikipedia.org/wiki/Boyer–Moore_string_search_algorithm
+ http://www.movsd.com/bm.htm
+ http://www.cs.ucdavis.edu/~gusfield/cs224f09/bnotes.pdf
+
+The Boyer-Moore search algorithm uses two tables, a "bad character" table
+to tell how far to skip ahead when it hits a character that is not in the pattern,
+and a "good character" table to tell how far to skip ahead when it hits a
+mismatch on a character that _is_ in the pattern.
+
+Requirements:
+ * Random access iterators
+ * The two iterator types (patIter and corpusIter) must
+ "point to" the same underlying type and be comparable.
+ * Additional requirements may be imposed but the skip table, such as:
+ ** Numeric type (array-based skip table)
+ ** Hashable type (map-based skip table)
+*/
+
+ template <typename patIter, typename traits = detail::BM_traits<patIter> >
+ class boyer_moore {
+ typedef typename std::iterator_traits<patIter>::difference_type difference_type;
+ public:
+ boyer_moore ( patIter first, patIter last )
+ : pat_first ( first ), pat_last ( last ),
+ k_pattern_length ( std::distance ( pat_first, pat_last )),
+ skip_ ( k_pattern_length, -1 ),
+ suffix_ ( k_pattern_length + 1 )
+ {
+ this->build_skip_table ( first, last );
+ this->build_suffix_table ( first, last );
+ }
+
+ ~boyer_moore () {}
+
+ /// \fn operator ( corpusIter corpus_first, corpusIter corpus_last )
+ /// \brief Searches the corpus for the pattern that was passed into the constructor
+ ///
+ /// \param corpus_first The start of the data to search (Random Access Iterator)
+ /// \param corpus_last One past the end of the data to search
+ ///
+ template <typename corpusIter>
+ corpusIter operator () ( corpusIter corpus_first, corpusIter corpus_last ) const {
+ BOOST_STATIC_ASSERT (( boost::is_same<
+ typename std::iterator_traits<patIter>::value_type,
+ typename std::iterator_traits<corpusIter>::value_type>::value ));
+
+ if ( corpus_first == corpus_last ) return corpus_last; // if nothing to search, we didn't find it!
+ if ( pat_first == pat_last ) return corpus_first; // empty pattern matches at start
+
+ const difference_type k_corpus_length = std::distance ( corpus_first, corpus_last );
+ // If the pattern is larger than the corpus, we can't find it!
+ if ( k_corpus_length < k_pattern_length )
+ return corpus_last;
+
+ // Do the search
+ return this->do_search ( corpus_first, corpus_last );
+ }
+
+ template <typename Range>
+ typename boost::range_iterator<Range>::type operator () ( Range &r ) const {
+ return (*this) (boost::begin(r), boost::end(r));
+ }
+
+ private:
+/// \cond DOXYGEN_HIDE
+ patIter pat_first, pat_last;
+ const difference_type k_pattern_length;
+ typename traits::skip_table_t skip_;
+ std::vector <difference_type> suffix_;
+
+ /// \fn operator ( corpusIter corpus_first, corpusIter corpus_last, Pred p )
+ /// \brief Searches the corpus for the pattern that was passed into the constructor
+ ///
+ /// \param corpus_first The start of the data to search (Random Access Iterator)
+ /// \param corpus_last One past the end of the data to search
+ /// \param p A predicate used for the search comparisons.
+ ///
+ template <typename corpusIter>
+ corpusIter do_search ( corpusIter corpus_first, corpusIter corpus_last ) const {
+ /* ---- Do the matching ---- */
+ corpusIter curPos = corpus_first;
+ const corpusIter lastPos = corpus_last - k_pattern_length;
+ difference_type j, k, m;
+
+ while ( curPos <= lastPos ) {
+ /* while ( std::distance ( curPos, corpus_last ) >= k_pattern_length ) { */
+ // Do we match right where we are?
+ j = k_pattern_length;
+ while ( pat_first [j-1] == curPos [j-1] ) {
+ j--;
+ // We matched - we're done!
+ if ( j == 0 )
+ return curPos;
+ }
+
+ // Since we didn't match, figure out how far to skip forward
+ k = skip_ [ curPos [ j - 1 ]];
+ m = j - k - 1;
+ if ( k < j && m > suffix_ [ j ] )
+ curPos += m;
+ else
+ curPos += suffix_ [ j ];
+ }
+
+ return corpus_last; // We didn't find anything
+ }
+
+
+ void build_skip_table ( patIter first, patIter last ) {
+ for ( std::size_t i = 0; first != last; ++first, ++i )
+ skip_.insert ( *first, i );
+ }
+
+
+ template<typename Iter, typename Container>
+ void compute_bm_prefix ( Iter pat_first, Iter pat_last, Container &prefix ) {
+ const std::size_t count = std::distance ( pat_first, pat_last );
+ BOOST_ASSERT ( count > 0 );
+ BOOST_ASSERT ( prefix.size () == count );
+
+ prefix[0] = 0;
+ std::size_t k = 0;
+ for ( std::size_t i = 1; i < count; ++i ) {
+ BOOST_ASSERT ( k < count );
+ while ( k > 0 && ( pat_first[k] != pat_first[i] )) {
+ BOOST_ASSERT ( k < count );
+ k = prefix [ k - 1 ];
+ }
+
+ if ( pat_first[k] == pat_first[i] )
+ k++;
+ prefix [ i ] = k;
+ }
+ }
+
+ void build_suffix_table ( patIter pat_first, patIter pat_last ) {
+ const std::size_t count = (std::size_t) std::distance ( pat_first, pat_last );
+
+ if ( count > 0 ) { // empty pattern
+ std::vector<typename std::iterator_traits<patIter>::value_type> reversed(count);
+ (void) std::reverse_copy ( pat_first, pat_last, reversed.begin ());
+
+ std::vector<difference_type> prefix (count);
+ compute_bm_prefix ( pat_first, pat_last, prefix );
+
+ std::vector<difference_type> prefix_reversed (count);
+ compute_bm_prefix ( reversed.begin (), reversed.end (), prefix_reversed );
+
+ for ( std::size_t i = 0; i <= count; i++ )
+ suffix_[i] = count - prefix [count-1];
+
+ for ( std::size_t i = 0; i < count; i++ ) {
+ const std::size_t j = count - prefix_reversed[i];
+ const difference_type k = i - prefix_reversed[i] + 1;
+
+ if (suffix_[j] > k)
+ suffix_[j] = k;
+ }
+ }
+ }
+/// \endcond
+ };
+
+
+/* Two ranges as inputs gives us four possibilities; with 2,3,3,4 parameters
+ Use a bit of TMP to disambiguate the 3-argument templates */
+
+/// \fn boyer_moore_search ( corpusIter corpus_first, corpusIter corpus_last,
+/// patIter pat_first, patIter pat_last )
+/// \brief Searches the corpus for the pattern.
+///
+/// \param corpus_first The start of the data to search (Random Access Iterator)
+/// \param corpus_last One past the end of the data to search
+/// \param pat_first The start of the pattern to search for (Random Access Iterator)
+/// \param pat_last One past the end of the data to search for
+///
+ template <typename patIter, typename corpusIter>
+ corpusIter boyer_moore_search (
+ corpusIter corpus_first, corpusIter corpus_last,
+ patIter pat_first, patIter pat_last )
+ {
+ boyer_moore<patIter> bm ( pat_first, pat_last );
+ return bm ( corpus_first, corpus_last );
+ }
+
+ template <typename PatternRange, typename corpusIter>
+ corpusIter boyer_moore_search (
+ corpusIter corpus_first, corpusIter corpus_last, const PatternRange &pattern )
+ {
+ typedef typename boost::range_iterator<const PatternRange>::type pattern_iterator;
+ boyer_moore<pattern_iterator> bm ( boost::begin(pattern), boost::end (pattern));
+ return bm ( corpus_first, corpus_last );
+ }
+
+ template <typename patIter, typename CorpusRange>
+ typename boost::lazy_disable_if_c<
+ boost::is_same<CorpusRange, patIter>::value, typename boost::range_iterator<CorpusRange> >
+ ::type
+ boyer_moore_search ( CorpusRange &corpus, patIter pat_first, patIter pat_last )
+ {
+ boyer_moore<patIter> bm ( pat_first, pat_last );
+ return bm (boost::begin (corpus), boost::end (corpus));
+ }
+
+ template <typename PatternRange, typename CorpusRange>
+ typename boost::range_iterator<CorpusRange>::type
+ boyer_moore_search ( CorpusRange &corpus, const PatternRange &pattern )
+ {
+ typedef typename boost::range_iterator<const PatternRange>::type pattern_iterator;
+ boyer_moore<pattern_iterator> bm ( boost::begin(pattern), boost::end (pattern));
+ return bm (boost::begin (corpus), boost::end (corpus));
+ }
+
+
+ // Creator functions -- take a pattern range, return an object
+ template <typename Range>
+ boost::algorithm::boyer_moore<typename boost::range_iterator<const Range>::type>
+ make_boyer_moore ( const Range &r ) {
+ return boost::algorithm::boyer_moore
+ <typename boost::range_iterator<const Range>::type> (boost::begin(r), boost::end(r));
+ }
+
+ template <typename Range>
+ boost::algorithm::boyer_moore<typename boost::range_iterator<Range>::type>
+ make_boyer_moore ( Range &r ) {
+ return boost::algorithm::boyer_moore
+ <typename boost::range_iterator<Range>::type> (boost::begin(r), boost::end(r));
+ }
+
+}}
+
+#endif // BOOST_ALGORITHM_BOYER_MOORE_SEARCH_HPP
diff --git a/boost/algorithm/searching/boyer_moore_horspool.hpp b/boost/algorithm/searching/boyer_moore_horspool.hpp
new file mode 100644
index 0000000000..5e59cf3220
--- /dev/null
+++ b/boost/algorithm/searching/boyer_moore_horspool.hpp
@@ -0,0 +1,194 @@
+/*
+ Copyright (c) Marshall Clow 2010-2012.
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+ For more information, see http://www.boost.org
+*/
+
+#ifndef BOOST_ALGORITHM_BOYER_MOORE_HORSPOOOL_SEARCH_HPP
+#define BOOST_ALGORITHM_BOYER_MOORE_HORSPOOOL_SEARCH_HPP
+
+#include <iterator> // for std::iterator_traits
+
+#include <boost/assert.hpp>
+#include <boost/static_assert.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+#include <boost/algorithm/searching/detail/bm_traits.hpp>
+#include <boost/algorithm/searching/detail/debugging.hpp>
+
+// #define BOOST_ALGORITHM_BOYER_MOORE_HORSPOOL_DEBUG_HPP
+
+namespace boost { namespace algorithm {
+
+/*
+ A templated version of the boyer-moore-horspool searching algorithm.
+
+ Requirements:
+ * Random access iterators
+ * The two iterator types (patIter and corpusIter) must
+ "point to" the same underlying type.
+ * Additional requirements may be imposed buy the skip table, such as:
+ ** Numeric type (array-based skip table)
+ ** Hashable type (map-based skip table)
+
+http://www-igm.univ-mlv.fr/%7Elecroq/string/node18.html
+
+*/
+
+ template <typename patIter, typename traits = detail::BM_traits<patIter> >
+ class boyer_moore_horspool {
+ typedef typename std::iterator_traits<patIter>::difference_type difference_type;
+ public:
+ boyer_moore_horspool ( patIter first, patIter last )
+ : pat_first ( first ), pat_last ( last ),
+ k_pattern_length ( std::distance ( pat_first, pat_last )),
+ skip_ ( k_pattern_length, k_pattern_length ) {
+
+ // Build the skip table
+ std::size_t i = 0;
+ if ( first != last ) // empty pattern?
+ for ( patIter iter = first; iter != last-1; ++iter, ++i )
+ skip_.insert ( *iter, k_pattern_length - 1 - i );
+#ifdef BOOST_ALGORITHM_BOYER_MOORE_HORSPOOL_DEBUG_HPP
+ skip_.PrintSkipTable ();
+#endif
+ }
+
+ ~boyer_moore_horspool () {}
+
+ /// \fn operator ( corpusIter corpus_first, corpusIter corpus_last, Pred p )
+ /// \brief Searches the corpus for the pattern that was passed into the constructor
+ ///
+ /// \param corpus_first The start of the data to search (Random Access Iterator)
+ /// \param corpus_last One past the end of the data to search
+ /// \param p A predicate used for the search comparisons.
+ ///
+ template <typename corpusIter>
+ corpusIter operator () ( corpusIter corpus_first, corpusIter corpus_last ) const {
+ BOOST_STATIC_ASSERT (( boost::is_same<
+ typename std::iterator_traits<patIter>::value_type,
+ typename std::iterator_traits<corpusIter>::value_type>::value ));
+
+ if ( corpus_first == corpus_last ) return corpus_last; // if nothing to search, we didn't find it!
+ if ( pat_first == pat_last ) return corpus_first; // empty pattern matches at start
+
+ const difference_type k_corpus_length = std::distance ( corpus_first, corpus_last );
+ // If the pattern is larger than the corpus, we can't find it!
+ if ( k_corpus_length < k_pattern_length )
+ return corpus_last;
+
+ // Do the search
+ return this->do_search ( corpus_first, corpus_last );
+ }
+
+ template <typename Range>
+ typename boost::range_iterator<Range>::type operator () ( Range &r ) const {
+ return (*this) (boost::begin(r), boost::end(r));
+ }
+
+ private:
+/// \cond DOXYGEN_HIDE
+ patIter pat_first, pat_last;
+ const difference_type k_pattern_length;
+ typename traits::skip_table_t skip_;
+
+ /// \fn do_search ( corpusIter corpus_first, corpusIter corpus_last )
+ /// \brief Searches the corpus for the pattern that was passed into the constructor
+ ///
+ /// \param corpus_first The start of the data to search (Random Access Iterator)
+ /// \param corpus_last One past the end of the data to search
+ /// \param k_corpus_length The length of the corpus to search
+ ///
+ template <typename corpusIter>
+ corpusIter do_search ( corpusIter corpus_first, corpusIter corpus_last ) const {
+ corpusIter curPos = corpus_first;
+ const corpusIter lastPos = corpus_last - k_pattern_length;
+ while ( curPos <= lastPos ) {
+ // Do we match right where we are?
+ std::size_t j = k_pattern_length - 1;
+ while ( pat_first [j] == curPos [j] ) {
+ // We matched - we're done!
+ if ( j == 0 )
+ return curPos;
+ j--;
+ }
+
+ curPos += skip_ [ curPos [ k_pattern_length - 1 ]];
+ }
+
+ return corpus_last;
+ }
+// \endcond
+ };
+
+/* Two ranges as inputs gives us four possibilities; with 2,3,3,4 parameters
+ Use a bit of TMP to disambiguate the 3-argument templates */
+
+/// \fn boyer_moore_horspool_search ( corpusIter corpus_first, corpusIter corpus_last,
+/// patIter pat_first, patIter pat_last )
+/// \brief Searches the corpus for the pattern.
+///
+/// \param corpus_first The start of the data to search (Random Access Iterator)
+/// \param corpus_last One past the end of the data to search
+/// \param pat_first The start of the pattern to search for (Random Access Iterator)
+/// \param pat_last One past the end of the data to search for
+///
+ template <typename patIter, typename corpusIter>
+ corpusIter boyer_moore_horspool_search (
+ corpusIter corpus_first, corpusIter corpus_last,
+ patIter pat_first, patIter pat_last )
+ {
+ boyer_moore_horspool<patIter> bmh ( pat_first, pat_last );
+ return bmh ( corpus_first, corpus_last );
+ }
+
+ template <typename PatternRange, typename corpusIter>
+ corpusIter boyer_moore_horspool_search (
+ corpusIter corpus_first, corpusIter corpus_last, const PatternRange &pattern )
+ {
+ typedef typename boost::range_iterator<const PatternRange>::type pattern_iterator;
+ boyer_moore_horspool<pattern_iterator> bmh ( boost::begin(pattern), boost::end (pattern));
+ return bmh ( corpus_first, corpus_last );
+ }
+
+ template <typename patIter, typename CorpusRange>
+ typename boost::lazy_disable_if_c<
+ boost::is_same<CorpusRange, patIter>::value, typename boost::range_iterator<CorpusRange> >
+ ::type
+ boyer_moore_horspool_search ( CorpusRange &corpus, patIter pat_first, patIter pat_last )
+ {
+ boyer_moore_horspool<patIter> bmh ( pat_first, pat_last );
+ return bm (boost::begin (corpus), boost::end (corpus));
+ }
+
+ template <typename PatternRange, typename CorpusRange>
+ typename boost::range_iterator<CorpusRange>::type
+ boyer_moore_horspool_search ( CorpusRange &corpus, const PatternRange &pattern )
+ {
+ typedef typename boost::range_iterator<const PatternRange>::type pattern_iterator;
+ boyer_moore_horspool<pattern_iterator> bmh ( boost::begin(pattern), boost::end (pattern));
+ return bmh (boost::begin (corpus), boost::end (corpus));
+ }
+
+
+ // Creator functions -- take a pattern range, return an object
+ template <typename Range>
+ boost::algorithm::boyer_moore_horspool<typename boost::range_iterator<const Range>::type>
+ make_boyer_moore_horspool ( const Range &r ) {
+ return boost::algorithm::boyer_moore_horspool
+ <typename boost::range_iterator<const Range>::type> (boost::begin(r), boost::end(r));
+ }
+
+ template <typename Range>
+ boost::algorithm::boyer_moore_horspool<typename boost::range_iterator<Range>::type>
+ make_boyer_moore_horspool ( Range &r ) {
+ return boost::algorithm::boyer_moore_horspool
+ <typename boost::range_iterator<Range>::type> (boost::begin(r), boost::end(r));
+ }
+
+}}
+
+#endif // BOOST_ALGORITHM_BOYER_MOORE_HORSPOOOL_SEARCH_HPP
diff --git a/boost/algorithm/searching/detail/bm_traits.hpp b/boost/algorithm/searching/detail/bm_traits.hpp
new file mode 100644
index 0000000000..ea150c3021
--- /dev/null
+++ b/boost/algorithm/searching/detail/bm_traits.hpp
@@ -0,0 +1,105 @@
+/*
+ Copyright (c) Marshall Clow 2010-2012.
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+ For more information, see http://www.boost.org
+*/
+
+#ifndef BOOST_ALGORITHM_SEARCH_DETAIL_BM_TRAITS_HPP
+#define BOOST_ALGORITHM_SEARCH_DETAIL_BM_TRAITS_HPP
+
+#include <climits> // for CHAR_BIT
+#include <vector>
+#include <iterator> // for std::iterator_traits
+
+#include <boost/type_traits/make_unsigned.hpp>
+#include <boost/type_traits/is_integral.hpp>
+#include <boost/type_traits/remove_pointer.hpp>
+#include <boost/type_traits/remove_const.hpp>
+
+#include <boost/array.hpp>
+#include <boost/tr1/tr1/unordered_map>
+
+#include <boost/algorithm/searching/detail/debugging.hpp>
+
+namespace boost { namespace algorithm { namespace detail {
+
+//
+// Default implementations of the skip tables for B-M and B-M-H
+//
+ template<typename key_type, typename value_type, bool /*useArray*/> class skip_table;
+
+// General case for data searching other than bytes; use a map
+ template<typename key_type, typename value_type>
+ class skip_table<key_type, value_type, false> {
+ private:
+ typedef std::tr1::unordered_map<key_type, value_type> skip_map;
+ const value_type k_default_value;
+ skip_map skip_;
+
+ public:
+ skip_table ( std::size_t patSize, value_type default_value )
+ : k_default_value ( default_value ), skip_ ( patSize ) {}
+
+ void insert ( key_type key, value_type val ) {
+ skip_ [ key ] = val; // Would skip_.insert (val) be better here?
+ }
+
+ value_type operator [] ( key_type key ) const {
+ typename skip_map::const_iterator it = skip_.find ( key );
+ return it == skip_.end () ? k_default_value : it->second;
+ }
+
+ void PrintSkipTable () const {
+ std::cout << "BM(H) Skip Table <unordered_map>:" << std::endl;
+ for ( typename skip_map::const_iterator it = skip_.begin (); it != skip_.end (); ++it )
+ if ( it->second != k_default_value )
+ std::cout << " " << it->first << ": " << it->second << std::endl;
+ std::cout << std::endl;
+ }
+ };
+
+
+// Special case small numeric values; use an array
+ template<typename key_type, typename value_type>
+ class skip_table<key_type, value_type, true> {
+ private:
+ typedef typename boost::make_unsigned<key_type>::type unsigned_key_type;
+ typedef boost::array<value_type, 1U << (CHAR_BIT * sizeof(key_type))> skip_map;
+ skip_map skip_;
+ const value_type k_default_value;
+ public:
+ skip_table ( std::size_t patSize, value_type default_value ) : k_default_value ( default_value ) {
+ std::fill_n ( skip_.begin(), skip_.size(), default_value );
+ }
+
+ void insert ( key_type key, value_type val ) {
+ skip_ [ static_cast<unsigned_key_type> ( key ) ] = val;
+ }
+
+ value_type operator [] ( key_type key ) const {
+ return skip_ [ static_cast<unsigned_key_type> ( key ) ];
+ }
+
+ void PrintSkipTable () const {
+ std::cout << "BM(H) Skip Table <boost:array>:" << std::endl;
+ for ( typename skip_map::const_iterator it = skip_.begin (); it != skip_.end (); ++it )
+ if ( *it != k_default_value )
+ std::cout << " " << std::distance (skip_.begin (), it) << ": " << *it << std::endl;
+ std::cout << std::endl;
+ }
+ };
+
+ template<typename Iterator>
+ struct BM_traits {
+ typedef typename std::iterator_traits<Iterator>::difference_type value_type;
+ typedef typename std::iterator_traits<Iterator>::value_type key_type;
+ typedef boost::algorithm::detail::skip_table<key_type, value_type,
+ boost::is_integral<key_type>::value && (sizeof(key_type)==1)> skip_table_t;
+ };
+
+}}} // namespaces
+
+#endif // BOOST_ALGORITHM_SEARCH_DETAIL_BM_TRAITS_HPP
diff --git a/boost/algorithm/searching/detail/debugging.hpp b/boost/algorithm/searching/detail/debugging.hpp
new file mode 100644
index 0000000000..3996e0f503
--- /dev/null
+++ b/boost/algorithm/searching/detail/debugging.hpp
@@ -0,0 +1,30 @@
+/*
+ Copyright (c) Marshall Clow 2010-2012.
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+ For more information, see http://www.boost.org
+*/
+
+#ifndef BOOST_ALGORITHM_SEARCH_DETAIL_DEBUG_HPP
+#define BOOST_ALGORITHM_SEARCH_DETAIL_DEBUG_HPP
+
+#include <iostream>
+/// \cond DOXYGEN_HIDE
+
+namespace boost { namespace algorithm { namespace detail {
+
+// Debugging support
+ template <typename Iter>
+ void PrintTable ( Iter first, Iter last ) {
+ std::cout << std::distance ( first, last ) << ": { ";
+ for ( Iter iter = first; iter != last; ++iter )
+ std::cout << *iter << " ";
+ std::cout << "}" << std::endl;
+ }
+
+}}}
+/// \endcond
+
+#endif // BOOST_ALGORITHM_SEARCH_DETAIL_DEBUG_HPP
diff --git a/boost/algorithm/searching/knuth_morris_pratt.hpp b/boost/algorithm/searching/knuth_morris_pratt.hpp
new file mode 100644
index 0000000000..cc83185c51
--- /dev/null
+++ b/boost/algorithm/searching/knuth_morris_pratt.hpp
@@ -0,0 +1,253 @@
+/*
+ Copyright (c) Marshall Clow 2010-2012.
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+ For more information, see http://www.boost.org
+*/
+
+#ifndef BOOST_ALGORITHM_KNUTH_MORRIS_PRATT_SEARCH_HPP
+#define BOOST_ALGORITHM_KNUTH_MORRIS_PRATT_SEARCH_HPP
+
+#include <vector>
+#include <iterator> // for std::iterator_traits
+
+#include <boost/assert.hpp>
+#include <boost/static_assert.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+#include <boost/algorithm/searching/detail/debugging.hpp>
+
+// #define BOOST_ALGORITHM_KNUTH_MORRIS_PRATT_DEBUG
+
+namespace boost { namespace algorithm {
+
+// #define NEW_KMP
+
+/*
+ A templated version of the Knuth-Morris-Pratt searching algorithm.
+
+ Requirements:
+ * Random-access iterators
+ * The two iterator types (I1 and I2) must "point to" the same underlying type.
+
+ http://en.wikipedia.org/wiki/Knuth-Morris-Pratt_algorithm
+ http://www.inf.fh-flensburg.de/lang/algorithmen/pattern/kmpen.htm
+*/
+
+ template <typename patIter>
+ class knuth_morris_pratt {
+ typedef typename std::iterator_traits<patIter>::difference_type difference_type;
+ public:
+ knuth_morris_pratt ( patIter first, patIter last )
+ : pat_first ( first ), pat_last ( last ),
+ k_pattern_length ( std::distance ( pat_first, pat_last )),
+ skip_ ( k_pattern_length + 1 ) {
+#ifdef NEW_KMP
+ preKmp ( pat_first, pat_last );
+#else
+ init_skip_table ( pat_first, pat_last );
+#endif
+#ifdef BOOST_ALGORITHM_KNUTH_MORRIS_PRATT_DEBUG
+ detail::PrintTable ( skip_.begin (), skip_.end ());
+#endif
+ }
+
+ ~knuth_morris_pratt () {}
+
+ /// \fn operator ( corpusIter corpus_first, corpusIter corpus_last, Pred p )
+ /// \brief Searches the corpus for the pattern that was passed into the constructor
+ ///
+ /// \param corpus_first The start of the data to search (Random Access Iterator)
+ /// \param corpus_last One past the end of the data to search
+ /// \param p A predicate used for the search comparisons.
+ ///
+ template <typename corpusIter>
+ corpusIter operator () ( corpusIter corpus_first, corpusIter corpus_last ) const {
+ BOOST_STATIC_ASSERT (( boost::is_same<
+ typename std::iterator_traits<patIter>::value_type,
+ typename std::iterator_traits<corpusIter>::value_type>::value ));
+ if ( corpus_first == corpus_last ) return corpus_last; // if nothing to search, we didn't find it!
+ if ( pat_first == pat_last ) return corpus_first; // empty pattern matches at start
+
+ const difference_type k_corpus_length = std::distance ( corpus_first, corpus_last );
+ // If the pattern is larger than the corpus, we can't find it!
+ if ( k_corpus_length < k_pattern_length )
+ return corpus_last;
+
+ return do_search ( corpus_first, corpus_last, k_corpus_length );
+ }
+
+ template <typename Range>
+ typename boost::range_iterator<Range>::type operator () ( Range &r ) const {
+ return (*this) (boost::begin(r), boost::end(r));
+ }
+
+ private:
+/// \cond DOXYGEN_HIDE
+ patIter pat_first, pat_last;
+ const difference_type k_pattern_length;
+ std::vector <difference_type> skip_;
+
+ /// \fn operator ( corpusIter corpus_first, corpusIter corpus_last, Pred p )
+ /// \brief Searches the corpus for the pattern that was passed into the constructor
+ ///
+ /// \param corpus_first The start of the data to search (Random Access Iterator)
+ /// \param corpus_last One past the end of the data to search
+ /// \param p A predicate used for the search comparisons.
+ ///
+ template <typename corpusIter>
+ corpusIter do_search ( corpusIter corpus_first, corpusIter corpus_last,
+ difference_type k_corpus_length ) const {
+ difference_type match_start = 0; // position in the corpus that we're matching
+
+#ifdef NEW_KMP
+ int patternIdx = 0;
+ while ( match_start < k_corpus_length ) {
+ while ( patternIdx > -1 && pat_first[patternIdx] != corpus_first [match_start] )
+ patternIdx = skip_ [patternIdx]; //<--- Shifting the pattern on mismatch
+
+ patternIdx++;
+ match_start++; //<--- corpus is always increased by 1
+
+ if ( patternIdx >= (int) k_pattern_length )
+ return corpus_first + match_start - patternIdx;
+ }
+
+#else
+// At this point, we know:
+// k_pattern_length <= k_corpus_length
+// for all elements of skip, it holds -1 .. k_pattern_length
+//
+// In the loop, we have the following invariants
+// idx is in the range 0 .. k_pattern_length
+// match_start is in the range 0 .. k_corpus_length - k_pattern_length + 1
+
+ const difference_type last_match = k_corpus_length - k_pattern_length;
+ difference_type idx = 0; // position in the pattern we're comparing
+
+ while ( match_start <= last_match ) {
+ while ( pat_first [ idx ] == corpus_first [ match_start + idx ] ) {
+ if ( ++idx == k_pattern_length )
+ return corpus_first + match_start;
+ }
+ // Figure out where to start searching again
+ // assert ( idx - skip_ [ idx ] > 0 ); // we're always moving forward
+ match_start += idx - skip_ [ idx ];
+ idx = skip_ [ idx ] >= 0 ? skip_ [ idx ] : 0;
+ // assert ( idx >= 0 && idx < k_pattern_length );
+ }
+#endif
+
+ // We didn't find anything
+ return corpus_last;
+ }
+
+
+ void preKmp ( patIter first, patIter last ) {
+ const /*std::size_t*/ int count = std::distance ( first, last );
+
+ int i, j;
+
+ i = 0;
+ j = skip_[0] = -1;
+ while (i < count) {
+ while (j > -1 && first[i] != first[j])
+ j = skip_[j];
+ i++;
+ j++;
+ if (first[i] == first[j])
+ skip_[i] = skip_[j];
+ else
+ skip_[i] = j;
+ }
+ }
+
+
+ void init_skip_table ( patIter first, patIter last ) {
+ const difference_type count = std::distance ( first, last );
+
+ int j;
+ skip_ [ 0 ] = -1;
+ for ( int i = 1; i <= count; ++i ) {
+ j = skip_ [ i - 1 ];
+ while ( j >= 0 ) {
+ if ( first [ j ] == first [ i - 1 ] )
+ break;
+ j = skip_ [ j ];
+ }
+ skip_ [ i ] = j + 1;
+ }
+ }
+// \endcond
+ };
+
+
+/* Two ranges as inputs gives us four possibilities; with 2,3,3,4 parameters
+ Use a bit of TMP to disambiguate the 3-argument templates */
+
+/// \fn knuth_morris_pratt_search ( corpusIter corpus_first, corpusIter corpus_last,
+/// patIter pat_first, patIter pat_last )
+/// \brief Searches the corpus for the pattern.
+///
+/// \param corpus_first The start of the data to search (Random Access Iterator)
+/// \param corpus_last One past the end of the data to search
+/// \param pat_first The start of the pattern to search for (Random Access Iterator)
+/// \param pat_last One past the end of the data to search for
+///
+ template <typename patIter, typename corpusIter>
+ corpusIter knuth_morris_pratt_search (
+ corpusIter corpus_first, corpusIter corpus_last,
+ patIter pat_first, patIter pat_last )
+ {
+ knuth_morris_pratt<patIter> kmp ( pat_first, pat_last );
+ return kmp ( corpus_first, corpus_last );
+ }
+
+ template <typename PatternRange, typename corpusIter>
+ corpusIter knuth_morris_pratt_search (
+ corpusIter corpus_first, corpusIter corpus_last, const PatternRange &pattern )
+ {
+ typedef typename boost::range_iterator<const PatternRange>::type pattern_iterator;
+ knuth_morris_pratt<pattern_iterator> kmp ( boost::begin(pattern), boost::end (pattern));
+ return kmp ( corpus_first, corpus_last );
+ }
+
+ template <typename patIter, typename CorpusRange>
+ typename boost::lazy_disable_if_c<
+ boost::is_same<CorpusRange, patIter>::value, typename boost::range_iterator<CorpusRange> >
+ ::type
+ knuth_morris_pratt_search ( CorpusRange &corpus, patIter pat_first, patIter pat_last )
+ {
+ knuth_morris_pratt<patIter> kmp ( pat_first, pat_last );
+ return kmp (boost::begin (corpus), boost::end (corpus));
+ }
+
+ template <typename PatternRange, typename CorpusRange>
+ typename boost::range_iterator<CorpusRange>::type
+ knuth_morris_pratt_search ( CorpusRange &corpus, const PatternRange &pattern )
+ {
+ typedef typename boost::range_iterator<const PatternRange>::type pattern_iterator;
+ knuth_morris_pratt<pattern_iterator> kmp ( boost::begin(pattern), boost::end (pattern));
+ return kmp (boost::begin (corpus), boost::end (corpus));
+ }
+
+
+ // Creator functions -- take a pattern range, return an object
+ template <typename Range>
+ boost::algorithm::knuth_morris_pratt<typename boost::range_iterator<const Range>::type>
+ make_knuth_morris_pratt ( const Range &r ) {
+ return boost::algorithm::knuth_morris_pratt
+ <typename boost::range_iterator<const Range>::type> (boost::begin(r), boost::end(r));
+ }
+
+ template <typename Range>
+ boost::algorithm::knuth_morris_pratt<typename boost::range_iterator<Range>::type>
+ make_knuth_morris_pratt ( Range &r ) {
+ return boost::algorithm::knuth_morris_pratt
+ <typename boost::range_iterator<Range>::type> (boost::begin(r), boost::end(r));
+ }
+}}
+
+#endif // BOOST_ALGORITHM_KNUTH_MORRIS_PRATT_SEARCH_HPP
diff --git a/boost/algorithm/string/find.hpp b/boost/algorithm/string/find.hpp
index 304646d090..cc99ca1c93 100644
--- a/boost/algorithm/string/find.hpp
+++ b/boost/algorithm/string/find.hpp
@@ -228,13 +228,13 @@ namespace boost {
//! Find head algorithm
/*!
Get the head of the input. Head is a prefix of the string of the
- given size. If the input is shorter then required, whole input if considered
+ given size. If the input is shorter then required, whole input is considered
to be the head.
\param Input An input string
\param N Length of the head
For N>=0, at most N characters are extracted.
- For N<0, size(Input)-|N| characters are extracted.
+ For N<0, at most size(Input)-|N| characters are extracted.
\return
An \c iterator_range delimiting the match.
Returned iterator is either \c Range1T::iterator or
@@ -258,13 +258,13 @@ namespace boost {
//! Find tail algorithm
/*!
Get the tail of the input. Tail is a suffix of the string of the
- given size. If the input is shorter then required, whole input if considered
+ given size. If the input is shorter then required, whole input is considered
to be the tail.
\param Input An input string
\param N Length of the tail.
For N>=0, at most N characters are extracted.
- For N<0, size(Input)-|N| characters are extracted.
+ For N<0, at most size(Input)-|N| characters are extracted.
\return
An \c iterator_range delimiting the match.
Returned iterator is either \c RangeT::iterator or
diff --git a/boost/algorithm/string/iter_find.hpp b/boost/algorithm/string/iter_find.hpp
index 9e0245f1a7..e10652834b 100644
--- a/boost/algorithm/string/iter_find.hpp
+++ b/boost/algorithm/string/iter_find.hpp
@@ -60,7 +60,7 @@ namespace boost {
a match).
\param Input A container which will be searched.
\param Finder A Finder object used for searching
- \return A reference the result
+ \return A reference to the result
\note Prior content of the result will be overwritten.
*/
@@ -122,7 +122,7 @@ namespace boost {
Each match is used as a separator of segments. These segments are then
returned in the result.
- \param Result A 'container container' to container the result of search.
+ \param Result A 'container container' to contain the result of search.
Both outer and inner container must have constructor taking a pair
of iterators as an argument.
Typical type of the result is
@@ -131,7 +131,7 @@ namespace boost {
a match).
\param Input A container which will be searched.
\param Finder A finder object used for searching
- \return A reference the result
+ \return A reference to the result
\note Prior content of the result will be overwritten.
*/
diff --git a/boost/archive/basic_archive.hpp b/boost/archive/basic_archive.hpp
index d408485206..c5ac8808e5 100644
--- a/boost/archive/basic_archive.hpp
+++ b/boost/archive/basic_archive.hpp
@@ -150,7 +150,8 @@ private:
base_type t;
public:
object_id_type(): t(0) {};
- explicit object_id_type(const unsigned int & t_) : t(t_){
+ // note: presumes that size_t >= unsigned int.
+ explicit object_id_type(const std::size_t & t_) : t(t_){
BOOST_ASSERT(t_ <= boost::integer_traits<base_type>::const_max);
}
object_id_type(const object_id_type & t_) :
diff --git a/boost/archive/detail/basic_serializer_map.hpp b/boost/archive/detail/basic_serializer_map.hpp
index 19defcb5be..a991ea1dc1 100644
--- a/boost/archive/detail/basic_serializer_map.hpp
+++ b/boost/archive/detail/basic_serializer_map.hpp
@@ -19,7 +19,7 @@
#include <set>
#include <boost/config.hpp>
-#include <boost/utility.hpp>
+#include <boost/noncopyable.hpp>
#include <boost/archive/detail/auto_link_archive.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
diff --git a/boost/archive/detail/iserializer.hpp b/boost/archive/detail/iserializer.hpp
index 46033fddf2..53765af315 100644
--- a/boost/archive/detail/iserializer.hpp
+++ b/boost/archive/detail/iserializer.hpp
@@ -61,7 +61,7 @@ namespace std{
#define DONT_USE_HAS_NEW_OPERATOR ( \
defined(__BORLANDC__) \
- || defined(__IBMCPP__) \
+ || BOOST_WORKAROUND(__IBMCPP__, < 1210) \
|| defined(BOOST_MSVC) && (BOOST_MSVC <= 1300) \
|| defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x590) \
)
diff --git a/boost/archive/iterators/head_iterator.hpp b/boost/archive/iterators/head_iterator.hpp
index 7d39a35da0..2fdd475e11 100644
--- a/boost/archive/iterators/head_iterator.hpp
+++ b/boost/archive/iterators/head_iterator.hpp
@@ -42,8 +42,8 @@ private:
> super_t;
typedef head_iterator<Predicate, Base> this_t;
- typedef BOOST_DEDUCED_TYPENAME super_t::value_type value_type;
- typedef BOOST_DEDUCED_TYPENAME super_t::reference reference_type;
+ typedef super_t::value_type value_type;
+ typedef super_t::reference reference_type;
reference_type dereference_impl(){
if(! m_end){
diff --git a/boost/archive/iterators/remove_whitespace.hpp b/boost/archive/iterators/remove_whitespace.hpp
index a8e1092983..a01049faf0 100644
--- a/boost/archive/iterators/remove_whitespace.hpp
+++ b/boost/archive/iterators/remove_whitespace.hpp
@@ -24,6 +24,7 @@
#include <boost/iterator/iterator_adaptor.hpp>
#include <boost/iterator/filter_iterator.hpp>
+#include <boost/iterator/iterator_traits.hpp>
//#include <boost/detail/workaround.hpp>
//#if ! BOOST_WORKAROUND(BOOST_MSVC, <=1300)
@@ -140,13 +141,19 @@ public:
template<class Base>
class remove_whitespace :
public filter_iterator<
- remove_whitespace_predicate<BOOST_DEDUCED_TYPENAME Base::value_type>,
+ remove_whitespace_predicate<
+ BOOST_DEDUCED_TYPENAME boost::iterator_value<Base>::type
+ //BOOST_DEDUCED_TYPENAME Base::value_type
+ >,
Base
>
{
friend class boost::iterator_core_access;
typedef filter_iterator<
- remove_whitespace_predicate<BOOST_DEDUCED_TYPENAME Base::value_type>,
+ remove_whitespace_predicate<
+ BOOST_DEDUCED_TYPENAME boost::iterator_value<Base>::type
+ //BOOST_DEDUCED_TYPENAME Base::value_type
+ >,
Base
> super_t;
public:
diff --git a/boost/archive/shared_ptr_helper.hpp b/boost/archive/shared_ptr_helper.hpp
index 0e5f4f26bc..39e6eb82c8 100644
--- a/boost/archive/shared_ptr_helper.hpp
+++ b/boost/archive/shared_ptr_helper.hpp
@@ -127,7 +127,7 @@ public:
template<class T>
struct non_polymorphic {
static const boost::serialization::extended_type_info *
- get_object_identifier(T & t){
+ get_object_identifier(T &){
return & boost::serialization::singleton<
BOOST_DEDUCED_TYPENAME
boost::serialization::type_info_implementation< T >::type
diff --git a/boost/array.hpp b/boost/array.hpp
index ffb504bdbb..fa06fa9a5f 100644
--- a/boost/array.hpp
+++ b/boost/array.hpp
@@ -13,6 +13,7 @@
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
+ * 14 Apr 2012 - (mtc) Added support for boost::hash
* 28 Dec 2010 - (mtc) Added cbegin and cend (and crbegin and crend) for C++Ox compatibility.
* 10 Mar 2010 - (mtc) fill method added, matching resolution of the standard library working group.
* See <http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#776> or Trac issue #3168
@@ -46,6 +47,7 @@
// Handles broken standard libraries better than <iterator>
#include <boost/detail/iterator.hpp>
#include <boost/throw_exception.hpp>
+#include <boost/functional/hash_fwd.hpp>
#include <algorithm>
// FIXES for broken compilers
@@ -118,13 +120,13 @@ namespace boost {
// operator[]
reference operator[](size_type i)
{
- BOOST_ASSERT( i < N && "out of range" );
+ BOOST_ASSERT_MSG( i < N, "out of range" );
return elems[i];
}
const_reference operator[](size_type i) const
{
- BOOST_ASSERT( i < N && "out of range" );
+ BOOST_ASSERT_MSG( i < N, "out of range" );
return elems[i];
}
@@ -427,6 +429,13 @@ namespace boost {
}
#endif
+
+ template<class T, std::size_t N>
+ std::size_t hash_value(const array<T,N>& arr)
+ {
+ return boost::hash_range(arr.begin(), arr.end());
+ }
+
} /* namespace boost */
diff --git a/boost/asio/basic_socket_iostream.hpp b/boost/asio/basic_socket_iostream.hpp
index 93d1fcd17c..6fae0854b2 100644
--- a/boost/asio/basic_socket_iostream.hpp
+++ b/boost/asio/basic_socket_iostream.hpp
@@ -53,7 +53,7 @@
basic_socket_streambuf<Protocol, StreamSocketService, \
Time, TimeTraits, TimerService> >::member) \
{ \
- tie(this); \
+ this->setf(std::ios_base::unitbuf); \
if (rdbuf()->connect(BOOST_PP_ENUM_PARAMS(n, x)) == 0) \
this->setstate(std::ios_base::failbit); \
} \
@@ -112,7 +112,7 @@ public:
basic_socket_streambuf<Protocol, StreamSocketService,
Time, TimeTraits, TimerService> >::member)
{
- tie(this);
+ this->setf(std::ios_base::unitbuf);
}
#if defined(GENERATING_DOCUMENTATION)
@@ -131,7 +131,7 @@ public:
basic_socket_streambuf<Protocol, StreamSocketService,
Time, TimeTraits, TimerService> >::member)
{
- tie(this);
+ this->setf(std::ios_base::unitbuf);
if (rdbuf()->connect(x...) == 0)
this->setstate(std::ios_base::failbit);
}
diff --git a/boost/asio/buffered_write_stream.hpp b/boost/asio/buffered_write_stream.hpp
index 9159c237f6..11cb872558 100644
--- a/boost/asio/buffered_write_stream.hpp
+++ b/boost/asio/buffered_write_stream.hpp
@@ -232,7 +232,7 @@ public:
? bytes_avail : space_avail;
storage_.resize(orig_size + length);
std::size_t bytes_copied = boost::asio::buffer_copy(
- storage_.data(), buffers_, length);
+ storage_.data() + orig_size, buffers_, length);
io_service_.dispatch(detail::bind_handler(handler_, ec, bytes_copied));
}
diff --git a/boost/asio/buffers_iterator.hpp b/boost/asio/buffers_iterator.hpp
index 66b8cf6042..c11e1469d6 100644
--- a/boost/asio/buffers_iterator.hpp
+++ b/boost/asio/buffers_iterator.hpp
@@ -128,7 +128,7 @@ public:
/// Construct an iterator representing the beginning of the buffers' data.
static buffers_iterator begin(const BufferSequence& buffers)
#if BOOST_WORKAROUND(__GNUC__, == 4) && BOOST_WORKAROUND(__GNUC_MINOR__, == 3)
- __attribute__ ((noinline))
+ __attribute__ ((__noinline__))
#endif
{
buffers_iterator new_iter;
@@ -148,7 +148,7 @@ public:
/// Construct an iterator representing the end of the buffers' data.
static buffers_iterator end(const BufferSequence& buffers)
#if BOOST_WORKAROUND(__GNUC__, == 4) && BOOST_WORKAROUND(__GNUC_MINOR__, == 3)
- __attribute__ ((noinline))
+ __attribute__ ((__noinline__))
#endif
{
buffers_iterator new_iter;
diff --git a/boost/asio/detail/atomic_count.hpp b/boost/asio/detail/atomic_count.hpp
index 9324fffa65..5e0051a22c 100644
--- a/boost/asio/detail/atomic_count.hpp
+++ b/boost/asio/detail/atomic_count.hpp
@@ -31,10 +31,13 @@ namespace detail {
#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
typedef long atomic_count;
+inline void increment(atomic_count& a, long b) { a += b; }
#elif defined(BOOST_ASIO_HAS_STD_ATOMIC)
typedef std::atomic<long> atomic_count;
+inline void increment(atomic_count& a, long b) { a += b; }
#else // defined(BOOST_ASIO_HAS_STD_ATOMIC)
typedef boost::detail::atomic_count atomic_count;
+inline void increment(atomic_count& a, long b) { while (b > 0) ++a, --b; }
#endif // defined(BOOST_ASIO_HAS_STD_ATOMIC)
} // namespace detail
diff --git a/boost/asio/detail/config.hpp b/boost/asio/detail/config.hpp
index 3f2314db9e..c47c0070c1 100644
--- a/boost/asio/detail/config.hpp
+++ b/boost/asio/detail/config.hpp
@@ -112,6 +112,20 @@
# endif // defined(__GNUC__)
#endif // !defined(BOOST_ASIO_DISABLE_STD_SYSTEM_ERROR)
+// Compliant C++11 compilers put noexcept specifiers on error_category members.
+#if !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT)
+# if defined(__GNUC__)
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
+# if defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true)
+# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
+# endif // defined(__GNUC__)
+# if !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT)
+# define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT
+# endif // !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT)
+#endif // !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT)
+
// Standard library support for arrays.
#if !defined(BOOST_ASIO_DISABLE_STD_ARRAY)
# if defined(__GNUC__)
@@ -163,7 +177,9 @@
# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
# if defined(__GXX_EXPERIMENTAL_CXX0X__)
# define BOOST_ASIO_HAS_STD_CHRONO
-# define BOOST_ASIO_HAS_STD_CHRONO_MONOTONIC_CLOCK
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6))
+# define BOOST_ASIO_HAS_STD_CHRONO_MONOTONIC_CLOCK
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6))
# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
# endif // defined(__GNUC__)
@@ -355,4 +371,19 @@
# endif // !defined(UNDER_CE)
#endif // !defined(BOOST_ASIO_DISABLE_SIGNAL)
+// Support for the __thread keyword extension.
+#if !defined(BOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION)
+# if defined(__linux__)
+# if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
+# if ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)
+# if !defined(__INTEL_COMPILER) && !defined(__ICL)
+# define BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION 1
+# elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1100)
+# define BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION 1
+# endif // defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1100)
+# endif // ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)
+# endif // defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
+# endif // defined(__linux__)
+#endif // !defined(BOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION)
+
#endif // BOOST_ASIO_DETAIL_CONFIG_HPP
diff --git a/boost/asio/detail/epoll_reactor.hpp b/boost/asio/detail/epoll_reactor.hpp
index 2d26644ca8..8f66f74b1f 100644
--- a/boost/asio/detail/epoll_reactor.hpp
+++ b/boost/asio/detail/epoll_reactor.hpp
@@ -19,6 +19,7 @@
#if defined(BOOST_ASIO_HAS_EPOLL)
+#include <boost/cstdint.hpp>
#include <boost/limits.hpp>
#include <boost/asio/io_service.hpp>
#include <boost/asio/detail/atomic_count.hpp>
@@ -59,6 +60,7 @@ public:
mutex mutex_;
epoll_reactor* reactor_;
int descriptor_;
+ boost::uint32_t registered_events_;
op_queue<reactor_op> op_queue_[max_ops];
bool shutdown_;
diff --git a/boost/asio/detail/fenced_block.hpp b/boost/asio/detail/fenced_block.hpp
index a362f5b56f..d9e8a04e8f 100644
--- a/boost/asio/detail/fenced_block.hpp
+++ b/boost/asio/detail/fenced_block.hpp
@@ -25,7 +25,8 @@
# include <boost/asio/detail/macos_fenced_block.hpp>
#elif defined(__sun)
# include <boost/asio/detail/solaris_fenced_block.hpp>
-#elif defined(__GNUC__) && defined(__arm__)
+#elif defined(__GNUC__) && defined(__arm__) \
+ && !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
# include <boost/asio/detail/gcc_arm_fenced_block.hpp>
#elif defined(__GNUC__) && (defined(__hppa) || defined(__hppa__))
# include <boost/asio/detail/gcc_hppa_fenced_block.hpp>
@@ -54,7 +55,8 @@ typedef null_fenced_block fenced_block;
typedef macos_fenced_block fenced_block;
#elif defined(__sun)
typedef solaris_fenced_block fenced_block;
-#elif defined(__GNUC__) && defined(__arm__)
+#elif defined(__GNUC__) && defined(__arm__) \
+ && !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
typedef gcc_arm_fenced_block fenced_block;
#elif defined(__GNUC__) && (defined(__hppa) || defined(__hppa__))
typedef gcc_hppa_fenced_block fenced_block;
diff --git a/boost/asio/detail/gcc_x86_fenced_block.hpp b/boost/asio/detail/gcc_x86_fenced_block.hpp
index b416b50d52..973165ab1e 100644
--- a/boost/asio/detail/gcc_x86_fenced_block.hpp
+++ b/boost/asio/detail/gcc_x86_fenced_block.hpp
@@ -40,17 +40,17 @@ public:
// Constructor for a full fenced block.
explicit gcc_x86_fenced_block(full_t)
{
- barrier1();
+ lbarrier();
}
// Destructor.
~gcc_x86_fenced_block()
{
- barrier2();
+ sbarrier();
}
private:
- static int barrier1()
+ static int barrier()
{
int r = 0, m = 1;
__asm__ __volatile__ (
@@ -61,12 +61,21 @@ private:
return r;
}
- static void barrier2()
+ static void lbarrier()
{
#if defined(__SSE2__)
- __asm__ __volatile__ ("mfence" ::: "memory");
+ __asm__ __volatile__ ("lfence" ::: "memory");
#else // defined(__SSE2__)
- barrier1();
+ barrier();
+#endif // defined(__SSE2__)
+ }
+
+ static void sbarrier()
+ {
+#if defined(__SSE2__)
+ __asm__ __volatile__ ("sfence" ::: "memory");
+#else // defined(__SSE2__)
+ barrier();
#endif // defined(__SSE2__)
}
};
diff --git a/boost/asio/detail/impl/epoll_reactor.ipp b/boost/asio/detail/impl/epoll_reactor.ipp
index 771edea67c..073bd08825 100644
--- a/boost/asio/detail/impl/epoll_reactor.ipp
+++ b/boost/asio/detail/impl/epoll_reactor.ipp
@@ -127,7 +127,7 @@ void epoll_reactor::fork_service(boost::asio::io_service::fork_event fork_ev)
for (descriptor_state* state = registered_descriptors_.first();
state != 0; state = state->next_)
{
- ev.events = EPOLLIN | EPOLLERR | EPOLLHUP | EPOLLOUT | EPOLLPRI | EPOLLET;
+ ev.events = state->registered_events_;
ev.data.ptr = state;
int result = epoll_ctl(epoll_fd_, EPOLL_CTL_ADD, state->descriptor_, &ev);
if (result != 0)
@@ -159,7 +159,8 @@ int epoll_reactor::register_descriptor(socket_type descriptor,
}
epoll_event ev = { 0, { 0 } };
- ev.events = EPOLLIN | EPOLLERR | EPOLLHUP | EPOLLOUT | EPOLLPRI | EPOLLET;
+ ev.events = EPOLLIN | EPOLLERR | EPOLLHUP | EPOLLPRI | EPOLLET;
+ descriptor_data->registered_events_ = ev.events;
ev.data.ptr = descriptor_data;
int result = epoll_ctl(epoll_fd_, EPOLL_CTL_ADD, descriptor, &ev);
if (result != 0)
@@ -184,7 +185,8 @@ int epoll_reactor::register_internal_descriptor(
}
epoll_event ev = { 0, { 0 } };
- ev.events = EPOLLIN | EPOLLERR | EPOLLHUP | EPOLLOUT | EPOLLPRI | EPOLLET;
+ ev.events = EPOLLIN | EPOLLERR | EPOLLHUP | EPOLLPRI | EPOLLET;
+ descriptor_data->registered_events_ = ev.events;
ev.data.ptr = descriptor_data;
int result = epoll_ctl(epoll_fd_, EPOLL_CTL_ADD, descriptor, &ev);
if (result != 0)
@@ -222,23 +224,47 @@ void epoll_reactor::start_op(int op_type, socket_type descriptor,
if (descriptor_data->op_queue_[op_type].empty())
{
- if (allow_speculative)
+ if (allow_speculative
+ && (op_type != read_op
+ || descriptor_data->op_queue_[except_op].empty()))
{
- if (op_type != read_op || descriptor_data->op_queue_[except_op].empty())
+ if (op->perform())
{
- if (op->perform())
+ descriptor_lock.unlock();
+ io_service_.post_immediate_completion(op);
+ return;
+ }
+
+ if (op_type == write_op)
+ {
+ if ((descriptor_data->registered_events_ & EPOLLOUT) == 0)
{
- descriptor_lock.unlock();
- io_service_.post_immediate_completion(op);
- return;
+ epoll_event ev = { 0, { 0 } };
+ ev.events = descriptor_data->registered_events_ | EPOLLOUT;
+ ev.data.ptr = descriptor_data;
+ if (epoll_ctl(epoll_fd_, EPOLL_CTL_MOD, descriptor, &ev) == 0)
+ {
+ descriptor_data->registered_events_ |= ev.events;
+ }
+ else
+ {
+ op->ec_ = boost::system::error_code(errno,
+ boost::asio::error::get_system_category());
+ io_service_.post_immediate_completion(op);
+ return;
+ }
}
}
}
else
{
+ if (op_type == write_op)
+ {
+ descriptor_data->registered_events_ |= EPOLLOUT;
+ }
+
epoll_event ev = { 0, { 0 } };
- ev.events = EPOLLIN | EPOLLERR | EPOLLHUP
- | EPOLLOUT | EPOLLPRI | EPOLLET;
+ ev.events = descriptor_data->registered_events_;
ev.data.ptr = descriptor_data;
epoll_ctl(epoll_fd_, EPOLL_CTL_MOD, descriptor, &ev);
}
@@ -440,7 +466,7 @@ int epoll_reactor::do_epoll_create()
errno = EINVAL;
#endif // defined(EPOLL_CLOEXEC)
- if (fd == -1 && errno == EINVAL)
+ if (fd == -1 && (errno == EINVAL || errno == ENOSYS))
{
fd = epoll_create(epoll_size);
if (fd != -1)
diff --git a/boost/asio/detail/impl/socket_ops.ipp b/boost/asio/detail/impl/socket_ops.ipp
index 24d2d66ad1..16e95366e6 100644
--- a/boost/asio/detail/impl/socket_ops.ipp
+++ b/boost/asio/detail/impl/socket_ops.ipp
@@ -18,6 +18,7 @@
#include <boost/asio/detail/config.hpp>
#include <boost/assert.hpp>
#include <boost/detail/workaround.hpp>
+#include <cctype>
#include <cstdio>
#include <cstdlib>
#include <cstring>
diff --git a/boost/asio/detail/impl/strand_service.hpp b/boost/asio/detail/impl/strand_service.hpp
index 1d98d99055..7581852ff5 100644
--- a/boost/asio/detail/impl/strand_service.hpp
+++ b/boost/asio/detail/impl/strand_service.hpp
@@ -50,11 +50,6 @@ struct strand_service::on_dispatch_exit
}
};
-inline void strand_service::destroy(strand_service::implementation_type& impl)
-{
- impl = 0;
-}
-
template <typename Handler>
void strand_service::dispatch(strand_service::implementation_type& impl,
Handler handler)
diff --git a/boost/asio/detail/impl/strand_service.ipp b/boost/asio/detail/impl/strand_service.ipp
index 64e4cc00ce..1912d80f72 100644
--- a/boost/asio/detail/impl/strand_service.ipp
+++ b/boost/asio/detail/impl/strand_service.ipp
@@ -38,7 +38,7 @@ struct strand_service::on_do_complete_exit
impl_->mutex_.unlock();
if (more_handlers)
- owner_->post_immediate_completion(impl_);
+ owner_->post_private_immediate_completion(impl_);
}
};
diff --git a/boost/asio/detail/impl/task_io_service.hpp b/boost/asio/detail/impl/task_io_service.hpp
index 7cd7449e60..2cc7b7eea1 100644
--- a/boost/asio/detail/impl/task_io_service.hpp
+++ b/boost/asio/detail/impl/task_io_service.hpp
@@ -45,7 +45,7 @@ void task_io_service::dispatch(Handler handler)
BOOST_ASIO_HANDLER_CREATION((p.p, "io_service", this, "dispatch"));
- post_immediate_completion(p.p);
+ post_non_private_immediate_completion(p.p);
p.v = p.p = 0;
}
}
diff --git a/boost/asio/detail/impl/task_io_service.ipp b/boost/asio/detail/impl/task_io_service.ipp
index 3d679c2dca..674df638fe 100644
--- a/boost/asio/detail/impl/task_io_service.ipp
+++ b/boost/asio/detail/impl/task_io_service.ipp
@@ -30,48 +30,67 @@ namespace boost {
namespace asio {
namespace detail {
+struct task_io_service::thread_info
+{
+ event* wakeup_event;
+ op_queue<operation> private_op_queue;
+ long private_outstanding_work;
+ thread_info* next;
+};
+
struct task_io_service::task_cleanup
{
~task_cleanup()
{
+ if (this_thread_->private_outstanding_work > 0)
+ {
+ boost::asio::detail::increment(
+ task_io_service_->outstanding_work_,
+ this_thread_->private_outstanding_work);
+ }
+ this_thread_->private_outstanding_work = 0;
+
// Enqueue the completed operations and reinsert the task at the end of
// the operation queue.
lock_->lock();
task_io_service_->task_interrupted_ = true;
- task_io_service_->op_queue_.push(*ops_);
+ task_io_service_->op_queue_.push(this_thread_->private_op_queue);
task_io_service_->op_queue_.push(&task_io_service_->task_operation_);
}
task_io_service* task_io_service_;
mutex::scoped_lock* lock_;
- op_queue<operation>* ops_;
+ thread_info* this_thread_;
};
struct task_io_service::work_cleanup
{
~work_cleanup()
{
- task_io_service_->work_finished();
+ if (this_thread_->private_outstanding_work > 1)
+ {
+ boost::asio::detail::increment(
+ task_io_service_->outstanding_work_,
+ this_thread_->private_outstanding_work - 1);
+ }
+ else if (this_thread_->private_outstanding_work < 1)
+ {
+ task_io_service_->work_finished();
+ }
+ this_thread_->private_outstanding_work = 0;
-#if defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
- if (!ops_->empty())
+#if defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+ if (!this_thread_->private_op_queue.empty())
{
lock_->lock();
- task_io_service_->op_queue_.push(*ops_);
+ task_io_service_->op_queue_.push(this_thread_->private_op_queue);
}
#endif // defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
}
task_io_service* task_io_service_;
mutex::scoped_lock* lock_;
- op_queue<operation>* ops_;
-};
-
-struct task_io_service::thread_info
-{
- event* wakeup_event;
- op_queue<operation>* private_op_queue;
- thread_info* next;
+ thread_info* this_thread_;
};
task_io_service::task_io_service(
@@ -131,19 +150,14 @@ std::size_t task_io_service::run(boost::system::error_code& ec)
thread_info this_thread;
event wakeup_event;
this_thread.wakeup_event = &wakeup_event;
- op_queue<operation> private_op_queue;
-#if defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
- this_thread.private_op_queue = one_thread_ == 1 ? &private_op_queue : 0;
-#else // defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
- this_thread.private_op_queue = 0;
-#endif // defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+ this_thread.private_outstanding_work = 0;
this_thread.next = 0;
thread_call_stack::context ctx(this, this_thread);
mutex::scoped_lock lock(mutex_);
std::size_t n = 0;
- for (; do_run_one(lock, this_thread, private_op_queue, ec); lock.lock())
+ for (; do_run_one(lock, this_thread, ec); lock.lock())
if (n != (std::numeric_limits<std::size_t>::max)())
++n;
return n;
@@ -161,14 +175,13 @@ std::size_t task_io_service::run_one(boost::system::error_code& ec)
thread_info this_thread;
event wakeup_event;
this_thread.wakeup_event = &wakeup_event;
- op_queue<operation> private_op_queue;
- this_thread.private_op_queue = 0;
+ this_thread.private_outstanding_work = 0;
this_thread.next = 0;
thread_call_stack::context ctx(this, this_thread);
mutex::scoped_lock lock(mutex_);
- return do_run_one(lock, this_thread, private_op_queue, ec);
+ return do_run_one(lock, this_thread, ec);
}
std::size_t task_io_service::poll(boost::system::error_code& ec)
@@ -182,29 +195,23 @@ std::size_t task_io_service::poll(boost::system::error_code& ec)
thread_info this_thread;
this_thread.wakeup_event = 0;
- op_queue<operation> private_op_queue;
-#if defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
- this_thread.private_op_queue = one_thread_ == 1 ? &private_op_queue : 0;
-#else // defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
- this_thread.private_op_queue = 0;
-#endif // defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+ this_thread.private_outstanding_work = 0;
this_thread.next = 0;
thread_call_stack::context ctx(this, this_thread);
mutex::scoped_lock lock(mutex_);
-#if defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
// We want to support nested calls to poll() and poll_one(), so any handlers
// that are already on a thread-private queue need to be put on to the main
// queue now.
if (one_thread_)
if (thread_info* outer_thread_info = ctx.next_by_key())
- if (outer_thread_info->private_op_queue)
- op_queue_.push(*outer_thread_info->private_op_queue);
+ op_queue_.push(outer_thread_info->private_op_queue);
#endif // defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
std::size_t n = 0;
- for (; do_poll_one(lock, private_op_queue, ec); lock.lock())
+ for (; do_poll_one(lock, this_thread, ec); lock.lock())
if (n != (std::numeric_limits<std::size_t>::max)())
++n;
return n;
@@ -221,24 +228,22 @@ std::size_t task_io_service::poll_one(boost::system::error_code& ec)
thread_info this_thread;
this_thread.wakeup_event = 0;
- op_queue<operation> private_op_queue;
- this_thread.private_op_queue = 0;
+ this_thread.private_outstanding_work = 0;
this_thread.next = 0;
thread_call_stack::context ctx(this, this_thread);
mutex::scoped_lock lock(mutex_);
-#if defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
// We want to support nested calls to poll() and poll_one(), so any handlers
// that are already on a thread-private queue need to be put on to the main
// queue now.
if (one_thread_)
if (thread_info* outer_thread_info = ctx.next_by_key())
- if (outer_thread_info->private_op_queue)
- op_queue_.push(*outer_thread_info->private_op_queue);
+ op_queue_.push(outer_thread_info->private_op_queue);
#endif // defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
- return do_poll_one(lock, private_op_queue, ec);
+ return do_poll_one(lock, this_thread, ec);
}
void task_io_service::stop()
@@ -261,22 +266,33 @@ void task_io_service::reset()
void task_io_service::post_immediate_completion(task_io_service::operation* op)
{
+#if defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+ if (one_thread_)
+ {
+ if (thread_info* this_thread = thread_call_stack::contains(this))
+ {
+ ++this_thread->private_outstanding_work;
+ this_thread->private_op_queue.push(op);
+ return;
+ }
+ }
+#endif // defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+
work_started();
- post_deferred_completion(op);
+ mutex::scoped_lock lock(mutex_);
+ op_queue_.push(op);
+ wake_one_thread_and_unlock(lock);
}
void task_io_service::post_deferred_completion(task_io_service::operation* op)
{
-#if defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
if (one_thread_)
{
if (thread_info* this_thread = thread_call_stack::contains(this))
{
- if (this_thread->private_op_queue)
- {
- this_thread->private_op_queue->push(op);
- return;
- }
+ this_thread->private_op_queue.push(op);
+ return;
}
}
#endif // defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
@@ -291,16 +307,13 @@ void task_io_service::post_deferred_completions(
{
if (!ops.empty())
{
-#if defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
if (one_thread_)
{
if (thread_info* this_thread = thread_call_stack::contains(this))
{
- if (this_thread->private_op_queue)
- {
- this_thread->private_op_queue->push(ops);
- return;
- }
+ this_thread->private_op_queue.push(ops);
+ return;
}
}
#endif // defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
@@ -311,6 +324,44 @@ void task_io_service::post_deferred_completions(
}
}
+void task_io_service::post_private_immediate_completion(
+ task_io_service::operation* op)
+{
+ work_started();
+ post_private_deferred_completion(op);
+}
+
+void task_io_service::post_private_deferred_completion(
+ task_io_service::operation* op)
+{
+#if defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+ if (thread_info* this_thread = thread_call_stack::contains(this))
+ {
+ this_thread->private_op_queue.push(op);
+ return;
+ }
+#endif // defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+
+ mutex::scoped_lock lock(mutex_);
+ op_queue_.push(op);
+ wake_one_thread_and_unlock(lock);
+}
+
+void task_io_service::post_non_private_immediate_completion(
+ task_io_service::operation* op)
+{
+ work_started();
+ post_non_private_deferred_completion(op);
+}
+
+void task_io_service::post_non_private_deferred_completion(
+ task_io_service::operation* op)
+{
+ mutex::scoped_lock lock(mutex_);
+ op_queue_.push(op);
+ wake_one_thread_and_unlock(lock);
+}
+
void task_io_service::abandon_operations(
op_queue<task_io_service::operation>& ops)
{
@@ -320,7 +371,7 @@ void task_io_service::abandon_operations(
std::size_t task_io_service::do_run_one(mutex::scoped_lock& lock,
task_io_service::thread_info& this_thread,
- op_queue<operation>& private_op_queue, const boost::system::error_code& ec)
+ const boost::system::error_code& ec)
{
while (!stopped_)
{
@@ -343,14 +394,13 @@ std::size_t task_io_service::do_run_one(mutex::scoped_lock& lock,
else
lock.unlock();
- op_queue<operation> completed_ops;
- task_cleanup on_exit = { this, &lock, &completed_ops };
+ task_cleanup on_exit = { this, &lock, &this_thread };
(void)on_exit;
// Run the task. May throw an exception. Only block if the operation
// queue is empty and we're not polling, otherwise we want to return
// as soon as possible.
- task_->run(!more_handlers, completed_ops);
+ task_->run(!more_handlers, this_thread.private_op_queue);
}
else
{
@@ -362,7 +412,7 @@ std::size_t task_io_service::do_run_one(mutex::scoped_lock& lock,
lock.unlock();
// Ensure the count of outstanding work is decremented on block exit.
- work_cleanup on_exit = { this, &lock, &private_op_queue };
+ work_cleanup on_exit = { this, &lock, &this_thread };
(void)on_exit;
// Complete the operation. May throw an exception. Deletes the object.
@@ -385,7 +435,8 @@ std::size_t task_io_service::do_run_one(mutex::scoped_lock& lock,
}
std::size_t task_io_service::do_poll_one(mutex::scoped_lock& lock,
- op_queue<operation>& private_op_queue, const boost::system::error_code& ec)
+ task_io_service::thread_info& this_thread,
+ const boost::system::error_code& ec)
{
if (stopped_)
return 0;
@@ -397,14 +448,13 @@ std::size_t task_io_service::do_poll_one(mutex::scoped_lock& lock,
lock.unlock();
{
- op_queue<operation> completed_ops;
- task_cleanup c = { this, &lock, &completed_ops };
+ task_cleanup c = { this, &lock, &this_thread };
(void)c;
// Run the task. May throw an exception. Only block if the operation
// queue is empty and we're not polling, otherwise we want to return
// as soon as possible.
- task_->run(false, completed_ops);
+ task_->run(false, this_thread.private_op_queue);
}
o = op_queue_.front();
@@ -426,7 +476,7 @@ std::size_t task_io_service::do_poll_one(mutex::scoped_lock& lock,
lock.unlock();
// Ensure the count of outstanding work is decremented on block exit.
- work_cleanup on_exit = { this, &lock, &private_op_queue };
+ work_cleanup on_exit = { this, &lock, &this_thread };
(void)on_exit;
// Complete the operation. May throw an exception. Deletes the object.
diff --git a/boost/asio/detail/keyword_tss_ptr.hpp b/boost/asio/detail/keyword_tss_ptr.hpp
new file mode 100644
index 0000000000..10dd01a1f0
--- /dev/null
+++ b/boost/asio/detail/keyword_tss_ptr.hpp
@@ -0,0 +1,72 @@
+//
+// detail/keyword_tss_ptr.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_DETAIL_KEYWORD_TSS_PTR_HPP
+#define BOOST_ASIO_DETAIL_KEYWORD_TSS_PTR_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+
+#if defined(BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION)
+
+#include <boost/asio/detail/noncopyable.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace detail {
+
+template <typename T>
+class keyword_tss_ptr
+ : private noncopyable
+{
+public:
+ // Constructor.
+ keyword_tss_ptr()
+ {
+ }
+
+ // Destructor.
+ ~keyword_tss_ptr()
+ {
+ }
+
+ // Get the value.
+ operator T*() const
+ {
+ return value_;
+ }
+
+ // Set the value.
+ void operator=(T* value)
+ {
+ value_ = value;
+ }
+
+private:
+ static __thread T* value_;
+};
+
+template <typename T>
+__thread T* keyword_tss_ptr<T>::value_;
+
+} // namespace detail
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // defined(BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION)
+
+#endif // BOOST_ASIO_DETAIL_KEYWORD_TSS_PTR_HPP
diff --git a/boost/asio/detail/strand_service.hpp b/boost/asio/detail/strand_service.hpp
index 4206346585..3a271b50d5 100644
--- a/boost/asio/detail/strand_service.hpp
+++ b/boost/asio/detail/strand_service.hpp
@@ -84,9 +84,6 @@ public:
// Construct a new strand implementation.
BOOST_ASIO_DECL void construct(implementation_type& impl);
- // Destroy a strand implementation.
- void destroy(implementation_type& impl);
-
// Request the io_service to invoke the given handler.
template <typename Handler>
void dispatch(implementation_type& impl, Handler handler);
diff --git a/boost/asio/detail/task_io_service.hpp b/boost/asio/detail/task_io_service.hpp
index 7a0bcc5701..e05c3a7419 100644
--- a/boost/asio/detail/task_io_service.hpp
+++ b/boost/asio/detail/task_io_service.hpp
@@ -112,6 +112,16 @@ public:
// that work_started() was previously called for each operation.
BOOST_ASIO_DECL void post_deferred_completions(op_queue<operation>& ops);
+ // Request invocation of the given operation, preferring the thread-private
+ // queue if available, and return immediately. Assumes that work_started()
+ // has not yet been called for the operation.
+ BOOST_ASIO_DECL void post_private_immediate_completion(operation* op);
+
+ // Request invocation of the given operation, preferring the thread-private
+ // queue if available, and return immediately. Assumes that work_started()
+ // was previously called for the operation.
+ BOOST_ASIO_DECL void post_private_deferred_completion(operation* op);
+
// Process unfinished operations as part of a shutdown_service operation.
// Assumes that work_started() was previously called for the operations.
BOOST_ASIO_DECL void abandon_operations(op_queue<operation>& ops);
@@ -120,15 +130,23 @@ private:
// Structure containing information about an idle thread.
struct thread_info;
- // Run at most one operation. Blocks only if this_idle_thread is non-null.
+ // Request invocation of the given operation, avoiding the thread-private
+ // queue, and return immediately. Assumes that work_started() has not yet
+ // been called for the operation.
+ BOOST_ASIO_DECL void post_non_private_immediate_completion(operation* op);
+
+ // Request invocation of the given operation, avoiding the thread-private
+ // queue, and return immediately. Assumes that work_started() was previously
+ // called for the operation.
+ BOOST_ASIO_DECL void post_non_private_deferred_completion(operation* op);
+
+ // Run at most one operation. May block.
BOOST_ASIO_DECL std::size_t do_run_one(mutex::scoped_lock& lock,
- thread_info& this_thread, op_queue<operation>& private_op_queue,
- const boost::system::error_code& ec);
+ thread_info& this_thread, const boost::system::error_code& ec);
// Poll for at most one operation.
BOOST_ASIO_DECL std::size_t do_poll_one(mutex::scoped_lock& lock,
- op_queue<operation>& private_op_queue,
- const boost::system::error_code& ec);
+ thread_info& this_thread, const boost::system::error_code& ec);
// Stop the task and all idle threads.
BOOST_ASIO_DECL void stop_all_threads(mutex::scoped_lock& lock);
diff --git a/boost/asio/detail/tss_ptr.hpp b/boost/asio/detail/tss_ptr.hpp
index cdb09e71b8..d14a959447 100644
--- a/boost/asio/detail/tss_ptr.hpp
+++ b/boost/asio/detail/tss_ptr.hpp
@@ -19,6 +19,8 @@
#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
# include <boost/asio/detail/null_tss_ptr.hpp>
+#elif defined(BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION)
+# include <boost/asio/detail/keyword_tss_ptr.hpp>
#elif defined(BOOST_WINDOWS)
# include <boost/asio/detail/win_tss_ptr.hpp>
#elif defined(BOOST_HAS_PTHREADS)
@@ -37,6 +39,8 @@ template <typename T>
class tss_ptr
#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
: public null_tss_ptr<T>
+#elif defined(BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION)
+ : public keyword_tss_ptr<T>
#elif defined(BOOST_WINDOWS)
: public win_tss_ptr<T>
#elif defined(BOOST_HAS_PTHREADS)
@@ -48,6 +52,8 @@ public:
{
#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
null_tss_ptr<T>::operator=(value);
+#elif defined(BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION)
+ keyword_tss_ptr<T>::operator=(value);
#elif defined(BOOST_WINDOWS)
win_tss_ptr<T>::operator=(value);
#elif defined(BOOST_HAS_PTHREADS)
diff --git a/boost/asio/detail/win_iocp_io_service.hpp b/boost/asio/detail/win_iocp_io_service.hpp
index c6ebf63e94..0e3bb0b8e6 100644
--- a/boost/asio/detail/win_iocp_io_service.hpp
+++ b/boost/asio/detail/win_iocp_io_service.hpp
@@ -135,6 +135,22 @@ public:
BOOST_ASIO_DECL void post_deferred_completions(
op_queue<win_iocp_operation>& ops);
+ // Request invocation of the given operation using the thread-private queue
+ // and return immediately. Assumes that work_started() has not yet been
+ // called for the operation.
+ void post_private_immediate_completion(win_iocp_operation* op)
+ {
+ post_immediate_completion(op);
+ }
+
+ // Request invocation of the given operation using the thread-private queue
+ // and return immediately. Assumes that work_started() was previously called
+ // for the operation.
+ void post_private_deferred_completion(win_iocp_operation* op)
+ {
+ post_deferred_completion(op);
+ }
+
// Process unfinished operations as part of a shutdown_service operation.
// Assumes that work_started() was previously called for the operations.
BOOST_ASIO_DECL void abandon_operations(op_queue<operation>& ops);
diff --git a/boost/asio/ssl/detail/impl/engine.ipp b/boost/asio/ssl/detail/impl/engine.ipp
index 72f1c35689..a7da0c1967 100644
--- a/boost/asio/ssl/detail/impl/engine.ipp
+++ b/boost/asio/ssl/detail/impl/engine.ipp
@@ -18,7 +18,10 @@
#include <boost/asio/detail/config.hpp>
#if !defined(BOOST_ASIO_ENABLE_OLD_SSL)
+# include <boost/asio/detail/throw_error.hpp>
+# include <boost/asio/error.hpp>
# include <boost/asio/ssl/detail/engine.hpp>
+# include <boost/asio/ssl/error.hpp>
# include <boost/asio/ssl/verify_context.hpp>
#endif // !defined(BOOST_ASIO_ENABLE_OLD_SSL)
@@ -34,6 +37,13 @@ namespace detail {
engine::engine(SSL_CTX* context)
: ssl_(::SSL_new(context))
{
+ if (!ssl_)
+ {
+ boost::system::error_code ec(::ERR_get_error(),
+ boost::asio::error::get_ssl_category());
+ boost::asio::detail::throw_error(ec, "engine");
+ }
+
accept_mutex().init();
::SSL_set_mode(ssl_, SSL_MODE_ENABLE_PARTIAL_WRITE);
diff --git a/boost/asio/ssl/detail/impl/openssl_init.ipp b/boost/asio/ssl/detail/impl/openssl_init.ipp
index af33f6e039..fe62e6eabc 100644
--- a/boost/asio/ssl/detail/impl/openssl_init.ipp
+++ b/boost/asio/ssl/detail/impl/openssl_init.ipp
@@ -56,7 +56,9 @@ public:
::EVP_cleanup();
::CRYPTO_cleanup_all_ex_data();
::CONF_modules_unload(1);
+#if !defined(OPENSSL_NO_ENGINE)
::ENGINE_cleanup();
+#endif // !defined(OPENSSL_NO_ENGINE)
}
private:
diff --git a/boost/asio/ssl/detail/openssl_types.hpp b/boost/asio/ssl/detail/openssl_types.hpp
index 752fe587de..a3c3729332 100644
--- a/boost/asio/ssl/detail/openssl_types.hpp
+++ b/boost/asio/ssl/detail/openssl_types.hpp
@@ -18,7 +18,9 @@
#include <boost/asio/detail/config.hpp>
#include <openssl/conf.h>
#include <openssl/ssl.h>
-#include <openssl/engine.h>
+#if !defined(OPENSSL_NO_ENGINE)
+# include <openssl/engine.h>
+#endif // !defined(OPENSSL_NO_ENGINE)
#include <openssl/err.h>
#include <openssl/x509v3.h>
#include <boost/asio/detail/socket_types.hpp>
diff --git a/boost/asio/strand.hpp b/boost/asio/strand.hpp
index ba82e602a8..6a1033f37e 100644
--- a/boost/asio/strand.hpp
+++ b/boost/asio/strand.hpp
@@ -105,7 +105,6 @@ public:
*/
~strand()
{
- service_.destroy(impl_);
}
/// Get the io_service associated with the strand.
diff --git a/boost/asio/version.hpp b/boost/asio/version.hpp
index 21eeb51243..4fc894bb38 100644
--- a/boost/asio/version.hpp
+++ b/boost/asio/version.hpp
@@ -18,6 +18,6 @@
// BOOST_ASIO_VERSION % 100 is the sub-minor version
// BOOST_ASIO_VERSION / 100 % 1000 is the minor version
// BOOST_ASIO_VERSION / 100000 is the major version
-#define BOOST_ASIO_VERSION 100800 // 1.8.0
+#define BOOST_ASIO_VERSION 100802 // 1.8.2
#endif // BOOST_ASIO_VERSION_HPP
diff --git a/boost/asio/windows/basic_object_handle.hpp b/boost/asio/windows/basic_object_handle.hpp
index 161bb512f1..a94bb57e26 100644
--- a/boost/asio/windows/basic_object_handle.hpp
+++ b/boost/asio/windows/basic_object_handle.hpp
@@ -125,7 +125,7 @@ public:
void wait()
{
boost::system::error_code ec;
- this->service.wait(this->implementation, ec);
+ this->get_service().wait(this->get_implementation(), ec);
boost::asio::detail::throw_error(ec, "wait");
}
@@ -139,7 +139,7 @@ public:
*/
void wait(boost::system::error_code& ec)
{
- this->service.wait(this->implementation, ec);
+ this->get_service().wait(this->get_implementation(), ec);
}
/// Start an asynchronous wait on the object handle.
@@ -161,7 +161,7 @@ public:
template <typename WaitHandler>
void async_wait(WaitHandler handler)
{
- this->service.async_wait(this->implementation, handler);
+ this->get_service().async_wait(this->get_implementation(), handler);
}
};
diff --git a/boost/bimap/container_adaptor/list_map_adaptor.hpp b/boost/bimap/container_adaptor/list_map_adaptor.hpp
index ff7a5407af..e4fd52df79 100644
--- a/boost/bimap/container_adaptor/list_map_adaptor.hpp
+++ b/boost/bimap/container_adaptor/list_map_adaptor.hpp
@@ -134,6 +134,7 @@ class list_map_adaptor :
typedef BOOST_DEDUCED_TYPENAME Iterator::value_type::first_type key_type;
typedef BOOST_DEDUCED_TYPENAME Iterator::value_type::second_type data_type;
+ typedef data_type mapped_type;
protected:
diff --git a/boost/bimap/container_adaptor/map_adaptor.hpp b/boost/bimap/container_adaptor/map_adaptor.hpp
index f1a6f64d2d..3df1a03cb0 100644
--- a/boost/bimap/container_adaptor/map_adaptor.hpp
+++ b/boost/bimap/container_adaptor/map_adaptor.hpp
@@ -82,6 +82,7 @@ class map_adaptor :
public:
typedef BOOST_DEDUCED_TYPENAME Iterator::value_type::second_type data_type;
+ typedef data_type mapped_type;
// Access -----------------------------------------------------------------
diff --git a/boost/bimap/container_adaptor/multimap_adaptor.hpp b/boost/bimap/container_adaptor/multimap_adaptor.hpp
index ad5edf2bb9..f39899ea0c 100644
--- a/boost/bimap/container_adaptor/multimap_adaptor.hpp
+++ b/boost/bimap/container_adaptor/multimap_adaptor.hpp
@@ -81,6 +81,7 @@ class multimap_adaptor :
public:
typedef BOOST_DEDUCED_TYPENAME Iterator::value_type::second_type data_type;
+ typedef data_type mapped_type;
// Access -----------------------------------------------------------------
diff --git a/boost/bimap/container_adaptor/unordered_map_adaptor.hpp b/boost/bimap/container_adaptor/unordered_map_adaptor.hpp
index 762a643c27..fd233e8e22 100644
--- a/boost/bimap/container_adaptor/unordered_map_adaptor.hpp
+++ b/boost/bimap/container_adaptor/unordered_map_adaptor.hpp
@@ -82,6 +82,7 @@ class unordered_map_adaptor :
public:
typedef BOOST_DEDUCED_TYPENAME Iterator::value_type::second_type data_type;
+ typedef data_type mapped_type;
// Access -----------------------------------------------------------------
diff --git a/boost/bimap/container_adaptor/unordered_multimap_adaptor.hpp b/boost/bimap/container_adaptor/unordered_multimap_adaptor.hpp
index be28b3adf3..104d197963 100644
--- a/boost/bimap/container_adaptor/unordered_multimap_adaptor.hpp
+++ b/boost/bimap/container_adaptor/unordered_multimap_adaptor.hpp
@@ -81,6 +81,7 @@ class unordered_multimap_adaptor :
public:
typedef BOOST_DEDUCED_TYPENAME Iterator::value_type::second_type data_type;
+ typedef data_type mapped_type;
// Access -----------------------------------------------------------------
diff --git a/boost/bimap/container_adaptor/vector_map_adaptor.hpp b/boost/bimap/container_adaptor/vector_map_adaptor.hpp
index 9b0b9d3df5..1d49ac7c6e 100644
--- a/boost/bimap/container_adaptor/vector_map_adaptor.hpp
+++ b/boost/bimap/container_adaptor/vector_map_adaptor.hpp
@@ -77,6 +77,7 @@ class vector_map_adaptor :
typedef BOOST_DEDUCED_TYPENAME Iterator::value_type::first_type key_type;
typedef BOOST_DEDUCED_TYPENAME Iterator::value_type::second_type data_type;
+ typedef data_type mapped_type;
// Access -----------------------------------------------------------------
diff --git a/boost/bimap/detail/map_view_iterator.hpp b/boost/bimap/detail/map_view_iterator.hpp
index adc8d7c861..4f0e20e00a 100644
--- a/boost/bimap/detail/map_view_iterator.hpp
+++ b/boost/bimap/detail/map_view_iterator.hpp
@@ -19,7 +19,11 @@
#include <boost/config.hpp>
// Boost
-#include <boost/serialization/nvp.hpp>
+
+#ifndef BOOST_BIMAP_DISABLE_SERIALIZATION
+ #include <boost/serialization/nvp.hpp>
+#endif // BOOST_BIMAP_DISABLE_SERIALIZATION
+
#include <boost/iterator/detail/enable_if.hpp>
#include <boost/iterator/iterator_adaptor.hpp>
#include <boost/bimap/relation/support/pair_by.hpp>
diff --git a/boost/bimap/detail/set_view_iterator.hpp b/boost/bimap/detail/set_view_iterator.hpp
index 57e6ae3c8b..d48f5c05b1 100644
--- a/boost/bimap/detail/set_view_iterator.hpp
+++ b/boost/bimap/detail/set_view_iterator.hpp
@@ -19,7 +19,11 @@
#include <boost/config.hpp>
// Boost
-#include <boost/serialization/nvp.hpp>
+
+#ifndef BOOST_BIMAP_DISABLE_SERIALIZATION
+ #include <boost/serialization/nvp.hpp>
+#endif // BOOST_BIMAP_DISABLE_SERIALIZATION
+
#include <boost/iterator/detail/enable_if.hpp>
#include <boost/iterator/iterator_adaptor.hpp>
#include <boost/bimap/relation/support/get_pair_functor.hpp>
diff --git a/boost/bimap/relation/detail/mutant.hpp b/boost/bimap/relation/detail/mutant.hpp
index 62b3843bb1..8a2ffdeba0 100644
--- a/boost/bimap/relation/detail/mutant.hpp
+++ b/boost/bimap/relation/detail/mutant.hpp
@@ -21,9 +21,9 @@
#include <boost/bimap/detail/debug/static_error.hpp>
#include <boost/mpl/contains.hpp>
#include <boost/mpl/assert.hpp>
-#include <boost/utility.hpp>
#include <boost/static_assert.hpp>
#include <boost/type_traits/is_const.hpp>
+#include <boost/utility/addressof.hpp>
#include <boost/mpl/not.hpp>
#include <boost/utility/enable_if.hpp>
diff --git a/boost/bimap/relation/mutant_relation.hpp b/boost/bimap/relation/mutant_relation.hpp
index c46ab790a9..9aa28e4cac 100644
--- a/boost/bimap/relation/mutant_relation.hpp
+++ b/boost/bimap/relation/mutant_relation.hpp
@@ -21,7 +21,10 @@
#include <boost/mpl/vector.hpp>
#include <boost/operators.hpp>
#include <boost/call_traits.hpp>
-#include <boost/serialization/nvp.hpp>
+
+#ifndef BOOST_BIMAP_DISABLE_SERIALIZATION
+ #include <boost/serialization/nvp.hpp>
+#endif // BOOST_BIMAP_DISABLE_SERIALIZATION
#include <boost/functional/hash/hash.hpp>
diff --git a/boost/bimap/views/unconstrained_map_view.hpp b/boost/bimap/views/unconstrained_map_view.hpp
index da9b4b47af..ce47541e48 100644
--- a/boost/bimap/views/unconstrained_map_view.hpp
+++ b/boost/bimap/views/unconstrained_map_view.hpp
@@ -29,7 +29,7 @@ class unconstrained_map_view
{
public:
template< class T >
- unconstrained_map_view(const T & t) {}
+ unconstrained_map_view(const T &) {}
typedef void reference;
typedef void const_reference;
diff --git a/boost/bimap/views/unconstrained_set_view.hpp b/boost/bimap/views/unconstrained_set_view.hpp
index 6b4a6e220d..e4ada9d08c 100644
--- a/boost/bimap/views/unconstrained_set_view.hpp
+++ b/boost/bimap/views/unconstrained_set_view.hpp
@@ -29,7 +29,7 @@ class unconstrained_set_view
{
public:
template< class T >
- unconstrained_set_view(const T & t) {}
+ unconstrained_set_view(const T &) {}
typedef void iterator;
typedef void const_iterator;
diff --git a/boost/chrono/config.hpp b/boost/chrono/config.hpp
index a852b103a7..b7d0c0d198 100644
--- a/boost/chrono/config.hpp
+++ b/boost/chrono/config.hpp
@@ -13,6 +13,14 @@
#include <boost/config.hpp>
+#if !defined BOOST_CHRONO_VERSION
+#define BOOST_CHRONO_VERSION 1
+#else
+#if BOOST_CHRONO_VERSION!=1 && BOOST_CHRONO_VERSION!=2
+#error "BOOST_CHRONO_VERSION must be 1 or 2"
+#endif
+#endif
+
#if defined(BOOST_CHRONO_SOURCE) && !defined(BOOST_USE_WINDOWS_H)
#define BOOST_USE_WINDOWS_H
#endif
@@ -62,12 +70,8 @@
# if defined( BOOST_CHRONO_POSIX_API )
# define BOOST_CHRONO_HAS_PROCESS_CLOCKS
# include <time.h> //to check for CLOCK_REALTIME and CLOCK_MONOTONIC and _POSIX_THREAD_CPUTIME
-# if defined(CLOCK_REALTIME)
-# if defined(CLOCK_MONOTONIC)
-# define BOOST_CHRONO_HAS_CLOCK_STEADY
-# endif
-# else
-# error <time.h> does not supply CLOCK_REALTIME
+# if defined(CLOCK_MONOTONIC)
+# define BOOST_CHRONO_HAS_CLOCK_STEADY
# endif
# if defined(_POSIX_THREAD_CPUTIME) && !defined(BOOST_DISABLE_THREADS)
# define BOOST_CHRONO_HAS_THREAD_CLOCK
@@ -81,6 +85,10 @@
# undef BOOST_CHRONO_HAS_THREAD_CLOCK
# undef BOOST_CHRONO_THREAD_CLOCK_IS_STEADY
# endif
+# if defined(__HP_aCC) && defined(__hpux)
+# undef BOOST_CHRONO_HAS_THREAD_CLOCK
+# undef BOOST_CHRONO_THREAD_CLOCK_IS_STEADY
+# endif
# endif
#if defined(BOOST_CHRONO_THREAD_DISABLED) && defined(BOOST_CHRONO_HAS_THREAD_CLOCK)
@@ -88,6 +96,7 @@
#undef BOOST_CHRONO_THREAD_CLOCK_IS_STEADY
#endif
+//#undef BOOST_CHRONO_HAS_PROCESS_CLOCKS
// unicode support ------------------------------//
@@ -134,7 +143,6 @@
#define BOOST_CHRONO_DECL
#endif
-
//#define BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
// enable automatic library variant selection ------------------------------//
@@ -158,4 +166,3 @@
#endif // auto-linking disabled
#endif // BOOST_CHRONO_HEADER_ONLY
#endif // BOOST_CHRONO_CONFIG_HPP
-
diff --git a/boost/chrono/detail/inlined/posix/process_cpu_clocks.hpp b/boost/chrono/detail/inlined/posix/process_cpu_clocks.hpp
index d76d9356cf..5d5c4f4806 100644
--- a/boost/chrono/detail/inlined/posix/process_cpu_clocks.hpp
+++ b/boost/chrono/detail/inlined/posix/process_cpu_clocks.hpp
@@ -32,8 +32,8 @@ namespace chrono_detail
factor = -1;
else
{
- BOOST_ASSERT( factor <= 1000000l ); // doesn't handle large ticks
- factor = 1000000l / factor; // compute factor
+ BOOST_ASSERT( factor <= 1000000000l ); // doesn't handle large ticks
+ factor = 1000000000l / factor; // compute factor
if ( !factor ) factor = -1;
}
}
@@ -54,7 +54,7 @@ process_real_cpu_clock::time_point process_real_cpu_clock::now() BOOST_NOEXCEPT
if ( chrono_detail::tick_factor() != -1 )
{
return time_point(
- microseconds(c*chrono_detail::tick_factor()));
+ nanoseconds(c*chrono_detail::tick_factor()));
}
else
{
@@ -66,9 +66,9 @@ process_real_cpu_clock::time_point process_real_cpu_clock::now() BOOST_NOEXCEPT
#if !defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
process_real_cpu_clock::time_point process_real_cpu_clock::now(
- system::error_code & ec)
+ system::error_code & ec)
{
-
+
tms tm;
clock_t c = ::times( &tm );
if ( c == clock_t(-1) ) // error
@@ -76,9 +76,9 @@ process_real_cpu_clock::time_point process_real_cpu_clock::now(
if (BOOST_CHRONO_IS_THROWS(ec))
{
boost::throw_exception(
- system::system_error(
- errno,
- BOOST_CHRONO_SYSTEM_CATEGORY,
+ system::system_error(
+ errno,
+ BOOST_CHRONO_SYSTEM_CATEGORY,
"chrono::process_real_cpu_clock" ));
}
else
@@ -91,21 +91,21 @@ process_real_cpu_clock::time_point process_real_cpu_clock::now(
{
if ( chrono_detail::tick_factor() != -1 )
{
- if (!BOOST_CHRONO_IS_THROWS(ec))
+ if (!BOOST_CHRONO_IS_THROWS(ec))
{
ec.clear();
}
return time_point(
- microseconds(c*chrono_detail::tick_factor()));
+ nanoseconds(c*chrono_detail::tick_factor()));
}
else
{
if (BOOST_CHRONO_IS_THROWS(ec))
{
boost::throw_exception(
- system::system_error(
- errno,
- BOOST_CHRONO_SYSTEM_CATEGORY,
+ system::system_error(
+ errno,
+ BOOST_CHRONO_SYSTEM_CATEGORY,
"chrono::process_real_cpu_clock" ));
}
else
@@ -131,7 +131,7 @@ process_user_cpu_clock::time_point process_user_cpu_clock::now() BOOST_NOEXCEPT
if ( chrono_detail::tick_factor() != -1 )
{
return time_point(
- microseconds((tm.tms_utime + tm.tms_cutime)*chrono_detail::tick_factor()));
+ nanoseconds((tm.tms_utime + tm.tms_cutime)*chrono_detail::tick_factor()));
}
else
{
@@ -152,9 +152,9 @@ process_user_cpu_clock::time_point process_user_cpu_clock::now(
if (BOOST_CHRONO_IS_THROWS(ec))
{
boost::throw_exception(
- system::system_error(
- errno,
- BOOST_CHRONO_SYSTEM_CATEGORY,
+ system::system_error(
+ errno,
+ BOOST_CHRONO_SYSTEM_CATEGORY,
"chrono::process_user_cpu_clock" ));
}
else
@@ -167,21 +167,21 @@ process_user_cpu_clock::time_point process_user_cpu_clock::now(
{
if ( chrono_detail::tick_factor() != -1 )
{
- if (!BOOST_CHRONO_IS_THROWS(ec))
+ if (!BOOST_CHRONO_IS_THROWS(ec))
{
ec.clear();
}
return time_point(
- microseconds((tm.tms_utime + tm.tms_cutime)*chrono_detail::tick_factor()));
+ nanoseconds((tm.tms_utime + tm.tms_cutime)*chrono_detail::tick_factor()));
}
else
{
if (BOOST_CHRONO_IS_THROWS(ec))
{
boost::throw_exception(
- system::system_error(
- errno,
- BOOST_CHRONO_SYSTEM_CATEGORY,
+ system::system_error(
+ errno,
+ BOOST_CHRONO_SYSTEM_CATEGORY,
"chrono::process_user_cpu_clock" ));
}
else
@@ -208,11 +208,12 @@ process_system_cpu_clock::time_point process_system_cpu_clock::now() BOOST_NOEXC
if ( chrono_detail::tick_factor() != -1 )
{
return time_point(
- microseconds((tm.tms_stime + tm.tms_cstime)*chrono_detail::tick_factor()));
+ nanoseconds((tm.tms_stime + tm.tms_cstime)*chrono_detail::tick_factor()));
}
else
{
BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
+ return time_point();
}
}
}
@@ -248,7 +249,7 @@ process_system_cpu_clock::time_point process_system_cpu_clock::now(
ec.clear();
}
return time_point(
- microseconds((tm.tms_stime + tm.tms_cstime)*chrono_detail::tick_factor()));
+ nanoseconds((tm.tms_stime + tm.tms_cstime)*chrono_detail::tick_factor()));
}
else
{
@@ -297,8 +298,8 @@ process_cpu_clock::time_point process_cpu_clock::now() BOOST_NOEXCEPT
}
#if !defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
-process_cpu_clock::time_point process_cpu_clock::now(
- system::error_code & ec )
+process_cpu_clock::time_point process_cpu_clock::now(
+ system::error_code & ec )
{
tms tm;
clock_t c = ::times( &tm );
@@ -307,9 +308,9 @@ process_cpu_clock::time_point process_cpu_clock::now(
if (BOOST_CHRONO_IS_THROWS(ec))
{
boost::throw_exception(
- system::system_error(
- errno,
- BOOST_CHRONO_SYSTEM_CATEGORY,
+ system::system_error(
+ errno,
+ BOOST_CHRONO_SYSTEM_CATEGORY,
"chrono::process_clock" ));
}
else
@@ -333,9 +334,9 @@ process_cpu_clock::time_point process_cpu_clock::now(
if (BOOST_CHRONO_IS_THROWS(ec))
{
boost::throw_exception(
- system::system_error(
- errno,
- BOOST_CHRONO_SYSTEM_CATEGORY,
+ system::system_error(
+ errno,
+ BOOST_CHRONO_SYSTEM_CATEGORY,
"chrono::process_clock" ));
}
else
@@ -345,7 +346,7 @@ process_cpu_clock::time_point process_cpu_clock::now(
}
}
}
-
+
}
#endif
diff --git a/boost/chrono/detail/inlined/posix/thread_clock.hpp b/boost/chrono/detail/inlined/posix/thread_clock.hpp
index 5ad41f84e3..42a544a0d6 100644
--- a/boost/chrono/detail/inlined/posix/thread_clock.hpp
+++ b/boost/chrono/detail/inlined/posix/thread_clock.hpp
@@ -15,6 +15,7 @@
#include <cassert>
# include <sys/times.h>
+# include <pthread.h>
# include <unistd.h>
namespace boost { namespace chrono {
@@ -45,7 +46,7 @@ namespace boost { namespace chrono {
}
#if !defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
- thread_clock::time_point thread_clock::now( system::error_code & ec )
+ thread_clock::time_point thread_clock::now( system::error_code & ec )
{
struct timespec ts;
#if defined CLOCK_THREAD_CPUTIME_ID
@@ -64,9 +65,9 @@ namespace boost { namespace chrono {
if (BOOST_CHRONO_IS_THROWS(ec))
{
boost::throw_exception(
- system::system_error(
- errno,
- BOOST_CHRONO_SYSTEM_CATEGORY,
+ system::system_error(
+ errno,
+ BOOST_CHRONO_SYSTEM_CATEGORY,
"chrono::thread_clock" ));
}
else
@@ -75,7 +76,7 @@ namespace boost { namespace chrono {
return time_point();
}
}
- if (!BOOST_CHRONO_IS_THROWS(ec))
+ if (!BOOST_CHRONO_IS_THROWS(ec))
{
ec.clear();
}
diff --git a/boost/chrono/detail/inlined/win/chrono.hpp b/boost/chrono/detail/inlined/win/chrono.hpp
index d953fe4bb4..75160dba97 100644
--- a/boost/chrono/detail/inlined/win/chrono.hpp
+++ b/boost/chrono/detail/inlined/win/chrono.hpp
@@ -42,6 +42,7 @@ namespace chrono_detail
(!boost::detail::win32::QueryPerformanceCounter( &pcount )) )
{
BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
+ return steady_clock::time_point();
}
return steady_clock::time_point(steady_clock::duration(
diff --git a/boost/chrono/detail/inlined/win/process_cpu_clocks.hpp b/boost/chrono/detail/inlined/win/process_cpu_clocks.hpp
index 6453aa600a..1b7e67a120 100644
--- a/boost/chrono/detail/inlined/win/process_cpu_clocks.hpp
+++ b/boost/chrono/detail/inlined/win/process_cpu_clocks.hpp
@@ -34,8 +34,9 @@ process_real_cpu_clock::time_point process_real_cpu_clock::now() BOOST_NOEXCEPT
{
BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
}
+ typedef ratio_divide<giga, ratio<CLOCKS_PER_SEC> >::type R;
return time_point(
- duration(c*(1000000000l/CLOCKS_PER_SEC))
+ duration(static_cast<rep>(c)*R::num/R::den)
);
}
@@ -56,8 +57,9 @@ process_real_cpu_clock::time_point process_real_cpu_clock::now(
{
ec.clear();
}
+ typedef ratio_divide<giga, ratio<CLOCKS_PER_SEC> >::type R;
return time_point(
- duration(c*(1000000000l/CLOCKS_PER_SEC))
+ duration(static_cast<rep>(c)*R::num/R::den)
);
}
#endif
diff --git a/boost/chrono/detail/no_warning/signed_unsigned_cmp.hpp b/boost/chrono/detail/no_warning/signed_unsigned_cmp.hpp
index 78a0ce13e7..491c1d64a0 100644
--- a/boost/chrono/detail/no_warning/signed_unsigned_cmp.hpp
+++ b/boost/chrono/detail/no_warning/signed_unsigned_cmp.hpp
@@ -41,4 +41,4 @@ namespace detail {
} // namespace detail
} // namespace chrono
-#endif // BOOST_CHRONO_DETAIL_IS_EVENLY_DIVISIBLE_BY_HPP
+#endif // BOOST_CHRONO_DETAIL_NO_WARNING_SIGNED_UNSIGNED_CMP_HPP
diff --git a/boost/chrono/detail/scan_keyword.hpp b/boost/chrono/detail/scan_keyword.hpp
index 13ad0ca8c8..7c3ba6e2af 100644
--- a/boost/chrono/detail/scan_keyword.hpp
+++ b/boost/chrono/detail/scan_keyword.hpp
@@ -23,10 +23,11 @@
#include <ios>
#include <exception>
#include <stdlib.h>
+#include <boost/throw_exception.hpp>
namespace boost {
using interprocess::unique_ptr;
-
+
namespace chrono {
namespace chrono_detail {
@@ -65,13 +66,13 @@ scan_keyword(InputIterator& b, InputIterator e,
unsigned char statbuf[100];
unsigned char* status = statbuf;
// Change free by free_aux to avoid
- // Error: Could not find a match for boost::interprocess::unique_ptr<unsigned char, void(*)(void*)>::unique_ptr(int, extern "C" void(void*))
+ // Error: Could not find a match for boost::interprocess::unique_ptr<unsigned char, void(*)(void*)>::unique_ptr(int, extern "C" void(void*))
unique_ptr<unsigned char, void(*)(void*)> stat_hold(0, free_aux);
if (nkw > sizeof(statbuf))
{
status = (unsigned char*)malloc(nkw);
if (status == 0)
- throw std::bad_alloc();
+ throw_exception(std::bad_alloc());
stat_hold.reset(status);
}
size_t n_might_match = nkw; // At this point, any keyword might match
diff --git a/boost/chrono/detail/system.hpp b/boost/chrono/detail/system.hpp
index f8a40f12a8..0dcffe8521 100644
--- a/boost/chrono/detail/system.hpp
+++ b/boost/chrono/detail/system.hpp
@@ -6,6 +6,8 @@
#ifndef BOOST_CHRONO_DETAIL_SYSTEM_HPP
#define BOOST_CHRONO_DETAIL_SYSTEM_HPP
+#if !defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
+
#include <boost/version.hpp>
#include <boost/system/error_code.hpp>
@@ -15,7 +17,7 @@
#define BOOST_CHRONO_SYSTEM_CATEGORY boost::system::system_category()
#endif
-#ifdef BOOST_SYSTEM_NO_DEPRECATED
+#ifdef BOOST_SYSTEM_NO_DEPRECATED
#define BOOST_CHRONO_THROWS boost::throws()
#define BOOST_CHRONO_IS_THROWS(EC) (&EC==&boost::throws())
#else
@@ -24,3 +26,4 @@
#endif
#endif
+#endif
diff --git a/boost/chrono/duration.hpp b/boost/chrono/duration.hpp
index 323474014d..e32357cc72 100644
--- a/boost/chrono/duration.hpp
+++ b/boost/chrono/duration.hpp
@@ -58,6 +58,10 @@ time2_demo contained this comment:
#define BOOST_CHRONO_SECOND_TEMPLATE_PARAMETER_OF_TIME_POINT_MUST_BE_A_BOOST_CHRONO_DURATION "Second template parameter of time_point must be a boost::chrono::duration"
#endif
+#ifndef BOOST_CHRONO_HEADER_ONLY
+// this must occur after all of the includes and before any code appears:
+#include <boost/config/abi_prefix.hpp> // must be the last #include
+#endif
//----------------------------------------------------------------------------//
// //
@@ -447,7 +451,7 @@ namespace chrono {
>
>::type* = 0
) : rep_(r) { }
- ~duration() {} //= default;
+ //~duration() {} //= default;
BOOST_CONSTEXPR
duration(const duration& rhs) : rep_(rhs.rep_) {} // = default;
duration& operator=(const duration& rhs) // = default;
@@ -660,7 +664,7 @@ namespace detail
template <class LhsDuration, class RhsDuration>
struct duration_eq
{
- bool operator()(const LhsDuration& lhs, const RhsDuration& rhs)
+ BOOST_CONSTEXPR bool operator()(const LhsDuration& lhs, const RhsDuration& rhs)
{
typedef typename common_type<LhsDuration, RhsDuration>::type CD;
return CD(lhs).count() == CD(rhs).count();
@@ -670,7 +674,7 @@ namespace detail
template <class LhsDuration>
struct duration_eq<LhsDuration, LhsDuration>
{
- bool operator()(const LhsDuration& lhs, const LhsDuration& rhs)
+ BOOST_CONSTEXPR bool operator()(const LhsDuration& lhs, const LhsDuration& rhs)
{
return lhs.count() == rhs.count();
}
@@ -679,7 +683,7 @@ namespace detail
template <class LhsDuration, class RhsDuration>
struct duration_lt
{
- bool operator()(const LhsDuration& lhs, const RhsDuration& rhs)
+ BOOST_CONSTEXPR bool operator()(const LhsDuration& lhs, const RhsDuration& rhs)
{
typedef typename common_type<LhsDuration, RhsDuration>::type CD;
return CD(lhs).count() < CD(rhs).count();
@@ -689,7 +693,7 @@ namespace detail
template <class LhsDuration>
struct duration_lt<LhsDuration, LhsDuration>
{
- bool operator()(const LhsDuration& lhs, const LhsDuration& rhs)
+ BOOST_CONSTEXPR bool operator()(const LhsDuration& lhs, const LhsDuration& rhs)
{
return lhs.count() < rhs.count();
}
@@ -783,4 +787,9 @@ namespace detail
} // namespace chrono
} // namespace boost
+#ifndef BOOST_CHRONO_HEADER_ONLY
+// the suffix header occurs after all of our code:
+#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
+#endif
+
#endif // BOOST_CHRONO_DURATION_HPP
diff --git a/boost/chrono/process_cpu_clocks.hpp b/boost/chrono/process_cpu_clocks.hpp
index 12ec2e39bf..486950da40 100644
--- a/boost/chrono/process_cpu_clocks.hpp
+++ b/boost/chrono/process_cpu_clocks.hpp
@@ -18,15 +18,11 @@
#include <boost/chrono/duration.hpp>
#include <boost/chrono/time_point.hpp>
#include <boost/operators.hpp>
-#if !defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
-#include <boost/system/error_code.hpp>
#include <boost/chrono/detail/system.hpp>
-#endif
#include <iostream>
#include <boost/type_traits/common_type.hpp>
#include <boost/chrono/clock_string.hpp>
-
#ifndef BOOST_CHRONO_HEADER_ONLY
#include <boost/config/abi_prefix.hpp> // must be the last #include
#endif
diff --git a/boost/chrono/system_clocks.hpp b/boost/chrono/system_clocks.hpp
index bb62610c72..df8b79e207 100644
--- a/boost/chrono/system_clocks.hpp
+++ b/boost/chrono/system_clocks.hpp
@@ -31,7 +31,6 @@ time2_demo contained this comment:
TODO:
* Fully implement error handling, with test cases.
- * Use boost::throw_exception. (Currently not used because of an issue with Intel 11.0.)
* Consider issues raised by Michael Marcin:
> In the past I've seen QueryPerformanceCounter give incorrect results,
@@ -62,14 +61,17 @@ TODO:
#include <boost/chrono/config.hpp>
#include <boost/chrono/duration.hpp>
#include <boost/chrono/time_point.hpp>
-#if !defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
#include <boost/chrono/detail/system.hpp>
-#include <boost/system/error_code.hpp>
-#endif
#include <boost/chrono/clock_string.hpp>
#include <ctime>
+# if defined( BOOST_CHRONO_POSIX_API )
+# if ! defined(CLOCK_REALTIME)
+# error <time.h> does not supply CLOCK_REALTIME
+# endif
+# endif
+
#ifdef BOOST_CHRONO_WINDOWS_API
// The system_clock tick is 100 nanoseconds
# define BOOST_SYSTEM_CLOCK_DURATION boost::chrono::duration<boost::int_least64_t, ratio<BOOST_RATIO_INTMAX_C(1), BOOST_RATIO_INTMAX_C(10000000)> >
@@ -77,6 +79,7 @@ TODO:
# define BOOST_SYSTEM_CLOCK_DURATION boost::chrono::nanoseconds
#endif
+// this must occur after all of the includes and before any code appears:
#ifndef BOOST_CHRONO_HEADER_ONLY
#include <boost/config/abi_prefix.hpp> // must be the last #include
#endif
@@ -221,6 +224,7 @@ namespace chrono {
} // namespace boost
#ifndef BOOST_CHRONO_HEADER_ONLY
+// the suffix header occurs after all of our code:
#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
#else
#include <boost/chrono/detail/inlined/chrono.hpp>
diff --git a/boost/chrono/thread_clock.hpp b/boost/chrono/thread_clock.hpp
index 7022c61dc1..207697b4cc 100644
--- a/boost/chrono/thread_clock.hpp
+++ b/boost/chrono/thread_clock.hpp
@@ -17,10 +17,7 @@
#include <boost/chrono/config.hpp>
#include <boost/chrono/duration.hpp>
#include <boost/chrono/time_point.hpp>
-#if !defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
-#include <boost/system/error_code.hpp>
#include <boost/chrono/detail/system.hpp>
-#endif
#include <boost/chrono/clock_string.hpp>
#ifndef BOOST_CHRONO_HEADER_ONLY
@@ -49,7 +46,7 @@ struct clock_string<thread_clock, CharT>
static std::basic_string<CharT> name()
{
static const CharT u[] =
- { 't', 'h', 'r', 'e', 'd', '_',
+ { 't', 'h', 'r', 'e', 'a', 'd', '_',
'c', 'l','o', 'c', 'k'};
static const std::basic_string<CharT> str(u, u + sizeof(u)/sizeof(u[0]));
return str;
@@ -57,7 +54,7 @@ struct clock_string<thread_clock, CharT>
static std::basic_string<CharT> since()
{
const CharT u[] =
- { ' ', 's', 'i', 'n', 'c', 'e', ' ', 't', 'r', 'e', 'a', 'd', ' ', 's', 't', 'a', 'r', 't', '-', 'u', 'p'};
+ { ' ', 's', 'i', 'n', 'c', 'e', ' ', 't', 'h', 'r', 'e', 'a', 'd', ' ', 's', 't', 'a', 'r', 't', '-', 'u', 'p'};
const std::basic_string<CharT> str(u, u + sizeof(u)/sizeof(u[0]));
return str;
}
diff --git a/boost/chrono/time_point.hpp b/boost/chrono/time_point.hpp
index bef49cb405..9aad25e66c 100644
--- a/boost/chrono/time_point.hpp
+++ b/boost/chrono/time_point.hpp
@@ -2,7 +2,7 @@
// Copyright 2008 Howard Hinnant
// Copyright 2008 Beman Dawes
-// Copyright 2009-2011 Vicente J. Botet Escriba
+// Copyright 2009-2012 Vicente J. Botet Escriba
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
@@ -32,8 +32,11 @@ time2_demo contained this comment:
#include <boost/chrono/duration.hpp>
#include <iostream>
-#include <boost/chrono/detail/system.hpp>
+#ifndef BOOST_CHRONO_HEADER_ONLY
+// this must occur after all of the includes and before any code appears:
+#include <boost/config/abi_prefix.hpp> // must be the last #include
+#endif
//----------------------------------------------------------------------------//
// //
@@ -160,7 +163,7 @@ namespace chrono {
typedef typename duration::rep rep;
typedef typename duration::period period;
typedef Duration difference_type;
-
+
private:
duration d_;
@@ -194,7 +197,7 @@ namespace chrono {
// arithmetic
-#ifdef BOOST_CHRONO_EXTENSIONS
+#ifdef BOOST_CHRONO_EXTENSIONS
BOOST_CONSTEXPR
time_point operator+() const {return *this;}
BOOST_CONSTEXPR
@@ -202,13 +205,13 @@ namespace chrono {
time_point& operator++() {++d_; return *this;}
time_point operator++(int) {return time_point(d_++);}
time_point& operator--() {--d_; return *this;}
- time_point operator--(int) {return time_point(d_--);}
+ time_point operator--(int) {return time_point(d_--);}
time_point& operator+=(const rep& r) {d_ += duration(r); return *this;}
time_point& operator-=(const rep& r) {d_ -= duration(r); return *this;}
#endif
-
+
time_point& operator+=(const duration& d) {d_ += d; return *this;}
time_point& operator-=(const duration& d) {d_ -= d; return *this;}
@@ -368,4 +371,9 @@ namespace chrono {
} // namespace chrono
} // namespace boost
+#ifndef BOOST_CHRONO_HEADER_ONLY
+// the suffix header occurs after all of our code:
+#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
+#endif
+
#endif // BOOST_CHRONO_TIME_POINT_HPP
diff --git a/boost/concept_check.hpp b/boost/concept_check.hpp
index 01b2f4ec27..bf5a2af783 100644
--- a/boost/concept_check.hpp
+++ b/boost/concept_check.hpp
@@ -1052,11 +1052,11 @@ namespace boost
c.swap(c);
}
- void const_constraints(const C& c) {
- ci = c.begin();
- ci = c.end();
- n = c.size();
- b = c.empty();
+ void const_constraints(const C& cc) {
+ ci = cc.begin();
+ ci = cc.end();
+ n = cc.size();
+ b = cc.empty();
}
private:
diff --git a/boost/config/compiler/borland.hpp b/boost/config/compiler/borland.hpp
index 680e87bde8..cffa8ea0ea 100644
--- a/boost/config/compiler/borland.hpp
+++ b/boost/config/compiler/borland.hpp
@@ -47,7 +47,7 @@
# define BOOST_NO_OPERATORS_IN_NAMESPACE
# endif
// Variadic macros do not exist for C++ Builder versions 5 and below
-#define BOOST_NO_VARIADIC_MACROS
+#define BOOST_NO_CXX11_VARIADIC_MACROS
# endif
// Version 5.51 and below:
@@ -150,14 +150,14 @@
// C++0x Macros:
//
#if !defined( BOOST_CODEGEAR_0X_SUPPORT ) || (__BORLANDC__ < 0x610)
-# define BOOST_NO_CHAR16_T
-# define BOOST_NO_CHAR32_T
-# define BOOST_NO_DECLTYPE
-# define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
-# define BOOST_NO_EXTERN_TEMPLATE
-# define BOOST_NO_RVALUE_REFERENCES
-# define BOOST_NO_SCOPED_ENUMS
-# define BOOST_NO_STATIC_ASSERT
+# define BOOST_NO_CXX11_CHAR16_T
+# define BOOST_NO_CXX11_CHAR32_T
+# define BOOST_NO_CXX11_DECLTYPE
+# define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+# define BOOST_NO_CXX11_EXTERN_TEMPLATE
+# define BOOST_NO_CXX11_RVALUE_REFERENCES
+# define BOOST_NO_CXX11_SCOPED_ENUMS
+# define BOOST_NO_CXX11_STATIC_ASSERT
#else
# define BOOST_HAS_ALIGNOF
# define BOOST_HAS_CHAR16_T
@@ -169,25 +169,27 @@
# define BOOST_HAS_STATIC_ASSERT
#endif
-#define BOOST_NO_AUTO_DECLARATIONS
-#define BOOST_NO_AUTO_MULTIDECLARATIONS
-#define BOOST_NO_CONSTEXPR
-#define BOOST_NO_DECLTYPE_N3276
-#define BOOST_NO_DEFAULTED_FUNCTIONS
-#define BOOST_NO_DELETED_FUNCTIONS
-#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
-#define BOOST_NO_INITIALIZER_LISTS
-#define BOOST_NO_LAMBDAS
-#define BOOST_NO_NULLPTR
-#define BOOST_NO_RAW_LITERALS
-#define BOOST_NO_RVALUE_REFERENCES
-#define BOOST_NO_SCOPED_ENUMS
+#define BOOST_NO_CXX11_AUTO_DECLARATIONS
+#define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+#define BOOST_NO_CXX11_CONSTEXPR
+#define BOOST_NO_CXX11_DECLTYPE_N3276
+#define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+#define BOOST_NO_CXX11_DELETED_FUNCTIONS
+#define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+#define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+#define BOOST_NO_CXX11_LAMBDAS
+#define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+#define BOOST_NO_CXX11_NULLPTR
+#define BOOST_NO_CXX11_RANGE_BASED_FOR
+#define BOOST_NO_CXX11_RAW_LITERALS
+#define BOOST_NO_CXX11_RVALUE_REFERENCES
+#define BOOST_NO_CXX11_SCOPED_ENUMS
#define BOOST_NO_SFINAE_EXPR
-#define BOOST_NO_TEMPLATE_ALIASES
-#define BOOST_NO_UNICODE_LITERALS // UTF-8 still not supported
-#define BOOST_NO_VARIADIC_TEMPLATES
-#define BOOST_NO_NOEXCEPT
-#define BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
+#define BOOST_NO_CXX11_TEMPLATE_ALIASES
+#define BOOST_NO_CXX11_UNICODE_LITERALS // UTF-8 still not supported
+#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#define BOOST_NO_CXX11_NOEXCEPT
+#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
#if __BORLANDC__ >= 0x590
# define BOOST_HAS_TR1_HASH
diff --git a/boost/config/compiler/clang.hpp b/boost/config/compiler/clang.hpp
index a183f34be7..aab3c610c9 100644
--- a/boost/config/compiler/clang.hpp
+++ b/boost/config/compiler/clang.hpp
@@ -8,15 +8,18 @@
// Clang compiler setup.
-#if __has_feature(cxx_exceptions) && !defined(BOOST_NO_EXCEPTIONS)
-#else
+#if !__has_feature(cxx_exceptions) && !defined(BOOST_NO_EXCEPTIONS)
# define BOOST_NO_EXCEPTIONS
#endif
-#if !__has_feature(cxx_rtti)
+#if !__has_feature(cxx_rtti) && !defined(BOOST_NO_RTTI)
# define BOOST_NO_RTTI
#endif
+#if !__has_feature(cxx_rtti) && !defined(BOOST_NO_TYPEID)
+# define BOOST_NO_TYPEID
+#endif
+
#if defined(__int64)
# define BOOST_HAS_MS_INT64
#endif
@@ -24,89 +27,100 @@
#define BOOST_HAS_NRVO
// Clang supports "long long" in all compilation modes.
+#define BOOST_HAS_LONG_LONG
#if !__has_feature(cxx_auto_type)
-# define BOOST_NO_AUTO_DECLARATIONS
-# define BOOST_NO_AUTO_MULTIDECLARATIONS
+# define BOOST_NO_CXX11_AUTO_DECLARATIONS
+# define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
#endif
#if !(defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L)
-# define BOOST_NO_CHAR16_T
-# define BOOST_NO_CHAR32_T
+# define BOOST_NO_CXX11_CHAR16_T
+# define BOOST_NO_CXX11_CHAR32_T
#endif
#if !__has_feature(cxx_constexpr)
-# define BOOST_NO_CONSTEXPR
+# define BOOST_NO_CXX11_CONSTEXPR
#endif
#if !__has_feature(cxx_decltype)
-# define BOOST_NO_DECLTYPE
+# define BOOST_NO_CXX11_DECLTYPE
#endif
-#define BOOST_NO_DECLTYPE_N3276
+#if !__has_feature(cxx_decltype_incomplete_return_types)
+# define BOOST_NO_CXX11_DECLTYPE_N3276
+#endif
#if !__has_feature(cxx_defaulted_functions)
-# define BOOST_NO_DEFAULTED_FUNCTIONS
+# define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
#endif
#if !__has_feature(cxx_deleted_functions)
-# define BOOST_NO_DELETED_FUNCTIONS
+# define BOOST_NO_CXX11_DELETED_FUNCTIONS
#endif
#if !__has_feature(cxx_explicit_conversions)
-# define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
+# define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
#endif
#if !__has_feature(cxx_default_function_template_args)
-# define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
+# define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
#endif
#if !__has_feature(cxx_generalized_initializers)
-# define BOOST_NO_INITIALIZER_LISTS
+# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
#endif
#if !__has_feature(cxx_lambdas)
-# define BOOST_NO_LAMBDAS
+# define BOOST_NO_CXX11_LAMBDAS
+#endif
+
+#if !__has_feature(cxx_local_type_template_args)
+# define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
#endif
#if !__has_feature(cxx_noexcept)
-# define BOOST_NO_NOEXCEPT
+# define BOOST_NO_CXX11_NOEXCEPT
#endif
#if !__has_feature(cxx_nullptr)
-# define BOOST_NO_NULLPTR
+# define BOOST_NO_CXX11_NULLPTR
+#endif
+
+#if !__has_feature(cxx_range_for)
+# define BOOST_NO_CXX11_RANGE_BASED_FOR
#endif
#if !__has_feature(cxx_raw_string_literals)
-# define BOOST_NO_RAW_LITERALS
+# define BOOST_NO_CXX11_RAW_LITERALS
#endif
#if !__has_feature(cxx_generalized_initializers)
-# define BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
+# define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
#endif
#if !__has_feature(cxx_rvalue_references)
-# define BOOST_NO_RVALUE_REFERENCES
+# define BOOST_NO_CXX11_RVALUE_REFERENCES
#endif
#if !__has_feature(cxx_strong_enums)
-# define BOOST_NO_SCOPED_ENUMS
+# define BOOST_NO_CXX11_SCOPED_ENUMS
#endif
#if !__has_feature(cxx_static_assert)
-# define BOOST_NO_STATIC_ASSERT
+# define BOOST_NO_CXX11_STATIC_ASSERT
#endif
#if !__has_feature(cxx_alias_templates)
-# define BOOST_NO_TEMPLATE_ALIASES
+# define BOOST_NO_CXX11_TEMPLATE_ALIASES
#endif
#if !__has_feature(cxx_unicode_literals)
-# define BOOST_NO_UNICODE_LITERALS
+# define BOOST_NO_CXX11_UNICODE_LITERALS
#endif
#if !__has_feature(cxx_variadic_templates)
-# define BOOST_NO_VARIADIC_TEMPLATES
+# define BOOST_NO_CXX11_VARIADIC_TEMPLATES
#endif
// Clang always supports variadic macros
diff --git a/boost/config/compiler/codegear.hpp b/boost/config/compiler/codegear.hpp
index f1887a0c0b..1a6df33520 100644
--- a/boost/config/compiler/codegear.hpp
+++ b/boost/config/compiler/codegear.hpp
@@ -76,7 +76,7 @@
// C++0x macros:
//
#if (__CODEGEARC__ <= 0x620)
-#define BOOST_NO_STATIC_ASSERT
+#define BOOST_NO_CXX11_STATIC_ASSERT
#else
#define BOOST_HAS_STATIC_ASSERT
#endif
@@ -91,24 +91,25 @@
// #define BOOST_HAS_STATIC_ASSERT
#define BOOST_HAS_STD_TYPE_TRAITS
-#define BOOST_NO_AUTO_DECLARATIONS
-#define BOOST_NO_AUTO_MULTIDECLARATIONS
-#define BOOST_NO_CONSTEXPR
-#define BOOST_NO_DEFAULTED_FUNCTIONS
-#define BOOST_NO_DELETED_FUNCTIONS
-#define BOOST_NO_EXTERN_TEMPLATE
-#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
-#define BOOST_NO_INITIALIZER_LISTS
-#define BOOST_NO_LAMBDAS
-#define BOOST_NO_NOEXCEPT
-#define BOOST_NO_NULLPTR
-#define BOOST_NO_RAW_LITERALS
-#define BOOST_NO_RVALUE_REFERENCES
+#define BOOST_NO_CXX11_AUTO_DECLARATIONS
+#define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+#define BOOST_NO_CXX11_CONSTEXPR
+#define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+#define BOOST_NO_CXX11_DELETED_FUNCTIONS
+#define BOOST_NO_CXX11_EXTERN_TEMPLATE
+#define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+#define BOOST_NO_CXX11_LAMBDAS
+#define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+#define BOOST_NO_CXX11_NOEXCEPT
+#define BOOST_NO_CXX11_NULLPTR
+#define BOOST_NO_CXX11_RANGE_BASED_FOR
+#define BOOST_NO_CXX11_RAW_LITERALS
+#define BOOST_NO_CXX11_RVALUE_REFERENCES
#define BOOST_NO_SFINAE_EXPR
-#define BOOST_NO_TEMPLATE_ALIASES
-#define BOOST_NO_UNICODE_LITERALS
-#define BOOST_NO_VARIADIC_TEMPLATES
-#define BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
+#define BOOST_NO_CXX11_TEMPLATE_ALIASES
+#define BOOST_NO_CXX11_UNICODE_LITERALS
+#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
//
// TR1 macros:
@@ -120,7 +121,7 @@
#define BOOST_HAS_MACRO_USE_FACET
-#define BOOST_NO_INITIALIZER_LISTS
+#define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
// On non-Win32 platforms let the platform config figure this out:
#ifdef _WIN32
diff --git a/boost/config/compiler/common_edg.hpp b/boost/config/compiler/common_edg.hpp
index 10333ad2d3..441a055fa2 100644
--- a/boost/config/compiler/common_edg.hpp
+++ b/boost/config/compiler/common_edg.hpp
@@ -60,39 +60,41 @@
// See above for BOOST_NO_LONG_LONG
//
#if (__EDG_VERSION__ < 310)
-# define BOOST_NO_EXTERN_TEMPLATE
+# define BOOST_NO_CXX11_EXTERN_TEMPLATE
#endif
#if (__EDG_VERSION__ <= 310)
// No support for initializer lists
-# define BOOST_NO_INITIALIZER_LISTS
+# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
#endif
#if (__EDG_VERSION__ < 400)
-# define BOOST_NO_VARIADIC_MACROS
+# define BOOST_NO_CXX11_VARIADIC_MACROS
#endif
-#define BOOST_NO_AUTO_DECLARATIONS
-#define BOOST_NO_AUTO_MULTIDECLARATIONS
-#define BOOST_NO_CHAR16_T
-#define BOOST_NO_CHAR32_T
-#define BOOST_NO_CONSTEXPR
-#define BOOST_NO_DECLTYPE
-#define BOOST_NO_DECLTYPE_N3276
-#define BOOST_NO_DEFAULTED_FUNCTIONS
-#define BOOST_NO_DELETED_FUNCTIONS
-#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
-#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
-#define BOOST_NO_LAMBDAS
-#define BOOST_NO_NOEXCEPT
-#define BOOST_NO_NULLPTR
-#define BOOST_NO_RAW_LITERALS
-#define BOOST_NO_RVALUE_REFERENCES
-#define BOOST_NO_SCOPED_ENUMS
+#define BOOST_NO_CXX11_AUTO_DECLARATIONS
+#define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+#define BOOST_NO_CXX11_CHAR16_T
+#define BOOST_NO_CXX11_CHAR32_T
+#define BOOST_NO_CXX11_CONSTEXPR
+#define BOOST_NO_CXX11_DECLTYPE
+#define BOOST_NO_CXX11_DECLTYPE_N3276
+#define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+#define BOOST_NO_CXX11_DELETED_FUNCTIONS
+#define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+#define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+#define BOOST_NO_CXX11_LAMBDAS
+#define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+#define BOOST_NO_CXX11_NOEXCEPT
+#define BOOST_NO_CXX11_NULLPTR
+#define BOOST_NO_CXX11_RANGE_BASED_FOR
+#define BOOST_NO_CXX11_RAW_LITERALS
+#define BOOST_NO_CXX11_RVALUE_REFERENCES
+#define BOOST_NO_CXX11_SCOPED_ENUMS
#define BOOST_NO_SFINAE_EXPR
-#define BOOST_NO_STATIC_ASSERT
-#define BOOST_NO_TEMPLATE_ALIASES
-#define BOOST_NO_UNICODE_LITERALS
-#define BOOST_NO_VARIADIC_TEMPLATES
-#define BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
+#define BOOST_NO_CXX11_STATIC_ASSERT
+#define BOOST_NO_CXX11_TEMPLATE_ALIASES
+#define BOOST_NO_CXX11_UNICODE_LITERALS
+#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
#ifdef c_plusplus
// EDG has "long long" in non-strict mode
diff --git a/boost/config/compiler/cray.hpp b/boost/config/compiler/cray.hpp
index ad2eeaf55b..5463ea08c7 100644
--- a/boost/config/compiler/cray.hpp
+++ b/boost/config/compiler/cray.hpp
@@ -25,33 +25,35 @@
//
// Cray peculiarities, probably version 7 specific:
//
-#undef BOOST_NO_AUTO_DECLARATIONS
-#undef BOOST_NO_AUTO_MULTIDECLARATIONS
+#undef BOOST_NO_CXX11_AUTO_DECLARATIONS
+#undef BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
#define BOOST_HAS_NRVO
-#define BOOST_NO_VARIADIC_TEMPLATES
-#define BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
-#define BOOST_NO_UNICODE_LITERALS
+#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+#define BOOST_NO_CXX11_UNICODE_LITERALS
#define BOOST_NO_TWO_PHASE_NAME_LOOKUP
#define BOOST_HAS_NRVO
-#define BOOST_NO_TEMPLATE_ALIASES
-#define BOOST_NO_STATIC_ASSERT
+#define BOOST_NO_CXX11_TEMPLATE_ALIASES
+#define BOOST_NO_CXX11_STATIC_ASSERT
#define BOOST_NO_SFINAE_EXPR
-#define BOOST_NO_SCOPED_ENUMS
-#define BOOST_NO_RVALUE_REFERENCES
-#define BOOST_NO_RAW_LITERALS
-#define BOOST_NO_NULLPTR
-#define BOOST_NO_NOEXCEPT
-#define BOOST_NO_LAMBDAS
-#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
-#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
-#define BOOST_NO_DELETED_FUNCTIONS
-#define BOOST_NO_DEFAULTED_FUNCTIONS
-#define BOOST_NO_DECLTYPE_N3276
-#define BOOST_NO_DECLTYPE
-#define BOOST_NO_CONSTEXPR
+#define BOOST_NO_CXX11_SCOPED_ENUMS
+#define BOOST_NO_CXX11_RVALUE_REFERENCES
+#define BOOST_NO_CXX11_RANGE_BASED_FOR
+#define BOOST_NO_CXX11_RAW_LITERALS
+#define BOOST_NO_CXX11_NULLPTR
+#define BOOST_NO_CXX11_NOEXCEPT
+#define BOOST_NO_CXX11_LAMBDAS
+#define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+#define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+#define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+#define BOOST_NO_CXX11_DELETED_FUNCTIONS
+#define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+#define BOOST_NO_CXX11_DECLTYPE_N3276
+#define BOOST_NO_CXX11_DECLTYPE
+#define BOOST_NO_CXX11_CONSTEXPR
#define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
-#define BOOST_NO_CHAR32_T
-#define BOOST_NO_CHAR16_T
+#define BOOST_NO_CXX11_CHAR32_T
+#define BOOST_NO_CXX11_CHAR16_T
//#define BOOST_BCB_PARTIAL_SPECIALIZATION_BUG
#define BOOST_MATH_DISABLE_STD_FPCLASSIFY
//#define BOOST_HAS_FPCLASSIFY
diff --git a/boost/config/compiler/digitalmars.hpp b/boost/config/compiler/digitalmars.hpp
index ed92306fb1..15cc209d00 100644
--- a/boost/config/compiler/digitalmars.hpp
+++ b/boost/config/compiler/digitalmars.hpp
@@ -60,33 +60,35 @@
//
// C++0x features
//
-#define BOOST_NO_AUTO_DECLARATIONS
-#define BOOST_NO_AUTO_MULTIDECLARATIONS
-#define BOOST_NO_CHAR16_T
-#define BOOST_NO_CHAR32_T
-#define BOOST_NO_CONSTEXPR
-#define BOOST_NO_DECLTYPE
-#define BOOST_NO_DECLTYPE_N3276
-#define BOOST_NO_DEFAULTED_FUNCTIONS
-#define BOOST_NO_DELETED_FUNCTIONS
-#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
-#define BOOST_NO_EXTERN_TEMPLATE
-#define BOOST_NO_INITIALIZER_LISTS
-#define BOOST_NO_LAMBDAS
-#define BOOST_NO_NOEXCEPT
-#define BOOST_NO_NULLPTR
-#define BOOST_NO_RAW_LITERALS
-#define BOOST_NO_RVALUE_REFERENCES
-#define BOOST_NO_SCOPED_ENUMS
+#define BOOST_NO_CXX11_AUTO_DECLARATIONS
+#define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+#define BOOST_NO_CXX11_CHAR16_T
+#define BOOST_NO_CXX11_CHAR32_T
+#define BOOST_NO_CXX11_CONSTEXPR
+#define BOOST_NO_CXX11_DECLTYPE
+#define BOOST_NO_CXX11_DECLTYPE_N3276
+#define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+#define BOOST_NO_CXX11_DELETED_FUNCTIONS
+#define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+#define BOOST_NO_CXX11_EXTERN_TEMPLATE
+#define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+#define BOOST_NO_CXX11_LAMBDAS
+#define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+#define BOOST_NO_CXX11_NOEXCEPT
+#define BOOST_NO_CXX11_NULLPTR
+#define BOOST_NO_CXX11_RANGE_BASED_FOR
+#define BOOST_NO_CXX11_RAW_LITERALS
+#define BOOST_NO_CXX11_RVALUE_REFERENCES
+#define BOOST_NO_CXX11_SCOPED_ENUMS
#define BOOST_NO_SFINAE_EXPR
-#define BOOST_NO_STATIC_ASSERT
-#define BOOST_NO_TEMPLATE_ALIASES
-#define BOOST_NO_UNICODE_LITERALS
-#define BOOST_NO_VARIADIC_TEMPLATES
-#define BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
+#define BOOST_NO_CXX11_STATIC_ASSERT
+#define BOOST_NO_CXX11_TEMPLATE_ALIASES
+#define BOOST_NO_CXX11_UNICODE_LITERALS
+#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
#if (__DMC__ < 0x812)
-#define BOOST_NO_VARIADIC_MACROS
+#define BOOST_NO_CXX11_VARIADIC_MACROS
#endif
#if __DMC__ < 0x800
diff --git a/boost/config/compiler/gcc.hpp b/boost/config/compiler/gcc.hpp
index 5a69cb4931..f42fd790ca 100644
--- a/boost/config/compiler/gcc.hpp
+++ b/boost/config/compiler/gcc.hpp
@@ -42,9 +42,9 @@
# define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE
# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
# define BOOST_NO_IS_ABSTRACT
-# define BOOST_NO_EXTERN_TEMPLATE
+# define BOOST_NO_CXX11_EXTERN_TEMPLATE
// Variadic macros do not exist for gcc versions before 3.0
-# define BOOST_NO_VARIADIC_MACROS
+# define BOOST_NO_CXX11_VARIADIC_MACROS
#elif __GNUC__ == 3
# if defined (__PATHSCALE__)
# define BOOST_NO_TWO_PHASE_NAME_LOOKUP
@@ -61,7 +61,7 @@
# if __GNUC_MINOR__ < 4
# define BOOST_NO_IS_ABSTRACT
# endif
-# define BOOST_NO_EXTERN_TEMPLATE
+# define BOOST_NO_CXX11_EXTERN_TEMPLATE
#endif
#if __GNUC__ < 4
//
@@ -146,9 +146,6 @@
# endif
#endif
-// C++0x features not implemented in any GCC version
-//
-#define BOOST_NO_TEMPLATE_ALIASES
// C++0x features in 4.3.n and later
//
@@ -161,30 +158,30 @@
# define BOOST_HAS_STATIC_ASSERT
# define BOOST_HAS_VARIADIC_TMPL
#else
-# define BOOST_NO_DECLTYPE
-# define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
-# define BOOST_NO_RVALUE_REFERENCES
-# define BOOST_NO_STATIC_ASSERT
+# define BOOST_NO_CXX11_DECLTYPE
+# define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+# define BOOST_NO_CXX11_RVALUE_REFERENCES
+# define BOOST_NO_CXX11_STATIC_ASSERT
// Variadic templates compiler:
// http://www.generic-programming.org/~dgregor/cpp/variadic-templates.html
# if defined(__VARIADIC_TEMPLATES) || (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4) && defined(__GXX_EXPERIMENTAL_CXX0X__))
# define BOOST_HAS_VARIADIC_TMPL
# else
-# define BOOST_NO_VARIADIC_TEMPLATES
+# define BOOST_NO_CXX11_VARIADIC_TEMPLATES
# endif
#endif
// C++0x features in 4.4.n and later
//
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define BOOST_NO_AUTO_DECLARATIONS
-# define BOOST_NO_AUTO_MULTIDECLARATIONS
-# define BOOST_NO_CHAR16_T
-# define BOOST_NO_CHAR32_T
-# define BOOST_NO_INITIALIZER_LISTS
-# define BOOST_NO_DEFAULTED_FUNCTIONS
-# define BOOST_NO_DELETED_FUNCTIONS
+# define BOOST_NO_CXX11_AUTO_DECLARATIONS
+# define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+# define BOOST_NO_CXX11_CHAR16_T
+# define BOOST_NO_CXX11_CHAR32_T
+# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+# define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+# define BOOST_NO_CXX11_DELETED_FUNCTIONS
#endif
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4)
@@ -194,32 +191,37 @@
// C++0x features in 4.5.0 and later
//
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
-# define BOOST_NO_LAMBDAS
-# define BOOST_NO_RAW_LITERALS
-# define BOOST_NO_UNICODE_LITERALS
+# define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+# define BOOST_NO_CXX11_LAMBDAS
+# define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+# define BOOST_NO_CXX11_RAW_LITERALS
+# define BOOST_NO_CXX11_UNICODE_LITERALS
#endif
// C++0x features in 4.5.1 and later
//
#if (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ < 40501) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
-// scoped enums have a serious bug in 4.4.0, so define BOOST_NO_SCOPED_ENUMS before 4.5.1
+// scoped enums have a serious bug in 4.4.0, so define BOOST_NO_CXX11_SCOPED_ENUMS before 4.5.1
// See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38064
-# define BOOST_NO_SCOPED_ENUMS
+# define BOOST_NO_CXX11_SCOPED_ENUMS
#endif
// C++0x features in 4.6.n and later
//
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
-#define BOOST_NO_CONSTEXPR
-#define BOOST_NO_NOEXCEPT
-#define BOOST_NO_NULLPTR
-#define BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
+#define BOOST_NO_CXX11_CONSTEXPR
+#define BOOST_NO_CXX11_NOEXCEPT
+#define BOOST_NO_CXX11_NULLPTR
+#define BOOST_NO_CXX11_RANGE_BASED_FOR
+#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
#endif
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define BOOST_NO_CXX11_TEMPLATE_ALIASES
+#endif
// C++0x features not supported at all yet
//
-#define BOOST_NO_DECLTYPE_N3276
+#define BOOST_NO_CXX11_DECLTYPE_N3276
#ifndef BOOST_COMPILER
# define BOOST_COMPILER "GNU C++ version " __VERSION__
diff --git a/boost/config/compiler/gcc_xml.hpp b/boost/config/compiler/gcc_xml.hpp
index 61dcedcc6f..eaed4b5af4 100644
--- a/boost/config/compiler/gcc_xml.hpp
+++ b/boost/config/compiler/gcc_xml.hpp
@@ -27,32 +27,33 @@
// C++0x features:
//
-# define BOOST_NO_CONSTEXPR
-# define BOOST_NO_NULLPTR
-# define BOOST_NO_TEMPLATE_ALIASES
-# define BOOST_NO_DECLTYPE
-# define BOOST_NO_DECLTYPE_N3276
-# define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
-# define BOOST_NO_RVALUE_REFERENCES
-# define BOOST_NO_STATIC_ASSERT
-# define BOOST_NO_VARIADIC_TEMPLATES
-# define BOOST_NO_VARIADIC_MACROS
-# define BOOST_NO_AUTO_DECLARATIONS
-# define BOOST_NO_AUTO_MULTIDECLARATIONS
-# define BOOST_NO_CHAR16_T
-# define BOOST_NO_CHAR32_T
-# define BOOST_NO_DEFAULTED_FUNCTIONS
-# define BOOST_NO_DELETED_FUNCTIONS
-# define BOOST_NO_INITIALIZER_LISTS
-# define BOOST_NO_SCOPED_ENUMS
+# define BOOST_NO_CXX11_CONSTEXPR
+# define BOOST_NO_CXX11_NULLPTR
+# define BOOST_NO_CXX11_TEMPLATE_ALIASES
+# define BOOST_NO_CXX11_DECLTYPE
+# define BOOST_NO_CXX11_DECLTYPE_N3276
+# define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+# define BOOST_NO_CXX11_RVALUE_REFERENCES
+# define BOOST_NO_CXX11_STATIC_ASSERT
+# define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+# define BOOST_NO_CXX11_VARIADIC_MACROS
+# define BOOST_NO_CXX11_AUTO_DECLARATIONS
+# define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+# define BOOST_NO_CXX11_CHAR16_T
+# define BOOST_NO_CXX11_CHAR32_T
+# define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+# define BOOST_NO_CXX11_DELETED_FUNCTIONS
+# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+# define BOOST_NO_CXX11_SCOPED_ENUMS
# define BOOST_NO_SFINAE_EXPR
-# define BOOST_NO_SCOPED_ENUMS
-# define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
-# define BOOST_NO_LAMBDAS
-# define BOOST_NO_RAW_LITERALS
-# define BOOST_NO_UNICODE_LITERALS
-# define BOOST_NO_NOEXCEPT
-#define BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
+# define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+# define BOOST_NO_CXX11_LAMBDAS
+# define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+# define BOOST_NO_CXX11_RANGE_BASED_FOR
+# define BOOST_NO_CXX11_RAW_LITERALS
+# define BOOST_NO_CXX11_UNICODE_LITERALS
+# define BOOST_NO_CXX11_NOEXCEPT
+#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
#define BOOST_COMPILER "GCC-XML C++ version " __GCCXML__
diff --git a/boost/config/compiler/hp_acc.hpp b/boost/config/compiler/hp_acc.hpp
index 0d73b28752..4f5f81b3c3 100644
--- a/boost/config/compiler/hp_acc.hpp
+++ b/boost/config/compiler/hp_acc.hpp
@@ -92,30 +92,32 @@
//
#if !defined(__EDG__)
-#define BOOST_NO_AUTO_DECLARATIONS
-#define BOOST_NO_AUTO_MULTIDECLARATIONS
-#define BOOST_NO_CHAR16_T
-#define BOOST_NO_CHAR32_T
-#define BOOST_NO_CONSTEXPR
-#define BOOST_NO_DECLTYPE
-#define BOOST_NO_DECLTYPE_N3276
-#define BOOST_NO_DEFAULTED_FUNCTIONS
-#define BOOST_NO_DELETED_FUNCTIONS
-#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
-#define BOOST_NO_EXTERN_TEMPLATE
-#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
-#define BOOST_NO_INITIALIZER_LISTS
-#define BOOST_NO_LAMBDAS
-#define BOOST_NO_NOEXCEPT
-#define BOOST_NO_NULLPTR
-#define BOOST_NO_RAW_LITERALS
-#define BOOST_NO_RVALUE_REFERENCES
-#define BOOST_NO_SCOPED_ENUMS
+#define BOOST_NO_CXX11_AUTO_DECLARATIONS
+#define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+#define BOOST_NO_CXX11_CHAR16_T
+#define BOOST_NO_CXX11_CHAR32_T
+#define BOOST_NO_CXX11_CONSTEXPR
+#define BOOST_NO_CXX11_DECLTYPE
+#define BOOST_NO_CXX11_DECLTYPE_N3276
+#define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+#define BOOST_NO_CXX11_DELETED_FUNCTIONS
+#define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+#define BOOST_NO_CXX11_EXTERN_TEMPLATE
+#define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+#define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+#define BOOST_NO_CXX11_LAMBDAS
+#define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+#define BOOST_NO_CXX11_NOEXCEPT
+#define BOOST_NO_CXX11_NULLPTR
+#define BOOST_NO_CXX11_RANGE_BASED_FOR
+#define BOOST_NO_CXX11_RAW_LITERALS
+#define BOOST_NO_CXX11_RVALUE_REFERENCES
+#define BOOST_NO_CXX11_SCOPED_ENUMS
#define BOOST_NO_SFINAE_EXPR
-#define BOOST_NO_STATIC_ASSERT
-#define BOOST_NO_TEMPLATE_ALIASES
-#define BOOST_NO_UNICODE_LITERALS
-#define BOOST_NO_VARIADIC_TEMPLATES
+#define BOOST_NO_CXX11_STATIC_ASSERT
+#define BOOST_NO_CXX11_TEMPLATE_ALIASES
+#define BOOST_NO_CXX11_UNICODE_LITERALS
+#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
/*
See https://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=1443331 and
@@ -123,7 +125,7 @@
*/
#if (__HP_aCC < 62500) || !defined(HP_CXX0x_SOURCE)
- #define BOOST_NO_VARIADIC_MACROS
+ #define BOOST_NO_CXX11_VARIADIC_MACROS
#endif
#endif
diff --git a/boost/config/compiler/intel.hpp b/boost/config/compiler/intel.hpp
index a1704a488f..8c746c1870 100644
--- a/boost/config/compiler/intel.hpp
+++ b/boost/config/compiler/intel.hpp
@@ -199,52 +199,54 @@ template<> struct assert_intrinsic_wchar_t<unsigned short> {};
// - ICC added static_assert in 11.0 (first version with C++0x support)
//
#if defined(BOOST_INTEL_STDCXX0X)
-# undef BOOST_NO_STATIC_ASSERT
+# undef BOOST_NO_CXX11_STATIC_ASSERT
//
// These pass our test cases, but aren't officially supported according to:
// http://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler/
//
-//# undef BOOST_NO_LAMBDAS
-//# undef BOOST_NO_DECLTYPE
-//# undef BOOST_NO_AUTO_DECLARATIONS
-//# undef BOOST_NO_AUTO_MULTIDECLARATIONS
+//# undef BOOST_NO_CXX11_LAMBDAS
+//# undef BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+//# undef BOOST_NO_CXX11_DECLTYPE
+//# undef BOOST_NO_CXX11_AUTO_DECLARATIONS
+//# undef BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
#endif
#if defined(BOOST_INTEL_STDCXX0X) && (BOOST_INTEL_CXX_VERSION >= 1200)
-//# undef BOOST_NO_RVALUE_REFERENCES // Enabling this breaks Filesystem and Exception libraries
-//# undef BOOST_NO_SCOPED_ENUMS // doesn't really work!!
-# undef BOOST_NO_DELETED_FUNCTIONS
-# undef BOOST_NO_DEFAULTED_FUNCTIONS
-# undef BOOST_NO_LAMBDAS
-# undef BOOST_NO_DECLTYPE
-# undef BOOST_NO_AUTO_DECLARATIONS
-# undef BOOST_NO_AUTO_MULTIDECLARATIONS
+//# undef BOOST_NO_CXX11_RVALUE_REFERENCES // Enabling this breaks Filesystem and Exception libraries
+//# undef BOOST_NO_CXX11_SCOPED_ENUMS // doesn't really work!!
+# undef BOOST_NO_CXX11_DELETED_FUNCTIONS
+# undef BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+# undef BOOST_NO_CXX11_LAMBDAS
+# undef BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+# undef BOOST_NO_CXX11_DECLTYPE
+# undef BOOST_NO_CXX11_AUTO_DECLARATIONS
+# undef BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
#endif
// icl Version 12.1.0.233 Build 20110811 and possibly some other builds
// had an incorrect __INTEL_COMPILER value of 9999. Intel say this has been fixed.
#if defined(BOOST_INTEL_STDCXX0X) && (BOOST_INTEL_CXX_VERSION > 1200)
-# undef BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
-# undef BOOST_NO_NULLPTR
-# undef BOOST_NO_RVALUE_REFERENCES
+# undef BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+# undef BOOST_NO_CXX11_NULLPTR
+# undef BOOST_NO_CXX11_RVALUE_REFERENCES
# undef BOOST_NO_SFINAE_EXPR
-# undef BOOST_NO_TEMPLATE_ALIASES
-# undef BOOST_NO_VARIADIC_TEMPLATES
+# undef BOOST_NO_CXX11_TEMPLATE_ALIASES
+# undef BOOST_NO_CXX11_VARIADIC_TEMPLATES
// http://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler/
// continues to list scoped enum support as "Partial"
-//# undef BOOST_NO_SCOPED_ENUMS
+//# undef BOOST_NO_CXX11_SCOPED_ENUMS
#endif
#if defined(_MSC_VER) && (_MSC_VER <= 1700)
//
// Although the Intel compiler is capable of supporting these, it appears not to in MSVC compatibility mode:
//
-# define BOOST_NO_INITIALIZER_LISTS
-# define BOOST_NO_VARIADIC_TEMPLATES
-# define BOOST_NO_DELETED_FUNCTIONS
-# define BOOST_NO_DEFAULTED_FUNCTIONS
-# define BOOST_NO_TEMPLATE_ALIASES
+# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+# define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+# define BOOST_NO_CXX11_DELETED_FUNCTIONS
+# define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+# define BOOST_NO_CXX11_TEMPLATE_ALIASES
#endif
#if (BOOST_INTEL_CXX_VERSION < 1200)
diff --git a/boost/config/compiler/metrowerks.hpp b/boost/config/compiler/metrowerks.hpp
index 02baecddee..184cb71c1f 100644
--- a/boost/config/compiler/metrowerks.hpp
+++ b/boost/config/compiler/metrowerks.hpp
@@ -90,33 +90,35 @@
#if __MWERKS__ > 0x3206 && __option(rvalue_refs)
# define BOOST_HAS_RVALUE_REFS
#else
-# define BOOST_NO_RVALUE_REFERENCES
+# define BOOST_NO_CXX11_RVALUE_REFERENCES
#endif
-#define BOOST_NO_AUTO_DECLARATIONS
-#define BOOST_NO_AUTO_MULTIDECLARATIONS
-#define BOOST_NO_CHAR16_T
-#define BOOST_NO_CHAR32_T
-#define BOOST_NO_CONSTEXPR
-#define BOOST_NO_DECLTYPE
-#define BOOST_NO_DECLTYPE_N3276
-#define BOOST_NO_DEFAULTED_FUNCTIONS
-#define BOOST_NO_DELETED_FUNCTIONS
-#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
-#define BOOST_NO_EXTERN_TEMPLATE
-#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
-#define BOOST_NO_INITIALIZER_LISTS
-#define BOOST_NO_LAMBDAS
-#define BOOST_NO_NOEXCEPT
-#define BOOST_NO_NULLPTR
-#define BOOST_NO_RAW_LITERALS
-#define BOOST_NO_SCOPED_ENUMS
+#define BOOST_NO_CXX11_AUTO_DECLARATIONS
+#define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+#define BOOST_NO_CXX11_CHAR16_T
+#define BOOST_NO_CXX11_CHAR32_T
+#define BOOST_NO_CXX11_CONSTEXPR
+#define BOOST_NO_CXX11_DECLTYPE
+#define BOOST_NO_CXX11_DECLTYPE_N3276
+#define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+#define BOOST_NO_CXX11_DELETED_FUNCTIONS
+#define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+#define BOOST_NO_CXX11_EXTERN_TEMPLATE
+#define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+#define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+#define BOOST_NO_CXX11_LAMBDAS
+#define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+#define BOOST_NO_CXX11_NOEXCEPT
+#define BOOST_NO_CXX11_NULLPTR
+#define BOOST_NO_CXX11_RANGE_BASED_FOR
+#define BOOST_NO_CXX11_RAW_LITERALS
+#define BOOST_NO_CXX11_SCOPED_ENUMS
#define BOOST_NO_SFINAE_EXPR
-#define BOOST_NO_STATIC_ASSERT
-#define BOOST_NO_TEMPLATE_ALIASES
-#define BOOST_NO_UNICODE_LITERALS
-#define BOOST_NO_VARIADIC_TEMPLATES
-#define BOOST_NO_VARIADIC_MACROS
-#define BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
+#define BOOST_NO_CXX11_STATIC_ASSERT
+#define BOOST_NO_CXX11_TEMPLATE_ALIASES
+#define BOOST_NO_CXX11_UNICODE_LITERALS
+#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#define BOOST_NO_CXX11_VARIADIC_MACROS
+#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
#define BOOST_COMPILER "Metrowerks CodeWarrior C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION)
diff --git a/boost/config/compiler/mpw.hpp b/boost/config/compiler/mpw.hpp
index 45e1aa45c6..14adee0cc6 100644
--- a/boost/config/compiler/mpw.hpp
+++ b/boost/config/compiler/mpw.hpp
@@ -40,32 +40,34 @@
//
// See boost\config\suffix.hpp for BOOST_NO_LONG_LONG
//
-#define BOOST_NO_AUTO_DECLARATIONS
-#define BOOST_NO_AUTO_MULTIDECLARATIONS
-#define BOOST_NO_CHAR16_T
-#define BOOST_NO_CHAR32_T
-#define BOOST_NO_CONSTEXPR
-#define BOOST_NO_DECLTYPE
-#define BOOST_NO_DECLTYPE_N3276
-#define BOOST_NO_DEFAULTED_FUNCTIONS
-#define BOOST_NO_DELETED_FUNCTIONS
-#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
-#define BOOST_NO_EXTERN_TEMPLATE
-#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
-#define BOOST_NO_INITIALIZER_LISTS
-#define BOOST_NO_LAMBDAS
-#define BOOST_NO_NOEXCEPT
-#define BOOST_NO_NULLPTR
-#define BOOST_NO_RAW_LITERALS
-#define BOOST_NO_RVALUE_REFERENCES
-#define BOOST_NO_SCOPED_ENUMS
+#define BOOST_NO_CXX11_AUTO_DECLARATIONS
+#define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+#define BOOST_NO_CXX11_CHAR16_T
+#define BOOST_NO_CXX11_CHAR32_T
+#define BOOST_NO_CXX11_CONSTEXPR
+#define BOOST_NO_CXX11_DECLTYPE
+#define BOOST_NO_CXX11_DECLTYPE_N3276
+#define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+#define BOOST_NO_CXX11_DELETED_FUNCTIONS
+#define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+#define BOOST_NO_CXX11_EXTERN_TEMPLATE
+#define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+#define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+#define BOOST_NO_CXX11_LAMBDAS
+#define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+#define BOOST_NO_CXX11_NOEXCEPT
+#define BOOST_NO_CXX11_NULLPTR
+#define BOOST_NO_CXX11_RANGE_BASED_FOR
+#define BOOST_NO_CXX11_RAW_LITERALS
+#define BOOST_NO_CXX11_RVALUE_REFERENCES
+#define BOOST_NO_CXX11_SCOPED_ENUMS
#define BOOST_NO_SFINAE_EXPR
-#define BOOST_NO_STATIC_ASSERT
-#define BOOST_NO_TEMPLATE_ALIASES
-#define BOOST_NO_UNICODE_LITERALS
-#define BOOST_NO_VARIADIC_TEMPLATES
-#define BOOST_NO_VARIADIC_MACROS
-#define BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
+#define BOOST_NO_CXX11_STATIC_ASSERT
+#define BOOST_NO_CXX11_TEMPLATE_ALIASES
+#define BOOST_NO_CXX11_UNICODE_LITERALS
+#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#define BOOST_NO_CXX11_VARIADIC_MACROS
+#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
//
// versions check:
diff --git a/boost/config/compiler/pathscale.hpp b/boost/config/compiler/pathscale.hpp
index 94e44726f1..3041126353 100644
--- a/boost/config/compiler/pathscale.hpp
+++ b/boost/config/compiler/pathscale.hpp
@@ -32,49 +32,49 @@
# define BOOST_HAS_EXPM1
# define BOOST_HAS_DIRENT_H
# define BOOST_HAS_CLOCK_GETTIME
-# define BOOST_NO_VARIADIC_TEMPLATES
-# define BOOST_NO_UNICODE_LITERALS
-# define BOOST_NO_TEMPLATE_ALIASES
-# define BOOST_NO_STD_UNORDERED
-# define BOOST_NO_STATIC_ASSERT
+# define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+# define BOOST_NO_CXX11_UNICODE_LITERALS
+# define BOOST_NO_CXX11_TEMPLATE_ALIASES
+# define BOOST_NO_CXX11_STATIC_ASSERT
# define BOOST_NO_SFINAE_EXPR
-# define BOOST_NO_SCOPED_ENUMS
-# define BOOST_NO_RVALUE_REFERENCES
-# define BOOST_NO_RAW_LITERALS
-# define BOOST_NO_NULLPTR
-# define BOOST_NO_NUMERIC_LIMITS_LOWEST
-# define BOOST_NO_NOEXCEPT
-# define BOOST_NO_LAMBDAS
-# define BOOST_NO_INITIALIZER_LISTS
+# define BOOST_NO_CXX11_SCOPED_ENUMS
+# define BOOST_NO_CXX11_RVALUE_REFERENCES
+# define BOOST_NO_CXX11_RANGE_BASED_FOR
+# define BOOST_NO_CXX11_RAW_LITERALS
+# define BOOST_NO_CXX11_NULLPTR
+# define BOOST_NO_CXX11_NUMERIC_LIMITS
+# define BOOST_NO_CXX11_NOEXCEPT
+# define BOOST_NO_CXX11_LAMBDAS
+# define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
# define BOOST_NO_MS_INT64_NUMERIC_LIMITS
-# define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
-# define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
-# define BOOST_NO_DELETED_FUNCTIONS
-# define BOOST_NO_DEFAULTED_FUNCTIONS
-# define BOOST_NO_DECLTYPE
-# define BOOST_NO_DECLTYPE_N3276
-# define BOOST_NO_CONSTEXPR
+# define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+# define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+# define BOOST_NO_CXX11_DELETED_FUNCTIONS
+# define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+# define BOOST_NO_CXX11_DECLTYPE
+# define BOOST_NO_CXX11_DECLTYPE_N3276
+# define BOOST_NO_CXX11_CONSTEXPR
# define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
-# define BOOST_NO_CHAR32_T
-# define BOOST_NO_CHAR16_T
-# define BOOST_NO_AUTO_MULTIDECLARATIONS
-# define BOOST_NO_AUTO_DECLARATIONS
-# define BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
-# define BOOST_NO_0X_HDR_UNORDERED_SET
-# define BOOST_NO_0X_HDR_UNORDERED_MAP
-# define BOOST_NO_0X_HDR_TYPEINDEX
-# define BOOST_NO_0X_HDR_TUPLE
-# define BOOST_NO_0X_HDR_THREAD
-# define BOOST_NO_0X_HDR_SYSTEM_ERROR
-# define BOOST_NO_0X_HDR_REGEX
-# define BOOST_NO_0X_HDR_RATIO
-# define BOOST_NO_0X_HDR_RANDOM
-# define BOOST_NO_0X_HDR_MUTEX
-# define BOOST_NO_0X_HDR_INITIALIZER_LIST
-# define BOOST_NO_0X_HDR_FUTURE
-# define BOOST_NO_0X_HDR_FORWARD_LIST
-# define BOOST_NO_0X_HDR_CONDITION_VARIABLE
-# define BOOST_NO_0X_HDR_CODECVT
-# define BOOST_NO_0X_HDR_CHRONO
+# define BOOST_NO_CXX11_CHAR32_T
+# define BOOST_NO_CXX11_CHAR16_T
+# define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+# define BOOST_NO_CXX11_AUTO_DECLARATIONS
+# define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+# define BOOST_NO_CXX11_HDR_UNORDERED_SET
+# define BOOST_NO_CXX11_HDR_UNORDERED_MAP
+# define BOOST_NO_CXX11_HDR_TYPEINDEX
+# define BOOST_NO_CXX11_HDR_TUPLE
+# define BOOST_NO_CXX11_HDR_THREAD
+# define BOOST_NO_CXX11_HDR_SYSTEM_ERROR
+# define BOOST_NO_CXX11_HDR_REGEX
+# define BOOST_NO_CXX11_HDR_RATIO
+# define BOOST_NO_CXX11_HDR_RANDOM
+# define BOOST_NO_CXX11_HDR_MUTEX
+# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+# define BOOST_NO_CXX11_HDR_FUTURE
+# define BOOST_NO_CXX11_HDR_FORWARD_LIST
+# define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
+# define BOOST_NO_CXX11_HDR_CODECVT
+# define BOOST_NO_CXX11_HDR_CHRONO
#endif
diff --git a/boost/config/compiler/pgi.hpp b/boost/config/compiler/pgi.hpp
index 0ae8af58e6..fa32fefb48 100644
--- a/boost/config/compiler/pgi.hpp
+++ b/boost/config/compiler/pgi.hpp
@@ -1,6 +1,6 @@
// (C) Copyright Noel Belcourt 2007.
-// Use, modification and distribution are subject to the
-// Boost Software License, Version 1.0. (See accompanying file
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
@@ -16,10 +16,29 @@
// if no threading API is detected.
//
-#if __PGIC__ >= 10
+#if __PGIC__ >= 11
// options requested by configure --enable-test
#define BOOST_HAS_PTHREADS
+#define BOOST_HAS_THREADS
+#define BOOST_HAS_PTHREAD_YIELD
+#define BOOST_HAS_NRVO
+#define BOOST_HAS_LONG_LONG
+
+// options --enable-test wants undefined
+#undef BOOST_NO_STDC_NAMESPACE
+#undef BOOST_NO_EXCEPTION_STD_NAMESPACE
+#undef BOOST_DEDUCED_TYPENAME
+
+#define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
+#define BOOST_NO_TWO_PHASE_NAME_LOOKUP
+#define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+#define BOOST_NO_CXX11_AUTO_DECLARATIONS
+
+#elif __PGIC__ >= 10
+
+// options requested by configure --enable-test
+#define BOOST_HAS_THREADS
#define BOOST_HAS_NRVO
#define BOOST_HAS_LONG_LONG
@@ -30,11 +49,11 @@
#elif __PGIC__ >= 7
-#define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
+#define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
#define BOOST_NO_TWO_PHASE_NAME_LOOKUP
#define BOOST_NO_SWPRINTF
-#define BOOST_NO_AUTO_MULTIDECLARATIONS
-#define BOOST_NO_AUTO_DECLARATIONS
+#define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+#define BOOST_NO_CXX11_AUTO_DECLARATIONS
#else
@@ -46,30 +65,52 @@
//
// See boost\config\suffix.hpp for BOOST_NO_LONG_LONG
//
-#define BOOST_NO_CHAR16_T
-#define BOOST_NO_CHAR32_T
-#define BOOST_NO_CONSTEXPR
-#define BOOST_NO_DECLTYPE
-#define BOOST_NO_DECLTYPE_N3276
-#define BOOST_NO_DEFAULTED_FUNCTIONS
-#define BOOST_NO_DELETED_FUNCTIONS
-#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
-#define BOOST_NO_EXTERN_TEMPLATE
-#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
-#define BOOST_NO_INITIALIZER_LISTS
-#define BOOST_NO_LAMBDAS
-#define BOOST_NO_NOEXCEPT
-#define BOOST_NO_NULLPTR
-#define BOOST_NO_RAW_LITERALS
-#define BOOST_NO_RVALUE_REFERENCES
-#define BOOST_NO_SCOPED_ENUMS
+#define BOOST_NO_CXX11_CHAR16_T
+#define BOOST_NO_CXX11_CHAR32_T
+#define BOOST_NO_CXX11_CONSTEXPR
+#define BOOST_NO_CXX11_DECLTYPE
+#define BOOST_NO_CXX11_DECLTYPE_N3276
+#define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+#define BOOST_NO_CXX11_DELETED_FUNCTIONS
+#define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+#define BOOST_NO_CXX11_EXTERN_TEMPLATE
+#define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+#define BOOST_NO_CXX11_LAMBDAS
+#define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+#define BOOST_NO_CXX11_NOEXCEPT
+#define BOOST_NO_CXX11_NULLPTR
+#define BOOST_NO_CXX11_NUMERIC_LIMITS
+#define BOOST_NO_CXX11_RANGE_BASED_FOR
+#define BOOST_NO_CXX11_RAW_LITERALS
+#define BOOST_NO_CXX11_RVALUE_REFERENCES
+#define BOOST_NO_CXX11_SCOPED_ENUMS
#define BOOST_NO_SFINAE_EXPR
-#define BOOST_NO_STATIC_ASSERT
-#define BOOST_NO_TEMPLATE_ALIASES
-#define BOOST_NO_UNICODE_LITERALS
-#define BOOST_NO_VARIADIC_TEMPLATES
-#define BOOST_NO_VARIADIC_MACROS
-#define BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
+#define BOOST_NO_CXX11_STATIC_ASSERT
+#define BOOST_NO_SWPRINTF
+#define BOOST_NO_CXX11_TEMPLATE_ALIASES
+#define BOOST_NO_CXX11_UNICODE_LITERALS
+#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#define BOOST_NO_CXX11_VARIADIC_MACROS
+#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+
+#define BOOST_NO_CXX11_HDR_UNORDERED_SET
+#define BOOST_NO_CXX11_HDR_UNORDERED_MAP
+#define BOOST_NO_CXX11_HDR_TYPEINDEX
+#define BOOST_NO_CXX11_HDR_TYPE_TRAITS
+#define BOOST_NO_CXX11_HDR_TUPLE
+#define BOOST_NO_CXX11_HDR_THREAD
+#define BOOST_NO_CXX11_HDR_SYSTEM_ERROR
+#define BOOST_NO_CXX11_HDR_REGEX
+#define BOOST_NO_CXX11_HDR_RATIO
+#define BOOST_NO_CXX11_HDR_RANDOM
+#define BOOST_NO_CXX11_HDR_MUTEX
+#define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+#define BOOST_NO_CXX11_HDR_FUTURE
+#define BOOST_NO_CXX11_HDR_FORWARD_LIST
+#define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
+#define BOOST_NO_CXX11_HDR_CODECVT
+#define BOOST_NO_CXX11_HDR_CHRONO
+#define BOOST_NO_CXX11_HDR_ARRAY
//
// version check:
diff --git a/boost/config/compiler/sunpro_cc.hpp b/boost/config/compiler/sunpro_cc.hpp
index eaf6c741c7..65beb50198 100644
--- a/boost/config/compiler/sunpro_cc.hpp
+++ b/boost/config/compiler/sunpro_cc.hpp
@@ -99,32 +99,34 @@
//
# define BOOST_HAS_LONG_LONG
-#define BOOST_NO_AUTO_DECLARATIONS
-#define BOOST_NO_AUTO_MULTIDECLARATIONS
-#define BOOST_NO_CHAR16_T
-#define BOOST_NO_CHAR32_T
-#define BOOST_NO_CONSTEXPR
-#define BOOST_NO_DECLTYPE
-#define BOOST_NO_DECLTYPE_N3276
-#define BOOST_NO_DEFAULTED_FUNCTIONS
-#define BOOST_NO_DELETED_FUNCTIONS
-#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
-#define BOOST_NO_EXTERN_TEMPLATE
-#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
-#define BOOST_NO_INITIALIZER_LISTS
-#define BOOST_NO_LAMBDAS
-#define BOOST_NO_NOEXCEPT
-#define BOOST_NO_NULLPTR
-#define BOOST_NO_RAW_LITERALS
-#define BOOST_NO_RVALUE_REFERENCES
-#define BOOST_NO_SCOPED_ENUMS
+#define BOOST_NO_CXX11_AUTO_DECLARATIONS
+#define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+#define BOOST_NO_CXX11_CHAR16_T
+#define BOOST_NO_CXX11_CHAR32_T
+#define BOOST_NO_CXX11_CONSTEXPR
+#define BOOST_NO_CXX11_DECLTYPE
+#define BOOST_NO_CXX11_DECLTYPE_N3276
+#define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+#define BOOST_NO_CXX11_DELETED_FUNCTIONS
+#define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+#define BOOST_NO_CXX11_EXTERN_TEMPLATE
+#define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+#define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+#define BOOST_NO_CXX11_LAMBDAS
+#define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+#define BOOST_NO_CXX11_NOEXCEPT
+#define BOOST_NO_CXX11_NULLPTR
+#define BOOST_NO_CXX11_RANGE_BASED_FOR
+#define BOOST_NO_CXX11_RAW_LITERALS
+#define BOOST_NO_CXX11_RVALUE_REFERENCES
+#define BOOST_NO_CXX11_SCOPED_ENUMS
#define BOOST_NO_SFINAE_EXPR
-#define BOOST_NO_STATIC_ASSERT
-#define BOOST_NO_TEMPLATE_ALIASES
-#define BOOST_NO_UNICODE_LITERALS
-#define BOOST_NO_VARIADIC_TEMPLATES
-#define BOOST_NO_VARIADIC_MACROS
-#define BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
+#define BOOST_NO_CXX11_STATIC_ASSERT
+#define BOOST_NO_CXX11_TEMPLATE_ALIASES
+#define BOOST_NO_CXX11_UNICODE_LITERALS
+#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#define BOOST_NO_CXX11_VARIADIC_MACROS
+#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
//
// Version
diff --git a/boost/config/compiler/vacpp.hpp b/boost/config/compiler/vacpp.hpp
index b0407aab71..2410d5a3ab 100644
--- a/boost/config/compiler/vacpp.hpp
+++ b/boost/config/compiler/vacpp.hpp
@@ -71,49 +71,59 @@
// See boost\config\suffix.hpp for BOOST_NO_LONG_LONG
//
#if ! __IBMCPP_AUTO_TYPEDEDUCTION
-# define BOOST_NO_AUTO_DECLARATIONS
-# define BOOST_NO_AUTO_MULTIDECLARATIONS
+# define BOOST_NO_CXX11_AUTO_DECLARATIONS
+# define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
#endif
#if ! __IBMCPP_UTF_LITERAL__
-# define BOOST_NO_CHAR16_T
-# define BOOST_NO_CHAR32_T
+# define BOOST_NO_CXX11_CHAR16_T
+# define BOOST_NO_CXX11_CHAR32_T
+#endif
+#if ! __IBMCPP_CONSTEXPR
+# define BOOST_NO_CXX11_CONSTEXPR
#endif
-#define BOOST_NO_CONSTEXPR
#if ! __IBMCPP_DECLTYPE
-# define BOOST_NO_DECLTYPE
+# define BOOST_NO_CXX11_DECLTYPE
#else
# define BOOST_HAS_DECLTYPE
#endif
-#define BOOST_NO_DECLTYPE_N3276
-#define BOOST_NO_DEFAULTED_FUNCTIONS
-#define BOOST_NO_DELETED_FUNCTIONS
-#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
+#define BOOST_NO_CXX11_DECLTYPE_N3276
+#define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+#define BOOST_NO_CXX11_DELETED_FUNCTIONS
+#if ! __IBMCPP_EXPLICIT_CONVERSION_OPERATORS
+# define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+#endif
#if ! __IBMCPP_EXTERN_TEMPLATE
-# define BOOST_NO_EXTERN_TEMPLATE
+# define BOOST_NO_CXX11_EXTERN_TEMPLATE
#endif
#if ! __IBMCPP_VARIADIC_TEMPLATES
// not enabled separately at this time
-# define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
-#endif
-#define BOOST_NO_INITIALIZER_LISTS
-#define BOOST_NO_LAMBDAS
-#define BOOST_NO_NOEXCEPT
-#define BOOST_NO_NULLPTR
-#define BOOST_NO_RAW_LITERALS
-#define BOOST_NO_RVALUE_REFERENCES
-#define BOOST_NO_SCOPED_ENUMS
+# define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+#endif
+#define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+#define BOOST_NO_CXX11_LAMBDAS
+#define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
+#define BOOST_NO_CXX11_NOEXCEPT
+#define BOOST_NO_CXX11_NULLPTR
+#define BOOST_NO_CXX11_RANGE_BASED_FOR
+#define BOOST_NO_CXX11_RAW_LITERALS
+#if ! __IBMCPP_RVALUE_REFERENCES
+# define BOOST_NO_CXX11_RVALUE_REFERENCES
+#endif
+#if ! __IBMCPP_SCOPED_ENUM
+# define BOOST_NO_CXX11_SCOPED_ENUMS
+#endif
#define BOOST_NO_SFINAE_EXPR
-#define BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
+#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
#if ! __IBMCPP_STATIC_ASSERT
-# define BOOST_NO_STATIC_ASSERT
+# define BOOST_NO_CXX11_STATIC_ASSERT
#endif
-#define BOOST_NO_TEMPLATE_ALIASES
-#define BOOST_NO_UNICODE_LITERALS
+#define BOOST_NO_CXX11_TEMPLATE_ALIASES
+#define BOOST_NO_CXX11_UNICODE_LITERALS
#if ! __IBMCPP_VARIADIC_TEMPLATES
-# define BOOST_NO_VARIADIC_TEMPLATES
+# define BOOST_NO_CXX11_VARIADIC_TEMPLATES
#endif
#if ! __C99_MACRO_WITH_VA_ARGS
-# define BOOST_NO_VARIADIC_MACROS
+# define BOOST_NO_CXX11_VARIADIC_MACROS
#endif
diff --git a/boost/config/compiler/visualc.hpp b/boost/config/compiler/visualc.hpp
index 1a13f0dbd2..0b11faaf44 100644
--- a/boost/config/compiler/visualc.hpp
+++ b/boost/config/compiler/visualc.hpp
@@ -9,38 +9,54 @@
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
-
+//
// Microsoft Visual C++ compiler setup:
+//
+// We need to be careful with the checks in this file, as contrary
+// to popular belief there are versions with _MSC_VER with the final
+// digit non-zero (mainly the MIPS cross compiler).
+//
+// So we either test _MSC_VER >= XXXX or else _MSC_VER < XXXX.
+// No other comparisons (==, >, or <=) are safe.
+//
#define BOOST_MSVC _MSC_VER
+//
+// Helper macro BOOST_MSVC_FULL_VER for use in Boost code:
+//
#if _MSC_FULL_VER > 100000000
# define BOOST_MSVC_FULL_VER _MSC_FULL_VER
#else
# define BOOST_MSVC_FULL_VER (_MSC_FULL_VER * 10)
#endif
-// turn off the warnings before we #include anything
+// Attempt to suppress VC6 warnings about the length of decorated names (obsolete):
#pragma warning( disable : 4503 ) // warning: decorated name length exceeded
+//
+// versions check:
+// we don't support Visual C++ prior to version 6:
+#if _MSC_VER < 1200
+# error "Compiler not supported or configured - please reconfigure"
+#endif
+
#if _MSC_VER < 1300 // 1200 == VC++ 6.0, 1200-1202 == eVC++4
# pragma warning( disable : 4786 ) // ident trunc to '255' chars in debug info
# define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
# define BOOST_NO_VOID_RETURNS
# define BOOST_NO_EXCEPTION_STD_NAMESPACE
-# if BOOST_MSVC == 1202
+# if _MSC_VER == 1202
# define BOOST_NO_STD_TYPEINFO
# endif
- // disable min/max macro defines on vc6:
- //
#endif
/// Visual Studio has no fenv.h
#define BOOST_NO_FENV_H
-#if (_MSC_VER <= 1300) // 1300 == VC++ 7.0
+#if (_MSC_VER < 1310) // 130X == VC++ 7.0
# if !defined(_MSC_EXTENSIONS) && !defined(BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS) // VC7 bug with /Za
# define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
@@ -72,7 +88,7 @@
# define BOOST_NO_IS_ABSTRACT
# define BOOST_NO_FUNCTION_TYPE_SPECIALIZATIONS
// TODO: what version is meant here? Have there really been any fixes in cl 12.01 (as e.g. shipped with eVC4)?
-# if (_MSC_VER > 1200)
+# if (_MSC_VER >= 1300)
# define BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS
# endif
@@ -83,9 +99,9 @@
// it appears not to actually work:
# define BOOST_NO_SWPRINTF
// Our extern template tests also fail for this compiler:
-# define BOOST_NO_EXTERN_TEMPLATE
+# define BOOST_NO_CXX11_EXTERN_TEMPLATE
// Variadic macros do not exist for VC7.1 and lower
-# define BOOST_NO_VARIADIC_MACROS
+# define BOOST_NO_CXX11_VARIADIC_MACROS
#endif
#if defined(UNDER_CE)
@@ -93,17 +109,16 @@
# define BOOST_NO_SWPRINTF
#endif
-#if _MSC_VER <= 1400 // 1400 == VC++ 8.0
+#if _MSC_VER < 1500 // 140X == VC++ 8.0
# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
#endif
-#if _MSC_VER == 1500 // 1500 == VC++ 9.0
+#if _MSC_VER < 1600 // 150X == VC++ 9.0
// A bug in VC9:
# define BOOST_NO_ADL_BARRIER
#endif
-#if (_MSC_VER <= 1600)
// MSVC (including the latest checked version) has not yet completely
// implemented value-initialization, as is reported:
// "VC++ does not value-initialize members of derived classes without
@@ -117,11 +132,10 @@
// https://connect.microsoft.com/VisualStudio/feedback/details/100744
// See also: http://www.boost.org/libs/utility/value_init.htm#compiler_issues
// (Niels Dekker, LKEB, May 2010)
-#define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
-#endif
+# define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
-#if _MSC_VER <= 1500 || !defined(BOOST_STRICT_CONFIG) // 1500 == VC++ 9.0
-# define BOOST_NO_INITIALIZER_LISTS
+#if _MSC_VER < 1600 || !defined(BOOST_STRICT_CONFIG) // 150X == VC++ 9.0
+# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
#endif
#ifndef _NATIVE_WCHAR_T_DEFINED
@@ -177,38 +191,44 @@
// C++ features supported by VC++ 10 (aka 2010)
//
#if _MSC_VER < 1600
-#define BOOST_NO_AUTO_DECLARATIONS
-#define BOOST_NO_AUTO_MULTIDECLARATIONS
-#define BOOST_NO_LAMBDAS
-#define BOOST_NO_RVALUE_REFERENCES
-#define BOOST_NO_STATIC_ASSERT
-#define BOOST_NO_NULLPTR
-#define BOOST_NO_DECLTYPE
+# define BOOST_NO_CXX11_AUTO_DECLARATIONS
+# define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
+# define BOOST_NO_CXX11_LAMBDAS
+# define BOOST_NO_CXX11_RVALUE_REFERENCES
+# define BOOST_NO_CXX11_STATIC_ASSERT
+# define BOOST_NO_CXX11_NULLPTR
+# define BOOST_NO_CXX11_DECLTYPE
#endif // _MSC_VER < 1600
#if _MSC_VER >= 1600
-#define BOOST_HAS_STDINT_H
+# define BOOST_HAS_STDINT_H
#endif
+// C++ features supported by VC++ 11 (aka 2012)
+//
+#if _MSC_VER < 1700
+# define BOOST_NO_CXX11_RANGE_BASED_FOR
+# define BOOST_NO_CXX11_SCOPED_ENUMS
+#endif // _MSC_VER < 1700
+
// C++0x features not supported by any versions
-#define BOOST_NO_CHAR16_T
-#define BOOST_NO_CHAR32_T
-#define BOOST_NO_CONSTEXPR
-#define BOOST_NO_DECLTYPE_N3276
-#define BOOST_NO_DEFAULTED_FUNCTIONS
-#define BOOST_NO_DELETED_FUNCTIONS
-#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
-#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
-#define BOOST_NO_INITIALIZER_LISTS
-#define BOOST_NO_NOEXCEPT
-#define BOOST_NO_RAW_LITERALS
-#define BOOST_NO_SCOPED_ENUMS
-#define BOOST_NO_TEMPLATE_ALIASES
-#define BOOST_NO_UNICODE_LITERALS
-#define BOOST_NO_VARIADIC_TEMPLATES
+#define BOOST_NO_CXX11_CHAR16_T
+#define BOOST_NO_CXX11_CHAR32_T
+#define BOOST_NO_CXX11_CONSTEXPR
+#define BOOST_NO_CXX11_DECLTYPE_N3276
+#define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+#define BOOST_NO_CXX11_DELETED_FUNCTIONS
+#define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+#define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+#define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+#define BOOST_NO_CXX11_NOEXCEPT
+#define BOOST_NO_CXX11_RAW_LITERALS
+#define BOOST_NO_CXX11_TEMPLATE_ALIASES
+#define BOOST_NO_CXX11_UNICODE_LITERALS
+#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
#define BOOST_NO_SFINAE_EXPR
#define BOOST_NO_TWO_PHASE_NAME_LOOKUP
-#define BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
+#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
//
// prefix and suffix headers:
//
@@ -219,6 +239,7 @@
# define BOOST_ABI_SUFFIX "boost/config/abi/msvc_suffix.hpp"
#endif
+#ifndef BOOST_COMPILER
// TODO:
// these things are mostly bogus. 1200 means version 12.0 of the compiler. The
// artificial versions assigned to them only refer to the versions of some IDE
@@ -230,13 +251,20 @@
// Note: these are so far off, they are not really supported
# elif _MSC_VER < 1300 // eVC++ 4 comes with 1200-1202
# define BOOST_COMPILER_VERSION evc4.0
-# elif _MSC_VER == 1400
+# elif _MSC_VER < 1400
+ // Note: I'm not aware of any CE compiler with version 13xx
+# if defined(BOOST_ASSERT_CONFIG)
+# error "Unknown EVC++ compiler version - please run the configure tests and report the results"
+# else
+# pragma message("Unknown EVC++ compiler version - please run the configure tests and report the results")
+# endif
+# elif _MSC_VER < 1500
# define BOOST_COMPILER_VERSION evc8
-# elif _MSC_VER == 1500
+# elif _MSC_VER < 1600
# define BOOST_COMPILER_VERSION evc9
-# elif _MSC_VER == 1600
+# elif _MSC_VER < 1700
# define BOOST_COMPILER_VERSION evc10
-# elif _MSC_VER == 1700
+# elif _MSC_VER < 1800
# define BOOST_COMPILER_VERSION evc11
# else
# if defined(BOOST_ASSERT_CONFIG)
@@ -251,31 +279,26 @@
# define BOOST_COMPILER_VERSION 5.0
# elif _MSC_VER < 1300
# define BOOST_COMPILER_VERSION 6.0
-# elif _MSC_VER == 1300
+# elif _MSC_VER < 1310
# define BOOST_COMPILER_VERSION 7.0
-# elif _MSC_VER == 1310
+# elif _MSC_VER < 1400
# define BOOST_COMPILER_VERSION 7.1
-# elif _MSC_VER == 1400
+# elif _MSC_VER < 1500
# define BOOST_COMPILER_VERSION 8.0
-# elif _MSC_VER == 1500
+# elif _MSC_VER < 1600
# define BOOST_COMPILER_VERSION 9.0
-# elif _MSC_VER == 1600
+# elif _MSC_VER < 1700
# define BOOST_COMPILER_VERSION 10.0
-# elif _MSC_VER == 1700
+# elif _MSC_VER < 1800
# define BOOST_COMPILER_VERSION 11.0
# else
# define BOOST_COMPILER_VERSION _MSC_VER
# endif
# endif
-#define BOOST_COMPILER "Microsoft Visual C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION)
-
-//
-// versions check:
-// we don't support Visual C++ prior to version 6:
-#if _MSC_VER < 1200
-#error "Compiler not supported or configured - please reconfigure"
+# define BOOST_COMPILER "Microsoft Visual C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION)
#endif
+
//
// last known and checked version is 1700 (VC11, aka 2011):
#if (_MSC_VER > 1700)
diff --git a/boost/config/stdlib/dinkumware.hpp b/boost/config/stdlib/dinkumware.hpp
index 1814bee2c5..e0032b9d49 100644
--- a/boost/config/stdlib/dinkumware.hpp
+++ b/boost/config/stdlib/dinkumware.hpp
@@ -94,34 +94,37 @@
// C++0x headers implemented in 520 (as shipped by Microsoft)
//
#if !defined(_CPPLIB_VER) || _CPPLIB_VER < 520
-# define BOOST_NO_0X_HDR_ARRAY
-# define BOOST_NO_0X_HDR_CODECVT
-# define BOOST_NO_0X_HDR_FORWARD_LIST
-# define BOOST_NO_0X_HDR_INITIALIZER_LIST
-# define BOOST_NO_0X_HDR_RANDOM
-# define BOOST_NO_0X_HDR_REGEX
-# define BOOST_NO_0X_HDR_SYSTEM_ERROR
-# define BOOST_NO_STD_UNORDERED // deprecated; see following
-# define BOOST_NO_0X_HDR_UNORDERED_MAP
-# define BOOST_NO_0X_HDR_UNORDERED_SET
-# define BOOST_NO_0X_HDR_TUPLE
-# define BOOST_NO_0X_HDR_TYPEINDEX
-# define BOOST_NO_NUMERIC_LIMITS_LOWEST
+# define BOOST_NO_CXX11_HDR_ARRAY
+# define BOOST_NO_CXX11_HDR_CODECVT
+# define BOOST_NO_CXX11_HDR_FORWARD_LIST
+# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+# define BOOST_NO_CXX11_HDR_RANDOM
+# define BOOST_NO_CXX11_HDR_REGEX
+# define BOOST_NO_CXX11_HDR_SYSTEM_ERROR
+# define BOOST_NO_CXX11_HDR_UNORDERED_MAP
+# define BOOST_NO_CXX11_HDR_UNORDERED_SET
+# define BOOST_NO_CXX11_HDR_TUPLE
+# define BOOST_NO_CXX11_HDR_TYPEINDEX
+# define BOOST_NO_CXX11_HDR_FUNCTIONAL
+# define BOOST_NO_CXX11_NUMERIC_LIMITS
+# define BOOST_NO_CXX11_SMART_PTR
#endif
-#if (!defined(_HAS_TR1_IMPORTS) || (_HAS_TR1_IMPORTS+0 == 0)) && !defined(BOOST_NO_0X_HDR_TUPLE)
-# define BOOST_NO_0X_HDR_TUPLE
+#if (!defined(_HAS_TR1_IMPORTS) || (_HAS_TR1_IMPORTS+0 == 0)) && !defined(BOOST_NO_CXX11_HDR_TUPLE)
+# define BOOST_NO_CXX11_HDR_TUPLE
#endif
//
// C++0x headers not yet (fully) implemented:
//
-# define BOOST_NO_0X_HDR_TYPE_TRAITS
-# define BOOST_NO_0X_HDR_CHRONO
-# define BOOST_NO_0X_HDR_CONDITION_VARIABLE
-# define BOOST_NO_0X_HDR_FUTURE
-# define BOOST_NO_0X_HDR_MUTEX
-# define BOOST_NO_0X_HDR_RATIO
-# define BOOST_NO_0X_HDR_THREAD
+# define BOOST_NO_CXX11_HDR_TYPE_TRAITS
+# define BOOST_NO_CXX11_HDR_CHRONO
+# define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
+# define BOOST_NO_CXX11_HDR_FUTURE
+# define BOOST_NO_CXX11_HDR_MUTEX
+# define BOOST_NO_CXX11_HDR_RATIO
+# define BOOST_NO_CXX11_HDR_THREAD
+# define BOOST_NO_CXX11_ALLOCATOR
+# define BOOST_NO_CXX11_ATOMIC_SMART_PTR
#ifdef _CPPLIB_VER
# define BOOST_DINKUMWARE_STDLIB _CPPLIB_VER
diff --git a/boost/config/stdlib/libcomo.hpp b/boost/config/stdlib/libcomo.hpp
index 341cf9708a..29490f1b13 100644
--- a/boost/config/stdlib/libcomo.hpp
+++ b/boost/config/stdlib/libcomo.hpp
@@ -35,26 +35,29 @@
// C++0x headers not yet implemented
//
-# define BOOST_NO_0X_HDR_ARRAY
-# define BOOST_NO_0X_HDR_CHRONO
-# define BOOST_NO_0X_HDR_CODECVT
-# define BOOST_NO_0X_HDR_CONDITION_VARIABLE
-# define BOOST_NO_0X_HDR_FORWARD_LIST
-# define BOOST_NO_0X_HDR_FUTURE
-# define BOOST_NO_0X_HDR_INITIALIZER_LIST
-# define BOOST_NO_0X_HDR_MUTEX
-# define BOOST_NO_0X_HDR_RANDOM
-# define BOOST_NO_0X_HDR_RATIO
-# define BOOST_NO_0X_HDR_REGEX
-# define BOOST_NO_0X_HDR_SYSTEM_ERROR
-# define BOOST_NO_0X_HDR_THREAD
-# define BOOST_NO_0X_HDR_TUPLE
-# define BOOST_NO_0X_HDR_TYPE_TRAITS
-# define BOOST_NO_0X_HDR_TYPEINDEX
-# define BOOST_NO_STD_UNORDERED // deprecated; see following
-# define BOOST_NO_0X_HDR_UNORDERED_MAP
-# define BOOST_NO_0X_HDR_UNORDERED_SET
-# define BOOST_NO_NUMERIC_LIMITS_LOWEST
+# define BOOST_NO_CXX11_HDR_ARRAY
+# define BOOST_NO_CXX11_HDR_CHRONO
+# define BOOST_NO_CXX11_HDR_CODECVT
+# define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
+# define BOOST_NO_CXX11_HDR_FORWARD_LIST
+# define BOOST_NO_CXX11_HDR_FUTURE
+# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+# define BOOST_NO_CXX11_HDR_MUTEX
+# define BOOST_NO_CXX11_HDR_RANDOM
+# define BOOST_NO_CXX11_HDR_RATIO
+# define BOOST_NO_CXX11_HDR_REGEX
+# define BOOST_NO_CXX11_HDR_SYSTEM_ERROR
+# define BOOST_NO_CXX11_HDR_THREAD
+# define BOOST_NO_CXX11_HDR_TUPLE
+# define BOOST_NO_CXX11_HDR_TYPE_TRAITS
+# define BOOST_NO_CXX11_HDR_TYPEINDEX
+# define BOOST_NO_CXX11_HDR_UNORDERED_MAP
+# define BOOST_NO_CXX11_HDR_UNORDERED_SET
+# define BOOST_NO_CXX11_NUMERIC_LIMITS
+# define BOOST_NO_CXX11_ALLOCATOR
+# define BOOST_NO_CXX11_ATOMIC_SMART_PTR
+# define BOOST_NO_CXX11_SMART_PTR
+# define BOOST_NO_CXX11_HDR_FUNCTIONAL
//
// Intrinsic type_traits support.
diff --git a/boost/config/stdlib/libcpp.hpp b/boost/config/stdlib/libcpp.hpp
index 07c7043331..3d574407ec 100644
--- a/boost/config/stdlib/libcpp.hpp
+++ b/boost/config/stdlib/libcpp.hpp
@@ -20,15 +20,16 @@
#define BOOST_HAS_THREADS
#ifdef _LIBCPP_HAS_NO_VARIADICS
-# define BOOST_NO_0X_HDR_TUPLE
+# define BOOST_NO_CXX11_HDR_TUPLE
#endif
//
// These appear to be unusable/incomplete so far:
//
-# define BOOST_NO_0X_HDR_CHRONO
-# define BOOST_NO_0X_HDR_FUTURE
-# define BOOST_NO_0X_HDR_TYPE_TRAITS
+# define BOOST_NO_CXX11_HDR_CHRONO
+# define BOOST_NO_CXX11_HDR_FUTURE
+# define BOOST_NO_CXX11_HDR_TYPE_TRAITS
+# define BOOST_NO_CXX11_ATOMIC_SMART_PTR
// libc++ uses a non-standard messages_base
#define BOOST_NO_STD_MESSAGES
diff --git a/boost/config/stdlib/libstdcpp3.hpp b/boost/config/stdlib/libstdcpp3.hpp
index 03cea5c0f7..c56dff225c 100644
--- a/boost/config/stdlib/libstdcpp3.hpp
+++ b/boost/config/stdlib/libstdcpp3.hpp
@@ -105,51 +105,61 @@
// C++0x headers in GCC 4.3.0 and later
//
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define BOOST_NO_0X_HDR_ARRAY
-# define BOOST_NO_0X_HDR_REGEX
-# define BOOST_NO_0X_HDR_TUPLE
-# define BOOST_NO_STD_UNORDERED // deprecated; see following
-# define BOOST_NO_0X_HDR_UNORDERED_MAP
-# define BOOST_NO_0X_HDR_UNORDERED_SET
+# define BOOST_NO_CXX11_HDR_ARRAY
+# define BOOST_NO_CXX11_HDR_REGEX
+# define BOOST_NO_CXX11_HDR_TUPLE
+# define BOOST_NO_CXX11_HDR_UNORDERED_MAP
+# define BOOST_NO_CXX11_HDR_UNORDERED_SET
+# define BOOST_NO_CXX11_HDR_FUNCTIONAL
#endif
// C++0x headers in GCC 4.4.0 and later
//
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define BOOST_NO_0X_HDR_CHRONO
-# define BOOST_NO_0X_HDR_CONDITION_VARIABLE
-# define BOOST_NO_0X_HDR_FORWARD_LIST
-# define BOOST_NO_0X_HDR_INITIALIZER_LIST
-# define BOOST_NO_0X_HDR_MUTEX
-# define BOOST_NO_0X_HDR_RATIO
-# define BOOST_NO_0X_HDR_SYSTEM_ERROR
+# define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
+# define BOOST_NO_CXX11_HDR_FORWARD_LIST
+# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+# define BOOST_NO_CXX11_HDR_MUTEX
+# define BOOST_NO_CXX11_HDR_RATIO
+# define BOOST_NO_CXX11_HDR_SYSTEM_ERROR
+# define BOOST_NO_CXX11_SMART_PTR
#else
# define BOOST_HAS_TR1_COMPLEX_INVERSE_TRIG
# define BOOST_HAS_TR1_COMPLEX_OVERLOADS
#endif
-#if (!defined(_GLIBCXX_HAS_GTHREADS) || !defined(_GLIBCXX_USE_C99_STDINT_TR1)) && (!defined(BOOST_NO_0X_HDR_CONDITION_VARIABLE) || !defined(BOOST_NO_0X_HDR_MUTEX))
-# define BOOST_NO_0X_HDR_CONDITION_VARIABLE
-# define BOOST_NO_0X_HDR_MUTEX
+#if (!defined(_GLIBCXX_HAS_GTHREADS) || !defined(_GLIBCXX_USE_C99_STDINT_TR1)) && (!defined(BOOST_NO_CXX11_HDR_CONDITION_VARIABLE) || !defined(BOOST_NO_CXX11_HDR_MUTEX))
+# define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
+# define BOOST_NO_CXX11_HDR_MUTEX
#endif
// C++0x features in GCC 4.5.0 and later
//
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define BOOST_NO_NUMERIC_LIMITS_LOWEST
-# define BOOST_NO_0X_HDR_FUTURE
-# define BOOST_NO_0X_HDR_RANDOM
+# define BOOST_NO_CXX11_NUMERIC_LIMITS
+# define BOOST_NO_CXX11_HDR_FUTURE
+# define BOOST_NO_CXX11_HDR_RANDOM
#endif
-// C++0x features in GCC 4.5.0 and later
+// C++0x features in GCC 4.6.0 and later
//
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define BOOST_NO_0X_HDR_TYPEINDEX
+# define BOOST_NO_CXX11_HDR_TYPEINDEX
+#endif
+
+// C++0x features in GCC 4.7.0 and later
+//
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
+// Note that although <chrono> existed prior to 4.7, "stead_clock" is spelled "monotonic_clock"
+// so 4.7.0 is the first truely conforming one.
+# define BOOST_NO_CXX11_HDR_CHRONO
+# define BOOST_NO_CXX11_ALLOCATOR
#endif
// C++0x headers not yet (fully!) implemented
//
-# define BOOST_NO_0X_HDR_THREAD
-# define BOOST_NO_0X_HDR_TYPE_TRAITS
-# define BOOST_NO_0X_HDR_CODECVT
+# define BOOST_NO_CXX11_HDR_THREAD
+# define BOOST_NO_CXX11_HDR_TYPE_TRAITS
+# define BOOST_NO_CXX11_HDR_CODECVT
+# define BOOST_NO_CXX11_ATOMIC_SMART_PTR
// --- end ---
diff --git a/boost/config/stdlib/modena.hpp b/boost/config/stdlib/modena.hpp
index 626e712b5d..b483b6e024 100644
--- a/boost/config/stdlib/modena.hpp
+++ b/boost/config/stdlib/modena.hpp
@@ -24,26 +24,29 @@
// C++0x headers not yet implemented
//
-# define BOOST_NO_0X_HDR_ARRAY
-# define BOOST_NO_0X_HDR_CHRONO
-# define BOOST_NO_0X_HDR_CODECVT
-# define BOOST_NO_0X_HDR_CONDITION_VARIABLE
-# define BOOST_NO_0X_HDR_FORWARD_LIST
-# define BOOST_NO_0X_HDR_FUTURE
-# define BOOST_NO_0X_HDR_INITIALIZER_LIST
-# define BOOST_NO_0X_HDR_MUTEX
-# define BOOST_NO_0X_HDR_RANDOM
-# define BOOST_NO_0X_HDR_RATIO
-# define BOOST_NO_0X_HDR_REGEX
-# define BOOST_NO_0X_HDR_SYSTEM_ERROR
-# define BOOST_NO_0X_HDR_THREAD
-# define BOOST_NO_0X_HDR_TUPLE
-# define BOOST_NO_0X_HDR_TYPE_TRAITS
-# define BOOST_NO_0X_HDR_TYPEINDEX
-# define BOOST_NO_STD_UNORDERED // deprecated; see following
-# define BOOST_NO_0X_HDR_UNORDERED_MAP
-# define BOOST_NO_0X_HDR_UNORDERED_SET
-# define BOOST_NO_NUMERIC_LIMITS_LOWEST
+# define BOOST_NO_CXX11_HDR_ARRAY
+# define BOOST_NO_CXX11_HDR_CHRONO
+# define BOOST_NO_CXX11_HDR_CODECVT
+# define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
+# define BOOST_NO_CXX11_HDR_FORWARD_LIST
+# define BOOST_NO_CXX11_HDR_FUTURE
+# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+# define BOOST_NO_CXX11_HDR_MUTEX
+# define BOOST_NO_CXX11_HDR_RANDOM
+# define BOOST_NO_CXX11_HDR_RATIO
+# define BOOST_NO_CXX11_HDR_REGEX
+# define BOOST_NO_CXX11_HDR_SYSTEM_ERROR
+# define BOOST_NO_CXX11_HDR_THREAD
+# define BOOST_NO_CXX11_HDR_TUPLE
+# define BOOST_NO_CXX11_HDR_TYPE_TRAITS
+# define BOOST_NO_CXX11_HDR_TYPEINDEX
+# define BOOST_NO_CXX11_HDR_UNORDERED_MAP
+# define BOOST_NO_CXX11_HDR_UNORDERED_SET
+# define BOOST_NO_CXX11_NUMERIC_LIMITS
+# define BOOST_NO_CXX11_ALLOCATOR
+# define BOOST_NO_CXX11_ATOMIC_SMART_PTR
+# define BOOST_NO_CXX11_SMART_PTR
+# define BOOST_NO_CXX11_HDR_FUNCTIONAL
#define BOOST_STDLIB "Modena C++ standard library"
diff --git a/boost/config/stdlib/msl.hpp b/boost/config/stdlib/msl.hpp
index adb3d4787d..4f9a2da6ee 100644
--- a/boost/config/stdlib/msl.hpp
+++ b/boost/config/stdlib/msl.hpp
@@ -48,26 +48,29 @@
// C++0x headers not yet implemented
//
-# define BOOST_NO_0X_HDR_ARRAY
-# define BOOST_NO_0X_HDR_CHRONO
-# define BOOST_NO_0X_HDR_CODECVT
-# define BOOST_NO_0X_HDR_CONDITION_VARIABLE
-# define BOOST_NO_0X_HDR_FORWARD_LIST
-# define BOOST_NO_0X_HDR_FUTURE
-# define BOOST_NO_0X_HDR_INITIALIZER_LIST
-# define BOOST_NO_0X_HDR_MUTEX
-# define BOOST_NO_0X_HDR_RANDOM
-# define BOOST_NO_0X_HDR_RATIO
-# define BOOST_NO_0X_HDR_REGEX
-# define BOOST_NO_0X_HDR_SYSTEM_ERROR
-# define BOOST_NO_0X_HDR_THREAD
-# define BOOST_NO_0X_HDR_TUPLE
-# define BOOST_NO_0X_HDR_TYPE_TRAITS
-# define BOOST_NO_0X_HDR_TYPEINDEX
-# define BOOST_NO_STD_UNORDERED // deprecated; see following
-# define BOOST_NO_0X_HDR_UNORDERED_MAP
-# define BOOST_NO_0X_HDR_UNORDERED_SET
-# define BOOST_NO_NUMERIC_LIMITS_LOWEST
+# define BOOST_NO_CXX11_HDR_ARRAY
+# define BOOST_NO_CXX11_HDR_CHRONO
+# define BOOST_NO_CXX11_HDR_CODECVT
+# define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
+# define BOOST_NO_CXX11_HDR_FORWARD_LIST
+# define BOOST_NO_CXX11_HDR_FUTURE
+# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+# define BOOST_NO_CXX11_HDR_MUTEX
+# define BOOST_NO_CXX11_HDR_RANDOM
+# define BOOST_NO_CXX11_HDR_RATIO
+# define BOOST_NO_CXX11_HDR_REGEX
+# define BOOST_NO_CXX11_HDR_SYSTEM_ERROR
+# define BOOST_NO_CXX11_HDR_THREAD
+# define BOOST_NO_CXX11_HDR_TUPLE
+# define BOOST_NO_CXX11_HDR_TYPE_TRAITS
+# define BOOST_NO_CXX11_HDR_TYPEINDEX
+# define BOOST_NO_CXX11_HDR_UNORDERED_MAP
+# define BOOST_NO_CXX11_HDR_UNORDERED_SET
+# define BOOST_NO_CXX11_NUMERIC_LIMITS
+# define BOOST_NO_CXX11_ALLOCATOR
+# define BOOST_NO_CXX11_ATOMIC_SMART_PTR
+# define BOOST_NO_CXX11_SMART_PTR
+# define BOOST_NO_CXX11_HDR_FUNCTIONAL
#define BOOST_STDLIB "Metrowerks Standard Library version " BOOST_STRINGIZE(__MSL_CPP__)
diff --git a/boost/config/stdlib/roguewave.hpp b/boost/config/stdlib/roguewave.hpp
index 95ac36c6b8..cb80f57082 100644
--- a/boost/config/stdlib/roguewave.hpp
+++ b/boost/config/stdlib/roguewave.hpp
@@ -155,29 +155,32 @@
#endif
#if _RWSTD_VER < 0x05000000
-# define BOOST_NO_0X_HDR_ARRAY
+# define BOOST_NO_CXX11_HDR_ARRAY
#endif
// type_traits header is incomplete:
-# define BOOST_NO_0X_HDR_TYPE_TRAITS
+# define BOOST_NO_CXX11_HDR_TYPE_TRAITS
//
// C++0x headers not yet implemented
//
-# define BOOST_NO_0X_HDR_CHRONO
-# define BOOST_NO_0X_HDR_CODECVT
-# define BOOST_NO_0X_HDR_CONDITION_VARIABLE
-# define BOOST_NO_0X_HDR_FORWARD_LIST
-# define BOOST_NO_0X_HDR_FUTURE
-# define BOOST_NO_0X_HDR_INITIALIZER_LIST
-# define BOOST_NO_0X_HDR_MUTEX
-# define BOOST_NO_0X_HDR_RANDOM
-# define BOOST_NO_0X_HDR_RATIO
-# define BOOST_NO_0X_HDR_REGEX
-# define BOOST_NO_0X_HDR_SYSTEM_ERROR
-# define BOOST_NO_0X_HDR_THREAD
-# define BOOST_NO_0X_HDR_TUPLE
-# define BOOST_NO_0X_HDR_TYPEINDEX
-# define BOOST_NO_STD_UNORDERED // deprecated; see following
-# define BOOST_NO_0X_HDR_UNORDERED_MAP
-# define BOOST_NO_0X_HDR_UNORDERED_SET
-# define BOOST_NO_NUMERIC_LIMITS_LOWEST
+# define BOOST_NO_CXX11_HDR_CHRONO
+# define BOOST_NO_CXX11_HDR_CODECVT
+# define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
+# define BOOST_NO_CXX11_HDR_FORWARD_LIST
+# define BOOST_NO_CXX11_HDR_FUTURE
+# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+# define BOOST_NO_CXX11_HDR_MUTEX
+# define BOOST_NO_CXX11_HDR_RANDOM
+# define BOOST_NO_CXX11_HDR_RATIO
+# define BOOST_NO_CXX11_HDR_REGEX
+# define BOOST_NO_CXX11_HDR_SYSTEM_ERROR
+# define BOOST_NO_CXX11_HDR_THREAD
+# define BOOST_NO_CXX11_HDR_TUPLE
+# define BOOST_NO_CXX11_HDR_TYPEINDEX
+# define BOOST_NO_CXX11_HDR_UNORDERED_MAP
+# define BOOST_NO_CXX11_HDR_UNORDERED_SET
+# define BOOST_NO_CXX11_NUMERIC_LIMITS
+# define BOOST_NO_CXX11_ALLOCATOR
+# define BOOST_NO_CXX11_ATOMIC_SMART_PTR
+# define BOOST_NO_CXX11_SMART_PTR
+# define BOOST_NO_CXX11_HDR_FUNCTIONAL
diff --git a/boost/config/stdlib/sgi.hpp b/boost/config/stdlib/sgi.hpp
index c8d77d55d4..ae9b6ad908 100644
--- a/boost/config/stdlib/sgi.hpp
+++ b/boost/config/stdlib/sgi.hpp
@@ -118,26 +118,29 @@
// C++0x headers not yet implemented
//
-# define BOOST_NO_0X_HDR_ARRAY
-# define BOOST_NO_0X_HDR_CHRONO
-# define BOOST_NO_0X_HDR_CODECVT
-# define BOOST_NO_0X_HDR_CONDITION_VARIABLE
-# define BOOST_NO_0X_HDR_FORWARD_LIST
-# define BOOST_NO_0X_HDR_FUTURE
-# define BOOST_NO_0X_HDR_INITIALIZER_LIST
-# define BOOST_NO_0X_HDR_MUTEX
-# define BOOST_NO_0X_HDR_RANDOM
-# define BOOST_NO_0X_HDR_RATIO
-# define BOOST_NO_0X_HDR_REGEX
-# define BOOST_NO_0X_HDR_SYSTEM_ERROR
-# define BOOST_NO_0X_HDR_THREAD
-# define BOOST_NO_0X_HDR_TUPLE
-# define BOOST_NO_0X_HDR_TYPE_TRAITS
-# define BOOST_NO_0X_HDR_TYPEINDEX
-# define BOOST_NO_STD_UNORDERED // deprecated; see following
-# define BOOST_NO_0X_HDR_UNORDERED_MAP
-# define BOOST_NO_0X_HDR_UNORDERED_SET
-# define BOOST_NO_NUMERIC_LIMITS_LOWEST
+# define BOOST_NO_CXX11_HDR_ARRAY
+# define BOOST_NO_CXX11_HDR_CHRONO
+# define BOOST_NO_CXX11_HDR_CODECVT
+# define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
+# define BOOST_NO_CXX11_HDR_FORWARD_LIST
+# define BOOST_NO_CXX11_HDR_FUTURE
+# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+# define BOOST_NO_CXX11_HDR_MUTEX
+# define BOOST_NO_CXX11_HDR_RANDOM
+# define BOOST_NO_CXX11_HDR_RATIO
+# define BOOST_NO_CXX11_HDR_REGEX
+# define BOOST_NO_CXX11_HDR_SYSTEM_ERROR
+# define BOOST_NO_CXX11_HDR_THREAD
+# define BOOST_NO_CXX11_HDR_TUPLE
+# define BOOST_NO_CXX11_HDR_TYPE_TRAITS
+# define BOOST_NO_CXX11_HDR_TYPEINDEX
+# define BOOST_NO_CXX11_HDR_UNORDERED_MAP
+# define BOOST_NO_CXX11_HDR_UNORDERED_SET
+# define BOOST_NO_CXX11_NUMERIC_LIMITS
+# define BOOST_NO_CXX11_ALLOCATOR
+# define BOOST_NO_CXX11_ATOMIC_SMART_PTR
+# define BOOST_NO_CXX11_SMART_PTR
+# define BOOST_NO_CXX11_HDR_FUNCTIONAL
#define BOOST_STDLIB "SGI standard library"
diff --git a/boost/config/stdlib/stlport.hpp b/boost/config/stdlib/stlport.hpp
index d306999221..bcc30b99e7 100644
--- a/boost/config/stdlib/stlport.hpp
+++ b/boost/config/stdlib/stlport.hpp
@@ -71,10 +71,6 @@
# endif
#endif
-#if defined(_STLPORT_VERSION) && ((_STLPORT_VERSION < 0x500) || (_STLPORT_VERSION >= 0x520))
-# define BOOST_NO_STD_UNORDERED
-#endif
-
#if defined(_STLPORT_VERSION) && (_STLPORT_VERSION >= 0x520)
# define BOOST_HAS_TR1_UNORDERED_SET
# define BOOST_HAS_TR1_UNORDERED_MAP
@@ -212,26 +208,29 @@ namespace boost { using std::min; using std::max; }
// C++0x headers not yet implemented
//
-# define BOOST_NO_0X_HDR_ARRAY
-# define BOOST_NO_0X_HDR_CHRONO
-# define BOOST_NO_0X_HDR_CODECVT
-# define BOOST_NO_0X_HDR_CONDITION_VARIABLE
-# define BOOST_NO_0X_HDR_FORWARD_LIST
-# define BOOST_NO_0X_HDR_FUTURE
-# define BOOST_NO_0X_HDR_INITIALIZER_LIST
-# define BOOST_NO_0X_HDR_MUTEX
-# define BOOST_NO_0X_HDR_RANDOM
-# define BOOST_NO_0X_HDR_RATIO
-# define BOOST_NO_0X_HDR_REGEX
-# define BOOST_NO_0X_HDR_SYSTEM_ERROR
-# define BOOST_NO_0X_HDR_THREAD
-# define BOOST_NO_0X_HDR_TUPLE
-# define BOOST_NO_0X_HDR_TYPE_TRAITS
-# define BOOST_NO_0X_HDR_TYPEINDEX
-# define BOOST_NO_STD_UNORDERED // deprecated; see following
-# define BOOST_NO_0X_HDR_UNORDERED_MAP
-# define BOOST_NO_0X_HDR_UNORDERED_SET
-# define BOOST_NO_NUMERIC_LIMITS_LOWEST
+# define BOOST_NO_CXX11_HDR_ARRAY
+# define BOOST_NO_CXX11_HDR_CHRONO
+# define BOOST_NO_CXX11_HDR_CODECVT
+# define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
+# define BOOST_NO_CXX11_HDR_FORWARD_LIST
+# define BOOST_NO_CXX11_HDR_FUTURE
+# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+# define BOOST_NO_CXX11_HDR_MUTEX
+# define BOOST_NO_CXX11_HDR_RANDOM
+# define BOOST_NO_CXX11_HDR_RATIO
+# define BOOST_NO_CXX11_HDR_REGEX
+# define BOOST_NO_CXX11_HDR_SYSTEM_ERROR
+# define BOOST_NO_CXX11_HDR_THREAD
+# define BOOST_NO_CXX11_HDR_TUPLE
+# define BOOST_NO_CXX11_HDR_TYPE_TRAITS
+# define BOOST_NO_CXX11_HDR_TYPEINDEX
+# define BOOST_NO_CXX11_HDR_UNORDERED_MAP
+# define BOOST_NO_CXX11_HDR_UNORDERED_SET
+# define BOOST_NO_CXX11_NUMERIC_LIMITS
+# define BOOST_NO_CXX11_ALLOCATOR
+# define BOOST_NO_CXX11_ATOMIC_SMART_PTR
+# define BOOST_NO_CXX11_SMART_PTR
+# define BOOST_NO_CXX11_HDR_FUNCTIONAL
#define BOOST_STDLIB "STLPort standard library version " BOOST_STRINGIZE(__SGI_STL_PORT)
diff --git a/boost/config/stdlib/vacpp.hpp b/boost/config/stdlib/vacpp.hpp
index 32a1fc08b7..9d16946552 100644
--- a/boost/config/stdlib/vacpp.hpp
+++ b/boost/config/stdlib/vacpp.hpp
@@ -24,26 +24,29 @@
// C++0x headers not yet implemented
//
-# define BOOST_NO_0X_HDR_ARRAY
-# define BOOST_NO_0X_HDR_CHRONO
-# define BOOST_NO_0X_HDR_CODECVT
-# define BOOST_NO_0X_HDR_CONDITION_VARIABLE
-# define BOOST_NO_0X_HDR_FORWARD_LIST
-# define BOOST_NO_0X_HDR_FUTURE
-# define BOOST_NO_0X_HDR_INITIALIZER_LIST
-# define BOOST_NO_0X_HDR_MUTEX
-# define BOOST_NO_0X_HDR_RANDOM
-# define BOOST_NO_0X_HDR_RATIO
-# define BOOST_NO_0X_HDR_REGEX
-# define BOOST_NO_0X_HDR_SYSTEM_ERROR
-# define BOOST_NO_0X_HDR_THREAD
-# define BOOST_NO_0X_HDR_TUPLE
-# define BOOST_NO_0X_HDR_TYPE_TRAITS
-# define BOOST_NO_0X_HDR_TYPEINDEX
-# define BOOST_NO_STD_UNORDERED // deprecated; see following
-# define BOOST_NO_0X_HDR_UNORDERED_MAP
-# define BOOST_NO_0X_HDR_UNORDERED_SET
-# define BOOST_NO_NUMERIC_LIMITS_LOWEST
+# define BOOST_NO_CXX11_HDR_ARRAY
+# define BOOST_NO_CXX11_HDR_CHRONO
+# define BOOST_NO_CXX11_HDR_CODECVT
+# define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
+# define BOOST_NO_CXX11_HDR_FORWARD_LIST
+# define BOOST_NO_CXX11_HDR_FUTURE
+# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+# define BOOST_NO_CXX11_HDR_MUTEX
+# define BOOST_NO_CXX11_HDR_RANDOM
+# define BOOST_NO_CXX11_HDR_RATIO
+# define BOOST_NO_CXX11_HDR_REGEX
+# define BOOST_NO_CXX11_HDR_SYSTEM_ERROR
+# define BOOST_NO_CXX11_HDR_THREAD
+# define BOOST_NO_CXX11_HDR_TUPLE
+# define BOOST_NO_CXX11_HDR_TYPE_TRAITS
+# define BOOST_NO_CXX11_HDR_TYPEINDEX
+# define BOOST_NO_CXX11_HDR_UNORDERED_MAP
+# define BOOST_NO_CXX11_HDR_UNORDERED_SET
+# define BOOST_NO_CXX11_NUMERIC_LIMITS
+# define BOOST_NO_CXX11_ALLOCATOR
+# define BOOST_NO_CXX11_ATOMIC_SMART_PTR
+# define BOOST_NO_CXX11_SMART_PTR
+# define BOOST_NO_CXX11_HDR_FUNCTIONAL
#define BOOST_STDLIB "Visual Age default standard library"
diff --git a/boost/config/suffix.hpp b/boost/config/suffix.hpp
index 72a0dc9573..2d2481327a 100644
--- a/boost/config/suffix.hpp
+++ b/boost/config/suffix.hpp
@@ -104,13 +104,6 @@
#endif
//
-// Normalize BOOST_NO_STATIC_ASSERT and (depricated) BOOST_HAS_STATIC_ASSERT:
-//
-#if !defined(BOOST_NO_STATIC_ASSERT) && !defined(BOOST_HAS_STATIC_ASSERT)
-# define BOOST_HAS_STATIC_ASSERT
-#endif
-
-//
// if there is no __int64 then there is no specialisation
// for numeric_limits<__int64> either:
//
@@ -334,38 +327,6 @@
# define BOOST_HASH_MAP_HEADER <hash_map>
#endif
-//
-// Set BOOST_NO_INITIALIZER_LISTS if there is no library support.
-//
-
-#if defined(BOOST_NO_0X_HDR_INITIALIZER_LIST) && !defined(BOOST_NO_INITIALIZER_LISTS)
-# define BOOST_NO_INITIALIZER_LISTS
-#endif
-#if defined(BOOST_NO_INITIALIZER_LISTS) && !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
-# define BOOST_NO_0X_HDR_INITIALIZER_LIST
-#endif
-
-//
-// Set BOOST_HAS_RVALUE_REFS when BOOST_NO_RVALUE_REFERENCES is not defined
-//
-#if !defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_HAS_RVALUE_REFS)
-#define BOOST_HAS_RVALUE_REFS
-#endif
-
-//
-// Set BOOST_HAS_VARIADIC_TMPL when BOOST_NO_VARIADIC_TEMPLATES is not defined
-//
-#if !defined(BOOST_NO_VARIADIC_TEMPLATES) && !defined(BOOST_HAS_VARIADIC_TMPL)
-#define BOOST_HAS_VARIADIC_TMPL
-#endif
-
-//
-// Set BOOST_NO_DECLTYPE_N3276 when BOOST_NO_DECLTYPE is defined
-//
-#if !defined(BOOST_NO_DECLTYPE_N3276) && defined(BOOST_NO_DECLTYPE)
-#define BOOST_NO_DECLTYPE_N3276
-#endif
-
// BOOST_HAS_ABI_HEADERS
// This macro gets set if we have headers that fix the ABI,
// and prevent ODR violations when linking to external libraries:
@@ -636,20 +597,6 @@ namespace std{ using ::type_info; }
#define BOOST_DO_JOIN2( X, Y ) X##Y
//
-// Helper macros BOOST_NOEXCEPT, BOOST_NOEXCEPT_IF, BOOST_NOEXCEPT_EXPR
-// These aid the transition to C++11 while still supporting C++03 compilers
-//
-#ifdef BOOST_NO_NOEXCEPT
-# define BOOST_NOEXCEPT
-# define BOOST_NOEXCEPT_IF(Predicate)
-# define BOOST_NOEXCEPT_EXPR(Expression) false
-#else
-# define BOOST_NOEXCEPT noexcept
-# define BOOST_NOEXCEPT_IF(Predicate) noexcept((Predicate))
-# define BOOST_NOEXCEPT_EXPR(Expression) noexcept((Expression))
-#endif
-
-//
// Set some default values for compiler/library/platform names.
// These are for debugging config setup only:
//
@@ -675,6 +622,260 @@ namespace std{ using ::type_info; }
# define BOOST_GPU_ENABLED
# endif
+// BOOST_FORCEINLINE ---------------------------------------------//
+// Macro to use in place of 'inline' to force a function to be inline
+#if !defined(BOOST_FORCEINLINE)
+# if defined(_MSC_VER)
+# define BOOST_FORCEINLINE __forceinline
+# elif defined(__GNUC__) && __GNUC__ > 3
+# define BOOST_FORCEINLINE inline __attribute__ ((always_inline))
+# else
+# define BOOST_FORCEINLINE inline
+# endif
+#endif
+
+//
+// Set BOOST_NO_DECLTYPE_N3276 when BOOST_NO_DECLTYPE is defined
+//
+#if defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_CXX11_DECLTYPE_N3276)
+#define BOOST_NO_CXX11_DECLTYPE_N3276 BOOST_NO_CXX11_DECLTYPE
+#endif
+
+// -------------------- Deprecated macros for 1.50 ---------------------------
+// These will go away in a future release
+
+// Use BOOST_NO_CXX11_HDR_UNORDERED_SET or BOOST_NO_CXX11_HDR_UNORDERED_MAP
+// instead of BOOST_NO_STD_UNORDERED
+#if defined(BOOST_NO_CXX11_HDR_UNORDERED_MAP) || defined (BOOST_NO_CXX11_HDR_UNORDERED_SET)
+# ifndef BOOST_NO_STD_UNORDERED
+# define BOOST_NO_STD_UNORDERED
+# endif
+#endif
+
+// Use BOOST_NO_CXX11_HDR_INITIALIZER_LIST instead of BOOST_NO_INITIALIZER_LISTS
+#if defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) && !defined(BOOST_NO_INITIALIZER_LISTS)
+# define BOOST_NO_INITIALIZER_LISTS
+#endif
+
+// Use BOOST_NO_CXX11_HDR_ARRAY instead of BOOST_NO_0X_HDR_ARRAY
+#if defined(BOOST_NO_CXX11_HDR_ARRAY) && !defined(BOOST_NO_BOOST_NO_0X_HDR_ARRAY)
+# define BOOST_NO_0X_HDR_ARRAY
+#endif
+// Use BOOST_NO_CXX11_HDR_CHRONO instead of BOOST_NO_0X_HDR_CHRONO
+#if defined(BOOST_NO_CXX11_HDR_CHRONO) && !defined(BOOST_NO_0X_HDR_CHRONO)
+# define BOOST_NO_0X_HDR_CHRONO
+#endif
+// Use BOOST_NO_CXX11_HDR_CODECVT instead of BOOST_NO_0X_HDR_CODECVT
+#if defined(BOOST_NO_CXX11_HDR_CODECVT) && !defined(BOOST_NO_0X_HDR_CODECVT)
+# define BOOST_NO_0X_HDR_CODECVT
+#endif
+// Use BOOST_NO_CXX11_HDR_CONDITION_VARIABLE instead of BOOST_NO_0X_HDR_CONDITION_VARIABLE
+#if defined(BOOST_NO_CXX11_HDR_CONDITION_VARIABLE) && !defined(BOOST_NO_0X_HDR_CONDITION_VARIABLE)
+# define BOOST_NO_0X_HDR_CONDITION_VARIABLE
+#endif
+// Use BOOST_NO_CXX11_HDR_FORWARD_LIST instead of BOOST_NO_0X_HDR_FORWARD_LIST
+#if defined(BOOST_NO_CXX11_HDR_FORWARD_LIST) && !defined(BOOST_NO_0X_HDR_FORWARD_LIST)
+# define BOOST_NO_0X_HDR_FORWARD_LIST
+#endif
+// Use BOOST_NO_CXX11_HDR_FUTURE instead of BOOST_NO_0X_HDR_FUTURE
+#if defined(BOOST_NO_CXX11_HDR_FUTURE) && !defined(BOOST_NO_0X_HDR_FUTURE)
+# define BOOST_NO_0X_HDR_FUTURE
+#endif
+
+// Use BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+// instead of BOOST_NO_0X_HDR_INITIALIZER_LIST or BOOST_NO_INITIALIZER_LISTS
+#ifdef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
+# ifndef BOOST_NO_0X_HDR_INITIALIZER_LIST
+# define BOOST_NO_0X_HDR_INITIALIZER_LIST
+# endif
+# ifndef BOOST_NO_INITIALIZER_LISTS
+# define BOOST_NO_INITIALIZER_LISTS
+# endif
+#endif
+
+// Use BOOST_NO_CXX11_HDR_MUTEX instead of BOOST_NO_0X_HDR_MUTEX
+#if defined(BOOST_NO_CXX11_HDR_MUTEX) && !defined(BOOST_NO_0X_HDR_MUTEX)
+# define BOOST_NO_0X_HDR_MUTEX
+#endif
+// Use BOOST_NO_CXX11_HDR_RANDOM instead of BOOST_NO_0X_HDR_RANDOM
+#if defined(BOOST_NO_CXX11_HDR_RANDOM) && !defined(BOOST_NO_0X_HDR_RANDOM)
+# define BOOST_NO_0X_HDR_RANDOM
+#endif
+// Use BOOST_NO_CXX11_HDR_RATIO instead of BOOST_NO_0X_HDR_RATIO
+#if defined(BOOST_NO_CXX11_HDR_RATIO) && !defined(BOOST_NO_0X_HDR_RATIO)
+# define BOOST_NO_0X_HDR_RATIO
+#endif
+// Use BOOST_NO_CXX11_HDR_REGEX instead of BOOST_NO_0X_HDR_REGEX
+#if defined(BOOST_NO_CXX11_HDR_REGEX) && !defined(BOOST_NO_0X_HDR_REGEX)
+# define BOOST_NO_0X_HDR_REGEX
+#endif
+// Use BOOST_NO_CXX11_HDR_SYSTEM_ERROR instead of BOOST_NO_0X_HDR_SYSTEM_ERROR
+#if defined(BOOST_NO_CXX11_HDR_SYSTEM_ERROR) && !defined(BOOST_NO_0X_HDR_SYSTEM_ERROR)
+# define BOOST_NO_0X_HDR_SYSTEM_ERROR
+#endif
+// Use BOOST_NO_CXX11_HDR_THREAD instead of BOOST_NO_0X_HDR_THREAD
+#if defined(BOOST_NO_CXX11_HDR_THREAD) && !defined(BOOST_NO_0X_HDR_THREAD)
+# define BOOST_NO_0X_HDR_THREAD
+#endif
+// Use BOOST_NO_CXX11_HDR_TUPLE instead of BOOST_NO_0X_HDR_TUPLE
+#if defined(BOOST_NO_CXX11_HDR_TUPLE) && !defined(BOOST_NO_0X_HDR_TUPLE)
+# define BOOST_NO_0X_HDR_TUPLE
+#endif
+// Use BOOST_NO_CXX11_HDR_TYPE_TRAITS instead of BOOST_NO_0X_HDR_TYPE_TRAITS
+#if defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) && !defined(BOOST_NO_0X_HDR_TYPE_TRAITS)
+# define BOOST_NO_0X_HDR_TYPE_TRAITS
+#endif
+// Use BOOST_NO_CXX11_HDR_TYPEINDEX instead of BOOST_NO_0X_HDR_TYPEINDEX
+#if defined(BOOST_NO_CXX11_HDR_TYPEINDEX) && !defined(BOOST_NO_0X_HDR_TYPEINDEX)
+# define BOOST_NO_0X_HDR_TYPEINDEX
+#endif
+// Use BOOST_NO_CXX11_HDR_UNORDERED_MAP instead of BOOST_NO_0X_HDR_UNORDERED_MAP
+#if defined(BOOST_NO_CXX11_HDR_UNORDERED_MAP) && !defined(BOOST_NO_0X_HDR_UNORDERED_MAP)
+# define BOOST_NO_0X_HDR_UNORDERED_MAP
+#endif
+// Use BOOST_NO_CXX11_HDR_UNORDERED_SET instead of BOOST_NO_0X_HDR_UNORDERED_SET
+#if defined(BOOST_NO_CXX11_HDR_UNORDERED_SET) && !defined(BOOST_NO_0X_HDR_UNORDERED_SET)
+# define BOOST_NO_0X_HDR_UNORDERED_SET
+#endif
+
+// ------------------ End of deprecated macros for 1.50 ---------------------------
+
+// -------------------- Deprecated macros for 1.51 ---------------------------
+// These will go away in a future release
+
+// Use BOOST_NO_CXX11_AUTO_DECLARATIONS instead of BOOST_NO_AUTO_DECLARATIONS
+#if defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) && !defined(BOOST_NO_AUTO_DECLARATIONS)
+# define BOOST_NO_AUTO_DECLARATIONS
+#endif
+// Use BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS instead of BOOST_NO_AUTO_MULTIDECLARATIONS
+#if defined(BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS) && !defined(BOOST_NO_AUTO_MULTIDECLARATIONS)
+# define BOOST_NO_AUTO_MULTIDECLARATIONS
+#endif
+// Use BOOST_NO_CXX11_CHAR16_T instead of BOOST_NO_CHAR16_T
+#if defined(BOOST_NO_CXX11_CHAR16_T) && !defined(BOOST_NO_CHAR16_T)
+# define BOOST_NO_CHAR16_T
+#endif
+// Use BOOST_NO_CXX11_CHAR32_T instead of BOOST_NO_CHAR32_T
+#if defined(BOOST_NO_CXX11_CHAR32_T) && !defined(BOOST_NO_CHAR32_T)
+# define BOOST_NO_CHAR32_T
+#endif
+// Use BOOST_NO_CXX11_TEMPLATE_ALIASES instead of BOOST_NO_TEMPLATE_ALIASES
+#if defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) && !defined(BOOST_NO_TEMPLATE_ALIASES)
+# define BOOST_NO_TEMPLATE_ALIASES
+#endif
+// Use BOOST_NO_CXX11_CONSTEXPR instead of BOOST_NO_CONSTEXPR
+#if defined(BOOST_NO_CXX11_CONSTEXPR) && !defined(BOOST_NO_CONSTEXPR)
+# define BOOST_NO_CONSTEXPR
+#endif
+// Use BOOST_NO_CXX11_DECLTYPE_N3276 instead of BOOST_NO_DECLTYPE_N3276
+#if defined(BOOST_NO_CXX11_DECLTYPE_N3276) && !defined(BOOST_NO_DECLTYPE_N3276)
+# define BOOST_NO_DECLTYPE_N3276
+#endif
+// Use BOOST_NO_CXX11_DECLTYPE instead of BOOST_NO_DECLTYPE
+#if defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_DECLTYPE)
+# define BOOST_NO_DECLTYPE
+#endif
+// Use BOOST_NO_CXX11_DEFAULTED_FUNCTIONS instead of BOOST_NO_DEFAULTED_FUNCTIONS
+#if defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) && !defined(BOOST_NO_DEFAULTED_FUNCTIONS)
+# define BOOST_NO_DEFAULTED_FUNCTIONS
+#endif
+// Use BOOST_NO_CXX11_DELETED_FUNCTIONS instead of BOOST_NO_DELETED_FUNCTIONS
+#if defined(BOOST_NO_CXX11_DELETED_FUNCTIONS) && !defined(BOOST_NO_DELETED_FUNCTIONS)
+# define BOOST_NO_DELETED_FUNCTIONS
+#endif
+// Use BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS instead of BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
+#if defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS) && !defined(BOOST_NO_EXPLICIT_CONVERSION_OPERATORS)
+# define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
+#endif
+// Use BOOST_NO_CXX11_EXTERN_TEMPLATE instead of BOOST_NO_EXTERN_TEMPLATE
+#if defined(BOOST_NO_CXX11_EXTERN_TEMPLATE) && !defined(BOOST_NO_EXTERN_TEMPLATE)
+# define BOOST_NO_EXTERN_TEMPLATE
+#endif
+// Use BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS instead of BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
+#if defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS) && !defined(BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS)
+# define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
+#endif
+// Use BOOST_NO_CXX11_LAMBDAS instead of BOOST_NO_LAMBDAS
+#if defined(BOOST_NO_CXX11_LAMBDAS) && !defined(BOOST_NO_LAMBDAS)
+# define BOOST_NO_LAMBDAS
+#endif
+// Use BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS instead of BOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS
+#if defined(BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS) && !defined(BOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS)
+# define BOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS
+#endif
+// Use BOOST_NO_CXX11_NOEXCEPT instead of BOOST_NO_NOEXCEPT
+#if defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_NOEXCEPT)
+# define BOOST_NO_NOEXCEPT
+#endif
+// Use BOOST_NO_CXX11_NULLPTR instead of BOOST_NO_NULLPTR
+#if defined(BOOST_NO_CXX11_NULLPTR) && !defined(BOOST_NO_NULLPTR)
+# define BOOST_NO_NULLPTR
+#endif
+// Use BOOST_NO_CXX11_RAW_LITERALS instead of BOOST_NO_RAW_LITERALS
+#if defined(BOOST_NO_CXX11_RAW_LITERALS) && !defined(BOOST_NO_RAW_LITERALS)
+# define BOOST_NO_RAW_LITERALS
+#endif
+// Use BOOST_NO_CXX11_RVALUE_REFERENCES instead of BOOST_NO_RVALUE_REFERENCES
+#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_RVALUE_REFERENCES)
+# define BOOST_NO_RVALUE_REFERENCES
+#endif
+// Use BOOST_NO_CXX11_SCOPED_ENUMS instead of BOOST_NO_SCOPED_ENUMS
+#if defined(BOOST_NO_CXX11_SCOPED_ENUMS) && !defined(BOOST_NO_SCOPED_ENUMS)
+# define BOOST_NO_SCOPED_ENUMS
+#endif
+// Use BOOST_NO_CXX11_STATIC_ASSERT instead of BOOST_NO_STATIC_ASSERT
+#if defined(BOOST_NO_CXX11_STATIC_ASSERT) && !defined(BOOST_NO_STATIC_ASSERT)
+# define BOOST_NO_STATIC_ASSERT
+#endif
+// Use BOOST_NO_CXX11_STD_UNORDERD instead of BOOST_NO_STD_UNORDERD
+#if defined(BOOST_NO_CXX11_STD_UNORDERD) && !defined(BOOST_NO_STD_UNORDERD)
+# define BOOST_NO_STD_UNORDERD
+#endif
+// Use BOOST_NO_CXX11_UNICODE_LITERALS instead of BOOST_NO_UNICODE_LITERALS
+#if defined(BOOST_NO_CXX11_UNICODE_LITERALS) && !defined(BOOST_NO_UNICODE_LITERALS)
+# define BOOST_NO_UNICODE_LITERALS
+#endif
+// Use BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX instead of BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
+#if defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX) && !defined(BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX)
+# define BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
+#endif
+// Use BOOST_NO_CXX11_VARIADIC_TEMPLATES instead of BOOST_NO_VARIADIC_TEMPLATES
+#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_VARIADIC_TEMPLATES)
+# define BOOST_NO_VARIADIC_TEMPLATES
+#endif
+// Use BOOST_NO_CXX11_VARIADIC_MACROS instead of BOOST_NO_VARIADIC_MACROS
+#if defined(BOOST_NO_CXX11_VARIADIC_MACROS) && !defined(BOOST_NO_VARIADIC_MACROS)
+# define BOOST_NO_VARIADIC_MACROS
+#endif
+// Use BOOST_NO_CXX11_NUMERIC_LIMITS instead of BOOST_NO_NUMERIC_LIMITS_LOWEST
+#if defined(BOOST_NO_CXX11_NUMERIC_LIMITS) && !defined(BOOST_NO_NUMERIC_LIMITS_LOWEST)
+# define BOOST_NO_NUMERIC_LIMITS_LOWEST
+#endif
+// ------------------ End of deprecated macros for 1.51 ---------------------------
+
+
+
+//
+// Helper macros BOOST_NOEXCEPT, BOOST_NOEXCEPT_IF, BOOST_NOEXCEPT_EXPR
+// These aid the transition to C++11 while still supporting C++03 compilers
+//
+#ifdef BOOST_NO_NOEXCEPT
+# define BOOST_NOEXCEPT
+# define BOOST_NOEXCEPT_IF(Predicate)
+# define BOOST_NOEXCEPT_EXPR(Expression) false
+#else
+# define BOOST_NOEXCEPT noexcept
+# define BOOST_NOEXCEPT_IF(Predicate) noexcept((Predicate))
+# define BOOST_NOEXCEPT_EXPR(Expression) noexcept((Expression))
+#endif
+
+//
+// Normalize BOOST_NO_STATIC_ASSERT and (depricated) BOOST_HAS_STATIC_ASSERT:
+//
+#if !defined(BOOST_NO_STATIC_ASSERT) && !defined(BOOST_HAS_STATIC_ASSERT)
+# define BOOST_HAS_STATIC_ASSERT
+#endif
+
//
// constexpr workarounds
//
@@ -688,17 +889,19 @@ namespace std{ using ::type_info; }
#define BOOST_STATIC_CONSTEXPR static BOOST_CONSTEXPR_OR_CONST
-// BOOST_FORCEINLINE ---------------------------------------------//
-// Macro to use in place of 'inline' to force a function to be inline
-#if !defined(BOOST_FORCEINLINE)
-# if defined(_MSC_VER)
-# define BOOST_FORCEINLINE __forceinline
-# elif defined(__GNUC__) && __GNUC__ > 3
-# define BOOST_FORCEINLINE inline __attribute__ ((always_inline))
-# else
-# define BOOST_FORCEINLINE inline
-# endif
+//
+// Set BOOST_HAS_RVALUE_REFS when BOOST_NO_RVALUE_REFERENCES is not defined
+//
+#if !defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_HAS_RVALUE_REFS)
+#define BOOST_HAS_RVALUE_REFS
#endif
+//
+// Set BOOST_HAS_VARIADIC_TMPL when BOOST_NO_VARIADIC_TEMPLATES is not defined
+//
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES) && !defined(BOOST_HAS_VARIADIC_TMPL)
+#define BOOST_HAS_VARIADIC_TMPL
#endif
+
+#endif
diff --git a/boost/container/allocator/scoped_allocator.hpp b/boost/container/allocator/scoped_allocator.hpp
deleted file mode 100644
index 03e12d1d1c..0000000000
--- a/boost/container/allocator/scoped_allocator.hpp
+++ /dev/null
@@ -1,651 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-//
-// (C) Copyright Pablo Halpern 2009. Distributed under the Boost
-// Software License, Version 1.0. (See accompanying file
-// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-//////////////////////////////////////////////////////////////////////////////
-//
-// (C) Copyright Ion Gaztanaga 2011-2011. Distributed under the Boost
-// Software License, Version 1.0. (See accompanying file
-// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-// See http://www.boost.org/libs/container for documentation.
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef BOOST_CONTAINER_ALLOCATOR_SCOPED_ALLOCATOR_HPP
-#define BOOST_CONTAINER_ALLOCATOR_SCOPED_ALLOCATOR_HPP
-
-#if (defined _MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif
-
-#include <boost/container/detail/config_begin.hpp>
-#include <boost/container/detail/workaround.hpp>
-#include <boost/container/allocator/allocator_traits.hpp>
-#include <boost/type_traits.hpp>
-#include <utility>
-
-namespace boost { namespace container {
-
-template <typename OuterAlloc, typename... InnerAllocs>
-class scoped_allocator_adaptor;
-
-template <typename OuterAlloc, typename... InnerAllocs>
-scoped_allocator_adaptor<OuterAlloc, InnerAllocs...> make_scoped();
-
-template <typename OuterAlloc, typename... InnerAllocs>
-class scoped_allocator_adaptor_base : public OuterAlloc
-{
- typedef allocator_traits<OuterAlloc> OuterTraits;
-
-public:
- // Workaround for inability of gcc-4.4.1 to expand InnerAllocs...
-// typedef scoped_allocator_adaptor<InnerAllocs...> inner_allocator_type;
- typedef decltype(make_scoped<InnerAllocs...>()) inner_allocator_type;
-
- scoped_allocator_adaptor_base();
-
- template <typename OuterA2>
- scoped_allocator_adaptor_base(OuterA2&& outerAlloc, const InnerAllocs&... innerAllocs);
-
- template <typename OuterA2>
- scoped_allocator_adaptor_base(const scoped_allocator_adaptor<OuterA2, InnerAllocs...>& other);
- template <typename OuterA2>
- scoped_allocator_adaptor_base(scoped_allocator_adaptor<OuterA2, InnerAllocs...>&& other);
-
- inner_allocator_type& inner_allocator()
- { return _M_inner_allocs; }
- inner_allocator_type const& inner_allocator() const
- { return _M_inner_allocs; }
-
- // Allocator propagation functions.
- scoped_allocator_adaptor<OuterAlloc, InnerAllocs...>
- select_on_container_copy_construction() const;
-
- typedef std::integral_constant<
- bool,
- OuterTraits::propagate_on_container_copy_assignment::value ||
- inner_allocator_type::propagate_on_container_copy_assignment::value
- > propagate_on_container_copy_assignment;
- typedef std::integral_constant<
- bool,
- OuterTraits::propagate_on_container_move_assignment::value ||
- inner_allocator_type::propagate_on_container_move_assignment::value
- > propagate_on_container_move_assignment;
- typedef std::integral_constant<
- bool,
- OuterTraits::propagate_on_container_swap::value ||
- inner_allocator_type::propagate_on_container_swap::value
- > propagate_on_container_swap;
-
-private:
- inner_allocator_type _M_inner_allocs;
-};
-
-// Specialization with only one parameter.
-template <typename OuterAlloc>
-class scoped_allocator_adaptor_base<OuterAlloc> : public OuterAlloc
-{
- typedef allocator_traits<OuterAlloc> OuterTraits;
-public:
- typedef scoped_allocator_adaptor<OuterAlloc> inner_allocator_type;
-
- scoped_allocator_adaptor_base();
-
- template <typename OuterA2>
- scoped_allocator_adaptor_base(OuterA2&& outerAlloc);
-
- template <typename OuterA2>
- scoped_allocator_adaptor_base(const scoped_allocator_adaptor<OuterA2>& other);
- template <typename OuterA2>
- scoped_allocator_adaptor_base(scoped_allocator_adaptor<OuterA2>&& other);
-
- inner_allocator_type& inner_allocator()
- { return static_cast<inner_allocator_type&>(*this); }
-
- inner_allocator_type const& inner_allocator() const
- { return static_cast<const inner_allocator_type&>(*this); }
-
- // Allocator propagation functions.
- scoped_allocator_adaptor<OuterAlloc>
- select_on_container_copy_construction() const;
-
- typedef typename OuterTraits::propagate_on_container_copy_assignment propagate_on_container_copy_assignment;
- typedef typename OuterTraits::propagate_on_container_move_assignment propagate_on_container_move_assignment;
- typedef typename OuterTraits::propagate_on_container_swap propagate_on_container_swap;
-};
-
-template <typename OuterAlloc, typename... InnerAllocs>
-class scoped_allocator_adaptor
- : public scoped_allocator_adaptor_base<OuterAlloc, InnerAllocs...>
-{
- typedef scoped_allocator_adaptor_base<OuterAlloc, InnerAllocs...> _Base;
- typedef allocator_traits<OuterAlloc> _Traits;
-
-public:
- typedef OuterAlloc outer_allocator_type;
- typedef typename _Base::inner_allocator_type inner_allocator_type;
-
- typedef typename allocator_traits<OuterAlloc>::size_type size_type;
- typedef typename allocator_traits<OuterAlloc>::difference_type difference_type;
- typedef typename allocator_traits<OuterAlloc>::pointer pointer;
- typedef typename allocator_traits<OuterAlloc>::const_pointer const_pointer;
- typedef typename allocator_traits<OuterAlloc>::void_pointer void_pointer;
- typedef typename allocator_traits<OuterAlloc>::const_void_pointer const_void_pointer;
- typedef typename allocator_traits<OuterAlloc>::value_type value_type;
-
- template <typename Tp>
- struct rebind {
- typedef typename allocator_traits<OuterAlloc>::template rebind_traits<Tp> rebound_traits;
- typedef typename rebound_traits::allocator_type rebound_outer; // exposition only
- typedef scoped_allocator_adaptor<rebound_outer, InnerAllocs...> other;
- };
-
- scoped_allocator_adaptor();
- scoped_allocator_adaptor(const scoped_allocator_adaptor& other);
-
- template <typename OuterA2>
- scoped_allocator_adaptor(const scoped_allocator_adaptor<OuterA2, InnerAllocs...>& other);
- template <typename OuterA2>
- scoped_allocator_adaptor(scoped_allocator_adaptor<OuterA2, InnerAllocs...>&& other);
-
- template <typename OuterA2>
- scoped_allocator_adaptor(OuterA2&& outerAlloc, const InnerAllocs&... innerAllocs);
-
- ~scoped_allocator_adaptor();
-
- inner_allocator_type & inner_allocator()
- { return _Base::inner_allocator(); }
- inner_allocator_type const& inner_allocator() const
- { return _Base::inner_allocator(); }
- outer_allocator_type & outer_allocator()
- { return *this; }
- outer_allocator_type const& outer_allocator() const
- { return *this; }
-
- pointer allocate(size_type n);
- pointer allocate(size_type n, const_void_pointer hint);
- void deallocate(pointer p, size_type n);
- size_type max_size() const;
-
- template <typename T, typename... Args>
- void construct(T* p, Args&&... args);
-
- // Specializations to pass inner_allocator to pair::first and pair::second
- template <class T1, class T2>
- void construct(std::pair<T1,T2>* p);
- template <class T1, class T2, class U, class V>
- void construct(std::pair<T1,T2>* p, U&& x, V&& y);
- template <class T1, class T2, class U, class V>
- void construct(std::pair<T1,T2>* p, const std::pair<U, V>& pr);
- template <class T1, class T2, class U, class V>
- void construct(std::pair<T1,T2>* p, std::pair<U, V>&& pr);
-
- template <typename T>
- void destroy(T* p);
-};
-
-template <typename OuterA1, typename OuterA2, typename... InnerAllocs>
-inline
-bool operator==(const scoped_allocator_adaptor<OuterA1,InnerAllocs...>& a,
- const scoped_allocator_adaptor<OuterA2,InnerAllocs...>& b);
-
-template <typename OuterA1, typename OuterA2, typename... InnerAllocs>
-inline
-bool operator!=(const scoped_allocator_adaptor<OuterA1,InnerAllocs...>& a,
- const scoped_allocator_adaptor<OuterA2,InnerAllocs...>& b);
-
-///////////////////////////////////////////////////////////////////////////////
-// Implementation of scoped_allocator_adaptor_base<OuterAlloc, InnerAllocs...>
-///////////////////////////////////////////////////////////////////////////////
-
-template <typename OuterAlloc, typename... InnerAllocs>
-inline
-scoped_allocator_adaptor_base<OuterAlloc, InnerAllocs...>::
- scoped_allocator_adaptor_base()
-{
-}
-
-template <typename OuterAlloc, typename... InnerAllocs>
- template <typename OuterA2>
- scoped_allocator_adaptor_base<OuterAlloc, InnerAllocs...>::
- scoped_allocator_adaptor_base(OuterA2&& outerAlloc,
- const InnerAllocs&... innerAllocs)
- : OuterAlloc(std::forward<OuterA2>(outerAlloc))
- , _M_inner_allocs(innerAllocs...)
-{
-}
-
-template <typename OuterAlloc, typename... InnerAllocs>
- template <typename OuterA2>
- scoped_allocator_adaptor_base<OuterAlloc, InnerAllocs...>::
- scoped_allocator_adaptor_base(
- const scoped_allocator_adaptor<OuterA2, InnerAllocs...>& other)
- : OuterAlloc(other.outer_allocator())
- , _M_inner_allocs(other.inner_allocator())
-{
-}
-
-template <typename OuterAlloc, typename... InnerAllocs>
- template <typename OuterA2>
- scoped_allocator_adaptor_base<OuterAlloc, InnerAllocs...>::
- scoped_allocator_adaptor_base(
- scoped_allocator_adaptor<OuterA2, InnerAllocs...>&& other)
- : OuterAlloc(std::move(other.outer_allocator()))
- , _M_inner_allocs(std::move(other.inner_allocator()))
-{
-}
-
-template <typename OuterAlloc, typename... InnerAllocs>
-inline
-scoped_allocator_adaptor<OuterAlloc,InnerAllocs...>
-scoped_allocator_adaptor_base<OuterAlloc,InnerAllocs...>::
- select_on_container_copy_construction() const
-{
- return scoped_allocator_adaptor<OuterAlloc,InnerAllocs...>(
- allocator_traits<OuterAlloc>::select_on_container_copy_construction(
- this->outer_allocator()),
- allocator_traits<inner_allocator_type>::select_on_container_copy_construction(
- this->inner_allocator()));
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Implementation of scoped_allocator_adaptor_base<OuterAlloc> specialization
-///////////////////////////////////////////////////////////////////////////////
-
-template <typename OuterAlloc>
-inline
-scoped_allocator_adaptor_base<OuterAlloc>::
- scoped_allocator_adaptor_base()
-{
-}
-
-template <typename OuterAlloc>
- template <typename OuterA2>
- scoped_allocator_adaptor_base<OuterAlloc>::
- scoped_allocator_adaptor_base(OuterA2&& outerAlloc)
- : OuterAlloc(std::forward<OuterA2>(outerAlloc))
-{
-}
-
-template <typename OuterAlloc>
- template <typename OuterA2>
- scoped_allocator_adaptor_base<OuterAlloc>::
- scoped_allocator_adaptor_base(
- const scoped_allocator_adaptor<OuterA2>& other)
- : OuterAlloc(other.outer_allocator())
-{
-}
-
-template <typename OuterAlloc>
- template <typename OuterA2>
- scoped_allocator_adaptor_base<OuterAlloc>::
- scoped_allocator_adaptor_base(
- scoped_allocator_adaptor<OuterA2>&& other)
- : OuterAlloc(std::move(other.outer_allocator()))
-{
-}
-
-// template <typename OuterAlloc>
-// inline
-// scoped_allocator_adaptor<OuterAlloc>&
-// scoped_allocator_adaptor_base<OuterAlloc>::inner_allocator()
-// {
-// return *this;
-// }
-
-// template <typename OuterAlloc>
-// inline
-// scoped_allocator_adaptor<OuterAlloc> const&
-// scoped_allocator_adaptor_base<OuterAlloc>::inner_allocator() cosnt
-// {
-// return *this;
-// }
-
-template <typename OuterAlloc>
-inline
-scoped_allocator_adaptor<OuterAlloc>
-scoped_allocator_adaptor_base<OuterAlloc>::
-select_on_container_copy_construction() const
-{
- return
- allocator_traits<OuterAlloc>::select_on_container_copy_construction(
- this->outer_allocator());
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Implementation of scoped_allocator_adaptor details
-///////////////////////////////////////////////////////////////////////////////
-
-namespace __details {
-
- // Overload resolution for __has_ctor resolves to this function
- // when _Tp is constructible with _Args. Returns true_type().
-
- static void* __void_p; // Declared but not defined
-
- template <typename _Tp, typename... _Args>
- inline
- auto __has_ctor(int, _Args&&... __args) ->
- decltype((new (__void_p) _Tp(__args...), std::true_type()))
- { return std::true_type(); }
-
- // Overload resolution for __has_ctor resolves to this function
- // when _Tp is not constructible with _Args. Returns false_type().
- template <typename _Tp, typename... _Args>
- auto __has_ctor(_LowPriorityConversion<int>, _Args&&...) ->
- std::false_type
- { return std::false_type(); }
-
- template <typename _Alloc>
- struct __is_scoped_allocator_imp {
- template <typename T>
- static char test(int, typename T::outer_allocator_type*);
- template <typename T>
- static int test(_LowPriorityConversion<int>, void*);
- static const bool value = (1 == sizeof(test<_Alloc>(0, 0)));
- };
-
- template <typename _Alloc>
- struct __is_scoped_allocator
- : std::integral_constant<bool, __is_scoped_allocator_imp<_Alloc>::value>
- {
- };
-
-#if 0
- // Called when outer_allocator_type is not a scoped allocator
- // (recursion stop).
- template <typename _Alloc>
- inline
- auto __outermost_alloc(_LowPriorityConversion<int>, _Alloc& __a) ->
- _Alloc&
- {
- return __a;
- }
-
- // Called when outer_allocator_type is a scoped allocator to
- // return the outermost allocator type.
- template <typename _Alloc>
- inline auto __outermost_alloc(int, _Alloc& __a) ->
- decltype(__outermost_alloc(0,__a.outer_allocator()))
- {
- return __a.outer_allocator();
- }
-#endif
-
- template <typename _Ignore, typename _OuterAlloc,
- typename _InnerAlloc, typename _Tp, typename... _Args>
- inline void __dispatch_scoped_construct(std::false_type __uses_alloc,
- _Ignore __use_alloc_prefix,
- _OuterAlloc& __outer_alloc,
- _InnerAlloc& __inner_alloc,
- _Tp* __p, _Args&&... __args)
- {
- // _Tp doesn't use allocators. Construct without an
- // allocator argument.
- allocator_traits<_OuterAlloc>::construct(__outer_alloc, __p,
- std::forward<_Args>(__args)...);
- }
-
- template <typename _OuterAlloc,
- typename _InnerAlloc, typename _Tp, typename... _Args>
- inline void __dispatch_scoped_construct(std::true_type __uses_alloc,
- std::true_type __use_alloc_prefix,
- _OuterAlloc& __outer_alloc,
- _InnerAlloc& __inner_alloc,
- _Tp* __p, _Args&&... __args)
- {
- // _Tp doesn't use allocators. Construct without an
- // allocator argument.
- allocator_traits<_OuterAlloc>::construct(__outer_alloc, __p,
- allocator_arg, __inner_alloc,
- std::forward<_Args>(__args)...);
- }
-
- template <typename _OuterAlloc,
- typename _InnerAlloc, typename _Tp, typename... _Args>
- inline void __dispatch_scoped_construct(std::true_type __uses_alloc,
- std::false_type __use_alloc_prefix,
- _OuterAlloc& __outer_alloc,
- _InnerAlloc& __inner_alloc,
- _Tp* __p, _Args&&... __args)
- {
- // If _Tp uses an allocator compatible with _InnerAlloc,
- // but the specific constructor does not have a variant that
- // takes an allocator argument, then program is malformed.
-// static_assert(has_constructor<_Tp, _Args...>::value,
-// "Cannot pass inner allocator to this constructor");
-
- allocator_traits<_OuterAlloc>::construct(
- __outer_alloc, __p, std::forward<_Args>(__args)...,
- __inner_alloc);
- }
-
- template <typename _OuterAlloc, typename _InnerAlloc,
- typename _Tp, typename... _Args>
- inline void __do_scoped_construct(std::false_type __scoped_outer,
- _OuterAlloc& __outer_alloc,
- _InnerAlloc& __inner_alloc,
- _Tp* __p, _Args&&... __args)
- {
- // Dispatch construction to the correct __dispatch_scoped_construct()
- // function based on whether _Tp uses an allocator of type
- // _InnerAlloc and, if so, whether there exists the following
- // constructor:
- // _Tp(allocator_arg_t, _InnerAlloc, Args...).
- auto __uses_alloc = uses_allocator<_Tp, _InnerAlloc>();
- auto __use_alloc_prefix = __has_ctor<_Tp>(0, allocator_arg,
- __inner_alloc,
- std::forward<_Args>(__args)...);
- __dispatch_scoped_construct(__uses_alloc, __use_alloc_prefix,
- __outer_alloc,
- __inner_alloc,
- __p, std::forward<_Args>(__args)...);
- }
-
- template <typename _OuterAlloc, typename _InnerAlloc,
- typename _Tp, typename... _Args>
- void __do_scoped_construct(std::true_type __scoped_outer,
- _OuterAlloc& __outer_alloc,
- _InnerAlloc& __inner_alloc,
- _Tp* __p, _Args&&... __args)
- {
- // Use outermost allocator if __outer_alloc is scoped
- typedef typename _OuterAlloc::outer_allocator_type outerouter;
- __do_scoped_construct(__is_scoped_allocator<outerouter>(),
- __outer_alloc.outer_allocator(),
- __inner_alloc,
- __p, std::forward<_Args>(__args)...);
- }
-
-} // end namespace __details
-
-///////////////////////////////////////////////////////////////////////////////
-// Implementation of scoped_allocator_adaptor
-///////////////////////////////////////////////////////////////////////////////
-
-template <typename OuterAlloc, typename... InnerAllocs>
-scoped_allocator_adaptor<OuterAlloc, InnerAllocs...>::
- scoped_allocator_adaptor()
-{
-}
-
-template <typename OuterAlloc, typename... InnerAllocs>
-scoped_allocator_adaptor<OuterAlloc, InnerAllocs...>::
- scoped_allocator_adaptor(const scoped_allocator_adaptor& other)
- : _Base(other)
-{
-}
-
-template <typename OuterAlloc, typename... InnerAllocs>
- template <typename OuterA2>
- scoped_allocator_adaptor<OuterAlloc, InnerAllocs...>::
- scoped_allocator_adaptor(const scoped_allocator_adaptor<OuterA2,
- InnerAllocs...>& other)
- : _Base(other)
-{
-}
-
-template <typename OuterAlloc, typename... InnerAllocs>
- template <typename OuterA2>
- scoped_allocator_adaptor<OuterAlloc, InnerAllocs...>::
- scoped_allocator_adaptor(scoped_allocator_adaptor<OuterA2, InnerAllocs...>&& other)
- : _Base(std::move(other))
-{
-}
-
-template <typename OuterAlloc, typename... InnerAllocs>
- template <typename OuterA2>
- scoped_allocator_adaptor<OuterAlloc, InnerAllocs...>::
- scoped_allocator_adaptor(OuterA2&& outerAlloc, const InnerAllocs&... innerAllocs)
- : _Base(std::forward<OuterA2>(outerAlloc), innerAllocs...)
-{
-}
-
-template <typename OuterAlloc, typename... InnerAllocs>
-scoped_allocator_adaptor<OuterAlloc, InnerAllocs...>::
- ~scoped_allocator_adaptor()
-{
-}
-
-template <typename OuterAlloc, typename... InnerAllocs>
-inline typename allocator_traits<OuterAlloc>::pointer
-scoped_allocator_adaptor<OuterAlloc, InnerAllocs...>::
- allocate(size_type n)
-{
- return allocator_traits<OuterAlloc>::allocate(outer_allocator(), n);
-}
-
-template <typename OuterAlloc, typename... InnerAllocs>
-inline typename allocator_traits<OuterAlloc>::pointer
-scoped_allocator_adaptor<OuterAlloc, InnerAllocs...>::
- allocate(size_type n, const_void_pointer hint)
-{
- return allocator_traits<OuterAlloc>::allocate(outer_allocator(), n, hint);
-}
-
-template <typename OuterAlloc, typename... InnerAllocs>
-inline void scoped_allocator_adaptor<OuterAlloc, InnerAllocs...>::
- deallocate(pointer p, size_type n)
-{
- allocator_traits<OuterAlloc>::deallocate(outer_allocator(), p, n);
-}
-
-template <typename OuterAlloc, typename... InnerAllocs>
-inline typename allocator_traits<OuterAlloc>::size_type
-scoped_allocator_adaptor<OuterAlloc, InnerAllocs...>::max_size() const
-{
- return allocator_traits<OuterAlloc>::max_size(outer_allocator());
-}
-
-template <typename OuterAlloc, typename... InnerAllocs>
- template <typename T>
- inline void scoped_allocator_adaptor<OuterAlloc, InnerAllocs...>::
- destroy(T* p)
-{
- allocator_traits<OuterAlloc>::destroy(outer_allocator(), p);
-}
-
-template <typename OuterAlloc, typename... InnerAllocs>
- template <typename T, typename... Args>
- inline
- void scoped_allocator_adaptor<OuterAlloc,InnerAllocs...>::construct(T* p,
- Args&&... args)
-{
- __do_scoped_construct(__details::__is_scoped_allocator<OuterAlloc>(),
- this->outer_allocator(), this->inner_allocator(),
- p, std::forward<Args>(args)...);
-}
-
-template <typename OuterAlloc, typename... InnerAllocs>
- template <class T1, class T2>
- void scoped_allocator_adaptor<OuterAlloc,InnerAllocs...>::construct(
- std::pair<T1,T2>* p)
-{
- construct(addressof(p->first));
- try {
- construct(addressof(p->second));
- }
- catch (...) {
- destroy(addressof(p->first));
- throw;
- }
-}
-
-template <typename OuterAlloc, typename... InnerAllocs>
- template <class T1, class T2, class U, class V>
- void scoped_allocator_adaptor<OuterAlloc,InnerAllocs...>::construct(
- std::pair<T1,T2>* p, U&& x, V&& y)
-{
- construct(addressof(p->first), std::forward<U>(x));
- try {
- construct(addressof(p->second), std::forward<V>(y));
- }
- catch (...) {
- destroy(addressof(p->first));
- throw;
- }
-}
-
-template <typename OuterAlloc, typename... InnerAllocs>
- template <class T1, class T2, class U, class V>
- void scoped_allocator_adaptor<OuterAlloc,InnerAllocs...>::construct(
- std::pair<T1,T2>* p, const std::pair<U, V>& pr)
-{
- construct(addressof(p->first), pr.first);
- try {
- construct(addressof(p->second), pr.second);
- }
- catch (...) {
- destroy(addressof(p->first));
- throw;
- }
-}
-
-template <typename OuterAlloc, typename... InnerAllocs>
- template <class T1, class T2, class U, class V>
- void scoped_allocator_adaptor<OuterAlloc,InnerAllocs...>::construct(
- std::pair<T1,T2>* p, std::pair<U, V>&& pr)
-{
- construct(addressof(p->first), std::move(pr.first));
- try {
- construct(addressof(p->second), std::move(pr.second));
- }
- catch (...) {
- destroy(addressof(p->first));
- throw;
- }
-}
-
-template <typename OuterA1, typename OuterA2, typename... InnerAllocs>
-inline
-bool operator==(const scoped_allocator_adaptor<OuterA1,InnerAllocs...>& a,
- const scoped_allocator_adaptor<OuterA2,InnerAllocs...>& b)
-{
- return a.outer_allocator() == b.outer_allocator()
- && a.inner_allocator() == b.inner_allocator();
-}
-
-template <typename OuterA1, typename OuterA2>
-inline
-bool operator==(const scoped_allocator_adaptor<OuterA1>& a,
- const scoped_allocator_adaptor<OuterA2>& b)
-{
- return a.outer_allocator() == b.outer_allocator();
-}
-
-template <typename OuterA1, typename OuterA2, typename... InnerAllocs>
-inline
-bool operator!=(const scoped_allocator_adaptor<OuterA1,InnerAllocs...>& a,
- const scoped_allocator_adaptor<OuterA2,InnerAllocs...>& b)
-{
- return ! (a == b);
-}
-
-}} // namespace boost { namespace container {
-
-#include <boost/container/detail/config_end.hpp>
-
-#endif // BOOST_CONTAINER_ALLOCATOR_SCOPED_ALLOCATOR_HPP
diff --git a/boost/container/allocator/allocator_traits.hpp b/boost/container/allocator_traits.hpp
index 01921615cf..8e537ccf6f 100644
--- a/boost/container/allocator/allocator_traits.hpp
+++ b/boost/container/allocator_traits.hpp
@@ -6,7 +6,7 @@
//
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2011-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2011-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -24,7 +24,8 @@
#include <boost/container/detail/config_begin.hpp>
#include <boost/container/detail/workaround.hpp>
#include <boost/intrusive/pointer_traits.hpp>
-#include <boost/container/allocator/memory_util.hpp>
+#include <boost/intrusive/detail/memory_util.hpp>
+#include <boost/container/detail/memory_util.hpp>
#include <boost/type_traits/integral_constant.hpp>
#include <boost/container/detail/mpl.hpp>
#include <boost/move/move.hpp>
@@ -53,6 +54,8 @@ struct is_std_allocator< std::allocator<T> >
///@endcond
+//! The class template allocator_traits supplies a uniform interface to all allocator types.
+//! This class is a C++03-compatible implementation of std::allocator_traits
template <typename Alloc>
struct allocator_traits
{
@@ -62,54 +65,54 @@ struct allocator_traits
typedef typename Alloc::value_type value_type;
#if defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- //!Alloc::pointer if such a type exists; otherwise, value_type*
+ //! Alloc::pointer if such a type exists; otherwise, value_type*
//!
typedef unspecified pointer;
- //!Alloc::const_pointer if such a type exists ; otherwise, pointer_traits<pointer>::rebind<const
+ //! Alloc::const_pointer if such a type exists ; otherwise, pointer_traits<pointer>::rebind<const
//!
typedef unspecified const_pointer;
- //!Non-standard extension
- //!Alloc::reference if such a type exists; otherwise, value_type&
- typedef unspecified pointer;
- //!Non-standard extension
- //!Alloc::const_reference if such a type exists ; otherwise, const value_type&
- typedef unspecified const_pointer;
- //!Alloc::void_pointer if such a type exists ; otherwise, pointer_traits<pointer>::rebind<void>.
+ //! Non-standard extension
+ //! Alloc::reference if such a type exists; otherwise, value_type&
+ typedef unspecified reference;
+ //! Non-standard extension
+ //! Alloc::const_reference if such a type exists ; otherwise, const value_type&
+ typedef unspecified const_reference;
+ //! Alloc::void_pointer if such a type exists ; otherwise, pointer_traits<pointer>::rebind<void>.
//!
typedef unspecified void_pointer;
- //!Alloc::const_void_pointer if such a type exists ; otherwis e, pointer_traits<pointer>::rebind<const
+ //! Alloc::const_void_pointer if such a type exists ; otherwis e, pointer_traits<pointer>::rebind<const
//!
typedef unspecified const_void_pointer;
- //!Alloc::difference_type if such a type exists ; otherwise, pointer_traits<pointer>::difference_type.
+ //! Alloc::difference_type if such a type exists ; otherwise, pointer_traits<pointer>::difference_type.
//!
typedef unspecified difference_type;
- //!Alloc::size_type if such a type exists ; otherwise, make_unsigned<difference_type>::type
+ //! Alloc::size_type if such a type exists ; otherwise, make_unsigned<difference_type>::type
//!
typedef unspecified size_type;
- //!Alloc::propagate_on_container_copy_assignment if such a type exists, otherwise an integral_constant
- //!type with internal constant static member <pre>value</pre> == false.
+ //! Alloc::propagate_on_container_copy_assignment if such a type exists, otherwise an integral_constant
+ //! type with internal constant static member `value` == false.
typedef unspecified propagate_on_container_copy_assignment;
- //!Alloc::propagate_on_container_move_assignment if such a type exists, otherwise an integral_constant
- //!type with internal constant static member <pre>value</pre> == false.
+ //! Alloc::propagate_on_container_move_assignment if such a type exists, otherwise an integral_constant
+ //! type with internal constant static member `value` == false.
typedef unspecified propagate_on_container_move_assignment;
- //!Alloc::propagate_on_container_swap if such a type exists, otherwise an integral_constant
- //!type with internal constant static member <pre>value</pre> == false.
+ //! Alloc::propagate_on_container_swap if such a type exists, otherwise an integral_constant
+ //! type with internal constant static member `value` == false.
typedef unspecified propagate_on_container_swap;
- //!Defines an allocator: Alloc::rebind<T>::other if such a type exists; otherwise, Alloc<T, Args>
- //!if Alloc is a class template instantiation of the form Alloc<U, Args>, where Args is zero or
- //!more type arguments ; otherwise, the instantiation of rebind_alloc is ill-formed.
+ //! Defines an allocator: Alloc::rebind<T>::other if such a type exists; otherwise, Alloc<T, Args>
+ //! if Alloc is a class template instantiation of the form Alloc<U, Args>, where Args is zero or
+ //! more type arguments ; otherwise, the instantiation of rebind_alloc is ill-formed.
//!
- //!In C++03 compilers <pre>rebind_alloc</pre> is a struct derived from an allocator
- //!deduced by previously detailed rules.
+ //! In C++03 compilers `rebind_alloc` is a struct derived from an allocator
+ //! deduced by previously detailed rules.
template <class T> using rebind_alloc = unspecified;
- //!In C++03 compilers <pre>rebind_traits</pre> is a struct derived from
- //!<pre>allocator_traits<OtherAlloc><pre>, where `OtherAlloc` is
- //!the allocator deduced by rules explained in `rebind_alloc`.
+ //! In C++03 compilers `rebind_traits` is a struct derived from
+ //! `allocator_traits<OtherAlloc>`, where `OtherAlloc` is
+ //! the allocator deduced by rules explained in `rebind_alloc`.
template <class T> using rebind_traits = allocator_traits<rebind_alloc<T> >;
- //!Non-standard extension: Portable allocator rebind for C++03 and C++11 compilers.
- //!`type` is an allocator related to Alloc deduced deduced by rules explained in `rebind_alloc`.
+ //! Non-standard extension: Portable allocator rebind for C++03 and C++11 compilers.
+ //! `type` is an allocator related to Alloc deduced deduced by rules explained in `rebind_alloc`.
template <class T>
struct portable_rebind_alloc
{ typedef unspecified_type type; };
@@ -119,7 +122,7 @@ struct allocator_traits
pointer, value_type*)
pointer;
//const_pointer
- typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_EVAL_DEFAULT(boost::container::container_detail::, Alloc,
+ typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_EVAL_DEFAULT(boost::container::container_detail::, Alloc,
const_pointer, typename boost::intrusive::pointer_traits<pointer>::template
rebind_pointer<const value_type>)
const_pointer;
@@ -128,11 +131,11 @@ struct allocator_traits
reference, typename container_detail::unvoid<value_type>::type&)
reference;
//const_reference
- typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(boost::container::container_detail::, Alloc,
+ typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(boost::container::container_detail::, Alloc,
const_reference, const typename container_detail::unvoid<value_type>::type&)
const_reference;
//void_pointer
- typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_EVAL_DEFAULT(boost::container::container_detail::, Alloc,
+ typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_EVAL_DEFAULT(boost::container::container_detail::, Alloc,
void_pointer, typename boost::intrusive::pointer_traits<pointer>::template
rebind_pointer<void>)
void_pointer;
@@ -164,9 +167,9 @@ struct allocator_traits
#if !defined(BOOST_NO_TEMPLATE_ALIASES)
//C++11
- template <typename T> using rebind_alloc = boost::intrusive::detail::type_rebinder<Alloc, T>::type;
+ template <typename T> using rebind_alloc = typename boost::intrusive::detail::type_rebinder<Alloc, T>::type;
template <typename T> using rebind_traits = allocator_traits< rebind_alloc<T> >;
- #else //!defined(BOOST_NO_TEMPLATE_ALIASES)
+ #else // #if !defined(BOOST_NO_TEMPLATE_ALIASES)
//Some workaround for C++03 or C++11 compilers with no template aliases
template <typename T>
struct rebind_alloc : boost::intrusive::detail::type_rebinder<Alloc,T>::type
@@ -174,10 +177,10 @@ struct allocator_traits
typedef typename boost::intrusive::detail::type_rebinder<Alloc,T>::type Base;
#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
template <typename... Args>
- rebind_alloc(Args&&... args)
+ rebind_alloc(BOOST_FWD_REF(Args)... args)
: Base(boost::forward<Args>(args)...)
{}
- #else //!defined(BOOST_NO_VARIADIC_TEMPLATES)
+ #else // #if !defined(BOOST_NO_VARIADIC_TEMPLATES)
#define BOOST_PP_LOCAL_MACRO(n) \
BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \
rebind_alloc(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \
@@ -186,32 +189,32 @@ struct allocator_traits
//
#define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS)
#include BOOST_PP_LOCAL_ITERATE()
- #endif //!defined(BOOST_NO_VARIADIC_TEMPLATES)
+ #endif // #if !defined(BOOST_NO_VARIADIC_TEMPLATES)
};
template <typename T>
struct rebind_traits
: allocator_traits<typename boost::intrusive::detail::type_rebinder<Alloc, T>::type>
{};
- #endif //!defined(BOOST_NO_TEMPLATE_ALIASES)
+ #endif // #if !defined(BOOST_NO_TEMPLATE_ALIASES)
template <class T>
struct portable_rebind_alloc
{ typedef typename boost::intrusive::detail::type_rebinder<Alloc, T>::type type; };
#endif //BOOST_CONTAINER_DOXYGEN_INVOKED
- //!<b>Returns</b>: a.allocate(n)
+ //! <b>Returns</b>: `a.allocate(n)`
//!
static pointer allocate(Alloc &a, size_type n)
{ return a.allocate(n); }
- //!<b>Returns</b>: a.deallocate(p, n)
+ //! <b>Returns</b>: `a.deallocate(p, n)`
//!
- //!<b>Throws</b>: Nothing
+ //! <b>Throws</b>: Nothing
static void deallocate(Alloc &a, pointer p, size_type n)
{ return a.deallocate(p, n); }
- //!<b>Effects</b>: calls `a.construct(p, std::forward<Args>(args)...)` if that call is well-formed;
- //!otherwise, invokes `::new (static_cast<void*>(p)) T(std::forward<Args>(args)...)`
+ //! <b>Effects</b>: calls `a.allocate(n, p)` if that call is well-formed;
+ //! otherwise, invokes `a.allocate(n)`
static pointer allocate(Alloc &a, size_type n, const_void_pointer p)
{
const bool value = boost::container::container_detail::
@@ -221,8 +224,8 @@ struct allocator_traits
return allocator_traits::priv_allocate(flag, a, n, p);
}
- //!<b>Effects</b>: calls a.destroy(p) if that call is well-formed;
- //!otherwise, invokes `p->~T()`.
+ //! <b>Effects</b>: calls `a.destroy(p)` if that call is well-formed;
+ //! otherwise, invokes `p->~T()`.
template<class T>
static void destroy(Alloc &a, T*p)
{
@@ -234,8 +237,8 @@ struct allocator_traits
allocator_traits::priv_destroy(flag, a, p);
}
- //!<b>Returns</b>: a.max_size() if that expression is well-formed; otherwise,
- //!`numeric_limits<size_type>::max()`.
+ //! <b>Returns</b>: `a.max_size()` if that expression is well-formed; otherwise,
+ //! `numeric_limits<size_type>::max()`.
static size_type max_size(const Alloc &a)
{
const bool value = boost::container::container_detail::
@@ -245,8 +248,8 @@ struct allocator_traits
return allocator_traits::priv_max_size(flag, a);
}
- //!<b>Returns</b>: a.select_on_container_copy_construction() if that expres sion is well- formed;
- //!otherwise, a.
+ //! <b>Returns</b>: `a.select_on_container_copy_construction()` if that expression is well-formed;
+ //! otherwise, a.
static Alloc select_on_container_copy_construction(const Alloc &a)
{
const bool value = boost::container::container_detail::
@@ -256,17 +259,17 @@ struct allocator_traits
return allocator_traits::priv_select_on_container_copy_construction(flag, a);
}
- #if defined(BOOST_CONTAINER_PERFECT_FORWARDING) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- //!Effects: calls a.construct(p, std::forward<Args>(args)...) if that call is well-formed;
- //!otherwise, invokes `::new (static_cast<void*>(p)) T(std::forward<Args>(args)...)`
+ #if !defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
+ //! <b>Effects</b>: calls `a.construct(p, std::forward<Args>(args)...)` if that call is well-formed;
+ //! otherwise, invokes `::new (static_cast<void*>(p)) T(std::forward<Args>(args)...)`
template <class T, class ...Args>
- static void construct(Alloc & a, T* p, Args&&... args)
+ static void construct(Alloc & a, T* p, BOOST_FWD_REF(Args)... args)
{
::boost::integral_constant<bool, container_detail::is_std_allocator<Alloc>::value> flag;
allocator_traits::priv_construct(flag, a, p, ::boost::forward<Args>(args)...);
}
#endif
-
+ ///@cond
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
private:
static pointer priv_allocate(boost::true_type, Alloc &a, size_type n, const_void_pointer p)
@@ -295,10 +298,10 @@ struct allocator_traits
static Alloc priv_select_on_container_copy_construction(boost::false_type, const Alloc &a)
{ return a; }
- #if defined(BOOST_CONTAINER_PERFECT_FORWARDING)
+ #if !defined(BOOST_NO_VARIADIC_TEMPLATES)
template<class T, class ...Args>
- static void priv_construct(boost::false_type, Alloc &a, T *p, Args && ...args)
- {
+ static void priv_construct(boost::false_type, Alloc &a, T *p, BOOST_FWD_REF(Args) ...args)
+ {
const bool value = boost::container::container_detail::
has_member_function_callable_with_construct
< Alloc, T*, Args... >::value;
@@ -307,19 +310,19 @@ struct allocator_traits
}
template<class T, class ...Args>
- static void priv_construct(boost::true_type, Alloc &a, T *p, Args && ...args)
+ static void priv_construct(boost::true_type, Alloc &a, T *p, BOOST_FWD_REF(Args) ...args)
{
priv_construct_dispatch2(boost::false_type(), a, p, ::boost::forward<Args>(args)...);
}
template<class T, class ...Args>
- static void priv_construct_dispatch2(boost::true_type, Alloc &a, T *p, Args && ...args)
+ static void priv_construct_dispatch2(boost::true_type, Alloc &a, T *p, BOOST_FWD_REF(Args) ...args)
{ a.construct( p, ::boost::forward<Args>(args)...); }
template<class T, class ...Args>
- static void priv_construct_dispatch2(boost::false_type, Alloc &, T *p, Args && ...args)
+ static void priv_construct_dispatch2(boost::false_type, Alloc &, T *p, BOOST_FWD_REF(Args) ...args)
{ ::new((void*)p) T(::boost::forward<Args>(args)...); }
- #else
+ #else // #if !defined(BOOST_NO_VARIADIC_TEMPLATES)
public:
#define BOOST_PP_LOCAL_MACRO(n) \
template<class T BOOST_PP_ENUM_TRAILING_PARAMS(n, class P) > \
@@ -333,7 +336,7 @@ struct allocator_traits
//
#define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS)
#include BOOST_PP_LOCAL_ITERATE()
-
+
private:
#define BOOST_PP_LOCAL_MACRO(n) \
template<class T BOOST_PP_ENUM_TRAILING_PARAMS(n, class P) > \
@@ -368,7 +371,7 @@ struct allocator_traits
//
#define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS)
#include BOOST_PP_LOCAL_ITERATE()
- #endif //BOOST_CONTAINER_PERFECT_FORWARDING
+ #endif // #if !defined(BOOST_NO_VARIADIC_TEMPLATES)
#endif //#if defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
///@endcond
diff --git a/boost/container/container_fwd.hpp b/boost/container/container_fwd.hpp
index da325e4461..c52b04a1c9 100644
--- a/boost/container/container_fwd.hpp
+++ b/boost/container/container_fwd.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -21,8 +21,8 @@
/// @cond
-namespace boost{
-namespace intrusive{
+namespace boost{
+namespace intrusive{
//Create namespace to avoid compilation errors
}}
@@ -32,9 +32,9 @@ namespace bi = boost::intrusive;
}}}
-#include <utility>
-#include <memory>
-#include <functional>
+#include <utility>
+#include <memory>
+#include <functional>
#include <iosfwd>
#include <string>
@@ -127,31 +127,27 @@ class flat_multimap;
//basic_string class
template <class CharT
,class Traits = std::char_traits<CharT>
- ,class A = std::allocator<CharT> >
+ ,class A = std::allocator<CharT> >
class basic_string;
//! Type used to tag that the input range is
//! guaranteed to be ordered
-struct ordered_range_impl_t {};
+struct ordered_range_t
+{};
//! Type used to tag that the input range is
//! guaranteed to be ordered and unique
-struct ordered_unique_range_impl_t{};
-
-/// @cond
-
-typedef ordered_range_impl_t * ordered_range_t;
-typedef ordered_unique_range_impl_t *ordered_unique_range_t;
-
-/// @endcond
+struct ordered_unique_range_t
+ : public ordered_range_t
+{};
//! Value used to tag that the input range is
//! guaranteed to be ordered
-static const ordered_range_t ordered_range = 0;
+static const ordered_range_t ordered_range = ordered_range_t();
//! Value used to tag that the input range is
//! guaranteed to be ordered and unique
-static const ordered_unique_range_t ordered_unique_range = 0;
+static const ordered_unique_range_t ordered_unique_range = ordered_unique_range_t();
/// @cond
diff --git a/boost/container/deque.hpp b/boost/container/deque.hpp
index 9ee0ee1371..6a85ae9486 100644
--- a/boost/container/deque.hpp
+++ b/boost/container/deque.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -44,7 +44,7 @@
#include <boost/container/detail/iterators.hpp>
#include <boost/container/detail/algorithms.hpp>
#include <boost/container/detail/mpl.hpp>
-#include <boost/container/allocator/allocator_traits.hpp>
+#include <boost/container/allocator_traits.hpp>
#include <boost/container/container_fwd.hpp>
#include <cstddef>
#include <iterator>
@@ -90,7 +90,7 @@ struct deque_value_traits
// Note: this function is simply a kludge to work around several compilers'
// bugs in handling constant expressions.
-inline std::size_t deque_buf_size(std::size_t size)
+inline std::size_t deque_buf_size(std::size_t size)
{ return size < 512 ? std::size_t(512 / size) : std::size_t(1); }
// Deque base class. It has two purposes. First, its constructor
@@ -128,16 +128,16 @@ class deque_base
static size_type s_buffer_size() { return deque_buf_size(sizeof(T)); }
- val_alloc_ptr priv_allocate_node()
+ val_alloc_ptr priv_allocate_node()
{ return this->alloc().allocate(s_buffer_size()); }
- void priv_deallocate_node(val_alloc_ptr p)
+ void priv_deallocate_node(val_alloc_ptr p)
{ this->alloc().deallocate(p, s_buffer_size()); }
- ptr_alloc_ptr priv_allocate_map(size_type n)
+ ptr_alloc_ptr priv_allocate_map(size_type n)
{ return this->ptr_alloc().allocate(n); }
- void priv_deallocate_map(ptr_alloc_ptr p, size_type n)
+ void priv_deallocate_map(ptr_alloc_ptr p, size_type n)
{ this->ptr_alloc().deallocate(p, n); }
public:
@@ -145,7 +145,7 @@ class deque_base
// For any nonsingular iterator i:
// i.node is the address of an element in the map array. The
// contents of i.node is a pointer to the beginning of a node.
- // i.first == //(i.node)
+ // i.first == //(i.node)
// i.last == i.first + node_size
// i.cur is a pointer in the range [i.first, i.last). NOTE:
// the implication of this is that i.cur is always a dereferenceable
@@ -160,14 +160,14 @@ class deque_base
// [start.cur, start.last) and [finish.first, finish.cur) are initialized
// objects, and [start.first, start.cur) and [finish.cur, finish.last)
// are uninitialized storage.
- // [map, map + map_size) is a valid, non-empty range.
- // [start.node, finish.node] is a valid range contained within
- // [map, map + map_size).
+ // [map, map + map_size) is a valid, non-empty range.
+ // [start.node, finish.node] is a valid range contained within
+ // [map, map + map_size).
// A pointer in the range [map, map + map_size) points to an allocated node
// if and only if the pointer is in the range [start.node, finish.node].
- class const_iterator
- : public std::iterator<std::random_access_iterator_tag,
- val_alloc_val, val_alloc_diff,
+ class const_iterator
+ : public std::iterator<std::random_access_iterator_tag,
+ val_alloc_val, val_alloc_diff,
val_alloc_cptr, val_alloc_cref>
{
public:
@@ -185,30 +185,30 @@ class deque_base
friend class deque<T, A>;
friend class deque_base<T, A>;
- protected:
+ protected:
val_alloc_ptr m_cur;
val_alloc_ptr m_first;
val_alloc_ptr m_last;
index_pointer m_node;
- public:
- const_iterator(val_alloc_ptr x, index_pointer y)
+ public:
+ const_iterator(val_alloc_ptr x, index_pointer y)
: m_cur(x), m_first(*y),
m_last(*y + s_buffer_size()), m_node(y) {}
const_iterator() : m_cur(0), m_first(0), m_last(0), m_node(0) {}
const_iterator(const const_iterator& x)
- : m_cur(x.m_cur), m_first(x.m_first),
+ : m_cur(x.m_cur), m_first(x.m_first),
m_last(x.m_last), m_node(x.m_node) {}
- reference operator*() const
+ reference operator*() const
{ return *this->m_cur; }
- pointer operator->() const
+ pointer operator->() const
{ return this->m_cur; }
- difference_type operator-(const self_t& x) const
+ difference_type operator-(const self_t& x) const
{
if(!this->m_cur && !x.m_cur){
return 0;
@@ -217,24 +217,24 @@ class deque_base
(this->m_cur - this->m_first) + (x.m_last - x.m_cur);
}
- self_t& operator++()
+ self_t& operator++()
{
++this->m_cur;
if (this->m_cur == this->m_last) {
this->priv_set_node(this->m_node + 1);
this->m_cur = this->m_first;
}
- return *this;
+ return *this;
}
- self_t operator++(int)
+ self_t operator++(int)
{
self_t tmp = *this;
++*this;
return tmp;
}
- self_t& operator--()
+ self_t& operator--()
{
if (this->m_cur == this->m_first) {
this->priv_set_node(this->m_node - 1);
@@ -244,7 +244,7 @@ class deque_base
return *this;
}
- self_t operator--(int)
+ self_t operator--(int)
{
self_t tmp = *this;
--*this;
@@ -261,7 +261,7 @@ class deque_base
offset > 0 ? offset / difference_type(this->s_buffer_size())
: -difference_type((-offset - 1) / this->s_buffer_size()) - 1;
this->priv_set_node(this->m_node + node_offset);
- this->m_cur = this->m_first +
+ this->m_cur = this->m_first +
(offset - node_offset * difference_type(this->s_buffer_size()));
}
return *this;
@@ -270,37 +270,37 @@ class deque_base
self_t operator+(difference_type n) const
{ self_t tmp = *this; return tmp += n; }
- self_t& operator-=(difference_type n)
+ self_t& operator-=(difference_type n)
{ return *this += -n; }
-
- self_t operator-(difference_type n) const
+
+ self_t operator-(difference_type n) const
{ self_t tmp = *this; return tmp -= n; }
- reference operator[](difference_type n) const
+ reference operator[](difference_type n) const
{ return *(*this + n); }
- bool operator==(const self_t& x) const
+ bool operator==(const self_t& x) const
{ return this->m_cur == x.m_cur; }
- bool operator!=(const self_t& x) const
+ bool operator!=(const self_t& x) const
{ return !(*this == x); }
- bool operator<(const self_t& x) const
+ bool operator<(const self_t& x) const
{
- return (this->m_node == x.m_node) ?
+ return (this->m_node == x.m_node) ?
(this->m_cur < x.m_cur) : (this->m_node < x.m_node);
}
- bool operator>(const self_t& x) const
+ bool operator>(const self_t& x) const
{ return x < *this; }
- bool operator<=(const self_t& x) const
+ bool operator<=(const self_t& x) const
{ return !(x < *this); }
- bool operator>=(const self_t& x) const
+ bool operator>=(const self_t& x) const
{ return !(*this < x); }
- void priv_set_node(index_pointer new_node)
+ void priv_set_node(index_pointer new_node)
{
this->m_node = new_node;
this->m_first = *new_node;
@@ -343,12 +343,12 @@ class deque_base
reference operator[](difference_type n) const { return *(*this + n); }
//Increment / Decrement
- iterator& operator++()
+ iterator& operator++()
{ this->const_iterator::operator++(); return *this; }
iterator operator++(int)
{ iterator tmp = *this; ++*this; return tmp; }
-
+
iterator& operator--()
{ this->const_iterator::operator--(); return *this; }
@@ -379,7 +379,7 @@ class deque_base
: members_(a)
{ this->priv_initialize_map(num_elements); }
- explicit deque_base(const allocator_type& a)
+ explicit deque_base(const allocator_type& a)
: members_(a)
{}
@@ -402,7 +402,7 @@ class deque_base
private:
deque_base(const deque_base&);
-
+
protected:
void swap_members(deque_base &x)
@@ -423,7 +423,7 @@ class deque_base
ptr_alloc_ptr nstart = this->members_.m_map + (this->members_.m_map_size - num_nodes) / 2;
ptr_alloc_ptr nfinish = nstart + num_nodes;
-
+
BOOST_TRY {
this->priv_create_nodes(nstart, nfinish);
}
@@ -508,16 +508,16 @@ class deque_base
iterator m_finish;
} members_;
- ptr_alloc_t &ptr_alloc()
+ ptr_alloc_t &ptr_alloc()
{ return members_; }
-
- const ptr_alloc_t &ptr_alloc() const
+
+ const ptr_alloc_t &ptr_alloc() const
{ return members_; }
- allocator_type &alloc()
+ allocator_type &alloc()
{ return members_; }
-
- const allocator_type &alloc() const
+
+ const allocator_type &alloc() const
{ return members_; }
};
/// @endcond
@@ -574,7 +574,7 @@ class deque : protected deque_base<T, A>
private: // Internal typedefs
BOOST_COPYABLE_AND_MOVABLE(deque)
typedef ptr_alloc_ptr index_pointer;
- static size_type s_buffer_size()
+ static size_type s_buffer_size()
{ return Base::s_buffer_size(); }
typedef container_detail::advanced_insert_aux_int<iterator> advanced_insert_aux_int_t;
typedef repeat_iterator<T, difference_type> r_iterator;
@@ -586,175 +586,175 @@ class deque : protected deque_base<T, A>
public:
//! <b>Effects</b>: Returns a copy of the internal allocator.
- //!
+ //!
//! <b>Throws</b>: If allocator's copy constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Constant.
allocator_type get_allocator() const BOOST_CONTAINER_NOEXCEPT
{ return Base::alloc(); }
//! <b>Effects</b>: Returns a reference to the internal allocator.
- //!
+ //!
//! <b>Throws</b>: Nothing
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Non-standard extension.
const stored_allocator_type &get_stored_allocator() const BOOST_CONTAINER_NOEXCEPT
{ return Base::alloc(); }
//! <b>Effects</b>: Returns a reference to the internal allocator.
- //!
+ //!
//! <b>Throws</b>: Nothing
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Non-standard extension.
stored_allocator_type &get_stored_allocator() BOOST_CONTAINER_NOEXCEPT
{ return Base::alloc(); }
//! <b>Effects</b>: Returns an iterator to the first element contained in the deque.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
iterator begin() BOOST_CONTAINER_NOEXCEPT
{ return this->members_.m_start; }
//! <b>Effects</b>: Returns an iterator to the end of the deque.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
iterator end() BOOST_CONTAINER_NOEXCEPT
{ return this->members_.m_finish; }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the deque.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_iterator begin() const BOOST_CONTAINER_NOEXCEPT
{ return this->members_.m_start; }
//! <b>Effects</b>: Returns a const_iterator to the end of the deque.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_iterator end() const BOOST_CONTAINER_NOEXCEPT
{ return this->members_.m_finish; }
- //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
- //! of the reversed deque.
- //!
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
+ //! of the reversed deque.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
reverse_iterator rbegin() BOOST_CONTAINER_NOEXCEPT
{ return reverse_iterator(this->members_.m_finish); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the end
- //! of the reversed deque.
- //!
+ //! of the reversed deque.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
reverse_iterator rend() BOOST_CONTAINER_NOEXCEPT
{ return reverse_iterator(this->members_.m_start); }
- //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
- //! of the reversed deque.
- //!
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed deque.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_reverse_iterator rbegin() const BOOST_CONTAINER_NOEXCEPT
{ return const_reverse_iterator(this->members_.m_finish); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
- //! of the reversed deque.
- //!
+ //! of the reversed deque.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_reverse_iterator rend() const BOOST_CONTAINER_NOEXCEPT
{ return const_reverse_iterator(this->members_.m_start); }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the deque.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_iterator cbegin() const BOOST_CONTAINER_NOEXCEPT
{ return this->members_.m_start; }
//! <b>Effects</b>: Returns a const_iterator to the end of the deque.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_iterator cend() const BOOST_CONTAINER_NOEXCEPT
{ return this->members_.m_finish; }
- //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
- //! of the reversed deque.
- //!
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed deque.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_reverse_iterator crbegin() const BOOST_CONTAINER_NOEXCEPT
{ return const_reverse_iterator(this->members_.m_finish); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
- //! of the reversed deque.
- //!
+ //! of the reversed deque.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_reverse_iterator crend() const BOOST_CONTAINER_NOEXCEPT
{ return const_reverse_iterator(this->members_.m_start); }
//! <b>Requires</b>: size() > n.
//!
- //! <b>Effects</b>: Returns a reference to the nth element
+ //! <b>Effects</b>: Returns a reference to the nth element
//! from the beginning of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
reference operator[](size_type n) BOOST_CONTAINER_NOEXCEPT
{ return this->members_.m_start[difference_type(n)]; }
//! <b>Requires</b>: size() > n.
//!
- //! <b>Effects</b>: Returns a const reference to the nth element
+ //! <b>Effects</b>: Returns a const reference to the nth element
//! from the beginning of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_reference operator[](size_type n) const BOOST_CONTAINER_NOEXCEPT
{ return this->members_.m_start[difference_type(n)]; }
//! <b>Requires</b>: size() > n.
//!
- //! <b>Effects</b>: Returns a reference to the nth element
+ //! <b>Effects</b>: Returns a reference to the nth element
//! from the beginning of the container.
- //!
+ //!
//! <b>Throws</b>: std::range_error if n >= size()
- //!
+ //!
//! <b>Complexity</b>: Constant.
reference at(size_type n)
{ this->priv_range_check(n); return (*this)[n]; }
//! <b>Requires</b>: size() > n.
//!
- //! <b>Effects</b>: Returns a const reference to the nth element
+ //! <b>Effects</b>: Returns a const reference to the nth element
//! from the beginning of the container.
- //!
+ //!
//! <b>Throws</b>: std::range_error if n >= size()
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_reference at(size_type n) const
{ this->priv_range_check(n); return (*this)[n]; }
@@ -763,20 +763,20 @@ class deque : protected deque_base<T, A>
//!
//! <b>Effects</b>: Returns a reference to the first
//! element of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
reference front() BOOST_CONTAINER_NOEXCEPT
{ return *this->members_.m_start; }
//! <b>Requires</b>: !empty()
//!
- //! <b>Effects</b>: Returns a const reference to the first element
+ //! <b>Effects</b>: Returns a const reference to the first element
//! from the beginning of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_reference front() const BOOST_CONTAINER_NOEXCEPT
{ return *this->members_.m_start; }
@@ -785,9 +785,9 @@ class deque : protected deque_base<T, A>
//!
//! <b>Effects</b>: Returns a reference to the last
//! element of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
reference back() BOOST_CONTAINER_NOEXCEPT
{ return *(end()-1); }
@@ -796,52 +796,52 @@ class deque : protected deque_base<T, A>
//!
//! <b>Effects</b>: Returns a const reference to the last
//! element of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_reference back() const BOOST_CONTAINER_NOEXCEPT
{ return *(cend()-1); }
//! <b>Effects</b>: Returns the number of the elements contained in the deque.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
size_type size() const BOOST_CONTAINER_NOEXCEPT
{ return this->members_.m_finish - this->members_.m_start; }
//! <b>Effects</b>: Returns the largest possible size of the deque.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
size_type max_size() const BOOST_CONTAINER_NOEXCEPT
{ return allocator_traits_type::max_size(this->alloc()); }
//! <b>Effects</b>: Returns true if the deque contains no elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
bool empty() const BOOST_CONTAINER_NOEXCEPT
{ return this->members_.m_finish == this->members_.m_start; }
//! <b>Effects</b>: Default constructors a deque.
- //!
+ //!
//! <b>Throws</b>: If allocator_type's default constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- deque()
+ deque()
: Base()
{}
//! <b>Effects</b>: Constructs a deque taking the allocator as parameter.
- //!
+ //!
//! <b>Throws</b>: If allocator_type's copy constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- explicit deque(const allocator_type& a)
+ explicit deque(const allocator_type& a)
: Base(a)
{}
@@ -850,7 +850,7 @@ class deque : protected deque_base<T, A>
//!
//! <b>Throws</b>: If allocator_type's default constructor or copy constructor
//! throws or T's default or copy constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Linear to n.
explicit deque(size_type n)
: Base(n, allocator_type())
@@ -865,7 +865,7 @@ class deque : protected deque_base<T, A>
//!
//! <b>Throws</b>: If allocator_type's default constructor or copy constructor
//! throws or T's default or copy constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Linear to n.
deque(size_type n, const value_type& value,
const allocator_type& a = allocator_type())
@@ -875,7 +875,7 @@ class deque : protected deque_base<T, A>
//! <b>Effects</b>: Copy constructs a deque.
//!
//! <b>Postcondition</b>: x == *this.
- //!
+ //!
//! <b>Complexity</b>: Linear to the elements x contains.
deque(const deque& x)
: Base(allocator_traits_type::select_on_container_copy_construction(x.alloc()))
@@ -890,12 +890,52 @@ class deque : protected deque_base<T, A>
//! <b>Effects</b>: Move constructor. Moves mx's resources to *this.
//!
//! <b>Throws</b>: If allocator_type's copy constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- deque(BOOST_RV_REF(deque) x)
+ deque(BOOST_RV_REF(deque) x)
: Base(boost::move(static_cast<Base&>(x)))
{ this->swap_members(x); }
+ //! <b>Effects</b>: Copy constructs a vector using the specified allocator.
+ //!
+ //! <b>Postcondition</b>: x == *this.
+ //!
+ //! <b>Throws</b>: If allocation
+ //! throws or T's copy constructor throws.
+ //!
+ //! <b>Complexity</b>: Linear to the elements x contains.
+ deque(const deque& x, const allocator_type &a)
+ : Base(a)
+ {
+ if(x.size()){
+ this->priv_initialize_map(x.size());
+ boost::container::uninitialized_copy_alloc
+ (this->alloc(), x.begin(), x.end(), this->members_.m_start);
+ }
+ }
+
+ //! <b>Effects</b>: Move constructor using the specified allocator.
+ //! Moves mx's resources to *this if a == allocator_type().
+ //! Otherwise copies values from x to *this.
+ //!
+ //! <b>Throws</b>: If allocation or T's copy constructor throws.
+ //!
+ //! <b>Complexity</b>: Constant if a == mx.get_allocator(), linear otherwise.
+ deque(BOOST_RV_REF(deque) mx, const allocator_type &a)
+ : Base(a)
+ {
+ if(mx.alloc() == a){
+ this->swap_members(mx);
+ }
+ else{
+ if(mx.size()){
+ this->priv_initialize_map(mx.size());
+ boost::container::uninitialized_copy_alloc
+ (this->alloc(), mx.begin(), mx.end(), this->members_.m_start);
+ }
+ }
+ }
+
//! <b>Effects</b>: Constructs a deque that will use a copy of allocator a
//! and inserts a copy of the range [first, last) in the deque.
//!
@@ -905,7 +945,7 @@ class deque : protected deque_base<T, A>
//! <b>Complexity</b>: Linear to the range [first, last).
template <class InpIt>
deque(InpIt first, InpIt last, const allocator_type& a = allocator_type())
- : Base(a)
+ : Base(a)
{
//Dispatch depending on integer/iterator
const bool aux_boolean = container_detail::is_convertible<InpIt, size_type>::value;
@@ -926,13 +966,13 @@ class deque : protected deque_base<T, A>
//! <b>Effects</b>: Makes *this contain the same elements as x.
//!
- //! <b>Postcondition</b>: this->size() == x.size(). *this contains a copy
- //! of each of x's elements.
+ //! <b>Postcondition</b>: this->size() == x.size(). *this contains a copy
+ //! of each of x's elements.
//!
//! <b>Throws</b>: If memory allocation throws or T's copy constructor throws.
//!
//! <b>Complexity</b>: Linear to the number of elements in x.
- deque& operator= (BOOST_COPY_ASSIGN_REF(deque) x)
+ deque& operator= (BOOST_COPY_ASSIGN_REF(deque) x)
{
if (&x != this){
allocator_type &this_alloc = this->alloc();
@@ -1092,7 +1132,7 @@ class deque : protected deque_base<T, A>
);
++this->members_.m_start.m_cur;
}
- else
+ else
this->priv_pop_front_aux();
}
@@ -1140,7 +1180,7 @@ class deque : protected deque_base<T, A>
//!
//! <b>Complexity</b>: Linear to std::distance [first, last).
template <class InpIt>
- void insert(const_iterator pos, InpIt first, InpIt last)
+ void insert(const_iterator pos, InpIt first, InpIt last)
{
//Dispatch depending on integer/iterator
const bool aux_boolean = container_detail::is_convertible<InpIt, size_type>::value;
@@ -1300,10 +1340,10 @@ class deque : protected deque_base<T, A>
//! <b>Throws</b>: If memory allocation throws, or T's copy constructor throws.
//!
//! <b>Complexity</b>: Linear to the difference between size() and new_size.
- void resize(size_type new_size, const value_type& x)
+ void resize(size_type new_size, const value_type& x)
{
const size_type len = size();
- if (new_size < len)
+ if (new_size < len)
this->erase(this->members_.m_start + new_size, this->members_.m_finish);
else
this->insert(this->members_.m_finish, new_size - len, x);
@@ -1315,10 +1355,10 @@ class deque : protected deque_base<T, A>
//! <b>Throws</b>: If memory allocation throws, or T's copy constructor throws.
//!
//! <b>Complexity</b>: Linear to the difference between size() and new_size.
- void resize(size_type new_size)
+ void resize(size_type new_size)
{
const size_type len = size();
- if (new_size < len)
+ if (new_size < len)
this->priv_erase_last_n(len - new_size);
else{
size_type n = new_size - this->size();
@@ -1331,7 +1371,7 @@ class deque : protected deque_base<T, A>
//!
//! <b>Throws</b>: Nothing.
//!
- //! <b>Complexity</b>: Linear to the elements between pos and the
+ //! <b>Complexity</b>: Linear to the elements between pos and the
//! last element (if pos is near the end) or the first element
//! if(pos is near the beginning).
//! Constant if pos is the first or the last element.
@@ -1356,7 +1396,7 @@ class deque : protected deque_base<T, A>
//! <b>Throws</b>: Nothing.
//!
//! <b>Complexity</b>: Linear to the distance between first and
- //! last plus the elements between pos and the
+ //! last plus the elements between pos and the
//! last element (if pos is near the end) or the first element
//! if(pos is near the beginning).
iterator erase(const_iterator first, const_iterator last) BOOST_CONTAINER_NOEXCEPT
@@ -1446,10 +1486,10 @@ class deque : protected deque_base<T, A>
/// @cond
private:
- void priv_range_check(size_type n) const
+ void priv_range_check(size_type n) const
{ if (n >= this->size()) BOOST_RETHROW std::out_of_range("deque"); }
- iterator priv_insert(const_iterator position, const value_type &x)
+ iterator priv_insert(const_iterator position, const value_type &x)
{
if (position == cbegin()){
this->push_front(x);
@@ -1466,7 +1506,7 @@ class deque : protected deque_base<T, A>
}
}
- iterator priv_insert(const_iterator position, BOOST_RV_REF(value_type) mx)
+ iterator priv_insert(const_iterator position, BOOST_RV_REF(value_type) mx)
{
if (position == cbegin()) {
this->push_front(boost::move(mx));
@@ -1569,7 +1609,7 @@ class deque : protected deque_base<T, A>
}
template <class FwdIt>
- void priv_insert_aux(const_iterator pos, FwdIt first, FwdIt last, std::forward_iterator_tag)
+ void priv_insert_aux(const_iterator pos, FwdIt first, FwdIt last, std::forward_iterator_tag)
{ this->priv_insert_aux(pos, first, last); }
// assign(), a generalized assignment member function. Two
@@ -1589,14 +1629,14 @@ class deque : protected deque_base<T, A>
}
template <class Integer>
- void priv_initialize_dispatch(Integer n, Integer x, container_detail::true_)
+ void priv_initialize_dispatch(Integer n, Integer x, container_detail::true_)
{
this->priv_initialize_map(n);
this->priv_fill_initialize(x);
}
template <class InpIt>
- void priv_initialize_dispatch(InpIt first, InpIt last, container_detail::false_)
+ void priv_initialize_dispatch(InpIt first, InpIt last, container_detail::false_)
{
typedef typename std::iterator_traits<InpIt>::iterator_category ItCat;
this->priv_range_initialize(first, last, ItCat());
@@ -1627,7 +1667,7 @@ class deque : protected deque_base<T, A>
{ this->priv_fill_assign((size_type) n, (value_type)val); }
template <class InpIt>
- void priv_assign_dispatch(InpIt first, InpIt last, container_detail::false_)
+ void priv_assign_dispatch(InpIt first, InpIt last, container_detail::false_)
{
typedef typename std::iterator_traits<InpIt>::iterator_category ItCat;
this->priv_assign_aux(first, last, ItCat());
@@ -1660,11 +1700,11 @@ class deque : protected deque_base<T, A>
}
template <class Integer>
- void priv_insert_dispatch(const_iterator pos, Integer n, Integer x, container_detail::true_)
+ void priv_insert_dispatch(const_iterator pos, Integer n, Integer x, container_detail::true_)
{ this->priv_fill_insert(pos, (size_type) n, (value_type)x); }
template <class InpIt>
- void priv_insert_dispatch(const_iterator pos,InpIt first, InpIt last, container_detail::false_)
+ void priv_insert_dispatch(const_iterator pos,InpIt first, InpIt last, container_detail::false_)
{
typedef typename std::iterator_traits<InpIt>::iterator_category ItCat;
this->priv_insert_aux(pos, first, last, ItCat());
@@ -1699,7 +1739,7 @@ class deque : protected deque_base<T, A>
iterator old_start = this->members_.m_start;
pos = this->members_.m_start + elemsbefore;
if (elemsbefore >= difference_type(n)) {
- iterator start_n = this->members_.m_start + difference_type(n);
+ iterator start_n = this->members_.m_start + difference_type(n);
::boost::container::uninitialized_move_alloc
(this->alloc(), this->members_.m_start, start_n, new_start);
this->members_.m_start = new_start;
@@ -1720,7 +1760,7 @@ class deque : protected deque_base<T, A>
else {
iterator new_finish = this->priv_reserve_elements_at_back(n);
iterator old_finish = this->members_.m_finish;
- const difference_type elemsafter =
+ const difference_type elemsafter =
difference_type(length) - elemsbefore;
pos = this->members_.m_finish - elemsafter;
if (elemsafter >= difference_type(n)) {
@@ -1774,7 +1814,7 @@ class deque : protected deque_base<T, A>
// Precondition: this->members_.m_start and this->members_.m_finish have already been initialized,
// but none of the deque's elements have yet been constructed.
- void priv_fill_initialize(const value_type& value)
+ void priv_fill_initialize(const value_type& value)
{
index_pointer cur;
BOOST_TRY {
@@ -1816,8 +1856,8 @@ class deque : protected deque_base<T, A>
index_pointer cur_node;
BOOST_TRY {
- for (cur_node = this->members_.m_start.m_node;
- cur_node < this->members_.m_finish.m_node;
+ for (cur_node = this->members_.m_start.m_node;
+ cur_node < this->members_.m_finish.m_node;
++cur_node) {
FwdIt mid = first;
std::advance(mid, this->s_buffer_size());
@@ -1847,9 +1887,9 @@ class deque : protected deque_base<T, A>
);
}
- // Called only if this->members_.m_start.m_cur == this->members_.m_start.m_last - 1. Note that
- // if the deque has at least one element (a precondition for this member
- // function), and if this->members_.m_start.m_cur == this->members_.m_start.m_last, then the deque
+ // Called only if this->members_.m_start.m_cur == this->members_.m_start.m_last - 1. Note that
+ // if the deque has at least one element (a precondition for this member
+ // function), and if this->members_.m_start.m_cur == this->members_.m_start.m_last, then the deque
// must have at least two nodes.
void priv_pop_front_aux()
{
@@ -1860,14 +1900,14 @@ class deque : protected deque_base<T, A>
this->priv_deallocate_node(this->members_.m_start.m_first);
this->members_.m_start.priv_set_node(this->members_.m_start.m_node + 1);
this->members_.m_start.m_cur = this->members_.m_start.m_first;
- }
+ }
- iterator priv_reserve_elements_at_front(size_type n)
+ iterator priv_reserve_elements_at_front(size_type n)
{
size_type vacancies = this->members_.m_start.m_cur - this->members_.m_start.m_first;
if (n > vacancies){
size_type new_elems = n-vacancies;
- size_type new_nodes = (new_elems + this->s_buffer_size() - 1) /
+ size_type new_nodes = (new_elems + this->s_buffer_size() - 1) /
this->s_buffer_size();
size_type s = (size_type)(this->members_.m_start.m_node - this->members_.m_map);
if (new_nodes > s){
@@ -1880,7 +1920,7 @@ class deque : protected deque_base<T, A>
}
BOOST_CATCH(...) {
for (size_type j = 1; j < i; ++j)
- this->priv_deallocate_node(*(this->members_.m_start.m_node - j));
+ this->priv_deallocate_node(*(this->members_.m_start.m_node - j));
BOOST_RETHROW
}
BOOST_CATCH_END
@@ -1888,7 +1928,7 @@ class deque : protected deque_base<T, A>
return this->members_.m_start - difference_type(n);
}
- iterator priv_reserve_elements_at_back(size_type n)
+ iterator priv_reserve_elements_at_back(size_type n)
{
size_type vacancies = (this->members_.m_finish.m_last - this->members_.m_finish.m_cur) - 1;
if (n > vacancies){
@@ -1905,7 +1945,7 @@ class deque : protected deque_base<T, A>
}
BOOST_CATCH(...) {
for (size_type j = 1; j < i; ++j)
- this->priv_deallocate_node(*(this->members_.m_finish.m_node + j));
+ this->priv_deallocate_node(*(this->members_.m_finish.m_node + j));
BOOST_RETHROW
}
BOOST_CATCH_END
@@ -1920,7 +1960,7 @@ class deque : protected deque_base<T, A>
index_pointer new_nstart;
if (this->members_.m_map_size > 2 * new_num_nodes) {
- new_nstart = this->members_.m_map + (this->members_.m_map_size - new_num_nodes) / 2
+ new_nstart = this->members_.m_map + (this->members_.m_map_size - new_num_nodes) / 2
+ (add_at_front ? nodes_to_add : 0);
if (new_nstart < this->members_.m_start.m_node)
boost::move(this->members_.m_start.m_node, this->members_.m_finish.m_node + 1, new_nstart);
@@ -1929,7 +1969,7 @@ class deque : protected deque_base<T, A>
(this->members_.m_start.m_node, this->members_.m_finish.m_node + 1, new_nstart + old_num_nodes);
}
else {
- size_type new_map_size =
+ size_type new_map_size =
this->members_.m_map_size + container_detail::max_value(this->members_.m_map_size, nodes_to_add) + 2;
index_pointer new_map = this->priv_allocate_map(new_map_size);
@@ -1958,29 +1998,29 @@ inline bool operator==(const deque<T, A>& x,
template <class T, class A>
inline bool operator<(const deque<T, A>& x,
- const deque<T, A>& y)
+ const deque<T, A>& y)
{
return lexicographical_compare(x.begin(), x.end(), y.begin(), y.end());
}
template <class T, class A>
inline bool operator!=(const deque<T, A>& x,
- const deque<T, A>& y)
+ const deque<T, A>& y)
{ return !(x == y); }
template <class T, class A>
inline bool operator>(const deque<T, A>& x,
- const deque<T, A>& y)
+ const deque<T, A>& y)
{ return y < x; }
template <class T, class A>
inline bool operator<=(const deque<T, A>& x,
- const deque<T, A>& y)
+ const deque<T, A>& y)
{ return !(y < x); }
template <class T, class A>
inline bool operator>=(const deque<T, A>& x,
- const deque<T, A>& y)
+ const deque<T, A>& y)
{ return !(x < y); }
diff --git a/boost/container/detail/adaptive_node_pool_impl.hpp b/boost/container/detail/adaptive_node_pool_impl.hpp
index 36495795fb..afba6b5f1b 100644
--- a/boost/container/detail/adaptive_node_pool_impl.hpp
+++ b/boost/container/detail/adaptive_node_pool_impl.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -51,11 +51,11 @@ struct adaptive_pool_types
, bi::optimize_size<true>
, bi::constant_time_size<false>
, bi::link_mode<bi::normal_link> >::type multiset_hook_t;
-
+
typedef hdr_offset_holder_t<SizeType> hdr_offset_holder;
struct block_info_t
- :
+ :
public hdr_offset_holder,
public multiset_hook_t
{
@@ -89,7 +89,7 @@ inline size_type calculate_alignment
const size_type divisor = overhead_percent*real_node_size;
const size_type dividend = hdr_offset_size*100;
size_type elements_per_subblock = (dividend - 1)/divisor + 1;
- size_type candidate_power_of_2 =
+ size_type candidate_power_of_2 =
upper_power_of_2(elements_per_subblock*real_node_size + hdr_offset_size);
bool overhead_satisfied = false;
//Now calculate the wors-case overhead for a subblock
@@ -228,7 +228,7 @@ class private_adaptive_node_pool_impl
{
priv_invariants();
//If there are no free nodes we allocate a new block
- if (m_block_multiset.empty()){
+ if (m_block_multiset.empty()){
priv_alloc_block(1);
}
//We take the first free node the multiset can't be empty
@@ -248,7 +248,7 @@ class private_adaptive_node_pool_impl
priv_invariants();
}
- //!Allocates n nodes.
+ //!Allocates n nodes.
//!Can throw
multiallocation_chain allocate_nodes(const size_type n)
{
@@ -448,7 +448,7 @@ class private_adaptive_node_pool_impl
#undef BOOST_CONTAINER_ADAPTIVE_NODE_POOL_CHECK_INVARIANTS
{
//We iterate through the block tree to free the memory
- block_iterator it(m_block_multiset.begin()),
+ block_iterator it(m_block_multiset.begin()),
itend(m_block_multiset.end()), to_deallocate;
if(it != itend){
for(++it; it != itend; ++it){
@@ -559,9 +559,9 @@ class private_adaptive_node_pool_impl
++m_totally_free_blocks;
block_info_t *c_info = new(mem_address)block_info_t();
m_block_multiset.insert(m_block_multiset.end(), *c_info);
-
+
mem_address += HdrSize;
- //We initialize all Nodes in Node Block to insert
+ //We initialize all Nodes in Node Block to insert
//them in the free Node list
typename free_nodes_t::iterator prev_insert_pos = c_info->free_nodes.before_begin();
for(size_type i = 0; i < m_real_num_node; ++i){
@@ -605,7 +605,7 @@ class private_adaptive_node_pool_impl
}
{
char *pNode = hdr_addr + HdrSize;
- //We initialize all Nodes in Node Block to insert
+ //We initialize all Nodes in Node Block to insert
//them in the free Node list
for(size_type i = 0; i < hdr_subblock_elements; ++i){
prev_insert_pos = c_info->free_nodes.insert_after(prev_insert_pos, *new (pNode) node_t);
diff --git a/boost/container/detail/advanced_insert_int.hpp b/boost/container/detail/advanced_insert_int.hpp
index 58199c7aa8..a97af282e0 100644
--- a/boost/container/detail/advanced_insert_int.hpp
+++ b/boost/container/detail/advanced_insert_int.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2008-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2008-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -17,7 +17,9 @@
#include "config_begin.hpp"
#include <boost/container/detail/workaround.hpp>
-#include <boost/container/allocator/allocator_traits.hpp>
+#include <boost/container/allocator_traits.hpp>
+#include <boost/container/detail/destroyers.hpp>
+#include <boost/aligned_storage.hpp>
#include <boost/move/move.hpp>
#include <iterator> //std::iterator_traits
#include <boost/assert.hpp>
@@ -41,7 +43,6 @@ template<class A, class FwdIt, class Iterator>
struct advanced_insert_aux_proxy
: public advanced_insert_aux_int<Iterator>
{
- typedef boost::container::allocator_traits<A> alloc_traits;
typedef typename allocator_traits<A>::size_type size_type;
typedef typename allocator_traits<A>::value_type value_type;
typedef typename advanced_insert_aux_int<Iterator>::difference_type difference_type;
@@ -54,36 +55,36 @@ struct advanced_insert_aux_proxy
{}
virtual void copy_remaining_to(Iterator p)
- { ::boost::copy_or_move(first_, last_, p); }
+ { ::boost::copy_or_move(this->first_, this->last_, p); }
virtual void uninitialized_copy_remaining_to(Iterator p)
- { ::boost::container::uninitialized_copy_or_move_alloc(a_, first_, last_, p); }
+ { ::boost::container::uninitialized_copy_or_move_alloc(this->a_, this->first_, this->last_, p); }
virtual void uninitialized_copy_some_and_update(Iterator pos, difference_type division_count, bool first_n)
{
- FwdIt mid = first_;
+ FwdIt mid = this->first_;
std::advance(mid, division_count);
if(first_n){
- ::boost::container::uninitialized_copy_or_move_alloc(a_, first_, mid, pos);
- first_ = mid;
+ ::boost::container::uninitialized_copy_or_move_alloc(this->a_, this->first_, mid, pos);
+ this->first_ = mid;
}
else{
- ::boost::container::uninitialized_copy_or_move_alloc(a_, mid, last_, pos);
- last_ = mid;
+ ::boost::container::uninitialized_copy_or_move_alloc(this->a_, mid, this->last_, pos);
+ this->last_ = mid;
}
}
virtual void copy_some_and_update(Iterator pos, difference_type division_count, bool first_n)
{
- FwdIt mid = first_;
+ FwdIt mid = this->first_;
std::advance(mid, division_count);
if(first_n){
- ::boost::copy_or_move(first_, mid, pos);
- first_ = mid;
+ ::boost::copy_or_move(this->first_, mid, pos);
+ this->first_ = mid;
}
else{
- ::boost::copy_or_move(mid, last_, pos);
- last_ = mid;
+ ::boost::copy_or_move(mid, this->last_, pos);
+ this->last_ = mid;
}
}
A &a_;
@@ -95,7 +96,7 @@ template<class A, class Iterator>
struct default_construct_aux_proxy
: public advanced_insert_aux_int<Iterator>
{
- typedef boost::container::allocator_traits<A> alloc_traits;
+ typedef ::boost::container::allocator_traits<A> alloc_traits;
typedef typename allocator_traits<A>::size_type size_type;
typedef typename allocator_traits<A>::value_type value_type;
typedef typename advanced_insert_aux_int<Iterator>::difference_type difference_type;
@@ -109,11 +110,11 @@ struct default_construct_aux_proxy
virtual void copy_remaining_to(Iterator)
{ //This should never be called with any count
- BOOST_ASSERT(count_ == 0);
+ BOOST_ASSERT(this->count_ == 0);
}
virtual void uninitialized_copy_remaining_to(Iterator p)
- { this->priv_uninitialized_copy(p, count_); }
+ { this->priv_uninitialized_copy(p, this->count_); }
virtual void uninitialized_copy_some_and_update(Iterator pos, difference_type division_count, bool first_n)
{
@@ -122,22 +123,22 @@ struct default_construct_aux_proxy
new_count = division_count;
}
else{
- BOOST_ASSERT(difference_type(count_)>= division_count);
- new_count = count_ - division_count;
+ BOOST_ASSERT(difference_type(this->count_)>= division_count);
+ new_count = this->count_ - division_count;
}
this->priv_uninitialized_copy(pos, new_count);
}
virtual void copy_some_and_update(Iterator , difference_type division_count, bool first_n)
{
- BOOST_ASSERT(count_ == 0);
+ BOOST_ASSERT(this->count_ == 0);
size_type new_count;
if(first_n){
new_count = division_count;
}
else{
- BOOST_ASSERT(difference_type(count_)>= division_count);
- new_count = count_ - division_count;
+ BOOST_ASSERT(difference_type(this->count_)>= division_count);
+ new_count = this->count_ - division_count;
}
//This function should never called with a count different to zero
BOOST_ASSERT(new_count == 0);
@@ -147,21 +148,21 @@ struct default_construct_aux_proxy
private:
void priv_uninitialized_copy(Iterator p, const size_type n)
{
- BOOST_ASSERT(n <= count_);
+ BOOST_ASSERT(n <= this->count_);
Iterator orig_p = p;
size_type i = 0;
try{
for(; i < n; ++i, ++p){
- alloc_traits::construct(a_, container_detail::to_raw_pointer(&*p));
+ alloc_traits::construct(this->a_, container_detail::to_raw_pointer(&*p));
}
}
catch(...){
while(i--){
- alloc_traits::destroy(a_, container_detail::to_raw_pointer(&*orig_p++));
+ alloc_traits::destroy(this->a_, container_detail::to_raw_pointer(&*orig_p++));
}
throw;
}
- count_ -= n;
+ this->count_ -= n;
}
A &a_;
size_type count_;
@@ -182,7 +183,7 @@ namespace container {
namespace container_detail {
-//This class template will adapt emplace construction insertions of movable types
+//This class template will adapt emplace construction insertions of movable types
//to advanced_insert_aux_int
template<class A, class Iterator, class ...Args>
struct advanced_insert_aux_non_movable_emplace
@@ -223,13 +224,13 @@ struct advanced_insert_aux_non_movable_emplace
{
BOOST_ASSERT(division_count <=1);
if((first_n && division_count == 1) || (!first_n && division_count == 0)){
- if(!used_){
- alloc_traits::construct( a_
+ if(!this->used_){
+ alloc_traits::construct( this->a_
, container_detail::to_raw_pointer(&*p)
, ::boost::container::container_detail::
- stored_ref<Args>::forward(get<IdxPack>(args_))...
+ stored_ref<Args>::forward(get<IdxPack>(this->args_))...
);
- used_ = true;
+ this->used_ = true;
}
}
}
@@ -237,13 +238,13 @@ struct advanced_insert_aux_non_movable_emplace
template<int ...IdxPack>
void priv_uninitialized_copy_remaining_to(const index_tuple<IdxPack...>&, Iterator p)
{
- if(!used_){
- alloc_traits::construct( a_
+ if(!this->used_){
+ alloc_traits::construct( this->a_
, container_detail::to_raw_pointer(&*p)
, ::boost::container::container_detail::
- stored_ref<Args>::forward(get<IdxPack>(args_))...
+ stored_ref<Args>::forward(get<IdxPack>(this->args_))...
);
- used_ = true;
+ this->used_ = true;
}
}
@@ -253,19 +254,20 @@ struct advanced_insert_aux_non_movable_emplace
bool used_;
};
-//This class template will adapt emplace construction insertions of movable types
+//This class template will adapt emplace construction insertions of movable types
//to advanced_insert_aux_int
template<class A, class Iterator, class ...Args>
struct advanced_insert_aux_emplace
: public advanced_insert_aux_non_movable_emplace<A, Iterator, Args...>
{
typedef advanced_insert_aux_non_movable_emplace<A, Iterator, Args...> base_t;
+ typedef boost::container::allocator_traits<A> alloc_traits;
typedef typename base_t::value_type value_type;
typedef typename base_t::difference_type difference_type;
typedef typename base_t::index_tuple_t index_tuple_t;
explicit advanced_insert_aux_emplace(A &a, Args&&... args)
- : base_t(a, boost::forward<Args>(args)...)
+ : base_t(a, ::boost::forward<Args>(args)...)
{}
~advanced_insert_aux_emplace()
@@ -283,8 +285,13 @@ struct advanced_insert_aux_emplace
void priv_copy_remaining_to(const index_tuple<IdxPack...>&, Iterator p)
{
if(!this->used_){
- *p = boost::move(value_type (
- ::boost::container::container_detail::stored_ref<Args>::forward(get<IdxPack>(this->args_))...));
+ aligned_storage<sizeof(value_type), alignment_of<value_type>::value> v;
+ value_type *vp = static_cast<value_type *>(static_cast<void *>(&v));
+ alloc_traits::construct(this->a_, vp,
+ ::boost::container::container_detail::stored_ref<Args>::forward(get<IdxPack>(this->args_))...);
+ scoped_destructor<A> d(this->a_, vp);
+ *p = ::boost::move(*vp);
+ d.release();
this->used_ = true;
}
}
@@ -295,8 +302,17 @@ struct advanced_insert_aux_emplace
BOOST_ASSERT(division_count <=1);
if((first_n && division_count == 1) || (!first_n && division_count == 0)){
if(!this->used_){
- *p = boost::move(value_type(
- ::boost::container::container_detail::stored_ref<Args>::forward(get<IdxPack>(this->args_))...));
+ aligned_storage<sizeof(value_type), alignment_of<value_type>::value> v;
+ value_type *vp = static_cast<value_type *>(static_cast<void *>(&v));
+ alloc_traits::construct(this->a_, vp,
+ ::boost::container::container_detail::stored_ref<Args>::forward(get<IdxPack>(this->args_))...);
+ try {
+ *p = ::boost::move(*vp);
+ } catch (...) {
+ alloc_traits::destroy(this->a_, vp);
+ throw;
+ }
+ alloc_traits::destroy(this->a_, vp);
this->used_ = true;
}
}
@@ -307,11 +323,11 @@ struct advanced_insert_aux_emplace
#else //#ifdef BOOST_CONTAINER_PERFECT_FORWARDING
-#include <boost/container/detail/preprocessor.hpp>
+#include <boost/container/detail/preprocessor.hpp>
#include <boost/container/detail/value_init.hpp>
namespace boost {
-namespace container {
+namespace container {
namespace container_detail {
#define BOOST_PP_LOCAL_MACRO(n) \
@@ -337,13 +353,13 @@ struct BOOST_PP_CAT(BOOST_PP_CAT(advanced_insert_aux_non_movable_emplace, n), ar
\
virtual void uninitialized_copy_remaining_to(Iterator p) \
{ \
- if(!used_){ \
+ if(!this->used_){ \
alloc_traits::construct \
- ( a_ \
+ ( this->a_ \
, container_detail::to_raw_pointer(&*p) \
BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_MEMBER_FORWARD, _) \
); \
- used_ = true; \
+ this->used_ = true; \
} \
} \
\
@@ -352,13 +368,13 @@ struct BOOST_PP_CAT(BOOST_PP_CAT(advanced_insert_aux_non_movable_emplace, n), ar
{ \
BOOST_ASSERT(division_count <=1); \
if((first_n && division_count == 1) || (!first_n && division_count == 0)){ \
- if(!used_){ \
+ if(!this->used_){ \
alloc_traits::construct \
- ( a_ \
+ ( this->a_ \
, container_detail::to_raw_pointer(&*p) \
BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_MEMBER_FORWARD, _) \
); \
- used_ = true; \
+ this->used_ = true; \
} \
} \
} \
@@ -382,6 +398,7 @@ struct BOOST_PP_CAT(BOOST_PP_CAT(advanced_insert_aux_emplace, n), arg)
<A, Iterator BOOST_PP_ENUM_TRAILING_PARAMS(n, P) > base_t; \
typedef typename base_t::value_type value_type; \
typedef typename base_t::difference_type difference_type; \
+ typedef boost::container::allocator_traits<A> alloc_traits; \
\
BOOST_PP_CAT(BOOST_PP_CAT(advanced_insert_aux_emplace, n), arg) \
( A &a BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _) ) \
@@ -391,10 +408,13 @@ struct BOOST_PP_CAT(BOOST_PP_CAT(advanced_insert_aux_emplace, n), arg)
virtual void copy_remaining_to(Iterator p) \
{ \
if(!this->used_){ \
- value_type v BOOST_PP_LPAREN_IF(n) \
- BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_MEMBER_FORWARD, _) \
- BOOST_PP_RPAREN_IF(n); \
- *p = boost::move(v); \
+ aligned_storage<sizeof(value_type), alignment_of<value_type>::value> v; \
+ value_type *vp = static_cast<value_type *>(static_cast<void *>(&v)); \
+ alloc_traits::construct(this->a_, vp \
+ BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_MEMBER_FORWARD, _)); \
+ scoped_destructor<A> d(this->a_, vp); \
+ *p = ::boost::move(*vp); \
+ d.release(); \
this->used_ = true; \
} \
} \
@@ -405,10 +425,13 @@ struct BOOST_PP_CAT(BOOST_PP_CAT(advanced_insert_aux_emplace, n), arg)
BOOST_ASSERT(division_count <=1); \
if((first_n && division_count == 1) || (!first_n && division_count == 0)){ \
if(!this->used_){ \
- value_type v BOOST_PP_LPAREN_IF(n) \
- BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_MEMBER_FORWARD, _) \
- BOOST_PP_RPAREN_IF(n); \
- *p = boost::move(v); \
+ aligned_storage<sizeof(value_type), alignment_of<value_type>::value> v; \
+ value_type *vp = static_cast<value_type *>(static_cast<void *>(&v)); \
+ alloc_traits::construct(this->a_, vp \
+ BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_MEMBER_FORWARD, _)); \
+ scoped_destructor<A> d(this->a_, vp); \
+ *p = ::boost::move(*vp); \
+ d.release(); \
this->used_ = true; \
} \
} \
diff --git a/boost/container/detail/algorithms.hpp b/boost/container/detail/algorithms.hpp
index a2713f50f1..dc09575b24 100644
--- a/boost/container/detail/algorithms.hpp
+++ b/boost/container/detail/algorithms.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2011.
+// (C) Copyright Ion Gaztanaga 2005-2012.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -51,7 +51,7 @@ inline void construct_in_place(A &a, T *dest, emplace_iterator<U, EF, D> ei)
ei.construct_in_place(a, dest);
}
-} //namespace container {
+} //namespace container {
} //namespace boost {
#include <boost/container/detail/config_end.hpp>
diff --git a/boost/container/detail/allocation_type.hpp b/boost/container/detail/allocation_type.hpp
index edad487c57..1ebf20ed70 100644
--- a/boost/container/detail/allocation_type.hpp
+++ b/boost/container/detail/allocation_type.hpp
@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -23,7 +23,7 @@ namespace container {
/// @cond
enum allocation_type_v
-{
+{
// constants for allocation commands
allocate_new_v = 0x01,
expand_fwd_v = 0x02,
diff --git a/boost/container/detail/config_begin.hpp b/boost/container/detail/config_begin.hpp
index bd44daacfe..83c2cfe40c 100644
--- a/boost/container/detail/config_begin.hpp
+++ b/boost/container/detail/config_begin.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -45,4 +45,5 @@
// with /GR-; unpredictable behavior may result
#pragma warning (disable : 4673) // throwing '' the following types will not be considered at the catch site
#pragma warning (disable : 4671) // the copy constructor is inaccessible
+ #pragma warning (disable : 4584) // X is already a base-class of Y
#endif //BOOST_MSVC
diff --git a/boost/container/detail/config_end.hpp b/boost/container/detail/config_end.hpp
index b71fabcdae..34513718cc 100644
--- a/boost/container/detail/config_end.hpp
+++ b/boost/container/detail/config_end.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
diff --git a/boost/container/detail/destroyers.hpp b/boost/container/detail/destroyers.hpp
index 26ae089aa6..d1b118cdcc 100644
--- a/boost/container/detail/destroyers.hpp
+++ b/boost/container/detail/destroyers.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2011.
+// (C) Copyright Ion Gaztanaga 2005-2012.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -21,10 +21,10 @@
#include <boost/container/detail/workaround.hpp>
#include <boost/container/detail/version_type.hpp>
#include <boost/container/detail/utilities.hpp>
-#include <boost/container/allocator/allocator_traits.hpp>
+#include <boost/container/allocator_traits.hpp>
namespace boost {
-namespace container {
+namespace container {
namespace container_detail {
//!A deleter for scoped_ptr that deallocates the memory
@@ -65,6 +65,44 @@ struct null_scoped_array_deallocator
{}
};
+template <class Allocator>
+struct scoped_destroy_deallocator
+{
+ typedef boost::container::allocator_traits<Allocator> AllocTraits;
+ typedef typename AllocTraits::pointer pointer;
+ typedef typename AllocTraits::size_type size_type;
+ typedef container_detail::integral_constant<unsigned,
+ boost::container::container_detail::
+ version<Allocator>::value> alloc_version;
+ typedef container_detail::integral_constant<unsigned, 1> allocator_v1;
+ typedef container_detail::integral_constant<unsigned, 2> allocator_v2;
+
+ scoped_destroy_deallocator(pointer p, Allocator& a)
+ : m_ptr(p), m_alloc(a) {}
+
+ ~scoped_destroy_deallocator()
+ {
+ if(m_ptr){
+ AllocTraits::destroy(m_alloc, container_detail::to_raw_pointer(m_ptr));
+ priv_deallocate(m_ptr, alloc_version());
+ }
+ }
+
+ void release()
+ { m_ptr = 0; }
+
+ private:
+
+ void priv_deallocate(const pointer &p, allocator_v1)
+ { AllocTraits::deallocate(m_alloc, p, 1); }
+
+ void priv_deallocate(const pointer &p, allocator_v2)
+ { m_alloc.deallocate_one(p); }
+
+ pointer m_ptr;
+ Allocator& m_alloc;
+};
+
//!A deleter for scoped_ptr that destroys
//!an object using a STL allocator.
@@ -85,7 +123,10 @@ struct scoped_destructor_n
void increment_size(size_type inc)
{ m_n += inc; }
-
+
+ void increment_size_backwards(size_type inc)
+ { m_n += inc; m_p -= inc; }
+
~scoped_destructor_n()
{
if(!m_p) return;
@@ -115,8 +156,57 @@ struct null_scoped_destructor_n
void increment_size(size_type)
{}
+ void increment_size_backwards(size_type)
+ {}
+
+ void release()
+ {}
+};
+
+template<class A>
+class scoped_destructor
+{
+ typedef boost::container::allocator_traits<A> AllocTraits;
+ public:
+ typedef typename A::value_type value_type;
+ scoped_destructor(A &a, value_type *pv)
+ : pv_(pv), a_(a)
+ {}
+
+ ~scoped_destructor()
+ {
+ if(pv_){
+ AllocTraits::destroy(a_, pv_);
+ }
+ }
+
void release()
+ { pv_ = 0; }
+
+ private:
+ value_type *pv_;
+ A &a_;
+};
+
+
+template<class A>
+class value_destructor
+{
+ typedef boost::container::allocator_traits<A> AllocTraits;
+ public:
+ typedef typename A::value_type value_type;
+ value_destructor(A &a, value_type &rv)
+ : rv_(rv), a_(a)
{}
+
+ ~value_destructor()
+ {
+ AllocTraits::destroy(a_, &rv_);
+ }
+
+ private:
+ value_type &rv_;
+ A &a_;
};
template <class Allocator>
@@ -154,8 +244,8 @@ class allocator_destroyer
};
-} //namespace container_detail {
-} //namespace container {
+} //namespace container_detail {
+} //namespace container {
} //namespace boost {
#include <boost/container/detail/config_end.hpp>
diff --git a/boost/container/detail/flat_tree.hpp b/boost/container/detail/flat_tree.hpp
index 44438386a3..23be0bfd13 100644
--- a/boost/container/detail/flat_tree.hpp
+++ b/boost/container/detail/flat_tree.hpp
@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -32,6 +32,8 @@
#include <boost/container/vector.hpp>
#include <boost/container/detail/value_init.hpp>
#include <boost/container/detail/destroyers.hpp>
+#include <boost/container/allocator_traits.hpp>
+#include <boost/aligned_storage.hpp>
namespace boost {
@@ -46,24 +48,24 @@ class flat_tree_value_compare
typedef Value first_argument_type;
typedef Value second_argument_type;
typedef bool return_type;
- public:
+ public:
flat_tree_value_compare()
: Compare()
{}
- flat_tree_value_compare(const Compare &pred)
+ flat_tree_value_compare(const Compare &pred)
: Compare(pred)
{}
bool operator()(const Value& lhs, const Value& rhs) const
- {
+ {
KeyOfValue key_extract;
- return Compare::operator()(key_extract(lhs), key_extract(rhs));
+ return Compare::operator()(key_extract(lhs), key_extract(rhs));
}
const Compare &get_comp() const
{ return *this; }
-
+
Compare &get_comp()
{ return *this; }
};
@@ -79,7 +81,7 @@ struct get_flat_tree_iterators
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
};
-template <class Key, class Value, class KeyOfValue,
+template <class Key, class Value, class KeyOfValue,
class Compare, class A>
class flat_tree
{
@@ -90,7 +92,7 @@ class flat_tree
typedef flat_tree_value_compare<Compare, Value, KeyOfValue> value_compare;
private:
- struct Data
+ struct Data
//Inherit from value_compare to do EBO
: public value_compare
{
@@ -102,19 +104,27 @@ class flat_tree
{}
Data(const Data &d)
- : value_compare(d), m_vect(d.m_vect)
+ : value_compare(static_cast<const value_compare&>(d)), m_vect(d.m_vect)
{}
Data(BOOST_RV_REF(Data) d)
- : value_compare(boost::move(d)), m_vect(boost::move(d.m_vect))
+ : value_compare(boost::move(static_cast<value_compare&>(d))), m_vect(boost::move(d.m_vect))
+ {}
+
+ Data(const Data &d, const A &a)
+ : value_compare(static_cast<const value_compare&>(d)), m_vect(d.m_vect, a)
{}
- Data(const Compare &comp)
+ Data(BOOST_RV_REF(Data) d, const A &a)
+ : value_compare(boost::move(static_cast<value_compare&>(d))), m_vect(boost::move(d.m_vect), a)
+ {}
+
+ Data(const Compare &comp)
: value_compare(comp), m_vect()
{}
Data(const Compare &comp,
- const allocator_t &alloc)
+ const allocator_t &alloc)
: value_compare(comp), m_vect(alloc)
{}
@@ -165,6 +175,10 @@ class flat_tree
//!Standard extension
typedef allocator_type stored_allocator_type;
+ private:
+ typedef allocator_traits<stored_allocator_type> stored_allocator_traits;
+
+ public:
flat_tree()
: m_data()
{ }
@@ -177,7 +191,7 @@ class flat_tree
: m_data(comp, a)
{ }
- flat_tree(const flat_tree& x)
+ flat_tree(const flat_tree& x)
: m_data(x.m_data)
{ }
@@ -185,6 +199,14 @@ class flat_tree
: m_data(boost::move(x.m_data))
{ }
+ flat_tree(const flat_tree& x, const allocator_type &a)
+ : m_data(x.m_data, a)
+ { }
+
+ flat_tree(BOOST_RV_REF(flat_tree) x, const allocator_type &a)
+ : m_data(boost::move(x.m_data), a)
+ { }
+
template <class InputIterator>
flat_tree( ordered_range_t, InputIterator first, InputIterator last
, const Compare& comp = Compare()
@@ -201,66 +223,66 @@ class flat_tree
flat_tree& operator=(BOOST_RV_REF(flat_tree) mx)
{ m_data = boost::move(mx.m_data); return *this; }
- public:
+ public:
// accessors:
- Compare key_comp() const
+ Compare key_comp() const
{ return this->m_data.get_comp(); }
- allocator_type get_allocator() const
+ allocator_type get_allocator() const
{ return this->m_data.m_vect.get_allocator(); }
- const stored_allocator_type &get_stored_allocator() const
+ const stored_allocator_type &get_stored_allocator() const
{ return this->m_data.m_vect.get_stored_allocator(); }
stored_allocator_type &get_stored_allocator()
{ return this->m_data.m_vect.get_stored_allocator(); }
- iterator begin()
+ iterator begin()
{ return this->m_data.m_vect.begin(); }
- const_iterator begin() const
+ const_iterator begin() const
{ return this->cbegin(); }
- const_iterator cbegin() const
+ const_iterator cbegin() const
{ return this->m_data.m_vect.begin(); }
- iterator end()
+ iterator end()
{ return this->m_data.m_vect.end(); }
- const_iterator end() const
+ const_iterator end() const
{ return this->cend(); }
- const_iterator cend() const
+ const_iterator cend() const
{ return this->m_data.m_vect.end(); }
- reverse_iterator rbegin()
+ reverse_iterator rbegin()
{ return reverse_iterator(this->end()); }
- const_reverse_iterator rbegin() const
+ const_reverse_iterator rbegin() const
{ return this->crbegin(); }
- const_reverse_iterator crbegin() const
+ const_reverse_iterator crbegin() const
{ return const_reverse_iterator(this->cend()); }
- reverse_iterator rend()
+ reverse_iterator rend()
{ return reverse_iterator(this->begin()); }
- const_reverse_iterator rend() const
- { return this->crend(); }
+ const_reverse_iterator rend() const
+ { return this->crend(); }
- const_reverse_iterator crend() const
- { return const_reverse_iterator(this->cbegin()); }
+ const_reverse_iterator crend() const
+ { return const_reverse_iterator(this->cbegin()); }
- bool empty() const
+ bool empty() const
{ return this->m_data.m_vect.empty(); }
- size_type size() const
+ size_type size() const
{ return this->m_data.m_vect.size(); }
- size_type max_size() const
+ size_type max_size() const
{ return this->m_data.m_vect.max_size(); }
- void swap(flat_tree& other)
+ void swap(flat_tree& other)
{ this->m_data.swap(other.m_data); }
public:
@@ -285,7 +307,6 @@ class flat_tree
return ret;
}
-
iterator insert_equal(const value_type& val)
{
iterator i = this->upper_bound(KeyOfValue()(val));
@@ -323,14 +344,14 @@ class flat_tree
iterator insert_equal(const_iterator pos, const value_type& val)
{
insert_commit_data data;
- priv_insert_equal_prepare(pos, val, data);
+ this->priv_insert_equal_prepare(pos, val, data);
return priv_insert_commit(data, val);
}
iterator insert_equal(const_iterator pos, BOOST_RV_REF(value_type) mval)
{
insert_commit_data data;
- priv_insert_equal_prepare(pos, mval, data);
+ this->priv_insert_equal_prepare(pos, mval, data);
return priv_insert_commit(data, boost::move(mval));
}
@@ -344,9 +365,25 @@ class flat_tree
template <class InIt>
void insert_equal(InIt first, InIt last)
{
- typedef typename
+ typedef typename
std::iterator_traits<InIt>::iterator_category ItCat;
- priv_insert_equal(first, last, ItCat());
+ this->priv_insert_equal(first, last, ItCat());
+ }
+
+ template <class InIt>
+ void insert_equal(ordered_range_t, InIt first, InIt last)
+ {
+ typedef typename
+ std::iterator_traits<InIt>::iterator_category ItCat;
+ this->priv_insert_equal(ordered_range_t(), first, last, ItCat());
+ }
+
+ template <class InIt>
+ void insert_unique(ordered_unique_range_t, InIt first, InIt last)
+ {
+ typedef typename
+ std::iterator_traits<InIt>::iterator_category ItCat;
+ this->priv_insert_unique(ordered_unique_range_t(), first, last, ItCat());
}
#ifdef BOOST_CONTAINER_PERFECT_FORWARDING
@@ -354,7 +391,11 @@ class flat_tree
template <class... Args>
std::pair<iterator, bool> emplace_unique(Args&&... args)
{
- value_type && val = value_type(boost::forward<Args>(args)...);
+ aligned_storage<sizeof(value_type), alignment_of<value_type>::value> v;
+ value_type &val = *static_cast<value_type *>(static_cast<void *>(&v));
+ stored_allocator_type &a = this->get_stored_allocator();
+ stored_allocator_traits::construct(a, &val, ::boost::forward<Args>(args)... );
+ value_destructor<stored_allocator_type> d(a, val);
insert_commit_data data;
std::pair<iterator,bool> ret =
priv_insert_unique_prepare(val, data);
@@ -367,7 +408,11 @@ class flat_tree
template <class... Args>
iterator emplace_hint_unique(const_iterator hint, Args&&... args)
{
- value_type && val = value_type(boost::forward<Args>(args)...);
+ aligned_storage<sizeof(value_type), alignment_of<value_type>::value> v;
+ value_type &val = *static_cast<value_type *>(static_cast<void *>(&v));
+ stored_allocator_type &a = this->get_stored_allocator();
+ stored_allocator_traits::construct(a, &val, ::boost::forward<Args>(args)... );
+ value_destructor<stored_allocator_type> d(a, val);
insert_commit_data data;
std::pair<iterator,bool> ret = priv_insert_unique_prepare(hint, val, data);
if(ret.second){
@@ -379,7 +424,11 @@ class flat_tree
template <class... Args>
iterator emplace_equal(Args&&... args)
{
- value_type &&val = value_type(boost::forward<Args>(args)...);
+ aligned_storage<sizeof(value_type), alignment_of<value_type>::value> v;
+ value_type &val = *static_cast<value_type *>(static_cast<void *>(&v));
+ stored_allocator_type &a = this->get_stored_allocator();
+ stored_allocator_traits::construct(a, &val, ::boost::forward<Args>(args)... );
+ value_destructor<stored_allocator_type> d(a, val);
iterator i = this->upper_bound(KeyOfValue()(val));
i = this->m_data.m_vect.insert(i, boost::move(val));
return i;
@@ -388,10 +437,15 @@ class flat_tree
template <class... Args>
iterator emplace_hint_equal(const_iterator hint, Args&&... args)
{
- value_type &&val = value_type(boost::forward<Args>(args)...);
+ aligned_storage<sizeof(value_type), alignment_of<value_type>::value> v;
+ value_type &val = *static_cast<value_type *>(static_cast<void *>(&v));
+ stored_allocator_type &a = this->get_stored_allocator();
+ stored_allocator_traits::construct(a, &val, ::boost::forward<Args>(args)... );
+ value_destructor<stored_allocator_type> d(a, val);
insert_commit_data data;
- priv_insert_equal_prepare(hint, val, data);
- return priv_insert_commit(data, boost::move(val));
+ this->priv_insert_equal_prepare(hint, val, data);
+ iterator i = priv_insert_commit(data, boost::move(val));
+ return i;
}
#else //#ifdef BOOST_CONTAINER_PERFECT_FORWARDING
@@ -401,10 +455,12 @@ class flat_tree
std::pair<iterator, bool> \
emplace_unique(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \
{ \
- BOOST_PP_EXPR_IF(BOOST_PP_NOT(n), container_detail::value_init<) value_type \
- BOOST_PP_EXPR_IF(BOOST_PP_NOT(n), >) vval BOOST_PP_LPAREN_IF(n) \
- BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _) BOOST_PP_RPAREN_IF(n); \
- value_type &val = vval; \
+ aligned_storage<sizeof(value_type), alignment_of<value_type>::value> v; \
+ value_type &val = *static_cast<value_type *>(static_cast<void *>(&v)); \
+ stored_allocator_type &a = this->get_stored_allocator(); \
+ stored_allocator_traits::construct(a, &val \
+ BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _) ); \
+ value_destructor<stored_allocator_type> d(a, val); \
insert_commit_data data; \
std::pair<iterator,bool> ret = priv_insert_unique_prepare(val, data); \
if(ret.second){ \
@@ -417,10 +473,12 @@ class flat_tree
iterator emplace_hint_unique(const_iterator hint \
BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \
{ \
- BOOST_PP_EXPR_IF(BOOST_PP_NOT(n), container_detail::value_init<) value_type \
- BOOST_PP_EXPR_IF(BOOST_PP_NOT(n), >) vval BOOST_PP_LPAREN_IF(n) \
- BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _) BOOST_PP_RPAREN_IF(n); \
- value_type &val = vval; \
+ aligned_storage<sizeof(value_type), alignment_of<value_type>::value> v; \
+ value_type &val = *static_cast<value_type *>(static_cast<void *>(&v)); \
+ stored_allocator_type &a = this->get_stored_allocator(); \
+ stored_allocator_traits::construct(a, &val \
+ BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _) ); \
+ value_destructor<stored_allocator_type> d(a, val); \
insert_commit_data data; \
std::pair<iterator,bool> ret = priv_insert_unique_prepare(hint, val, data); \
if(ret.second){ \
@@ -432,10 +490,12 @@ class flat_tree
BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \
iterator emplace_equal(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \
{ \
- BOOST_PP_EXPR_IF(BOOST_PP_NOT(n), container_detail::value_init<) value_type \
- BOOST_PP_EXPR_IF(BOOST_PP_NOT(n), >) vval BOOST_PP_LPAREN_IF(n) \
- BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _) BOOST_PP_RPAREN_IF(n); \
- value_type &val = vval; \
+ aligned_storage<sizeof(value_type), alignment_of<value_type>::value> v; \
+ value_type &val = *static_cast<value_type *>(static_cast<void *>(&v)); \
+ stored_allocator_type &a = this->get_stored_allocator(); \
+ stored_allocator_traits::construct(a, &val \
+ BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _) ); \
+ value_destructor<stored_allocator_type> d(a, val); \
iterator i = this->upper_bound(KeyOfValue()(val)); \
i = this->m_data.m_vect.insert(i, boost::move(val)); \
return i; \
@@ -445,14 +505,18 @@ class flat_tree
iterator emplace_hint_equal(const_iterator hint \
BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \
{ \
- BOOST_PP_EXPR_IF(BOOST_PP_NOT(n), container_detail::value_init<) value_type \
- BOOST_PP_EXPR_IF(BOOST_PP_NOT(n), >) vval BOOST_PP_LPAREN_IF(n) \
- BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _) BOOST_PP_RPAREN_IF(n); \
- value_type &val = vval; \
+ aligned_storage<sizeof(value_type), alignment_of<value_type>::value> v; \
+ value_type &val = *static_cast<value_type *>(static_cast<void *>(&v)); \
+ stored_allocator_type &a = this->get_stored_allocator(); \
+ stored_allocator_traits::construct(a, &val \
+ BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _) ); \
+ value_destructor<stored_allocator_type> d(a, val); \
insert_commit_data data; \
- priv_insert_equal_prepare(hint, val, data); \
- return priv_insert_commit(data, boost::move(val)); \
+ this->priv_insert_equal_prepare(hint, val, data); \
+ iterator i = priv_insert_commit(data, boost::move(val)); \
+ return i; \
} \
+
//!
#define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS)
#include BOOST_PP_LOCAL_ITERATE()
@@ -493,8 +557,8 @@ class flat_tree
const Compare &key_comp = this->m_data.get_comp();
iterator i = this->lower_bound(k);
- if (i != this->end() && key_comp(k, KeyOfValue()(*i))){
- i = this->end();
+ if (i != this->end() && key_comp(k, KeyOfValue()(*i))){
+ i = this->end();
}
return i;
}
@@ -504,8 +568,8 @@ class flat_tree
const Compare &key_comp = this->m_data.get_comp();
const_iterator i = this->lower_bound(k);
- if (i != this->end() && key_comp(k, KeyOfValue()(*i))){
- i = this->end();
+ if (i != this->end() && key_comp(k, KeyOfValue()(*i))){
+ i = this->end();
}
return i;
}
@@ -535,10 +599,10 @@ class flat_tree
std::pair<const_iterator, const_iterator> equal_range(const key_type& k) const
{ return this->priv_equal_range(this->begin(), this->end(), k); }
- size_type capacity() const
+ size_type capacity() const
{ return this->m_data.m_vect.capacity(); }
- void reserve(size_type count)
+ void reserve(size_type count)
{ this->m_data.m_vect.reserve(count); }
private:
@@ -567,12 +631,12 @@ class flat_tree
data.position = pos;
}
else{
- data.position =
+ data.position =
this->priv_upper_bound(this->cbegin(), pos, KeyOfValue()(val));
}
}
else{
- data.position =
+ data.position =
this->priv_lower_bound(pos, this->cend(), KeyOfValue()(val));
}
}
@@ -692,7 +756,7 @@ class flat_tree
}
else{
first = ++middle;
- len = len - half - 1;
+ len = len - half - 1;
}
}
return first;
@@ -730,14 +794,97 @@ class flat_tree
return std::pair<RanIt, RanIt>(first, first);
}
- template <class FwdIt>
- void priv_insert_equal(FwdIt first, FwdIt last, std::forward_iterator_tag)
+ template <class BidirIt>
+ void priv_insert_equal(ordered_range_t, BidirIt first, BidirIt last, std::bidirectional_iterator_tag)
{
size_type len = static_cast<size_type>(std::distance(first, last));
+ const size_type BurstSize = 16;
+ size_type positions[BurstSize];
+
+ //Prereserve all memory so that iterators are not invalidated
this->reserve(this->size()+len);
- this->priv_insert_equal(first, last, std::input_iterator_tag());
+ const const_iterator beg(this->cbegin());
+ const_iterator pos(beg);
+ //Loop in burst sizes
+ while(len){
+ const size_type burst = len < BurstSize ? len : BurstSize;
+ const const_iterator cend(this->cend());
+ len -= burst;
+ for(size_type i = 0; i != burst; ++i){
+ //Get the insertion position for each key
+ pos = const_cast<const flat_tree&>(*this).priv_upper_bound(pos, cend, KeyOfValue()(*first));
+ positions[i] = static_cast<size_type>(pos - beg);
+ ++first;
+ }
+ //Insert all in a single step in the precalculated positions
+ this->m_data.m_vect.insert_ordered_at(burst, positions + burst, first);
+ //Next search position updated
+ pos += burst;
+ }
}
+ template <class BidirIt>
+ void priv_insert_unique(ordered_unique_range_t, BidirIt first, BidirIt last, std::bidirectional_iterator_tag)
+ {
+ size_type len = static_cast<size_type>(std::distance(first, last));
+ const size_type BurstSize = 16;
+ size_type positions[BurstSize];
+ size_type skips[BurstSize];
+
+ //Prereserve all memory so that iterators are not invalidated
+ this->reserve(this->size()+len);
+ const const_iterator beg(this->cbegin());
+ const_iterator pos(beg);
+ const value_compare &value_comp = this->m_data;
+ //Loop in burst sizes
+ while(len){
+ skips[0u] = 0u;
+ const size_type burst = len < BurstSize ? len : BurstSize;
+ size_type unique_burst = 0u;
+ const const_iterator cend(this->cend());
+ while(unique_burst < burst && len > 0){
+ //Get the insertion position for each key
+ const value_type & val = *first++;
+ --len;
+ pos = const_cast<const flat_tree&>(*this).priv_lower_bound(pos, cend, KeyOfValue()(val));
+ //Check if already present
+ if(pos != cend && !value_comp(*pos, val)){
+ ++skips[unique_burst];
+ continue;
+ }
+
+ //If not present, calculate position
+ positions[unique_burst] = static_cast<size_type>(pos - beg);
+ if(++unique_burst < burst)
+ skips[unique_burst] = 0u;
+ }
+ //Insert all in a single step in the precalculated positions
+ this->m_data.m_vect.insert_ordered_at(unique_burst, positions + unique_burst, skips + unique_burst, first);
+ //Next search position updated
+ pos += unique_burst;
+ }
+ }
+/*
+ template <class FwdIt>
+ void priv_insert_equal_forward(ordered_range_t, FwdIt first, FwdIt last, std::forward_iterator_tag)
+ { this->priv_insert_equal(first, last, std::forward_iterator_tag()); }
+*/
+ template <class InIt>
+ void priv_insert_equal(ordered_range_t, InIt first, InIt last, std::input_iterator_tag)
+ { this->priv_insert_equal(first, last, std::input_iterator_tag()); }
+
+ template <class InIt>
+ void priv_insert_unique(ordered_unique_range_t, InIt first, InIt last, std::input_iterator_tag)
+ { this->priv_insert_unique(first, last, std::input_iterator_tag()); }
+/*
+ template <class FwdIt>
+ void priv_insert_equal_forward(FwdIt first, FwdIt last, std::forward_iterator_tag)
+ {
+ const size_type len = static_cast<size_type>(std::distance(first, last));
+ this->reserve(this->size()+len);
+ this->priv_insert_equal(first, last, std::input_iterator_tag());
+ }
+*/
template <class InIt>
void priv_insert_equal(InIt first, InIt last, std::input_iterator_tag)
{
@@ -746,59 +893,59 @@ class flat_tree
}
};
-template <class Key, class Value, class KeyOfValue,
+template <class Key, class Value, class KeyOfValue,
class Compare, class A>
-inline bool
-operator==(const flat_tree<Key,Value,KeyOfValue,Compare,A>& x,
+inline bool
+operator==(const flat_tree<Key,Value,KeyOfValue,Compare,A>& x,
const flat_tree<Key,Value,KeyOfValue,Compare,A>& y)
{
return x.size() == y.size() &&
std::equal(x.begin(), x.end(), y.begin());
}
-template <class Key, class Value, class KeyOfValue,
+template <class Key, class Value, class KeyOfValue,
class Compare, class A>
-inline bool
-operator<(const flat_tree<Key,Value,KeyOfValue,Compare,A>& x,
+inline bool
+operator<(const flat_tree<Key,Value,KeyOfValue,Compare,A>& x,
const flat_tree<Key,Value,KeyOfValue,Compare,A>& y)
{
- return std::lexicographical_compare(x.begin(), x.end(),
+ return std::lexicographical_compare(x.begin(), x.end(),
y.begin(), y.end());
}
-template <class Key, class Value, class KeyOfValue,
+template <class Key, class Value, class KeyOfValue,
class Compare, class A>
-inline bool
-operator!=(const flat_tree<Key,Value,KeyOfValue,Compare,A>& x,
- const flat_tree<Key,Value,KeyOfValue,Compare,A>& y)
+inline bool
+operator!=(const flat_tree<Key,Value,KeyOfValue,Compare,A>& x,
+ const flat_tree<Key,Value,KeyOfValue,Compare,A>& y)
{ return !(x == y); }
-template <class Key, class Value, class KeyOfValue,
+template <class Key, class Value, class KeyOfValue,
class Compare, class A>
-inline bool
-operator>(const flat_tree<Key,Value,KeyOfValue,Compare,A>& x,
- const flat_tree<Key,Value,KeyOfValue,Compare,A>& y)
+inline bool
+operator>(const flat_tree<Key,Value,KeyOfValue,Compare,A>& x,
+ const flat_tree<Key,Value,KeyOfValue,Compare,A>& y)
{ return y < x; }
-template <class Key, class Value, class KeyOfValue,
+template <class Key, class Value, class KeyOfValue,
class Compare, class A>
-inline bool
-operator<=(const flat_tree<Key,Value,KeyOfValue,Compare,A>& x,
- const flat_tree<Key,Value,KeyOfValue,Compare,A>& y)
+inline bool
+operator<=(const flat_tree<Key,Value,KeyOfValue,Compare,A>& x,
+ const flat_tree<Key,Value,KeyOfValue,Compare,A>& y)
{ return !(y < x); }
-template <class Key, class Value, class KeyOfValue,
+template <class Key, class Value, class KeyOfValue,
class Compare, class A>
-inline bool
-operator>=(const flat_tree<Key,Value,KeyOfValue,Compare,A>& x,
- const flat_tree<Key,Value,KeyOfValue,Compare,A>& y)
+inline bool
+operator>=(const flat_tree<Key,Value,KeyOfValue,Compare,A>& x,
+ const flat_tree<Key,Value,KeyOfValue,Compare,A>& y)
{ return !(x < y); }
-template <class Key, class Value, class KeyOfValue,
+template <class Key, class Value, class KeyOfValue,
class Compare, class A>
-inline void
-swap(flat_tree<Key,Value,KeyOfValue,Compare,A>& x,
+inline void
+swap(flat_tree<Key,Value,KeyOfValue,Compare,A>& x,
flat_tree<Key,Value,KeyOfValue,Compare,A>& y)
{ x.swap(y); }
@@ -808,7 +955,7 @@ swap(flat_tree<Key,Value,KeyOfValue,Compare,A>& x,
/*
//!has_trivial_destructor_after_move<> == true_type
//!specialization for optimizations
-template <class K, class V, class KOV,
+template <class K, class V, class KOV,
class C, class A>
struct has_trivial_destructor_after_move<boost::container::container_detail::flat_tree<K, V, KOV, C, A> >
{
diff --git a/boost/container/detail/function_detector.hpp b/boost/container/detail/function_detector.hpp
index c37c766844..5a5f6fd77d 100644
--- a/boost/container/detail/function_detector.hpp
+++ b/boost/container/detail/function_detector.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2009-2011.
+// (C) Copyright Ion Gaztanaga 2009-2012.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -15,7 +15,7 @@
///////////////////////////////////////////////////////////////////////////////
// Copyright 2007 Alexandre Courpron
//
-// Permission to use, copy, modify, redistribute and sell this software,
+// Permission to use, copy, modify, redistribute and sell this software,
// provided that this copyright notice appears on all copies of the software.
///////////////////////////////////////////////////////////////////////////////
@@ -74,7 +74,7 @@ namespace function_detector {
public : \
static const int check = NotFound + (sizeof(Test<T>(0, 0)) - sizeof(NotFoundType));\
};\
-}}} //namespace boost::container::function_detector {
+}}} //namespace boost::container::function_detector {
#define BOOST_CONTAINER_DETECT_FUNCTION(Class, InstantiationKey, ReturnType, Identifier, Params) \
::boost::container::function_detector::DetectMember_##InstantiationKey_##Identifier< Class,\
diff --git a/boost/container/detail/iterators.hpp b/boost/container/detail/iterators.hpp
index 899cbe4349..374b55c836 100644
--- a/boost/container/detail/iterators.hpp
+++ b/boost/container/detail/iterators.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2011.
+// (C) Copyright Ion Gaztanaga 2005-2012.
// (C) Copyright Gennaro Prota 2003 - 2004.
//
// Distributed under the Boost Software License, Version 1.0.
@@ -21,7 +21,7 @@
#include "config_begin.hpp"
#include <boost/container/detail/workaround.hpp>
#include <boost/move/move.hpp>
-#include <boost/container/allocator/allocator_traits.hpp>
+#include <boost/container/allocator_traits.hpp>
#ifdef BOOST_CONTAINER_PERFECT_FORWARDING
#include <boost/container/detail/variadic_templates_tools.hpp>
@@ -33,7 +33,7 @@
#include <iterator>
namespace boost {
-namespace container {
+namespace container {
template <class T, class Difference = std::ptrdiff_t>
class constant_iterator
@@ -50,9 +50,9 @@ class constant_iterator
constant_iterator()
: m_ptr(0), m_num(0){}
- constant_iterator& operator++()
+ constant_iterator& operator++()
{ increment(); return *this; }
-
+
constant_iterator operator++(int)
{
constant_iterator result (*this);
@@ -60,9 +60,9 @@ class constant_iterator
return result;
}
- constant_iterator& operator--()
+ constant_iterator& operator--()
{ decrement(); return *this; }
-
+
constant_iterator operator--(int)
{
constant_iterator result (*this);
@@ -161,9 +161,9 @@ class default_construct_iterator
default_construct_iterator()
: m_num(0){}
- default_construct_iterator& operator++()
+ default_construct_iterator& operator++()
{ increment(); return *this; }
-
+
default_construct_iterator operator++(int)
{
default_construct_iterator result (*this);
@@ -171,9 +171,9 @@ class default_construct_iterator
return result;
}
- default_construct_iterator& operator--()
+ default_construct_iterator& operator--()
{ decrement(); return *this; }
-
+
default_construct_iterator operator--(int)
{
default_construct_iterator result (*this);
@@ -247,7 +247,7 @@ class default_construct_iterator
{ return other.m_num < m_num; }
const T & dereference() const
- {
+ {
static T dummy;
return dummy;
}
@@ -273,9 +273,9 @@ class repeat_iterator
repeat_iterator()
: m_ptr(0), m_num(0){}
- this_type& operator++()
+ this_type& operator++()
{ increment(); return *this; }
-
+
this_type operator++(int)
{
this_type result (*this);
@@ -283,9 +283,9 @@ class repeat_iterator
return result;
}
- this_type& operator--()
+ this_type& operator--()
{ increment(); return *this; }
-
+
this_type operator--(int)
{
this_type result (*this);
@@ -384,9 +384,9 @@ class emplace_iterator
emplace_iterator()
: m_num(0), m_pe(0){}
- this_type& operator++()
+ this_type& operator++()
{ increment(); return *this; }
-
+
this_type operator++(int)
{
this_type result (*this);
@@ -394,9 +394,9 @@ class emplace_iterator
return result;
}
- this_type& operator--()
+ this_type& operator--()
{ decrement(); return *this; }
-
+
this_type operator--(int)
{
this_type result (*this);
@@ -475,7 +475,7 @@ class emplace_iterator
{ return other.m_num < m_num; }
const T & dereference() const
- {
+ {
static T dummy;
return dummy;
}
@@ -513,7 +513,7 @@ struct emplace_functor
container_detail::tuple<Args&...> args_;
};
-#else
+#else //#ifdef BOOST_CONTAINER_PERFECT_FORWARDING
#define BOOST_PP_LOCAL_MACRO(n) \
BOOST_PP_EXPR_IF(n, template <) \
@@ -522,16 +522,16 @@ struct emplace_functor
struct BOOST_PP_CAT(BOOST_PP_CAT(emplace_functor, n), arg) \
{ \
BOOST_PP_CAT(BOOST_PP_CAT(emplace_functor, n), arg) \
- ( BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _) ) \
- BOOST_PP_EXPR_IF(n, :) BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_INIT, _){} \
+ ( BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _) ) \
+ BOOST_PP_EXPR_IF(n, :) BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_INIT, _){} \
\
template<class A, class T> \
void operator()(A &a, T *ptr) \
{ \
allocator_traits<A>::construct \
- (a, ptr BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_MEMBER_FORWARD, _) );\
+ (a, ptr BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_MEMBER_FORWARD, _) ); \
} \
- BOOST_PP_REPEAT(n, BOOST_CONTAINER_PP_PARAM_DEFINE, _) \
+ BOOST_PP_REPEAT(n, BOOST_CONTAINER_PP_PARAM_DEFINE, _) \
}; \
//!
#define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS)
@@ -539,7 +539,7 @@ struct emplace_functor
#endif
-} //namespace container {
+} //namespace container {
} //namespace boost {
#include <boost/container/detail/config_end.hpp>
diff --git a/boost/container/detail/math_functions.hpp b/boost/container/detail/math_functions.hpp
index 4613573d48..fe8386be69 100644
--- a/boost/container/detail/math_functions.hpp
+++ b/boost/container/detail/math_functions.hpp
@@ -1,10 +1,10 @@
//////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Stephen Cleary 2000.
-// (C) Copyright Ion Gaztanaga 2007-2011.
+// (C) Copyright Ion Gaztanaga 2007-2012.
//
// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
+// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/container for documentation.
@@ -94,7 +94,7 @@ inline std::size_t floor_log2 (std::size_t x)
std::size_t n = x;
std::size_t log2 = 0;
-
+
for(std::size_t shift = Bits >> 1; shift; shift >>= 1){
std::size_t tmp = n >> shift;
if (tmp)
diff --git a/boost/container/allocator/memory_util.hpp b/boost/container/detail/memory_util.hpp
index ea4bc05548..c00172c60c 100644
--- a/boost/container/allocator/memory_util.hpp
+++ b/boost/container/detail/memory_util.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2011-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2011-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
diff --git a/boost/container/detail/mpl.hpp b/boost/container/detail/mpl.hpp
index c2d0ce41bb..74a1ce0e67 100644
--- a/boost/container/detail/mpl.hpp
+++ b/boost/container/detail/mpl.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2011.
+// (C) Copyright Ion Gaztanaga 2005-2012.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -20,7 +20,7 @@
#include <cstddef>
namespace boost {
-namespace container {
+namespace container {
namespace container_detail {
template <class T, T val>
@@ -109,24 +109,24 @@ struct if_
template <class Pair>
-struct select1st
-// : public std::unary_function<Pair, typename Pair::first_type>
+struct select1st
+// : public std::unary_function<Pair, typename Pair::first_type>
{
template<class OtherPair>
- const typename Pair::first_type& operator()(const OtherPair& x) const
+ const typename Pair::first_type& operator()(const OtherPair& x) const
{ return x.first; }
- const typename Pair::first_type& operator()(const typename Pair::first_type& x) const
+ const typename Pair::first_type& operator()(const typename Pair::first_type& x) const
{ return x; }
};
// identity is an extension: it is not part of the standard.
template <class T>
-struct identity
-// : public std::unary_function<T,T>
+struct identity
+// : public std::unary_function<T,T>
{
typedef T type;
- const T& operator()(const T& x) const
+ const T& operator()(const T& x) const
{ return x; }
};
@@ -152,8 +152,8 @@ template <typename T> struct unvoid { typedef T type; };
template <> struct unvoid<void> { struct type { }; };
template <> struct unvoid<const void> { struct type { }; };
-} //namespace container_detail {
-} //namespace container {
+} //namespace container_detail {
+} //namespace container {
} //namespace boost {
#endif //#ifndef BOOST_CONTAINER_CONTAINER_DETAIL_MPL_HPP
diff --git a/boost/container/detail/multiallocation_chain.hpp b/boost/container/detail/multiallocation_chain.hpp
index a67fd770bd..c9952535eb 100644
--- a/boost/container/detail/multiallocation_chain.hpp
+++ b/boost/container/detail/multiallocation_chain.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
diff --git a/boost/container/detail/node_alloc_holder.hpp b/boost/container/detail/node_alloc_holder.hpp
index 9b0a0a524b..9797f1fbd5 100644
--- a/boost/container/detail/node_alloc_holder.hpp
+++ b/boost/container/detail/node_alloc_holder.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -27,7 +27,7 @@
#include <boost/container/detail/version_type.hpp>
#include <boost/container/detail/type_traits.hpp>
#include <boost/container/detail/utilities.hpp>
-#include <boost/container/allocator/allocator_traits.hpp>
+#include <boost/container/allocator_traits.hpp>
#include <boost/container/detail/mpl.hpp>
#include <boost/container/detail/destroyers.hpp>
@@ -36,6 +36,7 @@
#endif
#include <boost/container/detail/algorithms.hpp>
+#include <new>
namespace boost {
@@ -188,11 +189,11 @@ struct node_alloc_holder
public:
//Constructors for sequence containers
- node_alloc_holder()
+ node_alloc_holder()
: members_()
{}
- explicit node_alloc_holder(const ValAlloc &a)
+ explicit node_alloc_holder(const ValAlloc &a)
: members_(a)
{}
@@ -205,7 +206,7 @@ struct node_alloc_holder
{ this->icont().swap(x.icont()); }
//Constructors for associative containers
- explicit node_alloc_holder(const ValAlloc &a, const Pred &c)
+ explicit node_alloc_holder(const ValAlloc &a, const Pred &c)
: members_(a, c)
{}
@@ -223,7 +224,7 @@ struct node_alloc_holder
{ this->icont().swap(x.icont()); }
void copy_assign_alloc(const node_alloc_holder &x)
- {
+ {
container_detail::bool_<allocator_traits_type::propagate_on_container_copy_assignment::value> flag;
container_detail::assign_alloc( static_cast<NodeAlloc &>(this->members_)
, static_cast<const NodeAlloc &>(x.members_), flag);
@@ -259,47 +260,21 @@ struct node_alloc_holder
void deallocate_one(const NodePtr &p, allocator_v2)
{ this->node_alloc().deallocate_one(p); }
-/*
- template<class A, class Convertible1, class Convertible2>
- static void construct(A &a, const NodePtr &ptr,
- BOOST_RV_REF_2_TEMPL_ARGS(std::pair, Convertible1, Convertible2) value)
- {
- typedef typename Node::hook_type hook_type;
- typedef typename Node::value_type::first_type first_type;
- typedef typename Node::value_type::second_type second_type;
- Node *nodeptr = container_detail::to_raw_pointer(ptr);
-
- //Hook constructor does not throw
- allocator_traits<A>::construct(a, static_cast<hook_type*>(nodeptr));
-
- //Now construct pair members_holder
- value_type *valueptr = &nodeptr->get_data();
- allocator_traits<A>::construct(a, &valueptr->first, boost::move(value.first));
- BOOST_TRY{
- allocator_traits<A>::construct(a, &valueptr->second, boost::move(value.second));
- }
- BOOST_CATCH(...){
- allocator_traits<A>::destroy(a, &valueptr->first);
- BOOST_RETHROW
- }
- BOOST_CATCH_END
- }
-*/
+
#ifdef BOOST_CONTAINER_PERFECT_FORWARDING
-/*
- template<class A, class ...Args>
- static void construct(A &a, const NodePtr &ptr, Args &&...args)
- {
- }
-*/
+
template<class ...Args>
NodePtr create_node(Args &&...args)
{
NodePtr p = this->allocate_one();
Deallocator node_deallocator(p, this->node_alloc());
allocator_traits<NodeAlloc>::construct
- (this->node_alloc(), container_detail::to_raw_pointer(p), boost::forward<Args>(args)...);
+ ( this->node_alloc()
+ , container_detail::addressof(p->m_data), boost::forward<Args>(args)...);
node_deallocator.release();
+ //This does not throw
+ typedef typename Node::hook_type hook_type;
+ ::new(static_cast<hook_type*>(container_detail::to_raw_pointer(p))) hook_type;
return (p);
}
@@ -313,9 +288,11 @@ struct node_alloc_holder
NodePtr p = this->allocate_one(); \
Deallocator node_deallocator(p, this->node_alloc()); \
allocator_traits<NodeAlloc>::construct \
- (this->node_alloc(), container_detail::to_raw_pointer(p) \
+ (this->node_alloc(), container_detail::addressof(p->m_data) \
BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)); \
node_deallocator.release(); \
+ typedef typename Node::hook_type hook_type; \
+ ::new(static_cast<hook_type*>(container_detail::to_raw_pointer(p))) hook_type; \
return (p); \
} \
//!
@@ -329,8 +306,11 @@ struct node_alloc_holder
{
NodePtr p = this->allocate_one();
Deallocator node_deallocator(p, this->node_alloc());
- ::boost::container::construct_in_place(this->node_alloc(), container_detail::to_raw_pointer(p), it);
+ ::boost::container::construct_in_place(this->node_alloc(), container_detail::addressof(p->m_data), it);
node_deallocator.release();
+ //This does not throw
+ typedef typename Node::hook_type hook_type;
+ ::new(static_cast<hook_type*>(container_detail::to_raw_pointer(p))) hook_type;
return (p);
}
@@ -364,8 +344,11 @@ struct node_alloc_holder
mem.pop_front();
//This can throw
constructed = 0;
- boost::container::construct_in_place(this->node_alloc(), p, beg);
+ boost::container::construct_in_place(this->node_alloc(), container_detail::addressof(p->m_data), beg);
++constructed;
+ //This does not throw
+ typedef typename Node::hook_type hook_type;
+ ::new(static_cast<hook_type*>(container_detail::to_raw_pointer(p))) hook_type;
//This can throw in some containers (predicate might throw)
inserter(*p);
}
diff --git a/boost/container/detail/node_pool_impl.hpp b/boost/container/detail/node_pool_impl.hpp
index 9ee9e311c0..63c1278238 100644
--- a/boost/container/detail/node_pool_impl.hpp
+++ b/boost/container/detail/node_pool_impl.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -86,12 +86,12 @@ class private_node_pool_impl
void *allocate_node()
{ return priv_alloc_node(); }
-
+
//!Deallocates an array pointed by ptr. Never throws
void deallocate_node(void *ptr)
{ priv_dealloc_node(ptr); }
- //!Allocates a singly linked list of n nodes ending in null pointer.
+ //!Allocates a singly linked list of n nodes ending in null pointer.
multiallocation_chain allocate_nodes(const size_type n)
{
//Preallocate all needed blocks to fulfill the request
@@ -238,7 +238,7 @@ class private_node_pool_impl
push_in_list(free_nodes_t &l, typename free_nodes_t::iterator &it)
: slist_(l), last_it_(it)
{}
-
+
void operator()(typename free_nodes_t::pointer p) const
{
slist_.push_front(*p);
@@ -258,10 +258,10 @@ class private_node_pool_impl
is_between(const void *addr, std::size_t size)
: beg_(static_cast<const char *>(addr)), end_(beg_+size)
{}
-
+
bool operator()(typename free_nodes_t::const_reference v) const
{
- return (beg_ <= reinterpret_cast<const char *>(&v) &&
+ return (beg_ <= reinterpret_cast<const char *>(&v) &&
end_ > reinterpret_cast<const char *>(&v));
}
private:
@@ -299,7 +299,7 @@ class private_node_pool_impl
{
if(!num_blocks)
return;
- size_type blocksize =
+ size_type blocksize =
get_rounded_size(m_real_node_size*m_nodes_per_block, (size_type)alignment_of<node_t>::value);
try{
@@ -311,7 +311,7 @@ class private_node_pool_impl
char *pBlock = pNode;
m_blocklist.push_front(get_block_hook(pBlock, blocksize));
- //We initialize all Nodes in Node Block to insert
+ //We initialize all Nodes in Node Block to insert
//them in the free Node list
for(size_type i = 0; i < m_nodes_per_block; ++i, pNode += m_real_node_size){
m_freelist.push_front(*new (pNode) node_t);
@@ -335,13 +335,13 @@ class private_node_pool_impl
private:
//!Returns a reference to the block hook placed in the end of the block
static node_t & get_block_hook (void *block, size_type blocksize)
- {
- return *reinterpret_cast<node_t*>(reinterpret_cast<char*>(block) + blocksize);
+ {
+ return *reinterpret_cast<node_t*>(reinterpret_cast<char*>(block) + blocksize);
}
//!Returns the starting address of the block reference to the block hook placed in the end of the block
void *get_block_from_hook (node_t *hook, size_type blocksize)
- {
+ {
return (reinterpret_cast<char*>(hook) - blocksize);
}
diff --git a/boost/container/detail/pair.hpp b/boost/container/detail/pair.hpp
index 1aeff91137..2a20ed13ec 100644
--- a/boost/container/detail/pair.hpp
+++ b/boost/container/detail/pair.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2011.
+// (C) Copyright Ion Gaztanaga 2005-2012.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -22,6 +22,8 @@
#include <boost/container/detail/mpl.hpp>
#include <boost/container/detail/type_traits.hpp>
+#include <boost/container/detail/mpl.hpp>
+#include <boost/container/detail/type_traits.hpp>
#include <utility> //std::pair
@@ -33,7 +35,7 @@
#endif
namespace boost {
-namespace container {
+namespace container {
namespace container_detail {
template <class T1, class T2>
@@ -62,6 +64,33 @@ struct pair_nat;
struct piecewise_construct_t { };
static const piecewise_construct_t piecewise_construct = piecewise_construct_t();
+/*
+template <class T1, class T2>
+struct pair
+{
+ template <class U, class V> pair(pair<U, V>&& p);
+ template <class... Args1, class... Args2>
+ pair(piecewise_construct_t, tuple<Args1...> first_args,
+ tuple<Args2...> second_args);
+
+ template <class U, class V> pair& operator=(const pair<U, V>& p);
+ pair& operator=(pair&& p) noexcept(is_nothrow_move_assignable<T1>::value &&
+ is_nothrow_move_assignable<T2>::value);
+ template <class U, class V> pair& operator=(pair<U, V>&& p);
+
+ void swap(pair& p) noexcept(noexcept(swap(first, p.first)) &&
+ noexcept(swap(second, p.second)));
+};
+
+template <class T1, class T2> bool operator==(const pair<T1,T2>&, const pair<T1,T2>&);
+template <class T1, class T2> bool operator!=(const pair<T1,T2>&, const pair<T1,T2>&);
+template <class T1, class T2> bool operator< (const pair<T1,T2>&, const pair<T1,T2>&);
+template <class T1, class T2> bool operator> (const pair<T1,T2>&, const pair<T1,T2>&);
+template <class T1, class T2> bool operator>=(const pair<T1,T2>&, const pair<T1,T2>&);
+template <class T1, class T2> bool operator<=(const pair<T1,T2>&, const pair<T1,T2>&);
+*/
+
+
template <class T1, class T2>
struct pair
{
@@ -79,47 +108,40 @@ struct pair
pair()
: first(), second()
{}
-/*
- //pair from two values
- pair(const T1 &t1, const T2 &t2)
- : first(t1)
- , second(t2)
- {}
-
-
- //pair from two values
- pair(BOOST_RV_REF(T1) t1, BOOST_RV_REF(T2) t2)
- : first(::boost::move(t1))
- , second(::boost::move(t2))
- {}
-*/
- template<class U, class V>
- pair(BOOST_FWD_REF(U) u, BOOST_FWD_REF(V) v)
- : first(::boost::forward<U>(u))
- , second(::boost::forward<V>(v))
- {}
//pair copy assignment
pair(const pair& x)
: first(x.first), second(x.second)
{}
+ //pair move constructor
+ pair(BOOST_RV_REF(pair) p)
+ : first(::boost::move(p.first)), second(::boost::move(p.second))
+ {}
+
template <class D, class S>
pair(const pair<D, S> &p)
: first(p.first), second(p.second)
{}
- //pair move constructor
- pair(BOOST_RV_REF(pair) p)
+ template <class D, class S>
+ pair(BOOST_RV_REF_BEG pair<D, S> BOOST_RV_REF_END p)
: first(::boost::move(p.first)), second(::boost::move(p.second))
{}
- template <class D, class S>
- pair(BOOST_RV_REF_2_TEMPL_ARGS(pair, D, S) p)
- : first(::boost::move(p.first)), second(::boost::move(p.second))
+ //pair from two values
+ pair(const T1 &t1, const T2 &t2)
+ : first(t1)
+ , second(t2)
+ {}
+
+ template<class U, class V>
+ pair(BOOST_FWD_REF(U) u, BOOST_FWD_REF(V) v)
+ : first(::boost::forward<U>(u))
+ , second(::boost::forward<V>(v))
{}
- //std::pair copy constructor
+ //And now compatibility with std::pair
pair(const std::pair<T1, T2>& x)
: first(x.first), second(x.second)
{}
@@ -129,17 +151,20 @@ struct pair
: first(p.first), second(p.second)
{}
- //std::pair move constructor
- template <class D, class S>
- pair(BOOST_RV_REF_2_TEMPL_ARGS(std::pair, D, S) p)
+ pair(BOOST_RV_REF_BEG std::pair<T1, T2> BOOST_RV_REF_END p)
: first(::boost::move(p.first)), second(::boost::move(p.second))
{}
- pair(BOOST_RV_REF_2_TEMPL_ARGS(std::pair, T1, T2) p)
+ template <class D, class S>
+ pair(BOOST_RV_REF_BEG std::pair<D, S> BOOST_RV_REF_END p)
: first(::boost::move(p.first)), second(::boost::move(p.second))
{}
//piecewise_construct missing
+ //template <class U, class V> pair(pair<U, V>&& p);
+ //template <class... Args1, class... Args2>
+ // pair(piecewise_construct_t, tuple<Args1...> first_args,
+ // tuple<Args2...> second_args);
/*
//Variadic versions
template<class U>
@@ -179,14 +204,6 @@ struct pair
return *this;
}
- template <class D, class S>
- pair& operator=(const pair<D, S>&p)
- {
- first = p.first;
- second = p.second;
- return *this;
- }
-
//pair move assignment
pair& operator=(BOOST_RV_REF(pair) p)
{
@@ -196,7 +213,23 @@ struct pair
}
template <class D, class S>
- pair& operator=(BOOST_RV_REF_2_TEMPL_ARGS(pair, D, S) p)
+ typename ::boost::container::container_detail::enable_if_c
+ < !(::boost::container::container_detail::is_same<T1, D>::value &&
+ ::boost::container::container_detail::is_same<T2, S>::value)
+ , pair &>::type
+ operator=(const pair<D, S>&p)
+ {
+ first = p.first;
+ second = p.second;
+ return *this;
+ }
+
+ template <class D, class S>
+ typename ::boost::container::container_detail::enable_if_c
+ < !(::boost::container::container_detail::is_same<T1, D>::value &&
+ ::boost::container::container_detail::is_same<T2, S>::value)
+ , pair &>::type
+ operator=(BOOST_RV_REF_BEG pair<D, S> BOOST_RV_REF_END p)
{
first = ::boost::move(p.first);
second = ::boost::move(p.second);
@@ -220,7 +253,7 @@ struct pair
}
//std::pair move assignment
- pair& operator=(BOOST_RV_REF_2_TEMPL_ARGS(std::pair, T1, T2) p)
+ pair& operator=(BOOST_RV_REF_BEG std::pair<T1, T2> BOOST_RV_REF_END p)
{
first = ::boost::move(p.first);
second = ::boost::move(p.second);
@@ -228,7 +261,7 @@ struct pair
}
template <class D, class S>
- pair& operator=(BOOST_RV_REF_2_TEMPL_ARGS(std::pair, D, S) p)
+ pair& operator=(BOOST_RV_REF_BEG std::pair<D, S> BOOST_RV_REF_END p)
{
first = ::boost::move(p.first);
second = ::boost::move(p.second);
@@ -280,8 +313,8 @@ inline void swap(pair<T1, T2>& x, pair<T1, T2>& y)
swap(x.second, y.second);
}
-} //namespace container_detail {
-} //namespace container {
+} //namespace container_detail {
+} //namespace container {
//Without this specialization recursive flat_(multi)map instantiation fails
diff --git a/boost/container/detail/pool_common.hpp b/boost/container/detail/pool_common.hpp
index c66e2cd18c..500b9124d5 100644
--- a/boost/container/detail/pool_common.hpp
+++ b/boost/container/detail/pool_common.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
diff --git a/boost/container/detail/preprocessor.hpp b/boost/container/detail/preprocessor.hpp
index 9916fbac62..1818094be1 100644
--- a/boost/container/detail/preprocessor.hpp
+++ b/boost/container/detail/preprocessor.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2008-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2008-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -27,7 +27,7 @@
//#error "This file is not needed when perfect forwarding is available"
#endif //BOOST_CONTAINER_PERFECT_FORWARDING
-#include <boost/preprocessor/iteration/local.hpp>
+#include <boost/preprocessor/iteration/local.hpp>
#include <boost/preprocessor/punctuation/paren_if.hpp>
#include <boost/preprocessor/punctuation/comma_if.hpp>
#include <boost/preprocessor/control/expr_if.hpp>
@@ -62,6 +62,10 @@
//!
#endif //#ifndef BOOST_NO_RVALUE_REFERENCES
+#define BOOST_CONTAINER_PP_CONST_REF_PARAM_LIST_Q(z, n, Data) \
+const BOOST_PP_CAT(Q, n) & BOOST_PP_CAT(q, n) \
+//!
+
#ifndef BOOST_NO_RVALUE_REFERENCES
#define BOOST_CONTAINER_PP_PARAM(U, u) \
U && u \
@@ -74,17 +78,16 @@
#ifndef BOOST_NO_RVALUE_REFERENCES
- #ifdef BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES
+ #if defined(BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG)
- #define BOOST_CONTAINER_PP_PARAM_INIT(z, n, data) \
- BOOST_PP_CAT(m_p, n) (boost::forward< BOOST_PP_CAT(P, n) >( BOOST_PP_CAT(p, n) )) \
- //!
+ #define BOOST_CONTAINER_PP_PARAM_INIT(z, n, data) \
+ BOOST_PP_CAT(m_p, n) (static_cast<BOOST_PP_CAT(P, n)>( BOOST_PP_CAT(p, n) )) \
- #else //BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES
+ #else //#if defined(BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG)
- #define BOOST_CONTAINER_PP_PARAM_INIT(z, n, data) \
- BOOST_PP_CAT(m_p, n) (static_cast<BOOST_PP_CAT(P, n)>( BOOST_PP_CAT(p, n) )) \
- //!
+ #define BOOST_CONTAINER_PP_PARAM_INIT(z, n, data) \
+ BOOST_PP_CAT(m_p, n) (::boost::forward< BOOST_PP_CAT(P, n) >( BOOST_PP_CAT(p, n) )) \
+ //!
#endif //BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES
@@ -127,7 +130,7 @@
#else //!defined(BOOST_NO_RVALUE_REFERENCES) && defined(BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG)
#define BOOST_CONTAINER_PP_MEMBER_FORWARD(z, n, data) \
- boost::forward< BOOST_PP_CAT(P, n) >( BOOST_PP_CAT(this->m_p, n) ) \
+ ::boost::forward< BOOST_PP_CAT(P, n) >( BOOST_PP_CAT(this->m_p, n) ) \
//!
#endif //!defined(BOOST_NO_RVALUE_REFERENCES) && defined(BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG)
@@ -140,11 +143,11 @@
#define BOOST_CONTAINER_PP_PARAM_FORWARD(z, n, data) \
-boost::forward< BOOST_PP_CAT(P, n) >( BOOST_PP_CAT(p, n) ) \
+::boost::forward< BOOST_PP_CAT(P, n) >( BOOST_PP_CAT(p, n) ) \
//!
#define BOOST_CONTAINER_PP_DECLVAL(z, n, data) \
-boost::move_detail::declval< BOOST_PP_CAT(P, n) >() \
+::boost::move_detail::declval< BOOST_PP_CAT(P, n) >() \
//!
#define BOOST_CONTAINER_PP_MEMBER_IT_FORWARD(z, n, data) \
@@ -152,7 +155,11 @@ BOOST_PP_CAT(*this->m_p, n) \
//!
#define BOOST_CONTAINER_PP_TEMPLATE_PARAM_VOID_DEFAULT(z, n, data) \
- BOOST_PP_CAT(class P, n) = void \
+ BOOST_PP_CAT(class P, n) = void \
+//!
+
+#define BOOST_CONTAINER_PP_TEMPLATE_PARAM_WITH_DEFAULT(z, n, default_type) \
+ BOOST_PP_CAT(class P, n) = default_type \
//!
#define BOOST_CONTAINER_PP_STATIC_PARAM_REF_DECLARE(z, n, data) \
diff --git a/boost/container/detail/stored_ref.hpp b/boost/container/detail/stored_ref.hpp
index df0faa85a0..80fda89615 100644
--- a/boost/container/detail/stored_ref.hpp
+++ b/boost/container/detail/stored_ref.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2008-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2008-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
diff --git a/boost/container/detail/transform_iterator.hpp b/boost/container/detail/transform_iterator.hpp
index 17eca9ef61..98f5c04d60 100644
--- a/boost/container/detail/transform_iterator.hpp
+++ b/boost/container/detail/transform_iterator.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2011.
+// (C) Copyright Ion Gaztanaga 2005-2012.
// (C) Copyright Gennaro Prota 2003 - 2004.
//
// Distributed under the Boost Software License, Version 1.0.
@@ -24,7 +24,7 @@
#include <iterator>
namespace boost {
-namespace container {
+namespace container {
template <class PseudoReference>
struct operator_arrow_proxy
@@ -74,7 +74,7 @@ class transform_iterator
{}
//Constructors
- transform_iterator& operator++()
+ transform_iterator& operator++()
{ increment(); return *this; }
transform_iterator operator++(int)
@@ -168,7 +168,7 @@ make_transform_iterator(Iterator it, UnaryFunc fun)
return transform_iterator<Iterator, UnaryFunc>(it, fun);
}
-} //namespace container {
+} //namespace container {
} //namespace boost {
#include <boost/container/detail/config_end.hpp>
diff --git a/boost/container/detail/tree.hpp b/boost/container/detail/tree.hpp
index 6cd91ed2a6..3ab1536204 100644
--- a/boost/container/detail/tree.hpp
+++ b/boost/container/detail/tree.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -27,7 +27,7 @@
#include <boost/container/detail/destroyers.hpp>
#include <boost/container/detail/pair.hpp>
#include <boost/container/detail/type_traits.hpp>
-#include <boost/container/allocator/allocator_traits.hpp>
+#include <boost/container/allocator_traits.hpp>
#ifndef BOOST_CONTAINER_PERFECT_FORWARDING
#include <boost/container/detail/preprocessor.hpp>
#endif
@@ -45,7 +45,7 @@ struct value_compare_impl
: public KeyCompare
{
typedef Value value_type;
- typedef KeyCompare key_compare;
+ typedef KeyCompare key_compare;
typedef KeyOfValue key_of_value;
typedef Key key_type;
@@ -90,70 +90,38 @@ struct rbtree_hook
>::type type;
};
+//This trait is used to type-pun std::pair because in C++03
+//compilers std::pair is useless for C++11 features
template<class T>
-struct rbtree_type
+struct rbtree_internal_data_type
{
typedef T type;
};
template<class T1, class T2>
-struct rbtree_type< std::pair<T1, T2> >
+struct rbtree_internal_data_type< std::pair<T1, T2> >
{
typedef pair<T1, T2> type;
};
+
+//The node to be store in the tree
template <class T, class VoidPointer>
struct rbtree_node
: public rbtree_hook<VoidPointer>::type
{
private:
- BOOST_COPYABLE_AND_MOVABLE(rbtree_node)
+ //BOOST_COPYABLE_AND_MOVABLE(rbtree_node)
+ rbtree_node();
public:
typedef typename rbtree_hook<VoidPointer>::type hook_type;
typedef T value_type;
- typedef typename rbtree_type<T>::type internal_type;
+ typedef typename rbtree_internal_data_type<T>::type internal_type;
typedef rbtree_node<T, VoidPointer> node_type;
- rbtree_node()
- : m_data()
- {}
-
- rbtree_node(const rbtree_node &other)
- : m_data(other.m_data)
- {}
-
- rbtree_node(BOOST_RV_REF(rbtree_node) other)
- : m_data(boost::move(other.m_data))
- {}
-
- #ifndef BOOST_CONTAINER_PERFECT_FORWARDING
-
- #define BOOST_PP_LOCAL_MACRO(n) \
- template<BOOST_PP_ENUM_PARAMS(n, class P)> \
- rbtree_node(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \
- : m_data(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)) \
- {} \
- //!
- #define BOOST_PP_LOCAL_LIMITS (1, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS)
- #include BOOST_PP_LOCAL_ITERATE()
-
- #else //#ifndef BOOST_CONTAINER_PERFECT_FORWARDING
-
- template<class ...Args>
- rbtree_node(Args &&...args)
- : m_data(boost::forward<Args>(args)...)
- {}
- #endif//#ifndef BOOST_CONTAINER_PERFECT_FORWARDING
-
- rbtree_node &operator=(const rbtree_node &other)
- { do_assign(other.m_data); return *this; }
-
- rbtree_node &operator=(BOOST_RV_REF(rbtree_node) other)
- { do_move(other.m_data); return *this; }
-
T &get_data()
{
T* ptr = reinterpret_cast<T*>(&this->m_data);
@@ -166,7 +134,6 @@ struct rbtree_node
return *ptr;
}
- private:
internal_type m_data;
template<class A, class B>
@@ -188,22 +155,22 @@ struct rbtree_node
{ m_data = v; }
template<class A, class B>
- void do_move(std::pair<const A, B> &p)
+ void do_move_assign(std::pair<const A, B> &p)
{
- const_cast<A&>(m_data.first) = boost::move(p.first);
- m_data.second = boost::move(p.second);
+ const_cast<A&>(m_data.first) = ::boost::move(p.first);
+ m_data.second = ::boost::move(p.second);
}
template<class A, class B>
- void do_move(pair<const A, B> &p)
+ void do_move_assign(pair<const A, B> &p)
{
- const_cast<A&>(m_data.first) = boost::move(p.first);
- m_data.second = boost::move(p.second);
+ const_cast<A&>(m_data.first) = ::boost::move(p.first);
+ m_data.second = ::boost::move(p.second);
}
template<class V>
- void do_move(V &v)
- { m_data = boost::move(v); }
+ void do_move_assign(V &v)
+ { m_data = ::boost::move(v); }
};
}//namespace container_detail {
@@ -236,13 +203,13 @@ struct intrusive_rbtree_type
namespace container_detail {
-template <class Key, class Value, class KeyOfValue,
+template <class Key, class Value, class KeyOfValue,
class KeyCompare, class A>
class rbtree
: protected container_detail::node_alloc_holder
< A
, typename container_detail::intrusive_rbtree_type
- <A, value_compare_impl<Key, Value, KeyCompare, KeyOfValue>
+ <A, value_compare_impl<Key, Value, KeyCompare, KeyOfValue>
>::type
, KeyCompare
>
@@ -251,7 +218,7 @@ class rbtree
< A, value_compare_impl
<Key, Value, KeyCompare, KeyOfValue>
>::type Icont;
- typedef container_detail::node_alloc_holder
+ typedef container_detail::node_alloc_holder
<A, Icont, KeyCompare> AllocHolder;
typedef typename AllocHolder::NodePtr NodePtr;
typedef rbtree < Key, Value, KeyOfValue
@@ -282,7 +249,7 @@ class rbtree
//First recycle a node (this can't throw)
try{
//This can throw
- *p = other;
+ p->do_assign(other.m_data);
return p;
}
catch(...){
@@ -295,7 +262,7 @@ class rbtree
}
}
else{
- return m_holder.create_node(other);
+ return m_holder.create_node(other.m_data);
}
}
@@ -319,7 +286,7 @@ class rbtree
//First recycle a node (this can't throw)
try{
//This can throw
- *p = boost::move(other);
+ p->do_move_assign(const_cast<Node &>(other).m_data);
return p;
}
catch(...){
@@ -332,7 +299,7 @@ class rbtree
}
}
else{
- return m_holder.create_node(other);
+ return m_holder.create_node(other.m_data);
}
}
@@ -431,17 +398,17 @@ class rbtree
{}
//Pointer like operators
- const_reference operator*() const
+ const_reference operator*() const
{ return m_it->get_data(); }
- const_pointer operator->() const
+ const_pointer operator->() const
{ return const_pointer(&m_it->get_data()); }
//Increment / Decrement
- const_iterator& operator++()
+ const_iterator& operator++()
{ prot_incr(); return *this; }
- const_iterator operator++(int)
+ const_iterator operator++(int)
{ iiterator tmp = m_it; ++*this; return const_iterator(tmp); }
const_iterator& operator--()
@@ -465,7 +432,7 @@ class rbtree
explicit iterator(iiterator it)
: const_iterator(it)
{}
-
+
iiterator get()
{ return this->m_it; }
@@ -478,16 +445,18 @@ class rbtree
iterator(){}
//Pointer like operators
- reference operator*() const { return this->m_it->get_data(); }
- pointer operator->() const { return pointer(&this->m_it->get_data()); }
+ reference operator*() const
+ { return this->m_it->get_data(); }
+ pointer operator->() const
+ { return boost::intrusive::pointer_traits<pointer>::pointer_to(this->m_it->get_data()); }
//Increment / Decrement
- iterator& operator++()
+ iterator& operator++()
{ this->prot_incr(); return *this; }
iterator operator++(int)
{ iiterator tmp = this->m_it; ++*this; return iterator(tmp); }
-
+
iterator& operator--()
{ this->prot_decr(); return *this; }
@@ -524,17 +493,36 @@ class rbtree
priv_create_and_insert_ordered_nodes(first, last, alloc_version(), ItCat());
}
- rbtree(const rbtree& x)
+ rbtree(const rbtree& x)
: AllocHolder(x, x.key_comp())
{
this->icont().clone_from
(x.icont(), typename AllocHolder::cloner(*this), Destroyer(this->node_alloc()));
}
- rbtree(BOOST_RV_REF(rbtree) x)
- : AllocHolder(boost::move(static_cast<AllocHolder&>(x)), x.key_comp())
+ rbtree(BOOST_RV_REF(rbtree) x)
+ : AllocHolder(::boost::move(static_cast<AllocHolder&>(x)), x.key_comp())
{}
+ rbtree(const rbtree& x, const allocator_type &a)
+ : AllocHolder(a, x.key_comp())
+ {
+ this->icont().clone_from
+ (x.icont(), typename AllocHolder::cloner(*this), Destroyer(this->node_alloc()));
+ }
+
+ rbtree(BOOST_RV_REF(rbtree) x, const allocator_type &a)
+ : AllocHolder(a, x.key_comp())
+ {
+ if(this->node_alloc() == x.node_alloc()){
+ this->icont().swap(x.icont());
+ }
+ else{
+ this->icont().clone_from
+ (x.icont(), typename AllocHolder::cloner(*this), Destroyer(this->node_alloc()));
+ }
+ }
+
~rbtree()
{} //AllocHolder clears the tree
@@ -552,7 +540,7 @@ class rbtree
//Transfer all the nodes to a temporary tree
//If anything goes wrong, all the nodes will be destroyed
//automatically
- Icont other_tree(boost::move(this->icont()));
+ Icont other_tree(::boost::move(this->icont()));
//Now recreate the source tree reusing nodes stored by other_tree
this->icont().clone_from
@@ -578,7 +566,7 @@ class rbtree
if(this_alloc == x_alloc){
//Destroy and swap pointers
this->clear();
- this->icont() = boost::move(x.icont());
+ this->icont() = ::boost::move(x.icont());
//Move allocator if needed
this->AllocHolder::move_assign_alloc(x);
}
@@ -587,7 +575,7 @@ class rbtree
//Transfer all the nodes to a temporary tree
//If anything goes wrong, all the nodes will be destroyed
//automatically
- Icont other_tree(boost::move(this->icont()));
+ Icont other_tree(::boost::move(this->icont()));
//Now recreate the source tree reusing nodes stored by other_tree
this->icont().clone_from
@@ -605,18 +593,18 @@ class rbtree
return *this;
}
- public:
+ public:
// accessors:
- value_compare value_comp() const
+ value_compare value_comp() const
{ return this->icont().value_comp().value_comp(); }
- key_compare key_comp() const
+ key_compare key_comp() const
{ return this->icont().value_comp().value_comp().key_comp(); }
- allocator_type get_allocator() const
+ allocator_type get_allocator() const
{ return allocator_type(this->node_alloc()); }
- const stored_allocator_type &get_stored_allocator() const
+ const stored_allocator_type &get_stored_allocator() const
{ return this->node_alloc(); }
stored_allocator_type &get_stored_allocator()
@@ -647,46 +635,46 @@ class rbtree
{ return this->crend(); }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator cbegin() const
+ const_iterator cbegin() const
{ return const_iterator(this->non_const_icont().begin()); }
//! <b>Effects</b>: Returns a const_iterator to the end of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator cend() const
+ const_iterator cend() const
{ return const_iterator(this->non_const_icont().end()); }
- //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
- //! of the reversed container.
- //!
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator crbegin() const
- { return const_reverse_iterator(cend()); }
+ const_reverse_iterator crbegin() const
+ { return const_reverse_iterator(cend()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
- //! of the reversed container.
- //!
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator crend() const
+ const_reverse_iterator crend() const
{ return const_reverse_iterator(cbegin()); }
- bool empty() const
+ bool empty() const
{ return !this->size(); }
- size_type size() const
+ size_type size() const
{ return this->icont().size(); }
- size_type max_size() const
+ size_type max_size() const
{ return AllocHolder::max_size(); }
void swap(ThisType& x)
@@ -700,7 +688,7 @@ class rbtree
std::pair<iterator,bool> insert_unique_check
(const key_type& key, insert_commit_data &data)
{
- std::pair<iiterator, bool> ret =
+ std::pair<iiterator, bool> ret =
this->icont().insert_unique_check(key, KeyNodeCompare(value_comp()), data);
return std::pair<iterator, bool>(iterator(ret.first), ret.second);
}
@@ -708,7 +696,7 @@ class rbtree
std::pair<iterator,bool> insert_unique_check
(const_iterator hint, const key_type& key, insert_commit_data &data)
{
- std::pair<iiterator, bool> ret =
+ std::pair<iiterator, bool> ret =
this->icont().insert_unique_check(hint.get(), key, KeyNodeCompare(value_comp()), data);
return std::pair<iterator, bool>(iterator(ret.first), ret.second);
}
@@ -757,12 +745,14 @@ class rbtree
{
value_type &v = p->get_data();
insert_commit_data data;
+ scoped_destroy_deallocator<NodeAlloc> destroy_deallocator(p, this->node_alloc());
std::pair<iterator,bool> ret =
this->insert_unique_check(KeyOfValue()(v), data);
if(!ret.second){
- Destroyer(this->node_alloc())(p);
return ret;
}
+ //No throw insertion part, release rollback
+ destroy_deallocator.release();
return std::pair<iterator,bool>
( iterator(iiterator(this->icont().insert_unique_commit(*p, data)))
, true );
@@ -872,9 +862,9 @@ class rbtree
if(this->empty()){
//Insert with end hint, to achieve linear
//complexity if [first, last) is ordered
- const_iterator end(this->end());
+ const_iterator hint(this->cend());
for( ; first != last; ++first)
- this->insert_unique(end, *first);
+ hint = this->insert_unique(hint, *first);
}
else{
for( ; first != last; ++first)
@@ -913,9 +903,9 @@ class rbtree
{
//Insert with end hint, to achieve linear
//complexity if [first, last) is ordered
- const_iterator end(this->cend());
+ const_iterator hint(this->cend());
for( ; first != last; ++first)
- this->insert_equal(end, *first);
+ hint = this->insert_equal(hint, *first);
}
iterator erase(const_iterator position)
@@ -927,7 +917,7 @@ class rbtree
iterator erase(const_iterator first, const_iterator last)
{ return iterator(AllocHolder::erase_range(first.get(), last.get(), alloc_version())); }
- void clear()
+ void clear()
{ AllocHolder::clear(alloc_version()); }
// set operations:
@@ -953,14 +943,14 @@ class rbtree
{ return const_iterator(this->non_const_icont().upper_bound(k, KeyNodeCompare(value_comp()))); }
std::pair<iterator,iterator> equal_range(const key_type& k)
- {
+ {
std::pair<iiterator, iiterator> ret =
this->icont().equal_range(k, KeyNodeCompare(value_comp()));
return std::pair<iterator,iterator>(iterator(ret.first), iterator(ret.second));
}
std::pair<const_iterator, const_iterator> equal_range(const key_type& k) const
- {
+ {
std::pair<iiterator, iiterator> ret =
this->non_const_icont().equal_range(k, KeyNodeCompare(value_comp()));
return std::pair<const_iterator,const_iterator>
@@ -1072,63 +1062,63 @@ class rbtree
}
};
-template <class Key, class Value, class KeyOfValue,
+template <class Key, class Value, class KeyOfValue,
class KeyCompare, class A>
-inline bool
-operator==(const rbtree<Key,Value,KeyOfValue,KeyCompare,A>& x,
+inline bool
+operator==(const rbtree<Key,Value,KeyOfValue,KeyCompare,A>& x,
const rbtree<Key,Value,KeyOfValue,KeyCompare,A>& y)
{
return x.size() == y.size() &&
std::equal(x.begin(), x.end(), y.begin());
}
-template <class Key, class Value, class KeyOfValue,
+template <class Key, class Value, class KeyOfValue,
class KeyCompare, class A>
-inline bool
-operator<(const rbtree<Key,Value,KeyOfValue,KeyCompare,A>& x,
+inline bool
+operator<(const rbtree<Key,Value,KeyOfValue,KeyCompare,A>& x,
const rbtree<Key,Value,KeyOfValue,KeyCompare,A>& y)
{
- return std::lexicographical_compare(x.begin(), x.end(),
+ return std::lexicographical_compare(x.begin(), x.end(),
y.begin(), y.end());
}
-template <class Key, class Value, class KeyOfValue,
+template <class Key, class Value, class KeyOfValue,
class KeyCompare, class A>
-inline bool
-operator!=(const rbtree<Key,Value,KeyOfValue,KeyCompare,A>& x,
+inline bool
+operator!=(const rbtree<Key,Value,KeyOfValue,KeyCompare,A>& x,
const rbtree<Key,Value,KeyOfValue,KeyCompare,A>& y) {
return !(x == y);
}
-template <class Key, class Value, class KeyOfValue,
+template <class Key, class Value, class KeyOfValue,
class KeyCompare, class A>
-inline bool
-operator>(const rbtree<Key,Value,KeyOfValue,KeyCompare,A>& x,
+inline bool
+operator>(const rbtree<Key,Value,KeyOfValue,KeyCompare,A>& x,
const rbtree<Key,Value,KeyOfValue,KeyCompare,A>& y) {
return y < x;
}
-template <class Key, class Value, class KeyOfValue,
+template <class Key, class Value, class KeyOfValue,
class KeyCompare, class A>
-inline bool
-operator<=(const rbtree<Key,Value,KeyOfValue,KeyCompare,A>& x,
+inline bool
+operator<=(const rbtree<Key,Value,KeyOfValue,KeyCompare,A>& x,
const rbtree<Key,Value,KeyOfValue,KeyCompare,A>& y) {
return !(y < x);
}
-template <class Key, class Value, class KeyOfValue,
+template <class Key, class Value, class KeyOfValue,
class KeyCompare, class A>
-inline bool
-operator>=(const rbtree<Key,Value,KeyOfValue,KeyCompare,A>& x,
+inline bool
+operator>=(const rbtree<Key,Value,KeyOfValue,KeyCompare,A>& x,
const rbtree<Key,Value,KeyOfValue,KeyCompare,A>& y) {
return !(x < y);
}
-template <class Key, class Value, class KeyOfValue,
+template <class Key, class Value, class KeyOfValue,
class KeyCompare, class A>
-inline void
-swap(rbtree<Key,Value,KeyOfValue,KeyCompare,A>& x,
+inline void
+swap(rbtree<Key,Value,KeyOfValue,KeyCompare,A>& x,
rbtree<Key,Value,KeyOfValue,KeyCompare,A>& y)
{
x.swap(y);
@@ -1139,7 +1129,7 @@ swap(rbtree<Key,Value,KeyOfValue,KeyCompare,A>& x,
/*
//!has_trivial_destructor_after_move<> == true_type
//!specialization for optimizations
-template <class K, class V, class KOV,
+template <class K, class V, class KOV,
class C, class A>
struct has_trivial_destructor_after_move
<boost::container::container_detail::rbtree<K, V, KOV, C, A> >
diff --git a/boost/container/detail/type_traits.hpp b/boost/container/detail/type_traits.hpp
index 6a0b3ed58d..0e096e54e3 100644
--- a/boost/container/detail/type_traits.hpp
+++ b/boost/container/detail/type_traits.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
// (C) Copyright John Maddock 2000.
-// (C) Copyright Ion Gaztanaga 2005-2011.
+// (C) Copyright Ion Gaztanaga 2005-2012.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -24,11 +24,18 @@
#include <boost/move/move.hpp>
namespace boost {
-namespace container {
+namespace container {
namespace container_detail {
struct nat{};
+template <typename U>
+struct LowPriorityConversion
+{
+ // Convertible from T with user-defined-conversion rank.
+ LowPriorityConversion(const U&) { }
+};
+
//boost::alignment_of yields to 10K lines of preprocessed code, so we
//need an alternative
template <typename T> struct alignment_of;
@@ -195,7 +202,7 @@ struct remove_ref_const
};
} // namespace container_detail
-} //namespace container {
+} //namespace container {
} //namespace boost {
#include <boost/container/detail/config_end.hpp>
diff --git a/boost/container/detail/utilities.hpp b/boost/container/detail/utilities.hpp
index ee0fe993b2..152b5e162e 100644
--- a/boost/container/detail/utilities.hpp
+++ b/boost/container/detail/utilities.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -21,13 +21,23 @@
#include <boost/move/move.hpp>
#include <boost/container/detail/mpl.hpp>
#include <boost/container/detail/type_traits.hpp>
-#include <boost/container/allocator/allocator_traits.hpp>
+#include <boost/container/allocator_traits.hpp>
#include <algorithm>
namespace boost {
namespace container {
namespace container_detail {
+template <typename T>
+inline T* addressof(T& obj)
+{
+ return static_cast<T*>(
+ static_cast<void*>(
+ const_cast<char*>(
+ &reinterpret_cast<const char&>(obj)
+ )));
+}
+
template<class T>
const T &max_value(const T &a, const T &b)
{ return a > b ? a : b; }
@@ -140,7 +150,7 @@ enum {
&& !::boost::is_fundamental<_TypeT>::value
};
-};
+};
*/
template<class T>
@@ -223,7 +233,7 @@ F uninitialized_copy_alloc(A &a, I f, I l, F r)
template
<typename A,
typename F, // F models ForwardIterator
- typename T>
+ typename T>
void uninitialized_fill_alloc(A &a, F f, F l, const T &t)
{
while (f != l) {
@@ -262,6 +272,7 @@ F uninitialized_copy_or_move_alloc
return ::boost::container::uninitialized_copy_alloc(a, f, l, r);
}
+
} //namespace container {
} //namespace boost {
diff --git a/boost/container/detail/value_init.hpp b/boost/container/detail/value_init.hpp
index afbc9c1e34..ec1a99c56d 100644
--- a/boost/container/detail/value_init.hpp
+++ b/boost/container/detail/value_init.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2011.
+// (C) Copyright Ion Gaztanaga 2005-2012.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -21,7 +21,7 @@
#include <boost/container/detail/workaround.hpp>
namespace boost {
-namespace container {
+namespace container {
namespace container_detail {
template<class T>
@@ -36,8 +36,8 @@ struct value_init
T m_t;
};
-} //namespace container_detail {
-} //namespace container {
+} //namespace container_detail {
+} //namespace container {
} //namespace boost {
#include <boost/container/detail/config_end.hpp>
diff --git a/boost/container/detail/variadic_templates_tools.hpp b/boost/container/detail/variadic_templates_tools.hpp
index f21f972ab1..d903dfa04c 100644
--- a/boost/container/detail/variadic_templates_tools.hpp
+++ b/boost/container/detail/variadic_templates_tools.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2008-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2008-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -21,7 +21,7 @@
#include <cstddef> //std::size_t
namespace boost {
-namespace container {
+namespace container {
namespace container_detail {
template<typename... Values>
@@ -136,7 +136,7 @@ struct index_tuple{};
template<std::size_t Num, typename Tuple = index_tuple<> >
struct build_number_seq;
-template<std::size_t Num, int... Indexes>
+template<std::size_t Num, int... Indexes>
struct build_number_seq<Num, index_tuple<Indexes...> >
: build_number_seq<Num - 1, index_tuple<Indexes..., sizeof...(Indexes)> >
{};
diff --git a/boost/container/detail/version_type.hpp b/boost/container/detail/version_type.hpp
index 46344faca0..e47ba26f12 100644
--- a/boost/container/detail/version_type.hpp
+++ b/boost/container/detail/version_type.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -38,7 +38,7 @@ struct version_type
namespace impl{
-template <class T,
+template <class T,
bool = container_detail::is_convertible<version_type<T, 0>, typename T::version>::value>
struct extract_version
{
diff --git a/boost/container/detail/workaround.hpp b/boost/container/detail/workaround.hpp
index 45ab2f2c4d..c4440743fc 100644
--- a/boost/container/detail/workaround.hpp
+++ b/boost/container/detail/workaround.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -26,6 +26,11 @@
#define BOOST_CONTAINER_NOEXCEPT_IF(x) noexcept(x)
#endif
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES) && defined(__GXX_EXPERIMENTAL_CXX0X__)\
+ && (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ < 40700)
+ #define BOOST_CONTAINER_UNIMPLEMENTED_PACK_EXPANSION_TO_FIXED_LIST
+#endif
+
#include <boost/container/detail/config_end.hpp>
#endif //#ifndef BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
diff --git a/boost/container/flat_map.hpp b/boost/container/flat_map.hpp
index 2d4515b4a4..0142500860 100644
--- a/boost/container/flat_map.hpp
+++ b/boost/container/flat_map.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -26,7 +26,7 @@
#include <boost/container/detail/flat_tree.hpp>
#include <boost/type_traits/has_trivial_destructor.hpp>
#include <boost/container/detail/mpl.hpp>
-#include <boost/container/allocator/allocator_traits.hpp>
+#include <boost/container/allocator_traits.hpp>
#include <boost/move/move.hpp>
#ifdef BOOST_CONTAINER_DOXYGEN_INVOKED
@@ -47,11 +47,11 @@ template <class Key, class T, class Pred, class A>
class flat_map;
template <class Key, class T, class Pred, class A>
-inline bool operator==(const flat_map<Key,T,Pred,A>& x,
+inline bool operator==(const flat_map<Key,T,Pred,A>& x,
const flat_map<Key,T,Pred,A>& y);
template <class Key, class T, class Pred, class A>
-inline bool operator<(const flat_map<Key,T,Pred,A>& x,
+inline bool operator<(const flat_map<Key,T,Pred,A>& x,
const flat_map<Key,T,Pred,A>& y);
namespace container_detail{
@@ -73,12 +73,12 @@ static D force_copy(S s)
/// @endcond
//! A flat_map is a kind of associative container that supports unique keys (contains at
-//! most one of each key value) and provides for fast retrieval of values of another
+//! most one of each key value) and provides for fast retrieval of values of another
//! type T based on the keys. The flat_map class supports random-access iterators.
-//!
-//! A flat_map satisfies all of the requirements of a container and of a reversible
-//! container and of an associative container. A flat_map also provides
-//! most operations described for unique keys. For a
+//!
+//! A flat_map satisfies all of the requirements of a container and of a reversible
+//! container and of an associative container. A flat_map also provides
+//! most operations described for unique keys. For a
//! flat_map<Key,T> the key_type is Key and the value_type is std::pair<Key,T>
//! (unlike std::map<Key, T> which value_type is std::pair<<b>const</b> Key, T>).
//!
@@ -86,35 +86,35 @@ static D force_copy(S s)
//!
//! A is the allocator to allocate the value_types
//! (e.g. <i>allocator< std::pair<Key, T> ></i>).
-//!
+//!
//! flat_map is similar to std::map but it's implemented like an ordered vector.
//! This means that inserting a new element into a flat_map invalidates
//! previous iterators and references
//!
-//! Erasing an element of a flat_map invalidates iterators and references
+//! Erasing an element of a flat_map invalidates iterators and references
//! pointing to elements that come after (their keys are bigger) the erased element.
#ifdef BOOST_CONTAINER_DOXYGEN_INVOKED
template <class Key, class T, class Pred = std::less< std::pair< Key, T> >, class A = std::allocator<T> >
#else
template <class Key, class T, class Pred, class A>
#endif
-class flat_map
+class flat_map
{
/// @cond
private:
BOOST_COPYABLE_AND_MOVABLE(flat_map)
//This is the tree that we should store if pair was movable
- typedef container_detail::flat_tree<Key,
- std::pair<Key, T>,
- container_detail::select1st< std::pair<Key, T> >,
- Pred,
+ typedef container_detail::flat_tree<Key,
+ std::pair<Key, T>,
+ container_detail::select1st< std::pair<Key, T> >,
+ Pred,
A> tree_t;
//This is the real tree stored here. It's based on a movable pair
- typedef container_detail::flat_tree<Key,
- container_detail::pair<Key, T>,
- container_detail::select1st<container_detail::pair<Key, T> >,
- Pred,
+ typedef container_detail::flat_tree<Key,
+ container_detail::pair<Key, T>,
+ container_detail::select1st<container_detail::pair<Key, T> >,
+ Pred,
typename allocator_traits<A>::template portable_rebind_alloc
<container_detail::pair<Key, T> >::type> impl_tree_t;
impl_tree_t m_flat_tree; // flat tree representing flat_map
@@ -165,245 +165,267 @@ class flat_map
get_flat_tree_iterators
<pointer>::const_reverse_iterator const_reverse_iterator;
typedef A allocator_type;
+
+ //!Standard extension
typedef A stored_allocator_type;
+ //!Standard extension for C++03 compilers with non-movable std::pair
+ typedef impl_value_type movable_value_type;
+
public:
//! <b>Effects</b>: Default constructs an empty flat_map.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- flat_map()
+ flat_map()
: m_flat_tree() {}
//! <b>Effects</b>: Constructs an empty flat_map using the specified
//! comparison object and allocator.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- explicit flat_map(const Pred& comp, const allocator_type& a = allocator_type())
+ explicit flat_map(const Pred& comp, const allocator_type& a = allocator_type())
: m_flat_tree(comp, container_detail::force<impl_allocator_type>(a)) {}
- //! <b>Effects</b>: Constructs an empty flat_map using the specified comparison object and
+ //! <b>Effects</b>: Constructs an empty flat_map using the specified comparison object and
//! allocator, and inserts elements from the range [first ,last ).
- //!
- //! <b>Complexity</b>: Linear in N if the range [first ,last ) is already sorted using
+ //!
+ //! <b>Complexity</b>: Linear in N if the range [first ,last ) is already sorted using
//! comp and otherwise N logN, where N is last - first.
template <class InputIterator>
flat_map(InputIterator first, InputIterator last, const Pred& comp = Pred(),
const allocator_type& a = allocator_type())
- : m_flat_tree(comp, container_detail::force<impl_allocator_type>(a))
+ : m_flat_tree(comp, container_detail::force<impl_allocator_type>(a))
{ m_flat_tree.insert_unique(first, last); }
- //! <b>Effects</b>: Constructs an empty flat_map using the specified comparison object and
+ //! <b>Effects</b>: Constructs an empty flat_map using the specified comparison object and
//! allocator, and inserts elements from the ordered unique range [first ,last). This function
//! is more efficient than the normal range creation for ordered ranges.
//!
//! <b>Requires</b>: [first ,last) must be ordered according to the predicate and must be
//! unique values.
- //!
+ //!
//! <b>Complexity</b>: Linear in N.
+ //!
+ //! <b>Note</b>: Non-standard extension.
template <class InputIterator>
flat_map( ordered_unique_range_t, InputIterator first, InputIterator last
, const Pred& comp = Pred(), const allocator_type& a = allocator_type())
- : m_flat_tree(ordered_range, first, last, comp, a)
+ : m_flat_tree(ordered_range, first, last, comp, a)
{}
//! <b>Effects</b>: Copy constructs a flat_map.
- //!
+ //!
//! <b>Complexity</b>: Linear in x.size().
- flat_map(const flat_map<Key,T,Pred,A>& x)
+ flat_map(const flat_map& x)
: m_flat_tree(x.m_flat_tree) {}
//! <b>Effects</b>: Move constructs a flat_map.
//! Constructs *this using x's resources.
- //!
- //! <b>Complexity</b>: Construct.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Postcondition</b>: x is emptied.
- flat_map(BOOST_RV_REF(flat_map) x)
+ flat_map(BOOST_RV_REF(flat_map) x)
: m_flat_tree(boost::move(x.m_flat_tree))
{}
+ //! <b>Effects</b>: Copy constructs a flat_map using the specified allocator.
+ //!
+ //! <b>Complexity</b>: Linear in x.size().
+ flat_map(const flat_map& x, const allocator_type &a)
+ : m_flat_tree(x.m_flat_tree, a)
+ {}
+
+ //! <b>Effects</b>: Move constructs a flat_map using the specified allocator.
+ //! Constructs *this using x's resources.
+ //!
+ //! <b>Complexity</b>: Constant if x.get_allocator() == a, linear otherwise.
+ flat_map(BOOST_RV_REF(flat_map) x, const allocator_type &a)
+ : m_flat_tree(boost::move(x.m_flat_tree), a)
+ {}
+
//! <b>Effects</b>: Makes *this a copy of x.
- //!
+ //!
//! <b>Complexity</b>: Linear in x.size().
- flat_map<Key,T,Pred,A>& operator=(BOOST_COPY_ASSIGN_REF(flat_map) x)
+ flat_map& operator=(BOOST_COPY_ASSIGN_REF(flat_map) x)
{ m_flat_tree = x.m_flat_tree; return *this; }
//! <b>Effects</b>: Move constructs a flat_map.
//! Constructs *this using x's resources.
- //!
+ //!
//! <b>Complexity</b>: Construct.
- //!
+ //!
//! <b>Postcondition</b>: x is emptied.
- flat_map<Key,T,Pred,A>& operator=(BOOST_RV_REF(flat_map) mx)
+ flat_map& operator=(BOOST_RV_REF(flat_map) mx)
{ m_flat_tree = boost::move(mx.m_flat_tree); return *this; }
//! <b>Effects</b>: Returns the comparison object out
//! of which a was constructed.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- key_compare key_comp() const
- { return container_detail::force<key_compare>(m_flat_tree.key_comp()); }
+ key_compare key_comp() const
+ { return container_detail::force_copy<key_compare>(m_flat_tree.key_comp()); }
//! <b>Effects</b>: Returns an object of value_compare constructed out
//! of the comparison object.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- value_compare value_comp() const
- { return value_compare(container_detail::force<key_compare>(m_flat_tree.key_comp())); }
+ value_compare value_comp() const
+ { return value_compare(container_detail::force_copy<key_compare>(m_flat_tree.key_comp())); }
//! <b>Effects</b>: Returns a copy of the Allocator that
//! was passed to the object's constructor.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- allocator_type get_allocator() const
- { return container_detail::force<allocator_type>(m_flat_tree.get_allocator()); }
+ allocator_type get_allocator() const
+ { return container_detail::force_copy<allocator_type>(m_flat_tree.get_allocator()); }
- const stored_allocator_type &get_stored_allocator() const
+ const stored_allocator_type &get_stored_allocator() const
{ return container_detail::force<stored_allocator_type>(m_flat_tree.get_stored_allocator()); }
stored_allocator_type &get_stored_allocator()
{ return container_detail::force<stored_allocator_type>(m_flat_tree.get_stored_allocator()); }
//! <b>Effects</b>: Returns an iterator to the first element contained in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- iterator begin()
+ iterator begin()
{ return container_detail::force_copy<iterator>(m_flat_tree.begin()); }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the container.
- //!
- //! <b>Throws</b>: Nothing.
- //!
- //! <b>Complexity</b>: Constant.
- const_iterator begin() const
- { return container_detail::force<const_iterator>(m_flat_tree.begin()); }
-
- //! <b>Effects</b>: Returns a const_iterator to the first element contained in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator cbegin() const
- { return container_detail::force<const_iterator>(m_flat_tree.cbegin()); }
+ const_iterator begin() const
+ { return container_detail::force_copy<const_iterator>(m_flat_tree.begin()); }
//! <b>Effects</b>: Returns an iterator to the end of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- iterator end()
+ iterator end()
{ return container_detail::force_copy<iterator>(m_flat_tree.end()); }
//! <b>Effects</b>: Returns a const_iterator to the end of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator end() const
- { return container_detail::force<const_iterator>(m_flat_tree.end()); }
+ const_iterator end() const
+ { return container_detail::force_copy<const_iterator>(m_flat_tree.end()); }
- //! <b>Effects</b>: Returns a const_iterator to the end of the container.
- //!
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator cend() const
- { return container_detail::force<const_iterator>(m_flat_tree.cend()); }
+ reverse_iterator rbegin()
+ { return container_detail::force_copy<reverse_iterator>(m_flat_tree.rbegin()); }
- //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
- //! of the reversed container.
- //!
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- reverse_iterator rbegin()
- { return container_detail::force<reverse_iterator>(m_flat_tree.rbegin()); }
+ const_reverse_iterator rbegin() const
+ { return container_detail::force_copy<const_reverse_iterator>(m_flat_tree.rbegin()); }
- //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
- //! of the reversed container.
- //!
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the end
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator rbegin() const
- { return container_detail::force<const_reverse_iterator>(m_flat_tree.rbegin()); }
+ reverse_iterator rend()
+ { return container_detail::force_copy<reverse_iterator>(m_flat_tree.rend()); }
- //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
- //! of the reversed container.
- //!
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator crbegin() const
- { return container_detail::force<const_reverse_iterator>(m_flat_tree.crbegin()); }
+ const_reverse_iterator rend() const
+ { return container_detail::force_copy<const_reverse_iterator>(m_flat_tree.rend()); }
- //! <b>Effects</b>: Returns a reverse_iterator pointing to the end
- //! of the reversed container.
- //!
+ //! <b>Effects</b>: Returns a const_iterator to the first element contained in the container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- reverse_iterator rend()
- { return container_detail::force<reverse_iterator>(m_flat_tree.rend()); }
+ const_iterator cbegin() const
+ { return container_detail::force_copy<const_iterator>(m_flat_tree.cbegin()); }
- //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
- //! of the reversed container.
- //!
+ //! <b>Effects</b>: Returns a const_iterator to the end of the container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator rend() const
- { return container_detail::force<const_reverse_iterator>(m_flat_tree.rend()); }
+ const_iterator cend() const
+ { return container_detail::force_copy<const_iterator>(m_flat_tree.cend()); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed container.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ const_reverse_iterator crbegin() const
+ { return container_detail::force_copy<const_reverse_iterator>(m_flat_tree.crbegin()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
- //! of the reversed container.
- //!
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator crend() const
- { return container_detail::force<const_reverse_iterator>(m_flat_tree.crend()); }
+ const_reverse_iterator crend() const
+ { return container_detail::force_copy<const_reverse_iterator>(m_flat_tree.crend()); }
//! <b>Effects</b>: Returns true if the container contains no elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- bool empty() const
+ bool empty() const
{ return m_flat_tree.empty(); }
//! <b>Effects</b>: Returns the number of the elements contained in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- size_type size() const
+ size_type size() const
{ return m_flat_tree.size(); }
//! <b>Effects</b>: Returns the largest possible size of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- size_type max_size() const
+ size_type max_size() const
{ return m_flat_tree.max_size(); }
#if defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- //! Effects: If there is no key equivalent to x in the flat_map, inserts
+ //! Effects: If there is no key equivalent to x in the flat_map, inserts
//! value_type(x, T()) into the flat_map.
- //!
+ //!
//! Returns: A reference to the mapped_type corresponding to x in *this.
- //!
+ //!
//! Complexity: Logarithmic.
mapped_type &operator[](const key_type& k);
- //! Effects: If there is no key equivalent to x in the flat_map, inserts
+ //! Effects: If there is no key equivalent to x in the flat_map, inserts
//! value_type(move(x), T()) into the flat_map (the key is move-constructed)
- //!
+ //!
//! Returns: A reference to the mapped_type corresponding to x in *this.
- //!
+ //!
//! Complexity: Logarithmic.
mapped_type &operator[](key_type &&k) ;
@@ -443,10 +465,10 @@ class flat_map
void swap(flat_map& x)
{ m_flat_tree.swap(x.m_flat_tree); }
- //! <b>Effects</b>: Inserts x if and only if there is no element in the container
+ //! <b>Effects</b>: Inserts x if and only if there is no element in the container
//! with key equivalent to the key of x.
//!
- //! <b>Returns</b>: The bool component of the returned pair is true if and only
+ //! <b>Returns</b>: The bool component of the returned pair is true if and only
//! if the insertion takes place, and the iterator component of the pair
//! points to the element with key equivalent to the key of x.
//!
@@ -454,14 +476,14 @@ class flat_map
//! to the elements with bigger keys than x.
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
- std::pair<iterator,bool> insert(const value_type& x)
- { return container_detail::force<std::pair<iterator,bool> >(
+ std::pair<iterator,bool> insert(const value_type& x)
+ { return container_detail::force_copy<std::pair<iterator,bool> >(
m_flat_tree.insert_unique(container_detail::force<impl_value_type>(x))); }
//! <b>Effects</b>: Inserts a new value_type move constructed from the pair if and
//! only if there is no element in the container with key equivalent to the key of x.
//!
- //! <b>Returns</b>: The bool component of the returned pair is true if and only
+ //! <b>Returns</b>: The bool component of the returned pair is true if and only
//! if the insertion takes place, and the iterator component of the pair
//! points to the element with key equivalent to the key of x.
//!
@@ -469,14 +491,14 @@ class flat_map
//! to the elements with bigger keys than x.
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
- std::pair<iterator,bool> insert(BOOST_RV_REF(value_type) x)
- { return container_detail::force<std::pair<iterator,bool> >(
+ std::pair<iterator,bool> insert(BOOST_RV_REF(value_type) x)
+ { return container_detail::force_copy<std::pair<iterator,bool> >(
m_flat_tree.insert_unique(boost::move(container_detail::force<impl_value_type>(x)))); }
//! <b>Effects</b>: Inserts a new value_type move constructed from the pair if and
//! only if there is no element in the container with key equivalent to the key of x.
//!
- //! <b>Returns</b>: The bool component of the returned pair is true if and only
+ //! <b>Returns</b>: The bool component of the returned pair is true if and only
//! if the insertion takes place, and the iterator component of the pair
//! points to the element with key equivalent to the key of x.
//!
@@ -484,13 +506,13 @@ class flat_map
//! to the elements with bigger keys than x.
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
- std::pair<iterator,bool> insert(BOOST_RV_REF(impl_value_type) x)
+ std::pair<iterator,bool> insert(BOOST_RV_REF(movable_value_type) x)
{
- return container_detail::force<std::pair<iterator,bool> >
+ return container_detail::force_copy<std::pair<iterator,bool> >
(m_flat_tree.insert_unique(boost::move(x)));
}
- //! <b>Effects</b>: Inserts a copy of x in the container if and only if there is
+ //! <b>Effects</b>: Inserts a copy of x in the container if and only if there is
//! no element in the container with key equivalent to the key of x.
//! p is a hint pointing to where the insert should start to search.
//!
@@ -502,8 +524,11 @@ class flat_map
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
iterator insert(const_iterator position, const value_type& x)
- { return container_detail::force_copy<iterator>(
- m_flat_tree.insert_unique(container_detail::force<impl_const_iterator>(position), container_detail::force<impl_value_type>(x))); }
+ {
+ return container_detail::force_copy<iterator>(
+ m_flat_tree.insert_unique( container_detail::force_copy<impl_const_iterator>(position)
+ , container_detail::force<impl_value_type>(x)));
+ }
//! <b>Effects</b>: Inserts an element move constructed from x in the container.
//! p is a hint pointing to where the insert should start to search.
@@ -515,8 +540,11 @@ class flat_map
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
iterator insert(const_iterator position, BOOST_RV_REF(value_type) x)
- { return container_detail::force_copy<iterator>
- (m_flat_tree.insert_unique(container_detail::force<impl_const_iterator>(position), boost::move(container_detail::force<impl_value_type>(x)))); }
+ {
+ return container_detail::force_copy<iterator>
+ (m_flat_tree.insert_unique( container_detail::force_copy<impl_const_iterator>(position)
+ , boost::move(container_detail::force<impl_value_type>(x))));
+ }
//! <b>Effects</b>: Inserts an element move constructed from x in the container.
//! p is a hint pointing to where the insert should start to search.
@@ -527,15 +555,15 @@ class flat_map
//! right before p) plus insertion linear to the elements with bigger keys than x.
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
- iterator insert(const_iterator position, BOOST_RV_REF(impl_value_type) x)
+ iterator insert(const_iterator position, BOOST_RV_REF(movable_value_type) x)
{
return container_detail::force_copy<iterator>(
- m_flat_tree.insert_unique(container_detail::force<impl_const_iterator>(position), boost::move(x)));
+ m_flat_tree.insert_unique(container_detail::force_copy<impl_const_iterator>(position), boost::move(x)));
}
//! <b>Requires</b>: first, last are not iterators into *this.
//!
- //! <b>Effects</b>: inserts each element from the range [first,last) if and only
+ //! <b>Effects</b>: inserts each element from the range [first,last) if and only
//! if there is no element with key equivalent to the key of that element.
//!
//! <b>Complexity</b>: At most N log(size()+N) (N is the distance from first to last)
@@ -543,16 +571,33 @@ class flat_map
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
template <class InputIterator>
- void insert(InputIterator first, InputIterator last)
+ void insert(InputIterator first, InputIterator last)
{ m_flat_tree.insert_unique(first, last); }
+ //! <b>Requires</b>: first, last are not iterators into *this.
+ //!
+ //! <b>Requires</b>: [first ,last) must be ordered according to the predicate and must be
+ //! unique values.
+ //!
+ //! <b>Effects</b>: inserts each element from the range [first,last) if and only
+ //! if there is no element with key equivalent to the key of that element. This
+ //! function is more efficient than the normal range creation for ordered ranges.
+ //!
+ //! <b>Complexity</b>: At most N log(size()+N) (N is the distance from first to last)
+ //! search time plus N*size() insertion time.
+ //!
+ //! <b>Note</b>: If an element is inserted it might invalidate elements.
+ template <class InputIterator>
+ void insert(ordered_unique_range_t, InputIterator first, InputIterator last)
+ { m_flat_tree.insert_unique(ordered_unique_range, first, last); }
+
#if defined(BOOST_CONTAINER_PERFECT_FORWARDING) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
//! <b>Effects</b>: Inserts an object x of type T constructed with
- //! std::forward<Args>(args)... if and only if there is no element in the container
+ //! std::forward<Args>(args)... if and only if there is no element in the container
//! with key equivalent to the key of x.
//!
- //! <b>Returns</b>: The bool component of the returned pair is true if and only
+ //! <b>Returns</b>: The bool component of the returned pair is true if and only
//! if the insertion takes place, and the iterator component of the pair
//! points to the element with key equivalent to the key of x.
//!
@@ -565,7 +610,7 @@ class flat_map
{ return container_detail::force_copy< std::pair<iterator, bool> >(m_flat_tree.emplace_unique(boost::forward<Args>(args)...)); }
//! <b>Effects</b>: Inserts an object of type T constructed with
- //! std::forward<Args>(args)... in the container if and only if there is
+ //! std::forward<Args>(args)... in the container if and only if there is
//! no element in the container with key equivalent to the key of x.
//! p is a hint pointing to where the insert should start to search.
//!
@@ -578,8 +623,11 @@ class flat_map
//! <b>Note</b>: If an element is inserted it might invalidate elements.
template <class... Args>
iterator emplace_hint(const_iterator hint, Args&&... args)
- { return container_detail::force_copy<iterator>
- (m_flat_tree.emplace_hint_unique(container_detail::force<impl_const_iterator>(hint), boost::forward<Args>(args)...)); }
+ {
+ return container_detail::force_copy<iterator>
+ (m_flat_tree.emplace_hint_unique( container_detail::force_copy<impl_const_iterator>(hint)
+ , boost::forward<Args>(args)...));
+ }
#else //#ifdef BOOST_CONTAINER_PERFECT_FORWARDING
@@ -593,7 +641,7 @@ class flat_map
iterator emplace_hint(const_iterator hint \
BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \
{ return container_detail::force_copy<iterator>(m_flat_tree.emplace_hint_unique \
- (container_detail::force<impl_const_iterator>(hint) \
+ (container_detail::force_copy<impl_const_iterator>(hint) \
BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _))); } \
//!
#define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS)
@@ -604,15 +652,18 @@ class flat_map
//! <b>Effects</b>: Erases the element pointed to by position.
//!
//! <b>Returns</b>: Returns an iterator pointing to the element immediately
- //! following q prior to the element being erased. If no such element exists,
+ //! following q prior to the element being erased. If no such element exists,
//! returns end().
//!
//! <b>Complexity</b>: Linear to the elements with keys bigger than position
//!
//! <b>Note</b>: Invalidates elements with keys
//! not less than the erased element.
- iterator erase(const_iterator position)
- { return container_detail::force_copy<iterator>(m_flat_tree.erase(container_detail::force<impl_const_iterator>(position))); }
+ iterator erase(const_iterator position)
+ {
+ return container_detail::force_copy<iterator>
+ (m_flat_tree.erase(container_detail::force_copy<impl_const_iterator>(position)));
+ }
//! <b>Effects</b>: Erases all elements in the container with key equivalent to x.
//!
@@ -620,7 +671,7 @@ class flat_map
//!
//! <b>Complexity</b>: Logarithmic search time plus erasure time
//! linear to the elements with bigger keys.
- size_type erase(const key_type& x)
+ size_type erase(const key_type& x)
{ return m_flat_tree.erase(x); }
//! <b>Effects</b>: Erases all the elements in the range [first, last).
@@ -632,15 +683,18 @@ class flat_map
//! <b>Complexity</b>: Logarithmic search time plus erasure time
//! linear to the elements with bigger keys.
iterator erase(const_iterator first, const_iterator last)
- { return container_detail::force_copy<iterator>
- (m_flat_tree.erase(container_detail::force<impl_const_iterator>(first), container_detail::force<impl_const_iterator>(last))); }
+ {
+ return container_detail::force_copy<iterator>(
+ m_flat_tree.erase( container_detail::force_copy<impl_const_iterator>(first)
+ , container_detail::force_copy<impl_const_iterator>(last)));
+ }
//! <b>Effects</b>: erase(a.begin(),a.end()).
//!
//! <b>Postcondition</b>: size() == 0.
//!
//! <b>Complexity</b>: linear in size().
- void clear()
+ void clear()
{ m_flat_tree.clear(); }
//! <b>Effects</b>: Tries to deallocate the excess of memory created
@@ -656,81 +710,81 @@ class flat_map
//! equivalent to x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic.
- iterator find(const key_type& x)
+ iterator find(const key_type& x)
{ return container_detail::force_copy<iterator>(m_flat_tree.find(x)); }
//! <b>Returns</b>: A const_iterator pointing to an element with the key
//! equivalent to x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic.s
- const_iterator find(const key_type& x) const
- { return container_detail::force<const_iterator>(m_flat_tree.find(x)); }
+ const_iterator find(const key_type& x) const
+ { return container_detail::force_copy<const_iterator>(m_flat_tree.find(x)); }
//! <b>Returns</b>: The number of elements with key equivalent to x.
//!
//! <b>Complexity</b>: log(size())+count(k)
- size_type count(const key_type& x) const
+ size_type count(const key_type& x) const
{ return m_flat_tree.find(x) == m_flat_tree.end() ? 0 : 1; }
//! <b>Returns</b>: An iterator pointing to the first element with key not less
//! than k, or a.end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic
- iterator lower_bound(const key_type& x)
+ iterator lower_bound(const key_type& x)
{ return container_detail::force_copy<iterator>(m_flat_tree.lower_bound(x)); }
//! <b>Returns</b>: A const iterator pointing to the first element with key not
//! less than k, or a.end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic
- const_iterator lower_bound(const key_type& x) const
- { return container_detail::force<const_iterator>(m_flat_tree.lower_bound(x)); }
+ const_iterator lower_bound(const key_type& x) const
+ { return container_detail::force_copy<const_iterator>(m_flat_tree.lower_bound(x)); }
//! <b>Returns</b>: An iterator pointing to the first element with key not less
//! than x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic
- iterator upper_bound(const key_type& x)
+ iterator upper_bound(const key_type& x)
{ return container_detail::force_copy<iterator>(m_flat_tree.upper_bound(x)); }
//! <b>Returns</b>: A const iterator pointing to the first element with key not
//! less than x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic
- const_iterator upper_bound(const key_type& x) const
- { return container_detail::force<const_iterator>(m_flat_tree.upper_bound(x)); }
+ const_iterator upper_bound(const key_type& x) const
+ { return container_detail::force_copy<const_iterator>(m_flat_tree.upper_bound(x)); }
//! <b>Effects</b>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).
//!
//! <b>Complexity</b>: Logarithmic
- std::pair<iterator,iterator> equal_range(const key_type& x)
- { return container_detail::force<std::pair<iterator,iterator> >(m_flat_tree.equal_range(x)); }
+ std::pair<iterator,iterator> equal_range(const key_type& x)
+ { return container_detail::force_copy<std::pair<iterator,iterator> >(m_flat_tree.equal_range(x)); }
//! <b>Effects</b>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).
//!
//! <b>Complexity</b>: Logarithmic
- std::pair<const_iterator,const_iterator> equal_range(const key_type& x) const
- { return container_detail::force<std::pair<const_iterator,const_iterator> >(m_flat_tree.equal_range(x)); }
+ std::pair<const_iterator,const_iterator> equal_range(const key_type& x) const
+ { return container_detail::force_copy<std::pair<const_iterator,const_iterator> >(m_flat_tree.equal_range(x)); }
//! <b>Effects</b>: Number of elements for which memory has been allocated.
//! capacity() is always greater than or equal to size().
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- size_type capacity() const
+ size_type capacity() const
{ return m_flat_tree.capacity(); }
//! <b>Effects</b>: If n is less than or equal to capacity(), this call has no
//! effect. Otherwise, it is a request for allocation of additional memory.
//! If the request is successful, then capacity() is greater than or equal to
//! n; otherwise, capacity() is unchanged. In either case, size() is unchanged.
- //!
+ //!
//! <b>Throws</b>: If memory allocation allocation throws or T's copy constructor throws.
//!
//! <b>Note</b>: If capacity() is less than "count", iterators and references to
//! to values might be invalidated.
- void reserve(size_type count)
+ void reserve(size_type count)
{ m_flat_tree.reserve(count); }
/// @cond
@@ -752,7 +806,7 @@ class flat_map
}
return (*i).second;
}
- mapped_type &priv_subscript(BOOST_RV_REF(key_type) mk)
+ mapped_type &priv_subscript(BOOST_RV_REF(key_type) mk)
{
key_type &k = mk;
iterator i = lower_bound(k);
@@ -767,38 +821,38 @@ class flat_map
};
template <class Key, class T, class Pred, class A>
-inline bool operator==(const flat_map<Key,T,Pred,A>& x,
- const flat_map<Key,T,Pred,A>& y)
+inline bool operator==(const flat_map<Key,T,Pred,A>& x,
+ const flat_map<Key,T,Pred,A>& y)
{ return x.m_flat_tree == y.m_flat_tree; }
template <class Key, class T, class Pred, class A>
-inline bool operator<(const flat_map<Key,T,Pred,A>& x,
- const flat_map<Key,T,Pred,A>& y)
+inline bool operator<(const flat_map<Key,T,Pred,A>& x,
+ const flat_map<Key,T,Pred,A>& y)
{ return x.m_flat_tree < y.m_flat_tree; }
template <class Key, class T, class Pred, class A>
-inline bool operator!=(const flat_map<Key,T,Pred,A>& x,
- const flat_map<Key,T,Pred,A>& y)
+inline bool operator!=(const flat_map<Key,T,Pred,A>& x,
+ const flat_map<Key,T,Pred,A>& y)
{ return !(x == y); }
template <class Key, class T, class Pred, class A>
-inline bool operator>(const flat_map<Key,T,Pred,A>& x,
- const flat_map<Key,T,Pred,A>& y)
+inline bool operator>(const flat_map<Key,T,Pred,A>& x,
+ const flat_map<Key,T,Pred,A>& y)
{ return y < x; }
template <class Key, class T, class Pred, class A>
-inline bool operator<=(const flat_map<Key,T,Pred,A>& x,
- const flat_map<Key,T,Pred,A>& y)
+inline bool operator<=(const flat_map<Key,T,Pred,A>& x,
+ const flat_map<Key,T,Pred,A>& y)
{ return !(y < x); }
template <class Key, class T, class Pred, class A>
-inline bool operator>=(const flat_map<Key,T,Pred,A>& x,
- const flat_map<Key,T,Pred,A>& y)
+inline bool operator>=(const flat_map<Key,T,Pred,A>& x,
+ const flat_map<Key,T,Pred,A>& y)
{ return !(x < y); }
template <class Key, class T, class Pred, class A>
-inline void swap(flat_map<Key,T,Pred,A>& x,
- flat_map<Key,T,Pred,A>& y)
+inline void swap(flat_map<Key,T,Pred,A>& x,
+ flat_map<Key,T,Pred,A>& y)
{ x.swap(y); }
/// @cond
@@ -824,21 +878,21 @@ template <class Key, class T, class Pred, class A>
class flat_multimap;
template <class Key, class T, class Pred, class A>
-inline bool operator==(const flat_multimap<Key,T,Pred,A>& x,
+inline bool operator==(const flat_multimap<Key,T,Pred,A>& x,
const flat_multimap<Key,T,Pred,A>& y);
template <class Key, class T, class Pred, class A>
-inline bool operator<(const flat_multimap<Key,T,Pred,A>& x,
+inline bool operator<(const flat_multimap<Key,T,Pred,A>& x,
const flat_multimap<Key,T,Pred,A>& y);
/// @endcond
-//! A flat_multimap is a kind of associative container that supports equivalent keys
-//! (possibly containing multiple copies of the same key value) and provides for
-//! fast retrieval of values of another type T based on the keys. The flat_multimap
+//! A flat_multimap is a kind of associative container that supports equivalent keys
+//! (possibly containing multiple copies of the same key value) and provides for
+//! fast retrieval of values of another type T based on the keys. The flat_multimap
//! class supports random-access iterators.
-//!
-//! A flat_multimap satisfies all of the requirements of a container and of a reversible
-//! container and of an associative container. For a
+//!
+//! A flat_multimap satisfies all of the requirements of a container and of a reversible
+//! container and of an associative container. For a
//! flat_multimap<Key,T> the key_type is Key and the value_type is std::pair<Key,T>
//! (unlike std::multimap<Key, T> which value_type is std::pair<<b>const</b> Key, T>).
//!
@@ -851,21 +905,21 @@ template <class Key, class T, class Pred = std::less< std::pair< Key, T> >, clas
#else
template <class Key, class T, class Pred, class A>
#endif
-class flat_multimap
+class flat_multimap
{
/// @cond
private:
BOOST_COPYABLE_AND_MOVABLE(flat_multimap)
- typedef container_detail::flat_tree<Key,
- std::pair<Key, T>,
- container_detail::select1st< std::pair<Key, T> >,
- Pred,
+ typedef container_detail::flat_tree<Key,
+ std::pair<Key, T>,
+ container_detail::select1st< std::pair<Key, T> >,
+ Pred,
A> tree_t;
//This is the real tree stored here. It's based on a movable pair
- typedef container_detail::flat_tree<Key,
- container_detail::pair<Key, T>,
- container_detail::select1st<container_detail::pair<Key, T> >,
- Pred,
+ typedef container_detail::flat_tree<Key,
+ container_detail::pair<Key, T>,
+ container_detail::select1st<container_detail::pair<Key, T> >,
+ Pred,
typename allocator_traits<A>::template portable_rebind_alloc
<container_detail::pair<Key, T> >::type> impl_tree_t;
impl_tree_t m_flat_tree; // flat tree representing flat_map
@@ -916,16 +970,18 @@ class flat_multimap
typedef A allocator_type;
//Non-standard extension
typedef A stored_allocator_type;
+ //!Standard extension for C++03 compilers with non-movable std::pair
+ typedef impl_value_type movable_value_type;
//! <b>Effects</b>: Default constructs an empty flat_map.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- flat_multimap()
+ flat_multimap()
: m_flat_tree() {}
//! <b>Effects</b>: Constructs an empty flat_multimap using the specified comparison
//! object and allocator.
- //!
+ //!
//! <b>Complexity</b>: Constant.
explicit flat_multimap(const Pred& comp,
const allocator_type& a = allocator_type())
@@ -933,174 +989,225 @@ class flat_multimap
//! <b>Effects</b>: Constructs an empty flat_multimap using the specified comparison object
//! and allocator, and inserts elements from the range [first ,last ).
- //!
- //! <b>Complexity</b>: Linear in N if the range [first ,last ) is already sorted using
+ //!
+ //! <b>Complexity</b>: Linear in N if the range [first ,last ) is already sorted using
//! comp and otherwise N logN, where N is last - first.
template <class InputIterator>
flat_multimap(InputIterator first, InputIterator last,
const Pred& comp = Pred(),
const allocator_type& a = allocator_type())
- : m_flat_tree(comp, container_detail::force<impl_allocator_type>(a))
+ : m_flat_tree(comp, container_detail::force<impl_allocator_type>(a))
{ m_flat_tree.insert_equal(first, last); }
- //! <b>Effects</b>: Constructs an empty flat_multimap using the specified comparison object and
+ //! <b>Effects</b>: Constructs an empty flat_multimap using the specified comparison object and
//! allocator, and inserts elements from the ordered range [first ,last). This function
//! is more efficient than the normal range creation for ordered ranges.
//!
//! <b>Requires</b>: [first ,last) must be ordered according to the predicate.
- //!
+ //!
//! <b>Complexity</b>: Linear in N.
+ //!
+ //! <b>Note</b>: Non-standard extension.
template <class InputIterator>
flat_multimap(ordered_range_t, InputIterator first, InputIterator last,
const Pred& comp = Pred(),
const allocator_type& a = allocator_type())
- : m_flat_tree(ordered_range, first, last, comp, a)
+ : m_flat_tree(ordered_range, first, last, comp, a)
{}
//! <b>Effects</b>: Copy constructs a flat_multimap.
- //!
+ //!
//! <b>Complexity</b>: Linear in x.size().
- flat_multimap(const flat_multimap<Key,T,Pred,A>& x)
+ flat_multimap(const flat_multimap& x)
: m_flat_tree(x.m_flat_tree) { }
//! <b>Effects</b>: Move constructs a flat_multimap. Constructs *this using x's resources.
- //!
- //! <b>Complexity</b>: Construct.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Postcondition</b>: x is emptied.
- flat_multimap(BOOST_RV_REF(flat_multimap) x)
+ flat_multimap(BOOST_RV_REF(flat_multimap) x)
: m_flat_tree(boost::move(x.m_flat_tree))
{ }
+ //! <b>Effects</b>: Copy constructs a flat_multimap using the specified allocator.
+ //!
+ //! <b>Complexity</b>: Linear in x.size().
+ flat_multimap(const flat_multimap& x, const allocator_type &a)
+ : m_flat_tree(x.m_flat_tree, a)
+ {}
+
+ //! <b>Effects</b>: Move constructs a flat_multimap using the specified allocator.
+ //! Constructs *this using x's resources.
+ //!
+ //! <b>Complexity</b>: Constant if a == x.get_allocator(), linear otherwise.
+ flat_multimap(BOOST_RV_REF(flat_multimap) x, const allocator_type &a)
+ : m_flat_tree(boost::move(x.m_flat_tree), a)
+ { }
+
//! <b>Effects</b>: Makes *this a copy of x.
- //!
+ //!
//! <b>Complexity</b>: Linear in x.size().
- flat_multimap<Key,T,Pred,A>& operator=(BOOST_COPY_ASSIGN_REF(flat_multimap) x)
+ flat_multimap& operator=(BOOST_COPY_ASSIGN_REF(flat_multimap) x)
{ m_flat_tree = x.m_flat_tree; return *this; }
//! <b>Effects</b>: this->swap(x.get()).
- //!
+ //!
//! <b>Complexity</b>: Constant.
- flat_multimap<Key,T,Pred,A>& operator=(BOOST_RV_REF(flat_multimap) mx)
+ flat_multimap& operator=(BOOST_RV_REF(flat_multimap) mx)
{ m_flat_tree = boost::move(mx.m_flat_tree); return *this; }
//! <b>Effects</b>: Returns the comparison object out
//! of which a was constructed.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- key_compare key_comp() const
- { return container_detail::force<key_compare>(m_flat_tree.key_comp()); }
+ key_compare key_comp() const
+ { return container_detail::force_copy<key_compare>(m_flat_tree.key_comp()); }
//! <b>Effects</b>: Returns an object of value_compare constructed out
//! of the comparison object.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- value_compare value_comp() const
- { return value_compare(container_detail::force<key_compare>(m_flat_tree.key_comp())); }
+ value_compare value_comp() const
+ { return value_compare(container_detail::force_copy<key_compare>(m_flat_tree.key_comp())); }
//! <b>Effects</b>: Returns a copy of the Allocator that
//! was passed to the object's constructor.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- allocator_type get_allocator() const
- { return container_detail::force<allocator_type>(m_flat_tree.get_allocator()); }
+ allocator_type get_allocator() const
+ { return container_detail::force_copy<allocator_type>(m_flat_tree.get_allocator()); }
- const stored_allocator_type &get_stored_allocator() const
+ const stored_allocator_type &get_stored_allocator() const
{ return container_detail::force<stored_allocator_type>(m_flat_tree.get_stored_allocator()); }
stored_allocator_type &get_stored_allocator()
{ return container_detail::force<stored_allocator_type>(m_flat_tree.get_stored_allocator()); }
//! <b>Effects</b>: Returns an iterator to the first element contained in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- iterator begin()
+ iterator begin()
{ return container_detail::force_copy<iterator>(m_flat_tree.begin()); }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator begin() const
- { return container_detail::force<const_iterator>(m_flat_tree.begin()); }
+ const_iterator begin() const
+ { return container_detail::force_copy<const_iterator>(m_flat_tree.begin()); }
//! <b>Effects</b>: Returns an iterator to the end of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- iterator end()
+ iterator end()
{ return container_detail::force_copy<iterator>(m_flat_tree.end()); }
//! <b>Effects</b>: Returns a const_iterator to the end of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator end() const
- { return container_detail::force<const_iterator>(m_flat_tree.end()); }
+ const_iterator end() const
+ { return container_detail::force_copy<const_iterator>(m_flat_tree.end()); }
- //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
- //! of the reversed container.
- //!
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- reverse_iterator rbegin()
- { return container_detail::force<reverse_iterator>(m_flat_tree.rbegin()); }
+ reverse_iterator rbegin()
+ { return container_detail::force_copy<reverse_iterator>(m_flat_tree.rbegin()); }
- //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
- //! of the reversed container.
- //!
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator rbegin() const
- { return container_detail::force<const_reverse_iterator>(m_flat_tree.rbegin()); }
+ const_reverse_iterator rbegin() const
+ { return container_detail::force_copy<const_reverse_iterator>(m_flat_tree.rbegin()); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the end
- //! of the reversed container.
- //!
+ //! of the reversed container.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ reverse_iterator rend()
+ { return container_detail::force_copy<reverse_iterator>(m_flat_tree.rend()); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed container.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ const_reverse_iterator rend() const
+ { return container_detail::force_copy<const_reverse_iterator>(m_flat_tree.rend()); }
+
+ //! <b>Effects</b>: Returns a const_iterator to the first element contained in the container.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ const_iterator cbegin() const
+ { return container_detail::force_copy<const_iterator>(m_flat_tree.cbegin()); }
+
+ //! <b>Effects</b>: Returns a const_iterator to the end of the container.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ const_iterator cend() const
+ { return container_detail::force_copy<const_iterator>(m_flat_tree.cend()); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- reverse_iterator rend()
- { return container_detail::force<reverse_iterator>(m_flat_tree.rend()); }
+ const_reverse_iterator crbegin() const
+ { return container_detail::force_copy<const_reverse_iterator>(m_flat_tree.crbegin()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
- //! of the reversed container.
- //!
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator rend() const
- { return container_detail::force<const_reverse_iterator>(m_flat_tree.rend()); }
+ const_reverse_iterator crend() const
+ { return container_detail::force_copy<const_reverse_iterator>(m_flat_tree.crend()); }
//! <b>Effects</b>: Returns true if the container contains no elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- bool empty() const
+ bool empty() const
{ return m_flat_tree.empty(); }
//! <b>Effects</b>: Returns the number of the elements contained in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- size_type size() const
+ size_type size() const
{ return m_flat_tree.size(); }
//! <b>Effects</b>: Returns the largest possible size of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- size_type max_size() const
+ size_type max_size() const
{ return m_flat_tree.max_size(); }
//! <b>Effects</b>: Swaps the contents of *this and x.
@@ -1112,33 +1219,36 @@ class flat_multimap
{ m_flat_tree.swap(x.m_flat_tree); }
//! <b>Effects</b>: Inserts x and returns the iterator pointing to the
- //! newly inserted element.
+ //! newly inserted element.
//!
//! <b>Complexity</b>: Logarithmic search time plus linear insertion
//! to the elements with bigger keys than x.
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
- iterator insert(const value_type& x)
- { return container_detail::force_copy<iterator>(m_flat_tree.insert_equal(container_detail::force<impl_value_type>(x))); }
+ iterator insert(const value_type& x)
+ {
+ return container_detail::force_copy<iterator>(
+ m_flat_tree.insert_equal(container_detail::force<impl_value_type>(x)));
+ }
- //! <b>Effects</b>: Inserts a new value move-constructed from x and returns
- //! the iterator pointing to the newly inserted element.
+ //! <b>Effects</b>: Inserts a new value move-constructed from x and returns
+ //! the iterator pointing to the newly inserted element.
//!
//! <b>Complexity</b>: Logarithmic search time plus linear insertion
//! to the elements with bigger keys than x.
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
- iterator insert(BOOST_RV_REF(value_type) x)
+ iterator insert(BOOST_RV_REF(value_type) x)
{ return container_detail::force_copy<iterator>(m_flat_tree.insert_equal(boost::move(x))); }
- //! <b>Effects</b>: Inserts a new value move-constructed from x and returns
- //! the iterator pointing to the newly inserted element.
+ //! <b>Effects</b>: Inserts a new value move-constructed from x and returns
+ //! the iterator pointing to the newly inserted element.
//!
//! <b>Complexity</b>: Logarithmic search time plus linear insertion
//! to the elements with bigger keys than x.
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
- iterator insert(BOOST_RV_REF(impl_value_type) x)
+ iterator insert(BOOST_RV_REF(impl_value_type) x)
{ return container_detail::force_copy<iterator>(m_flat_tree.insert_equal(boost::move(x))); }
//! <b>Effects</b>: Inserts a copy of x in the container.
@@ -1152,9 +1262,12 @@ class flat_multimap
//! to the elements with bigger keys than x.
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
- iterator insert(const_iterator position, const value_type& x)
- { return container_detail::force_copy<iterator>
- (m_flat_tree.insert_equal(container_detail::force<impl_const_iterator>(position), container_detail::force<impl_value_type>(x))); }
+ iterator insert(const_iterator position, const value_type& x)
+ {
+ return container_detail::force_copy<iterator>
+ (m_flat_tree.insert_equal( container_detail::force_copy<impl_const_iterator>(position)
+ , container_detail::force<impl_value_type>(x)));
+ }
//! <b>Effects</b>: Inserts a value move constructed from x in the container.
//! p is a hint pointing to where the insert should start to search.
@@ -1167,10 +1280,10 @@ class flat_multimap
//! to the elements with bigger keys than x.
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
- iterator insert(const_iterator position, BOOST_RV_REF(value_type) x)
+ iterator insert(const_iterator position, BOOST_RV_REF(value_type) x)
{
return container_detail::force_copy<iterator>
- (m_flat_tree.insert_equal(container_detail::force<impl_const_iterator>(position)
+ (m_flat_tree.insert_equal(container_detail::force_copy<impl_const_iterator>(position)
, boost::move(x)));
}
@@ -1185,10 +1298,10 @@ class flat_multimap
//! to the elements with bigger keys than x.
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
- iterator insert(const_iterator position, BOOST_RV_REF(impl_value_type) x)
+ iterator insert(const_iterator position, BOOST_RV_REF(impl_value_type) x)
{
return container_detail::force_copy<iterator>(
- m_flat_tree.insert_equal(container_detail::force<impl_const_iterator>(position), boost::move(x)));
+ m_flat_tree.insert_equal(container_detail::force_copy<impl_const_iterator>(position), boost::move(x)));
}
//! <b>Requires</b>: first, last are not iterators into *this.
@@ -1200,14 +1313,30 @@ class flat_multimap
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
template <class InputIterator>
- void insert(InputIterator first, InputIterator last)
+ void insert(InputIterator first, InputIterator last)
{ m_flat_tree.insert_equal(first, last); }
+ //! <b>Requires</b>: first, last are not iterators into *this.
+ //!
+ //! <b>Requires</b>: [first ,last) must be ordered according to the predicate.
+ //!
+ //! <b>Effects</b>: inserts each element from the range [first,last) if and only
+ //! if there is no element with key equivalent to the key of that element. This
+ //! function is more efficient than the normal range creation for ordered ranges.
+ //!
+ //! <b>Complexity</b>: At most N log(size()+N) (N is the distance from first to last)
+ //! search time plus N*size() insertion time.
+ //!
+ //! <b>Note</b>: If an element is inserted it might invalidate elements.
+ template <class InputIterator>
+ void insert(ordered_range_t, InputIterator first, InputIterator last)
+ { m_flat_tree.insert_equal(ordered_range, first, last); }
+
#if defined(BOOST_CONTAINER_PERFECT_FORWARDING) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
//! <b>Effects</b>: Inserts an object of type T constructed with
//! std::forward<Args>(args)... and returns the iterator pointing to the
- //! newly inserted element.
+ //! newly inserted element.
//!
//! <b>Complexity</b>: Logarithmic search time plus linear insertion
//! to the elements with bigger keys than x.
@@ -1233,7 +1362,7 @@ class flat_multimap
iterator emplace_hint(const_iterator hint, Args&&... args)
{
return container_detail::force_copy<iterator>(m_flat_tree.emplace_hint_equal
- (container_detail::force<impl_const_iterator>(hint), boost::forward<Args>(args)...));
+ (container_detail::force_copy<impl_const_iterator>(hint), boost::forward<Args>(args)...));
}
#else //#ifdef BOOST_CONTAINER_PERFECT_FORWARDING
@@ -1248,7 +1377,7 @@ class flat_multimap
iterator emplace_hint(const_iterator hint \
BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \
{ return container_detail::force_copy<iterator>(m_flat_tree.emplace_hint_equal \
- (container_detail::force<impl_const_iterator>(hint) \
+ (container_detail::force_copy<impl_const_iterator>(hint) \
BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _))); } \
//!
#define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS)
@@ -1259,15 +1388,18 @@ class flat_multimap
//! <b>Effects</b>: Erases the element pointed to by position.
//!
//! <b>Returns</b>: Returns an iterator pointing to the element immediately
- //! following q prior to the element being erased. If no such element exists,
+ //! following q prior to the element being erased. If no such element exists,
//! returns end().
//!
//! <b>Complexity</b>: Linear to the elements with keys bigger than position
//!
//! <b>Note</b>: Invalidates elements with keys
//! not less than the erased element.
- iterator erase(const_iterator position)
- { return container_detail::force_copy<iterator>(m_flat_tree.erase(container_detail::force<impl_const_iterator>(position))); }
+ iterator erase(const_iterator position)
+ {
+ return container_detail::force_copy<iterator>(
+ m_flat_tree.erase(container_detail::force_copy<impl_const_iterator>(position)));
+ }
//! <b>Effects</b>: Erases all elements in the container with key equivalent to x.
//!
@@ -1275,7 +1407,7 @@ class flat_multimap
//!
//! <b>Complexity</b>: Logarithmic search time plus erasure time
//! linear to the elements with bigger keys.
- size_type erase(const key_type& x)
+ size_type erase(const key_type& x)
{ return m_flat_tree.erase(x); }
//! <b>Effects</b>: Erases all the elements in the range [first, last).
@@ -1287,15 +1419,18 @@ class flat_multimap
//! <b>Complexity</b>: Logarithmic search time plus erasure time
//! linear to the elements with bigger keys.
iterator erase(const_iterator first, const_iterator last)
- { return container_detail::force_copy<iterator>
- (m_flat_tree.erase(container_detail::force<impl_const_iterator>(first), container_detail::force<impl_const_iterator>(last))); }
+ {
+ return container_detail::force_copy<iterator>
+ (m_flat_tree.erase( container_detail::force_copy<impl_const_iterator>(first)
+ , container_detail::force_copy<impl_const_iterator>(last)));
+ }
//! <b>Effects</b>: erase(a.begin(),a.end()).
//!
//! <b>Postcondition</b>: size() == 0.
//!
//! <b>Complexity</b>: linear in size().
- void clear()
+ void clear()
{ m_flat_tree.clear(); }
//! <b>Effects</b>: Tries to deallocate the excess of memory created
@@ -1318,75 +1453,75 @@ class flat_multimap
//! equivalent to x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic.
- const_iterator find(const key_type& x) const
- { return container_detail::force<const_iterator>(m_flat_tree.find(x)); }
+ const_iterator find(const key_type& x) const
+ { return container_detail::force_copy<const_iterator>(m_flat_tree.find(x)); }
//! <b>Returns</b>: The number of elements with key equivalent to x.
//!
//! <b>Complexity</b>: log(size())+count(k)
- size_type count(const key_type& x) const
+ size_type count(const key_type& x) const
{ return m_flat_tree.count(x); }
//! <b>Returns</b>: An iterator pointing to the first element with key not less
//! than k, or a.end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic
- iterator lower_bound(const key_type& x)
+ iterator lower_bound(const key_type& x)
{return container_detail::force_copy<iterator>(m_flat_tree.lower_bound(x)); }
//! <b>Returns</b>: A const iterator pointing to the first element with key
//! not less than k, or a.end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic
- const_iterator lower_bound(const key_type& x) const
- { return container_detail::force<const_iterator>(m_flat_tree.lower_bound(x)); }
+ const_iterator lower_bound(const key_type& x) const
+ { return container_detail::force_copy<const_iterator>(m_flat_tree.lower_bound(x)); }
//! <b>Returns</b>: An iterator pointing to the first element with key not less
//! than x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic
- iterator upper_bound(const key_type& x)
+ iterator upper_bound(const key_type& x)
{return container_detail::force_copy<iterator>(m_flat_tree.upper_bound(x)); }
//! <b>Returns</b>: A const iterator pointing to the first element with key
//! not less than x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic
- const_iterator upper_bound(const key_type& x) const
- { return container_detail::force<const_iterator>(m_flat_tree.upper_bound(x)); }
+ const_iterator upper_bound(const key_type& x) const
+ { return container_detail::force_copy<const_iterator>(m_flat_tree.upper_bound(x)); }
//! <b>Effects</b>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).
//!
//! <b>Complexity</b>: Logarithmic
- std::pair<iterator,iterator> equal_range(const key_type& x)
+ std::pair<iterator,iterator> equal_range(const key_type& x)
{ return container_detail::force_copy<std::pair<iterator,iterator> >(m_flat_tree.equal_range(x)); }
//! <b>Effects</b>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).
//!
//! <b>Complexity</b>: Logarithmic
- std::pair<const_iterator,const_iterator>
- equal_range(const key_type& x) const
+ std::pair<const_iterator,const_iterator>
+ equal_range(const key_type& x) const
{ return container_detail::force_copy<std::pair<const_iterator,const_iterator> >(m_flat_tree.equal_range(x)); }
//! <b>Effects</b>: Number of elements for which memory has been allocated.
//! capacity() is always greater than or equal to size().
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- size_type capacity() const
+ size_type capacity() const
{ return m_flat_tree.capacity(); }
//! <b>Effects</b>: If n is less than or equal to capacity(), this call has no
//! effect. Otherwise, it is a request for allocation of additional memory.
//! If the request is successful, then capacity() is greater than or equal to
//! n; otherwise, capacity() is unchanged. In either case, size() is unchanged.
- //!
+ //!
//! <b>Throws</b>: If memory allocation allocation throws or T's copy constructor throws.
//!
//! <b>Note</b>: If capacity() is less than "count", iterators and references to
//! to values might be invalidated.
- void reserve(size_type count)
+ void reserve(size_type count)
{ m_flat_tree.reserve(count); }
/// @cond
@@ -1401,37 +1536,37 @@ class flat_multimap
};
template <class Key, class T, class Pred, class A>
-inline bool operator==(const flat_multimap<Key,T,Pred,A>& x,
- const flat_multimap<Key,T,Pred,A>& y)
+inline bool operator==(const flat_multimap<Key,T,Pred,A>& x,
+ const flat_multimap<Key,T,Pred,A>& y)
{ return x.m_flat_tree == y.m_flat_tree; }
template <class Key, class T, class Pred, class A>
-inline bool operator<(const flat_multimap<Key,T,Pred,A>& x,
- const flat_multimap<Key,T,Pred,A>& y)
+inline bool operator<(const flat_multimap<Key,T,Pred,A>& x,
+ const flat_multimap<Key,T,Pred,A>& y)
{ return x.m_flat_tree < y.m_flat_tree; }
template <class Key, class T, class Pred, class A>
-inline bool operator!=(const flat_multimap<Key,T,Pred,A>& x,
- const flat_multimap<Key,T,Pred,A>& y)
+inline bool operator!=(const flat_multimap<Key,T,Pred,A>& x,
+ const flat_multimap<Key,T,Pred,A>& y)
{ return !(x == y); }
template <class Key, class T, class Pred, class A>
-inline bool operator>(const flat_multimap<Key,T,Pred,A>& x,
- const flat_multimap<Key,T,Pred,A>& y)
+inline bool operator>(const flat_multimap<Key,T,Pred,A>& x,
+ const flat_multimap<Key,T,Pred,A>& y)
{ return y < x; }
template <class Key, class T, class Pred, class A>
-inline bool operator<=(const flat_multimap<Key,T,Pred,A>& x,
- const flat_multimap<Key,T,Pred,A>& y)
+inline bool operator<=(const flat_multimap<Key,T,Pred,A>& x,
+ const flat_multimap<Key,T,Pred,A>& y)
{ return !(y < x); }
template <class Key, class T, class Pred, class A>
-inline bool operator>=(const flat_multimap<Key,T,Pred,A>& x,
- const flat_multimap<Key,T,Pred,A>& y)
+inline bool operator>=(const flat_multimap<Key,T,Pred,A>& x,
+ const flat_multimap<Key,T,Pred,A>& y)
{ return !(x < y); }
template <class Key, class T, class Pred, class A>
-inline void swap(flat_multimap<Key,T,Pred,A>& x, flat_multimap<Key,T,Pred,A>& y)
+inline void swap(flat_multimap<Key,T,Pred,A>& x, flat_multimap<Key,T,Pred,A>& y)
{ x.swap(y); }
}}
@@ -1448,7 +1583,7 @@ struct has_trivial_destructor_after_move< boost::container::flat_multimap<K, T,
static const bool value = has_trivial_destructor<A>::value && has_trivial_destructor<C>::value;
};
*/
-} //namespace boost {
+} //namespace boost {
/// @endcond
diff --git a/boost/container/flat_set.hpp b/boost/container/flat_set.hpp
index f36730972e..09c95eb2f5 100644
--- a/boost/container/flat_set.hpp
+++ b/boost/container/flat_set.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -45,31 +45,31 @@ template <class T, class Pred, class A>
class flat_set;
template <class T, class Pred, class A>
-inline bool operator==(const flat_set<T,Pred,A>& x,
+inline bool operator==(const flat_set<T,Pred,A>& x,
const flat_set<T,Pred,A>& y);
template <class T, class Pred, class A>
-inline bool operator<(const flat_set<T,Pred,A>& x,
+inline bool operator<(const flat_set<T,Pred,A>& x,
const flat_set<T,Pred,A>& y);
/// @endcond
-//! flat_set is a Sorted Associative Container that stores objects of type Key.
-//! flat_set is a Simple Associative Container, meaning that its value type,
-//! as well as its key type, is Key. It is also a Unique Associative Container,
-//! meaning that no two elements are the same.
-//!
+//! flat_set is a Sorted Associative Container that stores objects of type Key.
+//! flat_set is a Simple Associative Container, meaning that its value type,
+//! as well as its key type, is Key. It is also a Unique Associative Container,
+//! meaning that no two elements are the same.
+//!
//! flat_set is similar to std::set but it's implemented like an ordered vector.
//! This means that inserting a new element into a flat_set invalidates
//! previous iterators and references
//!
-//! Erasing an element of a flat_set invalidates iterators and references
+//! Erasing an element of a flat_set invalidates iterators and references
//! pointing to elements that come after (their keys are bigger) the erased element.
#ifdef BOOST_CONTAINER_DOXYGEN_INVOKED
template <class T, class Pred = std::less<T>, class A = std::allocator<T> >
#else
template <class T, class Pred, class A>
#endif
-class flat_set
+class flat_set
{
/// @cond
private:
@@ -100,227 +100,245 @@ class flat_set
typedef typename tree_t::allocator_type allocator_type;
typedef typename tree_t::stored_allocator_type stored_allocator_type;
- //! <b>Effects</b>: Defatuls constructs an empty flat_map.
- //!
+ //! <b>Effects</b>: Default constructs an empty flat_set.
+ //!
//! <b>Complexity</b>: Constant.
explicit flat_set()
: m_flat_tree()
{}
- //! <b>Effects</b>: Constructs an empty flat_map using the specified
+ //! <b>Effects</b>: Constructs an empty flat_set using the specified
//! comparison object and allocator.
- //!
+ //!
//! <b>Complexity</b>: Constant.
explicit flat_set(const Pred& comp,
const allocator_type& a = allocator_type())
: m_flat_tree(comp, a)
{}
- //! <b>Effects</b>: Constructs an empty map using the specified comparison object and
+ //! <b>Effects</b>: Constructs an empty set using the specified comparison object and
//! allocator, and inserts elements from the range [first ,last ).
- //!
- //! <b>Complexity</b>: Linear in N if the range [first ,last ) is already sorted using
+ //!
+ //! <b>Complexity</b>: Linear in N if the range [first ,last ) is already sorted using
//! comp and otherwise N logN, where N is last - first.
template <class InputIterator>
- flat_set(InputIterator first, InputIterator last,
+ flat_set(InputIterator first, InputIterator last,
const Pred& comp = Pred(),
const allocator_type& a = allocator_type())
- : m_flat_tree(comp, a)
+ : m_flat_tree(comp, a)
{ m_flat_tree.insert_unique(first, last); }
- //! <b>Effects</b>: Constructs an empty flat_set using the specified comparison object and
+ //! <b>Effects</b>: Constructs an empty flat_set using the specified comparison object and
//! allocator, and inserts elements from the ordered unique range [first ,last). This function
//! is more efficient than the normal range creation for ordered ranges.
//!
//! <b>Requires</b>: [first ,last) must be ordered according to the predicate and must be
//! unique values.
- //!
+ //!
//! <b>Complexity</b>: Linear in N.
+ //!
+ //! <b>Note</b>: Non-standard extension.
template <class InputIterator>
- flat_set(ordered_unique_range_t, InputIterator first, InputIterator last,
+ flat_set(ordered_unique_range_t, InputIterator first, InputIterator last,
const Pred& comp = Pred(),
const allocator_type& a = allocator_type())
- : m_flat_tree(ordered_range, first, last, comp, a)
+ : m_flat_tree(ordered_range, first, last, comp, a)
{}
- //! <b>Effects</b>: Copy constructs a map.
- //!
+ //! <b>Effects</b>: Copy constructs a set.
+ //!
//! <b>Complexity</b>: Linear in x.size().
- flat_set(const flat_set<T,Pred,A>& x)
- : m_flat_tree(x.m_flat_tree) {}
+ flat_set(const flat_set& x)
+ : m_flat_tree(x.m_flat_tree)
+ {}
- //! <b>Effects</b>: Move constructs a map. Constructs *this using x's resources.
- //!
- //! <b>Complexity</b>: Construct.
- //!
+ //! <b>Effects</b>: Move constructs a set. Constructs *this using x's resources.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Postcondition</b>: x is emptied.
- flat_set(BOOST_RV_REF(flat_set) mx)
+ flat_set(BOOST_RV_REF(flat_set) mx)
: m_flat_tree(boost::move(mx.m_flat_tree))
{}
+ //! <b>Effects</b>: Copy constructs a set using the specified allocator.
+ //!
+ //! <b>Complexity</b>: Linear in x.size().
+ flat_set(const flat_set& x, const allocator_type &a)
+ : m_flat_tree(x.m_flat_tree, a)
+ {}
+
+ //! <b>Effects</b>: Move constructs a set using the specified allocator.
+ //! Constructs *this using x's resources.
+ //!
+ //! <b>Complexity</b>: Constant if a == mx.get_allocator(), linear otherwise
+ flat_set(BOOST_RV_REF(flat_set) mx, const allocator_type &a)
+ : m_flat_tree(boost::move(mx.m_flat_tree), a)
+ {}
+
//! <b>Effects</b>: Makes *this a copy of x.
- //!
+ //!
//! <b>Complexity</b>: Linear in x.size().
- flat_set<T,Pred,A>& operator=(BOOST_COPY_ASSIGN_REF(flat_set) x)
+ flat_set& operator=(BOOST_COPY_ASSIGN_REF(flat_set) x)
{ m_flat_tree = x.m_flat_tree; return *this; }
- //! <b>Effects</b>: Makes *this a copy of x.
- //!
+ //! <b>Effects</b>: Makes *this a copy of the previous value of xx.
+ //!
//! <b>Complexity</b>: Linear in x.size().
- flat_set<T,Pred,A>& operator=(BOOST_RV_REF(flat_set) mx)
+ flat_set& operator=(BOOST_RV_REF(flat_set) mx)
{ m_flat_tree = boost::move(mx.m_flat_tree); return *this; }
//! <b>Effects</b>: Returns the comparison object out
//! of which a was constructed.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- key_compare key_comp() const
+ key_compare key_comp() const
{ return m_flat_tree.key_comp(); }
//! <b>Effects</b>: Returns an object of value_compare constructed out
//! of the comparison object.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- value_compare value_comp() const
+ value_compare value_comp() const
{ return m_flat_tree.key_comp(); }
//! <b>Effects</b>: Returns a copy of the Allocator that
//! was passed to the object's constructor.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- allocator_type get_allocator() const
+ allocator_type get_allocator() const
{ return m_flat_tree.get_allocator(); }
- const stored_allocator_type &get_stored_allocator() const
+ const stored_allocator_type &get_stored_allocator() const
{ return m_flat_tree.get_stored_allocator(); }
stored_allocator_type &get_stored_allocator()
{ return m_flat_tree.get_stored_allocator(); }
//! <b>Effects</b>: Returns an iterator to the first element contained in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- iterator begin()
+ iterator begin()
{ return m_flat_tree.begin(); }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator begin() const
+ const_iterator begin() const
{ return m_flat_tree.begin(); }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator cbegin() const
+ const_iterator cbegin() const
{ return m_flat_tree.cbegin(); }
//! <b>Effects</b>: Returns an iterator to the end of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- iterator end()
+ iterator end()
{ return m_flat_tree.end(); }
//! <b>Effects</b>: Returns a const_iterator to the end of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator end() const
+ const_iterator end() const
{ return m_flat_tree.end(); }
//! <b>Effects</b>: Returns a const_iterator to the end of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator cend() const
+ const_iterator cend() const
{ return m_flat_tree.cend(); }
- //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
- //! of the reversed container.
- //!
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- reverse_iterator rbegin()
- { return m_flat_tree.rbegin(); }
+ reverse_iterator rbegin()
+ { return m_flat_tree.rbegin(); }
- //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
- //! of the reversed container.
- //!
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator rbegin() const
- { return m_flat_tree.rbegin(); }
+ const_reverse_iterator rbegin() const
+ { return m_flat_tree.rbegin(); }
- //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
- //! of the reversed container.
- //!
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator crbegin() const
- { return m_flat_tree.crbegin(); }
+ const_reverse_iterator crbegin() const
+ { return m_flat_tree.crbegin(); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the end
- //! of the reversed container.
- //!
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
reverse_iterator rend()
{ return m_flat_tree.rend(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
- //! of the reversed container.
- //!
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator rend() const
+ const_reverse_iterator rend() const
{ return m_flat_tree.rend(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
- //! of the reversed container.
- //!
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator crend() const
+ const_reverse_iterator crend() const
{ return m_flat_tree.crend(); }
//! <b>Effects</b>: Returns true if the container contains no elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- bool empty() const
+ bool empty() const
{ return m_flat_tree.empty(); }
//! <b>Effects</b>: Returns the number of the elements contained in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- size_type size() const
+ size_type size() const
{ return m_flat_tree.size(); }
//! <b>Effects</b>: Returns the largest possible size of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- size_type max_size() const
+ size_type max_size() const
{ return m_flat_tree.max_size(); }
//! <b>Effects</b>: Swaps the contents of *this and x.
@@ -331,10 +349,10 @@ class flat_set
void swap(flat_set& x)
{ m_flat_tree.swap(x.m_flat_tree); }
- //! <b>Effects</b>: Inserts x if and only if there is no element in the container
+ //! <b>Effects</b>: Inserts x if and only if there is no element in the container
//! with key equivalent to the key of x.
//!
- //! <b>Returns</b>: The bool component of the returned pair is true if and only
+ //! <b>Returns</b>: The bool component of the returned pair is true if and only
//! if the insertion takes place, and the iterator component of the pair
//! points to the element with key equivalent to the key of x.
//!
@@ -342,7 +360,7 @@ class flat_set
//! to the elements with bigger keys than x.
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
- std::pair<iterator, bool> insert(insert_const_ref_type x)
+ std::pair<iterator, bool> insert(insert_const_ref_type x)
{ return priv_insert(x); }
#if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
@@ -357,7 +375,7 @@ class flat_set
//! <b>Effects</b>: Inserts a new value_type move constructed from the pair if and
//! only if there is no element in the container with key equivalent to the key of x.
//!
- //! <b>Returns</b>: The bool component of the returned pair is true if and only
+ //! <b>Returns</b>: The bool component of the returned pair is true if and only
//! if the insertion takes place, and the iterator component of the pair
//! points to the element with key equivalent to the key of x.
//!
@@ -365,10 +383,10 @@ class flat_set
//! to the elements with bigger keys than x.
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
- std::pair<iterator,bool> insert(BOOST_RV_REF(value_type) x)
+ std::pair<iterator,bool> insert(BOOST_RV_REF(value_type) x)
{ return m_flat_tree.insert_unique(boost::move(x)); }
- //! <b>Effects</b>: Inserts a copy of x in the container if and only if there is
+ //! <b>Effects</b>: Inserts a copy of x in the container if and only if there is
//! no element in the container with key equivalent to the key of x.
//! p is a hint pointing to where the insert should start to search.
//!
@@ -379,7 +397,7 @@ class flat_set
//! right before p) plus insertion linear to the elements with bigger keys than x.
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
- iterator insert(const_iterator p, insert_const_ref_type x)
+ iterator insert(const_iterator p, insert_const_ref_type x)
{ return priv_insert(p, x); }
#if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
@@ -400,12 +418,12 @@ class flat_set
//! right before p) plus insertion linear to the elements with bigger keys than x.
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
- iterator insert(const_iterator position, BOOST_RV_REF(value_type) x)
+ iterator insert(const_iterator position, BOOST_RV_REF(value_type) x)
{ return m_flat_tree.insert_unique(position, boost::move(x)); }
//! <b>Requires</b>: first, last are not iterators into *this.
//!
- //! <b>Effects</b>: inserts each element from the range [first,last) if and only
+ //! <b>Effects</b>: inserts each element from the range [first,last) if and only
//! if there is no element with key equivalent to the key of that element.
//!
//! <b>Complexity</b>: At most N log(size()+N) (N is the distance from first to last)
@@ -413,16 +431,31 @@ class flat_set
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
template <class InputIterator>
- void insert(InputIterator first, InputIterator last)
+ void insert(InputIterator first, InputIterator last)
{ m_flat_tree.insert_unique(first, last); }
+ //! <b>Requires</b>: first, last are not iterators into *this and
+ //! must be ordered according to the predicate and must be
+ //! unique values.
+ //!
+ //! <b>Effects</b>: inserts each element from the range [first,last) .This function
+ //! is more efficient than the normal range creation for ordered ranges.
+ //!
+ //! <b>Complexity</b>: At most N log(size()+N) (N is the distance from first to last)
+ //! search time plus N*size() insertion time.
+ //!
+ //! <b>Note</b>: Non-standard extension. If an element is inserted it might invalidate elements.
+ template <class InputIterator>
+ void insert(ordered_unique_range_t, InputIterator first, InputIterator last)
+ { m_flat_tree.insert_unique(ordered_unique_range, first, last); }
+
#if defined(BOOST_CONTAINER_PERFECT_FORWARDING) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
//! <b>Effects</b>: Inserts an object x of type T constructed with
- //! std::forward<Args>(args)... if and only if there is no element in the container
+ //! std::forward<Args>(args)... if and only if there is no element in the container
//! with key equivalent to the key of x.
//!
- //! <b>Returns</b>: The bool component of the returned pair is true if and only
+ //! <b>Returns</b>: The bool component of the returned pair is true if and only
//! if the insertion takes place, and the iterator component of the pair
//! points to the element with key equivalent to the key of x.
//!
@@ -435,7 +468,7 @@ class flat_set
{ return m_flat_tree.emplace_unique(boost::forward<Args>(args)...); }
//! <b>Effects</b>: Inserts an object of type T constructed with
- //! std::forward<Args>(args)... in the container if and only if there is
+ //! std::forward<Args>(args)... in the container if and only if there is
//! no element in the container with key equivalent to the key of x.
//! p is a hint pointing to where the insert should start to search.
//!
@@ -471,14 +504,14 @@ class flat_set
//! <b>Effects</b>: Erases the element pointed to by position.
//!
//! <b>Returns</b>: Returns an iterator pointing to the element immediately
- //! following q prior to the element being erased. If no such element exists,
+ //! following q prior to the element being erased. If no such element exists,
//! returns end().
//!
//! <b>Complexity</b>: Linear to the elements with keys bigger than position
//!
//! <b>Note</b>: Invalidates elements with keys
//! not less than the erased element.
- iterator erase(const_iterator position)
+ iterator erase(const_iterator position)
{ return m_flat_tree.erase(position); }
//! <b>Effects</b>: Erases all elements in the container with key equivalent to x.
@@ -487,7 +520,7 @@ class flat_set
//!
//! <b>Complexity</b>: Logarithmic search time plus erasure time
//! linear to the elements with bigger keys.
- size_type erase(const key_type& x)
+ size_type erase(const key_type& x)
{ return m_flat_tree.erase(x); }
//! <b>Effects</b>: Erases all the elements in the range [first, last).
@@ -498,7 +531,7 @@ class flat_set
//!
//! <b>Complexity</b>: Logarithmic search time plus erasure time
//! linear to the elements with bigger keys.
- iterator erase(const_iterator first, const_iterator last)
+ iterator erase(const_iterator first, const_iterator last)
{ return m_flat_tree.erase(first, last); }
//! <b>Effects</b>: erase(a.begin(),a.end()).
@@ -506,7 +539,7 @@ class flat_set
//! <b>Postcondition</b>: size() == 0.
//!
//! <b>Complexity</b>: linear in size().
- void clear()
+ void clear()
{ m_flat_tree.clear(); }
//! <b>Effects</b>: Tries to deallocate the excess of memory created
@@ -522,34 +555,34 @@ class flat_set
//! equivalent to x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic.
- iterator find(const key_type& x)
+ iterator find(const key_type& x)
{ return m_flat_tree.find(x); }
//! <b>Returns</b>: A const_iterator pointing to an element with the key
//! equivalent to x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic.s
- const_iterator find(const key_type& x) const
+ const_iterator find(const key_type& x) const
{ return m_flat_tree.find(x); }
//! <b>Returns</b>: The number of elements with key equivalent to x.
//!
//! <b>Complexity</b>: log(size())+count(k)
- size_type count(const key_type& x) const
+ size_type count(const key_type& x) const
{ return m_flat_tree.find(x) == m_flat_tree.end() ? 0 : 1; }
//! <b>Returns</b>: An iterator pointing to the first element with key not less
//! than k, or a.end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic
- iterator lower_bound(const key_type& x)
+ iterator lower_bound(const key_type& x)
{ return m_flat_tree.lower_bound(x); }
//! <b>Returns</b>: A const iterator pointing to the first element with key not
//! less than k, or a.end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic
- const_iterator lower_bound(const key_type& x) const
+ const_iterator lower_bound(const key_type& x) const
{ return m_flat_tree.lower_bound(x); }
//! <b>Returns</b>: An iterator pointing to the first element with key not less
@@ -563,42 +596,42 @@ class flat_set
//! less than x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic
- const_iterator upper_bound(const key_type& x) const
+ const_iterator upper_bound(const key_type& x) const
{ return m_flat_tree.upper_bound(x); }
//! <b>Effects</b>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).
//!
//! <b>Complexity</b>: Logarithmic
- std::pair<const_iterator, const_iterator>
- equal_range(const key_type& x) const
+ std::pair<const_iterator, const_iterator>
+ equal_range(const key_type& x) const
{ return m_flat_tree.equal_range(x); }
//! <b>Effects</b>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).
//!
//! <b>Complexity</b>: Logarithmic
- std::pair<iterator,iterator>
- equal_range(const key_type& x)
+ std::pair<iterator,iterator>
+ equal_range(const key_type& x)
{ return m_flat_tree.equal_range(x); }
//! <b>Effects</b>: Number of elements for which memory has been allocated.
//! capacity() is always greater than or equal to size().
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- size_type capacity() const
+ size_type capacity() const
{ return m_flat_tree.capacity(); }
//! <b>Effects</b>: If n is less than or equal to capacity(), this call has no
//! effect. Otherwise, it is a request for allocation of additional memory.
//! If the request is successful, then capacity() is greater than or equal to
//! n; otherwise, capacity() is unchanged. In either case, size() is unchanged.
- //!
+ //!
//! <b>Throws</b>: If memory allocation allocation throws or T's copy constructor throws.
//!
//! <b>Note</b>: If capacity() is less than "count", iterators and references to
//! to values might be invalidated.
- void reserve(size_type count)
+ void reserve(size_type count)
{ m_flat_tree.reserve(count); }
/// @cond
@@ -609,46 +642,46 @@ class flat_set
friend bool operator< (const flat_set<K1,C1,A1>&, const flat_set<K1,C1,A1>&);
private:
- std::pair<iterator, bool> priv_insert(const T &x)
+ std::pair<iterator, bool> priv_insert(const T &x)
{ return m_flat_tree.insert_unique(x); }
- iterator priv_insert(const_iterator p, const T &x)
+ iterator priv_insert(const_iterator p, const T &x)
{ return m_flat_tree.insert_unique(p, x); }
/// @endcond
};
template <class T, class Pred, class A>
-inline bool operator==(const flat_set<T,Pred,A>& x,
- const flat_set<T,Pred,A>& y)
+inline bool operator==(const flat_set<T,Pred,A>& x,
+ const flat_set<T,Pred,A>& y)
{ return x.m_flat_tree == y.m_flat_tree; }
template <class T, class Pred, class A>
-inline bool operator<(const flat_set<T,Pred,A>& x,
- const flat_set<T,Pred,A>& y)
+inline bool operator<(const flat_set<T,Pred,A>& x,
+ const flat_set<T,Pred,A>& y)
{ return x.m_flat_tree < y.m_flat_tree; }
template <class T, class Pred, class A>
-inline bool operator!=(const flat_set<T,Pred,A>& x,
- const flat_set<T,Pred,A>& y)
+inline bool operator!=(const flat_set<T,Pred,A>& x,
+ const flat_set<T,Pred,A>& y)
{ return !(x == y); }
template <class T, class Pred, class A>
-inline bool operator>(const flat_set<T,Pred,A>& x,
- const flat_set<T,Pred,A>& y)
+inline bool operator>(const flat_set<T,Pred,A>& x,
+ const flat_set<T,Pred,A>& y)
{ return y < x; }
template <class T, class Pred, class A>
-inline bool operator<=(const flat_set<T,Pred,A>& x,
- const flat_set<T,Pred,A>& y)
+inline bool operator<=(const flat_set<T,Pred,A>& x,
+ const flat_set<T,Pred,A>& y)
{ return !(y < x); }
template <class T, class Pred, class A>
-inline bool operator>=(const flat_set<T,Pred,A>& x,
- const flat_set<T,Pred,A>& y)
+inline bool operator>=(const flat_set<T,Pred,A>& x,
+ const flat_set<T,Pred,A>& y)
{ return !(x < y); }
template <class T, class Pred, class A>
-inline void swap(flat_set<T,Pred,A>& x, flat_set<T,Pred,A>& y)
+inline void swap(flat_set<T,Pred,A>& x, flat_set<T,Pred,A>& y)
{ x.swap(y); }
/// @cond
@@ -675,31 +708,31 @@ template <class T, class Pred, class A>
class flat_multiset;
template <class T, class Pred, class A>
-inline bool operator==(const flat_multiset<T,Pred,A>& x,
+inline bool operator==(const flat_multiset<T,Pred,A>& x,
const flat_multiset<T,Pred,A>& y);
template <class T, class Pred, class A>
-inline bool operator<(const flat_multiset<T,Pred,A>& x,
+inline bool operator<(const flat_multiset<T,Pred,A>& x,
const flat_multiset<T,Pred,A>& y);
/// @endcond
-//! flat_multiset is a Sorted Associative Container that stores objects of type Key.
-//! flat_multiset is a Simple Associative Container, meaning that its value type,
+//! flat_multiset is a Sorted Associative Container that stores objects of type Key.
+//! flat_multiset is a Simple Associative Container, meaning that its value type,
//! as well as its key type, is Key.
//! flat_Multiset can store multiple copies of the same key value.
-//!
+//!
//! flat_multiset is similar to std::multiset but it's implemented like an ordered vector.
//! This means that inserting a new element into a flat_multiset invalidates
//! previous iterators and references
//!
-//! Erasing an element of a flat_multiset invalidates iterators and references
+//! Erasing an element of a flat_multiset invalidates iterators and references
//! pointing to elements that come after (their keys are equal or bigger) the erased element.
#ifdef BOOST_CONTAINER_DOXYGEN_INVOKED
template <class T, class Pred = std::less<T>, class A = std::allocator<T> >
#else
template <class T, class Pred, class A>
#endif
-class flat_multiset
+class flat_multiset
{
/// @cond
private:
@@ -729,8 +762,8 @@ class flat_multiset
typedef typename tree_t::allocator_type allocator_type;
typedef typename tree_t::stored_allocator_type stored_allocator_type;
- //! <b>Effects</b>: Defatuls constructs an empty flat_map.
- //!
+ //! <b>Effects</b>: Default constructs an empty flat_multiset.
+ //!
//! <b>Complexity</b>: Constant.
explicit flat_multiset()
: m_flat_tree()
@@ -744,187 +777,219 @@ class flat_multiset
flat_multiset(InputIterator first, InputIterator last,
const Pred& comp = Pred(),
const allocator_type& a = allocator_type())
- : m_flat_tree(comp, a)
+ : m_flat_tree(comp, a)
{ m_flat_tree.insert_equal(first, last); }
- //! <b>Effects</b>: Constructs an empty flat_multiset using the specified comparison object and
+ //! <b>Effects</b>: Constructs an empty flat_multiset using the specified comparison object and
//! allocator, and inserts elements from the ordered range [first ,last ). This function
//! is more efficient than the normal range creation for ordered ranges.
//!
//! <b>Requires</b>: [first ,last) must be ordered according to the predicate.
- //!
+ //!
//! <b>Complexity</b>: Linear in N.
+ //!
+ //! <b>Note</b>: Non-standard extension.
template <class InputIterator>
flat_multiset(ordered_range_t, InputIterator first, InputIterator last,
const Pred& comp = Pred(),
const allocator_type& a = allocator_type())
- : m_flat_tree(ordered_range, first, last, comp, a)
+ : m_flat_tree(ordered_range, first, last, comp, a)
{}
- flat_multiset(const flat_multiset<T,Pred,A>& x)
- : m_flat_tree(x.m_flat_tree) {}
+ //! <b>Effects</b>: Copy constructs a flat_multiset.
+ //!
+ //! <b>Complexity</b>: Linear in x.size().
+ flat_multiset(const flat_multiset& x)
+ : m_flat_tree(x.m_flat_tree)
+ {}
+
+ //! <b>Effects</b>: Move constructs a flat_multiset. Constructs *this using x's resources.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Postcondition</b>: x is emptied.
+ flat_multiset(BOOST_RV_REF(flat_multiset) mx)
+ : m_flat_tree(boost::move(mx.m_flat_tree))
+ {}
+
+ //! <b>Effects</b>: Copy constructs a flat_multiset using the specified allocator.
+ //!
+ //! <b>Complexity</b>: Linear in x.size().
+ flat_multiset(const flat_multiset& x, const allocator_type &a)
+ : m_flat_tree(x.m_flat_tree, a)
+ {}
- flat_multiset(BOOST_RV_REF(flat_multiset) x)
- : m_flat_tree(boost::move(x.m_flat_tree))
+ //! <b>Effects</b>: Move constructs a flat_multiset using the specified allocator.
+ //! Constructs *this using x's resources.
+ //!
+ //! <b>Complexity</b>: Constant if a == mx.get_allocator(), linear otherwise
+ flat_multiset(BOOST_RV_REF(flat_multiset) mx, const allocator_type &a)
+ : m_flat_tree(boost::move(mx.m_flat_tree), a)
{}
- flat_multiset<T,Pred,A>& operator=(BOOST_COPY_ASSIGN_REF(flat_multiset) x)
+ //! <b>Effects</b>: Makes *this a copy of x.
+ //!
+ //! <b>Complexity</b>: Linear in x.size().
+ flat_multiset& operator=(BOOST_COPY_ASSIGN_REF(flat_multiset) x)
{ m_flat_tree = x.m_flat_tree; return *this; }
- flat_multiset<T,Pred,A>& operator=(BOOST_RV_REF(flat_multiset) mx)
+ //! <b>Effects</b>: Makes *this a copy of x.
+ //!
+ //! <b>Complexity</b>: Linear in x.size().
+ flat_multiset& operator=(BOOST_RV_REF(flat_multiset) mx)
{ m_flat_tree = boost::move(mx.m_flat_tree); return *this; }
//! <b>Effects</b>: Returns the comparison object out
//! of which a was constructed.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- key_compare key_comp() const
+ key_compare key_comp() const
{ return m_flat_tree.key_comp(); }
//! <b>Effects</b>: Returns an object of value_compare constructed out
//! of the comparison object.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- value_compare value_comp() const
+ value_compare value_comp() const
{ return m_flat_tree.key_comp(); }
//! <b>Effects</b>: Returns a copy of the Allocator that
//! was passed to the object's constructor.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- allocator_type get_allocator() const
+ allocator_type get_allocator() const
{ return m_flat_tree.get_allocator(); }
- const stored_allocator_type &get_stored_allocator() const
+ const stored_allocator_type &get_stored_allocator() const
{ return m_flat_tree.get_stored_allocator(); }
stored_allocator_type &get_stored_allocator()
{ return m_flat_tree.get_stored_allocator(); }
//! <b>Effects</b>: Returns an iterator to the first element contained in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- iterator begin()
+ iterator begin()
{ return m_flat_tree.begin(); }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator begin() const
+ const_iterator begin() const
{ return m_flat_tree.begin(); }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator cbegin() const
+ const_iterator cbegin() const
{ return m_flat_tree.cbegin(); }
//! <b>Effects</b>: Returns an iterator to the end of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- iterator end()
+ iterator end()
{ return m_flat_tree.end(); }
//! <b>Effects</b>: Returns a const_iterator to the end of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator end() const
+ const_iterator end() const
{ return m_flat_tree.end(); }
//! <b>Effects</b>: Returns a const_iterator to the end of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator cend() const
+ const_iterator cend() const
{ return m_flat_tree.cend(); }
- //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
- //! of the reversed container.
- //!
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- reverse_iterator rbegin()
- { return m_flat_tree.rbegin(); }
+ reverse_iterator rbegin()
+ { return m_flat_tree.rbegin(); }
- //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
- //! of the reversed container.
- //!
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator rbegin() const
- { return m_flat_tree.rbegin(); }
+ const_reverse_iterator rbegin() const
+ { return m_flat_tree.rbegin(); }
- //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
- //! of the reversed container.
- //!
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator crbegin() const
- { return m_flat_tree.crbegin(); }
+ const_reverse_iterator crbegin() const
+ { return m_flat_tree.crbegin(); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the end
- //! of the reversed container.
- //!
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
reverse_iterator rend()
{ return m_flat_tree.rend(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
- //! of the reversed container.
- //!
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator rend() const
+ const_reverse_iterator rend() const
{ return m_flat_tree.rend(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
- //! of the reversed container.
- //!
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator crend() const
+ const_reverse_iterator crend() const
{ return m_flat_tree.crend(); }
//! <b>Effects</b>: Returns true if the container contains no elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- bool empty() const
+ bool empty() const
{ return m_flat_tree.empty(); }
//! <b>Effects</b>: Returns the number of the elements contained in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- size_type size() const
+ size_type size() const
{ return m_flat_tree.size(); }
//! <b>Effects</b>: Returns the largest possible size of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- size_type max_size() const
+ size_type max_size() const
{ return m_flat_tree.max_size(); }
//! <b>Effects</b>: Swaps the contents of *this and x.
@@ -936,13 +1001,13 @@ class flat_multiset
{ m_flat_tree.swap(x.m_flat_tree); }
//! <b>Effects</b>: Inserts x and returns the iterator pointing to the
- //! newly inserted element.
+ //! newly inserted element.
//!
//! <b>Complexity</b>: Logarithmic search time plus linear insertion
//! to the elements with bigger keys than x.
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
- iterator insert(insert_const_ref_type x)
+ iterator insert(insert_const_ref_type x)
{ return priv_insert(x); }
#if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
@@ -955,13 +1020,13 @@ class flat_multiset
#endif
//! <b>Effects</b>: Inserts a new value_type move constructed from x
- //! and returns the iterator pointing to the newly inserted element.
+ //! and returns the iterator pointing to the newly inserted element.
//!
//! <b>Complexity</b>: Logarithmic search time plus linear insertion
//! to the elements with bigger keys than x.
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
- iterator insert(BOOST_RV_REF(value_type) x)
+ iterator insert(BOOST_RV_REF(value_type) x)
{ return m_flat_tree.insert_equal(boost::move(x)); }
//! <b>Effects</b>: Inserts a copy of x in the container.
@@ -974,7 +1039,7 @@ class flat_multiset
//! right before p) plus insertion linear to the elements with bigger keys than x.
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
- iterator insert(const_iterator p, insert_const_ref_type x)
+ iterator insert(const_iterator p, insert_const_ref_type x)
{ return priv_insert(p, x); }
#if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
@@ -997,7 +1062,7 @@ class flat_multiset
//! right before p) plus insertion linear to the elements with bigger keys than x.
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
- iterator insert(const_iterator position, BOOST_RV_REF(value_type) x)
+ iterator insert(const_iterator position, BOOST_RV_REF(value_type) x)
{ return m_flat_tree.insert_equal(position, boost::move(x)); }
//! <b>Requires</b>: first, last are not iterators into *this.
@@ -1009,14 +1074,28 @@ class flat_multiset
//!
//! <b>Note</b>: If an element is inserted it might invalidate elements.
template <class InputIterator>
- void insert(InputIterator first, InputIterator last)
+ void insert(InputIterator first, InputIterator last)
{ m_flat_tree.insert_equal(first, last); }
+ //! <b>Requires</b>: first, last are not iterators into *this and
+ //! must be ordered according to the predicate.
+ //!
+ //! <b>Effects</b>: inserts each element from the range [first,last) .This function
+ //! is more efficient than the normal range creation for ordered ranges.
+ //!
+ //! <b>Complexity</b>: At most N log(size()+N) (N is the distance from first to last)
+ //! search time plus N*size() insertion time.
+ //!
+ //! <b>Note</b>: Non-standard extension. If an element is inserted it might invalidate elements.
+ template <class InputIterator>
+ void insert(ordered_range_t, InputIterator first, InputIterator last)
+ { m_flat_tree.insert_equal(ordered_range, first, last); }
+
#if defined(BOOST_CONTAINER_PERFECT_FORWARDING) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
//! <b>Effects</b>: Inserts an object of type T constructed with
//! std::forward<Args>(args)... and returns the iterator pointing to the
- //! newly inserted element.
+ //! newly inserted element.
//!
//! <b>Complexity</b>: Logarithmic search time plus linear insertion
//! to the elements with bigger keys than x.
@@ -1062,14 +1141,14 @@ class flat_multiset
//! <b>Effects</b>: Erases the element pointed to by position.
//!
//! <b>Returns</b>: Returns an iterator pointing to the element immediately
- //! following q prior to the element being erased. If no such element exists,
+ //! following q prior to the element being erased. If no such element exists,
//! returns end().
//!
//! <b>Complexity</b>: Linear to the elements with keys bigger than position
//!
//! <b>Note</b>: Invalidates elements with keys
//! not less than the erased element.
- iterator erase(const_iterator position)
+ iterator erase(const_iterator position)
{ return m_flat_tree.erase(position); }
//! <b>Effects</b>: Erases all elements in the container with key equivalent to x.
@@ -1078,7 +1157,7 @@ class flat_multiset
//!
//! <b>Complexity</b>: Logarithmic search time plus erasure time
//! linear to the elements with bigger keys.
- size_type erase(const key_type& x)
+ size_type erase(const key_type& x)
{ return m_flat_tree.erase(x); }
//! <b>Effects</b>: Erases all the elements in the range [first, last).
@@ -1089,7 +1168,7 @@ class flat_multiset
//!
//! <b>Complexity</b>: Logarithmic search time plus erasure time
//! linear to the elements with bigger keys.
- iterator erase(const_iterator first, const_iterator last)
+ iterator erase(const_iterator first, const_iterator last)
{ return m_flat_tree.erase(first, last); }
//! <b>Effects</b>: erase(a.begin(),a.end()).
@@ -1097,7 +1176,7 @@ class flat_multiset
//! <b>Postcondition</b>: size() == 0.
//!
//! <b>Complexity</b>: linear in size().
- void clear()
+ void clear()
{ m_flat_tree.clear(); }
//! <b>Effects</b>: Tries to deallocate the excess of memory created
@@ -1113,34 +1192,34 @@ class flat_multiset
//! equivalent to x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic.
- iterator find(const key_type& x)
+ iterator find(const key_type& x)
{ return m_flat_tree.find(x); }
//! <b>Returns</b>: A const_iterator pointing to an element with the key
//! equivalent to x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic.s
- const_iterator find(const key_type& x) const
+ const_iterator find(const key_type& x) const
{ return m_flat_tree.find(x); }
//! <b>Returns</b>: The number of elements with key equivalent to x.
//!
//! <b>Complexity</b>: log(size())+count(k)
- size_type count(const key_type& x) const
+ size_type count(const key_type& x) const
{ return m_flat_tree.count(x); }
//! <b>Returns</b>: An iterator pointing to the first element with key not less
//! than k, or a.end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic
- iterator lower_bound(const key_type& x)
+ iterator lower_bound(const key_type& x)
{ return m_flat_tree.lower_bound(x); }
//! <b>Returns</b>: A const iterator pointing to the first element with key not
//! less than k, or a.end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic
- const_iterator lower_bound(const key_type& x) const
+ const_iterator lower_bound(const key_type& x) const
{ return m_flat_tree.lower_bound(x); }
//! <b>Returns</b>: An iterator pointing to the first element with key not less
@@ -1154,42 +1233,42 @@ class flat_multiset
//! less than x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic
- const_iterator upper_bound(const key_type& x) const
+ const_iterator upper_bound(const key_type& x) const
{ return m_flat_tree.upper_bound(x); }
//! <b>Effects</b>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).
//!
//! <b>Complexity</b>: Logarithmic
- std::pair<const_iterator, const_iterator>
- equal_range(const key_type& x) const
+ std::pair<const_iterator, const_iterator>
+ equal_range(const key_type& x) const
{ return m_flat_tree.equal_range(x); }
//! <b>Effects</b>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).
//!
//! <b>Complexity</b>: Logarithmic
- std::pair<iterator,iterator>
- equal_range(const key_type& x)
+ std::pair<iterator,iterator>
+ equal_range(const key_type& x)
{ return m_flat_tree.equal_range(x); }
//! <b>Effects</b>: Number of elements for which memory has been allocated.
//! capacity() is always greater than or equal to size().
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- size_type capacity() const
+ size_type capacity() const
{ return m_flat_tree.capacity(); }
//! <b>Effects</b>: If n is less than or equal to capacity(), this call has no
//! effect. Otherwise, it is a request for allocation of additional memory.
//! If the request is successful, then capacity() is greater than or equal to
//! n; otherwise, capacity() is unchanged. In either case, size() is unchanged.
- //!
+ //!
//! <b>Throws</b>: If memory allocation allocation throws or T's copy constructor throws.
//!
//! <b>Note</b>: If capacity() is less than "count", iterators and references to
//! to values might be invalidated.
- void reserve(size_type count)
+ void reserve(size_type count)
{ m_flat_tree.reserve(count); }
/// @cond
@@ -1200,46 +1279,46 @@ class flat_multiset
friend bool operator< (const flat_multiset<K1,C1,A1>&,
const flat_multiset<K1,C1,A1>&);
private:
- iterator priv_insert(const T &x)
+ iterator priv_insert(const T &x)
{ return m_flat_tree.insert_equal(x); }
- iterator priv_insert(const_iterator p, const T &x)
+ iterator priv_insert(const_iterator p, const T &x)
{ return m_flat_tree.insert_equal(p, x); }
/// @endcond
};
template <class T, class Pred, class A>
-inline bool operator==(const flat_multiset<T,Pred,A>& x,
- const flat_multiset<T,Pred,A>& y)
+inline bool operator==(const flat_multiset<T,Pred,A>& x,
+ const flat_multiset<T,Pred,A>& y)
{ return x.m_flat_tree == y.m_flat_tree; }
template <class T, class Pred, class A>
-inline bool operator<(const flat_multiset<T,Pred,A>& x,
- const flat_multiset<T,Pred,A>& y)
+inline bool operator<(const flat_multiset<T,Pred,A>& x,
+ const flat_multiset<T,Pred,A>& y)
{ return x.m_flat_tree < y.m_flat_tree; }
template <class T, class Pred, class A>
-inline bool operator!=(const flat_multiset<T,Pred,A>& x,
- const flat_multiset<T,Pred,A>& y)
+inline bool operator!=(const flat_multiset<T,Pred,A>& x,
+ const flat_multiset<T,Pred,A>& y)
{ return !(x == y); }
template <class T, class Pred, class A>
-inline bool operator>(const flat_multiset<T,Pred,A>& x,
- const flat_multiset<T,Pred,A>& y)
+inline bool operator>(const flat_multiset<T,Pred,A>& x,
+ const flat_multiset<T,Pred,A>& y)
{ return y < x; }
template <class T, class Pred, class A>
-inline bool operator<=(const flat_multiset<T,Pred,A>& x,
- const flat_multiset<T,Pred,A>& y)
+inline bool operator<=(const flat_multiset<T,Pred,A>& x,
+ const flat_multiset<T,Pred,A>& y)
{ return !(y < x); }
template <class T, class Pred, class A>
-inline bool operator>=(const flat_multiset<T,Pred,A>& x,
- const flat_multiset<T,Pred,A>& y)
+inline bool operator>=(const flat_multiset<T,Pred,A>& x,
+ const flat_multiset<T,Pred,A>& y)
{ return !(x < y); }
template <class T, class Pred, class A>
-inline void swap(flat_multiset<T,Pred,A>& x, flat_multiset<T,Pred,A>& y)
+inline void swap(flat_multiset<T,Pred,A>& x, flat_multiset<T,Pred,A>& y)
{ x.swap(y); }
/// @cond
diff --git a/boost/container/list.hpp b/boost/container/list.hpp
index 6df999bb51..c3e3562988 100644
--- a/boost/container/list.hpp
+++ b/boost/container/list.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -32,7 +32,7 @@
#if defined(BOOST_CONTAINER_PERFECT_FORWARDING) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
#else
//Preprocessor library to emulate perfect forwarding
-#include <boost/container/detail/preprocessor.hpp>
+#include <boost/container/detail/preprocessor.hpp>
#endif
#include <stdexcept>
@@ -65,30 +65,11 @@ template <class T, class VoidPointer>
struct list_node
: public list_hook<VoidPointer>::type
{
+ private:
+ list_node();
- list_node()
- : m_data()
- {}
- #if defined(BOOST_CONTAINER_PERFECT_FORWARDING) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
-
- template<class ...Args>
- list_node(Args &&...args)
- : m_data(boost::forward<Args>(args)...)
- {}
-
- #else //#ifndef BOOST_CONTAINER_PERFECT_FORWARDING
-
- #define BOOST_PP_LOCAL_MACRO(n) \
- template<BOOST_PP_ENUM_PARAMS(n, class P)> \
- list_node(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \
- : m_data(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)) \
- {} \
- //!
- #define BOOST_PP_LOCAL_LIMITS (1, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS)
- #include BOOST_PP_LOCAL_ITERATE()
-
- #endif//#ifndef BOOST_CONTAINER_PERFECT_FORWARDING
-
+ public:
+ typedef typename list_hook<VoidPointer>::type hook_type;
T m_data;
};
@@ -117,26 +98,26 @@ struct intrusive_list_type
/// @endcond
//! A list is a doubly linked list. That is, it is a Sequence that supports both
-//! forward and backward traversal, and (amortized) constant time insertion and
-//! removal of elements at the beginning or the end, or in the middle. Lists have
-//! the important property that insertion and splicing do not invalidate iterators
-//! to list elements, and that even removal invalidates only the iterators that point
-//! to the elements that are removed. The ordering of iterators may be changed
-//! (that is, list<T>::iterator might have a different predecessor or successor
-//! after a list operation than it did before), but the iterators themselves will
-//! not be invalidated or made to point to different elements unless that invalidation
+//! forward and backward traversal, and (amortized) constant time insertion and
+//! removal of elements at the beginning or the end, or in the middle. Lists have
+//! the important property that insertion and splicing do not invalidate iterators
+//! to list elements, and that even removal invalidates only the iterators that point
+//! to the elements that are removed. The ordering of iterators may be changed
+//! (that is, list<T>::iterator might have a different predecessor or successor
+//! after a list operation than it did before), but the iterators themselves will
+//! not be invalidated or made to point to different elements unless that invalidation
//! or mutation is explicit.
#ifdef BOOST_CONTAINER_DOXYGEN_INVOKED
template <class T, class A = std::allocator<T> >
#else
template <class T, class A>
#endif
-class list
+class list
: protected container_detail::node_alloc_holder
<A, typename container_detail::intrusive_list_type<A>::type>
{
/// @cond
- typedef typename
+ typedef typename
container_detail::intrusive_list_type<A>::type Icont;
typedef list <T, A> ThisType;
typedef container_detail::node_alloc_holder<A, Icont> AllocHolder;
@@ -211,11 +192,11 @@ class list
/// @endcond
public:
- //! Const iterator used to iterate through a list.
+ //! Const iterator used to iterate through a list.
class const_iterator
/// @cond
- : public std::iterator<std::bidirectional_iterator_tag,
- value_type, list_difference_type,
+ : public std::iterator<std::bidirectional_iterator_tag,
+ value_type, list_difference_type,
list_const_pointer, list_const_reference>
{
@@ -239,17 +220,17 @@ class list
{}
//Pointer like operators
- const_reference operator*() const
+ const_reference operator*() const
{ return m_it->m_data; }
- const_pointer operator->() const
+ const_pointer operator->() const
{ return const_pointer(&m_it->m_data); }
//Increment / Decrement
- const_iterator& operator++()
+ const_iterator& operator++()
{ prot_incr(); return *this; }
- const_iterator operator++(int)
+ const_iterator operator++(int)
{ typename Icont::iterator tmp = m_it; ++*this; return const_iterator(tmp); }
const_iterator& operator--()
@@ -278,7 +259,7 @@ class list
explicit iterator(typename Icont::iterator it)
: const_iterator(it)
{}
-
+
typename Icont::iterator get()
{ return this->m_it; }
@@ -295,12 +276,12 @@ class list
pointer operator->() const { return pointer(&this->m_it->m_data); }
//Increment / Decrement
- iterator& operator++()
+ iterator& operator++()
{ this->prot_incr(); return *this; }
iterator operator++(int)
{ typename Icont::iterator tmp = this->m_it; ++*this; return iterator(tmp); }
-
+
iterator& operator--()
{ this->prot_decr(); return *this; }
@@ -309,24 +290,24 @@ class list
};
/// @endcond
- //! Iterator used to iterate backwards through a list.
+ //! Iterator used to iterate backwards through a list.
typedef std::reverse_iterator<iterator> reverse_iterator;
- //! Const iterator used to iterate backwards through a list.
+ //! Const iterator used to iterate backwards through a list.
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
//! <b>Effects</b>: Default constructs a list.
- //!
+ //!
//! <b>Throws</b>: If allocator_type's default constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- list()
+ list()
: AllocHolder()
{}
//! <b>Effects</b>: Constructs a list taking the allocator as parameter.
- //!
+ //!
//! <b>Throws</b>: If allocator_type's copy constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Constant.
explicit list(const allocator_type &a)
: AllocHolder(a)
@@ -337,7 +318,7 @@ class list
//!
//! <b>Throws</b>: If allocator_type's default constructor or copy constructor
//! throws or T's default or copy constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Linear to n.
explicit list(size_type n)
: AllocHolder(A())
@@ -348,7 +329,7 @@ class list
//!
//! <b>Throws</b>: If allocator_type's default constructor or copy constructor
//! throws or T's default or copy constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Linear to n.
list(size_type n, const T& value, const A& a = A())
: AllocHolder(a)
@@ -357,23 +338,51 @@ class list
//! <b>Effects</b>: Copy constructs a list.
//!
//! <b>Postcondition</b>: x == *this.
- //!
+ //!
//! <b>Throws</b>: If allocator_type's default constructor or copy constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Linear to the elements x contains.
- list(const list& x)
+ list(const list& x)
: AllocHolder(x)
{ this->insert(this->cbegin(), x.begin(), x.end()); }
//! <b>Effects</b>: Move constructor. Moves mx's resources to *this.
//!
//! <b>Throws</b>: If allocator_type's copy constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Constant.
list(BOOST_RV_REF(list) x)
: AllocHolder(boost::move(static_cast<AllocHolder&>(x)))
{}
+ //! <b>Effects</b>: Copy constructs a list using the specified allocator.
+ //!
+ //! <b>Postcondition</b>: x == *this.
+ //!
+ //! <b>Throws</b>: If allocator_type's default constructor or copy constructor throws.
+ //!
+ //! <b>Complexity</b>: Linear to the elements x contains.
+ list(const list& x, const allocator_type &a)
+ : AllocHolder(a)
+ { this->insert(this->cbegin(), x.begin(), x.end()); }
+
+ //! <b>Effects</b>: Move constructor sing the specified allocator.
+ //! Moves mx's resources to *this.
+ //!
+ //! <b>Throws</b>: If allocation or value_type's copy constructor throws.
+ //!
+ //! <b>Complexity</b>: Constant if a == x.get_allocator(), linear otherwise.
+ list(BOOST_RV_REF(list) x, const allocator_type &a)
+ : AllocHolder(a)
+ {
+ if(this->node_alloc() == x.node_alloc()){
+ this->icont().swap(x.icont());
+ }
+ else{
+ this->insert(this->cbegin(), x.begin(), x.end());
+ }
+ }
+
//! <b>Effects</b>: Constructs a list that will use a copy of allocator a
//! and inserts a copy of the range [first, last) in the list.
//!
@@ -396,14 +405,14 @@ class list
{} //AllocHolder clears the list
//! <b>Effects</b>: Returns a copy of the internal allocator.
- //!
+ //!
//! <b>Throws</b>: If allocator's copy constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Constant.
allocator_type get_allocator() const
{ return allocator_type(this->node_alloc()); }
- const stored_allocator_type &get_stored_allocator() const
+ const stored_allocator_type &get_stored_allocator() const
{ return this->node_alloc(); }
stored_allocator_type &get_stored_allocator()
@@ -418,129 +427,129 @@ class list
{ AllocHolder::clear(alloc_version()); }
//! <b>Effects</b>: Returns an iterator to the first element contained in the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
iterator begin()
{ return iterator(this->icont().begin()); }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_iterator begin() const
{ return this->cbegin(); }
//! <b>Effects</b>: Returns an iterator to the end of the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
iterator end()
{ return iterator(this->icont().end()); }
//! <b>Effects</b>: Returns a const_iterator to the end of the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_iterator end() const
{ return this->cend(); }
- //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
- //! of the reversed list.
- //!
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
+ //! of the reversed list.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
reverse_iterator rbegin()
{ return reverse_iterator(end()); }
- //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
- //! of the reversed list.
- //!
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed list.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_reverse_iterator rbegin() const
{ return this->crbegin(); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the end
- //! of the reversed list.
- //!
+ //! of the reversed list.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
reverse_iterator rend()
{ return reverse_iterator(begin()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
- //! of the reversed list.
- //!
+ //! of the reversed list.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_reverse_iterator rend() const
{ return this->crend(); }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_iterator cbegin() const
{ return const_iterator(this->non_const_icont().begin()); }
//! <b>Effects</b>: Returns a const_iterator to the end of the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_iterator cend() const
{ return const_iterator(this->non_const_icont().end()); }
- //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
- //! of the reversed list.
- //!
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed list.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_reverse_iterator crbegin() const
{ return const_reverse_iterator(this->cend()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
- //! of the reversed list.
- //!
+ //! of the reversed list.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_reverse_iterator crend() const
{ return const_reverse_iterator(this->cbegin()); }
//! <b>Effects</b>: Returns true if the list contains no elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- bool empty() const
+ bool empty() const
{ return !this->size(); }
//! <b>Effects</b>: Returns the number of the elements contained in the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- size_type size() const
+ size_type size() const
{ return this->icont().size(); }
//! <b>Effects</b>: Returns the largest possible size of the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- size_type max_size() const
+ size_type max_size() const
{ return AllocHolder::max_size(); }
#if defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
@@ -588,7 +597,7 @@ class list
//! <b>Throws</b>: Nothing.
//!
//! <b>Complexity</b>: Amortized constant time.
- void pop_front()
+ void pop_front()
{ this->erase(this->cbegin()); }
//! <b>Effects</b>: Removes the last element from the list.
@@ -596,51 +605,51 @@ class list
//! <b>Throws</b>: Nothing.
//!
//! <b>Complexity</b>: Amortized constant time.
- void pop_back()
+ void pop_back()
{ const_iterator tmp = this->cend(); this->erase(--tmp); }
//! <b>Requires</b>: !empty()
//!
- //! <b>Effects</b>: Returns a reference to the first element
+ //! <b>Effects</b>: Returns a reference to the first element
//! from the beginning of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- reference front()
+ reference front()
{ return *this->begin(); }
//! <b>Requires</b>: !empty()
//!
- //! <b>Effects</b>: Returns a const reference to the first element
+ //! <b>Effects</b>: Returns a const reference to the first element
//! from the beginning of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reference front() const
+ const_reference front() const
{ return *this->begin(); }
//! <b>Requires</b>: !empty()
//!
- //! <b>Effects</b>: Returns a reference to the first element
+ //! <b>Effects</b>: Returns a reference to the first element
//! from the beginning of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- reference back()
+ reference back()
{ return *(--this->end()); }
//! <b>Requires</b>: !empty()
//!
- //! <b>Effects</b>: Returns a const reference to the first element
+ //! <b>Effects</b>: Returns a const reference to the first element
//! from the beginning of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reference back() const
+ const_reference back() const
{ return *(--this->end()); }
//! <b>Effects</b>: Inserts or erases elements at the end such that
@@ -653,7 +662,7 @@ class list
{
const_iterator iend = this->cend();
size_type len = this->size();
-
+
if(len > new_size){
size_type to_erase = len - new_size;
while(to_erase--){
@@ -676,7 +685,7 @@ class list
{
const_iterator iend = this->end();
size_type len = this->size();
-
+
if(len > new_size){
size_type to_erase = len - new_size;
const_iterator ifirst;
@@ -710,8 +719,8 @@ class list
//! <b>Effects</b>: Makes *this contain the same elements as x.
//!
- //! <b>Postcondition</b>: this->size() == x.size(). *this contains a copy
- //! of each of x's elements.
+ //! <b>Postcondition</b>: this->size() == x.size(). *this contains a copy
+ //! of each of x's elements.
//!
//! <b>Throws</b>: If memory allocation throws or T's copy constructor throws.
//!
@@ -782,7 +791,7 @@ class list
//!
//! <b>Complexity</b>: Linear to std::distance [first, last).
template <class InpIt>
- void insert(const_iterator p, InpIt first, InpIt last)
+ void insert(const_iterator p, InpIt first, InpIt last)
{
const bool aux_boolean = container_detail::is_convertible<InpIt, size_type>::value;
typedef container_detail::bool_<aux_boolean> Result;
@@ -891,7 +900,7 @@ class list
//! <b>Throws</b>: Nothing.
//!
//! <b>Complexity</b>: Amortized constant time.
- iterator erase(const_iterator p)
+ iterator erase(const_iterator p)
{ return iterator(this->icont().erase_and_dispose(p.get(), Destroyer(this->node_alloc()))); }
//! <b>Requires</b>: first and last must be valid iterator to elements in *this.
@@ -909,7 +918,7 @@ class list
//! <b>Throws</b>: If memory allocation throws or T's copy constructor throws.
//!
//! <b>Complexity</b>: Linear to n.
- void assign(size_type n, const T& val)
+ void assign(size_type n, const T& val)
{ this->priv_fill_assign(n, val); }
//! <b>Effects</b>: Assigns the the range [first, last) to *this.
@@ -919,7 +928,7 @@ class list
//!
//! <b>Complexity</b>: Linear to n.
template <class InpIt>
- void assign(InpIt first, InpIt last)
+ void assign(InpIt first, InpIt last)
{
const bool aux_boolean = container_detail::is_convertible<InpIt, size_type>::value;
typedef container_detail::bool_<aux_boolean> Result;
@@ -936,7 +945,7 @@ class list
//! are not equal.
//!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of
//! this list. Iterators of this list and all the references are not invalidated.
void splice(const_iterator p, ThisType& x) BOOST_CONTAINER_NOEXCEPT
@@ -947,16 +956,16 @@ class list
//! <b>Requires</b>: p must point to an element contained
//! by this list. i must point to an element contained in list x.
- //!
- //! <b>Effects</b>: Transfers the value pointed by i, from list x to this list,
+ //!
+ //! <b>Effects</b>: Transfers the value pointed by i, from list x to this list,
//! before the the element pointed by p. No destructors or copy constructors are called.
- //! If p == i or p == ++i, this function is a null operation.
- //!
+ //! If p == i or p == ++i, this function is a null operation.
+ //!
//! <b>Throws</b>: std::runtime_error if this' allocator and x's allocator
//! are not equal.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
//! list. Iterators of this list and all the references are not invalidated.
void splice(const_iterator p, ThisType &x, const_iterator i) BOOST_CONTAINER_NOEXCEPT
@@ -967,15 +976,15 @@ class list
//! <b>Requires</b>: p must point to an element contained
//! by this list. first and last must point to elements contained in list x.
- //!
- //! <b>Effects</b>: Transfers the range pointed by first and last from list x to this list,
+ //!
+ //! <b>Effects</b>: Transfers the range pointed by first and last from list x to this list,
//! before the the element pointed by p. No destructors or copy constructors are called.
- //!
+ //!
//! <b>Throws</b>: std::runtime_error if this' allocator and x's allocator
//! are not equal.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements transferred.
- //!
+ //!
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
//! list. Iterators of this list and all the references are not invalidated.
void splice(const_iterator p, ThisType &x, const_iterator first, const_iterator last) BOOST_CONTAINER_NOEXCEPT
@@ -987,15 +996,15 @@ class list
//! <b>Requires</b>: p must point to an element contained
//! by this list. first and last must point to elements contained in list x.
//! n == std::distance(first, last)
- //!
- //! <b>Effects</b>: Transfers the range pointed by first and last from list x to this list,
+ //!
+ //! <b>Effects</b>: Transfers the range pointed by first and last from list x to this list,
//! before the the element pointed by p. No destructors or copy constructors are called.
- //!
+ //!
//! <b>Throws</b>: std::runtime_error if this' allocator and x's allocator
//! are not equal.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
//! list. Iterators of this list and all the references are not invalidated.
void splice(const_iterator p, ThisType &x, const_iterator first, const_iterator last, size_type n) BOOST_CONTAINER_NOEXCEPT
@@ -1004,22 +1013,22 @@ class list
this->icont().splice(p.get(), x.icont(), first.get(), last.get(), n);
}
- //! <b>Effects</b>: Reverses the order of elements in the list.
- //!
+ //! <b>Effects</b>: Reverses the order of elements in the list.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: This function is linear time.
- //!
+ //!
//! <b>Note</b>: Iterators and references are not invalidated
void reverse()
- { this->icont().reverse(); }
+ { this->icont().reverse(); }
//! <b>Effects</b>: Removes all the elements that compare equal to value.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear time. It performs exactly size() comparisons for equality.
- //!
+ //!
//! <b>Note</b>: The relative order of elements that are not removed is unchanged,
//! and iterators to elements that are not removed remain valid.
void remove(const T& value)
@@ -1027,11 +1036,11 @@ class list
//! <b>Effects</b>: Removes all the elements for which a specified
//! predicate is satisfied.
- //!
+ //!
//! <b>Throws</b>: If pred throws.
- //!
+ //!
//! <b>Complexity</b>: Linear time. It performs exactly size() calls to the predicate.
- //!
+ //!
//! <b>Note</b>: The relative order of elements that are not removed is unchanged,
//! and iterators to elements that are not removed remain valid.
template <class Pred>
@@ -1041,25 +1050,25 @@ class list
this->icont().remove_and_dispose_if(Predicate(pred), Destroyer(this->node_alloc()));
}
- //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
+ //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
//! elements that are equal from the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear time (size()-1 comparisons calls to pred()).
- //!
+ //!
//! <b>Note</b>: The relative order of elements that are not removed is unchanged,
//! and iterators to elements that are not removed remain valid.
void unique()
{ this->unique(value_equal()); }
- //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
+ //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
//! elements that satisfy some binary predicate from the list.
- //!
+ //!
//! <b>Throws</b>: If pred throws.
- //!
+ //!
//! <b>Complexity</b>: Linear time (size()-1 comparisons equality comparisons).
- //!
+ //!
//! <b>Note</b>: The relative order of elements that are not removed is unchanged,
//! and iterators to elements that are not removed remain valid.
template <class BinaryPredicate>
@@ -1069,15 +1078,15 @@ class list
this->icont().unique_and_dispose(Predicate(binary_pred), Destroyer(this->node_alloc()));
}
- //! <b>Requires</b>: The lists x and *this must be distinct.
+ //! <b>Requires</b>: The lists x and *this must be distinct.
//!
//! <b>Effects</b>: This function removes all of x's elements and inserts them
- //! in order into *this according to std::less<value_type>. The merge is stable;
- //! that is, if an element from *this is equivalent to one from x, then the element
- //! from *this will precede the one from x.
- //!
+ //! in order into *this according to std::less<value_type>. The merge is stable;
+ //! that is, if an element from *this is equivalent to one from x, then the element
+ //! from *this will precede the one from x.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: This function is linear time: it performs at most
//! size() + x.size() - 1 comparisons.
void merge(list<T, A>& x)
@@ -1085,17 +1094,17 @@ class list
//! <b>Requires</b>: p must be a comparison function that induces a strict weak
//! ordering and both *this and x must be sorted according to that ordering
- //! The lists x and *this must be distinct.
- //!
+ //! The lists x and *this must be distinct.
+ //!
//! <b>Effects</b>: This function removes all of x's elements and inserts them
- //! in order into *this. The merge is stable; that is, if an element from *this is
- //! equivalent to one from x, then the element from *this will precede the one from x.
- //!
+ //! in order into *this. The merge is stable; that is, if an element from *this is
+ //! equivalent to one from x, then the element from *this will precede the one from x.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: This function is linear time: it performs at most
//! size() + x.size() - 1 comparisons.
- //!
+ //!
//! <b>Note</b>: Iterators and references to *this are not invalidated.
template <class StrictWeakOrdering>
void merge(list &x, StrictWeakOrdering comp)
@@ -1109,25 +1118,25 @@ class list
}
}
- //! <b>Effects</b>: This function sorts the list *this according to std::less<value_type>.
+ //! <b>Effects</b>: This function sorts the list *this according to std::less<value_type>.
//! The sort is stable, that is, the relative order of equivalent elements is preserved.
//!
//! <b>Throws</b>: Nothing.
//!
//! <b>Notes</b>: Iterators and references are not invalidated.
- //!
+ //!
//! <b>Complexity</b>: The number of comparisons is approximately N log N, where N
//! is the list's size.
void sort()
{ this->sort(value_less()); }
- //! <b>Effects</b>: This function sorts the list *this according to std::less<value_type>.
+ //! <b>Effects</b>: This function sorts the list *this according to std::less<value_type>.
//! The sort is stable, that is, the relative order of equivalent elements is preserved.
- //!
+ //!
//! <b>Throws</b>: Nothing.
//!
//! <b>Notes</b>: Iterators and references are not invalidated.
- //!
+ //!
//! <b>Complexity</b>: The number of comparisons is approximately N log N, where N
//! is the list's size.
template <class StrictWeakOrdering>
@@ -1142,25 +1151,25 @@ class list
/// @cond
private:
- iterator priv_insert(const_iterator p, const T &x)
+ iterator priv_insert(const_iterator p, const T &x)
{
NodePtr tmp = AllocHolder::create_node(x);
return iterator(this->icont().insert(p.get(), *tmp));
}
- iterator priv_insert(const_iterator p, BOOST_RV_REF(T) x)
+ iterator priv_insert(const_iterator p, BOOST_RV_REF(T) x)
{
NodePtr tmp = AllocHolder::create_node(boost::move(x));
return iterator(this->icont().insert(p.get(), *tmp));
}
- void priv_push_back (const T &x)
+ void priv_push_back (const T &x)
{ this->insert(this->cend(), x); }
void priv_push_back (BOOST_RV_REF(T) x)
{ this->insert(this->cend(), boost::move(x)); }
- void priv_push_front (const T &x)
+ void priv_push_front (const T &x)
{ this->insert(this->cbegin(), x); }
void priv_push_front (BOOST_RV_REF(T) x)
@@ -1242,10 +1251,10 @@ class list
{ this->priv_create_and_insert_nodes(p, first, last); }
template<class Integer>
- void priv_insert_dispatch(const_iterator p, Integer n, Integer x, container_detail::true_)
+ void priv_insert_dispatch(const_iterator p, Integer n, Integer x, container_detail::true_)
{ this->insert(p, (size_type)n, x); }
- void priv_fill_assign(size_type n, const T& val)
+ void priv_fill_assign(size_type n, const T& val)
{
iterator i = this->begin(), iend = this->end();
@@ -1319,25 +1328,25 @@ inline bool operator<(const list<T,A>& x,
}
template <class T, class A>
-inline bool operator!=(const list<T,A>& x, const list<T,A>& y)
+inline bool operator!=(const list<T,A>& x, const list<T,A>& y)
{
return !(x == y);
}
template <class T, class A>
-inline bool operator>(const list<T,A>& x, const list<T,A>& y)
+inline bool operator>(const list<T,A>& x, const list<T,A>& y)
{
return y < x;
}
template <class T, class A>
-inline bool operator<=(const list<T,A>& x, const list<T,A>& y)
+inline bool operator<=(const list<T,A>& x, const list<T,A>& y)
{
return !(y < x);
}
template <class T, class A>
-inline bool operator>=(const list<T,A>& x, const list<T,A>& y)
+inline bool operator>=(const list<T,A>& x, const list<T,A>& y)
{
return !(x < y);
}
diff --git a/boost/container/map.hpp b/boost/container/map.hpp
index 8f7ecd42b3..91cbd35429 100644
--- a/boost/container/map.hpp
+++ b/boost/container/map.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -47,20 +47,20 @@ namespace container {
/// @cond
// Forward declarations of operators == and <, needed for friend declarations.
template <class Key, class T, class Pred, class A>
-inline bool operator==(const map<Key,T,Pred,A>& x,
+inline bool operator==(const map<Key,T,Pred,A>& x,
const map<Key,T,Pred,A>& y);
template <class Key, class T, class Pred, class A>
-inline bool operator<(const map<Key,T,Pred,A>& x,
+inline bool operator<(const map<Key,T,Pred,A>& x,
const map<Key,T,Pred,A>& y);
/// @endcond
-//! A map is a kind of associative container that supports unique keys (contains at
-//! most one of each key value) and provides for fast retrieval of values of another
+//! A map is a kind of associative container that supports unique keys (contains at
+//! most one of each key value) and provides for fast retrieval of values of another
//! type T based on the keys. The map class supports bidirectional iterators.
-//!
-//! A map satisfies all of the requirements of a container and of a reversible
-//! container and of an associative container. For a
+//!
+//! A map satisfies all of the requirements of a container and of a reversible
+//! container and of an associative container. For a
//! map<Key,T> the key_type is Key and the value_type is std::pair<const Key,T>.
//!
//! Pred is the ordering function for Keys (e.g. <i>std::less<Key></i>).
@@ -72,15 +72,15 @@ template <class Key, class T, class Pred = std::less< std::pair< const Key, T> >
#else
template <class Key, class T, class Pred, class A>
#endif
-class map
+class map
{
/// @cond
private:
BOOST_COPYABLE_AND_MOVABLE(map)
- typedef container_detail::rbtree<Key,
- std::pair<const Key, T>,
- container_detail::select1st< std::pair<const Key, T> >,
- Pred,
+ typedef container_detail::rbtree<Key,
+ std::pair<const Key, T>,
+ container_detail::select1st< std::pair<const Key, T> >,
+ Pred,
A> tree_t;
tree_t m_tree; // red-black tree representing map
@@ -112,7 +112,7 @@ class map
/// @cond
class value_compare_impl
: public Pred,
- public std::binary_function<value_type, value_type, bool>
+ public std::binary_function<value_type, value_type, bool>
{
friend class map<Key,T,Pred,A>;
protected :
@@ -126,7 +126,7 @@ class map
typedef value_compare_impl value_compare;
//! <b>Effects</b>: Default constructs an empty map.
- //!
+ //!
//! <b>Complexity</b>: Constant.
map()
: m_tree()
@@ -135,9 +135,9 @@ class map
BOOST_STATIC_ASSERT((container_detail::is_same<std::pair<const Key, T>, typename A::value_type>::value));
}
- //! <b>Effects</b>: Constructs an empty map using the specified comparison object
+ //! <b>Effects</b>: Constructs an empty map using the specified comparison object
//! and allocator.
- //!
+ //!
//! <b>Complexity</b>: Constant.
explicit map(const Pred& comp,
const allocator_type& a = allocator_type())
@@ -147,204 +147,261 @@ class map
BOOST_STATIC_ASSERT((container_detail::is_same<std::pair<const Key, T>, typename A::value_type>::value));
}
- //! <b>Effects</b>: Constructs an empty map using the specified comparison object and
+ //! <b>Effects</b>: Constructs an empty map using the specified comparison object and
//! allocator, and inserts elements from the range [first ,last ).
- //!
- //! <b>Complexity</b>: Linear in N if the range [first ,last ) is already sorted using
+ //!
+ //! <b>Complexity</b>: Linear in N if the range [first ,last ) is already sorted using
//! comp and otherwise N logN, where N is last - first.
template <class InputIterator>
map(InputIterator first, InputIterator last, const Pred& comp = Pred(),
const allocator_type& a = allocator_type())
- : m_tree(first, last, comp, a, true)
+ : m_tree(first, last, comp, a, true)
{
//Allocator type must be std::pair<CONST Key, T>
- BOOST_STATIC_ASSERT((container_detail::is_same<std::pair<const Key, T>, typename A::value_type>::value));
+ BOOST_STATIC_ASSERT((container_detail::is_same<std::pair<const Key, T>, typename A::value_type>::value));
}
- //! <b>Effects</b>: Constructs an empty map using the specified comparison object and
+ //! <b>Effects</b>: Constructs an empty map using the specified comparison object and
//! allocator, and inserts elements from the ordered unique range [first ,last). This function
//! is more efficient than the normal range creation for ordered ranges.
//!
//! <b>Requires</b>: [first ,last) must be ordered according to the predicate and must be
//! unique values.
- //!
+ //!
//! <b>Complexity</b>: Linear in N.
template <class InputIterator>
map( ordered_unique_range_t, InputIterator first, InputIterator last
, const Pred& comp = Pred(), const allocator_type& a = allocator_type())
- : m_tree(ordered_range, first, last, comp, a)
+ : m_tree(ordered_range, first, last, comp, a)
{
//Allocator type must be std::pair<CONST Key, T>
- BOOST_STATIC_ASSERT((container_detail::is_same<std::pair<const Key, T>, typename A::value_type>::value));
+ BOOST_STATIC_ASSERT((container_detail::is_same<std::pair<const Key, T>, typename A::value_type>::value));
}
//! <b>Effects</b>: Copy constructs a map.
- //!
+ //!
//! <b>Complexity</b>: Linear in x.size().
- map(const map<Key,T,Pred,A>& x)
+ map(const map& x)
: m_tree(x.m_tree)
{
//Allocator type must be std::pair<CONST Key, T>
- BOOST_STATIC_ASSERT((container_detail::is_same<std::pair<const Key, T>, typename A::value_type>::value));
+ BOOST_STATIC_ASSERT((container_detail::is_same<std::pair<const Key, T>, typename A::value_type>::value));
}
//! <b>Effects</b>: Move constructs a map. Constructs *this using x's resources.
- //!
- //! <b>Complexity</b>: Construct.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Postcondition</b>: x is emptied.
- map(BOOST_RV_REF(map) x)
+ map(BOOST_RV_REF(map) x)
: m_tree(boost::move(x.m_tree))
{
//Allocator type must be std::pair<CONST Key, T>
- BOOST_STATIC_ASSERT((container_detail::is_same<std::pair<const Key, T>, typename A::value_type>::value));
+ BOOST_STATIC_ASSERT((container_detail::is_same<std::pair<const Key, T>, typename A::value_type>::value));
+ }
+
+ //! <b>Effects</b>: Copy constructs a map using the specified allocator.
+ //!
+ //! <b>Complexity</b>: Linear in x.size().
+ map(const map& x, const allocator_type &a)
+ : m_tree(x.m_tree, a)
+ {
+ //Allocator type must be std::pair<CONST Key, T>
+ BOOST_STATIC_ASSERT((container_detail::is_same<std::pair<const Key, T>, typename A::value_type>::value));
+ }
+
+ //! <b>Effects</b>: Move constructs a map using the specified allocator.
+ //! Constructs *this using x's resources.
+ //!
+ //! <b>Complexity</b>: Constant if x == x.get_allocator(), linear otherwise.
+ //!
+ //! <b>Postcondition</b>: x is emptied.
+ map(BOOST_RV_REF(map) x, const allocator_type &a)
+ : m_tree(boost::move(x.m_tree), a)
+ {
+ //Allocator type must be std::pair<CONST Key, T>
+ BOOST_STATIC_ASSERT((container_detail::is_same<std::pair<const Key, T>, typename A::value_type>::value));
}
//! <b>Effects</b>: Makes *this a copy of x.
- //!
+ //!
//! <b>Complexity</b>: Linear in x.size().
map& operator=(BOOST_COPY_ASSIGN_REF(map) x)
{ m_tree = x.m_tree; return *this; }
//! <b>Effects</b>: this->swap(x.get()).
- //!
+ //!
//! <b>Complexity</b>: Constant.
map& operator=(BOOST_RV_REF(map) x)
{ m_tree = boost::move(x.m_tree); return *this; }
//! <b>Effects</b>: Returns the comparison object out
//! of which a was constructed.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- key_compare key_comp() const
+ key_compare key_comp() const
{ return m_tree.key_comp(); }
//! <b>Effects</b>: Returns an object of value_compare constructed out
//! of the comparison object.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- value_compare value_comp() const
+ value_compare value_comp() const
{ return value_compare(m_tree.key_comp()); }
//! <b>Effects</b>: Returns a copy of the Allocator that
//! was passed to the object's constructor.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- allocator_type get_allocator() const
+ allocator_type get_allocator() const
{ return m_tree.get_allocator(); }
- const stored_allocator_type &get_stored_allocator() const
+ const stored_allocator_type &get_stored_allocator() const
{ return m_tree.get_stored_allocator(); }
stored_allocator_type &get_stored_allocator()
{ return m_tree.get_stored_allocator(); }
//! <b>Effects</b>: Returns an iterator to the first element contained in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- iterator begin()
+ iterator begin()
{ return m_tree.begin(); }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator begin() const
+ const_iterator begin() const
+ { return this->cbegin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator to the first element contained in the container.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ const_iterator cbegin() const
{ return m_tree.begin(); }
//! <b>Effects</b>: Returns an iterator to the end of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- iterator end()
+ iterator end()
{ return m_tree.end(); }
//! <b>Effects</b>: Returns a const_iterator to the end of the container.
- //!
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ const_iterator end() const
+ { return this->cend(); }
+
+ //! <b>Effects</b>: Returns a const_iterator to the end of the container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator end() const
+ const_iterator cend() const
{ return m_tree.end(); }
- //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
- //! of the reversed container.
- //!
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- reverse_iterator rbegin()
+ reverse_iterator rbegin()
{ return m_tree.rbegin(); }
- //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
- //! of the reversed container.
- //!
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed container.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ const_reverse_iterator rbegin() const
+ { return this->crbegin(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator rbegin() const
+ const_reverse_iterator crbegin() const
{ return m_tree.rbegin(); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the end
- //! of the reversed container.
- //!
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- reverse_iterator rend()
+ reverse_iterator rend()
{ return m_tree.rend(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
- //! of the reversed container.
- //!
+ //! of the reversed container.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ const_reverse_iterator rend() const
+ { return this->crend(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator rend() const
+ const_reverse_iterator crend() const
{ return m_tree.rend(); }
//! <b>Effects</b>: Returns true if the container contains no elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- bool empty() const
+ bool empty() const
{ return m_tree.empty(); }
//! <b>Effects</b>: Returns the number of the elements contained in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- size_type size() const
+ size_type size() const
{ return m_tree.size(); }
//! <b>Effects</b>: Returns the largest possible size of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- size_type max_size() const
+ size_type max_size() const
{ return m_tree.max_size(); }
#if defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- //! Effects: If there is no key equivalent to x in the map, inserts
+ //! Effects: If there is no key equivalent to x in the map, inserts
//! value_type(x, T()) into the map.
- //!
+ //!
//! Returns: A reference to the mapped_type corresponding to x in *this.
- //!
+ //!
//! Complexity: Logarithmic.
mapped_type& operator[](const key_type &k);
- //! Effects: If there is no key equivalent to x in the map, inserts
+ //! Effects: If there is no key equivalent to x in the map, inserts
//! value_type(boost::move(x), T()) into the map (the key is move-constructed)
- //!
+ //!
//! Returns: A reference to the mapped_type corresponding to x in *this.
- //!
+ //!
//! Complexity: Logarithmic.
mapped_type& operator[](key_type &&k);
#else
@@ -383,62 +440,62 @@ class map
void swap(map& x)
{ m_tree.swap(x.m_tree); }
- //! <b>Effects</b>: Inserts x if and only if there is no element in the container
+ //! <b>Effects</b>: Inserts x if and only if there is no element in the container
//! with key equivalent to the key of x.
//!
- //! <b>Returns</b>: The bool component of the returned pair is true if and only
+ //! <b>Returns</b>: The bool component of the returned pair is true if and only
//! if the insertion takes place, and the iterator component of the pair
//! points to the element with key equivalent to the key of x.
//!
//! <b>Complexity</b>: Logarithmic.
- std::pair<iterator,bool> insert(const value_type& x)
+ std::pair<iterator,bool> insert(const value_type& x)
{ return m_tree.insert_unique(x); }
- //! <b>Effects</b>: Inserts a new value_type created from the pair if and only if
+ //! <b>Effects</b>: Inserts a new value_type created from the pair if and only if
//! there is no element in the container with key equivalent to the key of x.
//!
- //! <b>Returns</b>: The bool component of the returned pair is true if and only
+ //! <b>Returns</b>: The bool component of the returned pair is true if and only
//! if the insertion takes place, and the iterator component of the pair
//! points to the element with key equivalent to the key of x.
//!
//! <b>Complexity</b>: Logarithmic.
- std::pair<iterator,bool> insert(const nonconst_value_type& x)
+ std::pair<iterator,bool> insert(const nonconst_value_type& x)
{ return m_tree.insert_unique(x); }
//! <b>Effects</b>: Inserts a new value_type move constructed from the pair if and
//! only if there is no element in the container with key equivalent to the key of x.
//!
- //! <b>Returns</b>: The bool component of the returned pair is true if and only
+ //! <b>Returns</b>: The bool component of the returned pair is true if and only
//! if the insertion takes place, and the iterator component of the pair
//! points to the element with key equivalent to the key of x.
//!
//! <b>Complexity</b>: Logarithmic.
- std::pair<iterator,bool> insert(BOOST_RV_REF(nonconst_value_type) x)
+ std::pair<iterator,bool> insert(BOOST_RV_REF(nonconst_value_type) x)
{ return m_tree.insert_unique(boost::move(x)); }
//! <b>Effects</b>: Inserts a new value_type move constructed from the pair if and
//! only if there is no element in the container with key equivalent to the key of x.
//!
- //! <b>Returns</b>: The bool component of the returned pair is true if and only
+ //! <b>Returns</b>: The bool component of the returned pair is true if and only
//! if the insertion takes place, and the iterator component of the pair
//! points to the element with key equivalent to the key of x.
//!
//! <b>Complexity</b>: Logarithmic.
- std::pair<iterator,bool> insert(BOOST_RV_REF(nonconst_impl_value_type) x)
+ std::pair<iterator,bool> insert(BOOST_RV_REF(nonconst_impl_value_type) x)
{ return m_tree.insert_unique(boost::move(x)); }
- //! <b>Effects</b>: Move constructs a new value from x if and only if there is
+ //! <b>Effects</b>: Move constructs a new value from x if and only if there is
//! no element in the container with key equivalent to the key of x.
//!
- //! <b>Returns</b>: The bool component of the returned pair is true if and only
+ //! <b>Returns</b>: The bool component of the returned pair is true if and only
//! if the insertion takes place, and the iterator component of the pair
//! points to the element with key equivalent to the key of x.
//!
//! <b>Complexity</b>: Logarithmic.
- std::pair<iterator,bool> insert(BOOST_RV_REF(value_type) x)
+ std::pair<iterator,bool> insert(BOOST_RV_REF(value_type) x)
{ return m_tree.insert_unique(boost::move(x)); }
- //! <b>Effects</b>: Inserts a copy of x in the container if and only if there is
+ //! <b>Effects</b>: Inserts a copy of x in the container if and only if there is
//! no element in the container with key equivalent to the key of x.
//! p is a hint pointing to where the insert should start to search.
//!
@@ -450,7 +507,7 @@ class map
iterator insert(iterator position, const value_type& x)
{ return m_tree.insert_unique(position, x); }
- //! <b>Effects</b>: Move constructs a new value from x if and only if there is
+ //! <b>Effects</b>: Move constructs a new value from x if and only if there is
//! no element in the container with key equivalent to the key of x.
//! p is a hint pointing to where the insert should start to search.
//!
@@ -462,7 +519,7 @@ class map
iterator insert(iterator position, BOOST_RV_REF(nonconst_value_type) x)
{ return m_tree.insert_unique(position, boost::move(x)); }
- //! <b>Effects</b>: Move constructs a new value from x if and only if there is
+ //! <b>Effects</b>: Move constructs a new value from x if and only if there is
//! no element in the container with key equivalent to the key of x.
//! p is a hint pointing to where the insert should start to search.
//!
@@ -494,22 +551,22 @@ class map
//! <b>Requires</b>: first, last are not iterators into *this.
//!
- //! <b>Effects</b>: inserts each element from the range [first,last) if and only
+ //! <b>Effects</b>: inserts each element from the range [first,last) if and only
//! if there is no element with key equivalent to the key of that element.
//!
//! <b>Complexity</b>: At most N log(size()+N) (N is the distance from first to last)
template <class InputIterator>
- void insert(InputIterator first, InputIterator last)
+ void insert(InputIterator first, InputIterator last)
{ m_tree.insert_unique(first, last); }
#if defined(BOOST_CONTAINER_PERFECT_FORWARDING) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
//! <b>Effects</b>: Inserts an object x of type T constructed with
- //! std::forward<Args>(args)... in the container if and only if there is
+ //! std::forward<Args>(args)... in the container if and only if there is
//! no element in the container with an equivalent key.
//! p is a hint pointing to where the insert should start to search.
//!
- //! <b>Returns</b>: The bool component of the returned pair is true if and only
+ //! <b>Returns</b>: The bool component of the returned pair is true if and only
//! if the insertion takes place, and the iterator component of the pair
//! points to the element with key equivalent to the key of x.
//!
@@ -520,7 +577,7 @@ class map
{ return m_tree.emplace_unique(boost::forward<Args>(args)...); }
//! <b>Effects</b>: Inserts an object of type T constructed with
- //! std::forward<Args>(args)... in the container if and only if there is
+ //! std::forward<Args>(args)... in the container if and only if there is
//! no element in the container with an equivalent key.
//! p is a hint pointing to where the insert should start to search.
//!
@@ -554,11 +611,11 @@ class map
//! <b>Effects</b>: Erases the element pointed to by position.
//!
//! <b>Returns</b>: Returns an iterator pointing to the element immediately
- //! following q prior to the element being erased. If no such element exists,
+ //! following q prior to the element being erased. If no such element exists,
//! returns end().
//!
//! <b>Complexity</b>: Amortized constant time
- iterator erase(const_iterator position)
+ iterator erase(const_iterator position)
{ return m_tree.erase(position); }
//! <b>Effects</b>: Erases all elements in the container with key equivalent to x.
@@ -566,7 +623,7 @@ class map
//! <b>Returns</b>: Returns the number of erased elements.
//!
//! <b>Complexity</b>: log(size()) + count(k)
- size_type erase(const key_type& x)
+ size_type erase(const key_type& x)
{ return m_tree.erase(x); }
//! <b>Effects</b>: Erases all the elements in the range [first, last).
@@ -582,67 +639,67 @@ class map
//! <b>Postcondition</b>: size() == 0.
//!
//! <b>Complexity</b>: linear in size().
- void clear()
+ void clear()
{ m_tree.clear(); }
//! <b>Returns</b>: An iterator pointing to an element with the key
//! equivalent to x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic.
- iterator find(const key_type& x)
+ iterator find(const key_type& x)
{ return m_tree.find(x); }
//! <b>Returns</b>: A const_iterator pointing to an element with the key
//! equivalent to x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic.
- const_iterator find(const key_type& x) const
+ const_iterator find(const key_type& x) const
{ return m_tree.find(x); }
//! <b>Returns</b>: The number of elements with key equivalent to x.
//!
//! <b>Complexity</b>: log(size())+count(k)
- size_type count(const key_type& x) const
+ size_type count(const key_type& x) const
{ return m_tree.find(x) == m_tree.end() ? 0 : 1; }
//! <b>Returns</b>: An iterator pointing to the first element with key not less
//! than k, or a.end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic
- iterator lower_bound(const key_type& x)
+ iterator lower_bound(const key_type& x)
{ return m_tree.lower_bound(x); }
//! <b>Returns</b>: A const iterator pointing to the first element with key not
//! less than k, or a.end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic
- const_iterator lower_bound(const key_type& x) const
+ const_iterator lower_bound(const key_type& x) const
{ return m_tree.lower_bound(x); }
//! <b>Returns</b>: An iterator pointing to the first element with key not less
//! than x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic
- iterator upper_bound(const key_type& x)
+ iterator upper_bound(const key_type& x)
{ return m_tree.upper_bound(x); }
//! <b>Returns</b>: A const iterator pointing to the first element with key not
//! less than x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic
- const_iterator upper_bound(const key_type& x) const
+ const_iterator upper_bound(const key_type& x) const
{ return m_tree.upper_bound(x); }
//! <b>Effects</b>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).
//!
//! <b>Complexity</b>: Logarithmic
- std::pair<iterator,iterator> equal_range(const key_type& x)
+ std::pair<iterator,iterator> equal_range(const key_type& x)
{ return m_tree.equal_range(x); }
//! <b>Effects</b>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).
//!
//! <b>Complexity</b>: Logarithmic
- std::pair<const_iterator,const_iterator> equal_range(const key_type& x) const
+ std::pair<const_iterator,const_iterator> equal_range(const key_type& x) const
{ return m_tree.equal_range(x); }
/// @cond
@@ -666,7 +723,7 @@ class map
return (*i).second;
}
- mapped_type& priv_subscript(BOOST_RV_REF(key_type) mk)
+ mapped_type& priv_subscript(BOOST_RV_REF(key_type) mk)
{
key_type &k = mk;
//we can optimize this
@@ -684,37 +741,37 @@ class map
};
template <class Key, class T, class Pred, class A>
-inline bool operator==(const map<Key,T,Pred,A>& x,
- const map<Key,T,Pred,A>& y)
+inline bool operator==(const map<Key,T,Pred,A>& x,
+ const map<Key,T,Pred,A>& y)
{ return x.m_tree == y.m_tree; }
template <class Key, class T, class Pred, class A>
-inline bool operator<(const map<Key,T,Pred,A>& x,
- const map<Key,T,Pred,A>& y)
+inline bool operator<(const map<Key,T,Pred,A>& x,
+ const map<Key,T,Pred,A>& y)
{ return x.m_tree < y.m_tree; }
template <class Key, class T, class Pred, class A>
-inline bool operator!=(const map<Key,T,Pred,A>& x,
- const map<Key,T,Pred,A>& y)
+inline bool operator!=(const map<Key,T,Pred,A>& x,
+ const map<Key,T,Pred,A>& y)
{ return !(x == y); }
template <class Key, class T, class Pred, class A>
-inline bool operator>(const map<Key,T,Pred,A>& x,
- const map<Key,T,Pred,A>& y)
+inline bool operator>(const map<Key,T,Pred,A>& x,
+ const map<Key,T,Pred,A>& y)
{ return y < x; }
template <class Key, class T, class Pred, class A>
-inline bool operator<=(const map<Key,T,Pred,A>& x,
- const map<Key,T,Pred,A>& y)
+inline bool operator<=(const map<Key,T,Pred,A>& x,
+ const map<Key,T,Pred,A>& y)
{ return !(y < x); }
template <class Key, class T, class Pred, class A>
-inline bool operator>=(const map<Key,T,Pred,A>& x,
- const map<Key,T,Pred,A>& y)
+inline bool operator>=(const map<Key,T,Pred,A>& x,
+ const map<Key,T,Pred,A>& y)
{ return !(x < y); }
template <class Key, class T, class Pred, class A>
-inline void swap(map<Key,T,Pred,A>& x, map<Key,T,Pred,A>& y)
+inline void swap(map<Key,T,Pred,A>& x, map<Key,T,Pred,A>& y)
{ x.swap(y); }
/// @cond
@@ -722,11 +779,11 @@ inline void swap(map<Key,T,Pred,A>& x, map<Key,T,Pred,A>& y)
// Forward declaration of operators < and ==, needed for friend declaration.
template <class Key, class T, class Pred, class A>
-inline bool operator==(const multimap<Key,T,Pred,A>& x,
+inline bool operator==(const multimap<Key,T,Pred,A>& x,
const multimap<Key,T,Pred,A>& y);
template <class Key, class T, class Pred, class A>
-inline bool operator<(const multimap<Key,T,Pred,A>& x,
+inline bool operator<(const multimap<Key,T,Pred,A>& x,
const multimap<Key,T,Pred,A>& y);
} //namespace container {
@@ -743,14 +800,14 @@ namespace container {
/// @endcond
-//! A multimap is a kind of associative container that supports equivalent keys
-//! (possibly containing multiple copies of the same key value) and provides for
+//! A multimap is a kind of associative container that supports equivalent keys
+//! (possibly containing multiple copies of the same key value) and provides for
//! fast retrieval of values of another type T based on the keys. The multimap class
//! supports bidirectional iterators.
-//!
-//! A multimap satisfies all of the requirements of a container and of a reversible
-//! container and of an associative container. For a
-//! map<Key,T> the key_type is Key and the value_type is std::pair<const Key,T>.
+//!
+//! A multimap satisfies all of the requirements of a container and of a reversible
+//! container and of an associative container. For a
+//! map<Key,T> the key_type is Key and the value_type is std::pair<const Key,T>.
//!
//! Pred is the ordering function for Keys (e.g. <i>std::less<Key></i>).
//!
@@ -761,15 +818,15 @@ template <class Key, class T, class Pred = std::less< std::pair< const Key, T> >
#else
template <class Key, class T, class Pred, class A>
#endif
-class multimap
+class multimap
{
/// @cond
private:
BOOST_COPYABLE_AND_MOVABLE(multimap)
- typedef container_detail::rbtree<Key,
- std::pair<const Key, T>,
- container_detail::select1st< std::pair<const Key, T> >,
- Pred,
+ typedef container_detail::rbtree<Key,
+ std::pair<const Key, T>,
+ container_detail::select1st< std::pair<const Key, T> >,
+ Pred,
A> tree_t;
tree_t m_tree; // red-black tree representing map
typedef typename container_detail::
@@ -802,7 +859,7 @@ class multimap
/// @cond
class value_compare_impl
: public Pred,
- public std::binary_function<value_type, value_type, bool>
+ public std::binary_function<value_type, value_type, bool>
{
friend class multimap<Key,T,Pred,A>;
protected :
@@ -816,7 +873,7 @@ class multimap
typedef value_compare_impl value_compare;
//! <b>Effects</b>: Default constructs an empty multimap.
- //!
+ //!
//! <b>Complexity</b>: Constant.
multimap()
: m_tree()
@@ -827,195 +884,250 @@ class multimap
//! <b>Effects</b>: Constructs an empty multimap using the specified comparison
//! object and allocator.
- //!
+ //!
//! <b>Complexity</b>: Constant.
explicit multimap(const Pred& comp, const allocator_type& a = allocator_type())
: m_tree(comp, a)
{
//Allocator type must be std::pair<CONST Key, T>
- BOOST_STATIC_ASSERT((container_detail::is_same<std::pair<const Key, T>, typename A::value_type>::value));
+ BOOST_STATIC_ASSERT((container_detail::is_same<std::pair<const Key, T>, typename A::value_type>::value));
}
//! <b>Effects</b>: Constructs an empty multimap using the specified comparison object
//! and allocator, and inserts elements from the range [first ,last ).
- //!
- //! <b>Complexity</b>: Linear in N if the range [first ,last ) is already sorted using
+ //!
+ //! <b>Complexity</b>: Linear in N if the range [first ,last ) is already sorted using
//! comp and otherwise N logN, where N is last - first.
template <class InputIterator>
multimap(InputIterator first, InputIterator last,
const Pred& comp = Pred(),
const allocator_type& a = allocator_type())
- : m_tree(first, last, comp, a, false)
+ : m_tree(first, last, comp, a, false)
{
//Allocator type must be std::pair<CONST Key, T>
- BOOST_STATIC_ASSERT((container_detail::is_same<std::pair<const Key, T>, typename A::value_type>::value));
+ BOOST_STATIC_ASSERT((container_detail::is_same<std::pair<const Key, T>, typename A::value_type>::value));
}
- //! <b>Effects</b>: Constructs an empty multimap using the specified comparison object and
+ //! <b>Effects</b>: Constructs an empty multimap using the specified comparison object and
//! allocator, and inserts elements from the ordered range [first ,last). This function
//! is more efficient than the normal range creation for ordered ranges.
//!
//! <b>Requires</b>: [first ,last) must be ordered according to the predicate.
- //!
+ //!
//! <b>Complexity</b>: Linear in N.
template <class InputIterator>
multimap(ordered_range_t ordered_range, InputIterator first, InputIterator last, const Pred& comp = Pred(),
const allocator_type& a = allocator_type())
- : m_tree(ordered_range, first, last, comp, a)
+ : m_tree(ordered_range, first, last, comp, a)
{}
-
//! <b>Effects</b>: Copy constructs a multimap.
- //!
+ //!
//! <b>Complexity</b>: Linear in x.size().
- multimap(const multimap<Key,T,Pred,A>& x)
+ multimap(const multimap& x)
: m_tree(x.m_tree)
{
//Allocator type must be std::pair<CONST Key, T>
- BOOST_STATIC_ASSERT((container_detail::is_same<std::pair<const Key, T>, typename A::value_type>::value));
+ BOOST_STATIC_ASSERT((container_detail::is_same<std::pair<const Key, T>, typename A::value_type>::value));
}
//! <b>Effects</b>: Move constructs a multimap. Constructs *this using x's resources.
- //!
- //! <b>Complexity</b>: Construct.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Postcondition</b>: x is emptied.
- multimap(BOOST_RV_REF(multimap) x)
+ multimap(BOOST_RV_REF(multimap) x)
: m_tree(boost::move(x.m_tree))
{
//Allocator type must be std::pair<CONST Key, T>
- BOOST_STATIC_ASSERT((container_detail::is_same<std::pair<const Key, T>, typename A::value_type>::value));
+ BOOST_STATIC_ASSERT((container_detail::is_same<std::pair<const Key, T>, typename A::value_type>::value));
+ }
+
+ //! <b>Effects</b>: Copy constructs a multimap.
+ //!
+ //! <b>Complexity</b>: Linear in x.size().
+ multimap(const multimap& x, const allocator_type &a)
+ : m_tree(x.m_tree, a)
+ {
+ //Allocator type must be std::pair<CONST Key, T>
+ BOOST_STATIC_ASSERT((container_detail::is_same<std::pair<const Key, T>, typename A::value_type>::value));
+ }
+
+ //! <b>Effects</b>: Move constructs a multimap using the specified allocator.
+ //! Constructs *this using x's resources.
+ //! <b>Complexity</b>: Constant if a == x.get_allocator(), linear otherwise.
+ //!
+ //! <b>Postcondition</b>: x is emptied.
+ multimap(BOOST_RV_REF(multimap) x, const allocator_type &a)
+ : m_tree(boost::move(x.m_tree), a)
+ {
+ //Allocator type must be std::pair<CONST Key, T>
+ BOOST_STATIC_ASSERT((container_detail::is_same<std::pair<const Key, T>, typename A::value_type>::value));
}
//! <b>Effects</b>: Makes *this a copy of x.
- //!
+ //!
//! <b>Complexity</b>: Linear in x.size().
- multimap& operator=(BOOST_COPY_ASSIGN_REF(multimap) x)
+ multimap& operator=(BOOST_COPY_ASSIGN_REF(multimap) x)
{ m_tree = x.m_tree; return *this; }
//! <b>Effects</b>: this->swap(x.get()).
- //!
+ //!
//! <b>Complexity</b>: Constant.
- multimap& operator=(BOOST_RV_REF(multimap) x)
+ multimap& operator=(BOOST_RV_REF(multimap) x)
{ m_tree = boost::move(x.m_tree); return *this; }
//! <b>Effects</b>: Returns the comparison object out
//! of which a was constructed.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- key_compare key_comp() const
+ key_compare key_comp() const
{ return m_tree.key_comp(); }
//! <b>Effects</b>: Returns an object of value_compare constructed out
//! of the comparison object.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- value_compare value_comp() const
+ value_compare value_comp() const
{ return value_compare(m_tree.key_comp()); }
//! <b>Effects</b>: Returns a copy of the Allocator that
//! was passed to the object's constructor.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- allocator_type get_allocator() const
+ allocator_type get_allocator() const
{ return m_tree.get_allocator(); }
- const stored_allocator_type &get_stored_allocator() const
+ const stored_allocator_type &get_stored_allocator() const
{ return m_tree.get_stored_allocator(); }
stored_allocator_type &get_stored_allocator()
{ return m_tree.get_stored_allocator(); }
//! <b>Effects</b>: Returns an iterator to the first element contained in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- iterator begin()
+ iterator begin()
{ return m_tree.begin(); }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator begin() const
+ const_iterator begin() const
+ { return this->cbegin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator to the first element contained in the container.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ const_iterator cbegin() const
{ return m_tree.begin(); }
//! <b>Effects</b>: Returns an iterator to the end of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- iterator end()
+ iterator end()
{ return m_tree.end(); }
//! <b>Effects</b>: Returns a const_iterator to the end of the container.
- //!
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ const_iterator end() const
+ { return this->cend(); }
+
+ //! <b>Effects</b>: Returns a const_iterator to the end of the container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator end() const
+ const_iterator cend() const
{ return m_tree.end(); }
- //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
- //! of the reversed container.
- //!
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- reverse_iterator rbegin()
+ reverse_iterator rbegin()
{ return m_tree.rbegin(); }
- //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
- //! of the reversed container.
- //!
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed container.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ const_reverse_iterator rbegin() const
+ { return this->crbegin(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator rbegin() const
+ const_reverse_iterator crbegin() const
{ return m_tree.rbegin(); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the end
- //! of the reversed container.
- //!
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- reverse_iterator rend()
+ reverse_iterator rend()
{ return m_tree.rend(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
- //! of the reversed container.
- //!
+ //! of the reversed container.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ const_reverse_iterator rend() const
+ { return this->crend(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator rend() const
+ const_reverse_iterator crend() const
{ return m_tree.rend(); }
//! <b>Effects</b>: Returns true if the container contains no elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- bool empty() const
+ bool empty() const
{ return m_tree.empty(); }
//! <b>Effects</b>: Returns the number of the elements contained in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- size_type size() const
+ size_type size() const
{ return m_tree.size(); }
//! <b>Effects</b>: Returns the largest possible size of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- size_type max_size() const
+ size_type max_size() const
{ return m_tree.max_size(); }
//! <b>Effects</b>: Swaps the contents of *this and x.
@@ -1027,31 +1139,31 @@ class multimap
{ m_tree.swap(x.m_tree); }
//! <b>Effects</b>: Inserts x and returns the iterator pointing to the
- //! newly inserted element.
+ //! newly inserted element.
//!
//! <b>Complexity</b>: Logarithmic.
- iterator insert(const value_type& x)
+ iterator insert(const value_type& x)
{ return m_tree.insert_equal(x); }
- //! <b>Effects</b>: Inserts a new value constructed from x and returns
- //! the iterator pointing to the newly inserted element.
+ //! <b>Effects</b>: Inserts a new value constructed from x and returns
+ //! the iterator pointing to the newly inserted element.
//!
//! <b>Complexity</b>: Logarithmic.
- iterator insert(const nonconst_value_type& x)
+ iterator insert(const nonconst_value_type& x)
{ return m_tree.insert_equal(x); }
- //! <b>Effects</b>: Inserts a new value move-constructed from x and returns
- //! the iterator pointing to the newly inserted element.
+ //! <b>Effects</b>: Inserts a new value move-constructed from x and returns
+ //! the iterator pointing to the newly inserted element.
//!
//! <b>Complexity</b>: Logarithmic.
- iterator insert(BOOST_RV_REF(nonconst_value_type) x)
+ iterator insert(BOOST_RV_REF(nonconst_value_type) x)
{ return m_tree.insert_equal(boost::move(x)); }
- //! <b>Effects</b>: Inserts a new value move-constructed from x and returns
- //! the iterator pointing to the newly inserted element.
+ //! <b>Effects</b>: Inserts a new value move-constructed from x and returns
+ //! the iterator pointing to the newly inserted element.
//!
//! <b>Complexity</b>: Logarithmic.
- iterator insert(BOOST_RV_REF(nonconst_impl_value_type) x)
+ iterator insert(BOOST_RV_REF(nonconst_impl_value_type) x)
{ return m_tree.insert_equal(boost::move(x)); }
//! <b>Effects</b>: Inserts a copy of x in the container.
@@ -1104,7 +1216,7 @@ class multimap
//!
//! <b>Complexity</b>: At most N log(size()+N) (N is the distance from first to last)
template <class InputIterator>
- void insert(InputIterator first, InputIterator last)
+ void insert(InputIterator first, InputIterator last)
{ m_tree.insert_equal(first, last); }
#if defined(BOOST_CONTAINER_PERFECT_FORWARDING) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
@@ -1156,11 +1268,11 @@ class multimap
//! <b>Effects</b>: Erases the element pointed to by position.
//!
//! <b>Returns</b>: Returns an iterator pointing to the element immediately
- //! following q prior to the element being erased. If no such element exists,
+ //! following q prior to the element being erased. If no such element exists,
//! returns end().
//!
//! <b>Complexity</b>: Amortized constant time
- iterator erase(const_iterator position)
+ iterator erase(const_iterator position)
{ return m_tree.erase(position); }
//! <b>Effects</b>: Erases all elements in the container with key equivalent to x.
@@ -1168,7 +1280,7 @@ class multimap
//! <b>Returns</b>: Returns the number of erased elements.
//!
//! <b>Complexity</b>: log(size()) + count(k)
- size_type erase(const key_type& x)
+ size_type erase(const key_type& x)
{ return m_tree.erase(x); }
//! <b>Effects</b>: Erases all the elements in the range [first, last).
@@ -1184,68 +1296,68 @@ class multimap
//! <b>Postcondition</b>: size() == 0.
//!
//! <b>Complexity</b>: linear in size().
- void clear()
+ void clear()
{ m_tree.clear(); }
//! <b>Returns</b>: An iterator pointing to an element with the key
//! equivalent to x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic.
- iterator find(const key_type& x)
+ iterator find(const key_type& x)
{ return m_tree.find(x); }
//! <b>Returns</b>: A const iterator pointing to an element with the key
//! equivalent to x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic.
- const_iterator find(const key_type& x) const
+ const_iterator find(const key_type& x) const
{ return m_tree.find(x); }
//! <b>Returns</b>: The number of elements with key equivalent to x.
//!
//! <b>Complexity</b>: log(size())+count(k)
- size_type count(const key_type& x) const
+ size_type count(const key_type& x) const
{ return m_tree.count(x); }
//! <b>Returns</b>: An iterator pointing to the first element with key not less
//! than k, or a.end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic
- iterator lower_bound(const key_type& x)
+ iterator lower_bound(const key_type& x)
{return m_tree.lower_bound(x); }
//! <b>Returns</b>: A const iterator pointing to the first element with key not
//! less than k, or a.end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic
- const_iterator lower_bound(const key_type& x) const
+ const_iterator lower_bound(const key_type& x) const
{ return m_tree.lower_bound(x); }
//! <b>Returns</b>: An iterator pointing to the first element with key not less
//! than x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic
- iterator upper_bound(const key_type& x)
+ iterator upper_bound(const key_type& x)
{ return m_tree.upper_bound(x); }
//! <b>Effects</b>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).
//!
//! <b>Complexity</b>: Logarithmic
- std::pair<iterator,iterator> equal_range(const key_type& x)
+ std::pair<iterator,iterator> equal_range(const key_type& x)
{ return m_tree.equal_range(x); }
//! <b>Returns</b>: A const iterator pointing to the first element with key not
//! less than x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic
- const_iterator upper_bound(const key_type& x) const
+ const_iterator upper_bound(const key_type& x) const
{ return m_tree.upper_bound(x); }
//! <b>Effects</b>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).
//!
//! <b>Complexity</b>: Logarithmic
- std::pair<const_iterator,const_iterator>
- equal_range(const key_type& x) const
+ std::pair<const_iterator,const_iterator>
+ equal_range(const key_type& x) const
{ return m_tree.equal_range(x); }
/// @cond
@@ -1260,37 +1372,37 @@ class multimap
};
template <class Key, class T, class Pred, class A>
-inline bool operator==(const multimap<Key,T,Pred,A>& x,
- const multimap<Key,T,Pred,A>& y)
+inline bool operator==(const multimap<Key,T,Pred,A>& x,
+ const multimap<Key,T,Pred,A>& y)
{ return x.m_tree == y.m_tree; }
template <class Key, class T, class Pred, class A>
-inline bool operator<(const multimap<Key,T,Pred,A>& x,
- const multimap<Key,T,Pred,A>& y)
+inline bool operator<(const multimap<Key,T,Pred,A>& x,
+ const multimap<Key,T,Pred,A>& y)
{ return x.m_tree < y.m_tree; }
template <class Key, class T, class Pred, class A>
-inline bool operator!=(const multimap<Key,T,Pred,A>& x,
- const multimap<Key,T,Pred,A>& y)
+inline bool operator!=(const multimap<Key,T,Pred,A>& x,
+ const multimap<Key,T,Pred,A>& y)
{ return !(x == y); }
template <class Key, class T, class Pred, class A>
-inline bool operator>(const multimap<Key,T,Pred,A>& x,
- const multimap<Key,T,Pred,A>& y)
+inline bool operator>(const multimap<Key,T,Pred,A>& x,
+ const multimap<Key,T,Pred,A>& y)
{ return y < x; }
template <class Key, class T, class Pred, class A>
-inline bool operator<=(const multimap<Key,T,Pred,A>& x,
- const multimap<Key,T,Pred,A>& y)
+inline bool operator<=(const multimap<Key,T,Pred,A>& x,
+ const multimap<Key,T,Pred,A>& y)
{ return !(y < x); }
template <class Key, class T, class Pred, class A>
-inline bool operator>=(const multimap<Key,T,Pred,A>& x,
- const multimap<Key,T,Pred,A>& y)
+inline bool operator>=(const multimap<Key,T,Pred,A>& x,
+ const multimap<Key,T,Pred,A>& y)
{ return !(x < y); }
template <class Key, class T, class Pred, class A>
-inline void swap(multimap<Key,T,Pred,A>& x, multimap<Key,T,Pred,A>& y)
+inline void swap(multimap<Key,T,Pred,A>& x, multimap<Key,T,Pred,A>& y)
{ x.swap(y); }
/// @cond
diff --git a/boost/container/scoped_allocator.hpp b/boost/container/scoped_allocator.hpp
new file mode 100644
index 0000000000..7da71bdf81
--- /dev/null
+++ b/boost/container/scoped_allocator.hpp
@@ -0,0 +1,1466 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Pablo Halpern 2009. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2011-2012. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_CONTAINER_ALLOCATOR_SCOPED_ALLOCATOR_HPP
+#define BOOST_CONTAINER_ALLOCATOR_SCOPED_ALLOCATOR_HPP
+
+#if (defined MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <boost/container/detail/config_begin.hpp>
+#include <boost/container/detail/workaround.hpp>
+#include <boost/container/scoped_allocator_fwd.hpp>
+#include <boost/type_traits/integral_constant.hpp>
+#include <boost/container/allocator_traits.hpp>
+#include <boost/container/detail/type_traits.hpp>
+#include <boost/container/detail/utilities.hpp>
+#include <utility>
+#include <boost/container/detail/pair.hpp>
+#include <boost/move/move.hpp>
+
+
+namespace boost { namespace container {
+
+//! <b>Remark</b>: if a specialization is derived from true_type, indicates that T may be constructed
+//! with an allocator as its last constructor argument. Ideally, all constructors of T (including the
+//! copy and move constructors) should have a variant that accepts a final argument of
+//! allocator_type.
+//!
+//! <b>Requires</b>: if a specialization is derived from true_type, T must have a nested type,
+//! allocator_type and at least one constructor for which allocator_type is the last
+//! parameter. If not all constructors of T can be called with a final allocator_type argument,
+//! and if T is used in a context where a container must call such a constructor, then the program is
+//! ill-formed.
+//!
+//! [Example:
+//! template <class T, class A = allocator<T> >
+//! class Z {
+//! public:
+//! typedef A allocator_type;
+//!
+//! // Default constructor with optional allocator suffix
+//! Z(const allocator_type& a = allocator_type());
+//!
+//! // Copy constructor and allocator-extended copy constructor
+//! Z(const Z& zz);
+//! Z(const Z& zz, const allocator_type& a);
+//! };
+//!
+//! // Specialize trait for class template Z
+//! template <class T, class A = allocator<T> >
+//! struct constructible_with_allocator_suffix<Z<T,A> >
+//! : ::boost::true_type { };
+//! -- end example]
+//!
+//! <b>Note</b>: This trait is a workaround inspired by "N2554: The Scoped Allocator Model (Rev 2)"
+//! (Pablo Halpern, 2008-02-29) to backport the scoped allocator model to C++03, as
+//! in C++03 there is no mechanism to detect if a type can be constructed from arbitrary arguments.
+//! Applications aiming portability with several compilers should always define this trait.
+//!
+//! In conforming C++11 compilers or compilers supporting SFINAE expressions
+//! (when BOOST_NO_SFINAE_EXPR is NOT defined), this trait is ignored and C++11 rules will be used
+//! to detect if a type should be constructed with suffix or prefix allocator arguments.
+template <class T>
+struct constructible_with_allocator_suffix
+ : ::boost::false_type
+{};
+
+//! <b>Remark</b>: if a specialization is derived from true_type, indicates that T may be constructed
+//! with allocator_arg and T::allocator_type as its first two constructor arguments.
+//! Ideally, all constructors of T (including the copy and move constructors) should have a variant
+//! that accepts these two initial arguments.
+//!
+//! <b>Requires</b>: if a specialization is derived from true_type, T must have a nested type,
+//! allocator_type and at least one constructor for which allocator_arg_t is the first
+//! parameter and allocator_type is the second parameter. If not all constructors of T can be
+//! called with these initial arguments, and if T is used in a context where a container must call such
+//! a constructor, then the program is ill-formed.
+//!
+//! [Example:
+//! template <class T, class A = allocator<T> >
+//! class Y {
+//! public:
+//! typedef A allocator_type;
+//!
+//! // Default constructor with and allocator-extended default constructor
+//! Y();
+//! Y(allocator_arg_t, const allocator_type& a);
+//!
+//! // Copy constructor and allocator-extended copy constructor
+//! Y(const Y& yy);
+//! Y(allocator_arg_t, const allocator_type& a, const Y& yy);
+//!
+//! // Variadic constructor and allocator-extended variadic constructor
+//! template<class ...Args> Y(Args&& args...);
+//! template<class ...Args>
+//! Y(allocator_arg_t, const allocator_type& a, Args&&... args);
+//! };
+//!
+//! // Specialize trait for class template Y
+//! template <class T, class A = allocator<T> >
+//! struct constructible_with_allocator_prefix<Y<T,A> >
+//! : ::boost::true_type { };
+//!
+//! -- end example]
+//!
+//! <b>Note</b>: This trait is a workaround inspired by "N2554: The Scoped Allocator Model (Rev 2)"
+//! (Pablo Halpern, 2008-02-29) to backport the scoped allocator model to C++03, as
+//! in C++03 there is no mechanism to detect if a type can be constructed from arbitrary arguments.
+//! Applications aiming portability with several compilers should always define this trait.
+//!
+//! In conforming C++11 compilers or compilers supporting SFINAE expressions
+//! (when BOOST_NO_SFINAE_EXPR is NOT defined), this trait is ignored and C++11 rules will be used
+//! to detect if a type should be constructed with suffix or prefix allocator arguments.
+template <class T>
+struct constructible_with_allocator_prefix
+ : ::boost::false_type
+{};
+
+///@cond
+
+namespace container_detail {
+
+template<typename T, typename Alloc>
+struct uses_allocator_imp
+{
+ // Use SFINAE (Substitution Failure Is Not An Error) to detect the
+ // presence of an 'allocator_type' nested type convertilble from Alloc.
+
+ private:
+ // Match this function if TypeT::allocator_type exists and is
+ // implicitly convertible from Alloc
+ template <typename U>
+ static char test(int, typename U::allocator_type);
+
+ // Match this function if TypeT::allocator_type does not exist or is
+ // not convertible from Alloc.
+ template <typename U>
+ static int test(LowPriorityConversion<int>, LowPriorityConversion<Alloc>);
+
+ static Alloc alloc; // Declared but not defined
+
+ public:
+ enum { value = sizeof(test<T>(0, alloc)) == sizeof(char) };
+};
+
+} //namespace container_detail {
+
+///@endcond
+
+//! <b>Remark</b>: Automatically detects if T has a nested allocator_type that is convertible from
+//! Alloc. Meets the BinaryTypeTrait requirements ([meta.rqmts] 20.4.1). A program may
+//! specialize this type to derive from true_type for a T of user-defined type if T does not
+//! have a nested allocator_type but is nonetheless constructible using the specified Alloc.
+//!
+//! <b>Result</b>: derived from true_type if Convertible<Alloc,T::allocator_type> and
+//! derived from false_type otherwise.
+template <typename T, typename Alloc>
+struct uses_allocator
+ : boost::integral_constant<bool, container_detail::uses_allocator_imp<T, Alloc>::value>
+{};
+
+///@cond
+
+namespace container_detail {
+
+template <typename Alloc>
+struct is_scoped_allocator_imp
+{
+ template <typename T>
+ static char test(int, typename T::outer_allocator_type*);
+
+ template <typename T>
+ static int test(LowPriorityConversion<int>, void*);
+
+ static const bool value = (sizeof(char) == sizeof(test<Alloc>(0, 0)));
+};
+
+template<class MaybeScopedAlloc, bool = is_scoped_allocator_imp<MaybeScopedAlloc>::value >
+struct outermost_allocator_type_impl
+{
+ typedef typename MaybeScopedAlloc::outer_allocator_type outer_type;
+ typedef typename outermost_allocator_type_impl<outer_type>::type type;
+};
+
+template<class MaybeScopedAlloc>
+struct outermost_allocator_type_impl<MaybeScopedAlloc, false>
+{
+ typedef MaybeScopedAlloc type;
+};
+
+template<class MaybeScopedAlloc, bool = is_scoped_allocator_imp<MaybeScopedAlloc>::value >
+struct outermost_allocator_imp
+{
+ typedef MaybeScopedAlloc type;
+
+ static type &get(MaybeScopedAlloc &a)
+ { return a; }
+
+ static const type &get(const MaybeScopedAlloc &a)
+ { return a; }
+};
+
+template<class MaybeScopedAlloc>
+struct outermost_allocator_imp<MaybeScopedAlloc, true>
+{
+ typedef typename MaybeScopedAlloc::outer_allocator_type outer_type;
+ typedef typename outermost_allocator_type_impl<outer_type>::type type;
+
+ static type &get(MaybeScopedAlloc &a)
+ { return outermost_allocator_imp<outer_type>::get(a.outer_allocator()); }
+
+ static const type &get(const MaybeScopedAlloc &a)
+ { return outermost_allocator_imp<outer_type>::get(a.outer_allocator()); }
+};
+
+} //namespace container_detail {
+
+template <typename Alloc>
+struct is_scoped_allocator
+ : boost::integral_constant<bool, container_detail::is_scoped_allocator_imp<Alloc>::value>
+{};
+
+template <typename Alloc>
+struct outermost_allocator
+ : container_detail::outermost_allocator_imp<Alloc>
+{};
+
+template <typename Alloc>
+typename container_detail::outermost_allocator_imp<Alloc>::type &
+ get_outermost_allocator(Alloc &a)
+{ return container_detail::outermost_allocator_imp<Alloc>::get(a); }
+
+template <typename Alloc>
+const typename container_detail::outermost_allocator_imp<Alloc>::type &
+ get_outermost_allocator(const Alloc &a)
+{ return container_detail::outermost_allocator_imp<Alloc>::get(a); }
+
+namespace container_detail {
+
+// Check if we can detect is_convertible using advanced SFINAE expressions
+#if !defined(BOOST_NO_SFINAE_EXPR)
+
+ //! Code inspired by Mathias Gaunard's is_convertible.cpp found in the Boost mailing list
+ //! http://boost.2283326.n4.nabble.com/type-traits-is-constructible-when-decltype-is-supported-td3575452.html
+ //! Thanks Mathias!
+
+ //With variadic templates, we need a single class to implement the trait
+ #if !defined(BOOST_NO_VARIADIC_TEMPLATES)
+
+ template<class T, class ...Args>
+ struct is_constructible_impl
+ {
+ typedef char yes_type;
+ struct no_type
+ { char padding[2]; };
+
+ template<std::size_t N>
+ struct dummy;
+
+ template<class X>
+ static yes_type test(dummy<sizeof(X(boost::move_detail::declval<Args>()...))>*);
+
+ template<class X>
+ static no_type test(...);
+
+ static const bool value = sizeof(test<T>(0)) == sizeof(yes_type);
+ };
+
+ template<class T, class ...Args>
+ struct is_constructible
+ : boost::integral_constant<bool, is_constructible_impl<T, Args...>::value>
+ {};
+
+ template <class T, class InnerAlloc, class ...Args>
+ struct is_constructible_with_allocator_prefix
+ : is_constructible<T, allocator_arg_t, InnerAlloc, Args...>
+ {};
+
+ #else // #if !defined(BOOST_NO_VARIADIC_TEMPLATES)
+
+ //Without variadic templates, we need to use de preprocessor to generate
+ //some specializations.
+
+ #define BOOST_CONTAINER_MAX_IS_CONSTRUCTIBLE_PARAMETERS \
+ BOOST_PP_ADD(BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS, 3)
+ //!
+
+ //Generate N+1 template parameters so that we can specialize N
+ template<class T
+ BOOST_PP_ENUM_TRAILING( BOOST_PP_ADD(BOOST_CONTAINER_MAX_IS_CONSTRUCTIBLE_PARAMETERS, 1)
+ , BOOST_CONTAINER_PP_TEMPLATE_PARAM_WITH_DEFAULT
+ , void)
+ >
+ struct is_constructible_impl;
+
+ //Generate N specializations, from 0 to
+ //BOOST_CONTAINER_MAX_IS_CONSTRUCTIBLE_PARAMETERS parameters
+ #define BOOST_PP_LOCAL_MACRO(n) \
+ template<class T BOOST_PP_ENUM_TRAILING_PARAMS(n, class P)> \
+ struct is_constructible_impl \
+ <T BOOST_PP_ENUM_TRAILING_PARAMS(n, P) \
+ BOOST_PP_ENUM_TRAILING \
+ ( BOOST_PP_SUB(BOOST_CONTAINER_MAX_IS_CONSTRUCTIBLE_PARAMETERS, n) \
+ , BOOST_CONTAINER_PP_IDENTITY, void) \
+ , void> \
+ { \
+ typedef char yes_type; \
+ struct no_type \
+ { char padding[2]; }; \
+ \
+ template<std::size_t N> \
+ struct dummy; \
+ \
+ template<class X> \
+ static yes_type test(dummy<sizeof(X(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_DECLVAL, ~)))>*); \
+ \
+ template<class X> \
+ static no_type test(...); \
+ \
+ static const bool value = sizeof(test<T>(0)) == sizeof(yes_type); \
+ }; \
+ //!
+
+ #define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_IS_CONSTRUCTIBLE_PARAMETERS)
+ #include BOOST_PP_LOCAL_ITERATE()
+
+ //Finally just inherit from the implementation to define he trait
+ template< class T
+ BOOST_PP_ENUM_TRAILING( BOOST_CONTAINER_MAX_IS_CONSTRUCTIBLE_PARAMETERS
+ , BOOST_CONTAINER_PP_TEMPLATE_PARAM_WITH_DEFAULT
+ , void)
+ >
+ struct is_constructible
+ : boost::integral_constant
+ < bool
+ , is_constructible_impl
+ < T
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_CONTAINER_MAX_IS_CONSTRUCTIBLE_PARAMETERS, P)
+ , void>::value
+ >
+ {};
+
+ //Finally just inherit from the implementation to define he trait
+ template <class T
+ ,class InnerAlloc
+ BOOST_PP_ENUM_TRAILING( BOOST_PP_SUB(BOOST_CONTAINER_MAX_IS_CONSTRUCTIBLE_PARAMETERS, 2)
+ , BOOST_CONTAINER_PP_TEMPLATE_PARAM_WITH_DEFAULT
+ , void)
+ >
+ struct is_constructible_with_allocator_prefix
+ : is_constructible
+ < T, allocator_arg_t, InnerAlloc
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_CONTAINER_MAX_IS_CONSTRUCTIBLE_PARAMETERS, 2), P)
+ >
+ {};
+/*
+ template <class T
+ ,class InnerAlloc
+ BOOST_PP_ENUM_TRAILING( BOOST_PP_SUB(BOOST_CONTAINER_MAX_IS_CONSTRUCTIBLE_PARAMETERS, 1)
+ , BOOST_CONTAINER_PP_TEMPLATE_PARAM_WITH_DEFAULT
+ , void)
+ >
+ struct is_constructible_with_allocator_suffix
+ : is_constructible
+ < T
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_CONTAINER_MAX_IS_CONSTRUCTIBLE_PARAMETERS, 1), P)
+ , InnerAlloc
+ >
+ {};*/
+
+ #endif // #if !defined(BOOST_NO_VARIADIC_TEMPLATES)
+
+#else // #if !defined(BOOST_NO_SFINAE_EXPR)
+
+ //Without advanced SFINAE expressions, we can't use is_constructible
+ //so backup to constructible_with_allocator_xxx
+
+ #if !defined(BOOST_NO_VARIADIC_TEMPLATES)
+
+ template < class T, class InnerAlloc, class ...Args>
+ struct is_constructible_with_allocator_prefix
+ : constructible_with_allocator_prefix<T>
+ {};
+/*
+ template < class T, class InnerAlloc, class ...Args>
+ struct is_constructible_with_allocator_suffix
+ : constructible_with_allocator_suffix<T>
+ {};*/
+
+ #else // #if !defined(BOOST_NO_VARIADIC_TEMPLATES)
+
+ template < class T
+ , class InnerAlloc
+ BOOST_PP_ENUM_TRAILING( BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_CONTAINER_PP_TEMPLATE_PARAM_WITH_DEFAULT
+ , void)
+ >
+ struct is_constructible_with_allocator_prefix
+ : constructible_with_allocator_prefix<T>
+ {};
+/*
+ template < class T
+ , class InnerAlloc
+ BOOST_PP_ENUM_TRAILING( BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_CONTAINER_PP_TEMPLATE_PARAM_WITH_DEFAULT
+ , void)
+ >
+ struct is_constructible_with_allocator_suffix
+ : constructible_with_allocator_suffix<T>
+ {};*/
+
+ #endif // #if !defined(BOOST_NO_VARIADIC_TEMPLATES)
+
+#endif // #if !defined(BOOST_NO_SFINAE_EXPR)
+
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
+
+template < typename OutermostAlloc
+ , typename InnerAlloc
+ , typename T
+ , class ...Args
+ >
+inline void dispatch_allocator_prefix_suffix
+ ( boost::true_type use_alloc_prefix, OutermostAlloc& outermost_alloc
+ , InnerAlloc& inner_alloc, T* p, BOOST_FWD_REF(Args) ...args)
+{
+ (void)use_alloc_prefix;
+ allocator_traits<OutermostAlloc>::construct
+ ( outermost_alloc, p, allocator_arg, inner_alloc, ::boost::forward<Args>(args)...);
+}
+
+template < typename OutermostAlloc
+ , typename InnerAlloc
+ , typename T
+ , class ...Args
+ >
+inline void dispatch_allocator_prefix_suffix
+ ( boost::false_type use_alloc_prefix, OutermostAlloc& outermost_alloc
+ , InnerAlloc &inner_alloc, T* p, BOOST_FWD_REF(Args)...args)
+{
+ (void)use_alloc_prefix;
+ allocator_traits<OutermostAlloc>::construct
+ (outermost_alloc, p, ::boost::forward<Args>(args)..., inner_alloc);
+}
+
+template < typename OutermostAlloc
+ , typename InnerAlloc
+ , typename T
+ , class ...Args
+ >
+inline void dispatch_uses_allocator
+ ( boost::true_type uses_allocator, OutermostAlloc& outermost_alloc
+ , InnerAlloc& inner_alloc, T* p, BOOST_FWD_REF(Args)...args)
+{
+ (void)uses_allocator;
+ //BOOST_STATIC_ASSERT((is_constructible_with_allocator_prefix<T, InnerAlloc, Args...>::value ||
+ // is_constructible_with_allocator_suffix<T, InnerAlloc, Args...>::value ));
+ dispatch_allocator_prefix_suffix
+ ( is_constructible_with_allocator_prefix<T, InnerAlloc, Args...>()
+ , outermost_alloc, inner_alloc, p, ::boost::forward<Args>(args)...);
+}
+
+template < typename OutermostAlloc
+ , typename InnerAlloc
+ , typename T
+ , class ...Args
+ >
+inline void dispatch_uses_allocator
+ ( boost::false_type uses_allocator, OutermostAlloc & outermost_alloc
+ , InnerAlloc & inner_alloc
+ ,T* p, BOOST_FWD_REF(Args)...args)
+{
+ (void)uses_allocator; (void)inner_alloc;
+ allocator_traits<OutermostAlloc>::construct
+ (outermost_alloc, p, ::boost::forward<Args>(args)...);
+}
+
+#else //#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
+
+#define BOOST_PP_LOCAL_MACRO(n) \
+template < typename OutermostAlloc \
+ , typename InnerAlloc \
+ , typename T \
+ BOOST_PP_ENUM_TRAILING_PARAMS(n, class P) \
+ > \
+inline void dispatch_allocator_prefix_suffix( \
+ boost::true_type use_alloc_prefix, \
+ OutermostAlloc& outermost_alloc, \
+ InnerAlloc& inner_alloc, \
+ T* p \
+ BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \
+{ \
+ (void)use_alloc_prefix, \
+ allocator_traits<OutermostAlloc>::construct \
+ (outermost_alloc, p, allocator_arg, inner_alloc \
+ BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)); \
+} \
+ \
+template < typename OutermostAlloc \
+ , typename InnerAlloc \
+ , typename T \
+ BOOST_PP_ENUM_TRAILING_PARAMS(n, class P) \
+ > \
+inline void dispatch_allocator_prefix_suffix( \
+ boost::false_type use_alloc_prefix, \
+ OutermostAlloc& outermost_alloc, \
+ InnerAlloc& inner_alloc, \
+ T* p BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \
+{ \
+ (void)use_alloc_prefix; \
+ allocator_traits<OutermostAlloc>::construct \
+ (outermost_alloc, p \
+ BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _) \
+ , inner_alloc); \
+} \
+ \
+template < typename OutermostAlloc \
+ , typename InnerAlloc \
+ , typename T \
+ BOOST_PP_ENUM_TRAILING_PARAMS(n, class P) \
+ > \
+inline void dispatch_uses_allocator(boost::true_type uses_allocator, \
+ OutermostAlloc& outermost_alloc, \
+ InnerAlloc& inner_alloc, \
+ T* p BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \
+{ \
+ (void)uses_allocator; \
+ dispatch_allocator_prefix_suffix \
+ (is_constructible_with_allocator_prefix \
+ < T, InnerAlloc BOOST_PP_ENUM_TRAILING_PARAMS(n, P)>() \
+ , outermost_alloc, inner_alloc, p \
+ BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)); \
+} \
+ \
+template < typename OutermostAlloc \
+ , typename InnerAlloc \
+ , typename T \
+ BOOST_PP_ENUM_TRAILING_PARAMS(n, class P) \
+ > \
+inline void dispatch_uses_allocator(boost::false_type uses_allocator \
+ ,OutermostAlloc & outermost_alloc \
+ ,InnerAlloc & inner_alloc \
+ ,T* p BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \
+{ \
+ (void)uses_allocator; (void)inner_alloc; \
+ allocator_traits<OutermostAlloc>::construct \
+ (outermost_alloc, p BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)); \
+} \
+//!
+#define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS)
+#include BOOST_PP_LOCAL_ITERATE()
+
+#endif //#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
+
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
+
+template <typename OuterAlloc, class ...InnerAllocs>
+class scoped_allocator_adaptor_base
+ : public OuterAlloc
+{
+ typedef allocator_traits<OuterAlloc> outer_traits_type;
+ BOOST_COPYABLE_AND_MOVABLE(scoped_allocator_adaptor_base)
+
+ public:
+ template <class OuterA2>
+ struct rebind_base
+ {
+ typedef scoped_allocator_adaptor_base<OuterA2, InnerAllocs...> other;
+ };
+
+ typedef OuterAlloc outer_allocator_type;
+ typedef scoped_allocator_adaptor<InnerAllocs...> inner_allocator_type;
+ typedef boost::integral_constant<
+ bool,
+ outer_traits_type::propagate_on_container_copy_assignment::value ||
+ inner_allocator_type::propagate_on_container_copy_assignment::value
+ > propagate_on_container_copy_assignment;
+ typedef boost::integral_constant<
+ bool,
+ outer_traits_type::propagate_on_container_move_assignment::value ||
+ inner_allocator_type::propagate_on_container_move_assignment::value
+ > propagate_on_container_move_assignment;
+ typedef boost::integral_constant<
+ bool,
+ outer_traits_type::propagate_on_container_swap::value ||
+ inner_allocator_type::propagate_on_container_swap::value
+ > propagate_on_container_swap;
+
+ scoped_allocator_adaptor_base()
+ {}
+
+ template <class OuterA2>
+ scoped_allocator_adaptor_base(BOOST_FWD_REF(OuterA2) outerAlloc, const InnerAllocs &...args)
+ : outer_allocator_type(::boost::forward<OuterA2>(outerAlloc))
+ , m_inner(args...)
+ {}
+
+ scoped_allocator_adaptor_base(const scoped_allocator_adaptor_base& other)
+ : outer_allocator_type(other.outer_allocator())
+ , m_inner(other.inner_allocator())
+ {}
+
+ scoped_allocator_adaptor_base(BOOST_RV_REF(scoped_allocator_adaptor_base) other)
+ : outer_allocator_type(::boost::move(other.outer_allocator()))
+ , m_inner(::boost::move(other.inner_allocator()))
+ {}
+
+ template <class OuterA2>
+ scoped_allocator_adaptor_base
+ (const scoped_allocator_adaptor_base<OuterA2, InnerAllocs...>& other)
+ : outer_allocator_type(other.outer_allocator())
+ , m_inner(other.inner_allocator())
+ {}
+
+ template <class OuterA2>
+ scoped_allocator_adaptor_base
+ (BOOST_RV_REF_BEG scoped_allocator_adaptor_base
+ <OuterA2, InnerAllocs...> BOOST_RV_REF_END other)
+ : outer_allocator_type(other.outer_allocator())
+ , m_inner(other.inner_allocator())
+ {}
+
+ protected:
+ struct internal_type_t{};
+
+ template <class OuterA2>
+ scoped_allocator_adaptor_base
+ ( internal_type_t
+ , BOOST_FWD_REF(OuterA2) outerAlloc
+ , const inner_allocator_type &inner)
+ : outer_allocator_type(::boost::forward<OuterA2>(outerAlloc))
+ , m_inner(inner)
+ {}
+
+ public:
+
+ scoped_allocator_adaptor_base &operator=
+ (BOOST_COPY_ASSIGN_REF(scoped_allocator_adaptor_base) other)
+ {
+ outer_allocator_type::operator=(other.outer_allocator());
+ m_inner = other.inner_allocator();
+ return *this;
+ }
+
+ scoped_allocator_adaptor_base &operator=(BOOST_RV_REF(scoped_allocator_adaptor_base) other)
+ {
+ outer_allocator_type::operator=(boost::move(other.outer_allocator()));
+ m_inner = ::boost::move(other.inner_allocator());
+ return *this;
+ }
+
+ inner_allocator_type& inner_allocator()
+ { return m_inner; }
+
+ inner_allocator_type const& inner_allocator() const
+ { return m_inner; }
+
+ outer_allocator_type & outer_allocator()
+ { return static_cast<outer_allocator_type&>(*this); }
+
+ const outer_allocator_type &outer_allocator() const
+ { return static_cast<const outer_allocator_type&>(*this); }
+
+ private:
+ inner_allocator_type m_inner;
+};
+
+#else //#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
+
+//Let's add a dummy first template parameter to allow creating
+//specializations up to maximum InnerAlloc count
+template <
+ typename OuterAlloc
+ , bool Dummy
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS, class Q)
+ >
+class scoped_allocator_adaptor_base;
+
+//Specializations for the adaptor with InnerAlloc allocators
+
+#define BOOST_PP_LOCAL_MACRO(n) \
+template <typename OuterAlloc \
+BOOST_PP_ENUM_TRAILING_PARAMS(n, class Q) \
+> \
+class scoped_allocator_adaptor_base<OuterAlloc, true \
+ BOOST_PP_ENUM_TRAILING_PARAMS(n, Q) \
+ BOOST_PP_ENUM_TRAILING( BOOST_PP_SUB(BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS, n) \
+ , BOOST_CONTAINER_PP_IDENTITY, nat) \
+ > \
+ : public OuterAlloc \
+{ \
+ typedef allocator_traits<OuterAlloc> outer_traits_type; \
+ BOOST_COPYABLE_AND_MOVABLE(scoped_allocator_adaptor_base) \
+ \
+ public: \
+ template <class OuterA2> \
+ struct rebind_base \
+ { \
+ typedef scoped_allocator_adaptor_base<OuterA2, true BOOST_PP_ENUM_TRAILING_PARAMS(n, Q) \
+ BOOST_PP_ENUM_TRAILING \
+ ( BOOST_PP_SUB(BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS, n) \
+ , BOOST_CONTAINER_PP_IDENTITY, nat) \
+ > other; \
+ }; \
+ \
+ typedef OuterAlloc outer_allocator_type; \
+ typedef scoped_allocator_adaptor<BOOST_PP_ENUM_PARAMS(n, Q) \
+ BOOST_PP_ENUM_TRAILING \
+ ( BOOST_PP_SUB(BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS, n) \
+ , BOOST_CONTAINER_PP_IDENTITY, nat) \
+ > inner_allocator_type; \
+ typedef boost::integral_constant< \
+ bool, \
+ outer_traits_type::propagate_on_container_copy_assignment::value || \
+ inner_allocator_type::propagate_on_container_copy_assignment::value \
+ > propagate_on_container_copy_assignment; \
+ typedef boost::integral_constant< \
+ bool, \
+ outer_traits_type::propagate_on_container_move_assignment::value || \
+ inner_allocator_type::propagate_on_container_move_assignment::value \
+ > propagate_on_container_move_assignment; \
+ typedef boost::integral_constant< \
+ bool, \
+ outer_traits_type::propagate_on_container_swap::value || \
+ inner_allocator_type::propagate_on_container_swap::value \
+ > propagate_on_container_swap; \
+ \
+ scoped_allocator_adaptor_base() \
+ {} \
+ \
+ template <class OuterA2> \
+ scoped_allocator_adaptor_base(BOOST_FWD_REF(OuterA2) outerAlloc \
+ BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_CONST_REF_PARAM_LIST_Q, _)) \
+ : outer_allocator_type(::boost::forward<OuterA2>(outerAlloc)) \
+ , m_inner(BOOST_PP_ENUM_PARAMS(n, q)) \
+ {} \
+ \
+ scoped_allocator_adaptor_base(const scoped_allocator_adaptor_base& other) \
+ : outer_allocator_type(other.outer_allocator()) \
+ , m_inner(other.inner_allocator()) \
+ {} \
+ \
+ scoped_allocator_adaptor_base(BOOST_RV_REF(scoped_allocator_adaptor_base) other) \
+ : outer_allocator_type(::boost::move(other.outer_allocator())) \
+ , m_inner(::boost::move(other.inner_allocator())) \
+ {} \
+ \
+ template <class OuterA2> \
+ scoped_allocator_adaptor_base(const scoped_allocator_adaptor_base<OuterA2, true \
+ BOOST_PP_ENUM_TRAILING_PARAMS(n, Q) \
+ BOOST_PP_ENUM_TRAILING \
+ ( BOOST_PP_SUB(BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS, n) \
+ , BOOST_CONTAINER_PP_IDENTITY, nat) \
+ >& other) \
+ : outer_allocator_type(other.outer_allocator()) \
+ , m_inner(other.inner_allocator()) \
+ {} \
+ \
+ template <class OuterA2> \
+ scoped_allocator_adaptor_base \
+ (BOOST_RV_REF_BEG scoped_allocator_adaptor_base<OuterA2, true \
+ BOOST_PP_ENUM_TRAILING_PARAMS(n, Q) \
+ BOOST_PP_ENUM_TRAILING \
+ ( BOOST_PP_SUB(BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS, n) \
+ , BOOST_CONTAINER_PP_IDENTITY, nat) \
+ > BOOST_RV_REF_END other) \
+ : outer_allocator_type(other.outer_allocator()) \
+ , m_inner(other.inner_allocator()) \
+ {} \
+ \
+ protected: \
+ struct internal_type_t{}; \
+ \
+ template <class OuterA2> \
+ scoped_allocator_adaptor_base \
+ ( internal_type_t \
+ , BOOST_FWD_REF(OuterA2) outerAlloc \
+ , const inner_allocator_type &inner) \
+ : outer_allocator_type(::boost::forward<OuterA2>(outerAlloc)) \
+ , m_inner(inner) \
+ {} \
+ \
+ public: \
+ scoped_allocator_adaptor_base &operator= \
+ (BOOST_COPY_ASSIGN_REF(scoped_allocator_adaptor_base) other) \
+ { \
+ outer_allocator_type::operator=(other.outer_allocator()); \
+ m_inner = other.inner_allocator(); \
+ return *this; \
+ } \
+ \
+ scoped_allocator_adaptor_base &operator=(BOOST_RV_REF(scoped_allocator_adaptor_base) other) \
+ { \
+ outer_allocator_type::operator=(boost::move(other.outer_allocator())); \
+ m_inner = ::boost::move(other.inner_allocator()); \
+ return *this; \
+ } \
+ \
+ inner_allocator_type& inner_allocator() \
+ { return m_inner; } \
+ \
+ inner_allocator_type const& inner_allocator() const \
+ { return m_inner; } \
+ \
+ outer_allocator_type & outer_allocator() \
+ { return static_cast<outer_allocator_type&>(*this); } \
+ \
+ const outer_allocator_type &outer_allocator() const \
+ { return static_cast<const outer_allocator_type&>(*this); } \
+ \
+ private: \
+ inner_allocator_type m_inner; \
+}; \
+//!
+#define BOOST_PP_LOCAL_LIMITS (1, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS)
+#include BOOST_PP_LOCAL_ITERATE()
+
+#endif //#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
+
+//Specialization for adaptor without any InnerAlloc
+template <typename OuterAlloc>
+class scoped_allocator_adaptor_base
+ < OuterAlloc
+ #if defined(BOOST_NO_VARIADIC_TEMPLATES)
+ , true
+ BOOST_PP_ENUM_TRAILING(BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS, BOOST_CONTAINER_PP_IDENTITY, nat)
+ #endif
+ >
+ : public OuterAlloc
+{
+ BOOST_COPYABLE_AND_MOVABLE(scoped_allocator_adaptor_base)
+ public:
+
+ template <class U>
+ struct rebind_base
+ {
+ typedef scoped_allocator_adaptor_base
+ <typename allocator_traits<OuterAlloc>::template portable_rebind_alloc<U>::type
+ #if defined(BOOST_NO_VARIADIC_TEMPLATES)
+ , true
+ BOOST_PP_ENUM_TRAILING(BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS, BOOST_CONTAINER_PP_IDENTITY, container_detail::nat)
+ #endif
+ > other;
+ };
+
+ typedef OuterAlloc outer_allocator_type;
+ typedef allocator_traits<OuterAlloc> outer_traits_type;
+ typedef scoped_allocator_adaptor<OuterAlloc> inner_allocator_type;
+ typedef typename outer_traits_type::
+ propagate_on_container_copy_assignment propagate_on_container_copy_assignment;
+ typedef typename outer_traits_type::
+ propagate_on_container_move_assignment propagate_on_container_move_assignment;
+ typedef typename outer_traits_type::
+ propagate_on_container_swap propagate_on_container_swap;
+
+ scoped_allocator_adaptor_base()
+ {}
+
+ template <class OuterA2>
+ scoped_allocator_adaptor_base(BOOST_FWD_REF(OuterA2) outerAlloc)
+ : outer_allocator_type(::boost::forward<OuterA2>(outerAlloc))
+ {}
+
+ scoped_allocator_adaptor_base(const scoped_allocator_adaptor_base& other)
+ : outer_allocator_type(other.outer_allocator())
+ {}
+
+ scoped_allocator_adaptor_base(BOOST_RV_REF(scoped_allocator_adaptor_base) other)
+ : outer_allocator_type(::boost::move(other.outer_allocator()))
+ {}
+
+ template <class OuterA2>
+ scoped_allocator_adaptor_base
+ (const scoped_allocator_adaptor_base<
+ OuterA2
+ #if defined(BOOST_NO_VARIADIC_TEMPLATES)
+ , true
+ BOOST_PP_ENUM_TRAILING(BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS, BOOST_CONTAINER_PP_IDENTITY, container_detail::nat)
+ #endif
+ >& other)
+ : outer_allocator_type(other.outer_allocator())
+ {}
+
+ template <class OuterA2>
+ scoped_allocator_adaptor_base
+ (BOOST_RV_REF_BEG scoped_allocator_adaptor_base<
+ OuterA2
+ #if defined(BOOST_NO_VARIADIC_TEMPLATES)
+ , true
+ BOOST_PP_ENUM_TRAILING(BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS, BOOST_CONTAINER_PP_IDENTITY, container_detail::nat)
+ #endif
+ > BOOST_RV_REF_END other)
+ : outer_allocator_type(other.outer_allocator())
+ {}
+
+ protected:
+ struct internal_type_t{};
+
+ template <class OuterA2>
+ scoped_allocator_adaptor_base(internal_type_t, BOOST_FWD_REF(OuterA2) outerAlloc, const inner_allocator_type &)
+ : outer_allocator_type(::boost::forward<OuterA2>(outerAlloc))
+ {}
+
+ public:
+ scoped_allocator_adaptor_base &operator=(BOOST_COPY_ASSIGN_REF(scoped_allocator_adaptor_base) other)
+ {
+ outer_allocator_type::operator=(other.outer_allocator());
+ return *this;
+ }
+
+ scoped_allocator_adaptor_base &operator=(BOOST_RV_REF(scoped_allocator_adaptor_base) other)
+ {
+ outer_allocator_type::operator=(boost::move(other.outer_allocator()));
+ return *this;
+ }
+
+ inner_allocator_type& inner_allocator()
+ { return static_cast<inner_allocator_type&>(*this); }
+
+ inner_allocator_type const& inner_allocator() const
+ { return static_cast<const inner_allocator_type&>(*this); }
+
+ outer_allocator_type & outer_allocator()
+ { return static_cast<outer_allocator_type&>(*this); }
+
+ const outer_allocator_type &outer_allocator() const
+ { return static_cast<const outer_allocator_type&>(*this); }
+};
+
+} //namespace container_detail {
+
+///@endcond
+
+//Scoped allocator
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
+
+ #if !defined(BOOST_CONTAINER_UNIMPLEMENTED_PACK_EXPANSION_TO_FIXED_LIST)
+
+ //! This class is a C++03-compatible implementation of std::scoped_allocator_adaptor.
+ //! The class template scoped_allocator_adaptor is an allocator template that specifies
+ //! the memory resource (the outer allocator) to be used by a container (as any other
+ //! allocator does) and also specifies an inner allocator resource to be passed to
+ //! the constructor of every element within the container.
+ //!
+ //! This adaptor is
+ //! instantiated with one outer and zero or more inner allocator types. If
+ //! instantiated with only one allocator type, the inner allocator becomes the
+ //! scoped_allocator_adaptor itself, thus using the same allocator resource for the
+ //! container and every element within the container and, if the elements themselves
+ //! are containers, each of their elements recursively. If instantiated with more than
+ //! one allocator, the first allocator is the outer allocator for use by the container,
+ //! the second allocator is passed to the constructors of the container's elements,
+ //! and, if the elements themselves are containers, the third allocator is passed to
+ //! the elements' elements, and so on. If containers are nested to a depth greater
+ //! than the number of allocators, the last allocator is used repeatedly, as in the
+ //! single-allocator case, for any remaining recursions.
+ //!
+ //! [<b>Note</b>: The
+ //! scoped_allocator_adaptor is derived from the outer allocator type so it can be
+ //! substituted for the outer allocator type in most expressions. -end note]
+ //!
+ //! In the construct member functions, `OUTERMOST(x)` is x if x does not have
+ //! an `outer_allocator()` member function and
+ //! `OUTERMOST(x.outer_allocator())` otherwise; `OUTERMOST_ALLOC_TRAITS(x)` is
+ //! `allocator_traits<decltype(OUTERMOST(x))>`.
+ //!
+ //! [<b>Note</b>: `OUTERMOST(x)` and
+ //! `OUTERMOST_ALLOC_TRAITS(x)` are recursive operations. It is incumbent upon
+ //! the definition of `outer_allocator()` to ensure that the recursion terminates.
+ //! It will terminate for all instantiations of scoped_allocator_adaptor. -end note]
+ template <typename OuterAlloc, typename ...InnerAllocs>
+ class scoped_allocator_adaptor
+
+ #else // #if !defined(BOOST_CONTAINER_UNIMPLEMENTED_PACK_EXPANSION_TO_FIXED_LIST)
+
+ template <typename OuterAlloc, typename ...InnerAllocs>
+ class scoped_allocator_adaptor<OuterAlloc, InnerAllocs...>
+
+ #endif // #if !defined(BOOST_CONTAINER_UNIMPLEMENTED_PACK_EXPANSION_TO_FIXED_LIST)
+
+#else // #if !defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
+
+template <typename OuterAlloc
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS, class Q)
+ >
+class scoped_allocator_adaptor
+#endif
+ : public container_detail::scoped_allocator_adaptor_base
+ <OuterAlloc
+ #if !defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
+ , InnerAllocs...
+ #else
+ , true BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS, Q)
+ #endif
+ >
+{
+ BOOST_COPYABLE_AND_MOVABLE(scoped_allocator_adaptor)
+
+ public:
+ /// @cond
+ typedef container_detail::scoped_allocator_adaptor_base
+ <OuterAlloc
+ #if !defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
+ , InnerAllocs...
+ #else
+ , true BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS, Q)
+ #endif
+ > base_type;
+ typedef typename base_type::internal_type_t internal_type_t;
+ /// @endcond
+ typedef OuterAlloc outer_allocator_type;
+ //! Type: For exposition only
+ //!
+ typedef allocator_traits<OuterAlloc> outer_traits_type;
+ //! Type: `scoped_allocator_adaptor<OuterAlloc>` if `sizeof...(InnerAllocs)` is zero; otherwise,
+ //! `scoped_allocator_adaptor<InnerAllocs...>`.
+ typedef typename base_type::inner_allocator_type inner_allocator_type;
+ typedef typename outer_traits_type::value_type value_type;
+ typedef typename outer_traits_type::size_type size_type;
+ typedef typename outer_traits_type::difference_type difference_type;
+ typedef typename outer_traits_type::pointer pointer;
+ typedef typename outer_traits_type::const_pointer const_pointer;
+ typedef typename outer_traits_type::void_pointer void_pointer;
+ typedef typename outer_traits_type::const_void_pointer const_void_pointer;
+ //! Type: `true_type` if `allocator_traits<A>::propagate_on_container_copy_assignment::value` is
+ //! true for any `A` in the set of `OuterAlloc` and `InnerAllocs...`; otherwise, false_type.
+ typedef typename base_type::
+ propagate_on_container_copy_assignment propagate_on_container_copy_assignment;
+ //! Type: `true_type` if `allocator_traits<A>::propagate_on_container_move_assignment::value` is
+ //! true for any `A` in the set of `OuterAlloc` and `InnerAllocs...`; otherwise, false_type.
+ typedef typename base_type::
+ propagate_on_container_move_assignment propagate_on_container_move_assignment;
+ //! Type: `true_type` if `allocator_traits<A>::propagate_on_container_swap::value` is true for any
+ //! `A` in the set of `OuterAlloc` and `InnerAllocs...`; otherwise, false_type.
+ typedef typename base_type::
+ propagate_on_container_swap propagate_on_container_swap;
+
+ //! Type: Rebinds scoped allocator to
+ //! `typedef scoped_allocator_adaptor
+ //! < typename outer_traits_type::template portable_rebind_alloc<U>::type
+ //! , InnerAllocs... >`
+ template <class U>
+ struct rebind
+ {
+ typedef scoped_allocator_adaptor
+ < typename outer_traits_type::template portable_rebind_alloc<U>::type
+ #if !defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
+ , InnerAllocs...
+ #else
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS, Q)
+ #endif
+ > other;
+ };
+
+ //! <b>Effects</b>: value-initializes the OuterAlloc base class
+ //! and the inner allocator object.
+ scoped_allocator_adaptor()
+ {}
+
+ ~scoped_allocator_adaptor()
+ {}
+
+ //! <b>Effects</b>: initializes each allocator within the adaptor with
+ //! the corresponding allocator from other.
+ scoped_allocator_adaptor(const scoped_allocator_adaptor& other)
+ : base_type(other.base())
+ {}
+
+ //! <b>Effects</b>: move constructs each allocator within the adaptor with
+ //! the corresponding allocator from other.
+ scoped_allocator_adaptor(BOOST_RV_REF(scoped_allocator_adaptor) other)
+ : base_type(::boost::move(other.base()))
+ {}
+
+ #if !defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
+
+ //! <b>Requires</b>: OuterAlloc shall be constructible from OuterA2.
+ //!
+ //! <b>Effects</b>: initializes the OuterAlloc base class with boost::forward<OuterA2>(outerAlloc) and inner
+ //! with innerAllocs...(hence recursively initializing each allocator within the adaptor with the
+ //! corresponding allocator from the argument list).
+ template <class OuterA2>
+ scoped_allocator_adaptor(BOOST_FWD_REF(OuterA2) outerAlloc, const InnerAllocs & ...innerAllocs)
+ : base_type(::boost::forward<OuterA2>(outerAlloc), innerAllocs...)
+ {}
+ #else // #if !defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
+
+ #define BOOST_PP_LOCAL_MACRO(n) \
+ template <class OuterA2> \
+ scoped_allocator_adaptor(BOOST_FWD_REF(OuterA2) outerAlloc \
+ BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_CONST_REF_PARAM_LIST_Q, _)) \
+ : base_type(::boost::forward<OuterA2>(outerAlloc) \
+ BOOST_PP_ENUM_TRAILING_PARAMS(n, q) \
+ ) \
+ {} \
+ //!
+ #define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS)
+ #include BOOST_PP_LOCAL_ITERATE()
+
+ #endif // #if !defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
+
+ //! <b>Requires</b>: OuterAlloc shall be constructible from OuterA2.
+ //!
+ //! <b>Effects</b>: initializes each allocator within the adaptor with the corresponding allocator from other.
+ template <class OuterA2>
+ scoped_allocator_adaptor(const scoped_allocator_adaptor<OuterA2
+ #if !defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
+ , InnerAllocs...
+ #else
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS, Q)
+ #endif
+ > &other)
+ : base_type(other.base())
+ {}
+
+ //! <b>Requires</b>: OuterAlloc shall be constructible from OuterA2.
+ //!
+ //! <b>Effects</b>: initializes each allocator within the adaptor with the corresponding allocator
+ //! rvalue from other.
+ template <class OuterA2>
+ scoped_allocator_adaptor(BOOST_RV_REF_BEG scoped_allocator_adaptor<OuterA2
+ #if !defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
+ , InnerAllocs...
+ #else
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS, Q)
+ #endif
+ > BOOST_RV_REF_END other)
+ : base_type(::boost::move(other.base()))
+ {}
+
+ scoped_allocator_adaptor &operator=(BOOST_COPY_ASSIGN_REF(scoped_allocator_adaptor) other)
+ {
+ base_type::operator=(static_cast<const base_type &>(other));
+ return *this;
+ }
+
+ scoped_allocator_adaptor &operator=(BOOST_RV_REF(scoped_allocator_adaptor) other)
+ {
+ base_type::operator=(boost::move(static_cast<scoped_allocator_adaptor&>(other)));
+ return *this;
+ }
+
+ //! <b>Returns</b>:
+ //! `static_cast<OuterAlloc&>(*this)`.
+ outer_allocator_type & outer_allocator()
+ { return *this; }
+
+ //! <b>Returns</b>:
+ //! `static_cast<const OuterAlloc&>(*this)`.
+ const outer_allocator_type &outer_allocator() const
+ { return *this; }
+
+ //! <b>Returns</b>:
+ //! *this if `sizeof...(InnerAllocs)` is zero; otherwise, inner.
+ inner_allocator_type& inner_allocator()
+ { return base_type::inner_allocator(); }
+
+ //! <b>Returns</b>:
+ //! *this if `sizeof...(InnerAllocs)` is zero; otherwise, inner.
+ inner_allocator_type const& inner_allocator() const
+ { return base_type::inner_allocator(); }
+
+ //! <b>Returns</b>:
+ //! `allocator_traits<OuterAlloc>::max_size(outer_allocator())`.
+ size_type max_size() const
+ {
+ return outer_traits_type::max_size(this->outer_allocator());
+ }
+
+ //! <b>Effects</b>:
+ //! calls `OUTERMOST_ALLOC_TRAITS(*this)::destroy(OUTERMOST(*this), p)`.
+ template <class T>
+ void destroy(T* p)
+ {
+ allocator_traits<typename outermost_allocator<OuterAlloc>::type>
+ ::destroy(get_outermost_allocator(this->outer_allocator()), p);
+ }
+
+ //! <b>Returns</b>:
+ //! `allocator_traits<OuterAlloc>::allocate(outer_allocator(), n)`.
+ pointer allocate(size_type n)
+ {
+ return outer_traits_type::allocate(this->outer_allocator(), n);
+ }
+
+ //! <b>Returns</b>:
+ //! `allocator_traits<OuterAlloc>::allocate(outer_allocator(), n, hint)`.
+ pointer allocate(size_type n, const_void_pointer hint)
+ {
+ return outer_traits_type::allocate(this->outer_allocator(), n, hint);
+ }
+
+ //! <b>Effects</b>:
+ //! `allocator_traits<OuterAlloc>::deallocate(outer_allocator(), p, n)`.
+ void deallocate(pointer p, size_type n)
+ {
+ outer_traits_type::deallocate(this->outer_allocator(), p, n);
+ }
+
+ //! <b>Returns</b>: A new scoped_allocator_adaptor object where each allocator
+ //! A in the adaptor is initialized from the result of calling
+ //! `allocator_traits<A>::select_on_container_copy_construction()` on
+ //! the corresponding allocator in *this.
+ scoped_allocator_adaptor select_on_container_copy_construction() const
+ {
+ return scoped_allocator_adaptor
+ (internal_type_t()
+ ,outer_traits_type::select_on_container_copy_construction(this->outer_allocator())
+ ,outer_traits_type::select_on_container_copy_construction(this->inner_allocator())
+ );
+ }
+ /// @cond
+ base_type &base() { return *this; }
+
+ const base_type &base() const { return *this; }
+ /// @endcond
+
+ #if !defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
+
+ //! <b>Effects</b>:
+ //! 1) If `uses_allocator<T, inner_allocator_type>::value` is false calls
+ //! `OUTERMOST_ALLOC_TRAITS(*this)::construct
+ //! (OUTERMOST(*this), p, std::forward<Args>(args)...)`.
+ //!
+ //! 2) Otherwise, if `uses_allocator<T, inner_allocator_type>::value` is true and
+ //! `is_constructible<T, allocator_arg_t, inner_allocator_type, Args...>::value` is true, calls
+ //! `OUTERMOST_ALLOC_TRAITS(*this)::construct(OUTERMOST(*this), p, allocator_arg,
+ //! inner_allocator(), std::forward<Args>(args)...)`.
+ //!
+ //! [<b>Note</b>: In compilers without advanced decltype SFINAE support, `is_constructible` can't
+ //! be implemented so that condition will be replaced by
+ //! constructible_with_allocator_prefix<T>::value. -end note]
+ //!
+ //! 3) Otherwise, if uses_allocator<T, inner_allocator_type>::value is true and
+ //! `is_constructible<T, Args..., inner_allocator_type>::value` is true, calls
+ //! `OUTERMOST_ALLOC_TRAITS(*this)::construct(OUTERMOST(*this), p,
+ //! std::forward<Args>(args)..., inner_allocator())`.
+ //!
+ //! [<b>Note</b>: In compilers without advanced decltype SFINAE support, `is_constructible` can't be
+ //! implemented so that condition will be replaced by
+ //! `constructible_with_allocator_suffix<T>::value`. -end note]
+ //!
+ //! 4) Otherwise, the program is ill-formed.
+ //!
+ //! [<b>Note</b>: An error will result if `uses_allocator` evaluates
+ //! to true but the specific constructor does not take an allocator. This definition prevents a silent
+ //! failure to pass an inner allocator to a contained element. -end note]
+ template < typename T, class ...Args>
+ #if defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
+ void
+ #else
+ typename container_detail::enable_if_c<!container_detail::is_pair<T>::value, void>::type
+ #endif
+ construct(T* p, BOOST_FWD_REF(Args)...args)
+ {
+ container_detail::dispatch_uses_allocator
+ ( uses_allocator<T, inner_allocator_type>()
+ , get_outermost_allocator(this->outer_allocator())
+ , this->inner_allocator()
+ , p, ::boost::forward<Args>(args)...);
+ }
+
+ #else // #if !defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
+
+ //Disable this overload if the first argument is pair as some compilers have
+ //overload selection problems when the first parameter is a pair.
+ #define BOOST_PP_LOCAL_MACRO(n) \
+ template < typename T \
+ BOOST_PP_ENUM_TRAILING_PARAMS(n, class P) \
+ > \
+ typename container_detail::enable_if_c<!container_detail::is_pair<T>::value, void>::type \
+ construct(T* p BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \
+ { \
+ container_detail::dispatch_uses_allocator \
+ ( uses_allocator<T, inner_allocator_type>() \
+ , get_outermost_allocator(this->outer_allocator()) \
+ , this->inner_allocator() \
+ , p BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)); \
+ } \
+ //!
+ #define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS)
+ #include BOOST_PP_LOCAL_ITERATE()
+
+ #endif // #if !defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
+
+ template <class T1, class T2>
+ void construct(std::pair<T1,T2>* p)
+ { this->construct_pair(p); }
+
+ template <class T1, class T2>
+ void construct(container_detail::pair<T1,T2>* p)
+ { this->construct_pair(p); }
+
+ template <class T1, class T2, class U, class V>
+ void construct(std::pair<T1, T2>* p, BOOST_FWD_REF(U) x, BOOST_FWD_REF(V) y)
+ { this->construct_pair(p, ::boost::forward<U>(x), ::boost::forward<V>(y)); }
+
+ template <class T1, class T2, class U, class V>
+ void construct(container_detail::pair<T1, T2>* p, BOOST_FWD_REF(U) x, BOOST_FWD_REF(V) y)
+ { this->construct_pair(p, ::boost::forward<U>(x), ::boost::forward<V>(y)); }
+
+ template <class T1, class T2, class U, class V>
+ void construct(std::pair<T1, T2>* p, const std::pair<U, V>& x)
+ { this->construct_pair(p, x); }
+
+ template <class T1, class T2, class U, class V>
+ void construct( container_detail::pair<T1, T2>* p
+ , const container_detail::pair<U, V>& x)
+ { this->construct_pair(p, x); }
+
+ template <class T1, class T2, class U, class V>
+ void construct( std::pair<T1, T2>* p
+ , BOOST_RV_REF_BEG std::pair<U, V> BOOST_RV_REF_END x)
+ { this->construct_pair(p, x); }
+
+ template <class T1, class T2, class U, class V>
+ void construct( container_detail::pair<T1, T2>* p
+ , BOOST_RV_REF_BEG container_detail::pair<U, V> BOOST_RV_REF_END x)
+ { this->construct_pair(p, x); }
+
+ /// @cond
+ private:
+ template <class Pair>
+ void construct_pair(Pair* p)
+ {
+ this->construct(container_detail::addressof(p->first));
+ try {
+ this->construct(container_detail::addressof(p->second));
+ }
+ catch (...) {
+ this->destroy(container_detail::addressof(p->first));
+ throw;
+ }
+ }
+
+ template <class Pair, class U, class V>
+ void construct_pair(Pair* p, BOOST_FWD_REF(U) x, BOOST_FWD_REF(V) y)
+ {
+ this->construct(container_detail::addressof(p->first), ::boost::forward<U>(x));
+ try {
+ this->construct(container_detail::addressof(p->second), ::boost::forward<V>(y));
+ }
+ catch (...) {
+ this->destroy(container_detail::addressof(p->first));
+ throw;
+ }
+ }
+
+ template <class Pair, class Pair2>
+ void construct_pair(Pair* p, const Pair2& pr)
+ {
+ this->construct(container_detail::addressof(p->first), pr.first);
+ try {
+ this->construct(container_detail::addressof(p->second), pr.second);
+ }
+ catch (...) {
+ this->destroy(container_detail::addressof(p->first));
+ throw;
+ }
+ }
+
+ template <class Pair, class Pair2>
+ void construct_pair(Pair* p, BOOST_RV_REF(Pair2) pr)
+ {
+ this->construct(container_detail::addressof(p->first), ::boost::move(pr.first));
+ try {
+ this->construct(container_detail::addressof(p->second), ::boost::move(pr.second));
+ }
+ catch (...) {
+ this->destroy(container_detail::addressof(p->first));
+ throw;
+ }
+ }
+
+ //template <class T1, class T2, class... Args1, class... Args2>
+ //void construct(pair<T1, T2>* p, piecewise_construct_t, tuple<Args1...> x, tuple<Args2...> y);
+
+ private:
+ template <class OuterA2>
+ scoped_allocator_adaptor(internal_type_t, BOOST_FWD_REF(OuterA2) outer, const inner_allocator_type& inner)
+ : base_type(internal_type_t(), ::boost::forward<OuterA2>(outer), inner)
+ {}
+
+ /// @endcond
+};
+
+template <typename OuterA1, typename OuterA2
+ #if !defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
+ , typename... InnerAllocs
+ #else
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS, class Q)
+ #endif
+ >
+inline bool operator==(
+ const scoped_allocator_adaptor<OuterA1
+ #if !defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
+ ,InnerAllocs...
+ #else
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS, Q)
+ #endif
+ >& a,
+ const scoped_allocator_adaptor<OuterA2
+ #if !defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
+ ,InnerAllocs...
+ #else
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS, Q)
+ #endif
+ >& b)
+{
+ #if !defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
+ const bool has_zero_inner = sizeof...(InnerAllocs) == 0u;
+ #else
+ const bool has_zero_inner =
+ boost::container::container_detail::is_same
+ <Q0, container_detail::nat>::value;
+ #endif
+
+ return a.outer_allocator() == b.outer_allocator()
+ && (has_zero_inner || a.inner_allocator() == b.inner_allocator());
+}
+
+template <typename OuterA1, typename OuterA2
+ #if !defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
+ , typename... InnerAllocs
+ #else
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS, class Q)
+ #endif
+ >
+inline bool operator!=(
+ const scoped_allocator_adaptor<OuterA1
+ #if !defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
+ ,InnerAllocs...
+ #else
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS, Q)
+ #endif
+ >& a,
+ const scoped_allocator_adaptor<OuterA2
+ #if !defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
+ ,InnerAllocs...
+ #else
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS, Q)
+ #endif
+ >& b)
+{
+ return ! (a == b);
+}
+
+}} // namespace boost { namespace container {
+
+#include <boost/container/detail/config_end.hpp>
+
+#endif // BOOST_CONTAINER_ALLOCATOR_SCOPED_ALLOCATOR_HPP
diff --git a/boost/container/scoped_allocator_fwd.hpp b/boost/container/scoped_allocator_fwd.hpp
new file mode 100644
index 0000000000..0814a50699
--- /dev/null
+++ b/boost/container/scoped_allocator_fwd.hpp
@@ -0,0 +1,83 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2011-2012. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_CONTAINER_ALLOCATOR_SCOPED_ALLOCATOR_FWD_HPP
+#define BOOST_CONTAINER_ALLOCATOR_SCOPED_ALLOCATOR_FWD_HPP
+
+#if (defined MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <boost/container/detail/config_begin.hpp>
+#include <boost/container/detail/workaround.hpp>
+
+#if defined(BOOST_NO_VARIADIC_TEMPLATES)
+#include <boost/container/detail/preprocessor.hpp>
+#include <boost/container/detail/type_traits.hpp>
+#endif
+
+namespace boost { namespace container {
+
+///@cond
+
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
+
+ #if !defined(BOOST_CONTAINER_UNIMPLEMENTED_PACK_EXPANSION_TO_FIXED_LIST)
+
+ template <typename OuterAlloc, typename ...InnerAllocs>
+ class scoped_allocator_adaptor;
+
+ #else // #if !defined(BOOST_CONTAINER_UNIMPLEMENTED_PACK_EXPANSION_TO_FIXED_LIST)
+
+ template <typename ...InnerAllocs>
+ class scoped_allocator_adaptor;
+
+ template <typename OuterAlloc, typename ...InnerAllocs>
+ class scoped_allocator_adaptor<OuterAlloc, InnerAllocs...>;
+
+ #endif // #if !defined(BOOST_CONTAINER_UNIMPLEMENTED_PACK_EXPANSION_TO_FIXED_LIST)
+
+
+#else // #if !defined(BOOST_NO_VARIADIC_TEMPLATES)
+
+template <typename OuterAlloc
+BOOST_PP_ENUM_TRAILING( BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_CONTAINER_PP_TEMPLATE_PARAM_WITH_DEFAULT, container_detail::nat)
+>
+class scoped_allocator_adaptor;
+
+#endif
+
+///@endcond
+
+//! The allocator_arg_t struct is an empty structure type used as a unique type to
+//! disambiguate constructor and function overloading. Specifically, several types
+//! have constructors with allocator_arg_t as the first argument, immediately followed
+//! by an argument of a type that satisfies the Allocator requirements
+struct allocator_arg_t{};
+
+//! A instance of type allocator_arg_t
+//!
+static const allocator_arg_t allocator_arg = allocator_arg_t();
+
+template <class T>
+struct constructible_with_allocator_suffix;
+
+template <class T>
+struct constructible_with_allocator_prefix;
+
+template <typename T, typename Alloc>
+struct uses_allocator;
+
+}} // namespace boost { namespace container {
+
+#include <boost/container/detail/config_end.hpp>
+
+#endif // BOOST_CONTAINER_ALLOCATOR_SCOPED_ALLOCATOR_FWD_HPP
diff --git a/boost/container/set.hpp b/boost/container/set.hpp
index b25e7013fc..09ada20033 100644
--- a/boost/container/set.hpp
+++ b/boost/container/set.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -42,32 +42,32 @@ namespace container {
/// @cond
// Forward declarations of operators < and ==, needed for friend declaration.
template <class T, class Pred, class A>
-inline bool operator==(const set<T,Pred,A>& x,
+inline bool operator==(const set<T,Pred,A>& x,
const set<T,Pred,A>& y);
template <class T, class Pred, class A>
-inline bool operator<(const set<T,Pred,A>& x,
+inline bool operator<(const set<T,Pred,A>& x,
const set<T,Pred,A>& y);
/// @endcond
-//! A set is a kind of associative container that supports unique keys (contains at
-//! most one of each key value) and provides for fast retrieval of the keys themselves.
-//! Class set supports bidirectional iterators.
-//!
-//! A set satisfies all of the requirements of a container and of a reversible container
-//! , and of an associative container. A set also provides most operations described in
+//! A set is a kind of associative container that supports unique keys (contains at
+//! most one of each key value) and provides for fast retrieval of the keys themselves.
+//! Class set supports bidirectional iterators.
+//!
+//! A set satisfies all of the requirements of a container and of a reversible container
+//! , and of an associative container. A set also provides most operations described in
//! for unique keys.
#ifdef BOOST_CONTAINER_DOXYGEN_INVOKED
template <class T, class Pred = std::less<T>, class A = std::allocator<T> >
#else
template <class T, class Pred, class A>
#endif
-class set
+class set
{
/// @cond
private:
BOOST_COPYABLE_AND_MOVABLE(set)
- typedef container_detail::rbtree<T, T,
+ typedef container_detail::rbtree<T, T,
container_detail::identity<T>, Pred, A> tree_t;
tree_t m_tree; // red-black tree representing set
typedef typename container_detail::
@@ -95,225 +95,240 @@ class set
typedef typename tree_t::stored_allocator_type stored_allocator_type;
//! <b>Effects</b>: Default constructs an empty set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
set()
: m_tree()
{}
- //! <b>Effects</b>: Constructs an empty set using the specified comparison object
+ //! <b>Effects</b>: Constructs an empty set using the specified comparison object
//! and allocator.
- //!
+ //!
//! <b>Complexity</b>: Constant.
explicit set(const Pred& comp,
const allocator_type& a = allocator_type())
: m_tree(comp, a)
{}
- //! <b>Effects</b>: Constructs an empty set using the specified comparison object and
+ //! <b>Effects</b>: Constructs an empty set using the specified comparison object and
//! allocator, and inserts elements from the range [first ,last ).
- //!
- //! <b>Complexity</b>: Linear in N if the range [first ,last ) is already sorted using
+ //!
+ //! <b>Complexity</b>: Linear in N if the range [first ,last ) is already sorted using
//! comp and otherwise N logN, where N is last - first.
template <class InputIterator>
set(InputIterator first, InputIterator last, const Pred& comp = Pred(),
const allocator_type& a = allocator_type())
- : m_tree(first, last, comp, a, true)
+ : m_tree(first, last, comp, a, true)
{}
- //! <b>Effects</b>: Constructs an empty set using the specified comparison object and
+ //! <b>Effects</b>: Constructs an empty set using the specified comparison object and
//! allocator, and inserts elements from the ordered unique range [first ,last). This function
//! is more efficient than the normal range creation for ordered ranges.
//!
//! <b>Requires</b>: [first ,last) must be ordered according to the predicate and must be
//! unique values.
- //!
+ //!
//! <b>Complexity</b>: Linear in N.
template <class InputIterator>
set( ordered_unique_range_t, InputIterator first, InputIterator last
, const Pred& comp = Pred(), const allocator_type& a = allocator_type())
- : m_tree(ordered_range, first, last, comp, a)
+ : m_tree(ordered_range, first, last, comp, a)
{}
//! <b>Effects</b>: Copy constructs a set.
- //!
+ //!
//! <b>Complexity</b>: Linear in x.size().
- set(const set& x)
+ set(const set& x)
: m_tree(x.m_tree)
{}
//! <b>Effects</b>: Move constructs a set. Constructs *this using x's resources.
- //!
- //! <b>Complexity</b>: Construct.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Postcondition</b>: x is emptied.
- set(BOOST_RV_REF(set) x)
+ set(BOOST_RV_REF(set) x)
: m_tree(boost::move(x.m_tree))
{}
+ //! <b>Effects</b>: Copy constructs a set using the specified allocator.
+ //!
+ //! <b>Complexity</b>: Linear in x.size().
+ set(const set& x, const allocator_type &a)
+ : m_tree(x.m_tree, a)
+ {}
+
+ //! <b>Effects</b>: Move constructs a set using the specified allocator.
+ //! Constructs *this using x's resources.
+ //!
+ //! <b>Complexity</b>: Constant if a == x.get_allocator(), linear otherwise.
+ set(BOOST_RV_REF(set) x, const allocator_type &a)
+ : m_tree(boost::move(x.m_tree), a)
+ {}
+
//! <b>Effects</b>: Makes *this a copy of x.
- //!
+ //!
//! <b>Complexity</b>: Linear in x.size().
set& operator=(BOOST_COPY_ASSIGN_REF(set) x)
{ m_tree = x.m_tree; return *this; }
//! <b>Effects</b>: this->swap(x.get()).
- //!
+ //!
//! <b>Complexity</b>: Constant.
set& operator=(BOOST_RV_REF(set) x)
{ m_tree = boost::move(x.m_tree); return *this; }
//! <b>Effects</b>: Returns the comparison object out
//! of which a was constructed.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- key_compare key_comp() const
+ key_compare key_comp() const
{ return m_tree.key_comp(); }
//! <b>Effects</b>: Returns an object of value_compare constructed out
//! of the comparison object.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- value_compare value_comp() const
+ value_compare value_comp() const
{ return m_tree.key_comp(); }
//! <b>Effects</b>: Returns a copy of the Allocator that
//! was passed to the object's constructor.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- allocator_type get_allocator() const
+ allocator_type get_allocator() const
{ return m_tree.get_allocator(); }
- const stored_allocator_type &get_stored_allocator() const
+ const stored_allocator_type &get_stored_allocator() const
{ return m_tree.get_stored_allocator(); }
stored_allocator_type &get_stored_allocator()
{ return m_tree.get_stored_allocator(); }
//! <b>Effects</b>: Returns an iterator to the first element contained in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant
- iterator begin()
+ iterator begin()
{ return m_tree.begin(); }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator begin() const
+ const_iterator begin() const
{ return m_tree.begin(); }
//! <b>Effects</b>: Returns an iterator to the end of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- iterator end()
+ iterator end()
{ return m_tree.end(); }
//! <b>Effects</b>: Returns a const_iterator to the end of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator end() const
+ const_iterator end() const
{ return m_tree.end(); }
- //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
- //! of the reversed container.
- //!
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- reverse_iterator rbegin()
- { return m_tree.rbegin(); }
+ reverse_iterator rbegin()
+ { return m_tree.rbegin(); }
- //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
- //! of the reversed container.
- //!
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator rbegin() const
- { return m_tree.rbegin(); }
+ const_reverse_iterator rbegin() const
+ { return m_tree.rbegin(); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the end
- //! of the reversed container.
- //!
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- reverse_iterator rend()
+ reverse_iterator rend()
{ return m_tree.rend(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
- //! of the reversed container.
- //!
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator rend() const
+ const_reverse_iterator rend() const
{ return m_tree.rend(); }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator cbegin() const
+ const_iterator cbegin() const
{ return m_tree.cbegin(); }
//! <b>Effects</b>: Returns a const_iterator to the end of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator cend() const
+ const_iterator cend() const
{ return m_tree.cend(); }
- //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
- //! of the reversed container.
- //!
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator crbegin() const
- { return m_tree.crbegin(); }
+ const_reverse_iterator crbegin() const
+ { return m_tree.crbegin(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
- //! of the reversed container.
- //!
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator crend() const
+ const_reverse_iterator crend() const
{ return m_tree.crend(); }
//! <b>Effects</b>: Returns true if the container contains no elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- bool empty() const
+ bool empty() const
{ return m_tree.empty(); }
//! <b>Effects</b>: Returns the number of the elements contained in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- size_type size() const
+ size_type size() const
{ return m_tree.size(); }
//! <b>Effects</b>: Returns the largest possible size of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- size_type max_size() const
+ size_type max_size() const
{ return m_tree.max_size(); }
//! <b>Effects</b>: Swaps the contents of *this and x.
@@ -324,15 +339,15 @@ class set
void swap(set& x)
{ m_tree.swap(x.m_tree); }
- //! <b>Effects</b>: Inserts x if and only if there is no element in the container
+ //! <b>Effects</b>: Inserts x if and only if there is no element in the container
//! with key equivalent to the key of x.
//!
- //! <b>Returns</b>: The bool component of the returned pair is true if and only
+ //! <b>Returns</b>: The bool component of the returned pair is true if and only
//! if the insertion takes place, and the iterator component of the pair
//! points to the element with key equivalent to the key of x.
//!
//! <b>Complexity</b>: Logarithmic.
- std::pair<iterator,bool> insert(insert_const_ref_type x)
+ std::pair<iterator,bool> insert(insert_const_ref_type x)
{ return priv_insert(x); }
#if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
@@ -345,18 +360,18 @@ class set
{ return priv_insert(u); }
#endif
- //! <b>Effects</b>: Move constructs a new value from x if and only if there is
+ //! <b>Effects</b>: Move constructs a new value from x if and only if there is
//! no element in the container with key equivalent to the key of x.
//!
- //! <b>Returns</b>: The bool component of the returned pair is true if and only
+ //! <b>Returns</b>: The bool component of the returned pair is true if and only
//! if the insertion takes place, and the iterator component of the pair
//! points to the element with key equivalent to the key of x.
//!
//! <b>Complexity</b>: Logarithmic.
- std::pair<iterator,bool> insert(BOOST_RV_REF(value_type) x)
+ std::pair<iterator,bool> insert(BOOST_RV_REF(value_type) x)
{ return m_tree.insert_unique(boost::move(x)); }
- //! <b>Effects</b>: Inserts a copy of x in the container if and only if there is
+ //! <b>Effects</b>: Inserts a copy of x in the container if and only if there is
//! no element in the container with key equivalent to the key of x.
//! p is a hint pointing to where the insert should start to search.
//!
@@ -365,7 +380,7 @@ class set
//!
//! <b>Complexity</b>: Logarithmic in general, but amortized constant if t
//! is inserted right before p.
- iterator insert(const_iterator p, insert_const_ref_type x)
+ iterator insert(const_iterator p, insert_const_ref_type x)
{ return priv_insert(p, x); }
#if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
@@ -384,28 +399,28 @@ class set
//! <b>Returns</b>: An iterator pointing to the element with key equivalent to the key of x.
//!
//! <b>Complexity</b>: Logarithmic.
- iterator insert(const_iterator p, BOOST_RV_REF(value_type) x)
+ iterator insert(const_iterator p, BOOST_RV_REF(value_type) x)
{ return m_tree.insert_unique(p, boost::move(x)); }
//! <b>Requires</b>: first, last are not iterators into *this.
//!
- //! <b>Effects</b>: inserts each element from the range [first,last) if and only
+ //! <b>Effects</b>: inserts each element from the range [first,last) if and only
//! if there is no element with key equivalent to the key of that element.
//!
//! <b>Complexity</b>: At most N log(size()+N) (N is the distance from first to last)
template <class InputIterator>
- void insert(InputIterator first, InputIterator last)
+ void insert(InputIterator first, InputIterator last)
{ m_tree.insert_unique(first, last); }
#if defined(BOOST_CONTAINER_PERFECT_FORWARDING) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
//! <b>Effects</b>: Inserts an object x of type T constructed with
- //! std::forward<Args>(args)... if and only if there is
+ //! std::forward<Args>(args)... if and only if there is
//! no element in the container with equivalent value.
//! and returns the iterator pointing to the
//! newly inserted element.
//!
- //! <b>Returns</b>: The bool component of the returned pair is true if and only
+ //! <b>Returns</b>: The bool component of the returned pair is true if and only
//! if the insertion takes place, and the iterator component of the pair
//! points to the element with key equivalent to the key of x.
//!
@@ -418,7 +433,7 @@ class set
{ return m_tree.emplace_unique(boost::forward<Args>(args)...); }
//! <b>Effects</b>: Inserts an object of type T constructed with
- //! std::forward<Args>(args)... if and only if there is
+ //! std::forward<Args>(args)... if and only if there is
//! no element in the container with equivalent value.
//! p is a hint pointing to where the insert
//! should start to search.
@@ -451,11 +466,11 @@ class set
//! <b>Effects</b>: Erases the element pointed to by p.
//!
//! <b>Returns</b>: Returns an iterator pointing to the element immediately
- //! following q prior to the element being erased. If no such element exists,
+ //! following q prior to the element being erased. If no such element exists,
//! returns end().
//!
//! <b>Complexity</b>: Amortized constant time
- iterator erase(const_iterator p)
+ iterator erase(const_iterator p)
{ return m_tree.erase(p); }
//! <b>Effects</b>: Erases all elements in the container with key equivalent to x.
@@ -463,7 +478,7 @@ class set
//! <b>Returns</b>: Returns the number of erased elements.
//!
//! <b>Complexity</b>: log(size()) + count(k)
- size_type erase(const key_type& x)
+ size_type erase(const key_type& x)
{ return m_tree.erase(x); }
//! <b>Effects</b>: Erases all the elements in the range [first, last).
@@ -471,7 +486,7 @@ class set
//! <b>Returns</b>: Returns last.
//!
//! <b>Complexity</b>: log(size())+N where N is the distance from first to last.
- iterator erase(const_iterator first, const_iterator last)
+ iterator erase(const_iterator first, const_iterator last)
{ return m_tree.erase(first, last); }
//! <b>Effects</b>: erase(a.begin(),a.end()).
@@ -479,41 +494,41 @@ class set
//! <b>Postcondition</b>: size() == 0.
//!
//! <b>Complexity</b>: linear in size().
- void clear()
+ void clear()
{ m_tree.clear(); }
//! <b>Returns</b>: An iterator pointing to an element with the key
//! equivalent to x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic.
- iterator find(const key_type& x)
+ iterator find(const key_type& x)
{ return m_tree.find(x); }
//! <b>Returns</b>: A const_iterator pointing to an element with the key
//! equivalent to x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic.
- const_iterator find(const key_type& x) const
+ const_iterator find(const key_type& x) const
{ return m_tree.find(x); }
//! <b>Returns</b>: The number of elements with key equivalent to x.
//!
//! <b>Complexity</b>: log(size())+count(k)
- size_type count(const key_type& x) const
+ size_type count(const key_type& x) const
{ return m_tree.find(x) == m_tree.end() ? 0 : 1; }
//! <b>Returns</b>: An iterator pointing to the first element with key not less
//! than k, or a.end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic
- iterator lower_bound(const key_type& x)
+ iterator lower_bound(const key_type& x)
{ return m_tree.lower_bound(x); }
//! <b>Returns</b>: A const iterator pointing to the first element with key not
//! less than k, or a.end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic
- const_iterator lower_bound(const key_type& x) const
+ const_iterator lower_bound(const key_type& x) const
{ return m_tree.lower_bound(x); }
//! <b>Returns</b>: An iterator pointing to the first element with key not less
@@ -527,21 +542,21 @@ class set
//! less than x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic
- const_iterator upper_bound(const key_type& x) const
+ const_iterator upper_bound(const key_type& x) const
{ return m_tree.upper_bound(x); }
//! <b>Effects</b>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).
//!
//! <b>Complexity</b>: Logarithmic
- std::pair<iterator,iterator>
- equal_range(const key_type& x)
+ std::pair<iterator,iterator>
+ equal_range(const key_type& x)
{ return m_tree.equal_range(x); }
//! <b>Effects</b>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).
//!
//! <b>Complexity</b>: Logarithmic
- std::pair<const_iterator, const_iterator>
- equal_range(const key_type& x) const
+ std::pair<const_iterator, const_iterator>
+ equal_range(const key_type& x) const
{ return m_tree.equal_range(x); }
/// @cond
@@ -552,47 +567,47 @@ class set
friend bool operator< (const set<K1,C1,A1>&, const set<K1,C1,A1>&);
private:
- std::pair<iterator, bool> priv_insert(const T &x)
+ std::pair<iterator, bool> priv_insert(const T &x)
{ return m_tree.insert_unique(x); }
- iterator priv_insert(const_iterator p, const T &x)
+ iterator priv_insert(const_iterator p, const T &x)
{ return m_tree.insert_unique(p, x); }
/// @endcond
};
template <class T, class Pred, class A>
-inline bool operator==(const set<T,Pred,A>& x,
- const set<T,Pred,A>& y)
+inline bool operator==(const set<T,Pred,A>& x,
+ const set<T,Pred,A>& y)
{ return x.m_tree == y.m_tree; }
template <class T, class Pred, class A>
-inline bool operator<(const set<T,Pred,A>& x,
- const set<T,Pred,A>& y)
+inline bool operator<(const set<T,Pred,A>& x,
+ const set<T,Pred,A>& y)
{ return x.m_tree < y.m_tree; }
template <class T, class Pred, class A>
-inline bool operator!=(const set<T,Pred,A>& x,
- const set<T,Pred,A>& y)
+inline bool operator!=(const set<T,Pred,A>& x,
+ const set<T,Pred,A>& y)
{ return !(x == y); }
template <class T, class Pred, class A>
-inline bool operator>(const set<T,Pred,A>& x,
- const set<T,Pred,A>& y)
+inline bool operator>(const set<T,Pred,A>& x,
+ const set<T,Pred,A>& y)
{ return y < x; }
template <class T, class Pred, class A>
-inline bool operator<=(const set<T,Pred,A>& x,
- const set<T,Pred,A>& y)
+inline bool operator<=(const set<T,Pred,A>& x,
+ const set<T,Pred,A>& y)
{ return !(y < x); }
template <class T, class Pred, class A>
-inline bool operator>=(const set<T,Pred,A>& x,
- const set<T,Pred,A>& y)
+inline bool operator>=(const set<T,Pred,A>& x,
+ const set<T,Pred,A>& y)
{ return !(x < y); }
template <class T, class Pred, class A>
-inline void swap(set<T,Pred,A>& x, set<T,Pred,A>& y)
+inline void swap(set<T,Pred,A>& x, set<T,Pred,A>& y)
{ x.swap(y); }
/// @cond
@@ -612,32 +627,32 @@ namespace container {
// Forward declaration of operators < and ==, needed for friend declaration.
template <class T, class Pred, class A>
-inline bool operator==(const multiset<T,Pred,A>& x,
+inline bool operator==(const multiset<T,Pred,A>& x,
const multiset<T,Pred,A>& y);
template <class T, class Pred, class A>
-inline bool operator<(const multiset<T,Pred,A>& x,
+inline bool operator<(const multiset<T,Pred,A>& x,
const multiset<T,Pred,A>& y);
/// @endcond
-//! A multiset is a kind of associative container that supports equivalent keys
-//! (possibly contains multiple copies of the same key value) and provides for
+//! A multiset is a kind of associative container that supports equivalent keys
+//! (possibly contains multiple copies of the same key value) and provides for
//! fast retrieval of the keys themselves. Class multiset supports bidirectional iterators.
-//!
-//! A multiset satisfies all of the requirements of a container and of a reversible
-//! container, and of an associative container). multiset also provides most operations
+//!
+//! A multiset satisfies all of the requirements of a container and of a reversible
+//! container, and of an associative container). multiset also provides most operations
//! described for duplicate keys.
#ifdef BOOST_CONTAINER_DOXYGEN_INVOKED
template <class T, class Pred = std::less<T>, class A = std::allocator<T> >
#else
template <class T, class Pred, class A>
#endif
-class multiset
+class multiset
{
/// @cond
private:
BOOST_COPYABLE_AND_MOVABLE(multiset)
- typedef container_detail::rbtree<T, T,
+ typedef container_detail::rbtree<T, T,
container_detail::identity<T>, Pred, A> tree_t;
tree_t m_tree; // red-black tree representing multiset
typedef typename container_detail::
@@ -666,7 +681,7 @@ class multiset
//! <b>Effects</b>: Constructs an empty multiset using the specified comparison
//! object and allocator.
- //!
+ //!
//! <b>Complexity</b>: Constant.
multiset()
: m_tree()
@@ -674,7 +689,7 @@ class multiset
//! <b>Effects</b>: Constructs an empty multiset using the specified comparison
//! object and allocator.
- //!
+ //!
//! <b>Complexity</b>: Constant.
explicit multiset(const Pred& comp,
const allocator_type& a = allocator_type())
@@ -683,209 +698,226 @@ class multiset
//! <b>Effects</b>: Constructs an empty multiset using the specified comparison object
//! and allocator, and inserts elements from the range [first ,last ).
- //!
- //! <b>Complexity</b>: Linear in N if the range [first ,last ) is already sorted using
+ //!
+ //! <b>Complexity</b>: Linear in N if the range [first ,last ) is already sorted using
//! comp and otherwise N logN, where N is last - first.
template <class InputIterator>
multiset(InputIterator first, InputIterator last,
const Pred& comp = Pred(),
const allocator_type& a = allocator_type())
- : m_tree(first, last, comp, a, false)
+ : m_tree(first, last, comp, a, false)
{}
- //! <b>Effects</b>: Constructs an empty multiset using the specified comparison object and
+ //! <b>Effects</b>: Constructs an empty multiset using the specified comparison object and
//! allocator, and inserts elements from the ordered range [first ,last ). This function
//! is more efficient than the normal range creation for ordered ranges.
//!
//! <b>Requires</b>: [first ,last) must be ordered according to the predicate.
- //!
+ //!
//! <b>Complexity</b>: Linear in N.
template <class InputIterator>
multiset( ordered_range_t ordered_range, InputIterator first, InputIterator last
, const Pred& comp = Pred()
, const allocator_type& a = allocator_type())
- : m_tree(ordered_range, first, last, comp, a)
+ : m_tree(ordered_range, first, last, comp, a)
{}
//! <b>Effects</b>: Copy constructs a multiset.
- //!
+ //!
//! <b>Complexity</b>: Linear in x.size().
- multiset(const multiset& x)
+ multiset(const multiset& x)
: m_tree(x.m_tree)
{}
//! <b>Effects</b>: Move constructs a multiset. Constructs *this using x's resources.
- //!
- //! <b>Complexity</b>: Construct.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Postcondition</b>: x is emptied.
- multiset(BOOST_RV_REF(multiset) x)
+ multiset(BOOST_RV_REF(multiset) x)
: m_tree(boost::move(x.m_tree))
{}
+ //! <b>Effects</b>: Copy constructs a multiset using the specified allocator.
+ //!
+ //! <b>Complexity</b>: Linear in x.size().
+ multiset(const multiset& x, const allocator_type &a)
+ : m_tree(x.m_tree, a)
+ {}
+
+ //! <b>Effects</b>: Move constructs a multiset using the specified allocator.
+ //! Constructs *this using x's resources.
+ //!
+ //! <b>Complexity</b>: Constant if a == x.get_allocator(), linear otherwise.
+ //!
+ //! <b>Postcondition</b>: x is emptied.
+ multiset(BOOST_RV_REF(multiset) x, const allocator_type &a)
+ : m_tree(boost::move(x.m_tree), a)
+ {}
+
//! <b>Effects</b>: Makes *this a copy of x.
- //!
+ //!
//! <b>Complexity</b>: Linear in x.size().
- multiset& operator=(BOOST_COPY_ASSIGN_REF(multiset) x)
+ multiset& operator=(BOOST_COPY_ASSIGN_REF(multiset) x)
{ m_tree = x.m_tree; return *this; }
//! <b>Effects</b>: this->swap(x.get()).
- //!
+ //!
//! <b>Complexity</b>: Constant.
- multiset& operator=(BOOST_RV_REF(multiset) x)
+ multiset& operator=(BOOST_RV_REF(multiset) x)
{ m_tree = boost::move(x.m_tree); return *this; }
//! <b>Effects</b>: Returns the comparison object out
//! of which a was constructed.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- key_compare key_comp() const
+ key_compare key_comp() const
{ return m_tree.key_comp(); }
//! <b>Effects</b>: Returns an object of value_compare constructed out
//! of the comparison object.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- value_compare value_comp() const
+ value_compare value_comp() const
{ return m_tree.key_comp(); }
//! <b>Effects</b>: Returns a copy of the Allocator that
//! was passed to the object's constructor.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- allocator_type get_allocator() const
+ allocator_type get_allocator() const
{ return m_tree.get_allocator(); }
- const stored_allocator_type &get_stored_allocator() const
+ const stored_allocator_type &get_stored_allocator() const
{ return m_tree.get_stored_allocator(); }
stored_allocator_type &get_stored_allocator()
{ return m_tree.get_stored_allocator(); }
//! <b>Effects</b>: Returns an iterator to the first element contained in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- iterator begin()
+ iterator begin()
{ return m_tree.begin(); }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator begin() const
+ const_iterator begin() const
{ return m_tree.begin(); }
//! <b>Effects</b>: Returns an iterator to the end of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- iterator end()
+ iterator end()
{ return m_tree.end(); }
//! <b>Effects</b>: Returns a const_iterator to the end of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator end() const
+ const_iterator end() const
{ return m_tree.end(); }
- //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
- //! of the reversed container.
- //!
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- reverse_iterator rbegin()
- { return m_tree.rbegin(); }
+ reverse_iterator rbegin()
+ { return m_tree.rbegin(); }
- //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
- //! of the reversed container.
- //!
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator rbegin() const
- { return m_tree.rbegin(); }
+ const_reverse_iterator rbegin() const
+ { return m_tree.rbegin(); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the end
- //! of the reversed container.
- //!
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- reverse_iterator rend()
+ reverse_iterator rend()
{ return m_tree.rend(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
- //! of the reversed container.
- //!
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator rend() const
+ const_reverse_iterator rend() const
{ return m_tree.rend(); }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator cbegin() const
+ const_iterator cbegin() const
{ return m_tree.cbegin(); }
//! <b>Effects</b>: Returns a const_iterator to the end of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator cend() const
+ const_iterator cend() const
{ return m_tree.cend(); }
- //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
- //! of the reversed container.
- //!
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator crbegin() const
- { return m_tree.crbegin(); }
+ const_reverse_iterator crbegin() const
+ { return m_tree.crbegin(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
- //! of the reversed container.
- //!
+ //! of the reversed container.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator crend() const
+ const_reverse_iterator crend() const
{ return m_tree.crend(); }
//! <b>Effects</b>: Returns true if the container contains no elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- bool empty() const
+ bool empty() const
{ return m_tree.empty(); }
//! <b>Effects</b>: Returns the number of the elements contained in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- size_type size() const
+ size_type size() const
{ return m_tree.size(); }
//! <b>Effects</b>: Returns the largest possible size of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- size_type max_size() const
+ size_type max_size() const
{ return m_tree.max_size(); }
//! <b>Effects</b>: Swaps the contents of *this and x.
@@ -897,10 +929,10 @@ class multiset
{ m_tree.swap(x.m_tree); }
//! <b>Effects</b>: Inserts x and returns the iterator pointing to the
- //! newly inserted element.
+ //! newly inserted element.
//!
//! <b>Complexity</b>: Logarithmic.
- iterator insert(insert_const_ref_type x)
+ iterator insert(insert_const_ref_type x)
{ return priv_insert(x); }
#if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
@@ -920,7 +952,7 @@ class multiset
//!
//! <b>Complexity</b>: Logarithmic in general, but amortized constant if t
//! is inserted right before p.
- iterator insert(BOOST_RV_REF(value_type) x)
+ iterator insert(BOOST_RV_REF(value_type) x)
{ return m_tree.insert_equal(boost::move(x)); }
//! <b>Effects</b>: Inserts a copy of x in the container.
@@ -931,7 +963,7 @@ class multiset
//!
//! <b>Complexity</b>: Logarithmic in general, but amortized constant if t
//! is inserted right before p.
- iterator insert(const_iterator p, insert_const_ref_type x)
+ iterator insert(const_iterator p, insert_const_ref_type x)
{ return priv_insert(p, x); }
#if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
@@ -952,7 +984,7 @@ class multiset
//!
//! <b>Complexity</b>: Logarithmic in general, but amortized constant if t
//! is inserted right before p.
- iterator insert(const_iterator p, BOOST_RV_REF(value_type) x)
+ iterator insert(const_iterator p, BOOST_RV_REF(value_type) x)
{ return m_tree.insert_equal(p, boost::move(x)); }
//! <b>Requires</b>: first, last are not iterators into *this.
@@ -961,14 +993,14 @@ class multiset
//!
//! <b>Complexity</b>: At most N log(size()+N) (N is the distance from first to last)
template <class InputIterator>
- void insert(InputIterator first, InputIterator last)
+ void insert(InputIterator first, InputIterator last)
{ m_tree.insert_equal(first, last); }
#if defined(BOOST_CONTAINER_PERFECT_FORWARDING) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
//! <b>Effects</b>: Inserts an object of type T constructed with
//! std::forward<Args>(args)... and returns the iterator pointing to the
- //! newly inserted element.
+ //! newly inserted element.
//!
//! <b>Complexity</b>: Logarithmic.
template <class... Args>
@@ -1008,11 +1040,11 @@ class multiset
//! <b>Effects</b>: Erases the element pointed to by p.
//!
//! <b>Returns</b>: Returns an iterator pointing to the element immediately
- //! following q prior to the element being erased. If no such element exists,
+ //! following q prior to the element being erased. If no such element exists,
//! returns end().
//!
//! <b>Complexity</b>: Amortized constant time
- iterator erase(const_iterator p)
+ iterator erase(const_iterator p)
{ return m_tree.erase(p); }
//! <b>Effects</b>: Erases all elements in the container with key equivalent to x.
@@ -1020,7 +1052,7 @@ class multiset
//! <b>Returns</b>: Returns the number of erased elements.
//!
//! <b>Complexity</b>: log(size()) + count(k)
- size_type erase(const key_type& x)
+ size_type erase(const key_type& x)
{ return m_tree.erase(x); }
//! <b>Effects</b>: Erases all the elements in the range [first, last).
@@ -1036,41 +1068,41 @@ class multiset
//! <b>Postcondition</b>: size() == 0.
//!
//! <b>Complexity</b>: linear in size().
- void clear()
+ void clear()
{ m_tree.clear(); }
//! <b>Returns</b>: An iterator pointing to an element with the key
//! equivalent to x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic.
- iterator find(const key_type& x)
+ iterator find(const key_type& x)
{ return m_tree.find(x); }
//! <b>Returns</b>: A const iterator pointing to an element with the key
//! equivalent to x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic.
- const_iterator find(const key_type& x) const
+ const_iterator find(const key_type& x) const
{ return m_tree.find(x); }
//! <b>Returns</b>: The number of elements with key equivalent to x.
//!
//! <b>Complexity</b>: log(size())+count(k)
- size_type count(const key_type& x) const
+ size_type count(const key_type& x) const
{ return m_tree.count(x); }
//! <b>Returns</b>: An iterator pointing to the first element with key not less
//! than k, or a.end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic
- iterator lower_bound(const key_type& x)
+ iterator lower_bound(const key_type& x)
{ return m_tree.lower_bound(x); }
//! <b>Returns</b>: A const iterator pointing to the first element with key not
//! less than k, or a.end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic
- const_iterator lower_bound(const key_type& x) const
+ const_iterator lower_bound(const key_type& x) const
{ return m_tree.lower_bound(x); }
//! <b>Returns</b>: An iterator pointing to the first element with key not less
@@ -1084,21 +1116,21 @@ class multiset
//! less than x, or end() if such an element is not found.
//!
//! <b>Complexity</b>: Logarithmic
- const_iterator upper_bound(const key_type& x) const
+ const_iterator upper_bound(const key_type& x) const
{ return m_tree.upper_bound(x); }
//! <b>Effects</b>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).
//!
//! <b>Complexity</b>: Logarithmic
- std::pair<iterator,iterator>
- equal_range(const key_type& x)
+ std::pair<iterator,iterator>
+ equal_range(const key_type& x)
{ return m_tree.equal_range(x); }
//! <b>Effects</b>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).
//!
//! <b>Complexity</b>: Logarithmic
- std::pair<const_iterator, const_iterator>
- equal_range(const key_type& x) const
+ std::pair<const_iterator, const_iterator>
+ equal_range(const key_type& x) const
{ return m_tree.equal_range(x); }
/// @cond
@@ -1109,47 +1141,47 @@ class multiset
friend bool operator< (const multiset<K1,C1,A1>&,
const multiset<K1,C1,A1>&);
private:
- iterator priv_insert(const T &x)
+ iterator priv_insert(const T &x)
{ return m_tree.insert_equal(x); }
- iterator priv_insert(const_iterator p, const T &x)
+ iterator priv_insert(const_iterator p, const T &x)
{ return m_tree.insert_equal(p, x); }
/// @endcond
};
template <class T, class Pred, class A>
-inline bool operator==(const multiset<T,Pred,A>& x,
- const multiset<T,Pred,A>& y)
+inline bool operator==(const multiset<T,Pred,A>& x,
+ const multiset<T,Pred,A>& y)
{ return x.m_tree == y.m_tree; }
template <class T, class Pred, class A>
-inline bool operator<(const multiset<T,Pred,A>& x,
- const multiset<T,Pred,A>& y)
+inline bool operator<(const multiset<T,Pred,A>& x,
+ const multiset<T,Pred,A>& y)
{ return x.m_tree < y.m_tree; }
template <class T, class Pred, class A>
-inline bool operator!=(const multiset<T,Pred,A>& x,
- const multiset<T,Pred,A>& y)
+inline bool operator!=(const multiset<T,Pred,A>& x,
+ const multiset<T,Pred,A>& y)
{ return !(x == y); }
template <class T, class Pred, class A>
-inline bool operator>(const multiset<T,Pred,A>& x,
- const multiset<T,Pred,A>& y)
+inline bool operator>(const multiset<T,Pred,A>& x,
+ const multiset<T,Pred,A>& y)
{ return y < x; }
template <class T, class Pred, class A>
-inline bool operator<=(const multiset<T,Pred,A>& x,
- const multiset<T,Pred,A>& y)
+inline bool operator<=(const multiset<T,Pred,A>& x,
+ const multiset<T,Pred,A>& y)
{ return !(y < x); }
template <class T, class Pred, class A>
-inline bool operator>=(const multiset<T,Pred,A>& x,
- const multiset<T,Pred,A>& y)
+inline bool operator>=(const multiset<T,Pred,A>& x,
+ const multiset<T,Pred,A>& y)
{ return !(x < y); }
template <class T, class Pred, class A>
-inline void swap(multiset<T,Pred,A>& x, multiset<T,Pred,A>& y)
+inline void swap(multiset<T,Pred,A>& x, multiset<T,Pred,A>& y)
{ x.swap(y); }
/// @cond
diff --git a/boost/container/slist.hpp b/boost/container/slist.hpp
index 1cdcdf1046..57719357fc 100644
--- a/boost/container/slist.hpp
+++ b/boost/container/slist.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2004-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -32,7 +32,7 @@
#if defined(BOOST_CONTAINER_PERFECT_FORWARDING) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
//Preprocessor library to emulate perfect forwarding
#else
-#include <boost/container/detail/preprocessor.hpp>
+#include <boost/container/detail/preprocessor.hpp>
#endif
#include <stdexcept>
@@ -65,31 +65,11 @@ template <class T, class VoidPointer>
struct slist_node
: public slist_hook<VoidPointer>::type
{
+ private:
+ slist_node();
- slist_node()
- : m_data()
- {}
-
- #if defined(BOOST_CONTAINER_PERFECT_FORWARDING) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
-
- template<class ...Args>
- slist_node(Args &&...args)
- : m_data(boost::forward<Args>(args)...)
- {}
-
- #else //#ifdef BOOST_CONTAINER_PERFECT_FORWARDING
-
- #define BOOST_PP_LOCAL_MACRO(n) \
- template<BOOST_PP_ENUM_PARAMS(n, class P)> \
- slist_node(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \
- : m_data(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)) \
- {} \
- //!
- #define BOOST_PP_LOCAL_LIMITS (1, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS)
- #include BOOST_PP_LOCAL_ITERATE()
-
- #endif//#ifdef BOOST_CONTAINER_PERFECT_FORWARDING
-
+ public:
+ typedef typename slist_hook<VoidPointer>::type hook_type;
T m_data;
};
@@ -119,51 +99,51 @@ struct intrusive_slist_type
/// @endcond
-//! An slist is a singly linked list: a list where each element is linked to the next
-//! element, but not to the previous element. That is, it is a Sequence that
-//! supports forward but not backward traversal, and (amortized) constant time
-//! insertion and removal of elements. Slists, like lists, have the important
-//! property that insertion and splicing do not invalidate iterators to list elements,
-//! and that even removal invalidates only the iterators that point to the elements
-//! that are removed. The ordering of iterators may be changed (that is,
-//! slist<T>::iterator might have a different predecessor or successor after a list
-//! operation than it did before), but the iterators themselves will not be invalidated
+//! An slist is a singly linked list: a list where each element is linked to the next
+//! element, but not to the previous element. That is, it is a Sequence that
+//! supports forward but not backward traversal, and (amortized) constant time
+//! insertion and removal of elements. Slists, like lists, have the important
+//! property that insertion and splicing do not invalidate iterators to list elements,
+//! and that even removal invalidates only the iterators that point to the elements
+//! that are removed. The ordering of iterators may be changed (that is,
+//! slist<T>::iterator might have a different predecessor or successor after a list
+//! operation than it did before), but the iterators themselves will not be invalidated
//! or made to point to different elements unless that invalidation or mutation is explicit.
//!
-//! The main difference between slist and list is that list's iterators are bidirectional
-//! iterators, while slist's iterators are forward iterators. This means that slist is
-//! less versatile than list; frequently, however, bidirectional iterators are
-//! unnecessary. You should usually use slist unless you actually need the extra
-//! functionality of list, because singly linked lists are smaller and faster than double
-//! linked lists.
-//!
-//! Important performance note: like every other Sequence, slist defines the member
-//! functions insert and erase. Using these member functions carelessly, however, can
-//! result in disastrously slow programs. The problem is that insert's first argument is
-//! an iterator p, and that it inserts the new element(s) before p. This means that
-//! insert must find the iterator just before p; this is a constant-time operation
-//! for list, since list has bidirectional iterators, but for slist it must find that
-//! iterator by traversing the list from the beginning up to p. In other words:
+//! The main difference between slist and list is that list's iterators are bidirectional
+//! iterators, while slist's iterators are forward iterators. This means that slist is
+//! less versatile than list; frequently, however, bidirectional iterators are
+//! unnecessary. You should usually use slist unless you actually need the extra
+//! functionality of list, because singly linked lists are smaller and faster than double
+//! linked lists.
+//!
+//! Important performance note: like every other Sequence, slist defines the member
+//! functions insert and erase. Using these member functions carelessly, however, can
+//! result in disastrously slow programs. The problem is that insert's first argument is
+//! an iterator p, and that it inserts the new element(s) before p. This means that
+//! insert must find the iterator just before p; this is a constant-time operation
+//! for list, since list has bidirectional iterators, but for slist it must find that
+//! iterator by traversing the list from the beginning up to p. In other words:
//! insert and erase are slow operations anywhere but near the beginning of the slist.
-//!
-//! Slist provides the member functions insert_after and erase_after, which are constant
-//! time operations: you should always use insert_after and erase_after whenever
-//! possible. If you find that insert_after and erase_after aren't adequate for your
-//! needs, and that you often need to use insert and erase in the middle of the list,
+//!
+//! Slist provides the member functions insert_after and erase_after, which are constant
+//! time operations: you should always use insert_after and erase_after whenever
+//! possible. If you find that insert_after and erase_after aren't adequate for your
+//! needs, and that you often need to use insert and erase in the middle of the list,
//! then you should probably use list instead of slist.
#ifdef BOOST_CONTAINER_DOXYGEN_INVOKED
template <class T, class A = std::allocator<T> >
#else
template <class T, class A>
#endif
-class slist
+class slist
: protected container_detail::node_alloc_holder
<A, typename container_detail::intrusive_slist_type<A>::type>
{
/// @cond
typedef typename container_detail::
move_const_ref_type<T>::type insert_const_ref_type;
- typedef typename
+ typedef typename
container_detail::intrusive_slist_type<A>::type Icont;
typedef container_detail::node_alloc_holder<A, Icont> AllocHolder;
typedef typename AllocHolder::NodePtr NodePtr;
@@ -238,11 +218,11 @@ class slist
public:
- //! Const iterator used to iterate through a list.
+ //! Const iterator used to iterate through a list.
class const_iterator
/// @cond
- : public std::iterator<std::forward_iterator_tag,
- value_type, list_difference_type,
+ : public std::iterator<std::forward_iterator_tag,
+ value_type, list_difference_type,
list_const_pointer, list_const_reference>
{
@@ -265,17 +245,17 @@ class slist
{}
//Pointer like operators
- const_reference operator*() const
+ const_reference operator*() const
{ return m_it->m_data; }
- const_pointer operator->() const
+ const_pointer operator->() const
{ return const_pointer(&m_it->m_data); }
//Increment / Decrement
- const_iterator& operator++()
+ const_iterator& operator++()
{ prot_incr(); return *this; }
- const_iterator operator++(int)
+ const_iterator operator++(int)
{ typename Icont::iterator tmp = m_it; ++*this; return const_iterator(tmp); }
//Comparison operators
@@ -298,7 +278,7 @@ class slist
explicit iterator(typename Icont::iterator it)
: const_iterator(it)
{}
-
+
typename Icont::iterator get()
{ return this->m_it; }
@@ -315,7 +295,7 @@ class slist
pointer operator->() const { return pointer(&this->m_it->m_data); }
//Increment / Decrement
- iterator& operator++()
+ iterator& operator++()
{ this->prot_incr(); return *this; }
iterator operator++(int)
@@ -326,18 +306,18 @@ class slist
public:
//! <b>Effects</b>: Constructs a list taking the allocator as parameter.
- //!
+ //!
//! <b>Throws</b>: If allocator_type's copy constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Constant.
slist()
: AllocHolder()
{}
//! <b>Effects</b>: Constructs a list taking the allocator as parameter.
- //!
+ //!
//! <b>Throws</b>: If allocator_type's copy constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Constant.
explicit slist(const allocator_type& a)
: AllocHolder(a)
@@ -352,7 +332,7 @@ class slist
//!
//! <b>Throws</b>: If allocator_type's default constructor or copy constructor
//! throws or T's default or copy constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Linear to n.
explicit slist(size_type n, const value_type& x, const allocator_type& a = allocator_type())
: AllocHolder(a)
@@ -367,34 +347,62 @@ class slist
//! <b>Complexity</b>: Linear to the range [first, last).
template <class InpIt>
slist(InpIt first, InpIt last,
- const allocator_type& a = allocator_type())
+ const allocator_type& a = allocator_type())
: AllocHolder(a)
{ this->insert_after(this->before_begin(), first, last); }
//! <b>Effects</b>: Copy constructs a list.
//!
//! <b>Postcondition</b>: x == *this.
- //!
+ //!
//! <b>Throws</b>: If allocator_type's default constructor or copy constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Linear to the elements x contains.
- slist(const slist& x)
+ slist(const slist& x)
: AllocHolder(x)
{ this->insert_after(this->before_begin(), x.begin(), x.end()); }
//! <b>Effects</b>: Move constructor. Moves mx's resources to *this.
//!
//! <b>Throws</b>: If allocator_type's copy constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Constant.
slist(BOOST_RV_REF(slist) x)
: AllocHolder(boost::move(static_cast<AllocHolder&>(x)))
{}
+ //! <b>Effects</b>: Copy constructs a list using the specified allocator.
+ //!
+ //! <b>Postcondition</b>: x == *this.
+ //!
+ //! <b>Throws</b>: If allocator_type's default constructor or copy constructor throws.
+ //!
+ //! <b>Complexity</b>: Linear to the elements x contains.
+ slist(const slist& x, const allocator_type &a)
+ : AllocHolder(a)
+ { this->insert_after(this->before_begin(), x.begin(), x.end()); }
+
+ //! <b>Effects</b>: Move constructor using the specified allocator.
+ //! Moves x's resources to *this.
+ //!
+ //! <b>Throws</b>: If allocation or value_type's copy constructor throws.
+ //!
+ //! <b>Complexity</b>: Constant if a == x.get_allocator(), linear otherwise.
+ slist(BOOST_RV_REF(slist) x, const allocator_type &a)
+ : AllocHolder(a)
+ {
+ if(this->node_alloc() == x.node_alloc()){
+ this->icont().swap(x.icont());
+ }
+ else{
+ this->insert(this->cbegin(), x.begin(), x.end());
+ }
+ }
+
//! <b>Effects</b>: Makes *this contain the same elements as x.
//!
- //! <b>Postcondition</b>: this->size() == x.size(). *this contains a copy
- //! of each of x's elements.
+ //! <b>Postcondition</b>: this->size() == x.size(). *this contains a copy
+ //! of each of x's elements.
//!
//! <b>Throws</b>: If memory allocation throws or T's copy constructor throws.
//!
@@ -417,8 +425,8 @@ class slist
//! <b>Effects</b>: Makes *this contain the same elements as x.
//!
- //! <b>Postcondition</b>: this->size() == x.size(). *this contains a copy
- //! of each of x's elements.
+ //! <b>Postcondition</b>: this->size() == x.size(). *this contains a copy
+ //! of each of x's elements.
//!
//! <b>Throws</b>: If memory allocation throws or T's copy constructor throws.
//!
@@ -452,18 +460,18 @@ class slist
//! <b>Throws</b>: Nothing.
//!
//! <b>Complexity</b>: Linear to the number of elements.
- ~slist()
+ ~slist()
{} //AllocHolder clears the slist
//! <b>Effects</b>: Returns a copy of the internal allocator.
- //!
+ //!
//! <b>Throws</b>: If allocator's copy constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Constant.
allocator_type get_allocator() const
{ return allocator_type(this->node_alloc()); }
- const stored_allocator_type &get_stored_allocator() const
+ const stored_allocator_type &get_stored_allocator() const
{ return this->node_alloc(); }
stored_allocator_type &get_stored_allocator()
@@ -486,7 +494,7 @@ class slist
//!
//! <b>Complexity</b>: Linear to n.
template <class InpIt>
- void assign(InpIt first, InpIt last)
+ void assign(InpIt first, InpIt last)
{
const bool aux_boolean = container_detail::is_convertible<InpIt, size_type>::value;
typedef container_detail::bool_<aux_boolean> Result;
@@ -494,33 +502,33 @@ class slist
}
//! <b>Effects</b>: Returns an iterator to the first element contained in the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- iterator begin()
+ iterator begin()
{ return iterator(this->icont().begin()); }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator begin() const
+ const_iterator begin() const
{ return this->cbegin(); }
//! <b>Effects</b>: Returns an iterator to the end of the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
iterator end()
{ return iterator(this->icont().end()); }
//! <b>Effects</b>: Returns a const_iterator to the end of the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_iterator end() const
{ return this->cend(); }
@@ -528,71 +536,71 @@ class slist
//! <b>Effects</b>: Returns a non-dereferenceable iterator that,
//! when incremented, yields begin(). This iterator may be used
//! as the argument toinsert_after, erase_after, etc.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- iterator before_begin()
+ iterator before_begin()
{ return iterator(end()); }
- //! <b>Effects</b>: Returns a non-dereferenceable const_iterator
+ //! <b>Effects</b>: Returns a non-dereferenceable const_iterator
//! that, when incremented, yields begin(). This iterator may be used
//! as the argument toinsert_after, erase_after, etc.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_iterator before_begin() const
{ return this->cbefore_begin(); }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator cbegin() const
+ const_iterator cbegin() const
{ return const_iterator(this->non_const_icont().begin()); }
//! <b>Effects</b>: Returns a const_iterator to the end of the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_iterator cend() const
{ return const_iterator(this->non_const_icont().end()); }
- //! <b>Effects</b>: Returns a non-dereferenceable const_iterator
+ //! <b>Effects</b>: Returns a non-dereferenceable const_iterator
//! that, when incremented, yields begin(). This iterator may be used
//! as the argument toinsert_after, erase_after, etc.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_iterator cbefore_begin() const
{ return const_iterator(end()); }
//! <b>Effects</b>: Returns the number of the elements contained in the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- size_type size() const
+ size_type size() const
{ return this->icont().size(); }
//! <b>Effects</b>: Returns the largest possible size of the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- size_type max_size() const
+ size_type max_size() const
{ return AllocHolder::max_size(); }
//! <b>Effects</b>: Returns true if the list contains no elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- bool empty() const
+ bool empty() const
{ return !this->size(); }
//! <b>Effects</b>: Swaps the contents of *this and x.
@@ -605,24 +613,24 @@ class slist
//! <b>Requires</b>: !empty()
//!
- //! <b>Effects</b>: Returns a reference to the first element
+ //! <b>Effects</b>: Returns a reference to the first element
//! from the beginning of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- reference front()
+ reference front()
{ return *this->begin(); }
//! <b>Requires</b>: !empty()
//!
- //! <b>Effects</b>: Returns a const reference to the first element
+ //! <b>Effects</b>: Returns a const reference to the first element
//! from the beginning of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reference front() const
+ const_reference front() const
{ return *this->begin(); }
//! <b>Effects</b>: Inserts a copy of t in the beginning of the list.
@@ -660,24 +668,24 @@ class slist
void pop_front()
{ this->icont().pop_front_and_dispose(Destroyer(this->node_alloc())); }
- //! <b>Returns</b>: The iterator to the element before i in the sequence.
- //! Returns the end-iterator, if either i is the begin-iterator or the
- //! sequence is empty.
- //!
+ //! <b>Returns</b>: The iterator to the element before i in the sequence.
+ //! Returns the end-iterator, if either i is the begin-iterator or the
+ //! sequence is empty.
+ //!
//! <b>Throws</b>: Nothing.
- //!
- //! <b>Complexity</b>: Linear to the number of elements before i.
- iterator previous(iterator p)
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements before i.
+ iterator previous(iterator p)
{ return iterator(this->icont().previous(p.get())); }
- //! <b>Returns</b>: The const_iterator to the element before i in the sequence.
- //! Returns the end-const_iterator, if either i is the begin-const_iterator or
- //! the sequence is empty.
- //!
+ //! <b>Returns</b>: The const_iterator to the element before i in the sequence.
+ //! Returns the end-const_iterator, if either i is the begin-const_iterator or
+ //! the sequence is empty.
+ //!
//! <b>Throws</b>: Nothing.
- //!
- //! <b>Complexity</b>: Linear to the number of elements before i.
- const_iterator previous(const_iterator p)
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements before i.
+ const_iterator previous(const_iterator p)
{ return const_iterator(this->icont().previous(p.get())); }
//! <b>Requires</b>: p must be a valid iterator of *this.
@@ -686,14 +694,14 @@ class slist
//! by prev_p.
//!
//! <b>Returns</b>: An iterator to the inserted element.
- //!
+ //!
//! <b>Throws</b>: If memory allocation throws or T's copy constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Amortized constant time.
//!
//! <b>Note</b>: Does not affect the validity of iterators and references of
//! previous values.
- iterator insert_after(const_iterator prev_pos, insert_const_ref_type x)
+ iterator insert_after(const_iterator prev_pos, insert_const_ref_type x)
{ return this->priv_insert_after(prev_pos, x); }
#if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
@@ -712,14 +720,14 @@ class slist
//! p pointed by prev_pos.
//!
//! <b>Returns</b>: An iterator to the inserted element.
- //!
+ //!
//! <b>Throws</b>: If memory allocation throws.
- //!
+ //!
//! <b>Complexity</b>: Amortized constant time.
//!
//! <b>Note</b>: Does not affect the validity of iterators and references of
//! previous values.
- iterator insert_after(const_iterator prev_pos, BOOST_RV_REF(value_type) x)
+ iterator insert_after(const_iterator prev_pos, BOOST_RV_REF(value_type) x)
{ return iterator(this->icont().insert_after(prev_pos.get(), *this->create_node(boost::move(x)))); }
//! <b>Requires</b>: prev_pos must be a valid iterator of *this.
@@ -736,19 +744,19 @@ class slist
{ this->priv_create_and_insert_nodes(prev_pos, n, x); }
//! <b>Requires</b>: prev_pos must be a valid iterator of *this.
- //!
- //! <b>Effects</b>: Inserts the range pointed by [first, last)
+ //!
+ //! <b>Effects</b>: Inserts the range pointed by [first, last)
//! after the p prev_pos.
- //!
+ //!
//! <b>Throws</b>: If memory allocation throws, T's constructor from a
//! dereferenced InpIt throws.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements inserted.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references of
//! previous values.
template <class InIter>
- void insert_after(const_iterator prev_pos, InIter first, InIter last)
+ void insert_after(const_iterator prev_pos, InIter first, InIter last)
{
const bool aux_boolean = container_detail::is_convertible<InIter, size_type>::value;
typedef container_detail::bool_<aux_boolean> Result;
@@ -762,7 +770,7 @@ class slist
//! <b>Throws</b>: If memory allocation throws or x's copy constructor throws.
//!
//! <b>Complexity</b>: Linear to the elements before p.
- iterator insert(const_iterator position, insert_const_ref_type x)
+ iterator insert(const_iterator position, insert_const_ref_type x)
{ return this->priv_insert(position, x); }
#if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
@@ -782,7 +790,7 @@ class slist
//! <b>Throws</b>: If memory allocation throws.
//!
//! <b>Complexity</b>: Linear to the elements before p.
- iterator insert(const_iterator p, BOOST_RV_REF(value_type) x)
+ iterator insert(const_iterator p, BOOST_RV_REF(value_type) x)
{ return this->insert_after(previous(p), boost::move(x)); }
//! <b>Requires</b>: p must be a valid iterator of *this.
@@ -792,9 +800,9 @@ class slist
//! <b>Throws</b>: If memory allocation throws or T's copy constructor throws.
//!
//! <b>Complexity</b>: Linear to n plus linear to the elements before p.
- void insert(const_iterator p, size_type n, const value_type& x)
+ void insert(const_iterator p, size_type n, const value_type& x)
{ return this->insert_after(previous(p), n, x); }
-
+
//! <b>Requires</b>: p must be a valid iterator of *this.
//!
//! <b>Effects</b>: Insert a copy of the [first, last) range before p.
@@ -805,7 +813,7 @@ class slist
//! <b>Complexity</b>: Linear to std::distance [first, last) plus
//! linear to the elements before p.
template <class InIter>
- void insert(const_iterator p, InIter first, InIter last)
+ void insert(const_iterator p, InIter first, InIter last)
{ return this->insert_after(previous(p), first, last); }
#if defined(BOOST_CONTAINER_PERFECT_FORWARDING) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
@@ -884,11 +892,11 @@ class slist
//!
//! <b>Returns</b>: the first element remaining beyond the removed elements,
//! or end() if no such element exists.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Does not invalidate iterators or references to non erased elements.
iterator erase_after(const_iterator prev_pos)
{
@@ -896,17 +904,17 @@ class slist
}
//! <b>Effects</b>: Erases the range (before_first, last) from
- //! the list.
+ //! the list.
//!
//! <b>Returns</b>: the first element remaining beyond the removed elements,
//! or end() if no such element exists.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of erased elements.
- //!
+ //!
//! <b>Note</b>: Does not invalidate iterators or references to non erased elements.
- iterator erase_after(const_iterator before_first, const_iterator last)
+ iterator erase_after(const_iterator before_first, const_iterator last)
{
return iterator(this->icont().erase_after_and_dispose(before_first.get(), last.get(), Destroyer(this->node_alloc())));
}
@@ -918,7 +926,7 @@ class slist
//! <b>Throws</b>: Nothing.
//!
//! <b>Complexity</b>: Linear to the number of elements before p.
- iterator erase(const_iterator p)
+ iterator erase(const_iterator p)
{ return iterator(this->erase_after(previous(p))); }
//! <b>Requires</b>: first and last must be valid iterator to elements in *this.
@@ -945,7 +953,7 @@ class slist
--new_size;
cur = cur_next;
}
- if (cur_next != end_n)
+ if (cur_next != end_n)
this->erase_after(const_iterator(cur), const_iterator(end_n));
else
this->insert_after(const_iterator(cur), new_size, x);
@@ -962,7 +970,7 @@ class slist
typename Icont::iterator end_n(this->icont().end()), cur(this->icont().before_begin()), cur_next;
size_type len = this->size();
size_type left = new_size;
-
+
while (++(cur_next = cur) != end_n && left > 0){
--left;
cur = cur_next;
@@ -980,7 +988,7 @@ class slist
//! <b>Throws</b>: Nothing.
//!
//! <b>Complexity</b>: Linear to the number of elements in the list.
- void clear()
+ void clear()
{ this->icont().clear_and_dispose(Destroyer(this->node_alloc())); }
//! <b>Requires</b>: p must point to an element contained
@@ -993,7 +1001,7 @@ class slist
//! are not equal.
//!
//! <b>Complexity</b>: Linear to the elements in x.
- //!
+ //!
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of
//! this list. Iterators of this list and all the references are not invalidated.
void splice_after(const_iterator prev_pos, slist& x)
@@ -1008,16 +1016,16 @@ class slist
//! <b>Requires</b>: prev_pos must be a valid iterator of this.
//! i must point to an element contained in list x.
- //!
- //! <b>Effects</b>: Transfers the value pointed by i, from list x to this list,
+ //!
+ //! <b>Effects</b>: Transfers the value pointed by i, from list x to this list,
//! after the element pointed by prev_pos.
- //! If prev_pos == prev or prev_pos == ++prev, this function is a null operation.
- //!
+ //! If prev_pos == prev or prev_pos == ++prev, this function is a null operation.
+ //!
//! <b>Throws</b>: std::runtime_error if this' allocator and x's allocator
//! are not equal.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
//! list. Iterators of this list and all the references are not invalidated.
void splice_after(const_iterator prev_pos, slist& x, const_iterator prev)
@@ -1033,18 +1041,18 @@ class slist
//! <b>Requires</b>: prev_pos must be a valid iterator of this.
//! before_first and before_last must be valid iterators of x.
//! prev_pos must not be contained in [before_first, before_last) range.
- //!
+ //!
//! <b>Effects</b>: Transfers the range [before_first + 1, before_last + 1)
//! from list x to this list, after the element pointed by prev_pos.
- //!
+ //!
//! <b>Throws</b>: std::runtime_error if this' allocator and x's allocator
//! are not equal.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of transferred elements.
- //!
+ //!
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
//! list. Iterators of this list and all the references are not invalidated.
- void splice_after(const_iterator prev_pos, slist& x,
+ void splice_after(const_iterator prev_pos, slist& x,
const_iterator before_first, const_iterator before_last)
{
if((NodeAlloc&)*this == (NodeAlloc&)x){
@@ -1060,18 +1068,18 @@ class slist
//! before_first and before_last must be valid iterators of x.
//! prev_pos must not be contained in [before_first, before_last) range.
//! n == std::distance(before_first, before_last)
- //!
+ //!
//! <b>Effects</b>: Transfers the range [before_first + 1, before_last + 1)
//! from list x to this list, after the element pointed by prev_pos.
- //!
+ //!
//! <b>Throws</b>: std::runtime_error if this' allocator and x's allocator
//! are not equal.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
//! list. Iterators of this list and all the references are not invalidated.
- void splice_after(const_iterator prev_pos, slist& x,
+ void splice_after(const_iterator prev_pos, slist& x,
const_iterator before_first, const_iterator before_last,
size_type n)
{
@@ -1094,24 +1102,24 @@ class slist
//! are not equal.
//!
//! <b>Complexity</b>: Linear in distance(begin(), p), and linear in x.size().
- //!
+ //!
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of
//! this list. Iterators of this list and all the references are not invalidated.
- void splice(const_iterator p, ThisType& x)
+ void splice(const_iterator p, ThisType& x)
{ this->splice_after(this->previous(p), x); }
//! <b>Requires</b>: p must point to an element contained
//! by this list. i must point to an element contained in list x.
- //!
- //! <b>Effects</b>: Transfers the value pointed by i, from list x to this list,
+ //!
+ //! <b>Effects</b>: Transfers the value pointed by i, from list x to this list,
//! before the the element pointed by p. No destructors or copy constructors are called.
- //! If p == i or p == ++i, this function is a null operation.
- //!
+ //! If p == i or p == ++i, this function is a null operation.
+ //!
//! <b>Throws</b>: std::runtime_error if this' allocator and x's allocator
//! are not equal.
- //!
+ //!
//! <b>Complexity</b>: Linear in distance(begin(), p), and in distance(x.begin(), i).
- //!
+ //!
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
//! list. Iterators of this list and all the references are not invalidated.
void splice(const_iterator p, slist& x, const_iterator i)
@@ -1119,37 +1127,37 @@ class slist
//! <b>Requires</b>: p must point to an element contained
//! by this list. first and last must point to elements contained in list x.
- //!
- //! <b>Effects</b>: Transfers the range pointed by first and last from list x to this list,
+ //!
+ //! <b>Effects</b>: Transfers the range pointed by first and last from list x to this list,
//! before the the element pointed by p. No destructors or copy constructors are called.
- //!
+ //!
//! <b>Throws</b>: std::runtime_error if this' allocator and x's allocator
//! are not equal.
- //!
+ //!
//! <b>Complexity</b>: Linear in distance(begin(), p), in distance(x.begin(), first),
//! and in distance(first, last).
- //!
+ //!
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
//! list. Iterators of this list and all the references are not invalidated.
void splice(const_iterator p, slist& x, const_iterator first, const_iterator last)
{ this->splice_after(previous(p), x, previous(first), previous(last)); }
- //! <b>Effects</b>: Reverses the order of elements in the list.
- //!
+ //! <b>Effects</b>: Reverses the order of elements in the list.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: This function is linear time.
- //!
+ //!
//! <b>Note</b>: Iterators and references are not invalidated
- void reverse()
+ void reverse()
{ this->icont().reverse(); }
//! <b>Effects</b>: Removes all the elements that compare equal to value.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear time. It performs exactly size() comparisons for equality.
- //!
+ //!
//! <b>Note</b>: The relative order of elements that are not removed is unchanged,
//! and iterators to elements that are not removed remain valid.
void remove(const T& value)
@@ -1157,57 +1165,57 @@ class slist
//! <b>Effects</b>: Removes all the elements for which a specified
//! predicate is satisfied.
- //!
+ //!
//! <b>Throws</b>: If pred throws.
- //!
+ //!
//! <b>Complexity</b>: Linear time. It performs exactly size() calls to the predicate.
- //!
+ //!
//! <b>Note</b>: The relative order of elements that are not removed is unchanged,
//! and iterators to elements that are not removed remain valid.
- template <class Pred>
+ template <class Pred>
void remove_if(Pred pred)
{
typedef ValueCompareToNodeCompare<Pred> Predicate;
this->icont().remove_and_dispose_if(Predicate(pred), Destroyer(this->node_alloc()));
}
- //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
+ //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
//! elements that are equal from the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear time (size()-1 comparisons calls to pred()).
- //!
+ //!
//! <b>Note</b>: The relative order of elements that are not removed is unchanged,
//! and iterators to elements that are not removed remain valid.
void unique()
{ this->unique(value_equal()); }
- //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
+ //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
//! elements that satisfy some binary predicate from the list.
- //!
+ //!
//! <b>Throws</b>: If pred throws.
- //!
+ //!
//! <b>Complexity</b>: Linear time (size()-1 comparisons equality comparisons).
- //!
+ //!
//! <b>Note</b>: The relative order of elements that are not removed is unchanged,
//! and iterators to elements that are not removed remain valid.
- template <class Pred>
+ template <class Pred>
void unique(Pred pred)
{
typedef ValueCompareToNodeCompare<Pred> Predicate;
this->icont().unique_and_dispose(Predicate(pred), Destroyer(this->node_alloc()));
}
- //! <b>Requires</b>: The lists x and *this must be distinct.
+ //! <b>Requires</b>: The lists x and *this must be distinct.
//!
//! <b>Effects</b>: This function removes all of x's elements and inserts them
- //! in order into *this according to std::less<value_type>. The merge is stable;
- //! that is, if an element from *this is equivalent to one from x, then the element
- //! from *this will precede the one from x.
- //!
+ //! in order into *this according to std::less<value_type>. The merge is stable;
+ //! that is, if an element from *this is equivalent to one from x, then the element
+ //! from *this will precede the one from x.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: This function is linear time: it performs at most
//! size() + x.size() - 1 comparisons.
void merge(slist & x)
@@ -1215,17 +1223,17 @@ class slist
//! <b>Requires</b>: p must be a comparison function that induces a strict weak
//! ordering and both *this and x must be sorted according to that ordering
- //! The lists x and *this must be distinct.
- //!
+ //! The lists x and *this must be distinct.
+ //!
//! <b>Effects</b>: This function removes all of x's elements and inserts them
- //! in order into *this. The merge is stable; that is, if an element from *this is
- //! equivalent to one from x, then the element from *this will precede the one from x.
- //!
+ //! in order into *this. The merge is stable; that is, if an element from *this is
+ //! equivalent to one from x, then the element from *this will precede the one from x.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: This function is linear time: it performs at most
//! size() + x.size() - 1 comparisons.
- //!
+ //!
//! <b>Note</b>: Iterators and references to *this are not invalidated.
template <class StrictWeakOrdering>
void merge(slist& x, StrictWeakOrdering comp)
@@ -1239,28 +1247,28 @@ class slist
}
}
- //! <b>Effects</b>: This function sorts the list *this according to std::less<value_type>.
+ //! <b>Effects</b>: This function sorts the list *this according to std::less<value_type>.
//! The sort is stable, that is, the relative order of equivalent elements is preserved.
- //!
+ //!
//! <b>Throws</b>: Nothing.
//!
//! <b>Notes</b>: Iterators and references are not invalidated.
- //!
+ //!
//! <b>Complexity</b>: The number of comparisons is approximately N log N, where N
//! is the list's size.
void sort()
{ this->sort(value_less()); }
- //! <b>Effects</b>: This function sorts the list *this according to std::less<value_type>.
+ //! <b>Effects</b>: This function sorts the list *this according to std::less<value_type>.
//! The sort is stable, that is, the relative order of equivalent elements is preserved.
- //!
+ //!
//! <b>Throws</b>: Nothing.
//!
//! <b>Notes</b>: Iterators and references are not invalidated.
- //!
+ //!
//! <b>Complexity</b>: The number of comparisons is approximately N log N, where N
//! is the list's size.
- template <class StrictWeakOrdering>
+ template <class StrictWeakOrdering>
void sort(StrictWeakOrdering comp)
{
// nothing if the slist has length 0 or 1.
@@ -1271,10 +1279,10 @@ class slist
/// @cond
private:
- iterator priv_insert(const_iterator p, const value_type& x)
+ iterator priv_insert(const_iterator p, const value_type& x)
{ return this->insert_after(previous(p), x); }
- iterator priv_insert_after(const_iterator prev_pos, const value_type& x)
+ iterator priv_insert_after(const_iterator prev_pos, const value_type& x)
{ return iterator(this->icont().insert_after(prev_pos.get(), *this->create_node(x))); }
void priv_push_front(const value_type &x)
@@ -1354,10 +1362,10 @@ class slist
{ this->priv_create_and_insert_nodes(prev, first, last); }
template<class Integer>
- void priv_insert_dispatch(const_iterator prev, Integer n, Integer x, container_detail::true_)
+ void priv_insert_dispatch(const_iterator prev, Integer n, Integer x, container_detail::true_)
{ this->priv_create_and_insert_nodes(prev, (size_type)n, x); }
- void priv_fill_assign(size_type n, const T& val)
+ void priv_fill_assign(size_type n, const T& val)
{
iterator end_n(this->end());
iterator prev(this->before_begin());
@@ -1396,11 +1404,11 @@ class slist
}
template <class Int>
- void priv_insert_after_range_dispatch(const_iterator prev_pos, Int n, Int x, container_detail::true_)
+ void priv_insert_after_range_dispatch(const_iterator prev_pos, Int n, Int x, container_detail::true_)
{ this->priv_create_and_insert_nodes(prev_pos, (size_type)n, x); }
template <class InIter>
- void priv_insert_after_range_dispatch(const_iterator prev_pos, InIter first, InIter last, container_detail::false_)
+ void priv_insert_after_range_dispatch(const_iterator prev_pos, InIter first, InIter last, container_detail::false_)
{ this->priv_create_and_insert_nodes(prev_pos, first, last); }
//Functors for member algorithm defaults
@@ -1430,7 +1438,7 @@ class slist
};
template <class T, class A>
-inline bool
+inline bool
operator==(const slist<T,A>& x, const slist<T,A>& y)
{
if(x.size() != y.size()){
@@ -1457,27 +1465,27 @@ operator<(const slist<T,A>& sL1, const slist<T,A>& sL2)
}
template <class T, class A>
-inline bool
-operator!=(const slist<T,A>& sL1, const slist<T,A>& sL2)
+inline bool
+operator!=(const slist<T,A>& sL1, const slist<T,A>& sL2)
{ return !(sL1 == sL2); }
template <class T, class A>
-inline bool
-operator>(const slist<T,A>& sL1, const slist<T,A>& sL2)
+inline bool
+operator>(const slist<T,A>& sL1, const slist<T,A>& sL2)
{ return sL2 < sL1; }
template <class T, class A>
-inline bool
+inline bool
operator<=(const slist<T,A>& sL1, const slist<T,A>& sL2)
{ return !(sL2 < sL1); }
template <class T, class A>
-inline bool
+inline bool
operator>=(const slist<T,A>& sL1, const slist<T,A>& sL2)
{ return !(sL1 < sL2); }
template <class T, class A>
-inline void swap(slist<T,A>& x, slist<T,A>& y)
+inline void swap(slist<T,A>& x, slist<T,A>& y)
{ x.swap(y); }
}}
@@ -1505,12 +1513,12 @@ namespace container {
///@cond
-//Ummm, I don't like to define things in namespace std, but
+//Ummm, I don't like to define things in namespace std, but
//there is no other way
namespace std {
template <class T, class A>
-class insert_iterator<boost::container::slist<T, A> >
+class insert_iterator<boost::container::slist<T, A> >
{
protected:
typedef boost::container::slist<T, A> Container;
@@ -1524,14 +1532,14 @@ class insert_iterator<boost::container::slist<T, A> >
typedef void pointer;
typedef void reference;
- insert_iterator(Container& x,
- typename Container::iterator i,
- bool is_previous = false)
+ insert_iterator(Container& x,
+ typename Container::iterator i,
+ bool is_previous = false)
: container(&x), iter(is_previous ? i : x.previous(i)){ }
- insert_iterator<Container>&
- operator=(const typename Container::value_type& value)
- {
+ insert_iterator<Container>&
+ operator=(const typename Container::value_type& value)
+ {
iter = container->insert_after(iter, value);
return *this;
}
diff --git a/boost/container/stable_vector.hpp b/boost/container/stable_vector.hpp
index 851b5f26e8..d91eccd16e 100644
--- a/boost/container/stable_vector.hpp
+++ b/boost/container/stable_vector.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2008-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2008-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -34,7 +34,7 @@
#include <boost/container/detail/utilities.hpp>
#include <boost/container/detail/iterators.hpp>
#include <boost/container/detail/algorithms.hpp>
-#include <boost/container/allocator/allocator_traits.hpp>
+#include <boost/container/allocator_traits.hpp>
#include <boost/intrusive/pointer_traits.hpp>
#include <algorithm>
@@ -78,10 +78,6 @@ struct smart_ptr_type<T*>
{ return ptr;}
};
-template<class Ptr>
-inline typename smart_ptr_type<Ptr>::pointer to_raw_pointer(const Ptr &ptr)
-{ return smart_ptr_type<Ptr>::get(ptr); }
-
template <class C>
class clear_on_destroy
{
@@ -97,7 +93,7 @@ class clear_on_destroy
{
if(do_clear_){
c_.clear();
- c_.clear_pool();
+ c_.clear_pool();
}
}
@@ -110,13 +106,10 @@ class clear_on_destroy
template<class VoidPtr>
struct node_type_base
-{/*
- node_type_base(VoidPtr p)
- : up(p)
- {}*/
+{
node_type_base()
{}
- void set_pointer(VoidPtr p)
+ void set_pointer(const VoidPtr &p)
{ up = p; }
VoidPtr up;
@@ -126,33 +119,10 @@ template<typename VoidPointer, typename T>
struct node_type
: public node_type_base<VoidPointer>
{
- node_type()
- : value()
- {}
-
- #if defined(BOOST_CONTAINER_PERFECT_FORWARDING) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
-
- template<class ...Args>
- node_type(Args &&...args)
- : value(boost::forward<Args>(args)...)
- {}
-
- #else //BOOST_CONTAINER_PERFECT_FORWARDING
-
- #define BOOST_PP_LOCAL_MACRO(n) \
- BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \
- node_type(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \
- : value(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)) \
- {} \
- //!
- #define BOOST_PP_LOCAL_LIMITS (1, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS)
- #include BOOST_PP_LOCAL_ITERATE()
-
- #endif//BOOST_CONTAINER_PERFECT_FORWARDING
-
- void set_pointer(VoidPointer p)
- { node_type_base<VoidPointer>::set_pointer(p); }
+ private:
+ node_type();
+ public:
T value;
};
@@ -202,21 +172,21 @@ class iterator
iterator(const iterator<T, T&, typename boost::intrusive::pointer_traits<Pointer>::template rebind_pointer<T>::type>& x)
: pn(x.pn)
{}
-
+
private:
static node_type_ptr_t node_ptr_cast(const void_ptr &p)
{
- return node_type_ptr_t(static_cast<node_type_t*>(stable_vector_detail::to_raw_pointer(p)));
+ return node_type_ptr_t(static_cast<node_type_t*>(container_detail::to_raw_pointer(p)));
}
static const_node_type_ptr_t node_ptr_cast(const const_void_ptr &p)
{
- return const_node_type_ptr_t(static_cast<const node_type_t*>(stable_vector_detail::to_raw_pointer(p)));
+ return const_node_type_ptr_t(static_cast<const node_type_t*>(container_detail::to_raw_pointer(p)));
}
static void_ptr_ptr void_ptr_ptr_cast(const void_ptr &p)
{
- return void_ptr_ptr(static_cast<void_ptr*>(stable_vector_detail::to_raw_pointer(p)));
+ return void_ptr_ptr(static_cast<void_ptr*>(container_detail::to_raw_pointer(p)));
}
reference dereference() const
@@ -238,7 +208,7 @@ class iterator
pointer operator->() const { return pointer(&this->dereference()); }
//Increment / Decrement
- iterator& operator++()
+ iterator& operator++()
{ this->increment(); return *this; }
iterator operator++(int)
@@ -353,35 +323,37 @@ BOOST_JOIN(check_invariant_,__LINE__).touch();
/// @endcond
-//!Originally developed by Joaquin M. Lopez Munoz, stable_vector is std::vector
-//!drop-in replacement implemented as a node container, offering iterator and reference
-//!stability.
+//! Originally developed by Joaquin M. Lopez Munoz, stable_vector is std::vector
+//! drop-in replacement implemented as a node container, offering iterator and reference
+//! stability.
//!
-//!More details taken the author's blog: (<a href="http://bannalia.blogspot.com/2008/09/introducing-stablevector.html" > Introducing stable_vector</a>)
+//! More details taken the author's blog:
+//! (<a href="http://bannalia.blogspot.com/2008/09/introducing-stablevector.html" >
+//! Introducing stable_vector</a>)
//!
-//!We present stable_vector, a fully STL-compliant stable container that provides
-//!most of the features of std::vector except element contiguity.
+//! We present stable_vector, a fully STL-compliant stable container that provides
+//! most of the features of std::vector except element contiguity.
//!
-//!General properties: stable_vector satisfies all the requirements of a container,
-//!a reversible container and a sequence and provides all the optional operations
-//!present in std::vector. Like std::vector, iterators are random access.
-//!stable_vector does not provide element contiguity; in exchange for this absence,
-//!the container is stable, i.e. references and iterators to an element of a stable_vector
-//!remain valid as long as the element is not erased, and an iterator that has been
-//!assigned the return value of end() always remain valid until the destruction of
-//!the associated stable_vector.
+//! General properties: stable_vector satisfies all the requirements of a container,
+//! a reversible container and a sequence and provides all the optional operations
+//! present in std::vector. Like std::vector, iterators are random access.
+//! stable_vector does not provide element contiguity; in exchange for this absence,
+//! the container is stable, i.e. references and iterators to an element of a stable_vector
+//! remain valid as long as the element is not erased, and an iterator that has been
+//! assigned the return value of end() always remain valid until the destruction of
+//! the associated stable_vector.
//!
-//!Operation complexity: The big-O complexities of stable_vector operations match
-//!exactly those of std::vector. In general, insertion/deletion is constant time at
-//!the end of the sequence and linear elsewhere. Unlike std::vector, stable_vector
-//!does not internally perform any value_type destruction, copy or assignment
-//!operations other than those exactly corresponding to the insertion of new
-//!elements or deletion of stored elements, which can sometimes compensate in terms
-//!of performance for the extra burden of doing more pointer manipulation and an
-//!additional allocation per element.
+//! Operation complexity: The big-O complexities of stable_vector operations match
+//! exactly those of std::vector. In general, insertion/deletion is constant time at
+//! the end of the sequence and linear elsewhere. Unlike std::vector, stable_vector
+//! does not internally perform any value_type destruction, copy or assignment
+//! operations other than those exactly corresponding to the insertion of new
+//! elements or deletion of stored elements, which can sometimes compensate in terms
+//! of performance for the extra burden of doing more pointer manipulation and an
+//! additional allocation per element.
//!
-//!Exception safety: As stable_vector does not internally copy elements around, some
-//!operations provide stronger exception safety guarantees than in std::vector:
+//! Exception safety: As stable_vector does not internally copy elements around, some
+//! operations provide stronger exception safety guarantees than in std::vector:
#ifdef BOOST_CONTAINER_DOXYGEN_INVOKED
template <class T, class A = std::allocator<T> >
#else
@@ -426,7 +398,7 @@ class stable_vector
integral_constant<unsigned, 1> allocator_v1;
typedef ::boost::container::container_detail::
integral_constant<unsigned, 2> allocator_v2;
- typedef ::boost::container::container_detail::integral_constant
+ typedef ::boost::container::container_detail::integral_constant
<unsigned, boost::container::container_detail::
version<A>::value> alloc_version;
typedef typename allocator_traits_type::
@@ -509,9 +481,9 @@ class stable_vector
public:
//! <b>Effects</b>: Default constructs a stable_vector.
- //!
+ //!
//! <b>Throws</b>: If allocator_type's default constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Constant.
stable_vector()
: internal_data(), impl()
@@ -520,11 +492,11 @@ class stable_vector
}
//! <b>Effects</b>: Constructs a stable_vector taking the allocator as parameter.
- //!
+ //!
//! <b>Throws</b>: If allocator_type's copy constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- explicit stable_vector(const A& al)
+ explicit stable_vector(const allocator_type& al)
: internal_data(al),impl(al)
{
STABLE_VECTOR_CHECK_INVARIANT;
@@ -535,10 +507,10 @@ class stable_vector
//!
//! <b>Throws</b>: If allocator_type's default constructor or copy constructor
//! throws or T's default or copy constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Linear to n.
explicit stable_vector(size_type n)
- : internal_data(A()),impl(A())
+ : internal_data(),impl()
{
stable_vector_detail::clear_on_destroy<stable_vector> cod(*this);
this->resize(n);
@@ -551,9 +523,9 @@ class stable_vector
//!
//! <b>Throws</b>: If allocator_type's default constructor or copy constructor
//! throws or T's default or copy constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Linear to n.
- stable_vector(size_type n, const T& t, const A& al=A())
+ stable_vector(size_type n, const T& t, const allocator_type& al = allocator_type())
: internal_data(al),impl(al)
{
stable_vector_detail::clear_on_destroy<stable_vector> cod(*this);
@@ -570,7 +542,7 @@ class stable_vector
//!
//! <b>Complexity</b>: Linear to the range [first, last).
template <class InputIterator>
- stable_vector(InputIterator first,InputIterator last,const A& al=A())
+ stable_vector(InputIterator first,InputIterator last, const allocator_type& al = allocator_type())
: internal_data(al),impl(al)
{
stable_vector_detail::clear_on_destroy<stable_vector> cod(*this);
@@ -582,7 +554,7 @@ class stable_vector
//! <b>Effects</b>: Copy constructs a stable_vector.
//!
//! <b>Postcondition</b>: x == *this.
- //!
+ //!
//! <b>Complexity</b>: Linear to the elements x contains.
stable_vector(const stable_vector& x)
: internal_data(allocator_traits<node_allocator_type>::
@@ -599,7 +571,7 @@ class stable_vector
//! <b>Effects</b>: Move constructor. Moves mx's resources to *this.
//!
//! <b>Throws</b>: If allocator_type's copy constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Constant.
stable_vector(BOOST_RV_REF(stable_vector) x)
: internal_data(boost::move(x.node_alloc())), impl(boost::move(x.impl))
@@ -607,6 +579,40 @@ class stable_vector
this->priv_swap_members(x);
}
+ //! <b>Effects</b>: Copy constructs a stable_vector using the specified allocator.
+ //!
+ //! <b>Postcondition</b>: x == *this.
+ //!
+ //! <b>Complexity</b>: Linear to the elements x contains.
+ stable_vector(const stable_vector& x, const allocator_type &a)
+ : internal_data(a), impl(a)
+ {
+ stable_vector_detail::clear_on_destroy<stable_vector> cod(*this);
+ this->insert(this->cbegin(), x.begin(), x.end());
+ STABLE_VECTOR_CHECK_INVARIANT;
+ cod.release();
+ }
+
+ //! <b>Effects</b>: Move constructor using the specified allocator.
+ //! Moves mx's resources to *this.
+ //!
+ //! <b>Throws</b>: If allocator_type's copy constructor throws.
+ //!
+ //! <b>Complexity</b>: Constant if a == x.get_allocator(), linear otherwise
+ stable_vector(BOOST_RV_REF(stable_vector) x, const allocator_type &a)
+ : internal_data(a), impl(a)
+ {
+ if(this->node_alloc() == x.node_alloc()){
+ this->priv_swap_members(x);
+ }
+ else{
+ stable_vector_detail::clear_on_destroy<stable_vector> cod(*this);
+ this->insert(this->cbegin(), x.begin(), x.end());
+ STABLE_VECTOR_CHECK_INVARIANT;
+ cod.release();
+ }
+ }
+
//! <b>Effects</b>: Destroys the stable_vector. All stored values are destroyed
//! and used memory is deallocated.
//!
@@ -616,13 +622,13 @@ class stable_vector
~stable_vector()
{
this->clear();
- clear_pool();
+ clear_pool();
}
//! <b>Effects</b>: Makes *this contain the same elements as x.
//!
- //! <b>Postcondition</b>: this->size() == x.size(). *this contains a copy
- //! of each of x's elements.
+ //! <b>Postcondition</b>: this->size() == x.size(). *this contains a copy
+ //! of each of x's elements.
//!
//! <b>Throws</b>: If memory allocation throws or T's copy constructor throws.
//!
@@ -705,146 +711,146 @@ class stable_vector
}
//! <b>Effects</b>: Returns a copy of the internal allocator.
- //!
+ //!
//! <b>Throws</b>: If allocator's copy constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- allocator_type get_allocator()const {return node_alloc();}
+ allocator_type get_allocator()const {return this->node_alloc();}
//! <b>Effects</b>: Returns a reference to the internal allocator.
- //!
+ //!
//! <b>Throws</b>: Nothing
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Non-standard extension.
const stored_allocator_type &get_stored_allocator() const BOOST_CONTAINER_NOEXCEPT
{ return node_alloc(); }
//! <b>Effects</b>: Returns a reference to the internal allocator.
- //!
+ //!
//! <b>Throws</b>: Nothing
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Non-standard extension.
stored_allocator_type &get_stored_allocator() BOOST_CONTAINER_NOEXCEPT
{ return node_alloc(); }
//! <b>Effects</b>: Returns an iterator to the first element contained in the stable_vector.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
iterator begin()
{ return (impl.empty()) ? end(): iterator(node_ptr_cast(impl.front())) ; }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the stable_vector.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_iterator begin()const
{ return (impl.empty()) ? cend() : const_iterator(node_ptr_cast(impl.front())) ; }
//! <b>Effects</b>: Returns an iterator to the end of the stable_vector.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
iterator end() {return iterator(get_end_node());}
//! <b>Effects</b>: Returns a const_iterator to the end of the stable_vector.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_iterator end()const {return const_iterator(get_end_node());}
- //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
- //! of the reversed stable_vector.
- //!
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
+ //! of the reversed stable_vector.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
reverse_iterator rbegin() {return reverse_iterator(this->end());}
- //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
- //! of the reversed stable_vector.
- //!
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed stable_vector.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_reverse_iterator rbegin()const {return const_reverse_iterator(this->end());}
//! <b>Effects</b>: Returns a reverse_iterator pointing to the end
- //! of the reversed stable_vector.
- //!
+ //! of the reversed stable_vector.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
reverse_iterator rend() {return reverse_iterator(this->begin());}
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
- //! of the reversed stable_vector.
- //!
+ //! of the reversed stable_vector.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_reverse_iterator rend()const {return const_reverse_iterator(this->begin());}
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the stable_vector.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_iterator cbegin()const {return this->begin();}
//! <b>Effects</b>: Returns a const_iterator to the end of the stable_vector.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_iterator cend()const {return this->end();}
- //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
- //! of the reversed stable_vector.
- //!
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed stable_vector.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_reverse_iterator crbegin()const{return this->rbegin();}
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
- //! of the reversed stable_vector.
- //!
+ //! of the reversed stable_vector.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_reverse_iterator crend()const {return this->rend();}
//! <b>Effects</b>: Returns the number of the elements contained in the stable_vector.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
size_type size() const
{ return impl.empty() ? 0 : (impl.size() - ExtraPointers); }
//! <b>Effects</b>: Returns the largest possible size of the stable_vector.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
size_type max_size() const
{ return impl.max_size() - ExtraPointers; }
//! <b>Effects</b>: Number of elements for which memory has been allocated.
//! capacity() is always greater than or equal to size().
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
size_type capacity() const
{
@@ -859,9 +865,9 @@ class stable_vector
}
//! <b>Effects</b>: Returns true if the stable_vector contains no elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
bool empty() const
{ return impl.empty() || impl.size() == ExtraPointers; }
@@ -901,7 +907,7 @@ class stable_vector
//! effect. Otherwise, it is a request for allocation of additional memory.
//! If the request is successful, then capacity() is greater than or equal to
//! n; otherwise, capacity() is unchanged. In either case, size() is unchanged.
- //!
+ //!
//! <b>Throws</b>: If memory allocation allocation throws.
void reserve(size_type n)
{
@@ -909,7 +915,7 @@ class stable_vector
if(n > this->max_size())
throw std::bad_alloc();
- size_type size = this->size();
+ size_type size = this->size();
size_type old_capacity = this->capacity();
if(n > old_capacity){
this->initialize_end_node(n);
@@ -929,31 +935,31 @@ class stable_vector
//! <b>Requires</b>: size() > n.
//!
- //! <b>Effects</b>: Returns a reference to the nth element
+ //! <b>Effects</b>: Returns a reference to the nth element
//! from the beginning of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
reference operator[](size_type n){return value(impl[n]);}
//! <b>Requires</b>: size() > n.
//!
- //! <b>Effects</b>: Returns a const reference to the nth element
+ //! <b>Effects</b>: Returns a const reference to the nth element
//! from the beginning of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_reference operator[](size_type n)const{return value(impl[n]);}
//! <b>Requires</b>: size() > n.
//!
- //! <b>Effects</b>: Returns a reference to the nth element
+ //! <b>Effects</b>: Returns a reference to the nth element
//! from the beginning of the container.
- //!
+ //!
//! <b>Throws</b>: std::range_error if n >= size()
- //!
+ //!
//! <b>Complexity</b>: Constant.
reference at(size_type n)
{
@@ -964,11 +970,11 @@ class stable_vector
//! <b>Requires</b>: size() > n.
//!
- //! <b>Effects</b>: Returns a const reference to the nth element
+ //! <b>Effects</b>: Returns a const reference to the nth element
//! from the beginning of the container.
- //!
+ //!
//! <b>Throws</b>: std::range_error if n >= size()
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_reference at(size_type n)const
{
@@ -981,9 +987,9 @@ class stable_vector
//!
//! <b>Effects</b>: Returns a reference to the first
//! element of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
reference front()
{ return value(impl.front()); }
@@ -992,9 +998,9 @@ class stable_vector
//!
//! <b>Effects</b>: Returns a const reference to the first
//! element of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_reference front()const
{ return value(impl.front()); }
@@ -1003,9 +1009,9 @@ class stable_vector
//!
//! <b>Effects</b>: Returns a reference to the last
//! element of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
reference back()
{ return value(*(&impl.back() - ExtraPointers)); }
@@ -1014,9 +1020,9 @@ class stable_vector
//!
//! <b>Effects</b>: Returns a const reference to the last
//! element of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_reference back()const
{ return value(*(&impl.back() - ExtraPointers)); }
@@ -1027,7 +1033,7 @@ class stable_vector
//! T's copy constructor throws.
//!
//! <b>Complexity</b>: Amortized constant time.
- void push_back(insert_const_ref_type x)
+ void push_back(insert_const_ref_type x)
{ return priv_push_back(x); }
#if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
@@ -1045,7 +1051,7 @@ class stable_vector
//! <b>Throws</b>: If memory allocation throws.
//!
//! <b>Complexity</b>: Amortized constant time.
- void push_back(BOOST_RV_REF(T) t)
+ void push_back(BOOST_RV_REF(T) t)
{ this->insert(end(), boost::move(t)); }
//! <b>Effects</b>: Removes the last element from the stable_vector.
@@ -1064,7 +1070,7 @@ class stable_vector
//!
//! <b>Complexity</b>: If position is end(), amortized constant time
//! Linear time otherwise.
- iterator insert(const_iterator position, insert_const_ref_type x)
+ iterator insert(const_iterator position, insert_const_ref_type x)
{ return this->priv_insert(position, x); }
#if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
@@ -1084,7 +1090,7 @@ class stable_vector
//!
//! <b>Complexity</b>: If position is end(), amortized constant time
//! Linear time otherwise.
- iterator insert(const_iterator position, BOOST_RV_REF(T) x)
+ iterator insert(const_iterator position, BOOST_RV_REF(T) x)
{
typedef repeat_iterator<T, difference_type> repeat_it;
typedef boost::move_iterator<repeat_it> repeat_move_it;
@@ -1137,7 +1143,7 @@ class stable_vector
void emplace_back(Args &&...args)
{
typedef emplace_functor<Args...> EmplaceFunctor;
- typedef emplace_iterator<node_type_t, EmplaceFunctor, difference_type> EmplaceIterator;
+ typedef emplace_iterator<value_type, EmplaceFunctor, difference_type> EmplaceIterator;
EmplaceFunctor &&ef = EmplaceFunctor(boost::forward<Args>(args)...);
this->insert(this->cend(), EmplaceIterator(ef), EmplaceIterator());
}
@@ -1157,7 +1163,7 @@ class stable_vector
//Just call more general insert(pos, size, value) and return iterator
size_type pos_n = position - cbegin();
typedef emplace_functor<Args...> EmplaceFunctor;
- typedef emplace_iterator<node_type_t, EmplaceFunctor, difference_type> EmplaceIterator;
+ typedef emplace_iterator<value_type, EmplaceFunctor, difference_type> EmplaceIterator;
EmplaceFunctor &&ef = EmplaceFunctor(boost::forward<Args>(args)...);
this->insert(position, EmplaceIterator(ef), EmplaceIterator());
return iterator(this->begin() + pos_n);
@@ -1172,7 +1178,7 @@ class stable_vector
typedef BOOST_PP_CAT(BOOST_PP_CAT(emplace_functor, n), arg) \
BOOST_PP_EXPR_IF(n, <) BOOST_PP_ENUM_PARAMS(n, P) BOOST_PP_EXPR_IF(n, >) \
EmplaceFunctor; \
- typedef emplace_iterator<node_type_t, EmplaceFunctor, difference_type> EmplaceIterator; \
+ typedef emplace_iterator<value_type, EmplaceFunctor, difference_type> EmplaceIterator; \
EmplaceFunctor ef BOOST_PP_LPAREN_IF(n) \
BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _) \
BOOST_PP_RPAREN_IF(n); \
@@ -1186,7 +1192,7 @@ class stable_vector
typedef BOOST_PP_CAT(BOOST_PP_CAT(emplace_functor, n), arg) \
BOOST_PP_EXPR_IF(n, <) BOOST_PP_ENUM_PARAMS(n, P) BOOST_PP_EXPR_IF(n, >) \
EmplaceFunctor; \
- typedef emplace_iterator<node_type_t, EmplaceFunctor, difference_type> EmplaceIterator; \
+ typedef emplace_iterator<value_type, EmplaceFunctor, difference_type> EmplaceIterator; \
EmplaceFunctor ef BOOST_PP_LPAREN_IF(n) \
BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _) \
BOOST_PP_RPAREN_IF(n); \
@@ -1204,7 +1210,7 @@ class stable_vector
//!
//! <b>Throws</b>: Nothing.
//!
- //! <b>Complexity</b>: Linear to the elements between pos and the
+ //! <b>Complexity</b>: Linear to the elements between pos and the
//! last element. Constant if pos is the last element.
iterator erase(const_iterator position)
{
@@ -1482,12 +1488,12 @@ class stable_vector
static node_type_ptr_t node_ptr_cast(const void_ptr &p)
{
- return node_type_ptr_t(static_cast<node_type_t*>(stable_vector_detail::to_raw_pointer(p)));
+ return node_type_ptr_t(static_cast<node_type_t*>(container_detail::to_raw_pointer(p)));
}
static node_type_base_ptr_t node_base_ptr_cast(const void_ptr &p)
{
- return node_type_base_ptr_t(static_cast<node_type_base_t*>(stable_vector_detail::to_raw_pointer(p)));
+ return node_type_base_ptr_t(static_cast<node_type_base_t*>(container_detail::to_raw_pointer(p)));
}
static value_type& value(const void_ptr &p)
@@ -1529,7 +1535,9 @@ class stable_vector
{
node_type_ptr_t p = this->allocate_one();
try{
- boost::container::construct_in_place(this->node_alloc(), &*p, it);
+ boost::container::construct_in_place(this->node_alloc(), container_detail::addressof(p->value), it);
+ //This does not throw
+ ::new(static_cast<node_type_base_t*>(container_detail::to_raw_pointer(p))) node_type_base_t;
p->set_pointer(up);
}
catch(...){
@@ -1573,7 +1581,7 @@ class stable_vector
{
for(; first!=last; ++first){
this->insert(position, *first);
- }
+ }
}
template <class InputIterator>
@@ -1621,7 +1629,9 @@ class stable_vector
p = mem.front();
mem.pop_front();
//This can throw
- boost::container::construct_in_place(this->node_alloc(), &*p, first);
+ boost::container::construct_in_place(this->node_alloc(), container_detail::addressof(p->value), first);
+ //This does not throw
+ ::new(static_cast<node_type_base_t*>(container_detail::to_raw_pointer(p))) node_type_base_t;
p->set_pointer(void_ptr_ptr(&it[i]));
++first;
it[i] = p;
@@ -1650,7 +1660,9 @@ class stable_vector
break;
}
//This can throw
- boost::container::construct_in_place(this->node_alloc(), &*p, first);
+ boost::container::construct_in_place(this->node_alloc(), container_detail::addressof(p->value), first);
+ //This does not throw
+ ::new(static_cast<node_type_base_t*>(container_detail::to_raw_pointer(p))) node_type_base_t;
p->set_pointer(void_ptr_ptr(&it[i]));
++first;
it[i]=p;
@@ -1680,7 +1692,7 @@ class stable_vector
return false;
}
for(const_impl_iterator it = impl.begin(), it_end = get_last_align(); it != it_end; ++it){
- if(const_void_ptr(node_ptr_cast(*it)->up) !=
+ if(const_void_ptr(node_ptr_cast(*it)->up) !=
const_void_ptr(const_void_ptr_ptr(&*it)))
return false;
}
diff --git a/boost/container/string.hpp b/boost/container/string.hpp
index 3a9c55a3c4..2a64cec428 100644
--- a/boost/container/string.hpp
+++ b/boost/container/string.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -43,15 +43,16 @@
#include <boost/container/detail/algorithms.hpp>
#include <boost/container/detail/version_type.hpp>
#include <boost/container/detail/allocation_type.hpp>
-#include <boost/container/allocator/allocator_traits.hpp>
+#include <boost/container/allocator_traits.hpp>
#include <boost/container/detail/mpl.hpp>
#include <boost/move/move.hpp>
#include <boost/static_assert.hpp>
+#include <boost/functional/hash.hpp>
#include <functional>
#include <string>
-#include <stdexcept>
-#include <utility>
+#include <stdexcept>
+#include <utility>
#include <iterator>
#include <memory>
#include <algorithm>
@@ -78,14 +79,14 @@ namespace container {
/// @cond
namespace container_detail {
// ------------------------------------------------------------
-// Class basic_string_base.
+// Class basic_string_base.
// basic_string_base is a helper class that makes it it easier to write
// an exception-safe version of basic_string. The constructor allocates,
// but does not initialize, a block of memory. The destructor
// deallocates, but does not destroy elements within, a block of
-// memory. The destructor assumes that the memory either is the internal buffer,
-// or else points to a block of memory that was allocated using _String_base's
+// memory. The destructor assumes that the memory either is the internal buffer,
+// or else points to a block of memory that was allocated using _String_base's
// allocator and whose size is this->m_storage.
template <class A>
class basic_string_base
@@ -111,22 +112,22 @@ class basic_string_base
basic_string_base(const allocator_type& a, size_type n)
: members_(a)
- {
- this->init();
+ {
+ this->init();
this->allocate_initial_block(n);
}
basic_string_base(BOOST_RV_REF(basic_string_base) b)
: members_(boost::move(b.alloc()))
- {
+ {
this->init();
- this->swap_data(b);
+ this->swap_data(b);
}
- ~basic_string_base()
- {
+ ~basic_string_base()
+ {
if(!this->is_short()){
- this->deallocate_block();
+ this->deallocate_block();
allocator_traits_type::destroy
( this->alloc()
, static_cast<long_t*>(static_cast<void*>(&this->members_.m_repr.r))
@@ -136,7 +137,7 @@ class basic_string_base
private:
- //This is the structure controlling a long string
+ //This is the structure controlling a long string
struct long_t
{
size_type is_short : 1;
@@ -175,8 +176,8 @@ class basic_string_base
//This type has the same alignment and size as long_t but it's POD
//so, unlike long_t, it can be placed in a union
-
- typedef typename boost::aligned_storage< sizeof(long_t),
+
+ typedef typename boost::aligned_storage< sizeof(long_t),
container_detail::alignment_of<long_t>::value>::type long_raw_t;
protected:
@@ -187,13 +188,13 @@ class basic_string_base
container_detail::ct_rounded_size<sizeof(short_header), AlignmentOfValueType>::value;
static const size_type ZeroCostInternalBufferChars =
(sizeof(long_t) - ShortDataOffset)/sizeof(value_type);
- static const size_type UnalignedFinalInternalBufferChars =
+ static const size_type UnalignedFinalInternalBufferChars =
(ZeroCostInternalBufferChars > MinInternalBufferChars) ?
ZeroCostInternalBufferChars : MinInternalBufferChars;
struct short_t
{
- short_header h;
+ short_header h;
value_type data[UnalignedFinalInternalBufferChars];
};
@@ -241,7 +242,7 @@ class basic_string_base
{ return static_cast<bool>(this->members_.m_repr.s.h.is_short != 0); }
void is_short(bool yes)
- {
+ {
if(yes && !this->is_short()){
allocator_traits_type::destroy
( this->alloc()
@@ -273,7 +274,7 @@ class basic_string_base
std::pair<pointer, bool>
allocation_command(allocation_type command,
- size_type limit_size,
+ size_type limit_size,
size_type preferred_size,
size_type &received_size, pointer reuse = 0)
{
@@ -287,7 +288,7 @@ class basic_string_base
std::pair<pointer, bool>
allocation_command(allocation_type command,
- size_type limit_size,
+ size_type limit_size,
size_type preferred_size,
size_type &received_size,
const pointer &reuse,
@@ -303,21 +304,21 @@ class basic_string_base
std::pair<pointer, bool>
allocation_command(allocation_type command,
- size_type limit_size,
+ size_type limit_size,
size_type preferred_size,
size_type &received_size,
pointer reuse,
allocator_v2)
{
- return this->alloc().allocation_command(command, limit_size, preferred_size,
+ return this->alloc().allocation_command(command, limit_size, preferred_size,
received_size, reuse);
}
size_type next_capacity(size_type additional_objects) const
{ return get_next_capacity(allocator_traits_type::max_size(this->alloc()), this->priv_storage(), additional_objects); }
- void deallocate(pointer p, size_type n)
- {
+ void deallocate(pointer p, size_type n)
+ {
if (p && (n > InternalBufferChars))
this->alloc().deallocate(p, n);
}
@@ -365,9 +366,9 @@ class basic_string_base
throw_length_error();
}
- void deallocate_block()
+ void deallocate_block()
{ this->deallocate(this->priv_addr(), this->priv_storage()); }
-
+
size_type max_size() const
{ return allocator_traits_type::max_size(this->alloc()) - 1; }
@@ -404,13 +405,13 @@ class basic_string_base
{ return this->members_.m_repr.long_repr().storage; }
void priv_storage(size_type storage)
- {
+ {
if(!this->is_short())
this->priv_long_storage(storage);
}
void priv_long_storage(size_type storage)
- {
+ {
this->members_.m_repr.long_repr().storage = storage;
}
@@ -424,7 +425,7 @@ class basic_string_base
{ return this->members_.m_repr.long_repr().length; }
void priv_size(size_type sz)
- {
+ {
if(this->is_short())
this->priv_short_size(sz);
else
@@ -432,12 +433,12 @@ class basic_string_base
}
void priv_short_size(size_type sz)
- {
+ {
this->members_.m_repr.s.h.length = (unsigned char)sz;
}
void priv_long_size(size_type sz)
- {
+ {
this->members_.m_repr.long_repr().length = static_cast<typename allocator_traits_type::size_type>(sz);
}
@@ -470,41 +471,41 @@ class basic_string_base
/// @endcond
-//! The basic_string class represents a Sequence of characters. It contains all the
-//! usual operations of a Sequence, and, additionally, it contains standard string
+//! The basic_string class represents a Sequence of characters. It contains all the
+//! usual operations of a Sequence, and, additionally, it contains standard string
//! operations such as search and concatenation.
//!
-//! The basic_string class is parameterized by character type, and by that type's
+//! The basic_string class is parameterized by character type, and by that type's
//! Character Traits.
-//!
-//! This class has performance characteristics very much like vector<>, meaning,
+//!
+//! This class has performance characteristics very much like vector<>, meaning,
//! for example, that it does not perform reference-count or copy-on-write, and that
-//! concatenation of two strings is an O(N) operation.
-//!
-//! Some of basic_string's member functions use an unusual method of specifying positions
-//! and ranges. In addition to the conventional method using iterators, many of
-//! basic_string's member functions use a single value pos of type size_type to represent a
-//! position (in which case the position is begin() + pos, and many of basic_string's
-//! member functions use two values, pos and n, to represent a range. In that case pos is
-//! the beginning of the range and n is its size. That is, the range is
-//! [begin() + pos, begin() + pos + n).
-//!
-//! Note that the C++ standard does not specify the complexity of basic_string operations.
-//! In this implementation, basic_string has performance characteristics very similar to
-//! those of vector: access to a single character is O(1), while copy and concatenation
+//! concatenation of two strings is an O(N) operation.
+//!
+//! Some of basic_string's member functions use an unusual method of specifying positions
+//! and ranges. In addition to the conventional method using iterators, many of
+//! basic_string's member functions use a single value pos of type size_type to represent a
+//! position (in which case the position is begin() + pos, and many of basic_string's
+//! member functions use two values, pos and n, to represent a range. In that case pos is
+//! the beginning of the range and n is its size. That is, the range is
+//! [begin() + pos, begin() + pos + n).
+//!
+//! Note that the C++ standard does not specify the complexity of basic_string operations.
+//! In this implementation, basic_string has performance characteristics very similar to
+//! those of vector: access to a single character is O(1), while copy and concatenation
//! are O(N).
-//!
-//! In this implementation, begin(),
+//!
+//! In this implementation, begin(),
//! end(), rbegin(), rend(), operator[], c_str(), and data() do not invalidate iterators.
//! In this implementation, iterators are only invalidated by member functions that
-//! explicitly change the string's contents.
+//! explicitly change the string's contents.
#ifdef BOOST_CONTAINER_DOXYGEN_INVOKED
template <class CharT, class Traits = std::char_traits<CharT>, class A = std::allocator<CharT> >
#else
template <class CharT, class Traits, class A>
#endif
class basic_string
- : private container_detail::basic_string_base<A>
+ : private container_detail::basic_string_base<A>
{
/// @cond
private:
@@ -535,12 +536,12 @@ class basic_string
const Pointer m_first;
const Pointer m_last;
- Not_within_traits(Pointer f, Pointer l)
+ Not_within_traits(Pointer f, Pointer l)
: m_first(f), m_last(l) {}
- bool operator()(const typename Tr::char_type& x) const
+ bool operator()(const typename Tr::char_type& x) const
{
- return std::find_if(m_first, m_last,
+ return std::find_if(m_first, m_last,
std::bind1st(Eq_traits<Tr>(), x)) == m_last;
}
};
@@ -558,11 +559,11 @@ class basic_string
typedef Traits traits_type;
//! Pointer to CharT
typedef typename allocator_traits_type::pointer pointer;
- //! Const pointer to CharT
+ //! Const pointer to CharT
typedef typename allocator_traits_type::const_pointer const_pointer;
- //! Reference to CharT
+ //! Reference to CharT
typedef typename allocator_traits_type::reference reference;
- //! Const reference to CharT
+ //! Const reference to CharT
typedef typename allocator_traits_type::const_reference const_reference;
//! An unsigned integral type
typedef typename allocator_traits_type::size_type size_type;
@@ -576,7 +577,7 @@ class basic_string
typedef std::reverse_iterator<iterator> reverse_iterator;
//! Const iterator used to iterate backwards through a string
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
- //! The largest possible value of type size_type. That is, size_type(-1).
+ //! The largest possible value of type size_type. That is, size_type(-1).
static const size_type npos;
/// @cond
@@ -602,7 +603,7 @@ class basic_string
/// @endcond
//! <b>Effects</b>: Default constructs a basic_string.
- //!
+ //!
//! <b>Throws</b>: If allocator_type's default constructor throws.
basic_string()
: base_t()
@@ -610,7 +611,7 @@ class basic_string
//! <b>Effects</b>: Constructs a basic_string taking the allocator as parameter.
- //!
+ //!
//! <b>Throws</b>: If allocator_type's copy constructor throws.
explicit basic_string(const allocator_type& a)
: base_t(a)
@@ -619,26 +620,52 @@ class basic_string
//! <b>Effects</b>: Copy constructs a basic_string.
//!
//! <b>Postcondition</b>: x == *this.
- //!
- //! <b>Throws</b>: If allocator_type's default constructor or copy constructor throws.
- basic_string(const basic_string& s)
+ //!
+ //! <b>Throws</b>: If allocator_type's default constructor throws.
+ basic_string(const basic_string& s)
: base_t(allocator_traits_type::select_on_container_copy_construction(s.alloc()))
{ this->priv_range_initialize(s.begin(), s.end()); }
- //! <b>Effects</b>: Move constructor. Moves mx's resources to *this.
+ //! <b>Effects</b>: Move constructor. Moves s's resources to *this.
//!
//! <b>Throws</b>: If allocator_type's copy constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- basic_string(BOOST_RV_REF(basic_string) s)
+ basic_string(BOOST_RV_REF(basic_string) s)
: base_t(boost::move((base_t&)s))
{}
+ //! <b>Effects</b>: Copy constructs a basic_string using the specified allocator.
+ //!
+ //! <b>Postcondition</b>: x == *this.
+ //!
+ //! <b>Throws</b>: If allocation throws.
+ basic_string(const basic_string& s, const allocator_type &a)
+ : base_t(a)
+ { this->priv_range_initialize(s.begin(), s.end()); }
+
+ //! <b>Effects</b>: Move constructor using the specified allocator.
+ //! Moves s's resources to *this.
+ //!
+ //! <b>Throws</b>: If allocation throws.
+ //!
+ //! <b>Complexity</b>: Constant if a == s.get_allocator(), linear otherwise.
+ basic_string(BOOST_RV_REF(basic_string) s, const allocator_type &a)
+ : base_t(a)
+ {
+ if(a == this->alloc()){
+ this->swap_data(s);
+ }
+ else{
+ this->priv_range_initialize(s.begin(), s.end());
+ }
+ }
+
//! <b>Effects</b>: Constructs a basic_string taking the allocator as parameter,
- //! and is initialized by a specific number of characters of the s string.
+ //! and is initialized by a specific number of characters of the s string.
basic_string(const basic_string& s, size_type pos, size_type n = npos,
- const allocator_type& a = allocator_type())
- : base_t(a)
+ const allocator_type& a = allocator_type())
+ : base_t(a)
{
if (pos > s.size())
this->throw_out_of_range();
@@ -650,15 +677,15 @@ class basic_string
//! <b>Effects</b>: Constructs a basic_string taking the allocator as parameter,
//! and is initialized by a specific number of characters of the s c-string.
basic_string(const CharT* s, size_type n,
- const allocator_type& a = allocator_type())
- : base_t(a)
+ const allocator_type& a = allocator_type())
+ : base_t(a)
{ this->priv_range_initialize(s, s + n); }
//! <b>Effects</b>: Constructs a basic_string taking the allocator as parameter,
//! and is initialized by the null-terminated s c-string.
basic_string(const CharT* s,
const allocator_type& a = allocator_type())
- : base_t(a)
+ : base_t(a)
{ this->priv_range_initialize(s, s + Traits::length(s)); }
//! <b>Effects</b>: Constructs a basic_string taking the allocator as parameter,
@@ -666,7 +693,7 @@ class basic_string
basic_string(size_type n, CharT c,
const allocator_type& a = allocator_type())
: base_t(a)
- {
+ {
this->priv_range_initialize(cvalue_iterator(c, n),
cvalue_iterator());
}
@@ -689,13 +716,13 @@ class basic_string
//! <b>Throws</b>: Nothing.
//!
//! <b>Complexity</b>: Constant.
- ~basic_string()
+ ~basic_string()
{}
-
+
//! <b>Effects</b>: Copy constructs a string.
//!
//! <b>Postcondition</b>: x == *this.
- //!
+ //!
//! <b>Complexity</b>: Linear to the elements x contains.
basic_string& operator=(BOOST_COPY_ASSIGN_REF(basic_string) x)
{
@@ -721,7 +748,7 @@ class basic_string
//! <b>Effects</b>: Move constructor. Moves mx's resources to *this.
//!
//! <b>Throws</b>: If allocator_type's copy constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Constant.
basic_string& operator=(BOOST_RV_REF(basic_string) x)
{
@@ -747,7 +774,7 @@ class basic_string
}
//! <b>Effects</b>: Assignment from a null-terminated c-string.
- basic_string& operator=(const CharT* s)
+ basic_string& operator=(const CharT* s)
{ return this->assign(s, s + Traits::length(s)); }
//! <b>Effects</b>: Assignment from character.
@@ -755,155 +782,155 @@ class basic_string
{ return this->assign(static_cast<size_type>(1), c); }
//! <b>Effects</b>: Returns an iterator to the first element contained in the vector.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
iterator begin()
{ return this->priv_addr(); }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the vector.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_iterator begin() const
{ return this->priv_addr(); }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the vector.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_iterator cbegin() const
{ return this->priv_addr(); }
//! <b>Effects</b>: Returns an iterator to the end of the vector.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
iterator end()
{ return this->priv_addr() + this->priv_size(); }
//! <b>Effects</b>: Returns a const_iterator to the end of the vector.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator end() const
- { return this->priv_addr() + this->priv_size(); }
+ const_iterator end() const
+ { return this->priv_addr() + this->priv_size(); }
//! <b>Effects</b>: Returns a const_iterator to the end of the vector.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator cend() const
- { return this->priv_addr() + this->priv_size(); }
+ const_iterator cend() const
+ { return this->priv_addr() + this->priv_size(); }
- //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
- //! of the reversed vector.
- //!
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
+ //! of the reversed vector.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- reverse_iterator rbegin()
+ reverse_iterator rbegin()
{ return reverse_iterator(this->priv_addr() + this->priv_size()); }
- //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
- //! of the reversed vector.
- //!
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed vector.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator rbegin() const
+ const_reverse_iterator rbegin() const
{ return this->crbegin(); }
- //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
- //! of the reversed vector.
- //!
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed vector.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator crbegin() const
+ const_reverse_iterator crbegin() const
{ return const_reverse_iterator(this->priv_addr() + this->priv_size()); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the end
- //! of the reversed vector.
- //!
+ //! of the reversed vector.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- reverse_iterator rend()
+ reverse_iterator rend()
{ return reverse_iterator(this->priv_addr()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
- //! of the reversed vector.
- //!
+ //! of the reversed vector.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator rend() const
+ const_reverse_iterator rend() const
{ return this->crend(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
- //! of the reversed vector.
- //!
+ //! of the reversed vector.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator crend() const
+ const_reverse_iterator crend() const
{ return const_reverse_iterator(this->priv_addr()); }
//! <b>Effects</b>: Returns a copy of the internal allocator.
- //!
+ //!
//! <b>Throws</b>: If allocator's copy constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- allocator_type get_allocator() const
+ allocator_type get_allocator() const
{ return this->alloc(); }
//! <b>Effects</b>: Returns a reference to the internal allocator.
- //!
+ //!
//! <b>Throws</b>: Nothing
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Non-standard extension.
const stored_allocator_type &get_stored_allocator() const BOOST_CONTAINER_NOEXCEPT
{ return this->alloc(); }
//! <b>Effects</b>: Returns a reference to the internal allocator.
- //!
+ //!
//! <b>Throws</b>: Nothing
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Non-standard extension.
stored_allocator_type &get_stored_allocator() BOOST_CONTAINER_NOEXCEPT
{ return this->alloc(); }
//! <b>Effects</b>: Returns the number of the elements contained in the vector.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- size_type size() const
+ size_type size() const
{ return this->priv_size(); }
//! <b>Effects</b>: Returns the number of the elements contained in the vector.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
size_type length() const
{ return this->size(); }
//! <b>Effects</b>: Returns the largest possible size of the vector.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
size_type max_size() const
{ return base_t::max_size(); }
@@ -935,7 +962,7 @@ class basic_string
//! effect. Otherwise, it is a request for allocation of additional memory.
//! If the request is successful, then capacity() is greater than or equal to
//! n; otherwise, capacity() is unchanged. In either case, size() is unchanged.
- //!
+ //!
//! <b>Throws</b>: If memory allocation allocation throws
void reserve(size_type res_arg)
{
@@ -962,9 +989,9 @@ class basic_string
//! <b>Effects</b>: Number of elements for which memory has been allocated.
//! capacity() is always greater than or equal to size().
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
size_type capacity() const
{ return this->priv_capacity(); }
@@ -1014,42 +1041,42 @@ class basic_string
}
//! <b>Effects</b>: Returns true if the vector contains no elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
bool empty() const
{ return !this->priv_size(); }
//! <b>Requires</b>: size() > n.
//!
- //! <b>Effects</b>: Returns a reference to the nth element
+ //! <b>Effects</b>: Returns a reference to the nth element
//! from the beginning of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
reference operator[](size_type n)
{ return *(this->priv_addr() + n); }
//! <b>Requires</b>: size() > n.
//!
- //! <b>Effects</b>: Returns a const reference to the nth element
+ //! <b>Effects</b>: Returns a const reference to the nth element
//! from the beginning of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_reference operator[](size_type n) const
{ return *(this->priv_addr() + n); }
//! <b>Requires</b>: size() > n.
//!
- //! <b>Effects</b>: Returns a reference to the nth element
+ //! <b>Effects</b>: Returns a reference to the nth element
//! from the beginning of the container.
- //!
+ //!
//! <b>Throws</b>: std::range_error if n >= size()
- //!
+ //!
//! <b>Complexity</b>: Constant.
reference at(size_type n) {
if (n >= size())
@@ -1059,11 +1086,11 @@ class basic_string
//! <b>Requires</b>: size() > n.
//!
- //! <b>Effects</b>: Returns a const reference to the nth element
+ //! <b>Effects</b>: Returns a const reference to the nth element
//! from the beginning of the container.
- //!
+ //!
//! <b>Throws</b>: std::range_error if n >= size()
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_reference at(size_type n) const {
if (n >= size())
@@ -1092,12 +1119,12 @@ class basic_string
//! <b>Effects</b>: Calls append(str.data(), str.size()).
//!
//! <b>Returns</b>: *this
- basic_string& append(const basic_string& s)
+ basic_string& append(const basic_string& s)
{ return this->append(s.begin(), s.end()); }
//! <b>Requires</b>: pos <= str.size()
//!
- //! <b>Effects</b>: Determines the effective length rlen of the string to append
+ //! <b>Effects</b>: Determines the effective length rlen of the string to append
//! as the smaller of n and str.size() - pos and calls append(str.data() + pos, rlen).
//!
//! <b>Throws</b>: If memory allocation throws and out_of_range if pos > str.size()
@@ -1121,7 +1148,7 @@ class basic_string
//! <b>Throws</b>: If memory allocation throws length_error if size() + n > max_size().
//!
//! <b>Returns</b>: *this
- basic_string& append(const CharT* s, size_type n)
+ basic_string& append(const CharT* s, size_type n)
{ return this->append(s, s + n); }
//! <b>Requires</b>: s points to an array of at least traits::length(s) + 1 elements of CharT.
@@ -1129,7 +1156,7 @@ class basic_string
//! <b>Effects</b>: Calls append(s, traits::length(s)).
//!
//! <b>Returns</b>: *this
- basic_string& append(const CharT* s)
+ basic_string& append(const CharT* s)
{ return this->append(s, s + Traits::length(s)); }
//! <b>Effects</b>: Equivalent to append(basic_string(n, c)).
@@ -1164,17 +1191,17 @@ class basic_string
//! <b>Effects</b>: Equivalent to assign(str, 0, npos).
//!
//! <b>Returns</b>: *this
- basic_string& assign(const basic_string& s)
+ basic_string& assign(const basic_string& s)
{ return this->operator=(s); }
//! <b>Effects</b>: The function replaces the string controlled by *this
- //! with a string of length str.size() whose elements are a copy of the string
+ //! with a string of length str.size() whose elements are a copy of the string
//! controlled by str. Leaves str in a valid but unspecified state.
//!
//! <b>Throws</b>: Nothing
//!
//! <b>Returns</b>: *this
- basic_string& assign(BOOST_RV_REF(basic_string) ms)
+ basic_string& assign(BOOST_RV_REF(basic_string) ms)
{ return this->swap_data(ms), *this; }
//! <b>Requires</b>: pos <= str.size()
@@ -1185,11 +1212,11 @@ class basic_string
//! <b>Throws</b>: If memory allocation throws or out_of_range if pos > str.size().
//!
//! <b>Returns</b>: *this
- basic_string& assign(const basic_string& s,
+ basic_string& assign(const basic_string& s,
size_type pos, size_type n) {
if (pos > s.size())
this->throw_out_of_range();
- return this->assign(s.begin() + pos,
+ return this->assign(s.begin() + pos,
s.begin() + pos + container_detail::min_value(n, s.size() - pos));
}
@@ -1199,7 +1226,7 @@ class basic_string
//! length n whose elements are a copy of those pointed to by s.
//!
//! <b>Throws</b>: If memory allocation throws or length_error if n > max_size().
- //!
+ //!
//! <b>Returns</b>: *this
basic_string& assign(const CharT* s, size_type n)
{ return this->assign(s, s + n); }
@@ -1222,7 +1249,7 @@ class basic_string
//!
//! <b>Returns</b>: *this
template <class InputIter>
- basic_string& assign(InputIter first, InputIter last)
+ basic_string& assign(InputIter first, InputIter last)
{
//Dispatch depending on integer/iterator
const bool aux_boolean = container_detail::is_convertible<InputIter, size_type>::value;
@@ -1237,7 +1264,7 @@ class basic_string
//! <b>Throws</b>: If memory allocation throws or out_of_range if pos > size().
//!
//! <b>Returns</b>: *this
- basic_string& insert(size_type pos, const basic_string& s)
+ basic_string& insert(size_type pos, const basic_string& s)
{
if (pos > size())
this->throw_out_of_range();
@@ -1256,7 +1283,7 @@ class basic_string
//!
//! <b>Returns</b>: *this
basic_string& insert(size_type pos1, const basic_string& s,
- size_type pos2, size_type n)
+ size_type pos2, size_type n)
{
if (pos1 > this->size() || pos2 > s.size())
this->throw_out_of_range();
@@ -1280,7 +1307,7 @@ class basic_string
//! length_error if size() + n > max_size().
//!
//! <b>Returns</b>: *this
- basic_string& insert(size_type pos, const CharT* s, size_type n)
+ basic_string& insert(size_type pos, const CharT* s, size_type n)
{
if (pos > this->size())
this->throw_out_of_range();
@@ -1298,7 +1325,7 @@ class basic_string
//! length_error if size() > max_size() - Traits::length(s)
//!
//! <b>Returns</b>: *this
- basic_string& insert(size_type pos, const CharT* s)
+ basic_string& insert(size_type pos, const CharT* s)
{
if (pos > size())
this->throw_out_of_range();
@@ -1315,7 +1342,7 @@ class basic_string
//! length_error if size() > max_size() - n
//!
//! <b>Returns</b>: *this
- basic_string& insert(size_type pos, size_type n, CharT c)
+ basic_string& insert(size_type pos, size_type n, CharT c)
{
if (pos > this->size())
this->throw_out_of_range();
@@ -1330,7 +1357,7 @@ class basic_string
//! <b>Effects</b>: inserts a copy of c before the character referred to by p.
//!
//! <b>Returns</b>: An iterator which refers to the copy of the inserted character.
- iterator insert(const_iterator p, CharT c)
+ iterator insert(const_iterator p, CharT c)
{
size_type new_offset = p - this->priv_addr() + 1;
this->insert(p, cvalue_iterator(c, 1), cvalue_iterator());
@@ -1356,7 +1383,7 @@ class basic_string
//! <b>Returns</b>: An iterator which refers to the copy of the first
//! inserted character, or p if first == last.
template <class InputIter>
- void insert(const_iterator p, InputIter first, InputIter last)
+ void insert(const_iterator p, InputIter first, InputIter last)
{
//Dispatch depending on integer/iterator
const bool aux_boolean = container_detail::is_convertible<InputIter, size_type>::value;
@@ -1375,13 +1402,13 @@ class basic_string
//! <b>Throws</b>: out_of_range if pos > size().
//!
//! <b>Returns</b>: *this
- basic_string& erase(size_type pos = 0, size_type n = npos)
+ basic_string& erase(size_type pos = 0, size_type n = npos)
{
if (pos > size())
this->throw_out_of_range();
erase(this->priv_addr() + pos, this->priv_addr() + pos + container_detail::min_value(n, size() - pos));
return *this;
- }
+ }
//! <b>Effects</b>: Removes the character referred to by p.
//!
@@ -1389,12 +1416,12 @@ class basic_string
//!
//! <b>Returns</b>: An iterator which points to the element immediately following p prior to the element being
//! erased. If no such element exists, end() is returned.
- iterator erase(const_iterator p)
+ iterator erase(const_iterator p)
{
// The move includes the terminating null.
CharT *ptr = const_cast<CharT*>(container_detail::to_raw_pointer(p));
Traits::move(ptr,
- container_detail::to_raw_pointer(p + 1),
+ container_detail::to_raw_pointer(p + 1),
this->priv_size() - (p - this->priv_addr()));
this->priv_size(this->priv_size()-1);
return iterator(ptr);
@@ -1414,7 +1441,7 @@ class basic_string
if (first != last) { // The move includes the terminating null.
size_type num_erased = last - first;
Traits::move(f,
- container_detail::to_raw_pointer(last),
+ container_detail::to_raw_pointer(last),
(this->priv_size() + 1)-(last - this->priv_addr()));
size_type new_length = this->priv_size() - num_erased;
this->priv_size(new_length);
@@ -1440,14 +1467,14 @@ class basic_string
//! <b>Throws</b>: if memory allocation throws or out_of_range if pos1 > size().
//!
//! <b>Returns</b>: *this
- basic_string& replace(size_type pos1, size_type n1, const basic_string& str)
+ basic_string& replace(size_type pos1, size_type n1, const basic_string& str)
{
if (pos1 > size())
this->throw_out_of_range();
const size_type len = container_detail::min_value(n1, size() - pos1);
if (this->size() - len >= this->max_size() - str.size())
this->throw_length_error();
- return this->replace(this->priv_addr() + pos1, this->priv_addr() + pos1 + len,
+ return this->replace(this->priv_addr() + pos1, this->priv_addr() + pos1 + len,
str.begin(), str.end());
}
@@ -1461,7 +1488,7 @@ class basic_string
//!
//! <b>Returns</b>: *this
basic_string& replace(size_type pos1, size_type n1,
- const basic_string& str, size_type pos2, size_type n2)
+ const basic_string& str, size_type pos2, size_type n2)
{
if (pos1 > size() || pos2 > str.size())
this->throw_out_of_range();
@@ -1475,20 +1502,20 @@ class basic_string
//! <b>Requires</b>: pos1 <= size() and s points to an array of at least n2 elements of CharT.
//!
- //! <b>Effects</b>: Determines the effective length xlen of the string to be removed as the
- //! smaller of n1 and size() - pos1. If size() - xlen >= max_size() - n2 throws length_error.
- //! Otherwise, the function replaces the string controlled by *this with a string of
- //! length size() - xlen + n2 whose first pos1 elements are a copy of the initial elements
- //! of the original string controlled by *this, whose next n2 elements are a copy of the
- //! initial n2 elements of s, and whose remaining elements are a copy of the elements of
+ //! <b>Effects</b>: Determines the effective length xlen of the string to be removed as the
+ //! smaller of n1 and size() - pos1. If size() - xlen >= max_size() - n2 throws length_error.
+ //! Otherwise, the function replaces the string controlled by *this with a string of
+ //! length size() - xlen + n2 whose first pos1 elements are a copy of the initial elements
+ //! of the original string controlled by *this, whose next n2 elements are a copy of the
+ //! initial n2 elements of s, and whose remaining elements are a copy of the elements of
//! the original string controlled by *this beginning at position pos + xlen.
//!
- //! <b>Throws</b>: if memory allocation throws, out_of_range if pos1 > size() or length_error
+ //! <b>Throws</b>: if memory allocation throws, out_of_range if pos1 > size() or length_error
//! if the length of the resulting string would exceed max_size()
//!
//! <b>Returns</b>: *this
basic_string& replace(size_type pos1, size_type n1,
- const CharT* s, size_type n2)
+ const CharT* s, size_type n2)
{
if (pos1 > size())
this->throw_out_of_range();
@@ -1509,11 +1536,11 @@ class basic_string
//! remaining elements are a copy of the elements of the original string controlled by *this
//! beginning at position pos + xlen.
//!
- //! <b>Throws</b>: if memory allocation throws, out_of_range if pos1 > size() or length_error
+ //! <b>Throws</b>: if memory allocation throws, out_of_range if pos1 > size() or length_error
//! if the length of the resulting string would exceed max_size()
//!
//! <b>Returns</b>: *this
- basic_string& replace(size_type pos, size_type n1, const CharT* s)
+ basic_string& replace(size_type pos, size_type n1, const CharT* s)
{
if (pos > size())
this->throw_out_of_range();
@@ -1529,11 +1556,11 @@ class basic_string
//!
//! <b>Effects</b>: Equivalent to replace(pos1, n1, basic_string(n2, c)).
//!
- //! <b>Throws</b>: if memory allocation throws, out_of_range if pos1 > size() or length_error
+ //! <b>Throws</b>: if memory allocation throws, out_of_range if pos1 > size() or length_error
//! if the length of the resulting string would exceed max_size()
//!
//! <b>Returns</b>: *this
- basic_string& replace(size_type pos1, size_type n1, size_type n2, CharT c)
+ basic_string& replace(size_type pos1, size_type n1, size_type n2, CharT c)
{
if (pos1 > size())
this->throw_out_of_range();
@@ -1550,10 +1577,10 @@ class basic_string
//! <b>Throws</b>: if memory allocation throws
//!
//! <b>Returns</b>: *this
- basic_string& replace(const_iterator i1, const_iterator i2, const basic_string& str)
+ basic_string& replace(const_iterator i1, const_iterator i2, const basic_string& str)
{ return this->replace(i1, i2, str.begin(), str.end()); }
- //! <b>Requires</b>: [begin(),i1) and [i1,i2) are valid ranges and
+ //! <b>Requires</b>: [begin(),i1) and [i1,i2) are valid ranges and
//! s points to an array of at least n elements
//!
//! <b>Effects</b>: Calls replace(i1 - begin(), i2 - i1, s, n).
@@ -1561,7 +1588,7 @@ class basic_string
//! <b>Throws</b>: if memory allocation throws
//!
//! <b>Returns</b>: *this
- basic_string& replace(const_iterator i1, const_iterator i2, const CharT* s, size_type n)
+ basic_string& replace(const_iterator i1, const_iterator i2, const CharT* s, size_type n)
{ return this->replace(i1, i2, s, s + n); }
//! <b>Requires</b>: [begin(),i1) and [i1,i2) are valid ranges and s points to an
@@ -1572,7 +1599,7 @@ class basic_string
//! <b>Throws</b>: if memory allocation throws
//!
//! <b>Returns</b>: *this
- basic_string& replace(const_iterator i1, const_iterator i2, const CharT* s)
+ basic_string& replace(const_iterator i1, const_iterator i2, const CharT* s)
{ return this->replace(i1, i2, s, s + Traits::length(s)); }
//! <b>Requires</b>: [begin(),i1) and [i1,i2) are valid ranges.
@@ -1604,7 +1631,7 @@ class basic_string
//!
//! <b>Returns</b>: *this
template <class InputIter>
- basic_string& replace(const_iterator i1, const_iterator i2, InputIter j1, InputIter j2)
+ basic_string& replace(const_iterator i1, const_iterator i2, InputIter j1, InputIter j2)
{
//Dispatch depending on integer/iterator
const bool aux_boolean = container_detail::is_convertible<InputIter, size_type>::value;
@@ -1616,14 +1643,14 @@ class basic_string
//!
//! <b>Effects</b>: Determines the effective length rlen of the string to copy as the
//! smaller of n and size() - pos. s shall designate an array of at least rlen elements.
- //! The function then replaces the string designated by s with a string of length rlen
+ //! The function then replaces the string designated by s with a string of length rlen
//! whose elements are a copy of the string controlled by *this beginning at position pos.
//! The function does not append a null object to the string designated by s.
//!
//! <b>Throws</b>: if memory allocation throws, out_of_range if pos > size().
//!
//! <b>Returns</b>: rlen
- size_type copy(CharT* s, size_type n, size_type pos = 0) const
+ size_type copy(CharT* s, size_type n, size_type pos = 0) const
{
if (pos > size())
this->throw_out_of_range();
@@ -1632,7 +1659,7 @@ class basic_string
return len;
}
- //! <b>Effects</b>: *this contains the same sequence of characters that was in s,
+ //! <b>Effects</b>: *this contains the same sequence of characters that was in s,
//! s contains the same sequence of characters that was in *this.
//!
//! <b>Throws</b>: Nothing
@@ -1648,7 +1675,7 @@ class basic_string
//! <b>Returns</b>: A pointer p such that p + i == &operator[](i) for each i in [0,size()].
//!
//! <b>Complexity</b>: constant time.
- const CharT* c_str() const
+ const CharT* c_str() const
{ return container_detail::to_raw_pointer(this->priv_addr()); }
//! <b>Requires</b>: The program shall not alter any of the values stored in the character array.
@@ -1656,17 +1683,17 @@ class basic_string
//! <b>Returns</b>: A pointer p such that p + i == &operator[](i) for each i in [0,size()].
//!
//! <b>Complexity</b>: constant time.
- const CharT* data() const
+ const CharT* data() const
{ return container_detail::to_raw_pointer(this->priv_addr()); }
- //! <b>Effects</b>: Determines the lowest position xpos, if possible, such that both
+ //! <b>Effects</b>: Determines the lowest position xpos, if possible, such that both
//! of the following conditions obtain: 19 pos <= xpos and xpos + str.size() <= size();
//! 2) traits::eq(at(xpos+I), str.at(I)) for all elements I of the string controlled by str.
//!
//! <b>Throws</b>: Nothing
//!
//! <b>Returns</b>: xpos if the function can determine such a value for xpos. Otherwise, returns npos.
- size_type find(const basic_string& s, size_type pos = 0) const
+ size_type find(const basic_string& s, size_type pos = 0) const
{ return find(s.c_str(), pos, s.size()); }
//! <b>Requires</b>: s points to an array of at least n elements of CharT.
@@ -1681,7 +1708,7 @@ class basic_string
else {
pointer finish = this->priv_addr() + this->priv_size();
const const_iterator result =
- std::search(container_detail::to_raw_pointer(this->priv_addr() + pos),
+ std::search(container_detail::to_raw_pointer(this->priv_addr() + pos),
container_detail::to_raw_pointer(finish),
s, s + n, Eq_traits<Traits>());
return result != finish ? result - begin() : npos;
@@ -1693,7 +1720,7 @@ class basic_string
//! <b>Throws</b>: Nothing
//!
//! <b>Returns</b>: find(basic_string(s), pos).
- size_type find(const CharT* s, size_type pos = 0) const
+ size_type find(const CharT* s, size_type pos = 0) const
{ return find(s, pos, Traits::length(s)); }
//! <b>Throws</b>: Nothing
@@ -1712,7 +1739,7 @@ class basic_string
}
}
- //! <b>Effects</b>: Determines the highest position xpos, if possible, such
+ //! <b>Effects</b>: Determines the highest position xpos, if possible, such
//! that both of the following conditions obtain:
//! a) xpos <= pos and xpos + str.size() <= size();
//! b) traits::eq(at(xpos+I), str.at(I)) for all elements I of the string controlled by str.
@@ -1720,7 +1747,7 @@ class basic_string
//! <b>Throws</b>: Nothing
//!
//! <b>Returns</b>: xpos if the function can determine such a value for xpos. Otherwise, returns npos.
- size_type rfind(const basic_string& str, size_type pos = npos) const
+ size_type rfind(const basic_string& str, size_type pos = npos) const
{ return rfind(str.c_str(), pos, str.size()); }
//! <b>Requires</b>: s points to an array of at least n elements of CharT.
@@ -1745,13 +1772,13 @@ class basic_string
}
}
- //! <b>Requires</b>: pos <= size() and s points to an array of at least
+ //! <b>Requires</b>: pos <= size() and s points to an array of at least
//! traits::length(s) + 1 elements of CharT.
//!
//! <b>Throws</b>: Nothing
//!
//! <b>Returns</b>: rfind(basic_string(s), pos).
- size_type rfind(const CharT* s, size_type pos = npos) const
+ size_type rfind(const CharT* s, size_type pos = npos) const
{ return rfind(s, pos, Traits::length(s)); }
//! <b>Throws</b>: Nothing
@@ -1779,7 +1806,7 @@ class basic_string
//! <b>Throws</b>: Nothing
//!
//! <b>Returns</b>: xpos if the function can determine such a value for xpos. Otherwise, returns npos.
- size_type find_first_of(const basic_string& s, size_type pos = 0) const
+ size_type find_first_of(const basic_string& s, size_type pos = 0) const
{ return find_first_of(s.c_str(), pos, s.size()); }
//! <b>Requires</b>: s points to an array of at least n elements of CharT.
@@ -1805,7 +1832,7 @@ class basic_string
//! <b>Throws</b>: Nothing
//!
//! <b>Returns</b>: find_first_of(basic_string(s), pos).
- size_type find_first_of(const CharT* s, size_type pos = 0) const
+ size_type find_first_of(const CharT* s, size_type pos = 0) const
{ return find_first_of(s, pos, Traits::length(s)); }
//! <b>Requires</b>: s points to an array of at least traits::length(s) + 1 elements of CharT.
@@ -1813,10 +1840,10 @@ class basic_string
//! <b>Throws</b>: Nothing
//!
//! <b>Returns</b>: find_first_of(basic_string<CharT,traits,Allocator>(1,c), pos).
- size_type find_first_of(CharT c, size_type pos = 0) const
+ size_type find_first_of(CharT c, size_type pos = 0) const
{ return find(c, pos); }
- //! <b>Effects</b>: Determines the highest position xpos, if possible, such that both of
+ //! <b>Effects</b>: Determines the highest position xpos, if possible, such that both of
//! the following conditions obtain: a) xpos <= pos and xpos < size(); b)
//! traits::eq(at(xpos), str.at(I)) for some element I of the string controlled by str.
//!
@@ -1852,16 +1879,16 @@ class basic_string
//! <b>Throws</b>: Nothing
//!
//! <b>Returns</b>: find_last_of(basic_string<CharT,traits,Allocator>(1,c),pos).
- size_type find_last_of(const CharT* s, size_type pos = npos) const
+ size_type find_last_of(const CharT* s, size_type pos = npos) const
{ return find_last_of(s, pos, Traits::length(s)); }
//! <b>Throws</b>: Nothing
//!
//! <b>Returns</b>: find_last_of(basic_string(s), pos).
- size_type find_last_of(CharT c, size_type pos = npos) const
+ size_type find_last_of(CharT c, size_type pos = npos) const
{ return rfind(c, pos); }
- //! <b>Effects</b>: Determines the lowest position xpos, if possible, such that
+ //! <b>Effects</b>: Determines the lowest position xpos, if possible, such that
//! both of the following conditions obtain:
//! a) pos <= xpos and xpos < size(); b) traits::eq(at(xpos), str.at(I)) for no
//! element I of the string controlled by str.
@@ -1869,7 +1896,7 @@ class basic_string
//! <b>Throws</b>: Nothing
//!
//! <b>Returns</b>: xpos if the function can determine such a value for xpos. Otherwise, returns npos.
- size_type find_first_not_of(const basic_string& str, size_type pos = 0) const
+ size_type find_first_not_of(const basic_string& str, size_type pos = 0) const
{ return find_first_not_of(str.c_str(), pos, str.size()); }
//! <b>Requires</b>: s points to an array of at least traits::length(s) + 1 elements of CharT.
@@ -1894,7 +1921,7 @@ class basic_string
//! <b>Throws</b>: Nothing
//!
//! <b>Returns</b>: find_first_not_of(basic_string(s), pos).
- size_type find_first_not_of(const CharT* s, size_type pos = 0) const
+ size_type find_first_not_of(const CharT* s, size_type pos = 0) const
{ return find_first_not_of(s, pos, Traits::length(s)); }
//! <b>Throws</b>: Nothing
@@ -1914,7 +1941,7 @@ class basic_string
}
//! <b>Effects</b>: Determines the highest position xpos, if possible, such that
- //! both of the following conditions obtain: a) xpos <= pos and xpos < size();
+ //! both of the following conditions obtain: a) xpos <= pos and xpos < size();
//! b) traits::eq(at(xpos), str.at(I)) for no element I of the string controlled by str.
//!
//! <b>Throws</b>: Nothing
@@ -1977,11 +2004,11 @@ class basic_string
//! <b>Throws</b>: If memory allocation throws or out_of_range if pos > size().
//!
//! <b>Returns</b>: basic_string<CharT,traits,Allocator>(data()+pos,rlen).
- basic_string substr(size_type pos = 0, size_type n = npos) const
+ basic_string substr(size_type pos = 0, size_type n = npos) const
{
if (pos > size())
this->throw_out_of_range();
- return basic_string(this->priv_addr() + pos,
+ return basic_string(this->priv_addr() + pos,
this->priv_addr() + pos + container_detail::min_value(n, size() - pos), this->alloc());
}
@@ -1994,7 +2021,7 @@ class basic_string
//! <b>Returns</b>: The nonzero result if the result of the comparison is nonzero.
//! Otherwise, returns a value < 0 if size() < str.size(), a 0 value if size() == str.size(),
//! and value > 0 if size() > str.size()
- int compare(const basic_string& str) const
+ int compare(const basic_string& str) const
{ return s_compare(this->priv_addr(), this->priv_addr() + this->priv_size(), str.priv_addr(), str.priv_addr() + str.priv_size()); }
//! <b>Requires</b>: pos1 <= size()
@@ -2005,16 +2032,16 @@ class basic_string
//! <b>Throws</b>: out_of_range if pos1 > size()
//!
//! <b>Returns</b>:basic_string(*this,pos1,n1).compare(str).
- int compare(size_type pos1, size_type n1, const basic_string& str) const
+ int compare(size_type pos1, size_type n1, const basic_string& str) const
{
if (pos1 > size())
this->throw_out_of_range();
- return s_compare(this->priv_addr() + pos1,
+ return s_compare(this->priv_addr() + pos1,
this->priv_addr() + pos1 + container_detail::min_value(n1, size() - pos1),
str.priv_addr(), str.priv_addr() + str.priv_size());
}
- //! <b>Requires</b>: pos1 <= size() and pos2 <= str.size()
+ //! <b>Requires</b>: pos1 <= size() and pos2 <= str.size()
//!
//! <b>Effects</b>: Determines the effective length rlen of the string to copy as
//! the smaller of
@@ -2022,20 +2049,20 @@ class basic_string
//! <b>Throws</b>: out_of_range if pos1 > size() or pos2 > str.size()
//!
//! <b>Returns</b>: basic_string(*this, pos1, n1).compare(basic_string(str, pos2, n2)).
- int compare(size_type pos1, size_type n1,
+ int compare(size_type pos1, size_type n1,
const basic_string& str, size_type pos2, size_type n2) const {
if (pos1 > size() || pos2 > str.size())
this->throw_out_of_range();
- return s_compare(this->priv_addr() + pos1,
+ return s_compare(this->priv_addr() + pos1,
this->priv_addr() + pos1 + container_detail::min_value(n1, size() - pos1),
- str.priv_addr() + pos2,
+ str.priv_addr() + pos2,
str.priv_addr() + pos2 + container_detail::min_value(n2, size() - pos2));
}
//! <b>Throws</b>: Nothing
//!
//! <b>Returns</b>: compare(basic_string(s)).
- int compare(const CharT* s) const
+ int compare(const CharT* s) const
{ return s_compare(this->priv_addr(), this->priv_addr() + this->priv_size(), s, s + Traits::length(s)); }
@@ -2045,11 +2072,11 @@ class basic_string
//!
//! <b>Returns</b>: basic_string(*this, pos, n1).compare(basic_string(s, n2)).
int compare(size_type pos1, size_type n1,
- const CharT* s, size_type n2) const
+ const CharT* s, size_type n2) const
{
if (pos1 > size())
this->throw_out_of_range();
- return s_compare(this->priv_addr() + pos1,
+ return s_compare(this->priv_addr() + pos1,
this->priv_addr() + pos1 + container_detail::min_value(n1, size() - pos1),
s, s + n2);
}
@@ -2059,18 +2086,18 @@ class basic_string
//! <b>Throws</b>: out_of_range if pos1 > size()
//!
//! <b>Returns</b>: basic_string(*this, pos, n1).compare(basic_string(s, n2)).
- int compare(size_type pos1, size_type n1, const CharT* s) const
+ int compare(size_type pos1, size_type n1, const CharT* s) const
{ return this->compare(pos1, n1, s, Traits::length(s)); }
/// @cond
private:
static int s_compare(const_pointer f1, const_pointer l1,
- const_pointer f2, const_pointer l2)
+ const_pointer f2, const_pointer l2)
{
const difference_type n1 = l1 - f1;
const difference_type n2 = l2 - f2;
- const int cmp = Traits::compare(container_detail::to_raw_pointer(f1),
- container_detail::to_raw_pointer(f2),
+ const int cmp = Traits::compare(container_detail::to_raw_pointer(f1),
+ container_detail::to_raw_pointer(f2),
container_detail::min_value(n1, n2));
return cmp != 0 ? cmp : (n1 < n2 ? -1 : (n1 > n2 ? 1 : 0));
}
@@ -2105,7 +2132,7 @@ class basic_string
template<class AllocVersion>
void priv_shrink_to_fit_dynamic_buffer
- ( AllocVersion
+ ( AllocVersion
, typename container_detail::enable_if<container_detail::is_same<AllocVersion, allocator_v2> >::type* = 0)
{
size_type received_size;
@@ -2125,7 +2152,7 @@ class basic_string
// Helper functions used by constructors. It is a severe error for
// any of them to be called anywhere except from within constructors.
- void priv_terminate_string()
+ void priv_terminate_string()
{ this->priv_construct_null(this->priv_addr() + this->priv_size()); }
template <class InputIter>
@@ -2138,7 +2165,7 @@ class basic_string
}
template <class ForwardIter>
- void priv_range_initialize(ForwardIter f, ForwardIter l,
+ void priv_range_initialize(ForwardIter f, ForwardIter l,
std::forward_iterator_tag)
{
difference_type n = std::distance(f, l);
@@ -2167,7 +2194,7 @@ class basic_string
template <class InputIter>
void priv_initialize_dispatch(InputIter f, InputIter l, container_detail::false_)
{ this->priv_range_initialize(f, l); }
-
+
template<class FwdIt, class Count> inline
void priv_uninitialized_fill_n(FwdIt first, Count count, const CharT val)
{
@@ -2215,7 +2242,7 @@ class basic_string
}
template <class Integer>
- basic_string& priv_assign_dispatch(Integer n, Integer x, container_detail::true_)
+ basic_string& priv_assign_dispatch(Integer n, Integer x, container_detail::true_)
{ return this->assign((size_type) n, (CharT) x); }
template <class InputIter>
@@ -2246,7 +2273,7 @@ class basic_string
}
template <class ForwardIter>
- void priv_insert(const_iterator position, ForwardIter first,
+ void priv_insert(const_iterator position, ForwardIter first,
ForwardIter last, std::forward_iterator_tag)
{
if (first != last) {
@@ -2260,13 +2287,13 @@ class basic_string
//Check if we have enough capacity
if (remaining >= n){
- enough_capacity = true;
+ enough_capacity = true;
}
else {
//Otherwise expand current buffer or allocate new storage
new_cap = this->next_capacity(n);
allocation_ret = this->allocation_command
- (allocate_new | expand_fwd | expand_bwd, old_size + n + 1,
+ (allocate_new | expand_fwd | expand_bwd, old_size + n + 1,
new_cap, new_cap, old_start);
//Check forward expansion
@@ -2327,7 +2354,7 @@ class basic_string
this->priv_long_storage(new_cap);
}
else{
- //value_type is POD, so backwards expansion is much easier
+ //value_type is POD, so backwards expansion is much easier
//than with vector<T>
value_type *oldbuf = container_detail::to_raw_pointer(old_start);
value_type *newbuf = container_detail::to_raw_pointer(new_start);
@@ -2351,12 +2378,12 @@ class basic_string
template <class Integer>
void priv_insert_dispatch(const_iterator p, Integer n, Integer x,
- container_detail::true_)
+ container_detail::true_)
{ insert(p, (size_type) n, (CharT) x); }
template <class InputIter>
void priv_insert_dispatch(const_iterator p, InputIter first, InputIter last,
- container_detail::false_)
+ container_detail::false_)
{
typedef typename std::iterator_traits<InputIter>::iterator_category Category;
priv_insert(p, first, last, Category());
@@ -2369,19 +2396,19 @@ class basic_string
Traits::assign(*result, *first);
}
- void priv_copy(const CharT* first, const CharT* last, CharT* result)
+ void priv_copy(const CharT* first, const CharT* last, CharT* result)
{ Traits::copy(result, first, last - first); }
template <class Integer>
basic_string& priv_replace_dispatch(const_iterator first, const_iterator last,
Integer n, Integer x,
- container_detail::true_)
+ container_detail::true_)
{ return this->replace(first, last, (size_type) n, (CharT) x); }
template <class InputIter>
basic_string& priv_replace_dispatch(const_iterator first, const_iterator last,
InputIter f, InputIter l,
- container_detail::false_)
+ container_detail::false_)
{
typedef typename std::iterator_traits<InputIter>::iterator_category Category;
return this->priv_replace(first, last, f, l, Category());
@@ -2404,7 +2431,7 @@ class basic_string
template <class ForwardIter>
basic_string& priv_replace(const_iterator first, const_iterator last,
- ForwardIter f, ForwardIter l,
+ ForwardIter f, ForwardIter l,
std::forward_iterator_tag)
{
difference_type n = std::distance(f, l);
@@ -2442,9 +2469,9 @@ wstring;
/// @cond
-template <class CharT, class Traits, class A>
-const typename basic_string<CharT,Traits,A>::size_type
-basic_string<CharT,Traits,A>::npos
+template <class CharT, class Traits, class A>
+const typename basic_string<CharT,Traits,A>::size_type
+basic_string<CharT,Traits,A>::npos
= (typename basic_string<CharT,Traits,A>::size_type) -1;
/// @endcond
@@ -2500,7 +2527,7 @@ BOOST_RV_REF_3_TEMPL_ARGS(basic_string, CharT, Traits, A)
template <class CharT, class Traits, class A>
inline basic_string<CharT,Traits,A>
-operator+(const CharT* s, const basic_string<CharT,Traits,A>& y)
+operator+(const CharT* s, const basic_string<CharT,Traits,A>& y)
{
typedef basic_string<CharT, Traits, A> str_t;
typedef typename str_t::reserve_t reserve_t;
@@ -2523,7 +2550,7 @@ operator+(const CharT* s,
template <class CharT, class Traits, class A>
inline basic_string<CharT,Traits,A>
-operator+(CharT c, const basic_string<CharT,Traits,A>& y)
+operator+(CharT c, const basic_string<CharT,Traits,A>& y)
{
typedef basic_string<CharT,Traits,A> str_t;
typedef typename str_t::reserve_t reserve_t;
@@ -2545,7 +2572,7 @@ operator+(CharT c,
template <class CharT, class Traits, class A>
inline basic_string<CharT,Traits,A>
-operator+(const basic_string<CharT,Traits,A>& x, const CharT* s)
+operator+(const basic_string<CharT,Traits,A>& x, const CharT* s)
{
typedef basic_string<CharT,Traits,A> str_t;
typedef typename str_t::reserve_t reserve_t;
@@ -2568,7 +2595,7 @@ operator+(BOOST_RV_REF_3_TEMPL_ARGS(basic_string, CharT, Traits, A) mx
template <class CharT, class Traits, class A>
inline basic_string<CharT,Traits,A>
-operator+(const basic_string<CharT,Traits,A>& x, const CharT c)
+operator+(const basic_string<CharT,Traits,A>& x, const CharT c)
{
typedef basic_string<CharT,Traits,A> str_t;
typedef typename str_t::reserve_t reserve_t;
@@ -2593,7 +2620,7 @@ operator+( BOOST_RV_REF_3_TEMPL_ARGS(basic_string, CharT, Traits, A) mx
template <class CharT, class Traits, class A>
inline bool
operator==(const basic_string<CharT,Traits,A>& x,
- const basic_string<CharT,Traits,A>& y)
+ const basic_string<CharT,Traits,A>& y)
{
return x.size() == y.size() &&
Traits::compare(x.data(), y.data(), x.size()) == 0;
@@ -2601,7 +2628,7 @@ operator==(const basic_string<CharT,Traits,A>& x,
template <class CharT, class Traits, class A>
inline bool
-operator==(const CharT* s, const basic_string<CharT,Traits,A>& y)
+operator==(const CharT* s, const basic_string<CharT,Traits,A>& y)
{
typename basic_string<CharT,Traits,A>::size_type n = Traits::length(s);
return n == y.size() && Traits::compare(s, y.data(), n) == 0;
@@ -2609,7 +2636,7 @@ operator==(const CharT* s, const basic_string<CharT,Traits,A>& y)
template <class CharT, class Traits, class A>
inline bool
-operator==(const basic_string<CharT,Traits,A>& x, const CharT* s)
+operator==(const basic_string<CharT,Traits,A>& x, const CharT* s)
{
typename basic_string<CharT,Traits,A>::size_type n = Traits::length(s);
return x.size() == n && Traits::compare(x.data(), s, n) == 0;
@@ -2618,17 +2645,17 @@ operator==(const basic_string<CharT,Traits,A>& x, const CharT* s)
template <class CharT, class Traits, class A>
inline bool
operator!=(const basic_string<CharT,Traits,A>& x,
- const basic_string<CharT,Traits,A>& y)
+ const basic_string<CharT,Traits,A>& y)
{ return !(x == y); }
template <class CharT, class Traits, class A>
inline bool
-operator!=(const CharT* s, const basic_string<CharT,Traits,A>& y)
+operator!=(const CharT* s, const basic_string<CharT,Traits,A>& y)
{ return !(s == y); }
template <class CharT, class Traits, class A>
inline bool
-operator!=(const basic_string<CharT,Traits,A>& x, const CharT* s)
+operator!=(const basic_string<CharT,Traits,A>& x, const CharT* s)
{ return !(x == s); }
@@ -2636,7 +2663,7 @@ operator!=(const basic_string<CharT,Traits,A>& x, const CharT* s)
template <class CharT, class Traits, class A>
inline bool
-operator<(const basic_string<CharT,Traits,A>& x, const basic_string<CharT,Traits,A>& y)
+operator<(const basic_string<CharT,Traits,A>& x, const basic_string<CharT,Traits,A>& y)
{
return x.compare(y) < 0;
// return basic_string<CharT,Traits,A>
@@ -2645,7 +2672,7 @@ operator<(const basic_string<CharT,Traits,A>& x, const basic_string<CharT,Traits
template <class CharT, class Traits, class A>
inline bool
-operator<(const CharT* s, const basic_string<CharT,Traits,A>& y)
+operator<(const CharT* s, const basic_string<CharT,Traits,A>& y)
{
return y.compare(s) > 0;
// basic_string<CharT,Traits,A>::size_type n = Traits::length(s);
@@ -2656,7 +2683,7 @@ operator<(const CharT* s, const basic_string<CharT,Traits,A>& y)
template <class CharT, class Traits, class A>
inline bool
operator<(const basic_string<CharT,Traits,A>& x,
- const CharT* s)
+ const CharT* s)
{
return x.compare(s) < 0;
// basic_string<CharT,Traits,A>::size_type n = Traits::length(s);
@@ -2679,7 +2706,7 @@ operator>(const CharT* s, const basic_string<CharT,Traits,A>& y) {
template <class CharT, class Traits, class A>
inline bool
-operator>(const basic_string<CharT,Traits,A>& x, const CharT* s)
+operator>(const basic_string<CharT,Traits,A>& x, const CharT* s)
{
return s < x;
}
@@ -2687,44 +2714,44 @@ operator>(const basic_string<CharT,Traits,A>& x, const CharT* s)
template <class CharT, class Traits, class A>
inline bool
operator<=(const basic_string<CharT,Traits,A>& x,
- const basic_string<CharT,Traits,A>& y)
+ const basic_string<CharT,Traits,A>& y)
{
return !(y < x);
}
template <class CharT, class Traits, class A>
inline bool
-operator<=(const CharT* s, const basic_string<CharT,Traits,A>& y)
+operator<=(const CharT* s, const basic_string<CharT,Traits,A>& y)
{ return !(y < s); }
template <class CharT, class Traits, class A>
inline bool
-operator<=(const basic_string<CharT,Traits,A>& x, const CharT* s)
+operator<=(const basic_string<CharT,Traits,A>& x, const CharT* s)
{ return !(s < x); }
template <class CharT, class Traits, class A>
inline bool
operator>=(const basic_string<CharT,Traits,A>& x,
- const basic_string<CharT,Traits,A>& y)
+ const basic_string<CharT,Traits,A>& y)
{ return !(x < y); }
template <class CharT, class Traits, class A>
inline bool
-operator>=(const CharT* s, const basic_string<CharT,Traits,A>& y)
+operator>=(const CharT* s, const basic_string<CharT,Traits,A>& y)
{ return !(s < y); }
template <class CharT, class Traits, class A>
inline bool
-operator>=(const basic_string<CharT,Traits,A>& x, const CharT* s)
+operator>=(const basic_string<CharT,Traits,A>& x, const CharT* s)
{ return !(x < s); }
// Swap.
template <class CharT, class Traits, class A>
-inline void swap(basic_string<CharT,Traits,A>& x, basic_string<CharT,Traits,A>& y)
+inline void swap(basic_string<CharT,Traits,A>& x, basic_string<CharT,Traits,A>& y)
{ x.swap(y); }
/// @cond
-// I/O.
+// I/O.
namespace container_detail {
template <class CharT, class Traits>
@@ -2762,11 +2789,11 @@ operator<<(std::basic_ostream<CharT, Traits>& os, const basic_string<CharT,Trait
if (w != 0 && n < w)
pad_len = w - n;
-
+
if (!left)
- ok = container_detail::string_fill(os, buf, pad_len);
+ ok = container_detail::string_fill(os, buf, pad_len);
- ok = ok &&
+ ok = ok &&
buf->sputn(s.data(), std::streamsize(n)) == std::streamsize(n);
if (left)
@@ -2781,7 +2808,7 @@ operator<<(std::basic_ostream<CharT, Traits>& os, const basic_string<CharT,Trait
template <class CharT, class Traits, class A>
-std::basic_istream<CharT, Traits>&
+std::basic_istream<CharT, Traits>&
operator>>(std::basic_istream<CharT, Traits>& is, basic_string<CharT,Traits,A>& s)
{
typename std::basic_istream<CharT, Traits>::sentry sentry(is);
@@ -2816,7 +2843,7 @@ operator>>(std::basic_istream<CharT, Traits>& is, basic_string<CharT,Traits,A>&
s.push_back(c);
}
}
-
+
// If we have read no characters, then set failbit.
if (s.size() == 0)
is.setstate(std::ios_base::failbit);
@@ -2827,8 +2854,8 @@ operator>>(std::basic_istream<CharT, Traits>& is, basic_string<CharT,Traits,A>&
return is;
}
-template <class CharT, class Traits, class A>
-std::basic_istream<CharT, Traits>&
+template <class CharT, class Traits, class A>
+std::basic_istream<CharT, Traits>&
getline(std::istream& is, basic_string<CharT,Traits,A>& s,CharT delim)
{
typename basic_string<CharT,Traits,A>::size_type nread = 0;
@@ -2846,7 +2873,7 @@ getline(std::istream& is, basic_string<CharT,Traits,A>& s,CharT delim)
else {
++nread;
CharT c = Traits::to_char_type(c1);
- if (!Traits::eq(c, delim))
+ if (!Traits::eq(c, delim))
s.push_back(c);
else
break; // Character is extracted but not appended.
@@ -2859,8 +2886,8 @@ getline(std::istream& is, basic_string<CharT,Traits,A>& s,CharT delim)
return is;
}
-template <class CharT, class Traits, class A>
-inline std::basic_istream<CharT, Traits>&
+template <class CharT, class Traits, class A>
+inline std::basic_istream<CharT, Traits>&
getline(std::basic_istream<CharT, Traits>& is, basic_string<CharT,Traits,A>& s)
{
return getline(is, s, '\n');
diff --git a/boost/container/vector.hpp b/boost/container/vector.hpp
index 742d00d37e..c6e5b51c30 100644
--- a/boost/container/vector.hpp
+++ b/boost/container/vector.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -38,7 +38,7 @@
#include <boost/container/detail/iterators.hpp>
#include <boost/container/detail/algorithms.hpp>
#include <boost/container/detail/destroyers.hpp>
-#include <boost/container/allocator/allocator_traits.hpp>
+#include <boost/container/allocator_traits.hpp>
#include <boost/container/container_fwd.hpp>
#include <boost/move/move.hpp>
#include <boost/move/move_helpers.hpp>
@@ -46,6 +46,7 @@
#include <boost/container/detail/mpl.hpp>
#include <boost/container/detail/type_traits.hpp>
#include <boost/container/detail/advanced_insert_int.hpp>
+#include <boost/assert.hpp>
namespace boost {
namespace container {
@@ -54,7 +55,7 @@ namespace container {
namespace container_detail {
-//! Const vector_iterator used to iterate through a vector.
+//! Const vector_iterator used to iterate through a vector.
template <class Pointer>
class vector_const_iterator
{
@@ -81,20 +82,20 @@ class vector_const_iterator
vector_const_iterator() : m_ptr(0){}
//Pointer like operators
- reference operator*() const
+ reference operator*() const
{ return *m_ptr; }
- const value_type * operator->() const
+ const value_type * operator->() const
{ return container_detail::to_raw_pointer(m_ptr); }
reference operator[](difference_type off) const
{ return m_ptr[off]; }
//Increment / Decrement
- vector_const_iterator& operator++()
+ vector_const_iterator& operator++()
{ ++m_ptr; return *this; }
- vector_const_iterator operator++(int)
+ vector_const_iterator operator++(int)
{ Pointer tmp = m_ptr; ++*this; return vector_const_iterator(tmp); }
vector_const_iterator& operator--()
@@ -164,22 +165,22 @@ class vector_iterator
{}
//Pointer like operators
- reference operator*() const
+ reference operator*() const
{ return *this->m_ptr; }
- value_type* operator->() const
+ value_type* operator->() const
{ return container_detail::to_raw_pointer(this->m_ptr); }
- reference operator[](difference_type off) const
+ reference operator[](difference_type off) const
{ return this->m_ptr[off]; }
//Increment / Decrement
- vector_iterator& operator++()
+ vector_iterator& operator++()
{ ++this->m_ptr; return *this; }
vector_iterator operator++(int)
{ pointer tmp = this->m_ptr; ++*this; return vector_iterator(tmp); }
-
+
vector_iterator& operator--()
{ --this->m_ptr; return *this; }
@@ -248,7 +249,7 @@ struct vector_value_traits
//!This struct deallocates and allocated memory
template <class A>
-struct vector_alloc_holder
+struct vector_alloc_holder
{
typedef boost::container::allocator_traits<A> allocator_traits_type;
typedef typename allocator_traits_type::pointer pointer;
@@ -281,7 +282,7 @@ struct vector_alloc_holder
boost::container::container_detail::version<A>::value> alloc_version;
std::pair<pointer, bool>
allocation_command(allocation_type command,
- size_type limit_size,
+ size_type limit_size,
size_type preferred_size,
size_type &received_size, const pointer &reuse = 0)
{
@@ -291,7 +292,7 @@ struct vector_alloc_holder
std::pair<pointer, bool>
allocation_command(allocation_type command,
- size_type limit_size,
+ size_type limit_size,
size_type preferred_size,
size_type &received_size,
const pointer &reuse,
@@ -307,7 +308,7 @@ struct vector_alloc_holder
std::pair<pointer, bool>
allocation_command(allocation_type command,
- size_type limit_size,
+ size_type limit_size,
size_type preferred_size,
size_type &received_size,
const pointer &reuse,
@@ -393,9 +394,9 @@ struct vector_alloc_holder
/// @endcond
//! \class vector
-//! A vector is a sequence that supports random access to elements, constant
-//! time insertion and removal of elements at the end, and linear time insertion
-//! and removal of elements at the beginning or in the middle. The number of
+//! A vector is a sequence that supports random access to elements, constant
+//! time insertion and removal of elements at the end, and linear time insertion
+//! and removal of elements at the beginning or in the middle. The number of
//! elements in a vector may vary dynamically; memory management is automatic.
//! boost::container::vector is similar to std::vector but it's compatible
//! with shared memory and memory mapped files.
@@ -433,11 +434,11 @@ class vector : private container_detail::vector_alloc_holder<A>
//! The random access const_iterator
typedef container_detail::vector_const_iterator<pointer> const_iterator;
- //! Iterator used to iterate backwards through a vector.
- typedef std::reverse_iterator<iterator>
+ //! Iterator used to iterate backwards through a vector.
+ typedef std::reverse_iterator<iterator>
reverse_iterator;
- //! Const iterator used to iterate backwards through a vector.
- typedef std::reverse_iterator<const_iterator>
+ //! Const iterator used to iterate backwards through a vector.
+ typedef std::reverse_iterator<const_iterator>
const_reverse_iterator;
//! The stored allocator type
typedef allocator_type stored_allocator_type;
@@ -460,9 +461,9 @@ class vector : private container_detail::vector_alloc_holder<A>
public:
//! <b>Effects</b>: Constructs a vector taking the allocator as parameter.
- //!
+ //!
//! <b>Throws</b>: If allocator_type's default constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Constant.
vector()
BOOST_CONTAINER_NOEXCEPT_IF(::boost::has_nothrow_default_constructor<A>::value)
@@ -470,9 +471,9 @@ class vector : private container_detail::vector_alloc_holder<A>
{}
//! <b>Effects</b>: Constructs a vector taking the allocator as parameter.
- //!
+ //!
//! <b>Throws</b>: Nothing
- //!
+ //!
//! <b>Complexity</b>: Constant.
explicit vector(const A& a) BOOST_CONTAINER_NOEXCEPT
: base_t(a)
@@ -483,7 +484,7 @@ class vector : private container_detail::vector_alloc_holder<A>
//!
//! <b>Throws</b>: If allocator_type's default constructor or allocation
//! throws or T's default constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Linear to n.
explicit vector(size_type n)
: base_t()
@@ -510,21 +511,21 @@ class vector : private container_detail::vector_alloc_holder<A>
//!
//! <b>Throws</b>: If allocator_type's default constructor or allocation
//! throws or T's copy constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Linear to n.
- vector(size_type n, const T& value, const allocator_type& a = allocator_type())
+ vector(size_type n, const T& value, const allocator_type& a = allocator_type())
: base_t(a)
{ this->insert(this->cend(), n, value); }
//! <b>Effects</b>: Copy constructs a vector.
//!
//! <b>Postcondition</b>: x == *this.
- //!
+ //!
//! <b>Throws</b>: If allocator_type's default constructor or allocation
//! throws or T's copy constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Linear to the elements x contains.
- vector(const vector &x)
+ vector(const vector &x)
: base_t(allocator_traits_type::select_on_container_copy_construction(x.alloc()))
{
this->assign( container_detail::to_raw_pointer(x.members_.m_start)
@@ -534,12 +535,46 @@ class vector : private container_detail::vector_alloc_holder<A>
//! <b>Effects</b>: Move constructor. Moves mx's resources to *this.
//!
//! <b>Throws</b>: Nothing
- //!
+ //!
//! <b>Complexity</b>: Constant.
vector(BOOST_RV_REF(vector) mx) BOOST_CONTAINER_NOEXCEPT
: base_t(boost::move(mx.alloc()))
{ this->swap_members(mx); }
+ //! <b>Effects</b>: Copy constructs a vector using the specified allocator.
+ //!
+ //! <b>Postcondition</b>: x == *this.
+ //!
+ //! <b>Throws</b>: If allocation
+ //! throws or T's copy constructor throws.
+ //!
+ //! <b>Complexity</b>: Linear to the elements x contains.
+ vector(const vector &x, const allocator_type &a)
+ : base_t(a)
+ {
+ this->assign( container_detail::to_raw_pointer(x.members_.m_start)
+ , container_detail::to_raw_pointer(x.members_.m_start + x.members_.m_size));
+ }
+
+ //! <b>Effects</b>: Move constructor using the specified allocator.
+ //! Moves mx's resources to *this if a == allocator_type().
+ //! Otherwise copies values from x to *this.
+ //!
+ //! <b>Throws</b>: If allocation or T's copy constructor throws.
+ //!
+ //! <b>Complexity</b>: Constant if a == mx.get_allocator(), linear otherwise.
+ vector(BOOST_RV_REF(vector) mx, const allocator_type &a)
+ : base_t(a)
+ {
+ if(mx.alloc() == a){
+ this->swap_members(mx);
+ }
+ else{
+ this->assign( container_detail::to_raw_pointer(mx.members_.m_start)
+ , container_detail::to_raw_pointer(mx.members_.m_start + mx.members_.m_size));
+ }
+ }
+
//! <b>Effects</b>: Constructs a vector that will use a copy of allocator a
//! and inserts a copy of the range [first, last) in the vector.
//!
@@ -562,103 +597,103 @@ class vector : private container_detail::vector_alloc_holder<A>
{} //vector_alloc_holder clears the data
//! <b>Effects</b>: Returns an iterator to the first element contained in the vector.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
iterator begin() BOOST_CONTAINER_NOEXCEPT
{ return iterator(this->members_.m_start); }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the vector.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_iterator begin() const BOOST_CONTAINER_NOEXCEPT
{ return const_iterator(this->members_.m_start); }
//! <b>Effects</b>: Returns an iterator to the end of the vector.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
iterator end() BOOST_CONTAINER_NOEXCEPT
{ return iterator(this->members_.m_start + this->members_.m_size); }
//! <b>Effects</b>: Returns a const_iterator to the end of the vector.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_iterator end() const BOOST_CONTAINER_NOEXCEPT
{ return this->cend(); }
- //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
- //! of the reversed vector.
- //!
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
+ //! of the reversed vector.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
reverse_iterator rbegin() BOOST_CONTAINER_NOEXCEPT
{ return reverse_iterator(this->end()); }
- //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
- //! of the reversed vector.
- //!
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed vector.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_reverse_iterator rbegin() const BOOST_CONTAINER_NOEXCEPT
{ return this->crbegin(); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the end
- //! of the reversed vector.
- //!
+ //! of the reversed vector.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
reverse_iterator rend() BOOST_CONTAINER_NOEXCEPT
{ return reverse_iterator(this->begin()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
- //! of the reversed vector.
- //!
+ //! of the reversed vector.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_reverse_iterator rend() const BOOST_CONTAINER_NOEXCEPT
{ return this->crend(); }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the vector.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_iterator cbegin() const BOOST_CONTAINER_NOEXCEPT
{ return const_iterator(this->members_.m_start); }
//! <b>Effects</b>: Returns a const_iterator to the end of the vector.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_iterator cend() const BOOST_CONTAINER_NOEXCEPT
{ return const_iterator(this->members_.m_start + this->members_.m_size); }
- //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
- //! of the reversed vector.
- //!
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed vector.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_reverse_iterator crbegin() const BOOST_CONTAINER_NOEXCEPT
{ return const_reverse_iterator(this->end());}
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
- //! of the reversed vector.
- //!
+ //! of the reversed vector.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_reverse_iterator crend() const BOOST_CONTAINER_NOEXCEPT
{ return const_reverse_iterator(this->begin()); }
@@ -667,9 +702,9 @@ class vector : private container_detail::vector_alloc_holder<A>
//!
//! <b>Effects</b>: Returns a reference to the first
//! element of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
reference front() BOOST_CONTAINER_NOEXCEPT
{ return *this->members_.m_start; }
@@ -678,9 +713,9 @@ class vector : private container_detail::vector_alloc_holder<A>
//!
//! <b>Effects</b>: Returns a const reference to the first
//! element of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_reference front() const BOOST_CONTAINER_NOEXCEPT
{ return *this->members_.m_start; }
@@ -689,9 +724,9 @@ class vector : private container_detail::vector_alloc_holder<A>
//!
//! <b>Effects</b>: Returns a reference to the last
//! element of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
reference back() BOOST_CONTAINER_NOEXCEPT
{ return this->members_.m_start[this->members_.m_size - 1]; }
@@ -700,132 +735,132 @@ class vector : private container_detail::vector_alloc_holder<A>
//!
//! <b>Effects</b>: Returns a const reference to the last
//! element of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_reference back() const BOOST_CONTAINER_NOEXCEPT
{ return this->members_.m_start[this->members_.m_size - 1]; }
//! <b>Returns</b>: A pointer such that [data(),data() + size()) is a valid range.
//! For a non-empty vector, data() == &front().
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
pointer data() BOOST_CONTAINER_NOEXCEPT
{ return this->members_.m_start; }
//! <b>Returns</b>: A pointer such that [data(),data() + size()) is a valid range.
//! For a non-empty vector, data() == &front().
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_pointer data() const BOOST_CONTAINER_NOEXCEPT
{ return this->members_.m_start; }
//! <b>Effects</b>: Returns the number of the elements contained in the vector.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
size_type size() const BOOST_CONTAINER_NOEXCEPT
{ return this->members_.m_size; }
//! <b>Effects</b>: Returns the largest possible size of the vector.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
size_type max_size() const BOOST_CONTAINER_NOEXCEPT
{ return allocator_traits_type::max_size(this->alloc()); }
//! <b>Effects</b>: Number of elements for which memory has been allocated.
//! capacity() is always greater than or equal to size().
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
size_type capacity() const BOOST_CONTAINER_NOEXCEPT
{ return this->members_.m_capacity; }
//! <b>Effects</b>: Returns true if the vector contains no elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
bool empty() const BOOST_CONTAINER_NOEXCEPT
{ return !this->members_.m_size; }
//! <b>Requires</b>: size() > n.
//!
- //! <b>Effects</b>: Returns a reference to the nth element
+ //! <b>Effects</b>: Returns a reference to the nth element
//! from the beginning of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- reference operator[](size_type n)
+ reference operator[](size_type n)
{ return this->members_.m_start[n]; }
//! <b>Requires</b>: size() > n.
//!
- //! <b>Effects</b>: Returns a const reference to the nth element
+ //! <b>Effects</b>: Returns a const reference to the nth element
//! from the beginning of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_reference operator[](size_type n) const BOOST_CONTAINER_NOEXCEPT
{ return this->members_.m_start[n]; }
//! <b>Requires</b>: size() > n.
//!
- //! <b>Effects</b>: Returns a reference to the nth element
+ //! <b>Effects</b>: Returns a reference to the nth element
//! from the beginning of the container.
- //!
+ //!
//! <b>Throws</b>: std::range_error if n >= size()
- //!
+ //!
//! <b>Complexity</b>: Constant.
- reference at(size_type n)
+ reference at(size_type n)
{ this->priv_check_range(n); return this->members_.m_start[n]; }
//! <b>Requires</b>: size() > n.
//!
- //! <b>Effects</b>: Returns a const reference to the nth element
+ //! <b>Effects</b>: Returns a const reference to the nth element
//! from the beginning of the container.
- //!
+ //!
//! <b>Throws</b>: std::range_error if n >= size()
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_reference at(size_type n) const
{ this->priv_check_range(n); return this->members_.m_start[n]; }
//! <b>Effects</b>: Returns a copy of the internal allocator.
- //!
+ //!
//! <b>Throws</b>: If allocator's copy constructor throws.
- //!
+ //!
//! <b>Complexity</b>: Constant.
allocator_type get_allocator() const BOOST_CONTAINER_NOEXCEPT
{ return this->alloc(); }
//! <b>Effects</b>: Returns a reference to the internal allocator.
- //!
+ //!
//! <b>Throws</b>: Nothing
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Non-standard extension.
const stored_allocator_type &get_stored_allocator() const BOOST_CONTAINER_NOEXCEPT
{ return this->alloc(); }
//! <b>Effects</b>: Returns a reference to the internal allocator.
- //!
+ //!
//! <b>Throws</b>: Nothing
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Non-standard extension.
stored_allocator_type &get_stored_allocator() BOOST_CONTAINER_NOEXCEPT
{ return this->alloc(); }
@@ -834,7 +869,7 @@ class vector : private container_detail::vector_alloc_holder<A>
//! effect. Otherwise, it is a request for allocation of additional memory.
//! If the request is successful, then capacity() is greater than or equal to
//! n; otherwise, capacity() is unchanged. In either case, size() is unchanged.
- //!
+ //!
//! <b>Throws</b>: If memory allocation allocation throws or T's copy/move constructor throws.
void reserve(size_type new_cap)
{
@@ -893,8 +928,8 @@ class vector : private container_detail::vector_alloc_holder<A>
//! <b>Effects</b>: Makes *this contain the same elements as x.
//!
- //! <b>Postcondition</b>: this->size() == x.size(). *this contains a copy
- //! of each of x's elements.
+ //! <b>Postcondition</b>: this->size() == x.size(). *this contains a copy
+ //! of each of x's elements.
//!
//! <b>Throws</b>: If memory allocation throws or T's copy/move constructor/assignment throws.
//!
@@ -967,7 +1002,7 @@ class vector : private container_detail::vector_alloc_holder<A>
//!
//! <b>Complexity</b>: Linear to n.
template <class InIt>
- void assign(InIt first, InIt last)
+ void assign(InIt first, InIt last)
{
//Dispatch depending on integer/iterator
const bool aux_boolean = container_detail::is_convertible<InIt, size_type>::value;
@@ -1078,7 +1113,7 @@ class vector : private container_detail::vector_alloc_holder<A>
#include BOOST_PP_LOCAL_ITERATE()
#endif //#ifdef BOOST_CONTAINER_PERFECT_FORWARDING
-
+
//! <b>Effects</b>: Swaps the contents of *this and x.
//!
//! <b>Throws</b>: Nothing.
@@ -1149,7 +1184,7 @@ class vector : private container_detail::vector_alloc_holder<A>
//! <b>Throws</b>: Nothing.
//!
//! <b>Complexity</b>: Constant time.
- void pop_back()
+ void pop_back()
{
//Destroy last element
--this->members_.m_size;
@@ -1160,9 +1195,9 @@ class vector : private container_detail::vector_alloc_holder<A>
//!
//! <b>Throws</b>: Nothing.
//!
- //! <b>Complexity</b>: Linear to the elements between pos and the
+ //! <b>Complexity</b>: Linear to the elements between pos and the
//! last element. Constant if pos is the last element.
- iterator erase(const_iterator position)
+ iterator erase(const_iterator position)
{
T *pos = container_detail::to_raw_pointer(position.get_ptr());
T *beg = container_detail::to_raw_pointer(this->members_.m_start);
@@ -1179,7 +1214,7 @@ class vector : private container_detail::vector_alloc_holder<A>
//!
//! <b>Complexity</b>: Linear to the distance between first and last
//! plus linear to the elements between pos and the last element.
- iterator erase(const_iterator first, const_iterator last)
+ iterator erase(const_iterator first, const_iterator last)
{
if (first != last){ // worth doing, copy down over hole
T* end_pos = container_detail::to_raw_pointer(this->members_.m_start) + this->members_.m_size;
@@ -1201,7 +1236,7 @@ class vector : private container_detail::vector_alloc_holder<A>
//! <b>Throws</b>: If memory allocation throws, or T's copy constructor throws.
//!
//! <b>Complexity</b>: Linear to the difference between size() and new_size.
- void resize(size_type new_size, const T& x)
+ void resize(size_type new_size, const T& x)
{
pointer finish = this->members_.m_start + this->members_.m_size;
if (new_size < size()){
@@ -1220,7 +1255,7 @@ class vector : private container_detail::vector_alloc_holder<A>
//! <b>Throws</b>: If memory allocation throws, or T's copy constructor throws.
//!
//! <b>Complexity</b>: Linear to the difference between size() and new_size.
- void resize(size_type new_size)
+ void resize(size_type new_size)
{
if (new_size < this->size()){
//Destroy last elements
@@ -1253,8 +1288,23 @@ class vector : private container_detail::vector_alloc_holder<A>
/// @cond
+ //Absolutely experimental. This function might change, disappear or simply crash!
+ template<class BiDirPosConstIt, class BiDirValueIt>
+ void insert_ordered_at(size_type element_count, BiDirPosConstIt last_position_it, BiDirValueIt last_value_it)
+ {
+ const size_type *dummy = 0;
+ this->priv_insert_ordered_at(element_count, last_position_it, false, &dummy[0], last_value_it);
+ }
+
+ //Absolutely experimental. This function might change, disappear or simply crash!
+ template<class BiDirPosConstIt, class BiDirSkipConstIt, class BiDirValueIt>
+ void insert_ordered_at(size_type element_count, BiDirPosConstIt last_position_it, BiDirSkipConstIt last_skip_it, BiDirValueIt last_value_it)
+ {
+ this->priv_insert_ordered_at(element_count, last_position_it, true, last_skip_it, last_value_it);
+ }
+
private:
- iterator priv_insert(const_iterator position, const T &x)
+ iterator priv_insert(const_iterator position, const T &x)
{
//Just call more general insert(pos, size, value) and return iterator
size_type pos_n = position - cbegin();
@@ -1262,7 +1312,7 @@ class vector : private container_detail::vector_alloc_holder<A>
return iterator(this->members_.m_start + pos_n);
}
- iterator priv_insert(const_iterator position, BOOST_RV_REF(T) x)
+ iterator priv_insert(const_iterator position, BOOST_RV_REF(T) x)
{
//Just call more general insert(pos, size, value) and return iterator
size_type pos_n = position - cbegin();
@@ -1352,7 +1402,7 @@ class vector : private container_detail::vector_alloc_holder<A>
template <class FwdIt>
void priv_range_insert(const_iterator pos, FwdIt first, FwdIt last, std::forward_iterator_tag)
{
- if(first != last){
+ if(first != last){
const size_type n = std::distance(first, last);
container_detail::advanced_insert_aux_proxy<A, FwdIt, T*> proxy(this->alloc(), first, last);
priv_range_insert(pos.get_ptr(), n, proxy);
@@ -1393,7 +1443,7 @@ class vector : private container_detail::vector_alloc_holder<A>
this->members_.m_capacity = real_cap;
}
}
-
+
//If we had room or we have expanded forward
if (same_buffer_start){
#ifdef BOOST_CONTAINER_VECTOR_ALLOC_STATS
@@ -1428,6 +1478,156 @@ class vector : private container_detail::vector_alloc_holder<A>
}
}
+ //Absolutely experimental. This function might change, disappear or simply crash!
+ template<class BiDirPosConstIt, class BiDirSkipConstIt, class BiDirValueIt>
+ void priv_insert_ordered_at( size_type element_count, BiDirPosConstIt last_position_it
+ , bool do_skip, BiDirSkipConstIt last_skip_it, BiDirValueIt last_value_it)
+ {
+ const size_type old_size_pos = this->size();
+ this->reserve(old_size_pos + element_count);
+ T* const begin_ptr = container_detail::to_raw_pointer(this->members_.m_start);
+ size_type insertions_left = element_count;
+ size_type next_pos = old_size_pos;
+ size_type hole_size = element_count;
+
+ //Exception rollback. If any copy throws before the hole is filled, values
+ //already inserted/copied at the end of the buffer will be destroyed.
+ typename value_traits::ArrayDestructor past_hole_values_destroyer
+ (begin_ptr + old_size_pos + element_count, this->alloc(), size_type(0u));
+ //Loop for each insertion backwards, first moving the elements after the insertion point,
+ //then inserting the element.
+ while(insertions_left){
+ const size_type pos = static_cast<size_type>(*(--last_position_it));
+ BOOST_ASSERT(pos <= old_size_pos);
+ //If needed shift the range after the insertion point and the previous insertion point.
+ //Function will take care if the shift crosses the size() boundary, using copy/move
+ //or uninitialized copy/move if necessary.
+ size_type new_hole_size = (pos != next_pos)
+ ? priv_insert_ordered_at_shift_range(pos, next_pos, this->size(), insertions_left)
+ : hole_size
+ ;
+ if(new_hole_size > 0){
+ //The hole was reduced by priv_insert_ordered_at_shift_range so expand exception rollback range backwards
+ past_hole_values_destroyer.increment_size_backwards(next_pos - pos);
+ //Insert the new value in the hole
+ allocator_traits_type::construct(this->alloc(), begin_ptr + pos + insertions_left - 1, *(--last_value_it));
+ --new_hole_size;
+ if(new_hole_size == 0){
+ //Hole was just filled, disable exception rollback and change vector size
+ past_hole_values_destroyer.release();
+ this->members_.m_size += element_count;
+ }
+ else{
+ //The hole was reduced by the new insertion by one
+ past_hole_values_destroyer.increment_size_backwards(size_type(1u));
+ }
+ }
+ else{
+ if(hole_size){
+ //Hole was just filled by priv_insert_ordered_at_shift_range, disable exception rollback and change vector size
+ past_hole_values_destroyer.release();
+ this->members_.m_size += element_count;
+ }
+ //Insert the new value in the already constructed range
+ begin_ptr[pos + insertions_left - 1] = *(--last_value_it);
+ }
+ if(do_skip){
+ size_type n = *(--last_skip_it);
+ while(n--){
+ --last_value_it;
+ }
+ }
+ --insertions_left;
+ hole_size = new_hole_size;
+ next_pos = pos;
+ }
+ }
+
+ //Takes the range pointed by [first_pos, last_pos) and shifts it to the right
+ //by 'shift_count'. 'limit_pos' marks the end of constructed elements.
+ //
+ //Precondition: first_pos <= last_pos <= limit_pos
+ //
+ //The shift operation might cross limit_pos so elements to moved beyond limit_pos
+ //are uninitialized_moved with an allocator. Other elements are moved.
+ //
+ //The shift operation might left uninitialized elements after limit_pos
+ //and the number of uninitialized elements is returned by the function.
+ //
+ //Old situation:
+ // first_pos last_pos old_limit
+ // | | |
+ // ____________V_______V__________________V_____________
+ //| prefix | range | suffix |raw_mem ~
+ //|____________|_______|__________________|_____________~
+ //
+ //New situation in Case A (hole_size == 0):
+ // range is moved through move assignments
+ //
+ // first_pos last_pos old_limit
+ // | | |
+ // ____________V_______V__________________V_____________
+ //| prefix' | | | range |suffix'|raw_mem ~
+ //|________________+______|___^___|_______|_____________~
+ // | |
+ // |_>_>_>_>_>^
+ //
+ //
+ //New situation in Case B (hole_size >= 0):
+ // range is moved through uninitialized moves
+ //
+ // first_pos last_pos old_limit
+ // | | |
+ // ____________V_______V__________________V________________
+ //| prefix' | | | [hole] | range |
+ //|_______________________________________|________|___^___|
+ // | |
+ // |_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_^
+ //
+ //New situation in Case C (hole_size == 0):
+ // range is moved through move assignments and uninitialized moves
+ //
+ // first_pos last_pos old_limit
+ // | | |
+ // ____________V_______V__________________V___
+ //| prefix' | | | range |
+ //|___________________________________|___^___|
+ // | |
+ // |_>_>_>_>_>_>_>_>_>_>_>^
+ size_type priv_insert_ordered_at_shift_range(size_type first_pos, size_type last_pos, size_type limit_pos, size_type shift_count)
+ {
+ BOOST_ASSERT(first_pos <= last_pos);
+ BOOST_ASSERT(last_pos <= limit_pos);
+ //
+ T* const begin_ptr = container_detail::to_raw_pointer(this->members_.m_start);
+
+ size_type hole_size = 0;
+ //Case A:
+ if((last_pos + shift_count) <= limit_pos){
+ //All move assigned
+ boost::move_backward(begin_ptr + first_pos, begin_ptr + last_pos, begin_ptr + last_pos + shift_count);
+ }
+ //Case B:
+ else if((first_pos + shift_count) >= limit_pos){
+ //All uninitialized_moved
+ ::boost::container::uninitialized_move_alloc
+ (this->alloc(), begin_ptr + first_pos, begin_ptr + last_pos, begin_ptr + first_pos + shift_count);
+ hole_size = last_pos + shift_count - limit_pos;
+ }
+ //Case C:
+ else{
+ //Some uninitialized_moved
+ T* const limit_ptr = begin_ptr + limit_pos;
+ T* const boundary_ptr = limit_ptr - shift_count;
+ ::boost::container::uninitialized_move_alloc
+ (this->alloc(), boundary_ptr, begin_ptr + last_pos, limit_ptr);
+ //The rest is move assigned
+ boost::move_backward(begin_ptr + first_pos, boundary_ptr, limit_ptr);
+ }
+ return hole_size;
+ }
+
+ private:
void priv_range_insert_expand_forward(T* pos, size_type n, advanced_insert_aux_int_t &interf)
{
//n can't be 0, because there is nothing to do in that case
@@ -1471,7 +1671,7 @@ class vector : private container_detail::vector_alloc_holder<A>
typename value_traits::ArrayDeallocator scoped_alloc(new_start, this->alloc(), new_cap);
typename value_traits::ArrayDestructor constructed_values_destroyer(new_start, this->alloc(), 0u);
- //Initialize with [begin(), pos) old buffer
+ //Initialize with [begin(), pos) old buffer
//the start of the new buffer
T *old_buffer = container_detail::to_raw_pointer(this->members_.m_start);
if(old_buffer){
@@ -1483,7 +1683,7 @@ class vector : private container_detail::vector_alloc_holder<A>
interf.uninitialized_copy_remaining_to(old_finish = new_finish);
new_finish += n;
constructed_values_destroyer.increment_size(new_finish - old_finish);
- //Initialize from the rest of the old buffer,
+ //Initialize from the rest of the old buffer,
//starting from previous point
if(old_buffer){
new_finish = ::boost::container::uninitialized_move_alloc
@@ -1491,7 +1691,7 @@ class vector : private container_detail::vector_alloc_holder<A>
//Destroy and deallocate old elements
//If there is allocated memory, destroy and deallocate
if(!value_traits::trivial_dctr_after_move)
- this->destroy_n(old_buffer, this->members_.m_size);
+ this->destroy_n(old_buffer, this->members_.m_size);
this->alloc().deallocate(this->members_.m_start, this->members_.m_capacity);
}
this->members_.m_start = new_start;
@@ -1637,7 +1837,7 @@ class vector : private container_detail::vector_alloc_holder<A>
//|___________|_____|_________|_____________________|
//
//Copy the first part of old_begin to raw_mem
- T *start_n = old_start + difference_type(s_before);
+ T *start_n = old_start + difference_type(s_before);
::boost::container::uninitialized_move_alloc
(this->alloc(), old_start, start_n, new_start);
//The buffer is all constructed until old_end,
@@ -1846,7 +2046,7 @@ class vector : private container_detail::vector_alloc_holder<A>
this->members_.m_capacity = real_cap;
}
}
-
+
if(same_buffer_start){
T *start = container_detail::to_raw_pointer(this->members_.m_start);
if (this->size() >= n){
@@ -1875,7 +2075,7 @@ class vector : private container_detail::vector_alloc_holder<A>
scoped_alloc.release();
//Destroy and deallocate old buffer
if(this->members_.m_start != 0){
- this->destroy_n(container_detail::to_raw_pointer(this->members_.m_start), this->members_.m_size);
+ this->destroy_n(container_detail::to_raw_pointer(this->members_.m_start), this->members_.m_size);
this->alloc().deallocate(this->members_.m_start, this->members_.m_capacity);
}
this->members_.m_start = ret.first;
@@ -1893,7 +2093,7 @@ class vector : private container_detail::vector_alloc_holder<A>
this->members_.m_size = 0;
this->members_.m_start = ret.first;
this->members_.m_capacity = real_cap;
-
+
//Backup old buffer data
size_type old_offset = old_start - container_detail::to_raw_pointer(ret.first);
size_type first_count = container_detail::min_value(n, old_offset);
@@ -1904,7 +2104,7 @@ class vector : private container_detail::vector_alloc_holder<A>
(this->alloc(), first, mid, container_detail::to_raw_pointer(ret.first));
if(old_offset > n){
- //All old elements will be destroyed by "old_values_destroyer"
+ //All old elements will be destroyed by "old_values_destroyer"
this->members_.m_size = n;
}
else{
@@ -1919,7 +2119,7 @@ class vector : private container_detail::vector_alloc_holder<A>
std::advance(mid2, second_count);
// iG std::copy(mid, mid2, old_start);
std::copy(mid, mid2, old_start);
-
+
//Check if we still have to append elements in the
//uninitialized end
if(second_count == old_size){
@@ -1932,7 +2132,7 @@ class vector : private container_detail::vector_alloc_holder<A>
(old_start + second_count, old_size - second_count);
this->members_.m_size = n;
}
- this->members_.m_size = n;
+ this->members_.m_size = n;
}
}
}
@@ -1943,18 +2143,18 @@ class vector : private container_detail::vector_alloc_holder<A>
template <class InIt>
void priv_assign_dispatch(InIt first, InIt last, container_detail::false_)
- {
+ {
//Dispatch depending on integer/iterator
typedef typename std::iterator_traits<InIt>::iterator_category ItCat;
- this->priv_assign_aux(first, last, ItCat());
+ this->priv_assign_aux(first, last, ItCat());
}
template <class Integer>
- void priv_insert_dispatch(const_iterator pos, Integer n, Integer val, container_detail::true_)
+ void priv_insert_dispatch(const_iterator pos, Integer n, Integer val, container_detail::true_)
{ this->insert(pos, (size_type)n, (T)val); }
template <class InIt>
- void priv_insert_dispatch(const_iterator pos, InIt first,
+ void priv_insert_dispatch(const_iterator pos, InIt first,
InIt last, container_detail::false_)
{
//Dispatch depending on integer/iterator
@@ -1962,7 +2162,7 @@ class vector : private container_detail::vector_alloc_holder<A>
this->priv_range_insert(pos, first, last, ItCat());
}
- void priv_check_range(size_type n) const
+ void priv_check_range(size_type n) const
{
//If n is out of range, throw an out_of_range exception
if (n >= size())
@@ -1982,7 +2182,7 @@ class vector : private container_detail::vector_alloc_holder<A>
};
template <class T, class A>
-inline bool
+inline bool
operator==(const vector<T, A>& x, const vector<T, A>& y)
{
//Check first size and each element if needed
@@ -1990,7 +2190,7 @@ operator==(const vector<T, A>& x, const vector<T, A>& y)
}
template <class T, class A>
-inline bool
+inline bool
operator!=(const vector<T, A>& x, const vector<T, A>& y)
{
//Check first size and each element if needed
@@ -1998,7 +2198,7 @@ operator!=(const vector<T, A>& x, const vector<T, A>& y)
}
template <class T, class A>
-inline bool
+inline bool
operator<(const vector<T, A>& x, const vector<T, A>& y)
{
return std::lexicographical_compare(x.begin(), x.end(), y.begin(), y.end());
diff --git a/boost/context/all.hpp b/boost/context/all.hpp
new file mode 100644
index 0000000000..f9a4c71dbf
--- /dev/null
+++ b/boost/context/all.hpp
@@ -0,0 +1,14 @@
+
+// Copyright Oliver Kowalke 2009.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_CTX_ALL_H
+#define BOOST_CTX_ALL_H
+
+#include <boost/context/fcontext.hpp>
+#include <boost/context/stack_allocator.hpp>
+#include <boost/context/stack_utils.hpp>
+
+#endif // BOOST_CTX_ALL_H
diff --git a/boost/context/detail/config.hpp b/boost/context/detail/config.hpp
new file mode 100644
index 0000000000..50ada3c507
--- /dev/null
+++ b/boost/context/detail/config.hpp
@@ -0,0 +1,42 @@
+
+// Copyright Oliver Kowalke 2009.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_CTX_DETAIL_CONFIG_H
+#define BOOST_CTX_DETAIL_CONFIG_H
+
+#include <boost/config.hpp>
+#include <boost/detail/workaround.hpp>
+
+#ifdef BOOST_CONTEXT_DECL
+# undef BOOST_CONTEXT_DECL
+#endif
+
+#if defined(BOOST_HAS_DECLSPEC)
+# if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_CONTEXT_DYN_LINK)
+# if ! defined(BOOST_DYN_LINK)
+# define BOOST_DYN_LINK
+# endif
+# if defined(BOOST_CONTEXT_SOURCE)
+# define BOOST_CONTEXT_DECL BOOST_SYMBOL_EXPORT
+# else
+# define BOOST_CONTEXT_DECL BOOST_SYMBOL_IMPORT
+# endif
+# endif
+#endif
+
+#if ! defined(BOOST_CONTEXT_DECL)
+# define BOOST_CONTEXT_DECL
+#endif
+
+#if ! defined(BOOST_CONTEXT_SOURCE) && ! defined(BOOST_ALL_NO_LIB) && ! defined(BOOST_CONTEXT_NO_LIB)
+# define BOOST_LIB_NAME boost_context
+# if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_CONTEXT_DYN_LINK)
+# define BOOST_DYN_LINK
+# endif
+# include <boost/config/auto_link.hpp>
+#endif
+
+#endif // BOOST_CTX_DETAIL_CONFIG_H
diff --git a/boost/context/detail/fcontext_arm.hpp b/boost/context/detail/fcontext_arm.hpp
new file mode 100644
index 0000000000..b4ed2fa264
--- /dev/null
+++ b/boost/context/detail/fcontext_arm.hpp
@@ -0,0 +1,66 @@
+
+// Copyright Oliver Kowalke 2009.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_CTX_DETAIL_FCONTEXT_ARM_H
+#define BOOST_CTX_DETAIL_FCONTEXT_ARM_H
+
+#include <boost/config.hpp>
+#include <boost/cstdint.hpp>
+
+#include <boost/context/detail/config.hpp>
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+namespace boost {
+namespace ctx {
+
+extern "C" {
+
+#define BOOST_CONTEXT_CALLDECL
+
+struct stack_t
+{
+ void * base;
+ void * limit;
+
+ stack_t() :
+ base( 0), limit( 0)
+ {}
+};
+
+struct fp_t
+{
+ boost::uint32_t fc_freg[16];
+
+ fp_t() :
+ fc_freg()
+ {}
+};
+
+struct fcontext_t
+{
+ boost::uint32_t fc_greg[11];
+ stack_t fc_stack;
+ fp_t fc_fp;
+
+ fcontext_t() :
+ fc_greg(),
+ fc_stack(),
+ fc_fp()
+ {}
+};
+
+}
+
+}}
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+#endif // BOOST_CTX_DETAIL_FCONTEXT_ARM_H
diff --git a/boost/context/detail/fcontext_i386.hpp b/boost/context/detail/fcontext_i386.hpp
new file mode 100644
index 0000000000..573a22caf3
--- /dev/null
+++ b/boost/context/detail/fcontext_i386.hpp
@@ -0,0 +1,68 @@
+
+// Copyright Oliver Kowalke 2009.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_CTX_DETAIL_FCONTEXT_I386H
+#define BOOST_CTX_DETAIL_FCONTEXT_I386H
+
+#include <cstddef>
+
+#include <boost/config.hpp>
+#include <boost/cstdint.hpp>
+
+#include <boost/context/detail/config.hpp>
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+namespace boost {
+namespace ctx {
+
+extern "C" {
+
+#define BOOST_CONTEXT_CALLDECL __attribute__((cdecl))
+
+struct stack_t
+{
+ void * base;
+ void * limit;
+
+ stack_t() :
+ base( 0), limit( 0)
+ {}
+};
+
+struct fp_t
+{
+ boost::uint32_t fc_freg[2];
+
+ fp_t() :
+ fc_freg()
+ {}
+};
+
+struct fcontext_t
+{
+ boost::uint32_t fc_greg[6];
+ stack_t fc_stack;
+ fp_t fc_fp;
+
+ fcontext_t() :
+ fc_greg(),
+ fc_stack(),
+ fc_fp()
+ {}
+};
+
+}
+
+}}
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+#endif // BOOST_CTX_DETAIL_FCONTEXT_I386_H
diff --git a/boost/context/detail/fcontext_i386_win.hpp b/boost/context/detail/fcontext_i386_win.hpp
new file mode 100644
index 0000000000..e250ec5e3b
--- /dev/null
+++ b/boost/context/detail/fcontext_i386_win.hpp
@@ -0,0 +1,83 @@
+
+// Copyright Oliver Kowalke 2009.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_CTX_DETAIL_FCONTEXT_I386H
+#define BOOST_CTX_DETAIL_FCONTEXT_I386H
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+#include <boost/config.hpp>
+#include <boost/cstdint.hpp>
+
+#include <boost/context/detail/config.hpp>
+
+#if defined(BOOST_MSVC)
+#pragma warning(push)
+#pragma warning(disable:4351)
+#endif
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+namespace boost {
+namespace ctx {
+
+extern "C" {
+
+#define BOOST_CONTEXT_CALLDECL __cdecl
+
+struct stack_t
+{
+ void * base;
+ void * limit;
+
+ stack_t() :
+ base( 0), limit( 0)
+ {}
+};
+
+struct fp_t
+{
+ boost::uint32_t fc_freg[2];
+
+ fp_t() :
+ fc_freg()
+ {}
+};
+
+struct fcontext_t
+{
+ boost::uint32_t fc_greg[6];
+ stack_t fc_stack;
+ void * fc_excpt_lst;
+ void * fc_local_storage;
+ fp_t fc_fp;
+
+ fcontext_t() :
+ fc_greg(),
+ fc_stack(),
+ fc_excpt_lst( 0),
+ fc_local_storage( 0),
+ fc_fp()
+ {}
+};
+
+}
+
+}}
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+#if defined(BOOST_MSVC)
+#pragma warning(pop)
+#endif
+
+#endif // BOOST_CTX_DETAIL_FCONTEXT_I386_H
diff --git a/boost/context/detail/fcontext_mips.hpp b/boost/context/detail/fcontext_mips.hpp
new file mode 100644
index 0000000000..1645adfb8b
--- /dev/null
+++ b/boost/context/detail/fcontext_mips.hpp
@@ -0,0 +1,68 @@
+
+// Copyright Oliver Kowalke 2009.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_CTX_DETAIL_FCONTEXT_MIPS_H
+#define BOOST_CTX_DETAIL_FCONTEXT_MIPS_H
+
+#include <boost/config.hpp>
+#include <boost/cstdint.hpp>
+
+#include <boost/context/detail/config.hpp>
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+namespace boost {
+namespace ctx {
+
+extern "C" {
+
+#define BOOST_CONTEXT_CALLDECL
+
+// on MIPS we assume 64bit regsiters - even for 32bit ABIs
+
+struct stack_t
+{
+ void * base;
+ void * limit;
+
+ stack_t() :
+ base( 0), limit( 0)
+ {}
+};
+
+struct fp_t
+{
+ boost::uint64_t fc_freg[6];
+
+ fp_t() :
+ fc_freg()
+ {}
+};
+
+struct fcontext_t
+{
+ boost::uint64_t fc_greg[13];
+ stack_t fc_stack;
+ fp_t fc_fp;
+
+ fcontext_t() :
+ fc_greg(),
+ fc_stack(),
+ fc_fp()
+ {}
+};
+
+}
+
+}}
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+#endif // BOOST_CTX_DETAIL_FCONTEXT_MIPS_H
diff --git a/boost/context/detail/fcontext_ppc.hpp b/boost/context/detail/fcontext_ppc.hpp
new file mode 100644
index 0000000000..5e6c64c555
--- /dev/null
+++ b/boost/context/detail/fcontext_ppc.hpp
@@ -0,0 +1,70 @@
+
+// Copyright Oliver Kowalke 2009.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_CTX_DETAIL_FCONTEXT_PPC_H
+#define BOOST_CTX_DETAIL_FCONTEXT_PPC_H
+
+#include <boost/config.hpp>
+#include <boost/cstdint.hpp>
+
+#include <boost/context/detail/config.hpp>
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+namespace boost {
+namespace ctx {
+
+extern "C" {
+
+#define BOOST_CONTEXT_CALLDECL
+
+struct stack_t
+{
+ void * base;
+ void * limit;
+
+ stack_t() :
+ base( 0), limit( 0)
+ {}
+};
+
+struct fp_t
+{
+ boost::uint64_t fc_freg[19];
+
+ fp_t() :
+ fc_freg()
+ {}
+};
+
+struct fcontext_t
+{
+# if defined(__powerpc64__)
+ boost::uint64_t fc_greg[23];
+# else
+ boost::uint32_t fc_greg[23];
+# endif
+ stack_t fc_stack;
+ fp_t fc_fp;
+
+ fcontext_t() :
+ fc_greg(),
+ fc_stack(),
+ fc_fp()
+ {}
+};
+
+}
+
+}}
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+#endif // BOOST_CTX_DETAIL_FCONTEXT_PPC_H
diff --git a/boost/context/detail/fcontext_x86_64.hpp b/boost/context/detail/fcontext_x86_64.hpp
new file mode 100644
index 0000000000..106ee74065
--- /dev/null
+++ b/boost/context/detail/fcontext_x86_64.hpp
@@ -0,0 +1,66 @@
+
+// Copyright Oliver Kowalke 2009.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_CTX_DETAIL_FCONTEXT_X86_64_H
+#define BOOST_CTX_DETAIL_FCONTEXT_X86_64_H
+
+#include <boost/config.hpp>
+#include <boost/cstdint.hpp>
+
+#include <boost/context/detail/config.hpp>
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+namespace boost {
+namespace ctx {
+
+extern "C" {
+
+#define BOOST_CONTEXT_CALLDECL
+
+struct stack_t
+{
+ void * base;
+ void * limit;
+
+ stack_t() :
+ base( 0), limit( 0)
+ {}
+};
+
+struct fp_t
+{
+ boost::uint32_t fc_freg[2];
+
+ fp_t() :
+ fc_freg()
+ {}
+};
+
+struct fcontext_t
+{
+ boost::uint64_t fc_greg[8];
+ stack_t fc_stack;
+ fp_t fc_fp;
+
+ fcontext_t() :
+ fc_greg(),
+ fc_stack(),
+ fc_fp()
+ {}
+};
+
+}
+
+}}
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+#endif // BOOST_CTX_DETAIL_FCONTEXT_X86_64_H
diff --git a/boost/context/detail/fcontext_x86_64_win.hpp b/boost/context/detail/fcontext_x86_64_win.hpp
new file mode 100644
index 0000000000..96f153b8e2
--- /dev/null
+++ b/boost/context/detail/fcontext_x86_64_win.hpp
@@ -0,0 +1,90 @@
+
+// Copyright Oliver Kowalke 2009.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_CTX_DETAIL_FCONTEXT_X86_64_H
+#define BOOST_CTX_DETAIL_FCONTEXT_X86_64_H
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+#include <boost/assert.hpp>
+#include <boost/config.hpp>
+#include <boost/cstdint.hpp>
+
+#include <boost/context/detail/config.hpp>
+
+#if defined(BOOST_MSVC)
+#pragma warning(push)
+#pragma warning(disable:4351)
+#endif
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+namespace boost {
+namespace ctx {
+
+extern "C" {
+
+#define BOOST_CONTEXT_CALLDECL
+
+struct stack_t
+{
+ void * base;
+ void * limit;
+
+ stack_t() :
+ base( 0), limit( 0)
+ {}
+};
+
+struct fp_t
+{
+ boost::uint32_t fc_freg[2];
+ void * fc_xmm;
+ char fc_buffer[175];
+
+ fp_t() :
+ fc_freg(),
+ fc_xmm( 0),
+ fc_buffer()
+ {
+ fc_xmm = fc_buffer;
+ if ( 0 != ( ( ( uintptr_t) fc_xmm) & 15) )
+ fc_xmm = ( char *) ( ( ( ( uintptr_t) fc_xmm) + 15) & ~0x0F);
+ }
+};
+
+struct fcontext_t
+{
+ boost::uint64_t fc_greg[10];
+ stack_t fc_stack;
+ void * fc_local_storage;
+ fp_t fc_fp;
+
+ fcontext_t() :
+ fc_greg(),
+ fc_stack(),
+ fc_local_storage( 0),
+ fc_fp()
+ {}
+};
+
+}
+
+}}
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+#if defined(BOOST_MSVC)
+#pragma warning(pop)
+#endif
+
+#endif // BOOST_CTX_DETAIL_FCONTEXT_X86_64_H
diff --git a/boost/context/fcontext.hpp b/boost/context/fcontext.hpp
new file mode 100644
index 0000000000..d2cc030a1e
--- /dev/null
+++ b/boost/context/fcontext.hpp
@@ -0,0 +1,82 @@
+
+// Copyright Oliver Kowalke 2009.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_CTX_FCONTEXT_H
+#define BOOST_CTX_FCONTEXT_H
+
+#if defined(__PGI)
+#include <stdint.h>
+#endif
+
+#include <boost/config.hpp>
+#include <boost/cstdint.hpp>
+
+#include <boost/context/detail/config.hpp>
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+// x86_64
+// test x86_64 before i386 because icc might
+// define __i686__ for x86_64 too
+#if defined(__x86_64__) || defined(__x86_64) \
+ || defined(__amd64__) || defined(__amd64) \
+ || defined(_M_X64) || defined(_M_AMD64)
+# if defined(BOOST_WINDOWS)
+# include <boost/context/detail/fcontext_x86_64_win.hpp>
+# else
+# include <boost/context/detail/fcontext_x86_64.hpp>
+# endif
+// i386
+#elif defined(i386) || defined(__i386__) || defined(__i386) \
+ || defined(__i486__) || defined(__i586__) || defined(__i686__) \
+ || defined(__X86__) || defined(_X86_) || defined(__THW_INTEL__) \
+ || defined(__I86__) || defined(__INTEL__) || defined(__IA32__) \
+ || defined(_M_IX86) || defined(_I86_)
+# if defined(BOOST_WINDOWS)
+# include <boost/context/detail/fcontext_i386_win.hpp>
+# else
+# include <boost/context/detail/fcontext_i386.hpp>
+# endif
+// arm
+#elif defined(__arm__) || defined(__thumb__) || defined(__TARGET_ARCH_ARM) \
+ || defined(__TARGET_ARCH_THUMB) || defined(_ARM)
+# include <boost/context/detail/fcontext_arm.hpp>
+// mips
+#elif (defined(__mips) && __mips == 1) || defined(_MIPS_ISA_MIPS1) \
+ || defined(_R3000)
+# include <boost/context/detail/fcontext_mips.hpp>
+// powerpc
+#elif defined(__powerpc) || defined(__powerpc__) || defined(__ppc) \
+ || defined(__ppc__) || defined(_ARCH_PPC) || defined(__POWERPC__) \
+ || defined(__PPCGECKO__) || defined(__PPCBROADWAY) || defined(_XENON)
+# include <boost/context/detail/fcontext_ppc.hpp>
+#else
+# error "platform not supported"
+#endif
+
+namespace boost {
+namespace ctx {
+namespace detail {
+
+extern "C" BOOST_CONTEXT_DECL void * BOOST_CONTEXT_CALLDECL align_stack( void * vp);
+
+}
+
+extern "C" BOOST_CONTEXT_DECL
+intptr_t BOOST_CONTEXT_CALLDECL jump_fcontext( fcontext_t * ofc, fcontext_t const* nfc, intptr_t vp, bool preserve_fpu = true);
+extern "C" BOOST_CONTEXT_DECL
+void BOOST_CONTEXT_CALLDECL make_fcontext( fcontext_t * fc, void (* fn)( intptr_t) );
+
+}}
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+#endif // BOOST_CTX_FCONTEXT_H
+
diff --git a/boost/context/stack_allocator.hpp b/boost/context/stack_allocator.hpp
new file mode 100644
index 0000000000..0db50157d1
--- /dev/null
+++ b/boost/context/stack_allocator.hpp
@@ -0,0 +1,37 @@
+
+// Copyright Oliver Kowalke 2009.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_CTX_STACK_ALLOCATOR_H
+#define BOOST_CTX_STACK_ALLOCATOR_H
+
+#include <cstddef>
+
+#include <boost/config.hpp>
+
+#include <boost/context/detail/config.hpp>
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+namespace boost {
+namespace ctx {
+
+class BOOST_CONTEXT_DECL stack_allocator
+{
+public:
+ void * allocate( std::size_t) const;
+
+ void deallocate( void *, std::size_t) const;
+};
+
+}}
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+#endif // BOOST_CTX_STACK_ALLOCATOR_H
diff --git a/boost/context/stack_utils.hpp b/boost/context/stack_utils.hpp
new file mode 100644
index 0000000000..ca3ed2135f
--- /dev/null
+++ b/boost/context/stack_utils.hpp
@@ -0,0 +1,41 @@
+
+// Copyright Oliver Kowalke 2009.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_CTX_STACK_UTILS_H
+#define BOOST_CTX_STACK_UTILS_H
+
+#include <cstddef>
+
+#include <boost/config.hpp>
+
+#include <boost/context/detail/config.hpp>
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+namespace boost {
+namespace ctx {
+
+BOOST_CONTEXT_DECL std::size_t default_stacksize();
+
+BOOST_CONTEXT_DECL std::size_t minimum_stacksize();
+
+BOOST_CONTEXT_DECL std::size_t maximum_stacksize();
+
+BOOST_CONTEXT_DECL std::size_t pagesize();
+
+BOOST_CONTEXT_DECL std::size_t page_count( std::size_t stacksize);
+
+BOOST_CONTEXT_DECL bool is_stack_unbound();
+
+}}
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+#endif // BOOST_CTX_STACK_UTILS_H
diff --git a/boost/date_time.hpp b/boost/date_time.hpp
index c9666222eb..07715262cd 100644
--- a/boost/date_time.hpp
+++ b/boost/date_time.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
// See www.boost.org/libs/date_time for documentation.
diff --git a/boost/date_time/adjust_functors.hpp b/boost/date_time/adjust_functors.hpp
index 7854ae4b76..dde8ca8590 100644
--- a/boost/date_time/adjust_functors.hpp
+++ b/boost/date_time/adjust_functors.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
#include "boost/date_time/date.hpp"
diff --git a/boost/date_time/c_local_time_adjustor.hpp b/boost/date_time/c_local_time_adjustor.hpp
index f8025828f7..45e96d3af8 100644
--- a/boost/date_time/c_local_time_adjustor.hpp
+++ b/boost/date_time/c_local_time_adjustor.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-11-12 14:37:53 -0500 (Wed, 12 Nov 2008) $
+ * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $
*/
/*! @file c_local_time_adjustor.hpp
diff --git a/boost/date_time/c_time.hpp b/boost/date_time/c_time.hpp
index f19e78576b..b3509afec6 100644
--- a/boost/date_time/c_time.hpp
+++ b/boost/date_time/c_time.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2012-01-30 21:30:03 -0500 (Mon, 30 Jan 2012) $
+ * $Date: 2012-07-27 11:15:55 -0700 (Fri, 27 Jul 2012) $
*/
diff --git a/boost/date_time/compiler_config.hpp b/boost/date_time/compiler_config.hpp
index 304748f250..1aa1330f64 100644
--- a/boost/date_time/compiler_config.hpp
+++ b/boost/date_time/compiler_config.hpp
@@ -5,7 +5,7 @@
* Subject to the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2011-07-26 13:40:21 -0400 (Tue, 26 Jul 2011) $
+ * $Date: 2011-07-26 10:40:21 -0700 (Tue, 26 Jul 2011) $
*/
#include <cstdlib>
diff --git a/boost/date_time/constrained_value.hpp b/boost/date_time/constrained_value.hpp
index b273dd5aa8..7338105e2d 100644
--- a/boost/date_time/constrained_value.hpp
+++ b/boost/date_time/constrained_value.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland
- * $Date: 2008-11-12 14:37:53 -0500 (Wed, 12 Nov 2008) $
+ * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $
*/
#include <exception>
diff --git a/boost/date_time/date.hpp b/boost/date_time/date.hpp
index 1056fb6a72..81730cab07 100644
--- a/boost/date_time/date.hpp
+++ b/boost/date_time/date.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2010-01-10 14:17:23 -0500 (Sun, 10 Jan 2010) $
+ * $Date: 2010-01-10 11:17:23 -0800 (Sun, 10 Jan 2010) $
*/
#include <boost/operators.hpp>
diff --git a/boost/date_time/date_clock_device.hpp b/boost/date_time/date_clock_device.hpp
index 6ccb26e254..6202f6c58f 100644
--- a/boost/date_time/date_clock_device.hpp
+++ b/boost/date_time/date_clock_device.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
#include "boost/date_time/c_time.hpp"
diff --git a/boost/date_time/date_defs.hpp b/boost/date_time/date_defs.hpp
index bc25b56c0d..ae7e4c5a03 100644
--- a/boost/date_time/date_defs.hpp
+++ b/boost/date_time/date_defs.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
diff --git a/boost/date_time/date_duration.hpp b/boost/date_time/date_duration.hpp
index 3871aac0ce..7bd48fd2b7 100644
--- a/boost/date_time/date_duration.hpp
+++ b/boost/date_time/date_duration.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-11-12 14:37:53 -0500 (Wed, 12 Nov 2008) $
+ * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $
*/
diff --git a/boost/date_time/date_duration_types.hpp b/boost/date_time/date_duration_types.hpp
index 1512c0ef20..e44c59fff6 100644
--- a/boost/date_time/date_duration_types.hpp
+++ b/boost/date_time/date_duration_types.hpp
@@ -6,7 +6,7 @@
* (See accompanying file LICENSE_1_0.txt or
* http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
#include <boost/date_time/int_adapter.hpp>
diff --git a/boost/date_time/date_facet.hpp b/boost/date_time/date_facet.hpp
index 3eda4c7d09..1584fe56a4 100644
--- a/boost/date_time/date_facet.hpp
+++ b/boost/date_time/date_facet.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Martin Andrian, Jeff Garland, Bart Garst
- * $Date: 2009-06-04 07:40:18 -0400 (Thu, 04 Jun 2009) $
+ * $Date: 2009-06-04 04:40:18 -0700 (Thu, 04 Jun 2009) $
*/
#include <locale>
diff --git a/boost/date_time/date_format_simple.hpp b/boost/date_time/date_format_simple.hpp
index be21ce4a57..05119c4413 100644
--- a/boost/date_time/date_format_simple.hpp
+++ b/boost/date_time/date_format_simple.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
#include "boost/date_time/parse_format_base.hpp"
diff --git a/boost/date_time/date_formatting.hpp b/boost/date_time/date_formatting.hpp
index f9721a3d85..0903c75bfb 100644
--- a/boost/date_time/date_formatting.hpp
+++ b/boost/date_time/date_formatting.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2012-01-30 21:30:03 -0500 (Mon, 30 Jan 2012) $
+ * $Date: 2012-07-27 11:15:55 -0700 (Fri, 27 Jul 2012) $
*/
#include "boost/date_time/iso_format.hpp"
diff --git a/boost/date_time/date_formatting_limited.hpp b/boost/date_time/date_formatting_limited.hpp
index 38fee07b91..5721473ba1 100644
--- a/boost/date_time/date_formatting_limited.hpp
+++ b/boost/date_time/date_formatting_limited.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
#include "boost/date_time/iso_format.hpp"
diff --git a/boost/date_time/date_formatting_locales.hpp b/boost/date_time/date_formatting_locales.hpp
index 4ac9c4e401..e3aec4967c 100644
--- a/boost/date_time/date_formatting_locales.hpp
+++ b/boost/date_time/date_formatting_locales.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
diff --git a/boost/date_time/date_generator_formatter.hpp b/boost/date_time/date_generator_formatter.hpp
index 88cd7e1aba..159cf36eb8 100644
--- a/boost/date_time/date_generator_formatter.hpp
+++ b/boost/date_time/date_generator_formatter.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-11-13 14:05:31 -0500 (Thu, 13 Nov 2008) $
+ * $Date: 2008-11-13 11:05:31 -0800 (Thu, 13 Nov 2008) $
*/
#include <iostream>
diff --git a/boost/date_time/date_generator_parser.hpp b/boost/date_time/date_generator_parser.hpp
index f11eb42d52..7cff9ca363 100644
--- a/boost/date_time/date_generator_parser.hpp
+++ b/boost/date_time/date_generator_parser.hpp
@@ -7,7 +7,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-11-12 14:37:53 -0500 (Wed, 12 Nov 2008) $
+ * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $
*/
#include <string>
diff --git a/boost/date_time/date_generators.hpp b/boost/date_time/date_generators.hpp
index 1f1a34a667..1944c3412c 100644
--- a/boost/date_time/date_generators.hpp
+++ b/boost/date_time/date_generators.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-11-12 14:37:53 -0500 (Wed, 12 Nov 2008) $
+ * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $
*/
/*! @file date_generators.hpp
diff --git a/boost/date_time/date_iterator.hpp b/boost/date_time/date_iterator.hpp
index 284dc749d0..20bfb05c9f 100644
--- a/boost/date_time/date_iterator.hpp
+++ b/boost/date_time/date_iterator.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
#include <iterator>
diff --git a/boost/date_time/date_names_put.hpp b/boost/date_time/date_names_put.hpp
index c6f0ce2a6f..6606f43153 100644
--- a/boost/date_time/date_names_put.hpp
+++ b/boost/date_time/date_names_put.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
diff --git a/boost/date_time/date_parsing.hpp b/boost/date_time/date_parsing.hpp
index f361bc8096..aa8e8e0836 100644
--- a/boost/date_time/date_parsing.hpp
+++ b/boost/date_time/date_parsing.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2009-06-04 04:24:49 -0400 (Thu, 04 Jun 2009) $
+ * $Date: 2009-06-04 01:24:49 -0700 (Thu, 04 Jun 2009) $
*/
#include <string>
diff --git a/boost/date_time/dst_rules.hpp b/boost/date_time/dst_rules.hpp
index 20cb40b676..503a255f1d 100644
--- a/boost/date_time/dst_rules.hpp
+++ b/boost/date_time/dst_rules.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
/*! @file dst_rules.hpp
diff --git a/boost/date_time/filetime_functions.hpp b/boost/date_time/filetime_functions.hpp
index 03f63f85d4..2460fd9791 100644
--- a/boost/date_time/filetime_functions.hpp
+++ b/boost/date_time/filetime_functions.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2012-01-30 21:30:03 -0500 (Mon, 30 Jan 2012) $
+ * $Date: 2012-07-27 11:15:55 -0700 (Fri, 27 Jul 2012) $
*/
/*! @file filetime_functions.hpp
diff --git a/boost/date_time/format_date_parser.hpp b/boost/date_time/format_date_parser.hpp
index a4a4d0dfbe..4a76529f6c 100644
--- a/boost/date_time/format_date_parser.hpp
+++ b/boost/date_time/format_date_parser.hpp
@@ -7,7 +7,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2009-06-04 04:24:49 -0400 (Thu, 04 Jun 2009) $
+ * $Date: 2009-06-04 01:24:49 -0700 (Thu, 04 Jun 2009) $
*/
diff --git a/boost/date_time/gregorian/conversion.hpp b/boost/date_time/gregorian/conversion.hpp
index c505bddf51..33f6856bf0 100644
--- a/boost/date_time/gregorian/conversion.hpp
+++ b/boost/date_time/gregorian/conversion.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2010-06-09 14:10:13 -0400 (Wed, 09 Jun 2010) $
+ * $Date: 2010-06-09 11:10:13 -0700 (Wed, 09 Jun 2010) $
*/
#include <cstring>
diff --git a/boost/date_time/gregorian/formatters.hpp b/boost/date_time/gregorian/formatters.hpp
index 786e79f2c1..eda7dc34be 100644
--- a/boost/date_time/gregorian/formatters.hpp
+++ b/boost/date_time/gregorian/formatters.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
#include "boost/date_time/compiler_config.hpp"
diff --git a/boost/date_time/gregorian/formatters_limited.hpp b/boost/date_time/gregorian/formatters_limited.hpp
index 4531ebec13..8dfd2d0c60 100644
--- a/boost/date_time/gregorian/formatters_limited.hpp
+++ b/boost/date_time/gregorian/formatters_limited.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
#include "boost/date_time/gregorian/gregorian_types.hpp"
diff --git a/boost/date_time/gregorian/greg_calendar.hpp b/boost/date_time/gregorian/greg_calendar.hpp
index 483ead5016..e9c1852e0b 100644
--- a/boost/date_time/gregorian/greg_calendar.hpp
+++ b/boost/date_time/gregorian/greg_calendar.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland
- * $Date: 2010-01-10 14:17:23 -0500 (Sun, 10 Jan 2010) $
+ * $Date: 2010-01-10 11:17:23 -0800 (Sun, 10 Jan 2010) $
*/
#include <boost/cstdint.hpp>
diff --git a/boost/date_time/gregorian/greg_date.hpp b/boost/date_time/gregorian/greg_date.hpp
index ad67c0ce2f..860a407c95 100644
--- a/boost/date_time/gregorian/greg_date.hpp
+++ b/boost/date_time/gregorian/greg_date.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland
- * $Date: 2010-01-10 14:17:23 -0500 (Sun, 10 Jan 2010) $
+ * $Date: 2010-01-10 11:17:23 -0800 (Sun, 10 Jan 2010) $
*/
#include <boost/throw_exception.hpp>
diff --git a/boost/date_time/gregorian/greg_day.hpp b/boost/date_time/gregorian/greg_day.hpp
index 92ea6ab07e..4ea829fbec 100644
--- a/boost/date_time/gregorian/greg_day.hpp
+++ b/boost/date_time/gregorian/greg_day.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
#include "boost/date_time/constrained_value.hpp"
diff --git a/boost/date_time/gregorian/greg_day_of_year.hpp b/boost/date_time/gregorian/greg_day_of_year.hpp
index 36b22c2b75..2f8874d2b7 100644
--- a/boost/date_time/gregorian/greg_day_of_year.hpp
+++ b/boost/date_time/gregorian/greg_day_of_year.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
#include "boost/date_time/constrained_value.hpp"
diff --git a/boost/date_time/gregorian/greg_duration.hpp b/boost/date_time/gregorian/greg_duration.hpp
index fd7554201e..a9c0c171b8 100644
--- a/boost/date_time/gregorian/greg_duration.hpp
+++ b/boost/date_time/gregorian/greg_duration.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-11-12 14:37:53 -0500 (Wed, 12 Nov 2008) $
+ * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $
*/
#include <boost/date_time/date_duration.hpp>
diff --git a/boost/date_time/gregorian/greg_duration_types.hpp b/boost/date_time/gregorian/greg_duration_types.hpp
index 3d1ce62183..8328ca303f 100644
--- a/boost/date_time/gregorian/greg_duration_types.hpp
+++ b/boost/date_time/gregorian/greg_duration_types.hpp
@@ -5,7 +5,7 @@
* Subject to Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-11-12 14:37:53 -0500 (Wed, 12 Nov 2008) $
+ * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $
*/
diff --git a/boost/date_time/gregorian/greg_facet.hpp b/boost/date_time/gregorian/greg_facet.hpp
index 9c3877ed03..9efc61951a 100644
--- a/boost/date_time/gregorian/greg_facet.hpp
+++ b/boost/date_time/gregorian/greg_facet.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-11-23 06:13:35 -0500 (Sun, 23 Nov 2008) $
+ * $Date: 2008-11-23 03:13:35 -0800 (Sun, 23 Nov 2008) $
*/
#include "boost/date_time/gregorian/gregorian_types.hpp"
diff --git a/boost/date_time/gregorian/greg_month.hpp b/boost/date_time/gregorian/greg_month.hpp
index fc9c86148d..b48a8a8911 100644
--- a/boost/date_time/gregorian/greg_month.hpp
+++ b/boost/date_time/gregorian/greg_month.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
#include "boost/date_time/constrained_value.hpp"
diff --git a/boost/date_time/gregorian/greg_serialize.hpp b/boost/date_time/gregorian/greg_serialize.hpp
index e427a48a20..a94bd73620 100644
--- a/boost/date_time/gregorian/greg_serialize.hpp
+++ b/boost/date_time/gregorian/greg_serialize.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2010-11-11 15:19:38 -0500 (Thu, 11 Nov 2010) $
+ * $Date: 2012-07-27 11:15:55 -0700 (Fri, 27 Jul 2012) $
*/
#include "boost/date_time/gregorian/gregorian_types.hpp"
@@ -22,6 +22,7 @@
BOOST_SERIALIZATION_SPLIT_FREE(::boost::gregorian::date_duration)
BOOST_SERIALIZATION_SPLIT_FREE(::boost::gregorian::date_duration::duration_rep)
BOOST_SERIALIZATION_SPLIT_FREE(::boost::gregorian::date_period)
+BOOST_SERIALIZATION_SPLIT_FREE(::boost::gregorian::greg_year)
BOOST_SERIALIZATION_SPLIT_FREE(::boost::gregorian::greg_month)
BOOST_SERIALIZATION_SPLIT_FREE(::boost::gregorian::greg_day)
BOOST_SERIALIZATION_SPLIT_FREE(::boost::gregorian::greg_weekday)
@@ -186,6 +187,32 @@ inline void load_construct_data(Archive & ar, gregorian::date_period* dp,
::new(dp) gregorian::date_period(d,dd);
}
+/**** greg_year ****/
+
+//! Function to save gregorian::greg_year objects using serialization lib
+template<class Archive>
+void save(Archive & ar, const gregorian::greg_year& gy,
+ unsigned int /*version*/)
+{
+ unsigned short us = gy;
+ ar & make_nvp("greg_year", us);
+}
+//! Function to load gregorian::greg_year objects using serialization lib
+template<class Archive>
+void load(Archive & ar, gregorian::greg_year& gy, unsigned int /*version*/)
+{
+ unsigned short us;
+ ar & make_nvp("greg_year", us);
+ gy = gregorian::greg_year(us);
+}
+//!override needed b/c no default constructor
+template<class Archive>
+inline void load_construct_data(Archive & ar, gregorian::greg_year* gy,
+ const unsigned int /*file_version*/)
+{
+ ::new(gy) gregorian::greg_year(1900);
+}
+
/**** greg_month ****/
//! Function to save gregorian::greg_month objects using serialization lib
diff --git a/boost/date_time/gregorian/greg_weekday.hpp b/boost/date_time/gregorian/greg_weekday.hpp
index 9b566c440d..ab68fcd19b 100644
--- a/boost/date_time/gregorian/greg_weekday.hpp
+++ b/boost/date_time/gregorian/greg_weekday.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-11-12 14:37:53 -0500 (Wed, 12 Nov 2008) $
+ * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $
*/
#include "boost/date_time/constrained_value.hpp"
diff --git a/boost/date_time/gregorian/greg_year.hpp b/boost/date_time/gregorian/greg_year.hpp
index ef1735f427..322f40d0d0 100644
--- a/boost/date_time/gregorian/greg_year.hpp
+++ b/boost/date_time/gregorian/greg_year.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
#include "boost/date_time/constrained_value.hpp"
diff --git a/boost/date_time/gregorian/greg_ymd.hpp b/boost/date_time/gregorian/greg_ymd.hpp
index 086e73df4a..e7d441efea 100644
--- a/boost/date_time/gregorian/greg_ymd.hpp
+++ b/boost/date_time/gregorian/greg_ymd.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
#include "boost/date_time/year_month_day.hpp"
diff --git a/boost/date_time/gregorian/gregorian.hpp b/boost/date_time/gregorian/gregorian.hpp
index bfafa1b037..becbc06817 100644
--- a/boost/date_time/gregorian/gregorian.hpp
+++ b/boost/date_time/gregorian/gregorian.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
/*! @file gregorian.hpp
diff --git a/boost/date_time/gregorian/gregorian_io.hpp b/boost/date_time/gregorian/gregorian_io.hpp
index 62a759f55c..e6ba01fe50 100644
--- a/boost/date_time/gregorian/gregorian_io.hpp
+++ b/boost/date_time/gregorian/gregorian_io.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-11-12 14:37:53 -0500 (Wed, 12 Nov 2008) $
+ * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $
*/
#include <locale>
diff --git a/boost/date_time/gregorian/gregorian_types.hpp b/boost/date_time/gregorian/gregorian_types.hpp
index 0c74857a25..3f4b92fd87 100644
--- a/boost/date_time/gregorian/gregorian_types.hpp
+++ b/boost/date_time/gregorian/gregorian_types.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
/*! @file gregorian_types.hpp
diff --git a/boost/date_time/gregorian/parsers.hpp b/boost/date_time/gregorian/parsers.hpp
index 95d4f23dec..a2fa4e1dae 100644
--- a/boost/date_time/gregorian/parsers.hpp
+++ b/boost/date_time/gregorian/parsers.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
#include "boost/date_time/gregorian/gregorian_types.hpp"
diff --git a/boost/date_time/gregorian_calendar.hpp b/boost/date_time/gregorian_calendar.hpp
index c27c09e760..b645aa49b0 100644
--- a/boost/date_time/gregorian_calendar.hpp
+++ b/boost/date_time/gregorian_calendar.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland
- * $Date: 2010-01-10 14:17:23 -0500 (Sun, 10 Jan 2010) $
+ * $Date: 2010-01-10 11:17:23 -0800 (Sun, 10 Jan 2010) $
*/
diff --git a/boost/date_time/gregorian_calendar.ipp b/boost/date_time/gregorian_calendar.ipp
index 19622fe8ec..77fa03e4af 100644
--- a/boost/date_time/gregorian_calendar.ipp
+++ b/boost/date_time/gregorian_calendar.ipp
@@ -3,7 +3,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2012-01-30 21:30:03 -0500 (Mon, 30 Jan 2012) $
+ * $Date: 2012-07-27 11:15:55 -0700 (Fri, 27 Jul 2012) $
*/
#ifndef NO_BOOST_DATE_TIME_INLINE
diff --git a/boost/date_time/int_adapter.hpp b/boost/date_time/int_adapter.hpp
index fc98fc1278..d1246e7b50 100644
--- a/boost/date_time/int_adapter.hpp
+++ b/boost/date_time/int_adapter.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-11-12 14:37:53 -0500 (Wed, 12 Nov 2008) $
+ * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $
*/
diff --git a/boost/date_time/iso_format.hpp b/boost/date_time/iso_format.hpp
index 8262fa2117..1f9e73d678 100644
--- a/boost/date_time/iso_format.hpp
+++ b/boost/date_time/iso_format.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
#include "boost/date_time/parse_format_base.hpp"
diff --git a/boost/date_time/local_time/conversion.hpp b/boost/date_time/local_time/conversion.hpp
index 13e4d3eb5c..a530de4224 100644
--- a/boost/date_time/local_time/conversion.hpp
+++ b/boost/date_time/local_time/conversion.hpp
@@ -5,7 +5,7 @@
* Subject to the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2009-06-04 04:24:49 -0400 (Thu, 04 Jun 2009) $
+ * $Date: 2009-06-04 01:24:49 -0700 (Thu, 04 Jun 2009) $
*/
diff --git a/boost/date_time/local_time/custom_time_zone.hpp b/boost/date_time/local_time/custom_time_zone.hpp
index a6c1d42055..390c3f484a 100644
--- a/boost/date_time/local_time/custom_time_zone.hpp
+++ b/boost/date_time/local_time/custom_time_zone.hpp
@@ -5,7 +5,7 @@
* Subject to the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
#include "boost/date_time/time_zone_base.hpp"
diff --git a/boost/date_time/local_time/date_duration_operators.hpp b/boost/date_time/local_time/date_duration_operators.hpp
index ee870227a9..b4c325df0a 100644
--- a/boost/date_time/local_time/date_duration_operators.hpp
+++ b/boost/date_time/local_time/date_duration_operators.hpp
@@ -6,7 +6,7 @@
* (See accompanying file LICENSE_1_0.txt or
* http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
#include "boost/date_time/gregorian/greg_duration_types.hpp"
diff --git a/boost/date_time/local_time/dst_transition_day_rules.hpp b/boost/date_time/local_time/dst_transition_day_rules.hpp
index 3d6cfbacf4..d82731c084 100644
--- a/boost/date_time/local_time/dst_transition_day_rules.hpp
+++ b/boost/date_time/local_time/dst_transition_day_rules.hpp
@@ -5,7 +5,7 @@
* Subject to the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
diff --git a/boost/date_time/local_time/local_date_time.hpp b/boost/date_time/local_time/local_date_time.hpp
index 9c9f62340f..6955439cd7 100644
--- a/boost/date_time/local_time/local_date_time.hpp
+++ b/boost/date_time/local_time/local_date_time.hpp
@@ -5,7 +5,7 @@
* Subject to the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2010-01-10 14:17:23 -0500 (Sun, 10 Jan 2010) $
+ * $Date: 2010-01-10 11:17:23 -0800 (Sun, 10 Jan 2010) $
*/
#include <string>
diff --git a/boost/date_time/local_time/local_time.hpp b/boost/date_time/local_time/local_time.hpp
index f7d4cc68e3..162cac5b36 100644
--- a/boost/date_time/local_time/local_time.hpp
+++ b/boost/date_time/local_time/local_time.hpp
@@ -5,7 +5,7 @@
* Subject to the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
#include "boost/date_time/posix_time/posix_time.hpp"
diff --git a/boost/date_time/local_time/local_time_io.hpp b/boost/date_time/local_time/local_time_io.hpp
index c161ff7e23..b5e3c3f1ba 100644
--- a/boost/date_time/local_time/local_time_io.hpp
+++ b/boost/date_time/local_time/local_time_io.hpp
@@ -5,7 +5,7 @@
* Subject to the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-11-13 14:05:31 -0500 (Thu, 13 Nov 2008) $
+ * $Date: 2008-11-13 11:05:31 -0800 (Thu, 13 Nov 2008) $
*/
#include <locale>
diff --git a/boost/date_time/local_time/local_time_types.hpp b/boost/date_time/local_time/local_time_types.hpp
index ed58b8018a..5e04422e8f 100644
--- a/boost/date_time/local_time/local_time_types.hpp
+++ b/boost/date_time/local_time/local_time_types.hpp
@@ -5,7 +5,7 @@
* Subject to the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
#include "boost/date_time/local_time/local_date_time.hpp"
diff --git a/boost/date_time/local_time/posix_time_zone.hpp b/boost/date_time/local_time/posix_time_zone.hpp
index 2a0199fcae..f640675bbd 100644
--- a/boost/date_time/local_time/posix_time_zone.hpp
+++ b/boost/date_time/local_time/posix_time_zone.hpp
@@ -5,7 +5,7 @@
* Subject to the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2010-06-10 13:24:38 -0400 (Thu, 10 Jun 2010) $
+ * $Date: 2010-06-10 10:24:38 -0700 (Thu, 10 Jun 2010) $
*/
#include <string>
diff --git a/boost/date_time/local_time/tz_database.hpp b/boost/date_time/local_time/tz_database.hpp
index 4cfca45c18..aceda93915 100644
--- a/boost/date_time/local_time/tz_database.hpp
+++ b/boost/date_time/local_time/tz_database.hpp
@@ -5,7 +5,7 @@
* Subject to the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
#include <string>
diff --git a/boost/date_time/local_time_adjustor.hpp b/boost/date_time/local_time_adjustor.hpp
index eea4d37ae3..13251a2cfb 100644
--- a/boost/date_time/local_time_adjustor.hpp
+++ b/boost/date_time/local_time_adjustor.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland
- * $Date: 2008-11-12 14:37:53 -0500 (Wed, 12 Nov 2008) $
+ * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $
*/
/*! @file local_time_adjustor.hpp
diff --git a/boost/date_time/local_timezone_defs.hpp b/boost/date_time/local_timezone_defs.hpp
index fd6d3c2fab..b56278ed28 100644
--- a/boost/date_time/local_timezone_defs.hpp
+++ b/boost/date_time/local_timezone_defs.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland
- * $Date: 2008-11-13 15:10:23 -0500 (Thu, 13 Nov 2008) $
+ * $Date: 2008-11-13 12:10:23 -0800 (Thu, 13 Nov 2008) $
*/
#include "boost/date_time/dst_rules.hpp"
diff --git a/boost/date_time/locale_config.hpp b/boost/date_time/locale_config.hpp
index d01e008fea..194d5dd37b 100644
--- a/boost/date_time/locale_config.hpp
+++ b/boost/date_time/locale_config.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
// This file configures whether the library will support locales and hence
diff --git a/boost/date_time/microsec_time_clock.hpp b/boost/date_time/microsec_time_clock.hpp
index 9396579d30..177811ee6f 100644
--- a/boost/date_time/microsec_time_clock.hpp
+++ b/boost/date_time/microsec_time_clock.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2010-05-10 05:15:48 -0400 (Mon, 10 May 2010) $
+ * $Date: 2010-05-10 02:15:48 -0700 (Mon, 10 May 2010) $
*/
diff --git a/boost/date_time/parse_format_base.hpp b/boost/date_time/parse_format_base.hpp
index b17a5c8e77..087baf9532 100644
--- a/boost/date_time/parse_format_base.hpp
+++ b/boost/date_time/parse_format_base.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
namespace boost {
diff --git a/boost/date_time/period.hpp b/boost/date_time/period.hpp
index c67bc36c65..3e34def323 100644
--- a/boost/date_time/period.hpp
+++ b/boost/date_time/period.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
/*! \file period.hpp
diff --git a/boost/date_time/period_formatter.hpp b/boost/date_time/period_formatter.hpp
index 08082e10f6..925b20c03c 100644
--- a/boost/date_time/period_formatter.hpp
+++ b/boost/date_time/period_formatter.hpp
@@ -7,7 +7,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
diff --git a/boost/date_time/period_parser.hpp b/boost/date_time/period_parser.hpp
index 9cd57e18c7..84b9d1378c 100644
--- a/boost/date_time/period_parser.hpp
+++ b/boost/date_time/period_parser.hpp
@@ -7,7 +7,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-11-13 15:10:23 -0500 (Thu, 13 Nov 2008) $
+ * $Date: 2008-11-13 12:10:23 -0800 (Thu, 13 Nov 2008) $
*/
#include <boost/throw_exception.hpp>
diff --git a/boost/date_time/posix_time/conversion.hpp b/boost/date_time/posix_time/conversion.hpp
index 3fb21d79eb..83ccf60068 100644
--- a/boost/date_time/posix_time/conversion.hpp
+++ b/boost/date_time/posix_time/conversion.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2010-06-09 14:10:13 -0400 (Wed, 09 Jun 2010) $
+ * $Date: 2010-06-09 11:10:13 -0700 (Wed, 09 Jun 2010) $
*/
#include <cstring>
diff --git a/boost/date_time/posix_time/date_duration_operators.hpp b/boost/date_time/posix_time/date_duration_operators.hpp
index e6899ba0aa..6846a77815 100644
--- a/boost/date_time/posix_time/date_duration_operators.hpp
+++ b/boost/date_time/posix_time/date_duration_operators.hpp
@@ -6,7 +6,7 @@
* (See accompanying file LICENSE_1_0.txt or
* http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
#include "boost/date_time/gregorian/greg_duration_types.hpp"
diff --git a/boost/date_time/posix_time/posix_time.hpp b/boost/date_time/posix_time/posix_time.hpp
index 4e9294c426..3b85ff46ff 100644
--- a/boost/date_time/posix_time/posix_time.hpp
+++ b/boost/date_time/posix_time/posix_time.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
/*!@file posix_time.hpp Global header file to get all of posix time types
*/
diff --git a/boost/date_time/posix_time/posix_time_config.hpp b/boost/date_time/posix_time/posix_time_config.hpp
index 60c3f7ee37..716f5e650f 100644
--- a/boost/date_time/posix_time/posix_time_config.hpp
+++ b/boost/date_time/posix_time/posix_time_config.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2009-06-04 07:52:28 -0400 (Thu, 04 Jun 2009) $
+ * $Date: 2009-06-04 04:52:28 -0700 (Thu, 04 Jun 2009) $
*/
#include <cstdlib> //for MCW 7.2 std::abs(long long)
diff --git a/boost/date_time/posix_time/posix_time_duration.hpp b/boost/date_time/posix_time/posix_time_duration.hpp
index db3b85fec3..9778fd7f3e 100644
--- a/boost/date_time/posix_time/posix_time_duration.hpp
+++ b/boost/date_time/posix_time/posix_time_duration.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
#include "boost/date_time/posix_time/posix_time_config.hpp"
diff --git a/boost/date_time/posix_time/posix_time_io.hpp b/boost/date_time/posix_time/posix_time_io.hpp
index 9a80737a47..fb63a9165c 100644
--- a/boost/date_time/posix_time/posix_time_io.hpp
+++ b/boost/date_time/posix_time/posix_time_io.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-11-13 14:05:31 -0500 (Thu, 13 Nov 2008) $
+ * $Date: 2008-11-13 11:05:31 -0800 (Thu, 13 Nov 2008) $
*/
#include <locale>
diff --git a/boost/date_time/posix_time/posix_time_legacy_io.hpp b/boost/date_time/posix_time/posix_time_legacy_io.hpp
index f5b20a8f8b..fcc3fac1d9 100644
--- a/boost/date_time/posix_time/posix_time_legacy_io.hpp
+++ b/boost/date_time/posix_time/posix_time_legacy_io.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
/*! @file posix_time_pre133_operators.hpp
diff --git a/boost/date_time/posix_time/posix_time_system.hpp b/boost/date_time/posix_time/posix_time_system.hpp
index 3d44e0ff00..13626e9bad 100644
--- a/boost/date_time/posix_time/posix_time_system.hpp
+++ b/boost/date_time/posix_time/posix_time_system.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
diff --git a/boost/date_time/posix_time/ptime.hpp b/boost/date_time/posix_time/ptime.hpp
index 2abc02d318..3f1cb0473f 100644
--- a/boost/date_time/posix_time/ptime.hpp
+++ b/boost/date_time/posix_time/ptime.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
#include "boost/date_time/posix_time/posix_time_system.hpp"
diff --git a/boost/date_time/posix_time/time_formatters.hpp b/boost/date_time/posix_time/time_formatters.hpp
index 466331b0a1..534b9525b8 100644
--- a/boost/date_time/posix_time/time_formatters.hpp
+++ b/boost/date_time/posix_time/time_formatters.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2010-01-10 14:17:23 -0500 (Sun, 10 Jan 2010) $
+ * $Date: 2010-01-10 11:17:23 -0800 (Sun, 10 Jan 2010) $
*/
#include <boost/date_time/gregorian/gregorian.hpp>
diff --git a/boost/date_time/posix_time/time_formatters_limited.hpp b/boost/date_time/posix_time/time_formatters_limited.hpp
index d0e959e915..8d2ebdce58 100644
--- a/boost/date_time/posix_time/time_formatters_limited.hpp
+++ b/boost/date_time/posix_time/time_formatters_limited.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2010-01-10 14:17:23 -0500 (Sun, 10 Jan 2010) $
+ * $Date: 2010-01-10 11:17:23 -0800 (Sun, 10 Jan 2010) $
*/
#include <boost/date_time/gregorian/gregorian.hpp>
diff --git a/boost/date_time/posix_time/time_parsers.hpp b/boost/date_time/posix_time/time_parsers.hpp
index 8a352f6e2b..3dc02b18a3 100644
--- a/boost/date_time/posix_time/time_parsers.hpp
+++ b/boost/date_time/posix_time/time_parsers.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
#include "boost/date_time/gregorian/gregorian.hpp"
diff --git a/boost/date_time/posix_time/time_period.hpp b/boost/date_time/posix_time/time_period.hpp
index cb7bf07f47..11f8120732 100644
--- a/boost/date_time/posix_time/time_period.hpp
+++ b/boost/date_time/posix_time/time_period.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
#include "boost/date_time/period.hpp"
diff --git a/boost/date_time/posix_time/time_serialize.hpp b/boost/date_time/posix_time/time_serialize.hpp
index f096da4411..3279d8d55d 100644
--- a/boost/date_time/posix_time/time_serialize.hpp
+++ b/boost/date_time/posix_time/time_serialize.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2012-01-30 21:30:03 -0500 (Mon, 30 Jan 2012) $
+ * $Date: 2012-07-27 11:15:55 -0700 (Fri, 27 Jul 2012) $
*/
#include "boost/date_time/posix_time/posix_time.hpp"
diff --git a/boost/date_time/special_defs.hpp b/boost/date_time/special_defs.hpp
index 56eb6fea1d..661814ec19 100644
--- a/boost/date_time/special_defs.hpp
+++ b/boost/date_time/special_defs.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
namespace boost {
diff --git a/boost/date_time/special_values_formatter.hpp b/boost/date_time/special_values_formatter.hpp
index 33542b6e42..53fe98452d 100644
--- a/boost/date_time/special_values_formatter.hpp
+++ b/boost/date_time/special_values_formatter.hpp
@@ -7,7 +7,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
#include <vector>
diff --git a/boost/date_time/string_convert.hpp b/boost/date_time/string_convert.hpp
index 54a979c70f..a3cc86c2db 100644
--- a/boost/date_time/string_convert.hpp
+++ b/boost/date_time/string_convert.hpp
@@ -5,7 +5,7 @@
* Subject to the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
#include "boost/date_time/compiler_config.hpp"
diff --git a/boost/date_time/string_parse_tree.hpp b/boost/date_time/string_parse_tree.hpp
index 0d515ff824..d67bf6b7d0 100644
--- a/boost/date_time/string_parse_tree.hpp
+++ b/boost/date_time/string_parse_tree.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-11-12 14:37:53 -0500 (Wed, 12 Nov 2008) $
+ * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $
*/
diff --git a/boost/date_time/strings_from_facet.hpp b/boost/date_time/strings_from_facet.hpp
index d782c54fb9..845aeb84b9 100644
--- a/boost/date_time/strings_from_facet.hpp
+++ b/boost/date_time/strings_from_facet.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland
- * $Date: 2012-01-30 21:30:03 -0500 (Mon, 30 Jan 2012) $
+ * $Date: 2012-07-27 11:15:55 -0700 (Fri, 27 Jul 2012) $
*/
#include <sstream>
diff --git a/boost/date_time/time.hpp b/boost/date_time/time.hpp
index 6a6cbe1f89..8b21144b6e 100644
--- a/boost/date_time/time.hpp
+++ b/boost/date_time/time.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-11-12 14:37:53 -0500 (Wed, 12 Nov 2008) $
+ * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $
*/
diff --git a/boost/date_time/time_clock.hpp b/boost/date_time/time_clock.hpp
index 1ea5d2e8bd..9aa2ff0e39 100644
--- a/boost/date_time/time_clock.hpp
+++ b/boost/date_time/time_clock.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
/*! @file time_clock.hpp
diff --git a/boost/date_time/time_defs.hpp b/boost/date_time/time_defs.hpp
index 55fe42a594..d74631d5eb 100644
--- a/boost/date_time/time_defs.hpp
+++ b/boost/date_time/time_defs.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland
- * $Date: 2008-11-12 14:37:53 -0500 (Wed, 12 Nov 2008) $
+ * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $
*/
diff --git a/boost/date_time/time_duration.hpp b/boost/date_time/time_duration.hpp
index 2fd259012e..b6df827f19 100644
--- a/boost/date_time/time_duration.hpp
+++ b/boost/date_time/time_duration.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2009-06-04 04:24:49 -0400 (Thu, 04 Jun 2009) $
+ * $Date: 2009-06-04 01:24:49 -0700 (Thu, 04 Jun 2009) $
*/
#include <boost/cstdint.hpp>
diff --git a/boost/date_time/time_facet.hpp b/boost/date_time/time_facet.hpp
index f6408b017c..b3cda2c023 100644
--- a/boost/date_time/time_facet.hpp
+++ b/boost/date_time/time_facet.hpp
@@ -7,7 +7,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Martin Andrian, Jeff Garland, Bart Garst
- * $Date: 2012-01-30 21:30:03 -0500 (Mon, 30 Jan 2012) $
+ * $Date: 2012-07-27 11:15:55 -0700 (Fri, 27 Jul 2012) $
*/
#include <cctype>
diff --git a/boost/date_time/time_formatting_streams.hpp b/boost/date_time/time_formatting_streams.hpp
index 3537c103cc..2d07d344ee 100644
--- a/boost/date_time/time_formatting_streams.hpp
+++ b/boost/date_time/time_formatting_streams.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-11-12 14:37:53 -0500 (Wed, 12 Nov 2008) $
+ * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $
*/
#include <boost/date_time/compiler_config.hpp>
diff --git a/boost/date_time/time_iterator.hpp b/boost/date_time/time_iterator.hpp
index 2258a3308e..98397de8f3 100644
--- a/boost/date_time/time_iterator.hpp
+++ b/boost/date_time/time_iterator.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
diff --git a/boost/date_time/time_parsing.hpp b/boost/date_time/time_parsing.hpp
index dfccf6a1df..9258f94fc3 100644
--- a/boost/date_time/time_parsing.hpp
+++ b/boost/date_time/time_parsing.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
#include "boost/tokenizer.hpp"
diff --git a/boost/date_time/time_resolution_traits.hpp b/boost/date_time/time_resolution_traits.hpp
index 658f3d207c..903830c76e 100644
--- a/boost/date_time/time_resolution_traits.hpp
+++ b/boost/date_time/time_resolution_traits.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2009-06-06 07:25:55 -0400 (Sat, 06 Jun 2009) $
+ * $Date: 2009-06-06 04:25:55 -0700 (Sat, 06 Jun 2009) $
*/
diff --git a/boost/date_time/time_system_counted.hpp b/boost/date_time/time_system_counted.hpp
index fa883907eb..5425f62af4 100644
--- a/boost/date_time/time_system_counted.hpp
+++ b/boost/date_time/time_system_counted.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
diff --git a/boost/date_time/time_system_split.hpp b/boost/date_time/time_system_split.hpp
index 08ea1ec2d1..6fc4a336b5 100644
--- a/boost/date_time/time_system_split.hpp
+++ b/boost/date_time/time_system_split.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-11-13 15:10:23 -0500 (Thu, 13 Nov 2008) $
+ * $Date: 2008-11-13 12:10:23 -0800 (Thu, 13 Nov 2008) $
*/
diff --git a/boost/date_time/time_zone_base.hpp b/boost/date_time/time_zone_base.hpp
index 0d3cb903e6..6ad7f70af5 100644
--- a/boost/date_time/time_zone_base.hpp
+++ b/boost/date_time/time_zone_base.hpp
@@ -5,7 +5,7 @@
* Subject to the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
diff --git a/boost/date_time/time_zone_names.hpp b/boost/date_time/time_zone_names.hpp
index 05260c7162..a56502704e 100644
--- a/boost/date_time/time_zone_names.hpp
+++ b/boost/date_time/time_zone_names.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
#include <string>
diff --git a/boost/date_time/tz_db_base.hpp b/boost/date_time/tz_db_base.hpp
index c125b966c9..17822cc65c 100644
--- a/boost/date_time/tz_db_base.hpp
+++ b/boost/date_time/tz_db_base.hpp
@@ -5,7 +5,7 @@
* Subject to the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2012-01-30 21:30:03 -0500 (Mon, 30 Jan 2012) $
+ * $Date: 2012-07-27 11:15:55 -0700 (Fri, 27 Jul 2012) $
*/
#include <map>
diff --git a/boost/date_time/wrapping_int.hpp b/boost/date_time/wrapping_int.hpp
index 969b078ac1..abfc58c561 100644
--- a/boost/date_time/wrapping_int.hpp
+++ b/boost/date_time/wrapping_int.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
- * $Date: 2008-11-12 14:37:53 -0500 (Wed, 12 Nov 2008) $
+ * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $
*/
diff --git a/boost/date_time/year_month_day.hpp b/boost/date_time/year_month_day.hpp
index 802ce42eb9..9340e53f55 100644
--- a/boost/date_time/year_month_day.hpp
+++ b/boost/date_time/year_month_day.hpp
@@ -6,7 +6,7 @@
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland
- * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
+ * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $
*/
namespace boost {
diff --git a/boost/detail/container_fwd.hpp b/boost/detail/container_fwd.hpp
index 7df7ccbb94..ef17498063 100644
--- a/boost/detail/container_fwd.hpp
+++ b/boost/detail/container_fwd.hpp
@@ -21,10 +21,17 @@
// Define BOOST_DETAIL_NO_CONTAINER_FWD if you don't want this header to //
// forward declare standard containers. //
// //
+// BOOST_DETAIL_CONTAINER_FWD to make it foward declare containers even if it //
+// normally doesn't. //
+// //
+// BOOST_DETAIL_NO_CONTAINER_FWD overrides BOOST_DETAIL_CONTAINER_FWD. //
+// //
////////////////////////////////////////////////////////////////////////////////
#if !defined(BOOST_DETAIL_NO_CONTAINER_FWD)
-# if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
+# if defined(BOOST_DETAIL_CONTAINER_FWD)
+ // Force forward declarations.
+# elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
// STLport
# define BOOST_DETAIL_NO_CONTAINER_FWD
# elif defined(__LIBCOMO__)
@@ -76,11 +83,6 @@
# endif
#endif
-// BOOST_DETAIL_TEST_* macros are for testing only
-// and shouldn't be relied upon. But you can use
-// BOOST_DETAIL_NO_CONTAINER_FWD to prevent forward
-// declaration of containers.
-
#if !defined(BOOST_DETAIL_TEST_CONFIG_ONLY)
#if defined(BOOST_DETAIL_NO_CONTAINER_FWD) && \
@@ -118,6 +120,7 @@ namespace std
template <class charT, class traits, class Allocator> class basic_string;
#if BOOST_WORKAROUND(__GNUC__, < 3) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
+
template <class charT> struct string_char_traits;
#else
template <class charT> struct char_traits;
diff --git a/boost/detail/scoped_enum_emulation.hpp b/boost/detail/scoped_enum_emulation.hpp
index e695a20857..80394cf433 100644
--- a/boost/detail/scoped_enum_emulation.hpp
+++ b/boost/detail/scoped_enum_emulation.hpp
@@ -1,56 +1,337 @@
// scoped_enum_emulation.hpp ---------------------------------------------------------//
// Copyright Beman Dawes, 2009
+// Copyright (C) 2011-2012 Vicente J. Botet Escriba
+// Copyright (C) 2012 Anthony Williams
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
-// Generates C++0x scoped enums if the feature is present, otherwise emulates C++0x
-// scoped enums with C++03 namespaces and enums. The Boost.Config BOOST_NO_SCOPED_ENUMS
-// macro is used to detect feature support.
-//
-// See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf for a
-// description of the scoped enum feature. Note that the committee changed the name
-// from strongly typed enum to scoped enum.
-//
-// Caution: only the syntax is emulated; the semantics are not emulated and
-// the syntax emulation doesn't include being able to specify the underlying
-// representation type.
-//
-// The emulation is via struct rather than namespace to allow use within classes.
-// Thanks to Andrey Semashev for pointing that out.
-//
-// Helpful comments and suggestions were also made by Kjell Elster, Phil Endecott,
-// Joel Falcou, Mathias Gaunard, Felipe Magno de Almeida, Matt Calabrese, Vincente
-// Botet, and Daniel James.
-//
-// Sample usage:
-//
-// BOOST_SCOPED_ENUM_START(algae) { green, red, cyan }; BOOST_SCOPED_ENUM_END
-// ...
-// BOOST_SCOPED_ENUM(algae) sample( algae::red );
-// void foo( BOOST_SCOPED_ENUM(algae) color );
-// ...
-// sample = algae::green;
-// foo( algae::cyan );
+/*
+[section:scoped_enums Scoped Enums]
+
+Generates C++0x scoped enums if the feature is present, otherwise emulates C++0x
+scoped enums with C++03 namespaces and enums. The Boost.Config BOOST_NO_SCOPED_ENUMS
+macro is used to detect feature support.
+
+See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf for a
+description of the scoped enum feature. Note that the committee changed the name
+from strongly typed enum to scoped enum.
+
+Some of the enumerations defined in the standard library are scoped enums.
+
+ enum class future_errc
+ {
+ broken_promise,
+ future_already_retrieved,
+ promise_already_satisfied,
+ no_state
+ };
+
+On compilers that don't support them, the library provides two emulations:
+
+[heading Strict]
+
+* Able to specify the underlying type.
+* explicit conversion to/from underlying type.
+* The wrapper is not a C++03 enum type.
+
+The user can declare declare these types as
+
+ BOOST_SCOPED_ENUM_DECLARE_BEGIN(future_errc)
+ {
+ broken_promise,
+ future_already_retrieved,
+ promise_already_satisfied,
+ no_state
+ }
+ BOOST_SCOPED_ENUM_DECLARE_END(future_errc)
+
+These macros allows to use 'future_errc' in almost all the cases as an scoped enum.
+
+ future_errc err = future_errc::no_state;
+
+There are however some limitations:
+
+* The type is not a C++ enum, so 'is_enum<future_errc>' will be false_type.
+* The emulated scoped enum can not be used in switch nor in template arguments. For these cases the user needs to use some macros.
+
+Instead of
+
+ switch (ev)
+ {
+ case future_errc::broken_promise:
+ // ...
+
+use
+
+ switch (boost::native_value(ev))
+ {
+ case future_errc::broken_promise:
+
+And instead of
+
+ #ifdef BOOST_NO_SCOPED_ENUMS
+ template <>
+ struct BOOST_SYMBOL_VISIBLE is_error_code_enum<future_errc> : public true_type { };
+ #endif
+
+use
+
+ #ifdef BOOST_NO_SCOPED_ENUMS
+ template <>
+ struct BOOST_SYMBOL_VISIBLE is_error_code_enum<future_errc::enum_type > : public true_type { };
+ #endif
+
+
+Sample usage:
+
+ BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(algae, char) { green, red, cyan }; BOOST_SCOPED_ENUM_DECLARE_END(algae)
+ ...
+ algae sample( algae::red );
+ void foo( algae color );
+ ...
+ sample = algae::green;
+ foo( algae::cyan );
+
+ Light
+ Caution: only the syntax is emulated; the semantics are not emulated and
+ the syntax emulation doesn't include being able to specify the underlying
+ representation type.
+
+ The literal scoped emulation is via struct rather than namespace to allow use within classes.
+ Thanks to Andrey Semashev for pointing that out.
+ However the type is an real C++03 enum and so convertible implicitly to an int.
+
+ Sample usage:
+
+ BOOST_SCOPED_ENUM_START(algae) { green, red, cyan }; BOOST_SCOPED_ENUM_END
+ ...
+ BOOST_SCOPED_ENUM(algae) sample( algae::red );
+ void foo( BOOST_SCOPED_ENUM(algae) color );
+ ...
+ sample = algae::green;
+ foo( algae::cyan );
+
+ Helpful comments and suggestions were also made by Kjell Elster, Phil Endecott,
+ Joel Falcou, Mathias Gaunard, Felipe Magno de Almeida, Matt Calabrese, Vicente
+ Botet, and Daniel James.
+
+[endsect]
+*/
+
#ifndef BOOST_SCOPED_ENUM_EMULATION_HPP
#define BOOST_SCOPED_ENUM_EMULATION_HPP
#include <boost/config.hpp>
+#include <boost/detail/workaround.hpp>
+
+namespace boost
+{
#ifdef BOOST_NO_SCOPED_ENUMS
+ /**
+ * Meta-function to get the underlying type of a scoped enum.
+ *
+ * Requires EnumType must be an enum type or the emulation of a scoped enum
+ */
+ template <typename EnumType>
+ struct underlying_type
+ {
+ /**
+ * The member typedef type names the underlying type of EnumType. It is EnumType::underlying_type when the EnumType is an emulated scoped enum,
+ * std::underlying_type<EnumType>::type when the standard library std::underlying_type is provided.
+ *
+ * The user will need to specialize it when the compiler supports scoped enums but don't provides std::underlying_type.
+ */
+ typedef typename EnumType::underlying_type type;
+ };
+
+ /**
+ * Meta-function to get the native enum type associated to an enum class or its emulation.
+ */
+ template <typename EnumType>
+ struct native_type
+ {
+ /**
+ * The member typedef type names the native enum type associated to the scoped enum,
+ * which is it self if the compiler supports scoped enums or EnumType::enum_type if it is an emulated scoped enum.
+ */
+ typedef typename EnumType::enum_type type;
+ };
+
+ /**
+ * Casts a scoped enum to its underlying type.
+ *
+ * This function is useful when working with scoped enum classes, which doens't implicitly convert to the underlying type.
+ * @param v A scoped enum.
+ * @returns The underlying type.
+ * @throws No-throws.
+ */
+ template <typename UnderlyingType, typename EnumType>
+ UnderlyingType underlying_cast(EnumType v)
+ {
+ return v.get_underlying_value_();
+ }
+
+ /**
+ * Casts a scoped enum to its native enum type.
+ *
+ * This function is useful to make programs portable when the scoped enum emulation can not be use where native enums can.
+ *
+ * EnumType the scoped enum type
+ *
+ * @param v A scoped enum.
+ * @returns The native enum value.
+ * @throws No-throws.
+ */
+ template <typename EnumType>
+ inline
+ typename EnumType::enum_type native_value(EnumType e)
+ {
+ return e.native_value_();
+ }
+
+#else // BOOST_NO_SCOPED_ENUMS
-# define BOOST_SCOPED_ENUM_START(name) struct name { enum enum_type
-# define BOOST_SCOPED_ENUM_END };
-# define BOOST_SCOPED_ENUM(name) name::enum_type
+ template <typename EnumType>
+ struct underlying_type
+ {
+ //typedef typename std::underlying_type<EnumType>::type type;
+ };
+
+ template <typename EnumType>
+ struct native_type
+ {
+ typedef EnumType type;
+ };
+
+ template <typename UnderlyingType, typename EnumType>
+ UnderlyingType underlying_cast(EnumType v)
+ {
+ return static_cast<UnderlyingType>(v);
+ }
+
+ template <typename EnumType>
+ inline
+ EnumType native_value(EnumType e)
+ {
+ return e;
+ }
+
+#endif
+}
+
+
+#ifdef BOOST_NO_SCOPED_ENUMS
+
+#ifndef BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
+
+#define BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR \
+ explicit operator underlying_type() const { return get_underlying_value_(); }
#else
-# define BOOST_SCOPED_ENUM_START(name) enum class name
-# define BOOST_SCOPED_ENUM_END
-# define BOOST_SCOPED_ENUM(name) name
+#define BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR
#endif
+/**
+ * Start a declaration of a scoped enum.
+ *
+ * @param EnumType The new scoped enum.
+ * @param UnderlyingType The underlying type.
+ */
+#define BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType, UnderlyingType) \
+ struct EnumType { \
+ typedef UnderlyingType underlying_type; \
+ EnumType() BOOST_NOEXCEPT {} \
+ explicit EnumType(underlying_type v) : v_(v) {} \
+ underlying_type get_underlying_value_() const { return v_; } \
+ BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR \
+ private: \
+ underlying_type v_; \
+ typedef EnumType self_type; \
+ public: \
+ enum enum_type
+
+#define BOOST_SCOPED_ENUM_DECLARE_END2() \
+ enum_type get_native_value_() const BOOST_NOEXCEPT { return enum_type(v_); } \
+ operator enum_type() const BOOST_NOEXCEPT { return get_native_value_(); } \
+ friend bool operator ==(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)==enum_type(rhs.v_); } \
+ friend bool operator ==(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)==rhs; } \
+ friend bool operator ==(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs==enum_type(rhs.v_); } \
+ friend bool operator !=(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)!=enum_type(rhs.v_); } \
+ friend bool operator !=(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)!=rhs; } \
+ friend bool operator !=(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs!=enum_type(rhs.v_); } \
+ friend bool operator <(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)<enum_type(rhs.v_); } \
+ friend bool operator <(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)<rhs; } \
+ friend bool operator <(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs<enum_type(rhs.v_); } \
+ friend bool operator <=(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)<=enum_type(rhs.v_); } \
+ friend bool operator <=(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)<=rhs; } \
+ friend bool operator <=(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs<=enum_type(rhs.v_); } \
+ friend bool operator >(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>enum_type(rhs.v_); } \
+ friend bool operator >(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>rhs; } \
+ friend bool operator >(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs>enum_type(rhs.v_); } \
+ friend bool operator >=(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>=enum_type(rhs.v_); } \
+ friend bool operator >=(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>=rhs; } \
+ friend bool operator >=(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs>=enum_type(rhs.v_); } \
+ };
+
+#define BOOST_SCOPED_ENUM_DECLARE_END(EnumType) \
+ ; \
+ EnumType(enum_type v) BOOST_NOEXCEPT : v_(v) {} \
+ BOOST_SCOPED_ENUM_DECLARE_END2()
+
+/**
+ * Starts a declaration of a scoped enum with the default int underlying type.
+ *
+ * @param EnumType The new scoped enum.
+ */
+#define BOOST_SCOPED_ENUM_DECLARE_BEGIN(EnumType) \
+ BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType,int)
+
+/**
+ * Name of the native enum type.
+ *
+ * @param NT The new scoped enum.
+ */
+#define BOOST_SCOPED_ENUM_NATIVE(EnumType) EnumType::enum_type
+/**
+ * Forward declares an scoped enum.
+ *
+ * @param NT The scoped enum.
+ */
+#define BOOST_SCOPED_ENUM_FORWARD_DECLARE(EnumType) struct EnumType
+
+#else // BOOST_NO_SCOPED_ENUMS
+
+#define BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType,UnderlyingType) enum class EnumType:UnderlyingType
+#define BOOST_SCOPED_ENUM_DECLARE_BEGIN(EnumType) enum class EnumType
+#define BOOST_SCOPED_ENUM_DECLARE_END2()
+#define BOOST_SCOPED_ENUM_DECLARE_END(EnumType) ;
+
+#define BOOST_SCOPED_ENUM_NATIVE(EnumType) EnumType
+#define BOOST_SCOPED_ENUM_FORWARD_DECLARE(EnumType) enum class EnumType
+
+#endif // BOOST_NO_SCOPED_ENUMS
+
+#define BOOST_SCOPED_ENUM_START(name) BOOST_SCOPED_ENUM_DECLARE_BEGIN(name)
+#define BOOST_SCOPED_ENUM_END BOOST_SCOPED_ENUM_DECLARE_END2()
+#define BOOST_SCOPED_ENUM(name) BOOST_SCOPED_ENUM_NATIVE(name)
+
+//#ifdef BOOST_NO_SCOPED_ENUMS
+//
+//# define BOOST_SCOPED_ENUM_START(name) struct name { enum enum_type
+//# define BOOST_SCOPED_ENUM_END };
+//# define BOOST_SCOPED_ENUM(name) name::enum_type
+//
+//#else
+//
+//# define BOOST_SCOPED_ENUM_START(name) enum class name
+//# define BOOST_SCOPED_ENUM_END
+//# define BOOST_SCOPED_ENUM(name) name
+//
+//#endif
#endif // BOOST_SCOPED_ENUM_EMULATION_HPP
diff --git a/boost/detail/utf8_codecvt_facet.ipp b/boost/detail/utf8_codecvt_facet.ipp
new file mode 100644
index 0000000000..064fdaf58e
--- /dev/null
+++ b/boost/detail/utf8_codecvt_facet.ipp
@@ -0,0 +1,285 @@
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// utf8_codecvt_facet.ipp
+
+// Copyright (c) 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu)
+// Andrew Lumsdaine, Indiana University (lums@osl.iu.edu).
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// Please see the comments in <boost/detail/utf8_codecvt_facet.hpp> to
+// learn how this file should be used.
+
+#include <boost/detail/utf8_codecvt_facet.hpp>
+
+#include <cstdlib> // for multi-byte converson routines
+#include <cassert>
+
+#include <boost/limits.hpp>
+#include <boost/config.hpp>
+
+// If we don't have wstring, then Unicode support
+// is not available anyway, so we don't need to even
+// compiler this file. This also fixes the problem
+// with mingw, which can compile this file, but will
+// generate link error when building DLL.
+#ifndef BOOST_NO_STD_WSTRING
+
+BOOST_UTF8_BEGIN_NAMESPACE
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// implementation for wchar_t
+
+// Translate incoming UTF-8 into UCS-4
+std::codecvt_base::result utf8_codecvt_facet::do_in(
+ std::mbstate_t& /*state*/,
+ const char * from,
+ const char * from_end,
+ const char * & from_next,
+ wchar_t * to,
+ wchar_t * to_end,
+ wchar_t * & to_next
+) const {
+ // Basic algorithm: The first octet determines how many
+ // octets total make up the UCS-4 character. The remaining
+ // "continuing octets" all begin with "10". To convert, subtract
+ // the amount that specifies the number of octets from the first
+ // octet. Subtract 0x80 (1000 0000) from each continuing octet,
+ // then mash the whole lot together. Note that each continuing
+ // octet only uses 6 bits as unique values, so only shift by
+ // multiples of 6 to combine.
+ while (from != from_end && to != to_end) {
+
+ // Error checking on the first octet
+ if (invalid_leading_octet(*from)){
+ from_next = from;
+ to_next = to;
+ return std::codecvt_base::error;
+ }
+
+ // The first octet is adjusted by a value dependent upon
+ // the number of "continuing octets" encoding the character
+ const int cont_octet_count = get_cont_octet_count(*from);
+ const wchar_t octet1_modifier_table[] = {
+ 0x00, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc
+ };
+
+ // The unsigned char conversion is necessary in case char is
+ // signed (I learned this the hard way)
+ wchar_t ucs_result =
+ (unsigned char)(*from++) - octet1_modifier_table[cont_octet_count];
+
+ // Invariants :
+ // 1) At the start of the loop, 'i' continuing characters have been
+ // processed
+ // 2) *from points to the next continuing character to be processed.
+ int i = 0;
+ while(i != cont_octet_count && from != from_end) {
+
+ // Error checking on continuing characters
+ if (invalid_continuing_octet(*from)) {
+ from_next = from;
+ to_next = to;
+ return std::codecvt_base::error;
+ }
+
+ ucs_result *= (1 << 6);
+
+ // each continuing character has an extra (10xxxxxx)b attached to
+ // it that must be removed.
+ ucs_result += (unsigned char)(*from++) - 0x80;
+ ++i;
+ }
+
+ // If the buffer ends with an incomplete unicode character...
+ if (from == from_end && i != cont_octet_count) {
+ // rewind "from" to before the current character translation
+ from_next = from - (i+1);
+ to_next = to;
+ return std::codecvt_base::partial;
+ }
+ *to++ = ucs_result;
+ }
+ from_next = from;
+ to_next = to;
+
+ // Were we done converting or did we run out of destination space?
+ if(from == from_end) return std::codecvt_base::ok;
+ else return std::codecvt_base::partial;
+}
+
+std::codecvt_base::result utf8_codecvt_facet::do_out(
+ std::mbstate_t& /*state*/,
+ const wchar_t * from,
+ const wchar_t * from_end,
+ const wchar_t * & from_next,
+ char * to,
+ char * to_end,
+ char * & to_next
+) const
+{
+ // RG - consider merging this table with the other one
+ const wchar_t octet1_modifier_table[] = {
+ 0x00, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc
+ };
+
+ wchar_t max_wchar = (std::numeric_limits<wchar_t>::max)();
+ while (from != from_end && to != to_end) {
+
+ // Check for invalid UCS-4 character
+ if (*from > max_wchar) {
+ from_next = from;
+ to_next = to;
+ return std::codecvt_base::error;
+ }
+
+ int cont_octet_count = get_cont_octet_out_count(*from);
+
+ // RG - comment this formula better
+ int shift_exponent = (cont_octet_count) * 6;
+
+ // Process the first character
+ *to++ = static_cast<char>(octet1_modifier_table[cont_octet_count] +
+ (unsigned char)(*from / (1 << shift_exponent)));
+
+ // Process the continuation characters
+ // Invariants: At the start of the loop:
+ // 1) 'i' continuing octets have been generated
+ // 2) '*to' points to the next location to place an octet
+ // 3) shift_exponent is 6 more than needed for the next octet
+ int i = 0;
+ while (i != cont_octet_count && to != to_end) {
+ shift_exponent -= 6;
+ *to++ = static_cast<char>(0x80 + ((*from / (1 << shift_exponent)) % (1 << 6)));
+ ++i;
+ }
+ // If we filled up the out buffer before encoding the character
+ if(to == to_end && i != cont_octet_count) {
+ from_next = from;
+ to_next = to - (i+1);
+ return std::codecvt_base::partial;
+ }
+ ++from;
+ }
+ from_next = from;
+ to_next = to;
+ // Were we done or did we run out of destination space
+ if(from == from_end) return std::codecvt_base::ok;
+ else return std::codecvt_base::partial;
+}
+
+// How many char objects can I process to get <= max_limit
+// wchar_t objects?
+int utf8_codecvt_facet::do_length(
+ BOOST_CODECVT_DO_LENGTH_CONST std::mbstate_t &,
+ const char * from,
+ const char * from_end,
+ std::size_t max_limit
+#if BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
+) const throw()
+#else
+) const
+#endif
+{
+ // RG - this code is confusing! I need a better way to express it.
+ // and test cases.
+
+ // Invariants:
+ // 1) last_octet_count has the size of the last measured character
+ // 2) char_count holds the number of characters shown to fit
+ // within the bounds so far (no greater than max_limit)
+ // 3) from_next points to the octet 'last_octet_count' before the
+ // last measured character.
+ int last_octet_count=0;
+ std::size_t char_count = 0;
+ const char* from_next = from;
+ // Use "<" because the buffer may represent incomplete characters
+ while (from_next+last_octet_count <= from_end && char_count <= max_limit) {
+ from_next += last_octet_count;
+ last_octet_count = (get_octet_count(*from_next));
+ ++char_count;
+ }
+ return static_cast<int>(from_next-from_end);
+}
+
+unsigned int utf8_codecvt_facet::get_octet_count(
+ unsigned char lead_octet
+){
+ // if the 0-bit (MSB) is 0, then 1 character
+ if (lead_octet <= 0x7f) return 1;
+
+ // Otherwise the count number of consecutive 1 bits starting at MSB
+// assert(0xc0 <= lead_octet && lead_octet <= 0xfd);
+
+ if (0xc0 <= lead_octet && lead_octet <= 0xdf) return 2;
+ else if (0xe0 <= lead_octet && lead_octet <= 0xef) return 3;
+ else if (0xf0 <= lead_octet && lead_octet <= 0xf7) return 4;
+ else if (0xf8 <= lead_octet && lead_octet <= 0xfb) return 5;
+ else return 6;
+}
+BOOST_UTF8_END_NAMESPACE
+
+namespace {
+template<std::size_t s>
+int get_cont_octet_out_count_impl(wchar_t word){
+ if (word < 0x80) {
+ return 0;
+ }
+ if (word < 0x800) {
+ return 1;
+ }
+ return 2;
+}
+
+template<>
+int get_cont_octet_out_count_impl<4>(wchar_t word){
+ if (word < 0x80) {
+ return 0;
+ }
+ if (word < 0x800) {
+ return 1;
+ }
+
+ // Note that the following code will generate warnings on some platforms
+ // where wchar_t is defined as UCS2. The warnings are superfluous as the
+ // specialization is never instantitiated with such compilers, but this
+ // can cause problems if warnings are being treated as errors, so we guard
+ // against that. Including <boost/detail/utf8_codecvt_facet.hpp> as we do
+ // should be enough to get WCHAR_MAX defined.
+#if !defined(WCHAR_MAX)
+# error WCHAR_MAX not defined!
+#endif
+ // cope with VC++ 7.1 or earlier having invalid WCHAR_MAX
+#if defined(_MSC_VER) && _MSC_VER <= 1310 // 7.1 or earlier
+ return 2;
+#elif WCHAR_MAX > 0x10000
+
+ if (word < 0x10000) {
+ return 2;
+ }
+ if (word < 0x200000) {
+ return 3;
+ }
+ if (word < 0x4000000) {
+ return 4;
+ }
+ return 5;
+
+#else
+ return 2;
+#endif
+}
+
+} // namespace anonymous
+
+BOOST_UTF8_BEGIN_NAMESPACE
+// How many "continuing octets" will be needed for this word
+// == total octets - 1.
+int utf8_codecvt_facet::get_cont_octet_out_count(
+ wchar_t word
+) const {
+ return get_cont_octet_out_count_impl<sizeof(wchar_t)>(word);
+}
+BOOST_UTF8_END_NAMESPACE
+
+#endif
diff --git a/boost/exception/detail/attribute_noreturn.hpp b/boost/exception/detail/attribute_noreturn.hpp
index f6a0b5903e..ae9f031efe 100644
--- a/boost/exception/detail/attribute_noreturn.hpp
+++ b/boost/exception/detail/attribute_noreturn.hpp
@@ -9,7 +9,7 @@
#if defined(_MSC_VER)
#define BOOST_ATTRIBUTE_NORETURN __declspec(noreturn)
#elif defined(__GNUC__)
-#define BOOST_ATTRIBUTE_NORETURN __attribute__((noreturn))
+#define BOOST_ATTRIBUTE_NORETURN __attribute__((__noreturn__))
#else
#define BOOST_ATTRIBUTE_NORETURN
#endif
diff --git a/boost/exception/detail/error_info_impl.hpp b/boost/exception/detail/error_info_impl.hpp
index 883d313a98..a8d1aa79dd 100644
--- a/boost/exception/detail/error_info_impl.hpp
+++ b/boost/exception/detail/error_info_impl.hpp
@@ -30,6 +30,7 @@ boost
protected:
+ virtual
~error_info_base() throw()
{
}
diff --git a/boost/exception/detail/exception_ptr.hpp b/boost/exception/detail/exception_ptr.hpp
index b6ccf7e18c..5e5a2679b8 100644
--- a/boost/exception/detail/exception_ptr.hpp
+++ b/boost/exception/detail/exception_ptr.hpp
@@ -25,7 +25,7 @@
#include <stdexcept>
#include <new>
#include <ios>
-#include <cstdlib>
+#include <stdlib.h>
namespace
boost
@@ -457,7 +457,12 @@ boost
BOOST_ASSERT(p);
p.ptr_->rethrow();
BOOST_ASSERT(0);
- std::abort();
+ #if defined(UNDER_CE)
+ // some CE platforms don't define ::abort()
+ exit(-1);
+ #else
+ abort();
+ #endif
}
inline
diff --git a/boost/exception/error_info.hpp b/boost/exception/error_info.hpp
index 2e6832a338..03b3da8e31 100644
--- a/boost/exception/error_info.hpp
+++ b/boost/exception/error_info.hpp
@@ -3,4 +3,7 @@
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+#ifndef UUID_EE7ECCA0433B11E1923E37064924019B
+#define UUID_EE7ECCA0433B11E1923E37064924019B
namespace boost { template <class Tag,class T> class error_info; }
+#endif
diff --git a/boost/exception/exception.hpp b/boost/exception/exception.hpp
index 9cdfd5c6e8..42d2787128 100644
--- a/boost/exception/exception.hpp
+++ b/boost/exception/exception.hpp
@@ -310,6 +310,11 @@ boost
namespace
exception_detail
{
+#if defined(__GNUC__)
+# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
+# pragma GCC visibility push (default)
+# endif
+#endif
template <class T>
struct
error_info_injector:
@@ -326,6 +331,11 @@ boost
{
}
};
+#if defined(__GNUC__)
+# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
+# pragma GCC visibility pop
+# endif
+#endif
struct large_size { char c[256]; };
large_size dispatch_boost_exception( exception const * );
@@ -373,6 +383,11 @@ boost
namespace
exception_detail
{
+#if defined(__GNUC__)
+# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
+# pragma GCC visibility push (default)
+# endif
+#endif
class
clone_base
{
@@ -386,6 +401,11 @@ boost
{
}
};
+#if defined(__GNUC__)
+# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
+# pragma GCC visibility pop
+# endif
+#endif
inline
void
@@ -410,8 +430,15 @@ boost
class
clone_impl:
public T,
- public clone_base
+ public virtual clone_base
{
+ struct clone_tag { };
+ clone_impl( clone_impl const & x, clone_tag ):
+ T(x)
+ {
+ copy_boost_exception(this,&x);
+ }
+
public:
explicit
@@ -430,7 +457,7 @@ boost
clone_base const *
clone() const
{
- return new clone_impl(*this);
+ return new clone_impl(*this,clone_tag());
}
void
diff --git a/boost/exception/info.hpp b/boost/exception/info.hpp
index 5530746223..7b56076d7b 100644
--- a/boost/exception/info.hpp
+++ b/boost/exception/info.hpp
@@ -97,7 +97,7 @@ boost
{
shared_ptr<error_info_base> const & p = i->second;
#ifndef BOOST_NO_RTTI
- BOOST_ASSERT( BOOST_EXCEPTION_DYNAMIC_TYPEID(*p).type_==ti.type_ );
+ BOOST_ASSERT( *BOOST_EXCEPTION_DYNAMIC_TYPEID(*p).type_==*ti.type_ );
#endif
return p;
}
diff --git a/boost/exception/info_tuple.hpp b/boost/exception/info_tuple.hpp
index 34afe421b1..bf1be15da2 100644
--- a/boost/exception/info_tuple.hpp
+++ b/boost/exception/info_tuple.hpp
@@ -19,6 +19,30 @@ namespace
boost
{
template <
+ class E >
+ inline
+ E const &
+ operator<<(
+ E const & x,
+ tuple< > const & v )
+ {
+ return x;
+ }
+
+ template <
+ class E,
+ class Tag1,class T1 >
+ inline
+ E const &
+ operator<<(
+ E const & x,
+ tuple<
+ error_info<Tag1,T1> > const & v )
+ {
+ return x << v.template get<0>();
+ }
+
+ template <
class E,
class Tag1,class T1,
class Tag2,class T2 >
diff --git a/boost/filesystem.hpp b/boost/filesystem.hpp
index d64d760c04..1a753026c8 100644
--- a/boost/filesystem.hpp
+++ b/boost/filesystem.hpp
@@ -12,30 +12,9 @@
#ifndef BOOST_FILESYSTEM_FILESYSTEM_HPP
#define BOOST_FILESYSTEM_FILESYSTEM_HPP
-#include <boost/config.hpp> // for <boost/config/user.hpp>, in case
- // BOOST_FILESYSTEM_VERSION defined there
-
-# if defined(BOOST_FILESYSTEM_VERSION) \
- && BOOST_FILESYSTEM_VERSION != 2 && BOOST_FILESYSTEM_VERSION != 3
-# error BOOST_FILESYSTEM_VERSION defined, but not as 2 or 3
-# endif
-
-# if !defined(BOOST_FILESYSTEM_VERSION)
-# define BOOST_FILESYSTEM_VERSION 3
-# endif
-
-#if BOOST_FILESYSTEM_VERSION == 2
-# include <boost/filesystem/v2/config.hpp>
-# include <boost/filesystem/v2/path.hpp>
-# include <boost/filesystem/v2/operations.hpp>
-# include <boost/filesystem/v2/convenience.hpp>
-
-# else
-# include <boost/filesystem/v3/config.hpp>
-# include <boost/filesystem/v3/path.hpp>
-# include <boost/filesystem/v3/operations.hpp>
-# include <boost/filesystem/v3/convenience.hpp>
-
-# endif
+# include <boost/filesystem/config.hpp>
+# include <boost/filesystem/path.hpp>
+# include <boost/filesystem/operations.hpp>
+# include <boost/filesystem/convenience.hpp>
#endif // BOOST_FILESYSTEM_FILESYSTEM_HPP
diff --git a/boost/filesystem/config.hpp b/boost/filesystem/config.hpp
index c813bf5c02..ca695f4114 100644
--- a/boost/filesystem/config.hpp
+++ b/boost/filesystem/config.hpp
@@ -1,6 +1,6 @@
-// boost/filesystem/config.hpp -------------------------------------------------------//
+// boost/filesystem/v3/config.hpp ----------------------------------------------------//
-// Copyright Beman Dawes 2010
+// Copyright Beman Dawes 2003
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
@@ -9,27 +9,101 @@
//--------------------------------------------------------------------------------------//
-#ifndef BOOST_FILESYSTEM_CONFIGX_HPP
-#define BOOST_FILESYSTEM_CONFIGX_HPP
+#ifndef BOOST_FILESYSTEM3_CONFIG_HPP
+#define BOOST_FILESYSTEM3_CONFIG_HPP
-#include <boost/config.hpp> // for <boost/config/user.hpp>, in case
- // BOOST_FILESYSTEM_VERSION defined there
-
-# if defined(BOOST_FILESYSTEM_VERSION) \
- && BOOST_FILESYSTEM_VERSION != 2 && BOOST_FILESYSTEM_VERSION != 3
-# error BOOST_FILESYSTEM_VERSION defined, but not as 2 or 3
+# if defined(BOOST_FILESYSTEM_VERSION) && BOOST_FILESYSTEM_VERSION != 3
+# error Compiling Filesystem version 3 file with BOOST_FILESYSTEM_VERSION defined != 3
# endif
# if !defined(BOOST_FILESYSTEM_VERSION)
# define BOOST_FILESYSTEM_VERSION 3
# endif
-#if BOOST_FILESYSTEM_VERSION == 2
-# include <boost/filesystem/v2/config.hpp>
+#define BOOST_FILESYSTEM_I18N // aid users wishing to compile several versions
+
+// This header implements separate compilation features as described in
+// http://www.boost.org/more/separate_compilation.html
+
+#include <boost/config.hpp>
+#include <boost/system/api_config.hpp> // for BOOST_POSIX_API or BOOST_WINDOWS_API
+#include <boost/detail/workaround.hpp>
+
+// BOOST_FILESYSTEM_DEPRECATED needed for source compiles -----------------------------//
+
+# ifdef BOOST_FILESYSTEM_SOURCE
+# define BOOST_FILESYSTEM_DEPRECATED
+# endif
+
+// throw an exception ----------------------------------------------------------------//
+//
+// Exceptions were originally thrown via boost::throw_exception().
+// As throw_exception() became more complex, it caused user error reporting
+// to be harder to interpret, since the exception reported became much more complex.
+// The immediate fix was to throw directly, wrapped in a macro to make any later change
+// easier.
+
+#define BOOST_FILESYSTEM_THROW(EX) throw EX
+
+# if defined( BOOST_NO_STD_WSTRING )
+# error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
+# endif
+
+// This header implements separate compilation features as described in
+// http://www.boost.org/more/separate_compilation.html
+
+// normalize macros ------------------------------------------------------------------//
+
+#if !defined(BOOST_FILESYSTEM_DYN_LINK) && !defined(BOOST_FILESYSTEM_STATIC_LINK) \
+ && !defined(BOOST_ALL_DYN_LINK) && !defined(BOOST_ALL_STATIC_LINK)
+# define BOOST_FILESYSTEM_STATIC_LINK
+#endif
+
+#if defined(BOOST_ALL_DYN_LINK) && !defined(BOOST_FILESYSTEM_DYN_LINK)
+# define BOOST_FILESYSTEM_DYN_LINK
+#elif defined(BOOST_ALL_STATIC_LINK) && !defined(BOOST_FILESYSTEM_STATIC_LINK)
+# define BOOST_FILESYSTEM_STATIC_LINK
+#endif
-# else
-# include <boost/filesystem/v3/config.hpp>
+#if defined(BOOST_FILESYSTEM_DYN_LINK) && defined(BOOST_FILESYSTEM_STATIC_LINK)
+# error Must not define both BOOST_FILESYSTEM_DYN_LINK and BOOST_FILESYSTEM_STATIC_LINK
+#endif
+#if defined(BOOST_ALL_NO_LIB) && !defined(BOOST_FILESYSTEM_NO_LIB)
+# define BOOST_FILESYSTEM_NO_LIB
+#endif
+
+// enable dynamic linking ------------------------------------------------------------//
+
+#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK)
+# if defined(BOOST_FILESYSTEM_SOURCE)
+# define BOOST_FILESYSTEM_DECL BOOST_SYMBOL_EXPORT
+# else
+# define BOOST_FILESYSTEM_DECL BOOST_SYMBOL_IMPORT
# endif
+#else
+# define BOOST_FILESYSTEM_DECL
+#endif
+
+// enable automatic library variant selection ----------------------------------------//
+
+#if !defined(BOOST_FILESYSTEM_SOURCE) && !defined(BOOST_ALL_NO_LIB) \
+ && !defined(BOOST_FILESYSTEM_NO_LIB)
+//
+// Set the name of our library, this will get undef'ed by auto_link.hpp
+// once it's done with it:
+//
+#define BOOST_LIB_NAME boost_filesystem
+//
+// If we're importing code from a dll, then tell auto_link.hpp about it:
+//
+#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK)
+# define BOOST_DYN_LINK
+#endif
+//
+// And include the header that does the work:
+//
+#include <boost/config/auto_link.hpp>
+#endif // auto-linking disabled
-#endif // BOOST_FILESYSTEM_CONFIGX_HPP
+#endif // BOOST_FILESYSTEM3_CONFIG_HPP
diff --git a/boost/filesystem/convenience.hpp b/boost/filesystem/convenience.hpp
index a132e17f0f..f0bd986909 100644
--- a/boost/filesystem/convenience.hpp
+++ b/boost/filesystem/convenience.hpp
@@ -1,35 +1,58 @@
-// boost/filesystem/convenience.hpp --------------------------------------------------//
+// boost/filesystem/convenience.hpp ----------------------------------------//
-// Copyright Beman Dawes 2010
+// Copyright Beman Dawes, 2002-2005
+// Copyright Vladimir Prus, 2002
+// Use, modification, and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
-// Distributed under the Boost Software License, Version 1.0.
-// See http://www.boost.org/LICENSE_1_0.txt
+// See library home page at http://www.boost.org/libs/filesystem
-// Library home page: http://www.boost.org/libs/filesystem
+//----------------------------------------------------------------------------//
-//--------------------------------------------------------------------------------------//
+#ifndef BOOST_FILESYSTEM3_CONVENIENCE_HPP
+#define BOOST_FILESYSTEM3_CONVENIENCE_HPP
-#ifndef BOOST_FILESYSTEM_CONVENIENCEX_HPP
-#define BOOST_FILESYSTEM_CONVENIENCEX_HPP
+#include <boost/config.hpp>
-#include <boost/config.hpp> // for <boost/config/user.hpp>, in case
- // BOOST_FILESYSTEM_VERSION defined there
-
-# if defined(BOOST_FILESYSTEM_VERSION) \
- && BOOST_FILESYSTEM_VERSION != 2 && BOOST_FILESYSTEM_VERSION != 3
-# error BOOST_FILESYSTEM_VERSION defined, but not as 2 or 3
+# if defined( BOOST_NO_STD_WSTRING )
+# error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
# endif
-# if !defined(BOOST_FILESYSTEM_VERSION)
-# define BOOST_FILESYSTEM_VERSION 3
-# endif
+#include <boost/filesystem/operations.hpp>
+#include <boost/system/error_code.hpp>
+
+#include <boost/config/abi_prefix.hpp> // must be the last #include
+
+namespace boost
+{
+ namespace filesystem
+ {
-#if BOOST_FILESYSTEM_VERSION == 2
-# include <boost/filesystem/v2/convenience.hpp>
+# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
-# else
-# include <boost/filesystem/v3/convenience.hpp>
+ inline std::string extension(const path & p)
+ {
+ return p.extension().string();
+ }
+
+ inline std::string basename(const path & p)
+ {
+ return p.stem().string();
+ }
+
+ inline path change_extension( const path & p, const path & new_extension )
+ {
+ path new_p( p );
+ new_p.replace_extension( new_extension );
+ return new_p;
+ }
# endif
-#endif // BOOST_FILESYSTEM_CONVENIENCEX_HPP
+
+ } // namespace filesystem
+} // namespace boost
+
+#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
+#endif // BOOST_FILESYSTEM3_CONVENIENCE_HPP
diff --git a/boost/filesystem/exception.hpp b/boost/filesystem/exception.hpp
index 6ba8466d17..985cd8f715 100644
--- a/boost/filesystem/exception.hpp
+++ b/boost/filesystem/exception.hpp
@@ -1,35 +1,9 @@
-// boost/filesystem/exception.hpp ----------------------------------------------------//
+// boost/filesystem/exception.hpp -----------------------------------------------------//
-// Copyright Beman Dawes 2010
+// Copyright Beman Dawes 2003
+// Use, modification, and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
-// Distributed under the Boost Software License, Version 1.0.
-// See http://www.boost.org/LICENSE_1_0.txt
-
-// Library home page: http://www.boost.org/libs/filesystem
-
-//--------------------------------------------------------------------------------------//
-
-#ifndef BOOST_FILESYSTEM_EXCEPTIONX_HPP
-#define BOOST_FILESYSTEM_EXCEPTIONX_HPP
-
-#include <boost/config.hpp> // for <boost/config/user.hpp>, in case
- // BOOST_FILESYSTEM_VERSION defined there
-
-# if defined(BOOST_FILESYSTEM_VERSION) \
- && BOOST_FILESYSTEM_VERSION != 2 && BOOST_FILESYSTEM_VERSION != 3
-# error BOOST_FILESYSTEM_VERSION defined, but not as 2 or 3
-# endif
-
-# if !defined(BOOST_FILESYSTEM_VERSION)
-# define BOOST_FILESYSTEM_VERSION 3
-# endif
-
-#if BOOST_FILESYSTEM_VERSION == 2
-# include <boost/filesystem/v2/exception.hpp>
-
-# else
-# include <boost/filesystem/v3/exception.hpp>
-
-# endif
-
-#endif // BOOST_FILESYSTEM_EXCEPTIONX_HPP
+// This header is no longer used. The contents have been moved to path.hpp.
+// It is provided so that user code #includes do not have to be changed.
diff --git a/boost/filesystem/fstream.hpp b/boost/filesystem/fstream.hpp
index e159e58ed3..0727238876 100644
--- a/boost/filesystem/fstream.hpp
+++ b/boost/filesystem/fstream.hpp
@@ -1,6 +1,6 @@
// boost/filesystem/fstream.hpp ------------------------------------------------------//
-// Copyright Beman Dawes 2010
+// Copyright Beman Dawes 2002
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
@@ -9,27 +9,174 @@
//--------------------------------------------------------------------------------------//
-#ifndef BOOST_FILESYSTEM_FSTREAMX_HPP
-#define BOOST_FILESYSTEM_FSTREAMX_HPP
+#ifndef BOOST_FILESYSTEM3_FSTREAM_HPP
+#define BOOST_FILESYSTEM3_FSTREAM_HPP
-#include <boost/config.hpp> // for <boost/config/user.hpp>, in case
- // BOOST_FILESYSTEM_VERSION defined there
+#include <boost/config.hpp>
-# if defined(BOOST_FILESYSTEM_VERSION) \
- && BOOST_FILESYSTEM_VERSION != 2 && BOOST_FILESYSTEM_VERSION != 3
-# error BOOST_FILESYSTEM_VERSION defined, but not as 2 or 3
+# if defined( BOOST_NO_STD_WSTRING )
+# error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
# endif
-# if !defined(BOOST_FILESYSTEM_VERSION)
-# define BOOST_FILESYSTEM_VERSION 3
-# endif
+#include <boost/filesystem/path.hpp>
+#include <iosfwd>
+#include <fstream>
-#if BOOST_FILESYSTEM_VERSION == 2
-# include <boost/filesystem/v2/fstream.hpp>
+#include <boost/config/abi_prefix.hpp> // must be the last #include
-# else
-# include <boost/filesystem/v3/fstream.hpp>
+// on Windows, except for standard libaries known to have wchar_t overloads for
+// file stream I/O, use path::string() to get a narrow character c_str()
+#if defined(BOOST_WINDOWS_API) \
+ && (!defined(_CPPLIB_VER) || _CPPLIB_VER < 405 || defined(_STLPORT_VERSION))
+ // !Dinkumware || early Dinkumware || STLPort masquerading as Dinkumware
+# define BOOST_FILESYSTEM_C_STR string().c_str() // use narrow, since wide not available
+#else // use the native c_str, which will be narrow on POSIX, wide on Windows
+# define BOOST_FILESYSTEM_C_STR c_str()
+#endif
-# endif
+namespace boost
+{
+namespace filesystem
+{
+
+//--------------------------------------------------------------------------------------//
+// basic_filebuf //
+//--------------------------------------------------------------------------------------//
+
+ template < class charT, class traits = std::char_traits<charT> >
+ class basic_filebuf : public std::basic_filebuf<charT,traits>
+ {
+ private: // disallow copying
+ basic_filebuf(const basic_filebuf&);
+ const basic_filebuf& operator=(const basic_filebuf&);
+
+ public:
+ basic_filebuf() {}
+ virtual ~basic_filebuf() {}
+
+ basic_filebuf<charT,traits>*
+ open(const path& p, std::ios_base::openmode mode)
+ {
+ return std::basic_filebuf<charT,traits>::open(p.BOOST_FILESYSTEM_C_STR, mode)
+ ? this : 0;
+ }
+ };
+
+//--------------------------------------------------------------------------------------//
+// basic_ifstream //
+//--------------------------------------------------------------------------------------//
+
+ template < class charT, class traits = std::char_traits<charT> >
+ class basic_ifstream : public std::basic_ifstream<charT,traits>
+ {
+ private: // disallow copying
+ basic_ifstream(const basic_ifstream&);
+ const basic_ifstream& operator=(const basic_ifstream&);
+
+ public:
+ basic_ifstream() {}
+
+ // use two signatures, rather than one signature with default second
+ // argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416)
+
+ explicit basic_ifstream(const path& p)
+ : std::basic_ifstream<charT,traits>(p.BOOST_FILESYSTEM_C_STR, std::ios_base::in) {}
+
+ basic_ifstream(const path& p, std::ios_base::openmode mode)
+ : std::basic_ifstream<charT,traits>(p.BOOST_FILESYSTEM_C_STR, mode) {}
+
+ void open(const path& p)
+ { std::basic_ifstream<charT,traits>::open(p.BOOST_FILESYSTEM_C_STR, std::ios_base::in); }
+
+ void open(const path& p, std::ios_base::openmode mode)
+ { std::basic_ifstream<charT,traits>::open(p.BOOST_FILESYSTEM_C_STR, mode); }
+
+ virtual ~basic_ifstream() {}
+ };
+
+//--------------------------------------------------------------------------------------//
+// basic_ofstream //
+//--------------------------------------------------------------------------------------//
+
+ template < class charT, class traits = std::char_traits<charT> >
+ class basic_ofstream : public std::basic_ofstream<charT,traits>
+ {
+ private: // disallow copying
+ basic_ofstream(const basic_ofstream&);
+ const basic_ofstream& operator=(const basic_ofstream&);
+
+ public:
+ basic_ofstream() {}
+
+ // use two signatures, rather than one signature with default second
+ // argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416)
+
+ explicit basic_ofstream(const path& p)
+ : std::basic_ofstream<charT,traits>(p.BOOST_FILESYSTEM_C_STR, std::ios_base::out) {}
+
+ basic_ofstream(const path& p, std::ios_base::openmode mode)
+ : std::basic_ofstream<charT,traits>(p.BOOST_FILESYSTEM_C_STR, mode) {}
+
+ void open(const path& p)
+ { std::basic_ofstream<charT,traits>::open(p.BOOST_FILESYSTEM_C_STR, std::ios_base::out); }
+
+ void open(const path& p, std::ios_base::openmode mode)
+ { std::basic_ofstream<charT,traits>::open(p.BOOST_FILESYSTEM_C_STR, mode); }
+
+ virtual ~basic_ofstream() {}
+ };
+
+//--------------------------------------------------------------------------------------//
+// basic_fstream //
+//--------------------------------------------------------------------------------------//
+
+ template < class charT, class traits = std::char_traits<charT> >
+ class basic_fstream : public std::basic_fstream<charT,traits>
+ {
+ private: // disallow copying
+ basic_fstream(const basic_fstream&);
+ const basic_fstream & operator=(const basic_fstream&);
+
+ public:
+ basic_fstream() {}
+
+ // use two signatures, rather than one signature with default second
+ // argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416)
+
+ explicit basic_fstream(const path& p)
+ : std::basic_fstream<charT,traits>(p.BOOST_FILESYSTEM_C_STR,
+ std::ios_base::in | std::ios_base::out) {}
+
+ basic_fstream(const path& p, std::ios_base::openmode mode)
+ : std::basic_fstream<charT,traits>(p.BOOST_FILESYSTEM_C_STR, mode) {}
+
+ void open(const path& p)
+ { std::basic_fstream<charT,traits>::open(p.BOOST_FILESYSTEM_C_STR,
+ std::ios_base::in | std::ios_base::out); }
+
+ void open(const path& p, std::ios_base::openmode mode)
+ { std::basic_fstream<charT,traits>::open(p.BOOST_FILESYSTEM_C_STR, mode); }
+
+ virtual ~basic_fstream() {}
+
+ };
+
+//--------------------------------------------------------------------------------------//
+// typedefs //
+//--------------------------------------------------------------------------------------//
+
+ typedef basic_filebuf<char> filebuf;
+ typedef basic_ifstream<char> ifstream;
+ typedef basic_ofstream<char> ofstream;
+ typedef basic_fstream<char> fstream;
+
+ typedef basic_filebuf<wchar_t> wfilebuf;
+ typedef basic_ifstream<wchar_t> wifstream;
+ typedef basic_ofstream<wchar_t> wofstream;
+ typedef basic_fstream<wchar_t> wfstream;
+
+} // namespace filesystem
+} // namespace boost
-#endif // BOOST_FILESYSTEM_FSTREAMX_HPP
+#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
+#endif // BOOST_FILESYSTEM3_FSTREAM_HPP
diff --git a/boost/filesystem/operations.hpp b/boost/filesystem/operations.hpp
index db7b1235e0..dc01b7d8ba 100644
--- a/boost/filesystem/operations.hpp
+++ b/boost/filesystem/operations.hpp
@@ -1,35 +1,1096 @@
// boost/filesystem/operations.hpp ---------------------------------------------------//
-// Copyright Beman Dawes 2010
-
+// Copyright Beman Dawes 2002-2009
+// Copyright Jan Langer 2002
+// Copyright Dietmar Kuehl 2001
+// Copyright Vladimir Prus 2002
+
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
// Library home page: http://www.boost.org/libs/filesystem
-//--------------------------------------------------------------------------------------//
+//--------------------------------------------------------------------------------------//
+
+#ifndef BOOST_FILESYSTEM3_OPERATIONS_HPP
+#define BOOST_FILESYSTEM3_OPERATIONS_HPP
+
+#include <boost/config.hpp>
+
+# if defined( BOOST_NO_STD_WSTRING )
+# error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
+# endif
+
+#include <boost/filesystem/config.hpp>
+#include <boost/filesystem/path.hpp>
+
+#include <boost/detail/scoped_enum_emulation.hpp>
+#include <boost/detail/bitmask.hpp>
+#include <boost/system/error_code.hpp>
+#include <boost/system/system_error.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/iterator.hpp>
+#include <boost/cstdint.hpp>
+#include <boost/assert.hpp>
+
+#include <string>
+#include <utility> // for pair
+#include <ctime>
+#include <vector>
+#include <stack>
+
+#ifdef BOOST_WINDOWS_API
+# include <fstream>
+#endif
+
+#include <boost/config/abi_prefix.hpp> // must be the last #include
+
+//--------------------------------------------------------------------------------------//
+
+namespace boost
+{
+ namespace filesystem
+ {
+
+//--------------------------------------------------------------------------------------//
+// file_type //
+//--------------------------------------------------------------------------------------//
+
+ enum file_type
+ {
+ status_error,
+# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
+ status_unknown = status_error,
+# endif
+ file_not_found,
+ regular_file,
+ directory_file,
+ // the following may not apply to some operating systems or file systems
+ symlink_file,
+ block_file,
+ character_file,
+ fifo_file,
+ socket_file,
+ reparse_file, // Windows: FILE_ATTRIBUTE_REPARSE_POINT that is not a symlink
+ type_unknown, // file does exist, but isn't one of the above types or
+ // we don't have strong enough permission to find its type
+
+ _detail_directory_symlink // internal use only; never exposed to users
+ };
+
+//--------------------------------------------------------------------------------------//
+// perms //
+//--------------------------------------------------------------------------------------//
+
+ enum perms
+ {
+ no_perms = 0, // file_not_found is no_perms rather than perms_not_known
+
+ // POSIX equivalent macros given in comments.
+ // Values are from POSIX and are given in octal per the POSIX standard.
+
+ // permission bits
+
+ owner_read = 0400, // S_IRUSR, Read permission, owner
+ owner_write = 0200, // S_IWUSR, Write permission, owner
+ owner_exe = 0100, // S_IXUSR, Execute/search permission, owner
+ owner_all = 0700, // S_IRWXU, Read, write, execute/search by owner
+
+ group_read = 040, // S_IRGRP, Read permission, group
+ group_write = 020, // S_IWGRP, Write permission, group
+ group_exe = 010, // S_IXGRP, Execute/search permission, group
+ group_all = 070, // S_IRWXG, Read, write, execute/search by group
+
+ others_read = 04, // S_IROTH, Read permission, others
+ others_write = 02, // S_IWOTH, Write permission, others
+ others_exe = 01, // S_IXOTH, Execute/search permission, others
+ others_all = 07, // S_IRWXO, Read, write, execute/search by others
+
+ all_all = owner_all|group_all|others_all, // 0777
+
+ // other POSIX bits
+
+ set_uid_on_exe = 04000, // S_ISUID, Set-user-ID on execution
+ set_gid_on_exe = 02000, // S_ISGID, Set-group-ID on execution
+ sticky_bit = 01000, // S_ISVTX,
+ // (POSIX XSI) On directories, restricted deletion flag
+ // (V7) 'sticky bit': save swapped text even after use
+ // (SunOS) On non-directories: don't cache this file
+ // (SVID-v4.2) On directories: restricted deletion flag
+ // Also see http://en.wikipedia.org/wiki/Sticky_bit
+
+ perms_mask = all_all|set_uid_on_exe|set_gid_on_exe|sticky_bit, // 07777
+
+ perms_not_known = 0xFFFF, // present when directory_entry cache not loaded
+
+ // options for permissions() function
+
+ add_perms = 0x1000, // adds the given permission bits to the current bits
+ remove_perms = 0x2000, // removes the given permission bits from the current bits;
+ // choose add_perms or remove_perms, not both; if neither add_perms
+ // nor remove_perms is given, replace the current bits with
+ // the given bits.
+
+ symlink_perms = 0x4000 // on POSIX, don't resolve symlinks; implied on Windows
+ };
+
+ BOOST_BITMASK(perms)
+
+//--------------------------------------------------------------------------------------//
+// file_status //
+//--------------------------------------------------------------------------------------//
+
+ class BOOST_FILESYSTEM_DECL file_status
+ {
+ public:
+ file_status() : m_value(status_error), m_perms(perms_not_known) {}
+ explicit file_status(file_type v, perms prms = perms_not_known)
+ : m_value(v), m_perms(prms) {}
+
+ // observers
+ file_type type() const { return m_value; }
+ perms permissions() const { return m_perms; }
+
+ // modifiers
+ void type(file_type v) { m_value = v; }
+ void permissions(perms prms) { m_perms = prms; }
+
+ bool operator==(const file_status& rhs) const { return type() == rhs.type() &&
+ permissions() == rhs.permissions(); }
+ bool operator!=(const file_status& rhs) const { return !(*this == rhs); }
+
+ private:
+ file_type m_value;
+ enum perms m_perms;
+ };
+
+ inline bool type_present(file_status f) { return f.type() != status_error; }
+ inline bool permissions_present(file_status f)
+ {return f.permissions() != perms_not_known;}
+ inline bool status_known(file_status f) { return type_present(f) && permissions_present(f); }
+ inline bool exists(file_status f) { return f.type() != status_error
+ && f.type() != file_not_found; }
+ inline bool is_regular_file(file_status f){ return f.type() == regular_file; }
+ inline bool is_directory(file_status f) { return f.type() == directory_file; }
+ inline bool is_symlink(file_status f) { return f.type() == symlink_file; }
+ inline bool is_other(file_status f) { return exists(f) && !is_regular_file(f)
+ && !is_directory(f) && !is_symlink(f); }
+
+# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
+ inline bool is_regular(file_status f) { return f.type() == regular_file; }
+# endif
+
+ struct space_info
+ {
+ // all values are byte counts
+ boost::uintmax_t capacity;
+ boost::uintmax_t free; // <= capacity
+ boost::uintmax_t available; // <= free
+ };
-#ifndef BOOST_FILESYSTEM_OPERATIONSX_HPP
-#define BOOST_FILESYSTEM_OPERATIONSX_HPP
+ BOOST_SCOPED_ENUM_START(copy_option)
+ {none, fail_if_exists = none, overwrite_if_exists};
+ BOOST_SCOPED_ENUM_END
-#include <boost/config.hpp> // for <boost/config/user.hpp>, in case
- // BOOST_FILESYSTEM_VERSION defined there
+//--------------------------------------------------------------------------------------//
+// implementation details //
+//--------------------------------------------------------------------------------------//
-# if defined(BOOST_FILESYSTEM_VERSION) \
- && BOOST_FILESYSTEM_VERSION != 2 && BOOST_FILESYSTEM_VERSION != 3
-# error BOOST_FILESYSTEM_VERSION defined, but not as 2 or 3
+ namespace detail
+ {
+ BOOST_FILESYSTEM_DECL
+ file_status status(const path&p, system::error_code* ec=0);
+ BOOST_FILESYSTEM_DECL
+ file_status symlink_status(const path& p, system::error_code* ec=0);
+ BOOST_FILESYSTEM_DECL
+ bool is_empty(const path& p, system::error_code* ec=0);
+ BOOST_FILESYSTEM_DECL
+ path initial_path(system::error_code* ec=0);
+ BOOST_FILESYSTEM_DECL
+ path canonical(const path& p, const path& base, system::error_code* ec=0);
+ BOOST_FILESYSTEM_DECL
+ void copy(const path& from, const path& to, system::error_code* ec=0);
+ BOOST_FILESYSTEM_DECL
+ void copy_directory(const path& from, const path& to, system::error_code* ec=0);
+ BOOST_FILESYSTEM_DECL
+ void copy_file(const path& from, const path& to,
+ BOOST_SCOPED_ENUM(copy_option) option, // See ticket #2925
+ system::error_code* ec=0);
+ BOOST_FILESYSTEM_DECL
+ void copy_symlink(const path& existing_symlink, const path& new_symlink, system::error_code* ec=0);
+ BOOST_FILESYSTEM_DECL
+ bool create_directories(const path& p, system::error_code* ec=0);
+ BOOST_FILESYSTEM_DECL
+ bool create_directory(const path& p, system::error_code* ec=0);
+ BOOST_FILESYSTEM_DECL
+ void create_directory_symlink(const path& to, const path& from,
+ system::error_code* ec=0);
+ BOOST_FILESYSTEM_DECL
+ void create_hard_link(const path& to, const path& from, system::error_code* ec=0);
+ BOOST_FILESYSTEM_DECL
+ void create_symlink(const path& to, const path& from, system::error_code* ec=0);
+ BOOST_FILESYSTEM_DECL
+ path current_path(system::error_code* ec=0);
+ BOOST_FILESYSTEM_DECL
+ void current_path(const path& p, system::error_code* ec=0);
+ BOOST_FILESYSTEM_DECL
+ bool equivalent(const path& p1, const path& p2, system::error_code* ec=0);
+ BOOST_FILESYSTEM_DECL
+ boost::uintmax_t file_size(const path& p, system::error_code* ec=0);
+ BOOST_FILESYSTEM_DECL
+ boost::uintmax_t hard_link_count(const path& p, system::error_code* ec=0);
+ BOOST_FILESYSTEM_DECL
+ std::time_t last_write_time(const path& p, system::error_code* ec=0);
+ BOOST_FILESYSTEM_DECL
+ void last_write_time(const path& p, const std::time_t new_time,
+ system::error_code* ec=0);
+ BOOST_FILESYSTEM_DECL
+ void permissions(const path& p, perms prms, system::error_code* ec=0);
+ BOOST_FILESYSTEM_DECL
+ path read_symlink(const path& p, system::error_code* ec=0);
+ BOOST_FILESYSTEM_DECL
+ // For standardization, if the committee doesn't like "remove", consider "eliminate"
+ bool remove(const path& p, system::error_code* ec=0);
+ BOOST_FILESYSTEM_DECL
+ boost::uintmax_t remove_all(const path& p, system::error_code* ec=0);
+ BOOST_FILESYSTEM_DECL
+ void rename(const path& old_p, const path& new_p, system::error_code* ec=0);
+ BOOST_FILESYSTEM_DECL
+ void resize_file(const path& p, uintmax_t size, system::error_code* ec=0);
+ BOOST_FILESYSTEM_DECL
+ space_info space(const path& p, system::error_code* ec=0);
+ BOOST_FILESYSTEM_DECL
+ path system_complete(const path& p, system::error_code* ec=0);
+ BOOST_FILESYSTEM_DECL
+ path temp_directory_path(system::error_code* ec=0);
+ BOOST_FILESYSTEM_DECL
+ path unique_path(const path& p, system::error_code* ec=0);
+ } // namespace detail
+
+//--------------------------------------------------------------------------------------//
+// //
+// status query functions //
+// //
+//--------------------------------------------------------------------------------------//
+
+ inline
+ file_status status(const path& p) {return detail::status(p);}
+ inline
+ file_status status(const path& p, system::error_code& ec)
+ {return detail::status(p, &ec);}
+ inline
+ file_status symlink_status(const path& p) {return detail::symlink_status(p);}
+ inline
+ file_status symlink_status(const path& p, system::error_code& ec)
+ {return detail::symlink_status(p, &ec);}
+ inline
+ bool exists(const path& p) {return exists(detail::status(p));}
+ inline
+ bool exists(const path& p, system::error_code& ec)
+ {return exists(detail::status(p, &ec));}
+ inline
+ bool is_directory(const path& p) {return is_directory(detail::status(p));}
+ inline
+ bool is_directory(const path& p, system::error_code& ec)
+ {return is_directory(detail::status(p, &ec));}
+ inline
+ bool is_regular_file(const path& p) {return is_regular_file(detail::status(p));}
+ inline
+ bool is_regular_file(const path& p, system::error_code& ec)
+ {return is_regular_file(detail::status(p, &ec));}
+ inline
+ bool is_other(const path& p) {return is_other(detail::status(p));}
+ inline
+ bool is_other(const path& p, system::error_code& ec)
+ {return is_other(detail::status(p, &ec));}
+ inline
+ bool is_symlink(const path& p) {return is_symlink(detail::symlink_status(p));}
+ inline
+ bool is_symlink(const path& p, system::error_code& ec)
+ {return is_symlink(detail::symlink_status(p, &ec));}
+# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
+ inline
+ bool is_regular(const path& p) {return is_regular(detail::status(p));}
+ inline
+ bool is_regular(const path& p, system::error_code& ec)
+ {return is_regular(detail::status(p, &ec));}
+# endif
+
+ inline
+ bool is_empty(const path& p) {return detail::is_empty(p);}
+ inline
+ bool is_empty(const path& p, system::error_code& ec)
+ {return detail::is_empty(p, &ec);}
+
+//--------------------------------------------------------------------------------------//
+// //
+// operational functions //
+// in alphabetical order, unless otherwise noted //
+// //
+//--------------------------------------------------------------------------------------//
+
+ // forward declarations
+ path current_path(); // fwd declaration
+ path initial_path();
+
+ BOOST_FILESYSTEM_DECL
+ path absolute(const path& p, const path& base=current_path());
+ // If base.is_absolute(), throws nothing. Thus no need for ec argument
+
+ inline
+ path canonical(const path& p, const path& base=current_path())
+ {return detail::canonical(p, base);}
+ inline
+ path canonical(const path& p, system::error_code& ec)
+ {return detail::canonical(p, current_path(), &ec);}
+ inline
+ path canonical(const path& p, const path& base, system::error_code& ec)
+ {return detail::canonical(p, base, &ec);}
+
+# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
+ inline
+ path complete(const path& p)
+ {
+ return absolute(p, initial_path());
+ }
+
+ inline
+ path complete(const path& p, const path& base)
+ {
+ return absolute(p, base);
+ }
+# endif
+
+ inline
+ void copy(const path& from, const path& to) {detail::copy(from, to);}
+
+ inline
+ void copy(const path& from, const path& to, system::error_code& ec)
+ {detail::copy(from, to, &ec);}
+ inline
+ void copy_directory(const path& from, const path& to)
+ {detail::copy_directory(from, to);}
+ inline
+ void copy_directory(const path& from, const path& to, system::error_code& ec)
+ {detail::copy_directory(from, to, &ec);}
+ inline
+ void copy_file(const path& from, const path& to, // See ticket #2925
+ BOOST_SCOPED_ENUM(copy_option) option)
+ {detail::copy_file(from, to, option);}
+ inline
+ void copy_file(const path& from, const path& to)
+ {detail::copy_file(from, to, copy_option::fail_if_exists);}
+ inline
+ void copy_file(const path& from, const path& to, // See ticket #2925
+ BOOST_SCOPED_ENUM(copy_option) option, system::error_code& ec)
+ {detail::copy_file(from, to, option, &ec);}
+ inline
+ void copy_file(const path& from, const path& to, system::error_code& ec)
+ {detail::copy_file(from, to, copy_option::fail_if_exists, &ec);}
+ inline
+ void copy_symlink(const path& existing_symlink, const path& new_symlink) {detail::copy_symlink(existing_symlink, new_symlink);}
+
+ inline
+ void copy_symlink(const path& existing_symlink, const path& new_symlink, system::error_code& ec)
+ {detail::copy_symlink(existing_symlink, new_symlink, &ec);}
+ inline
+ bool create_directories(const path& p) {return detail::create_directories(p);}
+
+ inline
+ bool create_directories(const path& p, system::error_code& ec)
+ {return detail::create_directories(p, &ec);}
+ inline
+ bool create_directory(const path& p) {return detail::create_directory(p);}
+
+ inline
+ bool create_directory(const path& p, system::error_code& ec)
+ {return detail::create_directory(p, &ec);}
+ inline
+ void create_directory_symlink(const path& to, const path& from)
+ {detail::create_directory_symlink(to, from);}
+ inline
+ void create_directory_symlink(const path& to, const path& from, system::error_code& ec)
+ {detail::create_directory_symlink(to, from, &ec);}
+ inline
+ void create_hard_link(const path& to, const path& new_hard_link) {detail::create_hard_link(to, new_hard_link);}
+
+ inline
+ void create_hard_link(const path& to, const path& new_hard_link, system::error_code& ec)
+ {detail::create_hard_link(to, new_hard_link, &ec);}
+ inline
+ void create_symlink(const path& to, const path& new_symlink) {detail::create_symlink(to, new_symlink);}
+
+ inline
+ void create_symlink(const path& to, const path& new_symlink, system::error_code& ec)
+ {detail::create_symlink(to, new_symlink, &ec);}
+ inline
+ path current_path() {return detail::current_path();}
+
+ inline
+ path current_path(system::error_code& ec) {return detail::current_path(&ec);}
+
+ inline
+ void current_path(const path& p) {detail::current_path(p);}
+
+ inline
+ void current_path(const path& p, system::error_code& ec) {detail::current_path(p, &ec);}
+
+ inline
+ bool equivalent(const path& p1, const path& p2) {return detail::equivalent(p1, p2);}
+
+ inline
+ bool equivalent(const path& p1, const path& p2, system::error_code& ec)
+ {return detail::equivalent(p1, p2, &ec);}
+ inline
+ boost::uintmax_t file_size(const path& p) {return detail::file_size(p);}
+
+ inline
+ boost::uintmax_t file_size(const path& p, system::error_code& ec)
+ {return detail::file_size(p, &ec);}
+ inline
+ boost::uintmax_t hard_link_count(const path& p) {return detail::hard_link_count(p);}
+
+ inline
+ boost::uintmax_t hard_link_count(const path& p, system::error_code& ec)
+ {return detail::hard_link_count(p, &ec);}
+ inline
+ path initial_path() {return detail::initial_path();}
+
+ inline
+ path initial_path(system::error_code& ec) {return detail::initial_path(&ec);}
+
+ template <class Path>
+ path initial_path() {return initial_path();}
+ template <class Path>
+ path initial_path(system::error_code& ec) {return detail::initial_path(&ec);}
+
+ inline
+ std::time_t last_write_time(const path& p) {return detail::last_write_time(p);}
+
+ inline
+ std::time_t last_write_time(const path& p, system::error_code& ec)
+ {return detail::last_write_time(p, &ec);}
+ inline
+ void last_write_time(const path& p, const std::time_t new_time)
+ {detail::last_write_time(p, new_time);}
+ inline
+ void last_write_time(const path& p, const std::time_t new_time, system::error_code& ec)
+ {detail::last_write_time(p, new_time, &ec);}
+ inline
+ void permissions(const path& p, perms prms)
+ {detail::permissions(p, prms);}
+ inline
+ void permissions(const path& p, perms prms, system::error_code& ec)
+ {detail::permissions(p, prms, &ec);}
+
+ inline
+ path read_symlink(const path& p) {return detail::read_symlink(p);}
+
+ inline
+ path read_symlink(const path& p, system::error_code& ec)
+ {return detail::read_symlink(p, &ec);}
+ inline
+ // For standardization, if the committee doesn't like "remove", consider "eliminate"
+ bool remove(const path& p) {return detail::remove(p);}
+
+ inline
+ bool remove(const path& p, system::error_code& ec) {return detail::remove(p, &ec);}
+
+ inline
+ boost::uintmax_t remove_all(const path& p) {return detail::remove_all(p);}
+
+ inline
+ boost::uintmax_t remove_all(const path& p, system::error_code& ec)
+ {return detail::remove_all(p, &ec);}
+ inline
+ void rename(const path& old_p, const path& new_p) {detail::rename(old_p, new_p);}
+
+ inline
+ void rename(const path& old_p, const path& new_p, system::error_code& ec)
+ {detail::rename(old_p, new_p, &ec);}
+ inline // name suggested by Scott McMurray
+ void resize_file(const path& p, uintmax_t size) {detail::resize_file(p, size);}
+
+ inline
+ void resize_file(const path& p, uintmax_t size, system::error_code& ec)
+ {detail::resize_file(p, size, &ec);}
+ inline
+ space_info space(const path& p) {return detail::space(p);}
+
+ inline
+ space_info space(const path& p, system::error_code& ec) {return detail::space(p, &ec);}
+
+# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
+ inline bool symbolic_link_exists(const path& p)
+ { return is_symlink(symlink_status(p)); }
# endif
-# if !defined(BOOST_FILESYSTEM_VERSION)
-# define BOOST_FILESYSTEM_VERSION 3
+ inline
+ path system_complete(const path& p) {return detail::system_complete(p);}
+
+ inline
+ path system_complete(const path& p, system::error_code& ec)
+ {return detail::system_complete(p, &ec);}
+ inline
+ path temp_directory_path() {return detail::temp_directory_path();}
+
+ inline
+ path temp_directory_path(system::error_code& ec)
+ {return detail::temp_directory_path(&ec);}
+ inline
+ path unique_path(const path& p="%%%%-%%%%-%%%%-%%%%")
+ { return detail::unique_path(p); }
+ inline
+ path unique_path(const path& p, system::error_code& ec)
+ { return detail::unique_path(p, &ec); }
+
+//--------------------------------------------------------------------------------------//
+// //
+// directory_entry //
+// //
+//--------------------------------------------------------------------------------------//
+
+// GCC has a problem with a member function named path within a namespace or
+// sub-namespace that also has a class named path. The workaround is to always
+// fully qualify the name path when it refers to the class name.
+
+class BOOST_FILESYSTEM_DECL directory_entry
+{
+public:
+
+ // compiler generated copy constructor, copy assignment, and destructor apply
+
+ directory_entry() {}
+ explicit directory_entry(const boost::filesystem::path& p,
+ file_status st = file_status(), file_status symlink_st=file_status())
+ : m_path(p), m_status(st), m_symlink_status(symlink_st)
+ {}
+
+ void assign(const boost::filesystem::path& p,
+ file_status st = file_status(), file_status symlink_st = file_status())
+ { m_path = p; m_status = st; m_symlink_status = symlink_st; }
+
+ void replace_filename(const boost::filesystem::path& p,
+ file_status st = file_status(), file_status symlink_st = file_status())
+ {
+ m_path.remove_filename();
+ m_path /= p;
+ m_status = st;
+ m_symlink_status = symlink_st;
+ }
+
+# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
+ void replace_leaf(const boost::filesystem::path& p,
+ file_status st, file_status symlink_st)
+ { replace_filename(p, st, symlink_st); }
# endif
-#if BOOST_FILESYSTEM_VERSION == 2
-# include <boost/filesystem/v2/operations.hpp>
+ const boost::filesystem::path& path() const {return m_path;}
+ file_status status() const {return m_get_status();}
+ file_status status(system::error_code& ec) const {return m_get_status(&ec);}
+ file_status symlink_status() const {return m_get_symlink_status();}
+ file_status symlink_status(system::error_code& ec) const {return m_get_symlink_status(&ec);}
+
+ bool operator==(const directory_entry& rhs) {return m_path == rhs.m_path;}
+ bool operator!=(const directory_entry& rhs) {return m_path != rhs.m_path;}
+ bool operator< (const directory_entry& rhs) {return m_path < rhs.m_path;}
+ bool operator<=(const directory_entry& rhs) {return m_path <= rhs.m_path;}
+ bool operator> (const directory_entry& rhs) {return m_path > rhs.m_path;}
+ bool operator>=(const directory_entry& rhs) {return m_path >= rhs.m_path;}
+
+private:
+ boost::filesystem::path m_path;
+ mutable file_status m_status; // stat()-like
+ mutable file_status m_symlink_status; // lstat()-like
+
+ file_status m_get_status(system::error_code* ec=0) const;
+ file_status m_get_symlink_status(system::error_code* ec=0) const;
+}; // directory_entry
+
+//--------------------------------------------------------------------------------------//
+// //
+// directory_iterator helpers //
+// //
+//--------------------------------------------------------------------------------------//
+
+class directory_iterator;
+
+namespace detail
+{
+ BOOST_FILESYSTEM_DECL
+ system::error_code dir_itr_close(// never throws()
+ void *& handle
+# if defined(BOOST_POSIX_API)
+ , void *& buffer
+# endif
+ );
+
+ struct dir_itr_imp
+ {
+ directory_entry dir_entry;
+ void* handle;
+
+# ifdef BOOST_POSIX_API
+ void* buffer; // see dir_itr_increment implementation
+# endif
+
+ dir_itr_imp() : handle(0)
+# ifdef BOOST_POSIX_API
+ , buffer(0)
+# endif
+ {}
+
+ ~dir_itr_imp() // never throws
+ {
+ dir_itr_close(handle
+# if defined(BOOST_POSIX_API)
+ , buffer
+# endif
+ );
+ }
+ };
+
+ // see path::iterator: comment below
+ BOOST_FILESYSTEM_DECL void directory_iterator_construct(directory_iterator& it,
+ const path& p, system::error_code* ec);
+ BOOST_FILESYSTEM_DECL void directory_iterator_increment(directory_iterator& it,
+ system::error_code* ec);
+
+} // namespace detail
+
+//--------------------------------------------------------------------------------------//
+// //
+// directory_iterator //
+// //
+//--------------------------------------------------------------------------------------//
+
+ class directory_iterator
+ : public boost::iterator_facade< directory_iterator,
+ directory_entry,
+ boost::single_pass_traversal_tag >
+ {
+ public:
+
+ directory_iterator(){} // creates the "end" iterator
+
+ // iterator_facade derived classes don't seem to like implementations in
+ // separate translation unit dll's, so forward to detail functions
+ explicit directory_iterator(const path& p)
+ : m_imp(new detail::dir_itr_imp)
+ { detail::directory_iterator_construct(*this, p, 0); }
+
+ directory_iterator(const path& p, system::error_code& ec)
+ : m_imp(new detail::dir_itr_imp)
+ { detail::directory_iterator_construct(*this, p, &ec); }
+
+ ~directory_iterator() {} // never throws
+
+ directory_iterator& increment(system::error_code& ec)
+ {
+ detail::directory_iterator_increment(*this, &ec);
+ return *this;
+ }
+
+ private:
+ friend struct detail::dir_itr_imp;
+ friend BOOST_FILESYSTEM_DECL void detail::directory_iterator_construct(directory_iterator& it,
+ const path& p, system::error_code* ec);
+ friend BOOST_FILESYSTEM_DECL void detail::directory_iterator_increment(directory_iterator& it,
+ system::error_code* ec);
+
+ // shared_ptr provides shallow-copy semantics required for InputIterators.
+ // m_imp.get()==0 indicates the end iterator.
+ boost::shared_ptr< detail::dir_itr_imp > m_imp;
+
+ friend class boost::iterator_core_access;
+
+ boost::iterator_facade<
+ directory_iterator,
+ directory_entry,
+ boost::single_pass_traversal_tag >::reference dereference() const
+ {
+ BOOST_ASSERT_MSG(m_imp.get(), "attempt to dereference end iterator");
+ return m_imp->dir_entry;
+ }
+
+ void increment() { detail::directory_iterator_increment(*this, 0); }
+
+ bool equal(const directory_iterator& rhs) const
+ { return m_imp == rhs.m_imp; }
+ };
+
+//--------------------------------------------------------------------------------------//
+// //
+// recursive_directory_iterator helpers //
+// //
+//--------------------------------------------------------------------------------------//
+
+ BOOST_SCOPED_ENUM_START(symlink_option)
+ {
+ none,
+ no_recurse = none, // don't follow directory symlinks (default behavior)
+ recurse, // follow directory symlinks
+ _detail_no_push = recurse << 1 // internal use only
+ };
+ BOOST_SCOPED_ENUM_END
+
+ BOOST_BITMASK(BOOST_SCOPED_ENUM(symlink_option))
+
+ namespace detail
+ {
+ struct recur_dir_itr_imp
+ {
+ typedef directory_iterator element_type;
+ std::stack< element_type, std::vector< element_type > > m_stack;
+ int m_level;
+ BOOST_SCOPED_ENUM(symlink_option) m_options;
+
+ recur_dir_itr_imp() : m_level(0), m_options(symlink_option::none) {}
+
+ void increment(system::error_code* ec); // ec == 0 means throw on error
+
+ void pop();
+
+ };
+
+ // Implementation is inline to avoid dynamic linking difficulties with m_stack:
+ // Microsoft warning C4251, m_stack needs to have dll-interface to be used by
+ // clients of struct 'boost::filesystem::detail::recur_dir_itr_imp'
-# else
-# include <boost/filesystem/v3/operations.hpp>
+ inline
+ void recur_dir_itr_imp::increment(system::error_code* ec)
+ // ec == 0 means throw on error
+ {
+ if ((m_options & symlink_option::_detail_no_push) == symlink_option::_detail_no_push)
+ m_options &= ~symlink_option::_detail_no_push;
+ else
+ {
+ // Logic for following predicate was contributed by Daniel Aarno to handle cyclic
+ // symlinks correctly and efficiently, fixing ticket #5652.
+ // if (((m_options & symlink_option::recurse) == symlink_option::recurse
+ // || !is_symlink(m_stack.top()->symlink_status()))
+ // && is_directory(m_stack.top()->status())) ...
+ // The predicate code has since been rewritten to pass error_code arguments,
+ // per ticket #5653.
+ bool or_pred = (m_options & symlink_option::recurse) == symlink_option::recurse
+ || (ec == 0 ? !is_symlink(m_stack.top()->symlink_status())
+ : !is_symlink(m_stack.top()->symlink_status(*ec)));
+ if (ec != 0 && *ec)
+ return;
+ bool and_pred = or_pred && (ec == 0 ? is_directory(m_stack.top()->status())
+ : is_directory(m_stack.top()->status(*ec)));
+ if (ec != 0 && *ec)
+ return;
+
+ if (and_pred)
+ {
+ if (ec == 0)
+ m_stack.push(directory_iterator(m_stack.top()->path()));
+ else
+ {
+ m_stack.push(directory_iterator(m_stack.top()->path(), *ec));
+ if (*ec)
+ return;
+ }
+ if (m_stack.top() != directory_iterator())
+ {
+ ++m_level;
+ return;
+ }
+ m_stack.pop();
+ }
+ }
+
+ while (!m_stack.empty() && ++m_stack.top() == directory_iterator())
+ {
+ m_stack.pop();
+ --m_level;
+ }
+ }
+
+ inline
+ void recur_dir_itr_imp::pop()
+ {
+ BOOST_ASSERT_MSG(m_level > 0,
+ "pop() on recursive_directory_iterator with level < 1");
+
+ do
+ {
+ m_stack.pop();
+ --m_level;
+ }
+ while (!m_stack.empty() && ++m_stack.top() == directory_iterator());
+ }
+ } // namespace detail
+
+//--------------------------------------------------------------------------------------//
+// //
+// recursive_directory_iterator //
+// //
+//--------------------------------------------------------------------------------------//
+
+ class recursive_directory_iterator
+ : public boost::iterator_facade<
+ recursive_directory_iterator,
+ directory_entry,
+ boost::single_pass_traversal_tag >
+ {
+ public:
+
+ recursive_directory_iterator(){} // creates the "end" iterator
+
+ explicit recursive_directory_iterator(const path& dir_path,
+ BOOST_SCOPED_ENUM(symlink_option) opt = symlink_option::none)
+ : m_imp(new detail::recur_dir_itr_imp)
+ {
+ m_imp->m_options = opt;
+ m_imp->m_stack.push(directory_iterator(dir_path));
+ if (m_imp->m_stack.top() == directory_iterator())
+ { m_imp.reset (); }
+ }
+
+ recursive_directory_iterator(const path& dir_path,
+ BOOST_SCOPED_ENUM(symlink_option) opt,
+ system::error_code & ec)
+ : m_imp(new detail::recur_dir_itr_imp)
+ {
+ m_imp->m_options = opt;
+ m_imp->m_stack.push(directory_iterator(dir_path, ec));
+ if (m_imp->m_stack.top() == directory_iterator())
+ { m_imp.reset (); }
+ }
+
+ recursive_directory_iterator(const path& dir_path,
+ system::error_code & ec)
+ : m_imp(new detail::recur_dir_itr_imp)
+ {
+ m_imp->m_options = symlink_option::none;
+ m_imp->m_stack.push(directory_iterator(dir_path, ec));
+ if (m_imp->m_stack.top() == directory_iterator())
+ { m_imp.reset (); }
+ }
+
+ recursive_directory_iterator& increment(system::error_code& ec)
+ {
+ BOOST_ASSERT_MSG(m_imp.get(),
+ "increment() on end recursive_directory_iterator");
+ m_imp->increment(&ec);
+ if (m_imp->m_stack.empty())
+ m_imp.reset(); // done, so make end iterator
+ return *this;
+ }
+
+ int level() const
+ {
+ BOOST_ASSERT_MSG(m_imp.get(),
+ "level() on end recursive_directory_iterator");
+ return m_imp->m_level;
+ }
+
+ bool no_push_pending() const
+ {
+ BOOST_ASSERT_MSG(m_imp.get(),
+ "is_no_push_requested() on end recursive_directory_iterator");
+ return (m_imp->m_options & symlink_option::_detail_no_push)
+ == symlink_option::_detail_no_push;
+ }
+
+# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
+ bool no_push_request() const { return no_push_pending(); }
+# endif
+
+ void pop()
+ {
+ BOOST_ASSERT_MSG(m_imp.get(),
+ "pop() on end recursive_directory_iterator");
+ m_imp->pop();
+ if (m_imp->m_stack.empty()) m_imp.reset(); // done, so make end iterator
+ }
+
+ void no_push(bool value=true)
+ {
+ BOOST_ASSERT_MSG(m_imp.get(),
+ "no_push() on end recursive_directory_iterator");
+ if (value)
+ m_imp->m_options |= symlink_option::_detail_no_push;
+ else
+ m_imp->m_options &= ~symlink_option::_detail_no_push;
+ }
+
+ file_status status() const
+ {
+ BOOST_ASSERT_MSG(m_imp.get(),
+ "status() on end recursive_directory_iterator");
+ return m_imp->m_stack.top()->status();
+ }
+
+ file_status symlink_status() const
+ {
+ BOOST_ASSERT_MSG(m_imp.get(),
+ "symlink_status() on end recursive_directory_iterator");
+ return m_imp->m_stack.top()->symlink_status();
+ }
+
+ private:
+
+ // shared_ptr provides shallow-copy semantics required for InputIterators.
+ // m_imp.get()==0 indicates the end iterator.
+ boost::shared_ptr< detail::recur_dir_itr_imp > m_imp;
+
+ friend class boost::iterator_core_access;
+
+ boost::iterator_facade<
+ recursive_directory_iterator,
+ directory_entry,
+ boost::single_pass_traversal_tag >::reference
+ dereference() const
+ {
+ BOOST_ASSERT_MSG(m_imp.get(),
+ "dereference of end recursive_directory_iterator");
+ return *m_imp->m_stack.top();
+ }
+
+ void increment()
+ {
+ BOOST_ASSERT_MSG(m_imp.get(),
+ "increment of end recursive_directory_iterator");
+ m_imp->increment(0);
+ if (m_imp->m_stack.empty())
+ m_imp.reset(); // done, so make end iterator
+ }
+
+ bool equal(const recursive_directory_iterator& rhs) const
+ { return m_imp == rhs.m_imp; }
+
+ };
+
+# if !defined(BOOST_FILESYSTEM_NO_DEPRECATED)
+ typedef recursive_directory_iterator wrecursive_directory_iterator;
# endif
-#endif // BOOST_FILESYSTEM_OPERATIONSX_HPP
+//--------------------------------------------------------------------------------------//
+// //
+// class filesystem_error //
+// //
+//--------------------------------------------------------------------------------------//
+
+ class BOOST_SYMBOL_VISIBLE filesystem_error : public system::system_error
+ {
+ // see http://www.boost.org/more/error_handling.html for design rationale
+
+ // all functions are inline to avoid issues with crossing dll boundaries
+
+ public:
+ // compiler generates copy constructor and copy assignment
+
+ filesystem_error(
+ const std::string & what_arg, system::error_code ec)
+ : system::system_error(ec, what_arg)
+ {
+ try
+ {
+ m_imp_ptr.reset(new m_imp);
+ }
+ catch (...) { m_imp_ptr.reset(); }
+ }
+
+ filesystem_error(
+ const std::string & what_arg, const path& path1_arg,
+ system::error_code ec)
+ : system::system_error(ec, what_arg)
+ {
+ try
+ {
+ m_imp_ptr.reset(new m_imp);
+ m_imp_ptr->m_path1 = path1_arg;
+ }
+ catch (...) { m_imp_ptr.reset(); }
+ }
+
+ filesystem_error(
+ const std::string & what_arg, const path& path1_arg,
+ const path& path2_arg, system::error_code ec)
+ : system::system_error(ec, what_arg)
+ {
+ try
+ {
+ m_imp_ptr.reset(new m_imp);
+ m_imp_ptr->m_path1 = path1_arg;
+ m_imp_ptr->m_path2 = path2_arg;
+ }
+ catch (...) { m_imp_ptr.reset(); }
+ }
+
+ ~filesystem_error() throw() {}
+
+ const path& path1() const
+ {
+ static const path empty_path;
+ return m_imp_ptr.get() ? m_imp_ptr->m_path1 : empty_path ;
+ }
+ const path& path2() const
+ {
+ static const path empty_path;
+ return m_imp_ptr.get() ? m_imp_ptr->m_path2 : empty_path ;
+ }
+
+ const char* what() const throw()
+ {
+ if (!m_imp_ptr.get())
+ return system::system_error::what();
+
+ try
+ {
+ if (m_imp_ptr->m_what.empty())
+ {
+ m_imp_ptr->m_what = system::system_error::what();
+ if (!m_imp_ptr->m_path1.empty())
+ {
+ m_imp_ptr->m_what += ": \"";
+ m_imp_ptr->m_what += m_imp_ptr->m_path1.string();
+ m_imp_ptr->m_what += "\"";
+ }
+ if (!m_imp_ptr->m_path2.empty())
+ {
+ m_imp_ptr->m_what += ", \"";
+ m_imp_ptr->m_what += m_imp_ptr->m_path2.string();
+ m_imp_ptr->m_what += "\"";
+ }
+ }
+ return m_imp_ptr->m_what.c_str();
+ }
+ catch (...)
+ {
+ return system::system_error::what();
+ }
+ }
+
+ private:
+ struct m_imp
+ {
+ path m_path1; // may be empty()
+ path m_path2; // may be empty()
+ std::string m_what; // not built until needed
+ };
+ boost::shared_ptr<m_imp> m_imp_ptr;
+ };
+
+// test helper -----------------------------------------------------------------------//
+
+// Not part of the documented interface since false positives are possible;
+// there is no law that says that an OS that has large stat.st_size
+// actually supports large file sizes.
+
+ namespace detail
+ {
+ BOOST_FILESYSTEM_DECL bool possible_large_file_size_support();
+ }
+
+ } // namespace filesystem
+} // namespace boost
+
+#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
+#endif // BOOST_FILESYSTEM3_OPERATIONS_HPP
diff --git a/boost/filesystem/path.hpp b/boost/filesystem/path.hpp
index 3bed7d2c84..2dd1b00ea5 100644
--- a/boost/filesystem/path.hpp
+++ b/boost/filesystem/path.hpp
@@ -1,35 +1,758 @@
-// boost/filesystem/path.hpp ---------------------------------------------------------//
+// filesystem path.hpp ---------------------------------------------------------------//
-// Copyright Beman Dawes 2010
+// Copyright Beman Dawes 2002-2005, 2009
+// Copyright Vladimir Prus 2002
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
// Library home page: http://www.boost.org/libs/filesystem
-//--------------------------------------------------------------------------------------//
+// path::stem(), extension(), and replace_extension() are based on
+// basename(), extension(), and change_extension() from the original
+// filesystem/convenience.hpp header by Vladimir Prus.
-#ifndef BOOST_FILESYSTEM_PATHX_HPP
-#define BOOST_FILESYSTEM_PATHX_HPP
+#ifndef BOOST_FILESYSTEM_PATH_HPP
+#define BOOST_FILESYSTEM_PATH_HPP
-#include <boost/config.hpp> // for <boost/config/user.hpp>, in case
- // BOOST_FILESYSTEM_VERSION defined there
+#include <boost/config.hpp>
-# if defined(BOOST_FILESYSTEM_VERSION) \
- && BOOST_FILESYSTEM_VERSION != 2 && BOOST_FILESYSTEM_VERSION != 3
-# error BOOST_FILESYSTEM_VERSION defined, but not as 2 or 3
+# if defined( BOOST_NO_STD_WSTRING )
+# error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
# endif
-# if !defined(BOOST_FILESYSTEM_VERSION)
-# define BOOST_FILESYSTEM_VERSION 3
+#include <boost/filesystem/config.hpp>
+#include <boost/filesystem/path_traits.hpp> // includes <cwchar>
+#include <boost/system/error_code.hpp>
+#include <boost/system/system_error.hpp>
+#include <boost/iterator/iterator_facade.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/io/detail/quoted_manip.hpp>
+#include <boost/static_assert.hpp>
+#include <boost/functional/hash_fwd.hpp>
+#include <boost/type_traits/is_integral.hpp>
+#include <string>
+#include <iterator>
+#include <cstring>
+#include <iosfwd>
+#include <stdexcept>
+#include <cassert>
+#include <locale>
+#include <algorithm>
+
+#include <boost/config/abi_prefix.hpp> // must be the last #include
+
+namespace boost
+{
+namespace filesystem
+{
+ //------------------------------------------------------------------------------------//
+ // //
+ // class path //
+ // //
+ //------------------------------------------------------------------------------------//
+
+ class BOOST_FILESYSTEM_DECL path
+ {
+ public:
+
+ // value_type is the character type used by the operating system API to
+ // represent paths.
+
+# ifdef BOOST_WINDOWS_API
+ typedef wchar_t value_type;
+ BOOST_STATIC_CONSTEXPR value_type preferred_separator = L'\\';
+# else
+ typedef char value_type;
+ BOOST_STATIC_CONSTEXPR value_type preferred_separator = '/';
# endif
+ typedef std::basic_string<value_type> string_type;
+ typedef std::codecvt<wchar_t, char,
+ std::mbstate_t> codecvt_type;
+
+
+ // ----- character encoding conversions -----
+
+ // Following the principle of least astonishment, path input arguments
+ // passed to or obtained from the operating system via objects of
+ // class path behave as if they were directly passed to or
+ // obtained from the O/S API, unless conversion is explicitly requested.
+ //
+ // POSIX specfies that path strings are passed unchanged to and from the
+ // API. Note that this is different from the POSIX command line utilities,
+ // which convert according to a locale.
+ //
+ // Thus for POSIX, char strings do not undergo conversion. wchar_t strings
+ // are converted to/from char using the path locale or, if a conversion
+ // argument is given, using a conversion object modeled on
+ // std::wstring_convert.
+ //
+ // The path locale, which is global to the thread, can be changed by the
+ // imbue() function. It is initialized to an implementation defined locale.
+ //
+ // For Windows, wchar_t strings do not undergo conversion. char strings
+ // are converted using the "ANSI" or "OEM" code pages, as determined by
+ // the AreFileApisANSI() function, or, if a conversion argument is given,
+ // using a conversion object modeled on std::wstring_convert.
+ //
+ // See m_pathname comments for further important rationale.
+
+ // TODO: rules needed for operating systems that use / or .
+ // differently, or format directory paths differently from file paths.
+ //
+ // **********************************************************************************
+ //
+ // More work needed: How to handle an operating system that may have
+ // slash characters or dot characters in valid filenames, either because
+ // it doesn't follow the POSIX standard, or because it allows MBCS
+ // filename encodings that may contain slash or dot characters. For
+ // example, ISO/IEC 2022 (JIS) encoding which allows switching to
+ // JIS x0208-1983 encoding. A valid filename in this set of encodings is
+ // 0x1B 0x24 0x42 [switch to X0208-1983] 0x24 0x2F [U+304F Kiragana letter KU]
+ // ^^^^
+ // Note that 0x2F is the ASCII slash character
+ //
+ // **********************************************************************************
+
+ // Supported source arguments: half-open iterator range, container, c-array,
+ // and single pointer to null terminated string.
+
+ // All source arguments except pointers to null terminated byte strings support
+ // multi-byte character strings which may have embedded nulls. Embedded null
+ // support is required for some Asian languages on Windows.
+
+ // [defaults] "const codecvt_type& cvt=codecvt()" default arguments are not used
+ // because some compilers, such as Microsoft prior to VC++ 10, do not handle defaults
+ // correctly in templates.
+
+ // ----- constructors -----
+
+ path(){}
+
+ path(const path& p) : m_pathname(p.m_pathname) {}
+
+ template <class Source>
+ path(Source const& source,
+ typename boost::enable_if<path_traits::is_pathable<
+ typename boost::decay<Source>::type> >::type* =0)
+ {
+ path_traits::dispatch(source, m_pathname, codecvt());
+ }
+
+ // Overloads for the operating system API's native character type. Rationale:
+ // - Avoids use of codecvt() for native value_type strings. This limits the
+ // impact of locale("") initialization failures on POSIX systems to programs
+ // that actually depend on locale(""). It further ensures that exceptions thrown
+ // as a result of such failues occur after main() has started, so can be caught.
+ // This is a partial resolution of tickets 4688, 5100, and 5289.
+ // - A slight optimization for a common use case, particularly on POSIX since
+ // value_type is char and that is the most common useage.
+ path(const value_type* s) : m_pathname(s) {}
+ path(const std::basic_string<value_type>& s) : m_pathname(s) {}
+
+ template <class Source>
+ path(Source const& source, const codecvt_type& cvt)
+ // see [defaults] note above explaining why codecvt() default arguments are not used
+ {
+ path_traits::dispatch(source, m_pathname, cvt);
+ }
+
+ template <class InputIterator>
+ path(InputIterator begin, InputIterator end)
+ {
+ if (begin != end)
+ {
+ std::basic_string<typename std::iterator_traits<InputIterator>::value_type>
+ s(begin, end);
+ path_traits::convert(s.c_str(), s.c_str()+s.size(), m_pathname, codecvt());
+ }
+ }
+
+ template <class InputIterator>
+ path(InputIterator begin, InputIterator end, const codecvt_type& cvt)
+ {
+ if (begin != end)
+ {
+ std::basic_string<typename std::iterator_traits<InputIterator>::value_type>
+ s(begin, end);
+ path_traits::convert(s.c_str(), s.c_str()+s.size(), m_pathname, cvt);
+ }
+ }
+
+ // ----- assignments -----
+
+ path& operator=(const path& p)
+ {
+ m_pathname = p.m_pathname;
+ return *this;
+ }
+
+ path& operator=(const value_type* ptr) // required in case ptr overlaps *this
+ {
+ m_pathname = ptr;
+ return *this;
+ }
+
+ template <class Source>
+ typename boost::enable_if<path_traits::is_pathable<
+ typename boost::decay<Source>::type>, path&>::type
+ operator=(Source const& source)
+ {
+ m_pathname.clear();
+ path_traits::dispatch(source, m_pathname, codecvt());
+ return *this;
+ }
+
+ path& assign(const value_type* ptr, const codecvt_type&) // required in case ptr overlaps *this
+ {
+ m_pathname = ptr;
+ return *this;
+ }
+
+ template <class Source>
+ path& assign(Source const& source, const codecvt_type& cvt)
+ {
+ m_pathname.clear();
+ path_traits::dispatch(source, m_pathname, cvt);
+ return *this;
+ }
+
+ template <class InputIterator>
+ path& assign(InputIterator begin, InputIterator end)
+ {
+ return assign(begin, end, codecvt());
+ }
+
+ template <class InputIterator>
+ path& assign(InputIterator begin, InputIterator end, const codecvt_type& cvt)
+ {
+ m_pathname.clear();
+ if (begin != end)
+ {
+ std::basic_string<typename std::iterator_traits<InputIterator>::value_type>
+ s(begin, end);
+ path_traits::convert(s.c_str(), s.c_str()+s.size(), m_pathname, cvt);
+ }
+ return *this;
+ }
+
+ // ----- concatenation -----
+
+ path& operator+=(const path& p) {m_pathname += p.m_pathname; return *this;}
+ path& operator+=(const string_type& s) {m_pathname += s; return *this;}
+ path& operator+=(const value_type* ptr) {m_pathname += ptr; return *this;}
+ path& operator+=(value_type c) {m_pathname += c; return *this;}
+
+ template <class Source>
+ typename boost::enable_if<path_traits::is_pathable<
+ typename boost::decay<Source>::type>, path&>::type
+ operator+=(Source const& source)
+ {
+ return concat(source, codecvt());
+ }
+
+ template <class CharT>
+ typename boost::enable_if<is_integral<CharT>, path&>::type
+ operator+=(CharT c)
+ {
+ CharT tmp[2];
+ tmp[0] = c;
+ tmp[1] = 0;
+ return concat(tmp, codecvt());
+ }
+
+ template <class Source>
+ path& concat(Source const& source, const codecvt_type& cvt)
+ {
+ path_traits::dispatch(source, m_pathname, cvt);
+ return *this;
+ }
+
+ template <class InputIterator>
+ path& concat(InputIterator begin, InputIterator end)
+ {
+ return concat(begin, end, codecvt());
+ }
+
+ template <class InputIterator>
+ path& concat(InputIterator begin, InputIterator end, const codecvt_type& cvt)
+ {
+ if (begin == end)
+ return *this;
+ std::basic_string<typename std::iterator_traits<InputIterator>::value_type>
+ s(begin, end);
+ path_traits::convert(s.c_str(), s.c_str()+s.size(), m_pathname, cvt);
+ return *this;
+ }
+
+ // ----- appends -----
+
+ // if a separator is added, it is the preferred separator for the platform;
+ // slash for POSIX, backslash for Windows
+
+ path& operator/=(const path& p);
+
+ path& operator/=(const value_type* ptr);
+
+ template <class Source>
+ typename boost::enable_if<path_traits::is_pathable<
+ typename boost::decay<Source>::type>, path&>::type
+ operator/=(Source const& source)
+ {
+ return append(source, codecvt());
+ }
+
+ path& append(const value_type* ptr, const codecvt_type&) // required in case ptr overlaps *this
+ {
+ this->operator/=(ptr);
+ return *this;
+ }
+
+ template <class Source>
+ path& append(Source const& source, const codecvt_type& cvt);
+
+ template <class InputIterator>
+ path& append(InputIterator begin, InputIterator end)
+ {
+ return append(begin, end, codecvt());
+ }
+
+ template <class InputIterator>
+ path& append(InputIterator begin, InputIterator end, const codecvt_type& cvt);
+
+ // ----- modifiers -----
+
+ void clear() { m_pathname.clear(); }
+ path& make_preferred()
+# ifdef BOOST_POSIX_API
+ { return *this; } // POSIX no effect
+# else // BOOST_WINDOWS_API
+ ; // change slashes to backslashes
+# endif
+ path& remove_filename();
+ path& replace_extension(const path& new_extension = path());
+ void swap(path& rhs) { m_pathname.swap(rhs.m_pathname); }
+
+ // ----- observers -----
+
+ // For operating systems that format file paths differently than directory
+ // paths, return values from observers are formatted as file names unless there
+ // is a trailing separator, in which case returns are formatted as directory
+ // paths. POSIX and Windows make no such distinction.
+
+ // Implementations are permitted to return const values or const references.
+
+ // The string or path returned by an observer are specified as being formatted
+ // as "native" or "generic".
+ //
+ // For POSIX, these are all the same format; slashes and backslashes are as input and
+ // are not modified.
+ //
+ // For Windows, native: as input; slashes and backslashes are not modified;
+ // this is the format of the internally stored string.
+ // generic: backslashes are converted to slashes
+
+ // ----- native format observers -----
+
+ const string_type& native() const { return m_pathname; } // Throws: nothing
+ const value_type* c_str() const { return m_pathname.c_str(); } // Throws: nothing
+
+ template <class String>
+ String string() const;
+
+ template <class String>
+ String string(const codecvt_type& cvt) const;
+
+# ifdef BOOST_WINDOWS_API
+ const std::string string() const { return string(codecvt()); }
+ const std::string string(const codecvt_type& cvt) const
+ {
+ std::string tmp;
+ if (!m_pathname.empty())
+ path_traits::convert(&*m_pathname.begin(), &*m_pathname.begin()+m_pathname.size(),
+ tmp, cvt);
+ return tmp;
+ }
+
+ // string_type is std::wstring, so there is no conversion
+ const std::wstring& wstring() const { return m_pathname; }
+ const std::wstring& wstring(const codecvt_type&) const { return m_pathname; }
+
+# else // BOOST_POSIX_API
+ // string_type is std::string, so there is no conversion
+ const std::string& string() const { return m_pathname; }
+ const std::string& string(const codecvt_type&) const { return m_pathname; }
+
+ const std::wstring wstring() const { return wstring(codecvt()); }
+ const std::wstring wstring(const codecvt_type& cvt) const
+ {
+ std::wstring tmp;
+ if (!m_pathname.empty())
+ path_traits::convert(&*m_pathname.begin(), &*m_pathname.begin()+m_pathname.size(),
+ tmp, cvt);
+ return tmp;
+ }
+
+# endif
+
+ // ----- generic format observers -----
+
+ template <class String>
+ String generic_string() const;
+
+ template <class String>
+ String generic_string(const codecvt_type& cvt) const;
+
+# ifdef BOOST_WINDOWS_API
+ const std::string generic_string() const { return generic_string(codecvt()); }
+ const std::string generic_string(const codecvt_type& cvt) const;
+ const std::wstring generic_wstring() const;
+ const std::wstring generic_wstring(const codecvt_type&) const { return generic_wstring(); };
-#if BOOST_FILESYSTEM_VERSION == 2
-# include <boost/filesystem/v2/path.hpp>
+# else // BOOST_POSIX_API
+ // On POSIX-like systems, the generic format is the same as the native format
+ const std::string& generic_string() const { return m_pathname; }
+ const std::string& generic_string(const codecvt_type&) const { return m_pathname; }
+ const std::wstring generic_wstring() const { return wstring(codecvt()); }
+ const std::wstring generic_wstring(const codecvt_type& cvt) const { return wstring(cvt); }
-# else
-# include <boost/filesystem/v3/path.hpp>
+# endif
+ // ----- compare -----
+
+ int compare(const path& p) const BOOST_NOEXCEPT; // generic, lexicographical
+ int compare(const std::string& s) const { return compare(path(s)); }
+ int compare(const value_type* s) const { return compare(path(s)); }
+
+ // ----- decomposition -----
+
+ path root_path() const;
+ path root_name() const; // returns 0 or 1 element path
+ // even on POSIX, root_name() is non-empty() for network paths
+ path root_directory() const; // returns 0 or 1 element path
+ path relative_path() const;
+ path parent_path() const;
+ path filename() const; // returns 0 or 1 element path
+ path stem() const; // returns 0 or 1 element path
+ path extension() const; // returns 0 or 1 element path
+
+ // ----- query -----
+
+ bool empty() const { return m_pathname.empty(); } // name consistent with std containers
+ bool has_root_path() const { return has_root_directory() || has_root_name(); }
+ bool has_root_name() const { return !root_name().empty(); }
+ bool has_root_directory() const { return !root_directory().empty(); }
+ bool has_relative_path() const { return !relative_path().empty(); }
+ bool has_parent_path() const { return !parent_path().empty(); }
+ bool has_filename() const { return !m_pathname.empty(); }
+ bool has_stem() const { return !stem().empty(); }
+ bool has_extension() const { return !extension().empty(); }
+ bool is_absolute() const
+ {
+# ifdef BOOST_WINDOWS_API
+ return has_root_name() && has_root_directory();
+# else
+ return has_root_directory();
+# endif
+ }
+ bool is_relative() const { return !is_absolute(); }
+
+ // ----- iterators -----
+
+ class iterator;
+ typedef iterator const_iterator;
+
+ iterator begin() const;
+ iterator end() const;
+
+ // ----- static member functions -----
+
+ static std::locale imbue(const std::locale& loc);
+ static const codecvt_type& codecvt();
+
+ // ----- deprecated functions -----
+
+# if defined(BOOST_FILESYSTEM_DEPRECATED) && defined(BOOST_FILESYSTEM_NO_DEPRECATED)
+# error both BOOST_FILESYSTEM_DEPRECATED and BOOST_FILESYSTEM_NO_DEPRECATED are defined
+# endif
+
+# if !defined(BOOST_FILESYSTEM_NO_DEPRECATED)
+ // recently deprecated functions supplied by default
+ path& normalize() { return m_normalize(); }
+ path& remove_leaf() { return remove_filename(); }
+ path leaf() const { return filename(); }
+ path branch_path() const { return parent_path(); }
+ bool has_leaf() const { return !m_pathname.empty(); }
+ bool has_branch_path() const { return !parent_path().empty(); }
+ bool is_complete() const { return is_absolute(); }
+# endif
+
+# if defined(BOOST_FILESYSTEM_DEPRECATED)
+ // deprecated functions with enough signature or semantic changes that they are
+ // not supplied by default
+ const std::string file_string() const { return string(); }
+ const std::string directory_string() const { return string(); }
+ const std::string native_file_string() const { return string(); }
+ const std::string native_directory_string() const { return string(); }
+ const string_type external_file_string() const { return native(); }
+ const string_type external_directory_string() const { return native(); }
+
+ // older functions no longer supported
+ //typedef bool (*name_check)(const std::string & name);
+ //basic_path(const string_type& str, name_check) { operator/=(str); }
+ //basic_path(const typename string_type::value_type* s, name_check)
+ // { operator/=(s);}
+ //static bool default_name_check_writable() { return false; }
+ //static void default_name_check(name_check) {}
+ //static name_check default_name_check() { return 0; }
+ //basic_path& canonize();
+# endif
+
+//--------------------------------------------------------------------------------------//
+// class path private members //
+//--------------------------------------------------------------------------------------//
+
+ private:
+# if defined(_MSC_VER)
+# pragma warning(push) // Save warning settings
+# pragma warning(disable : 4251) // disable warning: class 'std::basic_string<_Elem,_Traits,_Ax>'
+# endif // needs to have dll-interface...
+/*
+ m_pathname has the type, encoding, and format required by the native
+ operating system. Thus for POSIX and Windows there is no conversion for
+ passing m_pathname.c_str() to the O/S API or when obtaining a path from the
+ O/S API. POSIX encoding is unspecified other than for dot and slash
+ characters; POSIX just treats paths as a sequence of bytes. Windows
+ encoding is UCS-2 or UTF-16 depending on the version.
+*/
+ string_type m_pathname; // Windows: as input; backslashes NOT converted to slashes,
+ // slashes NOT converted to backslashes
+# if defined(_MSC_VER)
+# pragma warning(pop) // restore warning settings.
+# endif
+
+ string_type::size_type m_append_separator_if_needed();
+ // Returns: If separator is to be appended, m_pathname.size() before append. Otherwise 0.
+ // Note: An append is never performed if size()==0, so a returned 0 is unambiguous.
+
+ void m_erase_redundant_separator(string_type::size_type sep_pos);
+ string_type::size_type m_parent_path_end() const;
+
+ path& m_normalize();
+
+ // Was qualified; como433beta8 reports:
+ // warning #427-D: qualified name is not allowed in member declaration
+ friend class iterator;
+ friend bool operator<(const path& lhs, const path& rhs);
+
+ // see path::iterator::increment/decrement comment below
+ static void m_path_iterator_increment(path::iterator & it);
+ static void m_path_iterator_decrement(path::iterator & it);
+
+ }; // class path
+
+ namespace detail
+ {
+ BOOST_FILESYSTEM_DECL
+ int lex_compare(path::iterator first1, path::iterator last1,
+ path::iterator first2, path::iterator last2);
+ }
+
+# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
+ typedef path wpath;
+# endif
+
+ //------------------------------------------------------------------------------------//
+ // class path::iterator //
+ //------------------------------------------------------------------------------------//
+
+ class path::iterator
+ : public boost::iterator_facade<
+ path::iterator,
+ path const,
+ boost::bidirectional_traversal_tag >
+ {
+ private:
+ friend class boost::iterator_core_access;
+ friend class boost::filesystem::path;
+ friend void m_path_iterator_increment(path::iterator & it);
+ friend void m_path_iterator_decrement(path::iterator & it);
+
+ const path& dereference() const { return m_element; }
+
+ bool equal(const iterator & rhs) const
+ {
+ return m_path_ptr == rhs.m_path_ptr && m_pos == rhs.m_pos;
+ }
+
+ // iterator_facade derived classes don't seem to like implementations in
+ // separate translation unit dll's, so forward to class path static members
+ void increment() { m_path_iterator_increment(*this); }
+ void decrement() { m_path_iterator_decrement(*this); }
+
+ path m_element; // current element
+ const path* m_path_ptr; // path being iterated over
+ string_type::size_type m_pos; // position of m_element in
+ // m_path_ptr->m_pathname.
+ // if m_element is implicit dot, m_pos is the
+ // position of the last separator in the path.
+ // end() iterator is indicated by
+ // m_pos == m_path_ptr->m_pathname.size()
+ }; // path::iterator
+
+ //------------------------------------------------------------------------------------//
+ // //
+ // non-member functions //
+ // //
+ //------------------------------------------------------------------------------------//
+
+ // std::lexicographical_compare would infinately recurse because path iterators
+ // yield paths, so provide a path aware version
+ inline bool lexicographical_compare(path::iterator first1, path::iterator last1,
+ path::iterator first2, path::iterator last2)
+ { return detail::lex_compare(first1, last1, first2, last2) < 0; }
+
+ inline bool operator==(const path& lhs, const path& rhs) {return lhs.compare(rhs) == 0;}
+ inline bool operator==(const path& lhs, const path::string_type& rhs) {return lhs.compare(rhs) == 0;}
+ inline bool operator==(const path::string_type& lhs, const path& rhs) {return rhs.compare(lhs) == 0;}
+ inline bool operator==(const path& lhs, const path::value_type* rhs) {return lhs.compare(rhs) == 0;}
+ inline bool operator==(const path::value_type* lhs, const path& rhs) {return rhs.compare(lhs) == 0;}
+
+ inline bool operator!=(const path& lhs, const path& rhs) {return lhs.compare(rhs) != 0;}
+ inline bool operator!=(const path& lhs, const path::string_type& rhs) {return lhs.compare(rhs) != 0;}
+ inline bool operator!=(const path::string_type& lhs, const path& rhs) {return rhs.compare(lhs) != 0;}
+ inline bool operator!=(const path& lhs, const path::value_type* rhs) {return lhs.compare(rhs) != 0;}
+ inline bool operator!=(const path::value_type* lhs, const path& rhs) {return rhs.compare(lhs) != 0;}
+
+ // TODO: why do == and != have additional overloads, but the others don't?
+
+ inline bool operator<(const path& lhs, const path& rhs) {return lhs.compare(rhs) < 0;}
+ inline bool operator<=(const path& lhs, const path& rhs) {return !(rhs < lhs);}
+ inline bool operator> (const path& lhs, const path& rhs) {return rhs < lhs;}
+ inline bool operator>=(const path& lhs, const path& rhs) {return !(lhs < rhs);}
+
+ inline std::size_t hash_value(const path& x)
+ {
+# ifdef BOOST_WINDOWS_API
+ std::size_t seed = 0;
+ for(const path::value_type* it = x.c_str(); *it; ++it)
+ hash_combine(seed, *it == '/' ? L'\\' : *it);
+ return seed;
+# else // BOOST_POSIX_API
+ return hash_range(x.native().begin(), x.native().end());
# endif
+ }
+
+ inline void swap(path& lhs, path& rhs) { lhs.swap(rhs); }
+
+ inline path operator/(const path& lhs, const path& rhs) { return path(lhs) /= rhs; }
+
+ // inserters and extractors
+ // use boost::io::quoted() to handle spaces in paths
+ // use '&' as escape character to ease use for Windows paths
+
+ template <class Char, class Traits>
+ inline std::basic_ostream<Char, Traits>&
+ operator<<(std::basic_ostream<Char, Traits>& os, const path& p)
+ {
+ return os
+ << boost::io::quoted(p.template string<std::basic_string<Char> >(), static_cast<Char>('&'));
+ }
+
+ template <class Char, class Traits>
+ inline std::basic_istream<Char, Traits>&
+ operator>>(std::basic_istream<Char, Traits>& is, path& p)
+ {
+ std::basic_string<Char> str;
+ is >> boost::io::quoted(str, static_cast<Char>('&'));
+ p = str;
+ return is;
+ }
+
+ // name_checks
+
+ // These functions are holdovers from version 1. It isn't clear they have much
+ // usefulness, or how to generalize them for later versions.
+
+ BOOST_FILESYSTEM_DECL bool portable_posix_name(const std::string & name);
+ BOOST_FILESYSTEM_DECL bool windows_name(const std::string & name);
+ BOOST_FILESYSTEM_DECL bool portable_name(const std::string & name);
+ BOOST_FILESYSTEM_DECL bool portable_directory_name(const std::string & name);
+ BOOST_FILESYSTEM_DECL bool portable_file_name(const std::string & name);
+ BOOST_FILESYSTEM_DECL bool native(const std::string & name);
+
+//--------------------------------------------------------------------------------------//
+// class path member template implementation //
+//--------------------------------------------------------------------------------------//
+
+ template <class InputIterator>
+ path& path::append(InputIterator begin, InputIterator end, const codecvt_type& cvt)
+ {
+ if (begin == end)
+ return *this;
+ string_type::size_type sep_pos(m_append_separator_if_needed());
+ std::basic_string<typename std::iterator_traits<InputIterator>::value_type>
+ s(begin, end);
+ path_traits::convert(s.c_str(), s.c_str()+s.size(), m_pathname, cvt);
+ if (sep_pos)
+ m_erase_redundant_separator(sep_pos);
+ return *this;
+ }
+
+ template <class Source>
+ path& path::append(Source const& source, const codecvt_type& cvt)
+ {
+ if (path_traits::empty(source))
+ return *this;
+ string_type::size_type sep_pos(m_append_separator_if_needed());
+ path_traits::dispatch(source, m_pathname, cvt);
+ if (sep_pos)
+ m_erase_redundant_separator(sep_pos);
+ return *this;
+ }
+
+//--------------------------------------------------------------------------------------//
+// class path member template specializations //
+//--------------------------------------------------------------------------------------//
+
+ template <> inline
+ std::string path::string<std::string>() const
+ { return string(); }
+
+ template <> inline
+ std::wstring path::string<std::wstring>() const
+ { return wstring(); }
+
+ template <> inline
+ std::string path::string<std::string>(const codecvt_type& cvt) const
+ { return string(cvt); }
+
+ template <> inline
+ std::wstring path::string<std::wstring>(const codecvt_type& cvt) const
+ { return wstring(cvt); }
+
+ template <> inline
+ std::string path::generic_string<std::string>() const
+ { return generic_string(); }
+
+ template <> inline
+ std::wstring path::generic_string<std::wstring>() const
+ { return generic_wstring(); }
+
+ template <> inline
+ std::string path::generic_string<std::string>(const codecvt_type& cvt) const
+ { return generic_string(cvt); }
+
+ template <> inline
+ std::wstring path::generic_string<std::wstring>(const codecvt_type& cvt) const
+ { return generic_wstring(cvt); }
+
+
+} // namespace filesystem
+} // namespace boost
+
+//----------------------------------------------------------------------------//
+
+#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
-#endif // BOOST_FILESYSTEM_PATHX_HPP
+#endif // BOOST_FILESYSTEM_PATH_HPP
diff --git a/boost/filesystem/v3/path_traits.hpp b/boost/filesystem/path_traits.hpp
index 13f1b20950..a6a2505574 100644
--- a/boost/filesystem/v3/path_traits.hpp
+++ b/boost/filesystem/path_traits.hpp
@@ -16,7 +16,7 @@
# error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
# endif
-#include <boost/filesystem/v3/config.hpp>
+#include <boost/filesystem/config.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/is_array.hpp>
#include <boost/type_traits/decay.hpp>
@@ -32,7 +32,7 @@
#include <boost/config/abi_prefix.hpp> // must be the last #include
-namespace boost { namespace filesystem3 {
+namespace boost { namespace filesystem {
BOOST_FILESYSTEM_DECL const system::error_category& codecvt_error_category();
// uses std::codecvt_base::result used for error codes:
@@ -85,8 +85,8 @@ namespace path_traits {
}
template <typename T, size_t N> inline
- bool empty(T (&)[N])
- { return N <= 1; }
+ bool empty(T (&x)[N])
+ { return !x[0]; }
// value types differ ---------------------------------------------------------------//
//
@@ -230,18 +230,6 @@ namespace path_traits {
}}} // namespace boost::filesystem::path_traits
-//----------------------------------------------------------------------------//
-
-namespace boost
-{
- namespace filesystem
- {
- using filesystem3::codecvt_error_category;
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
-# endif
- }
-}
-
#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
#endif // BOOST_FILESYSTEM_PATH_TRAITS_HPP
diff --git a/boost/filesystem/v2/config.hpp b/boost/filesystem/v2/config.hpp
deleted file mode 100644
index 7116de5c5e..0000000000
--- a/boost/filesystem/v2/config.hpp
+++ /dev/null
@@ -1,106 +0,0 @@
-// boost/filesystem/v2/config.hpp ------------------------------------------//
-
-// Copyright Beman Dawes 2003
-
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-// See library home page at http://www.boost.org/libs/filesystem
-
-//----------------------------------------------------------------------------//
-
-#ifndef BOOST_FILESYSTEM2_CONFIG_HPP
-#define BOOST_FILESYSTEM2_CONFIG_HPP
-
-# if defined(BOOST_FILESYSTEM_VERSION) && BOOST_FILESYSTEM_VERSION != 2
-# error Compiling Filesystem version 2 file with BOOST_FILESYSTEM_VERSION defined != 2
-# endif
-
-# if !defined(BOOST_FILESYSTEM_VERSION)
-# define BOOST_FILESYSTEM_VERSION 2
-# endif
-
-#define BOOST_FILESYSTEM_I18N // aid users wishing to compile several versions
-
-// ability to change namespace aids path_table.cpp ------------------------//
-#ifndef BOOST_FILESYSTEM2_NAMESPACE
-# define BOOST_FILESYSTEM2_NAMESPACE filesystem2
-#endif
-
-#include <boost/config.hpp>
-#include <boost/system/api_config.hpp> // for BOOST_POSIX_API or BOOST_WINDOWS_API
-#include <boost/detail/workaround.hpp>
-
-// BOOST_POSIX_PATH or BOOST_WINDOWS_PATH specify which path syntax to recognise
-
-# if defined(BOOST_WINDOWS_API) && defined(BOOST_POSIX_PATH)
-# error builds with Windows API do not support BOOST_POSIX_PATH
-# endif
-
-# if !defined(_WIN32) && !defined(__CYGWIN__) && defined(BOOST_WINDOWS_PATH)
-# error builds on non-Windows platforms do not support BOOST_WINDOWS_PATH
-# endif
-
-# if defined(BOOST_WINDOWS_PATH) && defined(BOOST_POSIX_PATH)
-# error both BOOST_WINDOWS_PATH and BOOST_POSIX_PATH are defined
-# elif !defined(BOOST_WINDOWS_PATH) && !defined(BOOST_POSIX_PATH)
-# if !defined(BOOST_POSIX_PATH) && (defined(_WIN32) || defined(__CYGWIN__))
-# define BOOST_WINDOWS_PATH
-# else
-# define BOOST_POSIX_PATH
-# endif
-# endif
-
-// throw an exception ----------------------------------------------------------------//
-//
-// Exceptions were originally thrown via boost::throw_exception().
-// As throw_exception() became more complex, it caused user error reporting
-// to be harder to interpret, since the exception reported became much more complex.
-// The immediate fix was to throw directly, wrapped in a macro to make any later change
-// easier.
-
-#define BOOST_FILESYSTEM_THROW(EX) throw EX
-
-// narrow support only for badly broken compilers or libraries -------------//
-
-# if defined(BOOST_NO_STD_WSTRING) || defined(BOOST_NO_SFINAE) || defined(BOOST_NO_STD_LOCALE) || BOOST_WORKAROUND(__BORLANDC__, <0x610)
-# define BOOST_FILESYSTEM2_NARROW_ONLY
-# endif
-
-// This header implements separate compilation features as described in
-// http://www.boost.org/more/separate_compilation.html
-
-// enable dynamic linking ---------------------------------------------------//
-
-#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK)
-# if defined(BOOST_FILESYSTEM_SOURCE)
-# define BOOST_FILESYSTEM_DECL BOOST_SYMBOL_EXPORT
-# else
-# define BOOST_FILESYSTEM_DECL BOOST_SYMBOL_IMPORT
-# endif
-#else
-# define BOOST_FILESYSTEM_DECL
-#endif
-
-// enable automatic library variant selection ------------------------------//
-
-#if !defined(BOOST_FILESYSTEM_SOURCE) && !defined(BOOST_ALL_NO_LIB) \
- && !defined(BOOST_FILESYSTEM_NO_LIB)
-//
-// Set the name of our library, this will get undef'ed by auto_link.hpp
-// once it's done with it:
-//
-#define BOOST_LIB_NAME boost_filesystem
-//
-// If we're importing code from a dll, then tell auto_link.hpp about it:
-//
-#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK)
-# define BOOST_DYN_LINK
-#endif
-//
-// And include the header that does the work:
-//
-#include <boost/config/auto_link.hpp>
-#endif // auto-linking disabled
-
-#endif // BOOST_FILESYSTEM2_CONFIG_HPP
diff --git a/boost/filesystem/v2/convenience.hpp b/boost/filesystem/v2/convenience.hpp
deleted file mode 100644
index 30b6adee7d..0000000000
--- a/boost/filesystem/v2/convenience.hpp
+++ /dev/null
@@ -1,339 +0,0 @@
-// boost/filesystem/convenience.hpp ----------------------------------------//
-
-// Copyright Beman Dawes, 2002-2005
-// Copyright Vladimir Prus, 2002
-// Use, modification, and distribution is subject to the Boost Software
-// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// See library home page at http://www.boost.org/libs/filesystem
-
-//----------------------------------------------------------------------------//
-
-#ifndef BOOST_FILESYSTEM2_CONVENIENCE_HPP
-#define BOOST_FILESYSTEM2_CONVENIENCE_HPP
-
-#include <boost/filesystem/v2/config.hpp>
-#include <boost/filesystem/v2/operations.hpp>
-#include <boost/system/error_code.hpp>
-#include <vector>
-#include <stack>
-
-#include <boost/config/abi_prefix.hpp> // must be the last #include
-
-# ifndef BOOST_FILESYSTEM2_NARROW_ONLY
-# define BOOST_FS_FUNC(BOOST_FS_TYPE) \
- template<class Path> typename boost::enable_if<is_basic_path<Path>, \
- BOOST_FS_TYPE>::type
-# define BOOST_FS_FUNC_STRING BOOST_FS_FUNC(typename Path::string_type)
-# define BOOST_FS_TYPENAME typename
-# else
-# define BOOST_FS_FUNC(BOOST_FS_TYPE) inline BOOST_FS_TYPE
- typedef boost::filesystem::path Path;
-# define BOOST_FS_FUNC_STRING inline std::string
-# define BOOST_FS_TYPENAME
-# endif
-
-namespace boost
-{
- namespace filesystem2
- {
-
- BOOST_FS_FUNC(bool) create_directories(const Path& ph)
- {
- if (ph.empty() || exists(ph))
- {
- if ( !ph.empty() && !is_directory(ph) )
- boost::throw_exception( basic_filesystem_error<Path>(
- "boost::filesystem::create_directories", ph,
- make_error_code( boost::system::errc::file_exists ) ) );
- return false;
- }
-
- // First create branch, by calling ourself recursively
- create_directories(ph.parent_path());
- // Now that parent's path exists, create the directory
- create_directory(ph);
- return true;
- }
-
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
-
- BOOST_FS_FUNC_STRING extension(const Path& ph)
- {
- typedef BOOST_FS_TYPENAME Path::string_type string_type;
- string_type filename = ph.filename();
-
- BOOST_FS_TYPENAME string_type::size_type n = filename.rfind('.');
- if (n != string_type::npos)
- return filename.substr(n);
- else
- return string_type();
- }
-
- BOOST_FS_FUNC_STRING basename(const Path& ph)
- {
- typedef BOOST_FS_TYPENAME Path::string_type string_type;
- string_type filename = ph.filename();
- BOOST_FS_TYPENAME string_type::size_type n = filename.rfind('.');
- return filename.substr(0, n);
- }
-
-
- BOOST_FS_FUNC(Path) change_extension( const Path & ph,
- const BOOST_FS_TYPENAME Path::string_type & new_extension )
- {
-# if !defined(_STLPORT_VERSION)
- return ph.parent_path() / (basename(ph) + new_extension);
-# else
- typedef BOOST_FS_TYPENAME Path::string_type string_type;
- string_type filename = basename(ph) + new_extension;
- return ph.parent_path() / filename;
-# endif
- }
-# endif
-
-# ifndef BOOST_FILESYSTEM2_NARROW_ONLY
-
- // "do-the-right-thing" overloads ---------------------------------------//
-
- inline bool create_directories(const path& ph)
- { return create_directories<path>(ph); }
- inline bool create_directories(const wpath& ph)
- { return create_directories<wpath>(ph); }
-
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
- inline std::string extension(const path& ph)
- { return extension<path>(ph); }
- inline std::wstring extension(const wpath& ph)
- { return extension<wpath>(ph); }
-
- inline std::string basename(const path& ph)
- { return basename<path>( ph ); }
- inline std::wstring basename(const wpath& ph)
- { return basename<wpath>( ph ); }
-
- inline path change_extension( const path & ph, const std::string& new_ex )
- { return change_extension<path>( ph, new_ex ); }
- inline wpath change_extension( const wpath & ph, const std::wstring& new_ex )
- { return change_extension<wpath>( ph, new_ex ); }
-# endif
-
-# endif
-
-
- // basic_recursive_directory_iterator helpers --------------------------//
-
- namespace detail
- {
- template< class Path >
- struct recur_dir_itr_imp
- {
- typedef basic_directory_iterator< Path > element_type;
- std::stack< element_type, std::vector< element_type > > m_stack;
- int m_level;
- bool m_no_push;
- bool m_no_throw;
-
- recur_dir_itr_imp() : m_level(0), m_no_push(false), m_no_throw(false) {}
- };
-
- } // namespace detail
-
- // basic_recursive_directory_iterator ----------------------------------//
-
- template< class Path >
- class basic_recursive_directory_iterator
- : public boost::iterator_facade<
- basic_recursive_directory_iterator<Path>,
- basic_directory_entry<Path>,
- boost::single_pass_traversal_tag >
- {
- public:
- typedef Path path_type;
-
- basic_recursive_directory_iterator(){} // creates the "end" iterator
-
- explicit basic_recursive_directory_iterator( const Path & dir_path );
- basic_recursive_directory_iterator( const Path & dir_path,
- system::error_code & ec );
-
- int level() const { return m_imp->m_level; }
-
- void pop();
- void no_push()
- {
- BOOST_ASSERT( m_imp.get() && "attempt to no_push() on end iterator" );
- m_imp->m_no_push = true;
- }
-
- file_status status() const
- {
- BOOST_ASSERT( m_imp.get()
- && "attempt to call status() on end recursive_iterator" );
- return m_imp->m_stack.top()->status();
- }
-
- file_status symlink_status() const
- {
- BOOST_ASSERT( m_imp.get()
- && "attempt to call symlink_status() on end recursive_iterator" );
- return m_imp->m_stack.top()->symlink_status();
- }
-
- private:
-
- // shared_ptr provides shallow-copy semantics required for InputIterators.
- // m_imp.get()==0 indicates the end iterator.
- boost::shared_ptr< detail::recur_dir_itr_imp< Path > > m_imp;
-
- friend class boost::iterator_core_access;
-
- typename boost::iterator_facade<
- basic_recursive_directory_iterator<Path>,
- basic_directory_entry<Path>,
- boost::single_pass_traversal_tag >::reference
- dereference() const
- {
- BOOST_ASSERT( m_imp.get() && "attempt to dereference end iterator" );
- return *m_imp->m_stack.top();
- }
-
- void increment();
-
- bool equal( const basic_recursive_directory_iterator & rhs ) const
- { return m_imp == rhs.m_imp; }
-
- };
-
- typedef basic_recursive_directory_iterator<path> recursive_directory_iterator;
-# ifndef BOOST_FILESYSTEM2_NARROW_ONLY
- typedef basic_recursive_directory_iterator<wpath> wrecursive_directory_iterator;
-# endif
-
- // basic_recursive_directory_iterator implementation -------------------//
-
- // constructors
- template<class Path>
- basic_recursive_directory_iterator<Path>::
- basic_recursive_directory_iterator( const Path & dir_path )
- : m_imp( new detail::recur_dir_itr_imp<Path> )
- {
- m_imp->m_stack.push( basic_directory_iterator<Path>( dir_path ) );
- if ( m_imp->m_stack.top () == basic_directory_iterator<Path>() )
- { m_imp.reset (); }
- }
-
- template<class Path>
- basic_recursive_directory_iterator<Path>::
- basic_recursive_directory_iterator( const Path & dir_path,
- system::error_code & ec )
- : m_imp( new detail::recur_dir_itr_imp<Path> )
- {
- m_imp->m_no_throw = true;
- m_imp->m_stack.push( basic_directory_iterator<Path>( dir_path, ec ) );
- if ( m_imp->m_stack.top () == basic_directory_iterator<Path>() )
- { m_imp.reset (); }
- }
-
- // increment
- template<class Path>
- void basic_recursive_directory_iterator<Path>::increment()
- {
- BOOST_ASSERT( m_imp.get() && "increment on end iterator" );
-
- static const basic_directory_iterator<Path> end_itr;
-
- if ( m_imp->m_no_push )
- { m_imp->m_no_push = false; }
- else if ( is_directory( m_imp->m_stack.top()->status() ) )
- {
- system::error_code ec;
-#if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x610))
- if( m_imp->m_no_throw ) {
- m_imp->m_stack.push(
- basic_directory_iterator<Path>( *m_imp->m_stack.top(), ec )
- );
- }
- else {
- m_imp->m_stack.push(
- basic_directory_iterator<Path>( *m_imp->m_stack.top() )
- );
- }
-#else
- m_imp->m_stack.push(
- m_imp->m_no_throw
- ? basic_directory_iterator<Path>( *m_imp->m_stack.top(), ec )
- : basic_directory_iterator<Path>( *m_imp->m_stack.top() ) );
-#endif
- if ( m_imp->m_stack.top() != end_itr )
- {
- ++m_imp->m_level;
- return;
- }
- m_imp->m_stack.pop();
- }
-
- while ( !m_imp->m_stack.empty()
- && ++m_imp->m_stack.top() == end_itr )
- {
- m_imp->m_stack.pop();
- --m_imp->m_level;
- }
-
- if ( m_imp->m_stack.empty() ) m_imp.reset(); // done, so make end iterator
- }
-
- // pop
- template<class Path>
- void basic_recursive_directory_iterator<Path>::pop()
- {
- BOOST_ASSERT( m_imp.get() && "pop on end iterator" );
- BOOST_ASSERT( m_imp->m_level > 0 && "pop with level < 1" );
-
- static const basic_directory_iterator<Path> end_itr;
-
- do
- {
- m_imp->m_stack.pop();
- --m_imp->m_level;
- }
- while ( !m_imp->m_stack.empty()
- && ++m_imp->m_stack.top() == end_itr );
-
- if ( m_imp->m_stack.empty() ) m_imp.reset(); // done, so make end iterator
- }
-
- } // namespace filesystem2
-} // namespace boost
-
-#undef BOOST_FS_FUNC_STRING
-#undef BOOST_FS_FUNC
-
-//----------------------------------------------------------------------------//
-
-namespace boost
-{
- namespace filesystem
- {
- using filesystem2::create_directories;
- using filesystem2::basic_recursive_directory_iterator;
- using filesystem2::recursive_directory_iterator;
-
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
- using filesystem2::extension;
- using filesystem2::basename;
- using filesystem2::change_extension;
-# endif
-
-# ifndef BOOST_FILESYSTEM2_NARROW_ONLY
- using filesystem2::wrecursive_directory_iterator;
-# endif
-
- }
-}
-
-//----------------------------------------------------------------------------//
-
-#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
-#endif // BOOST_FILESYSTEM2_CONVENIENCE_HPP
diff --git a/boost/filesystem/v2/exception.hpp b/boost/filesystem/v2/exception.hpp
deleted file mode 100644
index edea663b1f..0000000000
--- a/boost/filesystem/v2/exception.hpp
+++ /dev/null
@@ -1,9 +0,0 @@
-// boost/filesystem/exception.hpp -------------------------------------------//
-
-// Copyright Beman Dawes 2003
-// Use, modification, and distribution is subject to the Boost Software
-// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// This header is no long used. The contents have been moved to path.hpp.
-// It is provided so that user code #includes do not have to be changed.
diff --git a/boost/filesystem/v2/fstream.hpp b/boost/filesystem/v2/fstream.hpp
deleted file mode 100644
index 887d59d3ab..0000000000
--- a/boost/filesystem/v2/fstream.hpp
+++ /dev/null
@@ -1,613 +0,0 @@
-// boost/filesystem/fstream.hpp --------------------------------------------//
-
-// Copyright Beman Dawes 2002.
-// Use, modification, and distribution is subject to the Boost Software
-// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// See library home page at http://www.boost.org/libs/filesystem
-
-//----------------------------------------------------------------------------//
-
-#ifndef BOOST_FILESYSTEM2_FSTREAM_HPP
-#define BOOST_FILESYSTEM2_FSTREAM_HPP
-
-#include <boost/filesystem/v2/config.hpp>
-#include <boost/filesystem/v2/operations.hpp> // for 8.3 hack (see below)
-#include <boost/utility/enable_if.hpp>
-#include <boost/detail/workaround.hpp>
-
-#include <iosfwd>
-#include <fstream>
-
-#include <boost/config/abi_prefix.hpp> // must be the last #include
-
-// NOTE: fstream.hpp for Boost 1.32.0 and earlier supplied workarounds for
-// various compiler problems. They have been removed to ease development of the
-// basic i18n functionality. Once the new interface is stable, the workarounds
-// will be reinstated for any compilers that otherwise can support the rest of
-// the library after internationalization.
-
-namespace boost
-{
- namespace filesystem2
- {
- namespace detail
- {
-# if defined(BOOST_WINDOWS_API) && !defined(BOOST_FILESYSTEM2_NARROW_ONLY)
-# if !defined(BOOST_DINKUMWARE_STDLIB) || BOOST_DINKUMWARE_STDLIB < 405
- // The 8.3 hack:
- // C++98 does not supply a wchar_t open, so try to get an equivalent
- // narrow char name based on the short, so-called 8.3, name.
- // Not needed for Dinkumware 405 and later as they do supply wchar_t open.
- BOOST_FILESYSTEM_DECL bool create_file_api( const std::wstring & ph,
- std::ios_base::openmode mode ); // true if succeeds
- BOOST_FILESYSTEM_DECL std::string narrow_path_api(
- const std::wstring & ph ); // return is empty if fails
-
- inline std::string path_proxy( const std::wstring & file_ph,
- std::ios_base::openmode mode )
- // Return a non-existant path if cannot supply narrow short path.
- // An empty path doesn't work because some Dinkumware versions
- // assert the path is non-empty.
- {
- std::string narrow_ph;
- bool created_file( false );
- if ( !exists( file_ph )
- && (mode & std::ios_base::out) != 0
- && create_file_api( file_ph, mode ) )
- {
- created_file = true;
- }
- narrow_ph = narrow_path_api( file_ph );
- if ( narrow_ph.empty() )
- {
- if ( created_file ) remove_api( file_ph );
- narrow_ph = "\x01";
- }
- return narrow_ph;
- }
-# else
- // Dinkumware 405 and later does supply wchar_t functions
- inline const std::wstring & path_proxy( const std::wstring & file_ph,
- std::ios_base::openmode )
- { return file_ph; }
-# endif
-# endif
-
- inline const std::string & path_proxy( const std::string & file_ph,
- std::ios_base::openmode )
- { return file_ph; }
-
- } // namespace detail
-
- template < class charT, class traits = std::char_traits<charT> >
- class basic_filebuf : public std::basic_filebuf<charT,traits>
- {
- private: // disallow copying
- basic_filebuf( const basic_filebuf & );
- const basic_filebuf & operator=( const basic_filebuf & );
- public:
- basic_filebuf() {}
- virtual ~basic_filebuf() {}
-
-# ifndef BOOST_FILESYSTEM2_NARROW_ONLY
- template<class Path>
- typename boost::enable_if<is_basic_path<Path>,
- basic_filebuf<charT,traits> *>::type
- open( const Path & file_ph, std::ios_base::openmode mode );
-
- basic_filebuf<charT,traits> *
- open( const wpath & file_ph, std::ios_base::openmode mode );
-# endif
-
-# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
- basic_filebuf<charT,traits> *
- open( const path & file_ph, std::ios_base::openmode mode );
-# endif
- };
-
- template < class charT, class traits = std::char_traits<charT> >
- class basic_ifstream : public std::basic_ifstream<charT,traits>
- {
- private: // disallow copying
- basic_ifstream( const basic_ifstream & );
- const basic_ifstream & operator=( const basic_ifstream & );
- public:
- basic_ifstream() {}
-
- // use two signatures, rather than one signature with default second
- // argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416)
-
-# ifndef BOOST_FILESYSTEM2_NARROW_ONLY
- template<class Path>
- explicit basic_ifstream( const Path & file_ph,
- typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
-
- template<class Path>
- basic_ifstream( const Path & file_ph, std::ios_base::openmode mode,
- typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
-
- template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- open( const Path & file_ph );
-
- template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- open( const Path & file_ph, std::ios_base::openmode mode );
-
- explicit basic_ifstream( const wpath & file_ph );
- basic_ifstream( const wpath & file_ph, std::ios_base::openmode mode );
- void open( const wpath & file_ph );
- void open( const wpath & file_ph, std::ios_base::openmode mode );
-# endif
-
- explicit basic_ifstream( const path & file_ph );
- basic_ifstream( const path & file_ph, std::ios_base::openmode mode );
-# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
- void open( const path & file_ph );
- void open( const path & file_ph, std::ios_base::openmode mode );
-# endif
- virtual ~basic_ifstream() {}
- };
-
- template < class charT, class traits = std::char_traits<charT> >
- class basic_ofstream : public std::basic_ofstream<charT,traits>
- {
- private: // disallow copying
- basic_ofstream( const basic_ofstream & );
- const basic_ofstream & operator=( const basic_ofstream & );
- public:
- basic_ofstream() {}
-
- // use two signatures, rather than one signature with default second
- // argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416)
-
-# ifndef BOOST_FILESYSTEM2_NARROW_ONLY
-
- template<class Path>
- explicit basic_ofstream( const Path & file_ph,
- typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
- explicit basic_ofstream( const wpath & file_ph );
-
- template<class Path>
- basic_ofstream( const Path & file_ph, std::ios_base::openmode mode,
- typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
- basic_ofstream( const wpath & file_ph, std::ios_base::openmode mode );
-
- template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- open( const Path & file_ph );
- void open( const wpath & file_ph );
-
- template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- open( const Path & file_ph, std::ios_base::openmode mode );
- void open( const wpath & file_ph, std::ios_base::openmode mode );
-
-# endif
-
- explicit basic_ofstream( const path & file_ph );
- basic_ofstream( const path & file_ph, std::ios_base::openmode mode );
-# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
- void open( const path & file_ph );
- void open( const path & file_ph, std::ios_base::openmode mode );
-# endif
- virtual ~basic_ofstream() {}
- };
-
- template < class charT, class traits = std::char_traits<charT> >
- class basic_fstream : public std::basic_fstream<charT,traits>
- {
- private: // disallow copying
- basic_fstream( const basic_fstream & );
- const basic_fstream & operator=( const basic_fstream & );
- public:
- basic_fstream() {}
-
- // use two signatures, rather than one signature with default second
- // argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416)
-
-# ifndef BOOST_FILESYSTEM2_NARROW_ONLY
-
- template<class Path>
- explicit basic_fstream( const Path & file_ph,
- typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
- explicit basic_fstream( const wpath & file_ph );
-
- template<class Path>
- basic_fstream( const Path & file_ph, std::ios_base::openmode mode,
- typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
- basic_fstream( const wpath & file_ph, std::ios_base::openmode mode );
-
- template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- open( const Path & file_ph );
- void open( const wpath & file_ph );
-
- template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- open( const Path & file_ph, std::ios_base::openmode mode );
- void open( const wpath & file_ph, std::ios_base::openmode mode );
-
-# endif
-
- explicit basic_fstream( const path & file_ph );
- basic_fstream( const path & file_ph, std::ios_base::openmode mode );
-# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
- void open( const path & file_ph );
- void open( const path & file_ph, std::ios_base::openmode mode );
-# endif
- virtual ~basic_fstream() {}
-
- };
-
- typedef basic_filebuf<char> filebuf;
- typedef basic_ifstream<char> ifstream;
- typedef basic_ofstream<char> ofstream;
- typedef basic_fstream<char> fstream;
-
-# ifndef BOOST_FILESYSTEM2_NARROW_ONLY
- typedef basic_filebuf<wchar_t> wfilebuf;
- typedef basic_ifstream<wchar_t> wifstream;
- typedef basic_fstream<wchar_t> wfstream;
- typedef basic_ofstream<wchar_t> wofstream;
-# endif
-
-# ifndef BOOST_FILESYSTEM2_NARROW_ONLY
-
-// basic_filebuf definitions -----------------------------------------------//
-
- template <class charT, class traits>
- template<class Path>
- typename boost::enable_if<is_basic_path<Path>,
- basic_filebuf<charT,traits> *>::type
- basic_filebuf<charT,traits>::open( const Path & file_ph,
- std::ios_base::openmode mode )
- {
- return (std::basic_filebuf<charT,traits>::open( detail::path_proxy(
- file_ph.external_file_string(), mode ).c_str(), mode )
- == 0) ? 0 : this;
- }
-
- template <class charT, class traits>
- basic_filebuf<charT,traits> *
- basic_filebuf<charT, traits>::open( const wpath & file_ph,
- std::ios_base::openmode mode )
- {
- return this->BOOST_NESTED_TEMPLATE open<wpath>( file_ph, mode );
- }
-
-// basic_ifstream definitions ----------------------------------------------//
-
- template <class charT, class traits> template<class Path>
- basic_ifstream<charT,traits>::basic_ifstream(const Path & file_ph,
- typename boost::enable_if<is_basic_path<Path> >::type* )
- : std::basic_ifstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::in ).c_str(), std::ios_base::in ) {}
-
- template <class charT, class traits>
- basic_ifstream<charT,traits>::basic_ifstream( const wpath & file_ph )
- : std::basic_ifstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::in ).c_str(), std::ios_base::in ) {}
-
- template <class charT, class traits> template<class Path>
- basic_ifstream<charT,traits>::basic_ifstream( const Path & file_ph,
- std::ios_base::openmode mode,
- typename boost::enable_if<is_basic_path<Path> >::type* )
- : std::basic_ifstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode ) {}
-
- template <class charT, class traits>
- basic_ifstream<charT,traits>::basic_ifstream( const wpath & file_ph,
- std::ios_base::openmode mode )
- : std::basic_ifstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode ) {}
-
- template <class charT, class traits> template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- basic_ifstream<charT,traits>::open( const Path & file_ph )
- {
- std::basic_ifstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::in ).c_str(), std::ios_base::in );
- }
-
- template <class charT, class traits>
- void basic_ifstream<charT,traits>::open( const wpath & file_ph )
- {
- std::basic_ifstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::in ).c_str(), std::ios_base::in );
- }
-
- template <class charT, class traits> template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- basic_ifstream<charT,traits>::open( const Path & file_ph,
- std::ios_base::openmode mode )
- {
- std::basic_ifstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode );
- }
-
- template <class charT, class traits>
- void basic_ifstream<charT,traits>::open( const wpath & file_ph,
- std::ios_base::openmode mode )
- {
- std::basic_ifstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode );
- }
-
-// basic_ofstream definitions ----------------------------------------------//
-
- template <class charT, class traits> template<class Path>
- basic_ofstream<charT,traits>::basic_ofstream(const Path & file_ph,
- typename boost::enable_if<is_basic_path<Path> >::type* )
- : std::basic_ofstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::out ).c_str(), std::ios_base::out ) {}
-
- template <class charT, class traits>
- basic_ofstream<charT,traits>::basic_ofstream( const wpath & file_ph )
- : std::basic_ofstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::out ).c_str(), std::ios_base::out ) {}
-
- template <class charT, class traits> template<class Path>
- basic_ofstream<charT,traits>::basic_ofstream( const Path & file_ph,
- std::ios_base::openmode mode,
- typename boost::enable_if<is_basic_path<Path> >::type* )
- : std::basic_ofstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode ) {}
-
- template <class charT, class traits>
- basic_ofstream<charT,traits>::basic_ofstream( const wpath & file_ph,
- std::ios_base::openmode mode )
- : std::basic_ofstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode ) {}
-
- template <class charT, class traits> template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- basic_ofstream<charT,traits>::open( const Path & file_ph )
- {
- std::basic_ofstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::out ).c_str(), std::ios_base::out );
- }
-
- template <class charT, class traits>
- void basic_ofstream<charT,traits>::open( const wpath & file_ph )
- {
- std::basic_ofstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::out ).c_str(), std::ios_base::out );
- }
-
- template <class charT, class traits> template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- basic_ofstream<charT,traits>::open( const Path & file_ph,
- std::ios_base::openmode mode )
- {
- std::basic_ofstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode );
- }
-
- template <class charT, class traits>
- void basic_ofstream<charT,traits>::open( const wpath & file_ph,
- std::ios_base::openmode mode )
- {
- std::basic_ofstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode );
- }
-
-// basic_fstream definitions -----------------------------------------------//
-
- template <class charT, class traits> template<class Path>
- basic_fstream<charT,traits>::basic_fstream(const Path & file_ph,
- typename boost::enable_if<is_basic_path<Path> >::type* )
- : std::basic_fstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::in|std::ios_base::out ).c_str(),
- std::ios_base::in|std::ios_base::out ) {}
-
- template <class charT, class traits>
- basic_fstream<charT,traits>::basic_fstream( const wpath & file_ph )
- : std::basic_fstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::in|std::ios_base::out ).c_str(),
- std::ios_base::in|std::ios_base::out ) {}
-
- template <class charT, class traits> template<class Path>
- basic_fstream<charT,traits>::basic_fstream( const Path & file_ph,
- std::ios_base::openmode mode,
- typename boost::enable_if<is_basic_path<Path> >::type* )
- : std::basic_fstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode ) {}
-
- template <class charT, class traits>
- basic_fstream<charT,traits>::basic_fstream( const wpath & file_ph,
- std::ios_base::openmode mode )
- : std::basic_fstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode ) {}
-
- template <class charT, class traits> template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- basic_fstream<charT,traits>::open( const Path & file_ph )
- {
- std::basic_fstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::in|std::ios_base::out ).c_str(),
- std::ios_base::in|std::ios_base::out );
- }
-
- template <class charT, class traits>
- void basic_fstream<charT,traits>::open( const wpath & file_ph )
- {
- std::basic_fstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::in|std::ios_base::out ).c_str(),
- std::ios_base::in|std::ios_base::out );
- }
-
- template <class charT, class traits> template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- basic_fstream<charT,traits>::open( const Path & file_ph,
- std::ios_base::openmode mode )
- {
- std::basic_fstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode );
- }
-
- template <class charT, class traits>
- void basic_fstream<charT,traits>::open( const wpath & file_ph,
- std::ios_base::openmode mode )
- {
- std::basic_fstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode );
- }
-
-# endif
-
-# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
- template <class charT, class traits>
- basic_filebuf<charT,traits> *
- basic_filebuf<charT, traits>::open( const path & file_ph,
- std::ios_base::openmode mode )
- {
- return std::basic_filebuf<charT,traits>::open(
- file_ph.file_string().c_str(), mode ) == 0 ? 0 : this;
- }
-# endif
-
- template <class charT, class traits>
- basic_ifstream<charT,traits>::basic_ifstream( const path & file_ph )
- : std::basic_ifstream<charT,traits>(
- file_ph.file_string().c_str(), std::ios_base::in ) {}
-
- template <class charT, class traits>
- basic_ifstream<charT,traits>::basic_ifstream( const path & file_ph,
- std::ios_base::openmode mode )
- : std::basic_ifstream<charT,traits>(
- file_ph.file_string().c_str(), mode ) {}
-
-# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
- template <class charT, class traits>
- void basic_ifstream<charT,traits>::open( const path & file_ph )
- {
- std::basic_ifstream<charT,traits>::open(
- file_ph.file_string().c_str(), std::ios_base::in );
- }
-
- template <class charT, class traits>
- void basic_ifstream<charT,traits>::open( const path & file_ph,
- std::ios_base::openmode mode )
- {
- std::basic_ifstream<charT,traits>::open(
- file_ph.file_string().c_str(), mode );
- }
-# endif
-
- template <class charT, class traits>
- basic_ofstream<charT,traits>::basic_ofstream( const path & file_ph )
- : std::basic_ofstream<charT,traits>(
- file_ph.file_string().c_str(), std::ios_base::out ) {}
-
- template <class charT, class traits>
- basic_ofstream<charT,traits>::basic_ofstream( const path & file_ph,
- std::ios_base::openmode mode )
- : std::basic_ofstream<charT,traits>(
- file_ph.file_string().c_str(), mode ) {}
-
-# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
- template <class charT, class traits>
- void basic_ofstream<charT,traits>::open( const path & file_ph )
- {
- std::basic_ofstream<charT,traits>::open(
- file_ph.file_string().c_str(), std::ios_base::out );
- }
-
- template <class charT, class traits>
- void basic_ofstream<charT,traits>::open( const path & file_ph,
- std::ios_base::openmode mode )
- {
- std::basic_ofstream<charT,traits>::open(
- file_ph.file_string().c_str(), mode );
- }
-# endif
-
- template <class charT, class traits>
- basic_fstream<charT,traits>::basic_fstream( const path & file_ph )
- : std::basic_fstream<charT,traits>(
- file_ph.file_string().c_str(),
- std::ios_base::in|std::ios_base::out ) {}
-
-
- template <class charT, class traits>
- basic_fstream<charT,traits>::basic_fstream( const path & file_ph,
- std::ios_base::openmode mode )
- : std::basic_fstream<charT,traits>(
- file_ph.file_string().c_str(), mode ) {}
-
-# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
- template <class charT, class traits>
- void basic_fstream<charT,traits>::open( const path & file_ph )
- {
- std::basic_fstream<charT,traits>::open(
- file_ph.file_string().c_str(), std::ios_base::in|std::ios_base::out );
- }
-
- template <class charT, class traits>
- void basic_fstream<charT,traits>::open( const path & file_ph,
- std::ios_base::openmode mode )
- {
- std::basic_fstream<charT,traits>::open(
- file_ph.file_string().c_str(), mode );
- }
-# endif
- } // namespace filesystem2
-} // namespace boost
-
-//----------------------------------------------------------------------------//
-
-namespace boost
-{
- namespace filesystem
- {
-# ifndef BOOST_FILESYSTEM2_NARROW_ONLY
- using filesystem2::wfilebuf;
- using filesystem2::wifstream;
- using filesystem2::wfstream;
- using filesystem2::wofstream;
-# endif
- using filesystem2::filebuf;
- using filesystem2::ifstream;
- using filesystem2::ofstream;
- using filesystem2::fstream;
- using filesystem2::basic_filebuf;
- using filesystem2::basic_ifstream;
- using filesystem2::basic_ofstream;
- using filesystem2::basic_fstream;
-
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
-# endif
- }
-}
-
-//----------------------------------------------------------------------------//
-
-#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
-#endif // BOOST_FILESYSTEM2_FSTREAM_HPP
diff --git a/boost/filesystem/v2/operations.hpp b/boost/filesystem/v2/operations.hpp
deleted file mode 100644
index 57c406daac..0000000000
--- a/boost/filesystem/v2/operations.hpp
+++ /dev/null
@@ -1,1245 +0,0 @@
-// boost/filesystem/operations.hpp -----------------------------------------//
-
-// Copyright 2002-2005 Beman Dawes
-// Copyright 2002 Jan Langer
-// Copyright 2001 Dietmar Kuehl
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-// See library home page at http://www.boost.org/libs/filesystem
-
-//----------------------------------------------------------------------------//
-
-#ifndef BOOST_FILESYSTEM2_OPERATIONS_HPP
-#define BOOST_FILESYSTEM2_OPERATIONS_HPP
-
-#include <boost/filesystem/v2/config.hpp>
-#include <boost/filesystem/v2/path.hpp>
-#include <boost/detail/scoped_enum_emulation.hpp>
-
-#include <boost/shared_ptr.hpp>
-#include <boost/utility/enable_if.hpp>
-#include <boost/type_traits/is_same.hpp>
-#include <boost/iterator.hpp>
-#include <boost/cstdint.hpp>
-#include <boost/assert.hpp>
-
-#include <string>
-#include <utility> // for pair
-#include <ctime>
-
-#ifdef BOOST_WINDOWS_API
-# include <fstream>
-# if !defined(_WIN32_WINNT) || _WIN32_WINNT >= 0x0500
-# define BOOST_FS_HARD_LINK // Default for Windows 2K or later
-# endif
-#endif
-
-#include <boost/config/abi_prefix.hpp> // must be the last #include
-
-# ifdef BOOST_NO_STDC_NAMESPACE
- namespace std { using ::time_t; }
-# endif
-
-//----------------------------------------------------------------------------//
-
-namespace boost
-{
- namespace filesystem2
- {
-
-// typedef boost::filesystem::path Path; needs to be in namespace boost::filesystem
-# ifndef BOOST_FILESYSTEM2_NARROW_ONLY
-# define BOOST_FS_FUNC(BOOST_FS_TYPE) \
- template<class Path> typename boost::enable_if<is_basic_path<Path>, \
- BOOST_FS_TYPE>::type
-# define BOOST_INLINE_FS_FUNC(BOOST_FS_TYPE) \
- template<class Path> inline typename boost::enable_if<is_basic_path<Path>, \
- BOOST_FS_TYPE>::type
-# define BOOST_FS_TYPENAME typename
-# else
-# define BOOST_FS_FUNC(BOOST_FS_TYPE) inline BOOST_FS_TYPE
-# define BOOST_INLINE_FS_FUNC(BOOST_FS_TYPE) inline BOOST_FS_TYPE
- typedef boost::filesystem2::path Path;
-# define BOOST_FS_TYPENAME
-# endif
-
- template<class Path> class basic_directory_iterator;
-
- // BOOST_FILESYSTEM2_NARROW_ONLY needs this:
- typedef basic_directory_iterator<path> directory_iterator;
-
- template<class Path> class basic_directory_entry;
-
- enum file_type
- {
- status_unknown,
- file_not_found,
- regular_file,
- directory_file,
- // the following will never be reported by some operating or file systems
- symlink_file,
- block_file,
- character_file,
- fifo_file,
- socket_file,
- type_unknown // file does exist, but isn't one of the above types or
- // we don't have strong enough permission to find its type
- };
-
- class file_status
- {
- public:
- explicit file_status( file_type v = status_unknown ) : m_value(v) {}
-
- void type( file_type v ) { m_value = v; }
- file_type type() const { return m_value; }
-
- private:
- // the internal representation is unspecified so that additional state
- // information such as permissions can be added in the future; this
- // implementation just uses status_type as the internal representation
-
- file_type m_value;
- };
-
- inline bool status_known( file_status f ) { return f.type() != status_unknown; }
- inline bool exists( file_status f ) { return f.type() != status_unknown && f.type() != file_not_found; }
- inline bool is_regular_file(file_status f){ return f.type() == regular_file; }
- inline bool is_directory( file_status f ) { return f.type() == directory_file; }
- inline bool is_symlink( file_status f ) { return f.type() == symlink_file; }
- inline bool is_other( file_status f ) { return exists(f) && !is_regular_file(f) && !is_directory(f) && !is_symlink(f); }
-
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
- inline bool is_regular( file_status f ) { return f.type() == regular_file; }
-# endif
-
- struct space_info
- {
- // all values are byte counts
- boost::uintmax_t capacity;
- boost::uintmax_t free; // <= capacity
- boost::uintmax_t available; // <= free
- };
-
- namespace detail
- {
- typedef std::pair< system::error_code, bool >
- query_pair;
-
- typedef std::pair< system::error_code, boost::uintmax_t >
- uintmax_pair;
-
- typedef std::pair< system::error_code, std::time_t >
- time_pair;
-
- typedef std::pair< system::error_code, space_info >
- space_pair;
-
- template< class Path >
- struct directory_pair
- {
- typedef std::pair< system::error_code,
- typename Path::external_string_type > type;
- };
-
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
- BOOST_FILESYSTEM_DECL bool
- symbolic_link_exists_api( const std::string & ); // deprecated
-# endif
-
- BOOST_FILESYSTEM_DECL file_status
- status_api( const std::string & ph, system::error_code & ec );
-# ifndef BOOST_WINDOWS_API
- BOOST_FILESYSTEM_DECL file_status
- symlink_status_api( const std::string & ph, system::error_code & ec );
-# endif
- BOOST_FILESYSTEM_DECL query_pair
- is_empty_api( const std::string & ph );
- BOOST_FILESYSTEM_DECL query_pair
- equivalent_api( const std::string & ph1, const std::string & ph2 );
- BOOST_FILESYSTEM_DECL uintmax_pair
- file_size_api( const std::string & ph );
- BOOST_FILESYSTEM_DECL space_pair
- space_api( const std::string & ph );
- BOOST_FILESYSTEM_DECL time_pair
- last_write_time_api( const std::string & ph );
- BOOST_FILESYSTEM_DECL system::error_code
- last_write_time_api( const std::string & ph, std::time_t new_value );
- BOOST_FILESYSTEM_DECL system::error_code
- get_current_path_api( std::string & ph );
- BOOST_FILESYSTEM_DECL system::error_code
- set_current_path_api( const std::string & ph );
- BOOST_FILESYSTEM_DECL query_pair
- create_directory_api( const std::string & ph );
- BOOST_FILESYSTEM_DECL system::error_code
- create_hard_link_api( const std::string & to_ph,
- const std::string & from_ph );
- BOOST_FILESYSTEM_DECL system::error_code
- create_symlink_api( const std::string & to_ph,
- const std::string & from_ph );
- BOOST_FILESYSTEM_DECL system::error_code
- remove_api( const std::string & ph );
- BOOST_FILESYSTEM_DECL system::error_code
- rename_api( const std::string & from, const std::string & to );
- BOOST_FILESYSTEM_DECL system::error_code
- copy_file_api( const std::string & from, const std::string & to, bool fail_if_exists );
-
-# if defined(BOOST_WINDOWS_API)
-
- BOOST_FILESYSTEM_DECL system::error_code
- get_full_path_name_api( const std::string & ph, std::string & target );
-
-# if !defined(BOOST_FILESYSTEM2_NARROW_ONLY)
-
- BOOST_FILESYSTEM_DECL boost::filesystem2::file_status
- status_api( const std::wstring & ph, system::error_code & ec );
- BOOST_FILESYSTEM_DECL query_pair
- is_empty_api( const std::wstring & ph );
- BOOST_FILESYSTEM_DECL query_pair
- equivalent_api( const std::wstring & ph1, const std::wstring & ph2 );
- BOOST_FILESYSTEM_DECL uintmax_pair
- file_size_api( const std::wstring & ph );
- BOOST_FILESYSTEM_DECL space_pair
- space_api( const std::wstring & ph );
- BOOST_FILESYSTEM_DECL system::error_code
- get_full_path_name_api( const std::wstring & ph, std::wstring & target );
- BOOST_FILESYSTEM_DECL time_pair
- last_write_time_api( const std::wstring & ph );
- BOOST_FILESYSTEM_DECL system::error_code
- last_write_time_api( const std::wstring & ph, std::time_t new_value );
- BOOST_FILESYSTEM_DECL system::error_code
- get_current_path_api( std::wstring & ph );
- BOOST_FILESYSTEM_DECL system::error_code
- set_current_path_api( const std::wstring & ph );
- BOOST_FILESYSTEM_DECL query_pair
- create_directory_api( const std::wstring & ph );
-# ifdef BOOST_FS_HARD_LINK
- BOOST_FILESYSTEM_DECL system::error_code
- create_hard_link_api( const std::wstring & existing_ph,
- const std::wstring & new_ph );
-# endif
- BOOST_FILESYSTEM_DECL system::error_code
- create_symlink_api( const std::wstring & to_ph,
- const std::wstring & from_ph );
- BOOST_FILESYSTEM_DECL system::error_code
- remove_api( const std::wstring & ph );
- BOOST_FILESYSTEM_DECL system::error_code
- rename_api( const std::wstring & from, const std::wstring & to );
- BOOST_FILESYSTEM_DECL system::error_code
- copy_file_api( const std::wstring & from, const std::wstring & to, bool fail_if_exists );
-
-# endif
-# endif
-
- template<class Path>
- bool remove_aux( const Path & ph, file_status f );
-
- template<class Path>
- unsigned long remove_all_aux( const Path & ph, file_status f );
-
- } // namespace detail
-
-// operations functions ----------------------------------------------------//
-
- // The non-template overloads enable automatic conversion from std and
- // C-style strings. See basic_path constructors. The enable_if for the
- // templates implements the famous "do-the-right-thing" rule.
-
-// query functions ---------------------------------------------------------//
-
- BOOST_INLINE_FS_FUNC(file_status)
- status( const Path & ph, system::error_code & ec )
- { return detail::status_api( ph.external_file_string(), ec ); }
-
- BOOST_FS_FUNC(file_status)
- status( const Path & ph )
- {
- system::error_code ec;
- file_status result( detail::status_api( ph.external_file_string(), ec ) );
- if ( ec )
- BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>(
- "boost::filesystem::status", ph, ec ) );
- return result;
- }
-
- BOOST_INLINE_FS_FUNC(file_status)
- symlink_status( const Path & ph, system::error_code & ec )
-# ifdef BOOST_WINDOWS_API
- { return detail::status_api( ph.external_file_string(), ec ); }
-# else
- { return detail::symlink_status_api( ph.external_file_string(), ec ); }
-# endif
-
- BOOST_FS_FUNC(file_status)
- symlink_status( const Path & ph )
- {
- system::error_code ec;
- file_status result( symlink_status( ph, ec ) );
- if ( ec )
- BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>(
- "boost::filesystem::symlink_status", ph, ec ) );
- return result;
- }
-
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
- inline bool symbolic_link_exists( const path & ph )
- { return is_symlink( symlink_status(ph) ); }
-# endif
-
- BOOST_FS_FUNC(bool) exists( const Path & ph )
- {
- system::error_code ec;
- file_status result( detail::status_api( ph.external_file_string(), ec ) );
- if ( ec )
- BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>(
- "boost::filesystem::exists", ph, ec ) );
- return exists( result );
- }
-
- BOOST_FS_FUNC(bool) is_directory( const Path & ph )
- {
- system::error_code ec;
- file_status result( detail::status_api( ph.external_file_string(), ec ) );
- if ( ec )
- BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>(
- "boost::filesystem::is_directory", ph, ec ) );
- return is_directory( result );
- }
-
- BOOST_FS_FUNC(bool) is_regular_file( const Path & ph )
- {
- system::error_code ec;
- file_status result( detail::status_api( ph.external_file_string(), ec ) );
- if ( ec )
- BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>(
- "boost::filesystem::is_regular_file", ph, ec ) );
- return is_regular_file( result );
- }
-
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
- BOOST_FS_FUNC(bool) is_regular( const Path & ph )
- {
- system::error_code ec;
- file_status result( detail::status_api( ph.external_file_string(), ec ) );
- if ( ec )
- BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>(
- "boost::filesystem::is_regular", ph, ec ) );
- return is_regular( result );
- }
-# endif
-
- BOOST_FS_FUNC(bool) is_other( const Path & ph )
- {
- system::error_code ec;
- file_status result( detail::status_api( ph.external_file_string(), ec ) );
- if ( ec )
- BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>(
- "boost::filesystem::is_other", ph, ec ) );
- return is_other( result );
- }
-
- BOOST_FS_FUNC(bool) is_symlink(
-# ifdef BOOST_WINDOWS_API
- const Path & )
- {
- return false;
-# else
- const Path & ph)
- {
- system::error_code ec;
- file_status result( detail::symlink_status_api( ph.external_file_string(), ec ) );
- if ( ec )
- BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>(
- "boost::filesystem::is_symlink", ph, ec ) );
- return is_symlink( result );
-# endif
- }
-
- // VC++ 7.0 and earlier has a serious namespace bug that causes a clash
- // between boost::filesystem2::is_empty and the unrelated type trait
- // boost::is_empty.
-
-# if !defined( BOOST_MSVC ) || BOOST_MSVC > 1300
- BOOST_FS_FUNC(bool) is_empty( const Path & ph )
-# else
- BOOST_FS_FUNC(bool) _is_empty( const Path & ph )
-# endif
- {
- detail::query_pair result(
- detail::is_empty_api( ph.external_file_string() ) );
- if ( result.first )
- BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>(
- "boost::filesystem::is_empty", ph, result.first ) );
- return result.second;
- }
-
- BOOST_FS_FUNC(bool) equivalent( const Path & ph1, const Path & ph2 )
- {
- detail::query_pair result( detail::equivalent_api(
- ph1.external_file_string(), ph2.external_file_string() ) );
- if ( result.first )
- BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>(
- "boost::filesystem::equivalent", ph1, ph2, result.first ) );
- return result.second;
- }
-
- BOOST_FS_FUNC(boost::uintmax_t) file_size( const Path & ph )
- {
- detail::uintmax_pair result
- ( detail::file_size_api( ph.external_file_string() ) );
- if ( result.first )
- BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>(
- "boost::filesystem::file_size", ph, result.first ) );
- return result.second;
- }
-
- BOOST_FS_FUNC(space_info) space( const Path & ph )
- {
- detail::space_pair result
- ( detail::space_api( ph.external_file_string() ) );
- if ( result.first )
- BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>(
- "boost::filesystem::space", ph, result.first ) );
- return result.second;
- }
-
- BOOST_FS_FUNC(std::time_t) last_write_time( const Path & ph )
- {
- detail::time_pair result
- ( detail::last_write_time_api( ph.external_file_string() ) );
- if ( result.first )
- BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>(
- "boost::filesystem::last_write_time", ph, result.first ) );
- return result.second;
- }
-
-
-// operations --------------------------------------------------------------//
-
- BOOST_FS_FUNC(bool) create_directory( const Path & dir_ph )
- {
- detail::query_pair result(
- detail::create_directory_api( dir_ph.external_directory_string() ) );
- if ( result.first )
- BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>(
- "boost::filesystem::create_directory",
- dir_ph, result.first ) );
- return result.second;
- }
-
-#if !defined(BOOST_WINDOWS_API) || defined(BOOST_FS_HARD_LINK)
- BOOST_FS_FUNC(void)
- create_hard_link( const Path & to_ph, const Path & from_ph )
- {
- system::error_code ec(
- detail::create_hard_link_api(
- to_ph.external_file_string(),
- from_ph.external_file_string() ) );
- if ( ec )
- BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>(
- "boost::filesystem::create_hard_link",
- to_ph, from_ph, ec ) );
- }
-
- BOOST_FS_FUNC(system::error_code)
- create_hard_link( const Path & to_ph, const Path & from_ph,
- system::error_code & ec )
- {
- ec = detail::create_hard_link_api(
- to_ph.external_file_string(),
- from_ph.external_file_string() );
- return ec;
- }
-#endif
-
- BOOST_FS_FUNC(void)
- create_symlink( const Path & to_ph, const Path & from_ph )
- {
- system::error_code ec(
- detail::create_symlink_api(
- to_ph.external_file_string(),
- from_ph.external_file_string() ) );
- if ( ec )
- BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>(
- "boost::filesystem::create_symlink",
- to_ph, from_ph, ec ) );
- }
-
- BOOST_FS_FUNC(system::error_code)
- create_symlink( const Path & to_ph, const Path & from_ph,
- system::error_code & ec )
- {
- ec = detail::create_symlink_api(
- to_ph.external_file_string(),
- from_ph.external_file_string() );
- return ec;
- }
-
- BOOST_FS_FUNC(bool) remove( const Path & ph )
- {
- system::error_code ec;
- file_status f = symlink_status( ph, ec );
- if ( ec )
- BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>(
- "boost::filesystem::remove", ph, ec ) );
- return detail::remove_aux( ph, f );
- }
-
- BOOST_FS_FUNC(unsigned long) remove_all( const Path & ph )
- {
- system::error_code ec;
- file_status f = symlink_status( ph, ec );
- if ( ec )
- BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>(
- "boost::filesystem::remove_all", ph, ec ) );
- return exists( f ) ? detail::remove_all_aux( ph, f ) : 0;
- }
-
- BOOST_FS_FUNC(void) rename( const Path & from_path, const Path & to_path )
- {
- system::error_code ec( detail::rename_api(
- from_path.external_directory_string(),
- to_path.external_directory_string() ) );
- if ( ec )
- BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>(
- "boost::filesystem::rename",
- from_path, to_path, ec ) );
- }
-
- BOOST_SCOPED_ENUM_START(copy_option)
- { fail_if_exists, overwrite_if_exists };
- BOOST_SCOPED_ENUM_END
-
- BOOST_FS_FUNC(void) copy_file( const Path & from_path, const Path & to_path,
- BOOST_SCOPED_ENUM(copy_option) option = copy_option::fail_if_exists )
- {
- system::error_code ec( detail::copy_file_api(
- from_path.external_directory_string(),
- to_path.external_directory_string(), option == copy_option::fail_if_exists ) );
- if ( ec )
- BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>(
- "boost::filesystem::copy_file",
- from_path, to_path, ec ) );
- }
-
- template< class Path >
- Path current_path()
- {
- typename Path::external_string_type ph;
- system::error_code ec( detail::get_current_path_api( ph ) );
- if ( ec )
- BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>(
- "boost::filesystem::current_path", ec ) );
- return Path( Path::traits_type::to_internal( ph ) );
- }
-
- BOOST_FS_FUNC(void) current_path( const Path & ph )
- {
- system::error_code ec( detail::set_current_path_api(
- ph.external_directory_string() ) );
- if ( ec )
- BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>(
- "boost::filesystem::current_path", ph, ec ) );
- }
-
- template< class Path >
- const Path & initial_path()
- {
- static Path init_path;
- if ( init_path.empty() ) init_path = current_path<Path>();
- return init_path;
- }
-
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
- // legacy support
- inline path current_path() // overload supports pre-i18n apps
- { return current_path<boost::filesystem2::path>(); }
- inline const path & initial_path() // overload supports pre-i18n apps
- { return initial_path<boost::filesystem2::path>(); }
-# endif
-
- BOOST_FS_FUNC(Path) system_complete( const Path & ph )
- {
-# ifdef BOOST_WINDOWS_API
- if ( ph.empty() ) return ph;
- BOOST_FS_TYPENAME Path::external_string_type sys_ph;
- system::error_code ec( detail::get_full_path_name_api( ph.external_file_string(),
- sys_ph ) );
- if ( ec )
- BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>(
- "boost::filesystem::system_complete", ph, ec ) );
- return Path( Path::traits_type::to_internal( sys_ph ) );
-# else
- return (ph.empty() || ph.is_complete())
- ? ph : current_path<Path>() / ph;
-# endif
- }
-
- BOOST_FS_FUNC(Path)
- complete( const Path & ph,
- const Path & base/* = initial_path<Path>() */)
- {
- BOOST_ASSERT( base.is_complete()
- && (ph.is_complete() || !ph.has_root_name())
- && "boost::filesystem::complete() precondition not met" );
-# ifdef BOOST_WINDOWS_PATH
- if (ph.empty() || ph.is_complete()) return ph;
- if ( !ph.has_root_name() )
- return ph.has_root_directory()
- ? Path( base.root_name() ) / ph
- : base / ph;
- return base / ph;
-# else
- return (ph.empty() || ph.is_complete()) ? ph : base / ph;
-# endif
- }
-
- // VC++ 7.1 had trouble with default arguments, so separate one argument
- // signatures are provided as workarounds; the effect is the same.
- BOOST_FS_FUNC(Path) complete( const Path & ph )
- { return complete( ph, initial_path<Path>() ); }
-
- BOOST_FS_FUNC(void)
- last_write_time( const Path & ph, const std::time_t new_time )
- {
- system::error_code ec( detail::last_write_time_api( ph.external_file_string(),
- new_time ) );
- if ( ec )
- BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>(
- "boost::filesystem::last_write_time", ph, ec ) );
- }
-
-# ifndef BOOST_FILESYSTEM2_NARROW_ONLY
-
- // "do-the-right-thing" overloads ---------------------------------------//
-
- inline file_status status( const path & ph )
- { return status<path>( ph ); }
- inline file_status status( const wpath & ph )
- { return status<wpath>( ph ); }
-
- inline file_status status( const path & ph, system::error_code & ec )
- { return status<path>( ph, ec ); }
- inline file_status status( const wpath & ph, system::error_code & ec )
- { return status<wpath>( ph, ec ); }
-
- inline file_status symlink_status( const path & ph )
- { return symlink_status<path>( ph ); }
- inline file_status symlink_status( const wpath & ph )
- { return symlink_status<wpath>( ph ); }
-
- inline file_status symlink_status( const path & ph, system::error_code & ec )
- { return symlink_status<path>( ph, ec ); }
- inline file_status symlink_status( const wpath & ph, system::error_code & ec )
- { return symlink_status<wpath>( ph, ec ); }
-
- inline bool exists( const path & ph ) { return exists<path>( ph ); }
- inline bool exists( const wpath & ph ) { return exists<wpath>( ph ); }
-
- inline bool is_directory( const path & ph )
- { return is_directory<path>( ph ); }
- inline bool is_directory( const wpath & ph )
- { return is_directory<wpath>( ph ); }
-
- inline bool is_regular_file( const path & ph )
- { return is_regular_file<path>( ph ); }
- inline bool is_regular_file( const wpath & ph )
- { return is_regular_file<wpath>( ph ); }
-
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
- inline bool is_regular( const path & ph )
- { return is_regular<path>( ph ); }
- inline bool is_regular( const wpath & ph )
- { return is_regular<wpath>( ph ); }
-# endif
-
- inline bool is_other( const path & ph )
- { return is_other<path>( ph ); }
- inline bool is_other( const wpath & ph )
- { return is_other<wpath>( ph ); }
-
- inline bool is_symlink( const path & ph )
- { return is_symlink<path>( ph ); }
- inline bool is_symlink( const wpath & ph )
- { return is_symlink<wpath>( ph ); }
-
- inline bool is_empty( const path & ph )
- { return boost::filesystem2::is_empty<path>( ph ); }
- inline bool is_empty( const wpath & ph )
- { return boost::filesystem2::is_empty<wpath>( ph ); }
-
- inline bool equivalent( const path & ph1, const path & ph2 )
- { return equivalent<path>( ph1, ph2 ); }
- inline bool equivalent( const wpath & ph1, const wpath & ph2 )
- { return equivalent<wpath>( ph1, ph2 ); }
-
- inline boost::uintmax_t file_size( const path & ph )
- { return file_size<path>( ph ); }
- inline boost::uintmax_t file_size( const wpath & ph )
- { return file_size<wpath>( ph ); }
-
- inline space_info space( const path & ph )
- { return space<path>( ph ); }
- inline space_info space( const wpath & ph )
- { return space<wpath>( ph ); }
-
- inline std::time_t last_write_time( const path & ph )
- { return last_write_time<path>( ph ); }
- inline std::time_t last_write_time( const wpath & ph )
- { return last_write_time<wpath>( ph ); }
-
- inline bool create_directory( const path & dir_ph )
- { return create_directory<path>( dir_ph ); }
- inline bool create_directory( const wpath & dir_ph )
- { return create_directory<wpath>( dir_ph ); }
-
-#if !defined(BOOST_WINDOWS_API) || defined(BOOST_FS_HARD_LINK)
- inline void create_hard_link( const path & to_ph,
- const path & from_ph )
- { return create_hard_link<path>( to_ph, from_ph ); }
- inline void create_hard_link( const wpath & to_ph,
- const wpath & from_ph )
- { return create_hard_link<wpath>( to_ph, from_ph ); }
-
- inline system::error_code create_hard_link( const path & to_ph,
- const path & from_ph, system::error_code & ec )
- { return create_hard_link<path>( to_ph, from_ph, ec ); }
- inline system::error_code create_hard_link( const wpath & to_ph,
- const wpath & from_ph, system::error_code & ec )
- { return create_hard_link<wpath>( to_ph, from_ph, ec ); }
-#endif
-
- inline void create_symlink( const path & to_ph,
- const path & from_ph )
- { return create_symlink<path>( to_ph, from_ph ); }
- inline void create_symlink( const wpath & to_ph,
- const wpath & from_ph )
- { return create_symlink<wpath>( to_ph, from_ph ); }
-
- inline system::error_code create_symlink( const path & to_ph,
- const path & from_ph, system::error_code & ec )
- { return create_symlink<path>( to_ph, from_ph, ec ); }
- inline system::error_code create_symlink( const wpath & to_ph,
- const wpath & from_ph, system::error_code & ec )
- { return create_symlink<wpath>( to_ph, from_ph, ec ); }
-
- inline bool remove( const path & ph )
- { return remove<path>( ph ); }
- inline bool remove( const wpath & ph )
- { return remove<wpath>( ph ); }
-
- inline unsigned long remove_all( const path & ph )
- { return remove_all<path>( ph ); }
- inline unsigned long remove_all( const wpath & ph )
- { return remove_all<wpath>( ph ); }
-
- inline void rename( const path & from_path, const path & to_path )
- { return rename<path>( from_path, to_path ); }
- inline void rename( const wpath & from_path, const wpath & to_path )
- { return rename<wpath>( from_path, to_path ); }
-
- inline void copy_file( const path & from_path, const path & to_path )
- { return copy_file<path>( from_path, to_path ); }
- inline void copy_file( const wpath & from_path, const wpath & to_path )
- { return copy_file<wpath>( from_path, to_path ); }
-
- inline path system_complete( const path & ph )
- { return system_complete<path>( ph ); }
- inline wpath system_complete( const wpath & ph )
- { return system_complete<wpath>( ph ); }
-
- inline path complete( const path & ph,
- const path & base/* = initial_path<path>()*/ )
- { return complete<path>( ph, base ); }
- inline wpath complete( const wpath & ph,
- const wpath & base/* = initial_path<wpath>()*/ )
- { return complete<wpath>( ph, base ); }
-
- inline path complete( const path & ph )
- { return complete<path>( ph, initial_path<path>() ); }
- inline wpath complete( const wpath & ph )
- { return complete<wpath>( ph, initial_path<wpath>() ); }
-
- inline void last_write_time( const path & ph, const std::time_t new_time )
- { last_write_time<path>( ph, new_time ); }
- inline void last_write_time( const wpath & ph, const std::time_t new_time )
- { last_write_time<wpath>( ph, new_time ); }
-
- inline void current_path( const path & ph )
- { current_path<path>( ph ); }
- inline void current_path( const wpath & ph )
- { current_path<wpath>( ph ); }
-
-# endif // ifndef BOOST_FILESYSTEM2_NARROW_ONLY
-
- namespace detail
- {
- template<class Path>
- bool remove_aux( const Path & ph, file_status f )
- {
- if ( exists( f ) )
- {
- system::error_code ec = remove_api( ph.external_file_string() );
- if ( ec )
- BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>(
- "boost::filesystem::remove", ph, ec ) );
- return true;
- }
- return false;
- }
-
- template<class Path>
- unsigned long remove_all_aux( const Path & ph, file_status f )
- {
- static const boost::filesystem2::basic_directory_iterator<Path> end_itr;
- unsigned long count = 1;
- if ( !boost::filesystem2::is_symlink( f ) // don't recurse symbolic links
- && boost::filesystem2::is_directory( f ) )
- {
- for ( boost::filesystem2::basic_directory_iterator<Path> itr( ph );
- itr != end_itr; ++itr )
- {
- boost::system::error_code ec;
- boost::filesystem2::file_status fn = boost::filesystem2::symlink_status( itr->path(), ec );
- if ( ec )
- BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>(
- "boost::filesystem:remove_all", ph, ec ) );
- count += remove_all_aux( itr->path(), fn );
- }
- }
- remove_aux( ph, f );
- return count;
- }
-
-// test helper -------------------------------------------------------------//
-
- // not part of the documented interface because false positives are possible;
- // there is no law that says that an OS that has large stat.st_size
- // actually supports large file sizes.
- BOOST_FILESYSTEM_DECL bool possible_large_file_size_support();
-
-// directory_iterator helpers ----------------------------------------------//
-
-// forwarding functions avoid need for BOOST_FILESYSTEM_DECL for class
-// basic_directory_iterator, and so avoid iterator_facade DLL template
-// problems. They also overload to the proper external path character type.
-
- BOOST_FILESYSTEM_DECL system::error_code
- dir_itr_first( void *& handle,
-#if defined(BOOST_POSIX_API)
- void *& buffer,
-#endif
- const std::string & dir_path,
- std::string & target, file_status & fs, file_status & symlink_fs );
- // eof: return==0 && handle==0
-
- BOOST_FILESYSTEM_DECL system::error_code
- dir_itr_increment( void *& handle,
-#if defined(BOOST_POSIX_API)
- void *& buffer,
-#endif
- std::string & target, file_status & fs, file_status & symlink_fs );
- // eof: return==0 && handle==0
-
- BOOST_FILESYSTEM_DECL system::error_code
- dir_itr_close( void *& handle
-#if defined(BOOST_POSIX_API)
- , void *& buffer
-#endif
- );
- // Effects: none if handle==0, otherwise close handle, set handle=0
-
-# if defined(BOOST_WINDOWS_API) && !defined(BOOST_FILESYSTEM2_NARROW_ONLY)
- BOOST_FILESYSTEM_DECL system::error_code
- dir_itr_first( void *& handle, const std::wstring & ph,
- std::wstring & target, file_status & fs, file_status & symlink_fs );
- BOOST_FILESYSTEM_DECL system::error_code
- dir_itr_increment( void *& handle, std::wstring & target,
- file_status & fs, file_status & symlink_fs );
-# endif
-
- template< class Path >
- class dir_itr_imp
- {
- public:
- basic_directory_entry<Path> m_directory_entry;
- void * m_handle;
-# ifdef BOOST_POSIX_API
- void * m_buffer; // see dir_itr_increment implementation
-# endif
- dir_itr_imp() : m_handle(0)
-# ifdef BOOST_POSIX_API
- , m_buffer(0)
-# endif
- {}
-
- ~dir_itr_imp() { dir_itr_close( m_handle
-#if defined(BOOST_POSIX_API)
- , m_buffer
-#endif
- ); }
- };
-
- BOOST_FILESYSTEM_DECL system::error_code not_found_error();
-
- } // namespace detail
-
-// basic_directory_iterator ------------------------------------------------//
-
- template< class Path >
- class basic_directory_iterator
- : public boost::iterator_facade<
- basic_directory_iterator<Path>,
- basic_directory_entry<Path>,
- boost::single_pass_traversal_tag >
- {
- public:
- typedef Path path_type;
-
- basic_directory_iterator(){} // creates the "end" iterator
-
- explicit basic_directory_iterator( const Path & dir_path );
- basic_directory_iterator( const Path & dir_path, system::error_code & ec );
-
- private:
-
- // shared_ptr provides shallow-copy semantics required for InputIterators.
- // m_imp.get()==0 indicates the end iterator.
- boost::shared_ptr< detail::dir_itr_imp< Path > > m_imp;
-
- friend class boost::iterator_core_access;
-
- typename boost::iterator_facade<
- basic_directory_iterator<Path>,
- basic_directory_entry<Path>,
- boost::single_pass_traversal_tag >::reference dereference() const
- {
- BOOST_ASSERT( m_imp.get() && "attempt to dereference end iterator" );
- return m_imp->m_directory_entry;
- }
-
- void increment();
-
- bool equal( const basic_directory_iterator & rhs ) const
- { return m_imp == rhs.m_imp; }
-
- system::error_code m_init( const Path & dir_path );
- };
-
- typedef basic_directory_iterator< path > directory_iterator;
-# ifndef BOOST_FILESYSTEM2_NARROW_ONLY
- typedef basic_directory_iterator< wpath > wdirectory_iterator;
-# endif
-
- // basic_directory_iterator implementation ---------------------------//
-
- template<class Path>
- system::error_code basic_directory_iterator<Path>::m_init(
- const Path & dir_path )
- {
- if ( dir_path.empty() )
- {
- m_imp.reset();
- return detail::not_found_error();
- }
- typename Path::external_string_type name;
- file_status fs, symlink_fs;
- system::error_code ec( detail::dir_itr_first( m_imp->m_handle,
-#if defined(BOOST_POSIX_API)
- m_imp->m_buffer,
-#endif
- dir_path.external_directory_string(),
- name, fs, symlink_fs ) );
-
- if ( ec )
- {
- m_imp.reset();
- return ec;
- }
-
- if ( m_imp->m_handle == 0 ) m_imp.reset(); // eof, so make end iterator
- else // not eof
- {
- m_imp->m_directory_entry.assign( dir_path
- / Path::traits_type::to_internal( name ), fs, symlink_fs );
- if ( name[0] == dot<Path>::value // dot or dot-dot
- && (name.size() == 1
- || (name[1] == dot<Path>::value
- && name.size() == 2)) )
- { increment(); }
- }
- return boost::system::error_code();
- }
-
- template<class Path>
- basic_directory_iterator<Path>::basic_directory_iterator(
- const Path & dir_path )
- : m_imp( new detail::dir_itr_imp<Path> )
- {
- system::error_code ec( m_init(dir_path) );
- if ( ec )
- {
- BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>(
- "boost::filesystem::basic_directory_iterator constructor",
- dir_path, ec ) );
- }
- }
-
- template<class Path>
- basic_directory_iterator<Path>::basic_directory_iterator(
- const Path & dir_path, system::error_code & ec )
- : m_imp( new detail::dir_itr_imp<Path> )
- {
- ec = m_init(dir_path);
- }
-
- template<class Path>
- void basic_directory_iterator<Path>::increment()
- {
- BOOST_ASSERT( m_imp.get() && "attempt to increment end iterator" );
- BOOST_ASSERT( m_imp->m_handle != 0 && "internal program error" );
-
- typename Path::external_string_type name;
- file_status fs, symlink_fs;
- system::error_code ec;
-
- for (;;)
- {
- ec = detail::dir_itr_increment( m_imp->m_handle,
-#if defined(BOOST_POSIX_API)
- m_imp->m_buffer,
-#endif
- name, fs, symlink_fs );
- if ( ec )
- {
- BOOST_FILESYSTEM_THROW( basic_filesystem_error<Path>(
- "boost::filesystem::basic_directory_iterator increment",
- m_imp->m_directory_entry.path().parent_path(), ec ) );
- }
- if ( m_imp->m_handle == 0 ) { m_imp.reset(); return; } // eof, make end
- if ( !(name[0] == dot<Path>::value // !(dot or dot-dot)
- && (name.size() == 1
- || (name[1] == dot<Path>::value
- && name.size() == 2))) )
- {
- m_imp->m_directory_entry.replace_filename(
- Path::traits_type::to_internal( name ), fs, symlink_fs );
- return;
- }
- }
- }
-
- // basic_directory_entry -----------------------------------------------//
-
- template<class Path>
- class basic_directory_entry
- {
- public:
- typedef Path path_type;
- typedef typename Path::string_type string_type;
-
- // compiler generated copy-ctor, copy assignment, and destructor apply
-
- basic_directory_entry() {}
- explicit basic_directory_entry( const path_type & p,
- file_status st = file_status(), file_status symlink_st=file_status() )
- : m_path(p), m_status(st), m_symlink_status(symlink_st)
- {}
-
- void assign( const path_type & p,
- file_status st, file_status symlink_st )
- { m_path = p; m_status = st; m_symlink_status = symlink_st; }
-
- void replace_filename( const string_type & s,
- file_status st, file_status symlink_st )
- {
- m_path.remove_filename();
- m_path /= s;
- m_status = st;
- m_symlink_status = symlink_st;
- }
-
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
- void replace_leaf( const string_type & s,
- file_status st, file_status symlink_st )
- { replace_filename( s, st, symlink_st ); }
-# endif
-
- const Path & path() const { return m_path; }
- file_status status() const;
- file_status status( system::error_code & ec ) const;
- file_status symlink_status() const;
- file_status symlink_status( system::error_code & ec ) const;
-
- // conversion simplifies the most common use of basic_directory_entry
- operator const path_type &() const { return m_path; }
-
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
- // deprecated functions preserve common use cases in legacy code
- typename Path::string_type filename() const
- {
- return path().filename();
- }
- typename Path::string_type leaf() const
- {
- return path().filename();
- }
- typename Path::string_type string() const
- {
- return path().string();
- }
-# endif
-
- private:
- path_type m_path;
- mutable file_status m_status; // stat()-like
- mutable file_status m_symlink_status; // lstat()-like
- // note: m_symlink_status is not used by Windows implementation
-
- }; // basic_directory_status
-
- typedef basic_directory_entry<path> directory_entry;
-# ifndef BOOST_FILESYSTEM2_NARROW_ONLY
- typedef basic_directory_entry<wpath> wdirectory_entry;
-# endif
-
- // basic_directory_entry implementation --------------------------------//
-
- template<class Path>
- file_status
- basic_directory_entry<Path>::status() const
- {
- if ( !status_known( m_status ) )
- {
-# ifndef BOOST_WINDOWS_API
- if ( status_known( m_symlink_status )
- && !is_symlink( m_symlink_status ) )
- { m_status = m_symlink_status; }
- else { m_status = boost::filesystem2::status( m_path ); }
-# else
- m_status = boost::filesystem2::status( m_path );
-# endif
- }
- return m_status;
- }
-
- template<class Path>
- file_status
- basic_directory_entry<Path>::status( system::error_code & ec ) const
- {
- if ( !status_known( m_status ) )
- {
-# ifndef BOOST_WINDOWS_API
- if ( status_known( m_symlink_status )
- && !is_symlink( m_symlink_status ) )
- { ec = boost::system::error_code();; m_status = m_symlink_status; }
- else { m_status = boost::filesystem2::status( m_path, ec ); }
-# else
- m_status = boost::filesystem2::status( m_path, ec );
-# endif
- }
- else ec = boost::system::error_code();;
- return m_status;
- }
-
- template<class Path>
- file_status
- basic_directory_entry<Path>::symlink_status() const
- {
-# ifndef BOOST_WINDOWS_API
- if ( !status_known( m_symlink_status ) )
- { m_symlink_status = boost::filesystem2::symlink_status( m_path ); }
- return m_symlink_status;
-# else
- return status();
-# endif
- }
-
- template<class Path>
- file_status
- basic_directory_entry<Path>::symlink_status( system::error_code & ec ) const
- {
-# ifndef BOOST_WINDOWS_API
- if ( !status_known( m_symlink_status ) )
- { m_symlink_status = boost::filesystem2::symlink_status( m_path, ec ); }
- else ec = boost::system::error_code();;
- return m_symlink_status;
-# else
- return status( ec );
-# endif
- }
- } // namespace filesystem2
-} // namespace boost
-
-#undef BOOST_FS_FUNC
-
-//----------------------------------------------------------------------------//
-
-namespace boost
-{
- namespace filesystem
- {
- using filesystem2::basic_directory_entry;
- using filesystem2::basic_directory_iterator;
- using filesystem2::block_file;
- using filesystem2::character_file;
- using filesystem2::complete;
- using filesystem2::copy_file;
- using filesystem2::copy_option;
- using filesystem2::create_directory;
-# if !defined(BOOST_WINDOWS_API) || defined(BOOST_FS_HARD_LINK)
- using filesystem2::create_hard_link;
-# endif
- using filesystem2::create_symlink;
- using filesystem2::current_path;
- using filesystem2::directory_entry;
- using filesystem2::directory_file;
- using filesystem2::directory_iterator;
- using filesystem2::equivalent;
- using filesystem2::exists;
- using filesystem2::fifo_file;
- using filesystem2::file_not_found;
- using filesystem2::file_size;
- using filesystem2::file_status;
- using filesystem2::file_type;
- using filesystem2::initial_path;
- using filesystem2::is_directory;
- using filesystem2::is_directory;
- using filesystem2::is_empty;
- using filesystem2::is_other;
- using filesystem2::is_regular_file;
- using filesystem2::is_symlink;
- using filesystem2::last_write_time;
- using filesystem2::regular_file;
- using filesystem2::remove;
- using filesystem2::remove_all;
- using filesystem2::rename;
- using filesystem2::socket_file;
- using filesystem2::space;
- using filesystem2::space_info;
- using filesystem2::status;
- using filesystem2::status_known;
- using filesystem2::symlink_file;
- using filesystem2::symlink_status;
- using filesystem2::system_complete;
- using filesystem2::type_unknown;
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
- using filesystem2::is_regular;
- using filesystem2::symbolic_link_exists;
-# endif
-# ifndef BOOST_FILESYSTEM2_NARROW_ONLY
- using filesystem2::wdirectory_iterator;
- using filesystem2::wdirectory_entry;
-# endif
- namespace detail
- {
- using filesystem2::detail::not_found_error;
- using filesystem2::detail::possible_large_file_size_support;
- }
- }
-}
-
-#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
-#endif // BOOST_FILESYSTEM2_OPERATIONS_HPP
diff --git a/boost/filesystem/v2/path.hpp b/boost/filesystem/v2/path.hpp
deleted file mode 100644
index 615b89cd31..0000000000
--- a/boost/filesystem/v2/path.hpp
+++ /dev/null
@@ -1,1571 +0,0 @@
-// boost/filesystem/path.hpp -----------------------------------------------//
-
-// Copyright Beman Dawes 2002-2005
-// Copyright Vladimir Prus 2002
-
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-// See library home page at http://www.boost.org/libs/filesystem
-
-// basic_path's stem(), extension(), and replace_extension() are based on
-// basename(), extension(), and change_extension() from the original
-// filesystem/convenience.hpp header by Vladimir Prus.
-
-//----------------------------------------------------------------------------//
-
-#ifndef BOOST_FILESYSTEM2_PATH_HPP
-#define BOOST_FILESYSTEM2_PATH_HPP
-
-#include <boost/filesystem/v2/config.hpp>
-#include <boost/system/system_error.hpp>
-#include <boost/iterator/iterator_facade.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/type_traits/is_same.hpp>
-#include <boost/static_assert.hpp>
-#include <boost/assert.hpp>
-
-#include <string>
-#include <algorithm> // for lexicographical_compare
-#include <iosfwd> // needed by basic_path inserter and extractor
-#include <stdexcept>
-
-# ifndef BOOST_FILESYSTEM2_NARROW_ONLY
-# include <locale>
-# endif
-
-#include <boost/config/abi_prefix.hpp> // must be the last #include
-
-namespace boost
-{
- namespace BOOST_FILESYSTEM2_NAMESPACE
- {
- template<class String, class Traits> class basic_path;
-
- struct path_traits;
- typedef basic_path< std::string, path_traits > path;
-
- struct path_traits
- {
- typedef std::string internal_string_type;
- typedef std::string external_string_type;
- static external_string_type to_external( const path &,
- const internal_string_type & src ) { return src; }
- static internal_string_type to_internal(
- const external_string_type & src ) { return src; }
- };
-
-# ifndef BOOST_FILESYSTEM2_NARROW_ONLY
-
- struct BOOST_FILESYSTEM_DECL wpath_traits;
-
- typedef basic_path< std::wstring, wpath_traits > wpath;
-
- struct BOOST_FILESYSTEM_DECL wpath_traits
- {
- typedef std::wstring internal_string_type;
-# ifdef BOOST_WINDOWS_API
- typedef std::wstring external_string_type;
- static external_string_type to_external( const wpath &,
- const internal_string_type & src ) { return src; }
- static internal_string_type to_internal(
- const external_string_type & src ) { return src; }
-# else
- typedef std::string external_string_type;
- static external_string_type to_external( const wpath & ph,
- const internal_string_type & src );
- static internal_string_type to_internal(
- const external_string_type & src );
-# endif
- static void imbue( const std::locale & loc );
- static bool imbue( const std::locale & loc, const std::nothrow_t & );
- };
-
-# endif // ifndef BOOST_FILESYSTEM2_NARROW_ONLY
-
- // path traits ---------------------------------------------------------//
-
- template<class Path> struct is_basic_path
- { BOOST_STATIC_CONSTANT( bool, value = false ); };
- template<> struct is_basic_path<path>
- { BOOST_STATIC_CONSTANT( bool, value = true ); };
-# ifndef BOOST_FILESYSTEM2_NARROW_ONLY
- template<> struct is_basic_path<wpath>
- { BOOST_STATIC_CONSTANT( bool, value = true ); };
-# endif
-
- // These only have to be specialized if Path::string_type::value_type
- // is not convertible from char, although specializations may eliminate
- // compiler warnings. See ticket 2543.
- template<class Path> struct slash
- { BOOST_STATIC_CONSTANT( char, value = '/' ); };
-
- template<class Path> struct dot
- { BOOST_STATIC_CONSTANT( char, value = '.' ); };
-
- template<class Path> struct colon
- { BOOST_STATIC_CONSTANT( char, value = ':' ); };
-
-# ifndef BOOST_FILESYSTEM2_NARROW_ONLY
- template<> struct slash<wpath>
- { BOOST_STATIC_CONSTANT( wchar_t, value = L'/' ); };
- template<> struct dot<wpath>
- { BOOST_STATIC_CONSTANT( wchar_t, value = L'.' ); };
- template<> struct colon<wpath>
- { BOOST_STATIC_CONSTANT( wchar_t, value = L':' ); };
-# endif
-
-# ifdef BOOST_WINDOWS_PATH
- template<class Path> struct path_alt_separator
- { BOOST_STATIC_CONSTANT( char, value = '\\' ); };
-# ifndef BOOST_FILESYSTEM2_NARROW_ONLY
- template<> struct path_alt_separator<wpath>
- { BOOST_STATIC_CONSTANT( wchar_t, value = L'\\' ); };
-# endif
-# endif
-
- // workaround for VC++ 7.0 and earlier issues with nested classes
- namespace detail
- {
- template<class Path>
- class iterator_helper
- {
- public:
- typedef typename Path::iterator iterator;
- static void do_increment( iterator & ph );
- static void do_decrement( iterator & ph );
- };
- }
-
- // basic_path ----------------------------------------------------------//
-
- template<class String, class Traits>
- class basic_path
- {
- // invariant: m_path valid according to the portable generic path grammar
-
- // validate template arguments
-// TODO: get these working
-// BOOST_STATIC_ASSERT( ::boost::is_same<String,typename Traits::internal_string_type>::value );
-// BOOST_STATIC_ASSERT( ::boost::is_same<typename Traits::external_string_type,std::string>::value || ::boost::is_same<typename Traits::external_string_type,std::wstring>::value );
-
- public:
- // compiler generates copy constructor and copy assignment
-
- typedef basic_path<String, Traits> path_type;
- typedef String string_type;
- typedef typename String::value_type value_type;
- typedef Traits traits_type;
- typedef typename Traits::external_string_type external_string_type;
-
- // constructors/destructor
- basic_path() {}
- basic_path( const string_type & s ) { operator/=( s ); }
- basic_path( const value_type * s ) { operator/=( s ); }
-# ifndef BOOST_NO_MEMBER_TEMPLATES
- template <class InputIterator>
- basic_path( InputIterator first, InputIterator last )
- { append( first, last ); }
-# endif
- ~basic_path() {}
-
- // assignments
- basic_path & operator=( const string_type & s )
- {
-# if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, >= 310)
- m_path.clear();
-# else
- m_path.erase( m_path.begin(), m_path.end() );
-# endif
- operator/=( s );
- return *this;
- }
- basic_path & operator=( const value_type * s )
- {
-# if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, >= 310)
- m_path.clear();
-# else
- m_path.erase( m_path.begin(), m_path.end() );
-# endif
- operator/=( s );
- return *this;
- }
-# ifndef BOOST_NO_MEMBER_TEMPLATES
- template <class InputIterator>
- basic_path & assign( InputIterator first, InputIterator last )
- { m_path.clear(); append( first, last ); return *this; }
-# endif
-
- // modifiers
- basic_path & operator/=( const basic_path & rhs ) { return operator /=( rhs.string().c_str() ); }
- basic_path & operator/=( const string_type & rhs ) { return operator /=( rhs.c_str() ); }
- basic_path & operator/=( const value_type * s );
-# ifndef BOOST_NO_MEMBER_TEMPLATES
- template <class InputIterator>
- basic_path & append( InputIterator first, InputIterator last );
-# endif
-
- void clear()
- {
-# if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, >= 310)
- m_path.clear();
-# else
- m_path.erase( m_path.begin(), m_path.end() );
-# endif
- }
-
- void swap( basic_path & rhs )
- {
- m_path.swap( rhs.m_path );
-# ifdef BOOST_CYGWIN_PATH
- std::swap( m_cygwin_root, rhs.m_cygwin_root );
-# endif
- }
-
- basic_path & remove_filename();
- basic_path & replace_extension( const string_type & new_extension = string_type() );
-
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
- basic_path & remove_leaf() { return remove_filename(); }
-# endif
-
- // observers
- const string_type & string() const { return m_path; }
- const string_type file_string() const;
- const string_type directory_string() const { return file_string(); }
-
- const external_string_type external_file_string() const { return Traits::to_external( *this, file_string() ); }
- const external_string_type external_directory_string() const { return Traits::to_external( *this, directory_string() ); }
-
- basic_path root_path() const;
- string_type root_name() const;
- string_type root_directory() const;
- basic_path relative_path() const;
- basic_path parent_path() const;
- string_type filename() const;
- string_type stem() const;
- string_type extension() const;
-
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
- string_type leaf() const { return filename(); }
- basic_path branch_path() const { return parent_path(); }
- bool has_leaf() const { return !m_path.empty(); }
- bool has_branch_path() const { return !parent_path().empty(); }
-# endif
-
- bool empty() const { return m_path.empty(); } // name consistent with std containers
- bool is_complete() const;
- bool has_root_path() const;
- bool has_root_name() const;
- bool has_root_directory() const;
- bool has_relative_path() const { return !relative_path().empty(); }
- bool has_filename() const { return !m_path.empty(); }
- bool has_parent_path() const { return !parent_path().empty(); }
-
- // iterators
- class iterator : public boost::iterator_facade<
- iterator,
- string_type const,
- boost::bidirectional_traversal_tag >
- {
- private:
- friend class boost::iterator_core_access;
- friend class boost::BOOST_FILESYSTEM2_NAMESPACE::basic_path<String, Traits>;
-
- const string_type & dereference() const
- { return m_name; }
- bool equal( const iterator & rhs ) const
- { return m_path_ptr == rhs.m_path_ptr && m_pos == rhs.m_pos; }
-
- friend class boost::BOOST_FILESYSTEM2_NAMESPACE::detail::iterator_helper<path_type>;
-
- void increment()
- {
- boost::BOOST_FILESYSTEM2_NAMESPACE::detail::iterator_helper<path_type>::do_increment(
- *this );
- }
- void decrement()
- {
- boost::BOOST_FILESYSTEM2_NAMESPACE::detail::iterator_helper<path_type>::do_decrement(
- *this );
- }
-
- string_type m_name; // current element
- const basic_path * m_path_ptr; // path being iterated over
- typename string_type::size_type m_pos; // position of name in
- // path_ptr->string(). The
- // end() iterator is indicated by
- // pos == path_ptr->m_path.size()
- }; // iterator
-
- typedef iterator const_iterator;
-
- iterator begin() const;
- iterator end() const;
-
- private:
- // Note: This is an implementation for POSIX and Windows, where there
- // are only minor differences between generic and native path grammars.
- // Private members might be quite different in other implementations,
- // particularly where there were wide differences between portable and
- // native path formats, or between file_string() and
- // directory_string() formats, or simply that the implementation
- // was willing expend additional memory to achieve greater speed for
- // some operations at the expense of other operations.
-
- string_type m_path; // invariant: portable path grammar
- // on Windows, backslashes converted to slashes
-
-# ifdef BOOST_CYGWIN_PATH
- bool m_cygwin_root; // if present, m_path[0] was slash. note: initialization
- // done by append
-# endif
-
- void m_append_separator_if_needed();
- void m_append( value_type value ); // converts Windows alt_separator
-
- // Was qualified; como433beta8 reports:
- // warning #427-D: qualified name is not allowed in member declaration
- friend class iterator;
- friend class boost::BOOST_FILESYSTEM2_NAMESPACE::detail::iterator_helper<path_type>;
-
- // Deprecated features ease transition for existing code. Don't use these
- // in new code.
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
- public:
- typedef bool (*name_check)( const std::string & name );
- basic_path( const string_type & str, name_check ) { operator/=( str ); }
- basic_path( const typename string_type::value_type * s, name_check )
- { operator/=( s );}
- string_type native_file_string() const { return file_string(); }
- string_type native_directory_string() const { return directory_string(); }
- static bool default_name_check_writable() { return false; }
- static void default_name_check( name_check ) {}
- static name_check default_name_check() { return 0; }
- basic_path & canonize();
- basic_path & normalize();
-# endif
- };
-
- // basic_path non-member functions ---------------------------------------//
-
- template< class String, class Traits >
- inline void swap( basic_path<String, Traits> & lhs,
- basic_path<String, Traits> & rhs ) { lhs.swap( rhs ); }
-
- template< class String, class Traits >
- bool operator<( const basic_path<String, Traits> & lhs, const basic_path<String, Traits> & rhs )
- {
- return std::lexicographical_compare(
- lhs.begin(), lhs.end(), rhs.begin(), rhs.end() );
- }
-
- template< class String, class Traits >
- bool operator<( const typename basic_path<String, Traits>::string_type::value_type * lhs,
- const basic_path<String, Traits> & rhs )
- {
- basic_path<String, Traits> tmp( lhs );
- return std::lexicographical_compare(
- tmp.begin(), tmp.end(), rhs.begin(), rhs.end() );
- }
-
- template< class String, class Traits >
- bool operator<( const typename basic_path<String, Traits>::string_type & lhs,
- const basic_path<String, Traits> & rhs )
- {
- basic_path<String, Traits> tmp( lhs );
- return std::lexicographical_compare(
- tmp.begin(), tmp.end(), rhs.begin(), rhs.end() );
- }
-
- template< class String, class Traits >
- bool operator<( const basic_path<String, Traits> & lhs,
- const typename basic_path<String, Traits>::string_type::value_type * rhs )
- {
- basic_path<String, Traits> tmp( rhs );
- return std::lexicographical_compare(
- lhs.begin(), lhs.end(), tmp.begin(), tmp.end() );
- }
-
- template< class String, class Traits >
- bool operator<( const basic_path<String, Traits> & lhs,
- const typename basic_path<String, Traits>::string_type & rhs )
- {
- basic_path<String, Traits> tmp( rhs );
- return std::lexicographical_compare(
- lhs.begin(), lhs.end(), tmp.begin(), tmp.end() );
- }
-
- // operator == uses hand-written compare rather than !(lhs < rhs) && !(rhs < lhs)
- // because the result is the same yet the direct compare is much more efficient
- // than lexicographical_compare, which would also be called twice.
-
- template< class String, class Traits >
- inline bool operator==( const basic_path<String, Traits> & lhs,
- const typename basic_path<String, Traits>::string_type::value_type * rhs )
- {
- typedef typename
- boost::BOOST_FILESYSTEM2_NAMESPACE::basic_path<String, Traits> path_type;
- const typename path_type::string_type::value_type * l (lhs.string().c_str());
- while ( (*l == *rhs
-# ifdef BOOST_WINDOWS_PATH
- || (*l == path_alt_separator<path_type>::value && *rhs == slash<path_type>::value)
- || (*l == slash<path_type>::value && *rhs == path_alt_separator<path_type>::value)
-# endif
- ) && *l ) { ++l; ++rhs; }
- return *l == *rhs
-# ifdef BOOST_WINDOWS_PATH
- || (*l == path_alt_separator<path_type>::value && *rhs == slash<path_type>::value)
- || (*l == slash<path_type>::value && *rhs == path_alt_separator<path_type>::value)
-# endif
- ;
- }
-
- template< class String, class Traits >
- inline bool operator==( const basic_path<String, Traits> & lhs,
- const basic_path<String, Traits> & rhs )
- {
- return lhs == rhs.string().c_str();
- }
-
- template< class String, class Traits >
- inline bool operator==( const typename basic_path<String, Traits>::string_type::value_type * lhs,
- const basic_path<String, Traits> & rhs )
- {
- return rhs == lhs;
- }
-
- template< class String, class Traits >
- inline bool operator==( const typename basic_path<String, Traits>::string_type & lhs,
- const basic_path<String, Traits> & rhs )
- {
- return rhs == lhs.c_str();
- }
-
- template< class String, class Traits >
- inline bool operator==( const basic_path<String, Traits> & lhs,
- const typename basic_path<String, Traits>::string_type & rhs )
- {
- return lhs == rhs.c_str();
- }
-
- template< class String, class Traits >
- inline bool operator!=( const basic_path<String, Traits> & lhs,
- const basic_path<String, Traits> & rhs )
- { return !(lhs == rhs); }
-
- template< class String, class Traits >
- inline bool operator!=( const typename basic_path<String,
- Traits>::string_type::value_type * lhs,
- const basic_path<String, Traits> & rhs )
- { return !(lhs == rhs); }
-
- template< class String, class Traits >
- inline bool operator!=( const typename basic_path<String, Traits>::string_type & lhs,
- const basic_path<String, Traits> & rhs )
- { return !(lhs == rhs); }
-
- template< class String, class Traits >
- inline bool operator!=( const basic_path<String, Traits> & lhs,
- const typename basic_path<String, Traits>::string_type::value_type * rhs )
- { return !(lhs == rhs); }
-
- template< class String, class Traits >
- inline bool operator!=( const basic_path<String, Traits> & lhs,
- const typename basic_path<String, Traits>::string_type & rhs )
- { return !(lhs == rhs); }
-
- template< class String, class Traits >
- inline bool operator>( const basic_path<String, Traits> & lhs, const basic_path<String, Traits> & rhs ) { return rhs < lhs; }
-
- template< class String, class Traits >
- inline bool operator>( const typename basic_path<String, Traits>::string_type::value_type * lhs,
- const basic_path<String, Traits> & rhs ) { return rhs < basic_path<String, Traits>(lhs); }
-
- template< class String, class Traits >
- inline bool operator>( const typename basic_path<String, Traits>::string_type & lhs,
- const basic_path<String, Traits> & rhs ) { return rhs < basic_path<String, Traits>(lhs); }
-
- template< class String, class Traits >
- inline bool operator>( const basic_path<String, Traits> & lhs,
- const typename basic_path<String, Traits>::string_type::value_type * rhs )
- { return basic_path<String, Traits>(rhs) < lhs; }
-
- template< class String, class Traits >
- inline bool operator>( const basic_path<String, Traits> & lhs,
- const typename basic_path<String, Traits>::string_type & rhs )
- { return basic_path<String, Traits>(rhs) < lhs; }
-
- template< class String, class Traits >
- inline bool operator<=( const basic_path<String, Traits> & lhs, const basic_path<String, Traits> & rhs ) { return !(rhs < lhs); }
-
- template< class String, class Traits >
- inline bool operator<=( const typename basic_path<String, Traits>::string_type::value_type * lhs,
- const basic_path<String, Traits> & rhs ) { return !(rhs < basic_path<String, Traits>(lhs)); }
-
- template< class String, class Traits >
- inline bool operator<=( const typename basic_path<String, Traits>::string_type & lhs,
- const basic_path<String, Traits> & rhs ) { return !(rhs < basic_path<String, Traits>(lhs)); }
-
- template< class String, class Traits >
- inline bool operator<=( const basic_path<String, Traits> & lhs,
- const typename basic_path<String, Traits>::string_type::value_type * rhs )
- { return !(basic_path<String, Traits>(rhs) < lhs); }
-
- template< class String, class Traits >
- inline bool operator<=( const basic_path<String, Traits> & lhs,
- const typename basic_path<String, Traits>::string_type & rhs )
- { return !(basic_path<String, Traits>(rhs) < lhs); }
-
- template< class String, class Traits >
- inline bool operator>=( const basic_path<String, Traits> & lhs, const basic_path<String, Traits> & rhs ) { return !(lhs < rhs); }
-
- template< class String, class Traits >
- inline bool operator>=( const typename basic_path<String, Traits>::string_type::value_type * lhs,
- const basic_path<String, Traits> & rhs ) { return !(lhs < basic_path<String, Traits>(rhs)); }
-
- template< class String, class Traits >
- inline bool operator>=( const typename basic_path<String, Traits>::string_type & lhs,
- const basic_path<String, Traits> & rhs ) { return !(lhs < basic_path<String, Traits>(rhs)); }
-
- template< class String, class Traits >
- inline bool operator>=( const basic_path<String, Traits> & lhs,
- const typename basic_path<String, Traits>::string_type::value_type * rhs )
- { return !(basic_path<String, Traits>(lhs) < rhs); }
-
- template< class String, class Traits >
- inline bool operator>=( const basic_path<String, Traits> & lhs,
- const typename basic_path<String, Traits>::string_type & rhs )
- { return !(basic_path<String, Traits>(lhs) < rhs); }
-
- // operator /
-
- template< class String, class Traits >
- inline basic_path<String, Traits> operator/(
- const basic_path<String, Traits> & lhs,
- const basic_path<String, Traits> & rhs )
- { return basic_path<String, Traits>( lhs ) /= rhs; }
-
- template< class String, class Traits >
- inline basic_path<String, Traits> operator/(
- const basic_path<String, Traits> & lhs,
- const typename String::value_type * rhs )
- { return basic_path<String, Traits>( lhs ) /=
- basic_path<String, Traits>( rhs ); }
-
- template< class String, class Traits >
- inline basic_path<String, Traits> operator/(
- const basic_path<String, Traits> & lhs, const String & rhs )
- { return basic_path<String, Traits>( lhs ) /=
- basic_path<String, Traits>( rhs ); }
-
- template< class String, class Traits >
- inline basic_path<String, Traits> operator/(
- const typename String::value_type * lhs,
- const basic_path<String, Traits> & rhs )
- { return basic_path<String, Traits>( lhs ) /= rhs; }
-
- template< class String, class Traits >
- inline basic_path<String, Traits> operator/(
- const String & lhs, const basic_path<String, Traits> & rhs )
- { return basic_path<String, Traits>( lhs ) /= rhs; }
-
- // inserters and extractors --------------------------------------------//
-
-// bypass VC++ 7.0 and earlier, and broken Borland compilers
-# if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) && !BOOST_WORKAROUND(__BORLANDC__, < 0x610)
- template< class Path >
- std::basic_ostream< typename Path::string_type::value_type,
- typename Path::string_type::traits_type > &
- operator<<
- ( std::basic_ostream< typename Path::string_type::value_type,
- typename Path::string_type::traits_type >& os, const Path & ph )
- {
- os << ph.string();
- return os;
- }
-
- template< class Path >
- std::basic_istream< typename Path::string_type::value_type,
- typename Path::string_type::traits_type > &
- operator>>
- ( std::basic_istream< typename Path::string_type::value_type,
- typename Path::string_type::traits_type >& is, Path & ph )
- {
- typename Path::string_type str;
- std::getline(is, str); // See ticket 3863
- ph = str;
- return is;
- }
-# elif BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
- template< class String, class Traits >
- std::basic_ostream< BOOST_DEDUCED_TYPENAME String::value_type,
- BOOST_DEDUCED_TYPENAME String::traits_type > &
- operator<<
- ( std::basic_ostream< BOOST_DEDUCED_TYPENAME String::value_type,
- BOOST_DEDUCED_TYPENAME String::traits_type >& os,
- const basic_path< String, Traits > & ph )
- {
- os << ph.string();
- return os;
- }
-
- template< class String, class Traits >
- std::basic_istream< BOOST_DEDUCED_TYPENAME String::value_type,
- BOOST_DEDUCED_TYPENAME String::traits_type > &
- operator>>
- ( std::basic_istream< BOOST_DEDUCED_TYPENAME String::value_type,
- BOOST_DEDUCED_TYPENAME String::traits_type> & is,
- basic_path< String, Traits > & ph )
- {
- String str;
- std::getline(is, str); // See ticket 3863
- ph = str;
- return is;
- }
-# endif
-
- // basic_filesystem_error helpers --------------------------------------//
-
- // Originally choice of implementation was done via specialization of
- // basic_filesystem_error::what(). Several compilers (GCC, aCC, etc.)
- // couldn't handle that, so the choice is now accomplished by overloading.
-
- namespace detail
- {
- // BOOST_FILESYSTEM_DECL version works for VC++ but not GCC. Go figure!
- inline
- const char * what( const char * sys_err_what,
- const path & path1_arg, const path & path2_arg, std::string & target )
- {
- try
- {
- if ( target.empty() )
- {
- target = sys_err_what;
- if ( !path1_arg.empty() )
- {
- target += ": \"";
- target += path1_arg.file_string();
- target += "\"";
- }
- if ( !path2_arg.empty() )
- {
- target += ", \"";
- target += path2_arg.file_string();
- target += "\"";
- }
- }
- return target.c_str();
- }
- catch (...)
- {
- return sys_err_what;
- }
- }
-
- template<class Path>
- const char * what( const char * sys_err_what,
- const Path & /*path1_arg*/, const Path & /*path2_arg*/, std::string & /*target*/ )
- {
- return sys_err_what;
- }
- }
-
- // basic_filesystem_error ----------------------------------------------//
-
- template<class Path>
- class basic_filesystem_error : public system::system_error
- {
- // see http://www.boost.org/more/error_handling.html for design rationale
- public:
- // compiler generates copy constructor and copy assignment
-
- typedef Path path_type;
-
- basic_filesystem_error( const std::string & what_arg,
- system::error_code ec );
-
- basic_filesystem_error( const std::string & what_arg,
- const path_type & path1_arg, system::error_code ec );
-
- basic_filesystem_error( const std::string & what_arg, const path_type & path1_arg,
- const path_type & path2_arg, system::error_code ec );
-
- ~basic_filesystem_error() throw() {}
-
- const path_type & path1() const
- {
- static const path_type empty_path;
- return m_imp_ptr.get() ? m_imp_ptr->m_path1 : empty_path ;
- }
- const path_type & path2() const
- {
- static const path_type empty_path;
- return m_imp_ptr.get() ? m_imp_ptr->m_path2 : empty_path ;
- }
-
- const char * what() const throw()
- {
- if ( !m_imp_ptr.get() )
- return system::system_error::what();
- return detail::what( system::system_error::what(), m_imp_ptr->m_path1,
- m_imp_ptr->m_path2, m_imp_ptr->m_what );
- }
-
- private:
- struct m_imp
- {
- path_type m_path1; // may be empty()
- path_type m_path2; // may be empty()
- std::string m_what; // not built until needed
- };
- boost::shared_ptr<m_imp> m_imp_ptr;
- };
-
- typedef basic_filesystem_error<path> filesystem_error;
-
-# ifndef BOOST_FILESYSTEM2_NARROW_ONLY
- typedef basic_filesystem_error<wpath> wfilesystem_error;
-# endif
-
- // path::name_checks -----------------------------------------------------//
-
- BOOST_FILESYSTEM_DECL bool portable_posix_name( const std::string & name );
- BOOST_FILESYSTEM_DECL bool windows_name( const std::string & name );
- BOOST_FILESYSTEM_DECL bool portable_name( const std::string & name );
- BOOST_FILESYSTEM_DECL bool portable_directory_name( const std::string & name );
- BOOST_FILESYSTEM_DECL bool portable_file_name( const std::string & name );
- BOOST_FILESYSTEM_DECL bool native( const std::string & name );
- inline bool no_check( const std::string & )
- { return true; }
-
-// implementation -----------------------------------------------------------//
-
- namespace detail
- {
-
- // is_separator helper ------------------------------------------------//
-
- template<class Path>
- inline bool is_separator( typename Path::string_type::value_type c )
- {
- return c == slash<Path>::value
-# ifdef BOOST_WINDOWS_PATH
- || c == path_alt_separator<Path>::value
-# endif
- ;
- }
-
- // filename_pos helper ----------------------------------------------------//
-
- template<class String, class Traits>
- typename String::size_type filename_pos(
- const String & str, // precondition: portable generic path grammar
- typename String::size_type end_pos ) // end_pos is past-the-end position
- // return 0 if str itself is filename (or empty)
- {
- typedef typename
- boost::BOOST_FILESYSTEM2_NAMESPACE::basic_path<String, Traits> path_type;
-
- // case: "//"
- if ( end_pos == 2
- && str[0] == slash<path_type>::value
- && str[1] == slash<path_type>::value ) return 0;
-
- // case: ends in "/"
- if ( end_pos && str[end_pos-1] == slash<path_type>::value )
- return end_pos-1;
-
- // set pos to start of last element
- typename String::size_type pos(
- str.find_last_of( slash<path_type>::value, end_pos-1 ) );
-# ifdef BOOST_WINDOWS_PATH
- if ( pos == String::npos )
- pos = str.find_last_of( path_alt_separator<path_type>::value, end_pos-1 );
- if ( pos == String::npos )
- pos = str.find_last_of( colon<path_type>::value, end_pos-2 );
-# endif
-
- return ( pos == String::npos // path itself must be a filename (or empty)
- || (pos == 1 && str[0] == slash<path_type>::value) ) // or net
- ? 0 // so filename is entire string
- : pos + 1; // or starts after delimiter
- }
-
- // first_element helper -----------------------------------------------//
- // sets pos and len of first element, excluding extra separators
- // if src.empty(), sets pos,len, to 0,0.
-
- template<class String, class Traits>
- void first_element(
- const String & src, // precondition: portable generic path grammar
- typename String::size_type & element_pos,
- typename String::size_type & element_size,
-# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1310 ) // VC++ 7.1
- typename String::size_type size = String::npos
-# else
- typename String::size_type size = -1
-# endif
- )
- {
- if ( size == String::npos ) size = src.size();
- element_pos = 0;
- element_size = 0;
- if ( src.empty() ) return;
-
- typedef typename boost::BOOST_FILESYSTEM2_NAMESPACE::basic_path<String, Traits> path_type;
-
- typename String::size_type cur(0);
-
- // deal with // [network]
- if ( size >= 2 && src[0] == slash<path_type>::value
- && src[1] == slash<path_type>::value
- && (size == 2
- || src[2] != slash<path_type>::value) )
- {
- cur += 2;
- element_size += 2;
- }
-
- // leading (not non-network) separator
- else if ( src[0] == slash<path_type>::value )
- {
- ++element_size;
- // bypass extra leading separators
- while ( cur+1 < size
- && src[cur+1] == slash<path_type>::value )
- {
- ++cur;
- ++element_pos;
- }
- return;
- }
-
- // at this point, we have either a plain name, a network name,
- // or (on Windows only) a device name
-
- // find the end
- while ( cur < size
-# ifdef BOOST_WINDOWS_PATH
- && src[cur] != colon<path_type>::value
-# endif
- && src[cur] != slash<path_type>::value )
- {
- ++cur;
- ++element_size;
- }
-
-# ifdef BOOST_WINDOWS_PATH
- if ( cur == size ) return;
- // include device delimiter
- if ( src[cur] == colon<path_type>::value )
- { ++element_size; }
-# endif
-
- return;
- }
-
- // root_directory_start helper ----------------------------------------//
-
- template<class String, class Traits>
- typename String::size_type root_directory_start(
- const String & s, // precondition: portable generic path grammar
- typename String::size_type size )
- // return npos if no root_directory found
- {
- typedef typename boost::BOOST_FILESYSTEM2_NAMESPACE::basic_path<String, Traits> path_type;
-
-# ifdef BOOST_WINDOWS_PATH
- // case "c:/"
- if ( size > 2
- && s[1] == colon<path_type>::value
- && s[2] == slash<path_type>::value ) return 2;
-# endif
-
- // case "//"
- if ( size == 2
- && s[0] == slash<path_type>::value
- && s[1] == slash<path_type>::value ) return String::npos;
-
- // case "//net {/}"
- if ( size > 3
- && s[0] == slash<path_type>::value
- && s[1] == slash<path_type>::value
- && s[2] != slash<path_type>::value )
- {
- typename String::size_type pos(
- s.find( slash<path_type>::value, 2 ) );
- return pos < size ? pos : String::npos;
- }
-
- // case "/"
- if ( size > 0 && s[0] == slash<path_type>::value ) return 0;
-
- return String::npos;
- }
-
- // is_non_root_slash helper -------------------------------------------//
-
- template<class String, class Traits>
- bool is_non_root_slash( const String & str,
- typename String::size_type pos ) // pos is position of the slash
- {
- typedef typename
- boost::BOOST_FILESYSTEM2_NAMESPACE::basic_path<String, Traits>
- path_type;
-
- BOOST_ASSERT( !str.empty() && str[pos] == slash<path_type>::value
- && "precondition violation" );
-
- // subsequent logic expects pos to be for leftmost slash of a set
- while ( pos > 0 && str[pos-1] == slash<path_type>::value )
- --pos;
-
- return pos != 0
- && (pos <= 2 || str[1] != slash<path_type>::value
- || str.find( slash<path_type>::value, 2 ) != pos)
-# ifdef BOOST_WINDOWS_PATH
- && (pos !=2 || str[1] != colon<path_type>::value)
-# endif
- ;
- }
- } // namespace detail
-
- // decomposition functions ----------------------------------------------//
-
- template<class String, class Traits>
- String basic_path<String, Traits>::filename() const
- {
- typename String::size_type end_pos(
- detail::filename_pos<String, Traits>( m_path, m_path.size() ) );
- return (m_path.size()
- && end_pos
- && m_path[end_pos] == slash<path_type>::value
- && detail::is_non_root_slash< String, Traits >(m_path, end_pos))
- ? String( 1, dot<path_type>::value )
- : m_path.substr( end_pos );
- }
-
- template<class String, class Traits>
- String basic_path<String, Traits>::stem() const
- {
- string_type name = filename();
- typename string_type::size_type n = name.rfind(dot<path_type>::value);
- return name.substr(0, n);
- }
-
- template<class String, class Traits>
- String basic_path<String, Traits>::extension() const
- {
- string_type name = filename();
- typename string_type::size_type n = name.rfind(dot<path_type>::value);
- if (n != string_type::npos)
- return name.substr(n);
- else
- return string_type();
- }
-
- template<class String, class Traits>
- basic_path<String, Traits> basic_path<String, Traits>::parent_path() const
- {
- typename String::size_type end_pos(
- detail::filename_pos<String, Traits>( m_path, m_path.size() ) );
-
- bool filename_was_separator( m_path.size()
- && m_path[end_pos] == slash<path_type>::value );
-
- // skip separators unless root directory
- typename string_type::size_type root_dir_pos( detail::root_directory_start
- <string_type, traits_type>( m_path, end_pos ) );
- for ( ;
- end_pos > 0
- && (end_pos-1) != root_dir_pos
- && m_path[end_pos-1] == slash<path_type>::value
- ;
- --end_pos ) {}
-
- return (end_pos == 1 && root_dir_pos == 0 && filename_was_separator)
- ? path_type()
- : path_type( m_path.substr( 0, end_pos ) );
- }
-
- template<class String, class Traits>
- basic_path<String, Traits> basic_path<String, Traits>::relative_path() const
- {
- iterator itr( begin() );
- for ( ; itr.m_pos != m_path.size()
- && (itr.m_name[0] == slash<path_type>::value
-# ifdef BOOST_WINDOWS_PATH
- || itr.m_name[itr.m_name.size()-1]
- == colon<path_type>::value
-# endif
- ); ++itr ) {}
-
- return basic_path<String, Traits>( m_path.substr( itr.m_pos ) );
- }
-
- template<class String, class Traits>
- String basic_path<String, Traits>::root_name() const
- {
- iterator itr( begin() );
-
- return ( itr.m_pos != m_path.size()
- && (
- ( itr.m_name.size() > 1
- && itr.m_name[0] == slash<path_type>::value
- && itr.m_name[1] == slash<path_type>::value
- )
-# ifdef BOOST_WINDOWS_PATH
- || itr.m_name[itr.m_name.size()-1]
- == colon<path_type>::value
-# endif
- ) )
- ? *itr
- : String();
- }
-
- template<class String, class Traits>
- String basic_path<String, Traits>::root_directory() const
- {
- typename string_type::size_type start(
- detail::root_directory_start<String, Traits>( m_path, m_path.size() ) );
-
- return start == string_type::npos
- ? string_type()
- : m_path.substr( start, 1 );
- }
-
- template<class String, class Traits>
- basic_path<String, Traits> basic_path<String, Traits>::root_path() const
- {
- // even on POSIX, root_name() is non-empty() on network paths
- return basic_path<String, Traits>( root_name() ) /= root_directory();
- }
-
- // path query functions -------------------------------------------------//
-
- template<class String, class Traits>
- inline bool basic_path<String, Traits>::is_complete() const
- {
-# ifdef BOOST_WINDOWS_PATH
- return has_root_name() && has_root_directory();
-# else
- return has_root_directory();
-# endif
- }
-
- template<class String, class Traits>
- inline bool basic_path<String, Traits>::has_root_path() const
- {
- return !root_path().empty();
- }
-
- template<class String, class Traits>
- inline bool basic_path<String, Traits>::has_root_name() const
- {
- return !root_name().empty();
- }
-
- template<class String, class Traits>
- inline bool basic_path<String, Traits>::has_root_directory() const
- {
- return !root_directory().empty();
- }
-
- // append ---------------------------------------------------------------//
-
- template<class String, class Traits>
- void basic_path<String, Traits>::m_append_separator_if_needed()
- // requires: !empty()
- {
- if (
-# ifdef BOOST_WINDOWS_PATH
- *(m_path.end()-1) != colon<path_type>::value &&
-# endif
- *(m_path.end()-1) != slash<path_type>::value )
- {
- m_path += slash<path_type>::value;
- }
- }
-
- template<class String, class Traits>
- void basic_path<String, Traits>::m_append( value_type value )
- {
-# ifdef BOOST_CYGWIN_PATH
- if ( m_path.empty() ) m_cygwin_root = (value == slash<path_type>::value);
-# endif
-
-# ifdef BOOST_WINDOWS_PATH
- // for BOOST_WINDOWS_PATH, convert alt_separator ('\') to separator ('/')
- m_path += ( value == path_alt_separator<path_type>::value
- ? slash<path_type>::value
- : value );
-# else
- m_path += value;
-# endif
- }
-
- // except that it wouldn't work for BOOST_NO_MEMBER_TEMPLATES compilers,
- // the append() member template could replace this code.
- template<class String, class Traits>
- basic_path<String, Traits> & basic_path<String, Traits>::operator /=
- ( const value_type * next_p )
- {
- // ignore escape sequence on POSIX or Windows
- if ( *next_p == slash<path_type>::value
- && *(next_p+1) == slash<path_type>::value
- && *(next_p+2) == colon<path_type>::value ) next_p += 3;
-
- // append slash<path_type>::value if needed
- if ( !empty() && *next_p != 0
- && !detail::is_separator<path_type>( *next_p ) )
- { m_append_separator_if_needed(); }
-
- for ( ; *next_p != 0; ++next_p ) m_append( *next_p );
- return *this;
- }
-
-# ifndef BOOST_NO_MEMBER_TEMPLATES
- template<class String, class Traits> template <class InputIterator>
- basic_path<String, Traits> & basic_path<String, Traits>::append(
- InputIterator first, InputIterator last )
- {
- // append slash<path_type>::value if needed
- if ( !empty() && first != last
- && !detail::is_separator<path_type>( *first ) )
- { m_append_separator_if_needed(); }
-
- // song-and-dance to avoid violating InputIterator requirements
- // (which prohibit lookahead) in detecting a possible escape sequence
- // (escape sequences are simply ignored on POSIX and Windows)
- bool was_escape_sequence(true);
- std::size_t append_count(0);
- typename String::size_type initial_pos( m_path.size() );
-
- for ( ; first != last && *first; ++first )
- {
- if ( append_count == 0 && *first != slash<path_type>::value )
- was_escape_sequence = false;
- if ( append_count == 1 && *first != slash<path_type>::value )
- was_escape_sequence = false;
- if ( append_count == 2 && *first != colon<path_type>::value )
- was_escape_sequence = false;
- m_append( *first );
- ++append_count;
- }
-
- // erase escape sequence if any
- if ( was_escape_sequence && append_count >= 3 )
- m_path.erase( initial_pos, 3 );
-
- return *this;
- }
-# endif
-
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
-
- // canonize ------------------------------------------------------------//
-
- template<class String, class Traits>
- basic_path<String, Traits> & basic_path<String, Traits>::canonize()
- {
- static const typename string_type::value_type dot_str[]
- = { dot<path_type>::value, 0 };
-
- if ( m_path.empty() ) return *this;
-
- path_type temp;
-
- for ( iterator itr( begin() ); itr != end(); ++itr )
- {
- temp /= *itr;
- };
-
- if ( temp.empty() ) temp /= dot_str;
- m_path = temp.m_path;
- return *this;
- }
-
- // normalize ------------------------------------------------------------//
-
- template<class String, class Traits>
- basic_path<String, Traits> & basic_path<String, Traits>::normalize()
- {
- static const typename string_type::value_type dot_str[]
- = { dot<path_type>::value, 0 };
-
- if ( m_path.empty() ) return *this;
-
- path_type temp;
- iterator start( begin() );
- iterator last( end() );
- iterator stop( last-- );
- for ( iterator itr( start ); itr != stop; ++itr )
- {
- // ignore "." except at start and last
- if ( itr->size() == 1
- && (*itr)[0] == dot<path_type>::value
- && itr != start
- && itr != last ) continue;
-
- // ignore a name and following ".."
- if ( !temp.empty()
- && itr->size() == 2
- && (*itr)[0] == dot<path_type>::value
- && (*itr)[1] == dot<path_type>::value ) // dot dot
- {
- string_type lf( temp.filename() );
- if ( lf.size() > 0
- && (lf.size() != 1
- || (lf[0] != dot<path_type>::value
- && lf[0] != slash<path_type>::value))
- && (lf.size() != 2
- || (lf[0] != dot<path_type>::value
- && lf[1] != dot<path_type>::value
-# ifdef BOOST_WINDOWS_PATH
- && lf[1] != colon<path_type>::value
-# endif
- )
- )
- )
- {
- temp.remove_filename();
- // if not root directory, must also remove "/" if any
- if ( temp.m_path.size() > 0
- && temp.m_path[temp.m_path.size()-1]
- == slash<path_type>::value )
- {
- typename string_type::size_type rds(
- detail::root_directory_start<String,Traits>( temp.m_path,
- temp.m_path.size() ) );
- if ( rds == string_type::npos
- || rds != temp.m_path.size()-1 )
- { temp.m_path.erase( temp.m_path.size()-1 ); }
- }
-
- iterator next( itr );
- if ( temp.empty() && ++next != stop
- && next == last && *last == dot_str ) temp /= dot_str;
- continue;
- }
- }
-
- temp /= *itr;
- };
-
- if ( temp.empty() ) temp /= dot_str;
- m_path = temp.m_path;
- return *this;
- }
-
-# endif
-
- // modifiers ------------------------------------------------------------//
-
- template<class String, class Traits>
- basic_path<String, Traits> & basic_path<String, Traits>::remove_filename()
- {
- m_path.erase(
- detail::filename_pos<String, Traits>( m_path, m_path.size() ) );
- return *this;
- }
-
- template<class String, class Traits>
- basic_path<String, Traits> &
- basic_path<String, Traits>::replace_extension( const string_type & new_ext )
- {
- // erase existing extension if any
- string_type old_ext = extension();
- if ( !old_ext.empty() )
- m_path.erase( m_path.size() - old_ext.size() );
-
- if ( !new_ext.empty() && new_ext[0] != dot<path_type>::value )
- m_path += dot<path_type>::value;
-
- m_path += new_ext;
-
- return *this;
- }
-
-
- // path conversion functions --------------------------------------------//
-
- template<class String, class Traits>
- const String
- basic_path<String, Traits>::file_string() const
- {
-# ifdef BOOST_WINDOWS_PATH
- // for Windows, use the alternate separator, and bypass extra
- // root separators
-
- typename string_type::size_type root_dir_start(
- detail::root_directory_start<String, Traits>( m_path, m_path.size() ) );
- bool in_root( root_dir_start != string_type::npos );
- String s;
- for ( typename string_type::size_type pos( 0 );
- pos != m_path.size(); ++pos )
- {
- // special case // [net]
- if ( pos == 0 && m_path.size() > 1
- && m_path[0] == slash<path_type>::value
- && m_path[1] == slash<path_type>::value
- && ( m_path.size() == 2
- || !detail::is_separator<path_type>( m_path[2] )
- ) )
- {
- ++pos;
- s += path_alt_separator<path_type>::value;
- s += path_alt_separator<path_type>::value;
- continue;
- }
-
- // bypass extra root separators
- if ( in_root )
- {
- if ( s.size() > 0
- && s[s.size()-1] == path_alt_separator<path_type>::value
- && m_path[pos] == slash<path_type>::value
- ) continue;
- }
-
- if ( m_path[pos] == slash<path_type>::value )
- s += path_alt_separator<path_type>::value;
- else
- s += m_path[pos];
-
- if ( pos > root_dir_start
- && m_path[pos] == slash<path_type>::value )
- { in_root = false; }
- }
-# ifdef BOOST_CYGWIN_PATH
- if ( m_cygwin_root ) s[0] = slash<path_type>::value;
-# endif
- return s;
-# else
- return m_path;
-# endif
- }
-
- // iterator functions ---------------------------------------------------//
-
- template<class String, class Traits>
- typename basic_path<String, Traits>::iterator basic_path<String, Traits>::begin() const
- {
- iterator itr;
- itr.m_path_ptr = this;
- typename string_type::size_type element_size;
- detail::first_element<String, Traits>( m_path, itr.m_pos, element_size );
- itr.m_name = m_path.substr( itr.m_pos, element_size );
- return itr;
- }
-
- template<class String, class Traits>
- typename basic_path<String, Traits>::iterator basic_path<String, Traits>::end() const
- {
- iterator itr;
- itr.m_path_ptr = this;
- itr.m_pos = m_path.size();
- return itr;
- }
-
- namespace detail
- {
- // do_increment ------------------------------------------------------//
-
- template<class Path>
- void iterator_helper<Path>::do_increment( iterator & itr )
- {
- typedef typename Path::string_type string_type;
- typedef typename Path::traits_type traits_type;
-
- BOOST_ASSERT( itr.m_pos < itr.m_path_ptr->m_path.size() && "basic_path::iterator increment past end()" );
-
- bool was_net( itr.m_name.size() > 2
- && itr.m_name[0] == slash<Path>::value
- && itr.m_name[1] == slash<Path>::value
- && itr.m_name[2] != slash<Path>::value );
-
- // increment to position past current element
- itr.m_pos += itr.m_name.size();
-
- // if end reached, create end iterator
- if ( itr.m_pos == itr.m_path_ptr->m_path.size() )
- {
- itr.m_name.erase( itr.m_name.begin(), itr.m_name.end() ); // VC++ 6.0 lib didn't supply clear()
- return;
- }
-
- // process separator (Windows drive spec is only case not a separator)
- if ( itr.m_path_ptr->m_path[itr.m_pos] == slash<Path>::value )
- {
- // detect root directory
- if ( was_net
- # ifdef BOOST_WINDOWS_PATH
- // case "c:/"
- || itr.m_name[itr.m_name.size()-1] == colon<Path>::value
- # endif
- )
- {
- itr.m_name = slash<Path>::value;
- return;
- }
-
- // bypass separators
- while ( itr.m_pos != itr.m_path_ptr->m_path.size()
- && itr.m_path_ptr->m_path[itr.m_pos] == slash<Path>::value )
- { ++itr.m_pos; }
-
- // detect trailing separator, and treat it as ".", per POSIX spec
- if ( itr.m_pos == itr.m_path_ptr->m_path.size()
- && detail::is_non_root_slash< string_type, traits_type >(
- itr.m_path_ptr->m_path, itr.m_pos-1 ) )
- {
- --itr.m_pos;
- itr.m_name = dot<Path>::value;
- return;
- }
- }
-
- // get next element
- typename string_type::size_type end_pos(
- itr.m_path_ptr->m_path.find( slash<Path>::value, itr.m_pos ) );
- itr.m_name = itr.m_path_ptr->m_path.substr( itr.m_pos, end_pos - itr.m_pos );
- }
-
- // do_decrement ------------------------------------------------------//
-
- template<class Path>
- void iterator_helper<Path>::do_decrement( iterator & itr )
- {
- BOOST_ASSERT( itr.m_pos && "basic_path::iterator decrement past begin()" );
-
- typedef typename Path::string_type string_type;
- typedef typename Path::traits_type traits_type;
-
- typename string_type::size_type end_pos( itr.m_pos );
-
- typename string_type::size_type root_dir_pos(
- detail::root_directory_start<string_type, traits_type>(
- itr.m_path_ptr->m_path, end_pos ) );
-
- // if at end and there was a trailing non-root '/', return "."
- if ( itr.m_pos == itr.m_path_ptr->m_path.size()
- && itr.m_path_ptr->m_path.size() > 1
- && itr.m_path_ptr->m_path[itr.m_pos-1] == slash<Path>::value
- && detail::is_non_root_slash< string_type, traits_type >(
- itr.m_path_ptr->m_path, itr.m_pos-1 )
- )
- {
- --itr.m_pos;
- itr.m_name = dot<Path>::value;
- return;
- }
-
- // skip separators unless root directory
- for (
- ;
- end_pos > 0
- && (end_pos-1) != root_dir_pos
- && itr.m_path_ptr->m_path[end_pos-1] == slash<Path>::value
- ;
- --end_pos ) {}
-
- itr.m_pos = detail::filename_pos<string_type, traits_type>
- ( itr.m_path_ptr->m_path, end_pos );
- itr.m_name = itr.m_path_ptr->m_path.substr( itr.m_pos, end_pos - itr.m_pos );
- }
- } // namespace detail
-
- // basic_filesystem_error implementation --------------------------------//
-
- template<class Path>
- basic_filesystem_error<Path>::basic_filesystem_error(
- const std::string & what_arg, system::error_code ec )
- : system::system_error(ec, what_arg)
- {
- try
- {
- m_imp_ptr.reset( new m_imp );
- }
- catch (...) { m_imp_ptr.reset(); }
- }
-
- template<class Path>
- basic_filesystem_error<Path>::basic_filesystem_error(
- const std::string & what_arg, const path_type & path1_arg,
- system::error_code ec )
- : system::system_error(ec, what_arg)
- {
- try
- {
- m_imp_ptr.reset( new m_imp );
- m_imp_ptr->m_path1 = path1_arg;
- }
- catch (...) { m_imp_ptr.reset(); }
- }
-
- template<class Path>
- basic_filesystem_error<Path>::basic_filesystem_error(
- const std::string & what_arg, const path_type & path1_arg,
- const path_type & path2_arg, system::error_code ec )
- : system::system_error(ec, what_arg)
- {
- try
- {
- m_imp_ptr.reset( new m_imp );
- m_imp_ptr->m_path1 = path1_arg;
- m_imp_ptr->m_path2 = path2_arg;
- }
- catch (...) { m_imp_ptr.reset(); }
- }
-
- } // namespace BOOST_FILESYSTEM2_NAMESPACE
-} // namespace boost
-
-//----------------------------------------------------------------------------//
-
-namespace boost
-{
- namespace filesystem
- {
- using filesystem2::basic_path;
- using filesystem2::path_traits;
-
- using filesystem2::slash;
- using filesystem2::dot;
- using filesystem2::colon;
-
- using filesystem2::path;
-# ifndef BOOST_FILESYSTEM2_NARROW_ONLY
- using filesystem2::wpath_traits;
- using filesystem2::wpath;
- using filesystem2::wfilesystem_error;
-# endif
- using filesystem2::basic_filesystem_error;
- using filesystem2::filesystem_error;
- using filesystem2::portable_posix_name;
- using filesystem2::windows_name;
- using filesystem2::portable_name;
- using filesystem2::portable_directory_name;
- using filesystem2::portable_file_name;
- using filesystem2::native;
- using filesystem2::no_check;
- using filesystem2::swap;
- using filesystem2::operator<;
- using filesystem2::operator==;
- using filesystem2::operator!=;
- using filesystem2::operator>;
- using filesystem2::operator<=;
- using filesystem2::operator>=;
- using filesystem2::operator/;
- using filesystem2::operator<<;
- using filesystem2::operator>>;
- }
-}
-
-//----------------------------------------------------------------------------//
-
-#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
-
-#endif // BOOST_FILESYSTEM2_PATH_HPP
diff --git a/boost/filesystem/v3/config.hpp b/boost/filesystem/v3/config.hpp
deleted file mode 100644
index 13fc308dbe..0000000000
--- a/boost/filesystem/v3/config.hpp
+++ /dev/null
@@ -1,85 +0,0 @@
-// boost/filesystem/v3/config.hpp ----------------------------------------------------//
-
-// Copyright Beman Dawes 2003
-
-// Distributed under the Boost Software License, Version 1.0.
-// See http://www.boost.org/LICENSE_1_0.txt
-
-// Library home page: http://www.boost.org/libs/filesystem
-
-//--------------------------------------------------------------------------------------//
-
-#ifndef BOOST_FILESYSTEM3_CONFIG_HPP
-#define BOOST_FILESYSTEM3_CONFIG_HPP
-
-# if defined(BOOST_FILESYSTEM_VERSION) && BOOST_FILESYSTEM_VERSION != 3
-# error Compiling Filesystem version 3 file with BOOST_FILESYSTEM_VERSION defined != 3
-# endif
-
-# if !defined(BOOST_FILESYSTEM_VERSION)
-# define BOOST_FILESYSTEM_VERSION 3
-# endif
-
-#define BOOST_FILESYSTEM_I18N // aid users wishing to compile several versions
-
-// This header implements separate compilation features as described in
-// http://www.boost.org/more/separate_compilation.html
-
-#include <boost/config.hpp>
-#include <boost/system/api_config.hpp> // for BOOST_POSIX_API or BOOST_WINDOWS_API
-#include <boost/detail/workaround.hpp>
-
-// BOOST_FILESYSTEM_DEPRECATED needed for source compiles -----------------------------//
-
-# ifdef BOOST_FILESYSTEM_SOURCE
-# define BOOST_FILESYSTEM_DEPRECATED
-# endif
-
-// throw an exception ----------------------------------------------------------------//
-//
-// Exceptions were originally thrown via boost::throw_exception().
-// As throw_exception() became more complex, it caused user error reporting
-// to be harder to interpret, since the exception reported became much more complex.
-// The immediate fix was to throw directly, wrapped in a macro to make any later change
-// easier.
-
-#define BOOST_FILESYSTEM_THROW(EX) throw EX
-
-# if defined( BOOST_NO_STD_WSTRING )
-# error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
-# endif
-
-// enable dynamic linking -------------------------------------------------------------//
-
-#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK)
-# if defined(BOOST_FILESYSTEM_SOURCE)
-# define BOOST_FILESYSTEM_DECL BOOST_SYMBOL_EXPORT
-# else
-# define BOOST_FILESYSTEM_DECL BOOST_SYMBOL_IMPORT
-# endif
-#else
-# define BOOST_FILESYSTEM_DECL
-#endif
-
-// enable automatic library variant selection ----------------------------------------//
-
-#if !defined(BOOST_FILESYSTEM_SOURCE) && !defined(BOOST_ALL_NO_LIB) \
- && !defined(BOOST_FILESYSTEM_NO_LIB)
-//
-// Set the name of our library, this will get undef'ed by auto_link.hpp
-// once it's done with it:
-//
-#define BOOST_LIB_NAME boost_filesystem
-//
-// If we're importing code from a dll, then tell auto_link.hpp about it:
-//
-#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK)
-# define BOOST_DYN_LINK
-#endif
-//
-// And include the header that does the work:
-//
-#include <boost/config/auto_link.hpp>
-#endif // auto-linking disabled
-
-#endif // BOOST_FILESYSTEM3_CONFIG_HPP
diff --git a/boost/filesystem/v3/convenience.hpp b/boost/filesystem/v3/convenience.hpp
deleted file mode 100644
index 1a1f9435fe..0000000000
--- a/boost/filesystem/v3/convenience.hpp
+++ /dev/null
@@ -1,74 +0,0 @@
-// boost/filesystem/convenience.hpp ----------------------------------------//
-
-// Copyright Beman Dawes, 2002-2005
-// Copyright Vladimir Prus, 2002
-// Use, modification, and distribution is subject to the Boost Software
-// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// See library home page at http://www.boost.org/libs/filesystem
-
-//----------------------------------------------------------------------------//
-
-#ifndef BOOST_FILESYSTEM3_CONVENIENCE_HPP
-#define BOOST_FILESYSTEM3_CONVENIENCE_HPP
-
-#include <boost/config.hpp>
-
-# if defined( BOOST_NO_STD_WSTRING )
-# error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
-# endif
-
-#include <boost/filesystem/v3/operations.hpp>
-#include <boost/system/error_code.hpp>
-
-#include <boost/config/abi_prefix.hpp> // must be the last #include
-
-namespace boost
-{
- namespace filesystem3
- {
-
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
-
- inline std::string extension(const path & p)
- {
- return p.extension().string();
- }
-
- inline std::string basename(const path & p)
- {
- return p.stem().string();
- }
-
- inline path change_extension( const path & p, const path & new_extension )
- {
- path new_p( p );
- new_p.replace_extension( new_extension );
- return new_p;
- }
-
-# endif
-
-
- } // namespace filesystem3
-} // namespace boost
-
-//----------------------------------------------------------------------------//
-
-namespace boost
-{
- namespace filesystem
- {
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
- using filesystem3::extension;
- using filesystem3::basename;
- using filesystem3::change_extension;
-# endif
- }
-}
-
-//----------------------------------------------------------------------------//
-
-#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
-#endif // BOOST_FILESYSTEM3_CONVENIENCE_HPP
diff --git a/boost/filesystem/v3/exception.hpp b/boost/filesystem/v3/exception.hpp
deleted file mode 100644
index 985cd8f715..0000000000
--- a/boost/filesystem/v3/exception.hpp
+++ /dev/null
@@ -1,9 +0,0 @@
-// boost/filesystem/exception.hpp -----------------------------------------------------//
-
-// Copyright Beman Dawes 2003
-// Use, modification, and distribution is subject to the Boost Software
-// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// This header is no longer used. The contents have been moved to path.hpp.
-// It is provided so that user code #includes do not have to be changed.
diff --git a/boost/filesystem/v3/fstream.hpp b/boost/filesystem/v3/fstream.hpp
deleted file mode 100644
index 60a2a3b2b4..0000000000
--- a/boost/filesystem/v3/fstream.hpp
+++ /dev/null
@@ -1,208 +0,0 @@
-// boost/filesystem/fstream.hpp ------------------------------------------------------//
-
-// Copyright Beman Dawes 2002
-
-// Distributed under the Boost Software License, Version 1.0.
-// See http://www.boost.org/LICENSE_1_0.txt
-
-// Library home page: http://www.boost.org/libs/filesystem
-
-//--------------------------------------------------------------------------------------//
-
-#ifndef BOOST_FILESYSTEM3_FSTREAM_HPP
-#define BOOST_FILESYSTEM3_FSTREAM_HPP
-
-#include <boost/config.hpp>
-
-# if defined( BOOST_NO_STD_WSTRING )
-# error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
-# endif
-
-#include <boost/filesystem/v3/path.hpp>
-#include <iosfwd>
-#include <fstream>
-
-#include <boost/config/abi_prefix.hpp> // must be the last #include
-
-// on Windows, except for standard libaries known to have wchar_t overloads for
-// file stream I/O, use path::string() to get a narrow character c_str()
-#if defined(BOOST_WINDOWS_API) \
- && (!defined(_CPPLIB_VER) || _CPPLIB_VER < 405 || defined(_STLPORT_VERSION))
- // !Dinkumware || early Dinkumware || STLPort masquerading as Dinkumware
-# define BOOST_FILESYSTEM_C_STR string().c_str() // use narrow, since wide not available
-#else // use the native c_str, which will be narrow on POSIX, wide on Windows
-# define BOOST_FILESYSTEM_C_STR c_str()
-#endif
-
-namespace boost
-{
-namespace filesystem3
-{
-
-//--------------------------------------------------------------------------------------//
-// basic_filebuf //
-//--------------------------------------------------------------------------------------//
-
- template < class charT, class traits = std::char_traits<charT> >
- class basic_filebuf : public std::basic_filebuf<charT,traits>
- {
- private: // disallow copying
- basic_filebuf(const basic_filebuf&);
- const basic_filebuf& operator=(const basic_filebuf&);
-
- public:
- basic_filebuf() {}
- virtual ~basic_filebuf() {}
-
- basic_filebuf<charT,traits>*
- open(const path& p, std::ios_base::openmode mode)
- {
- return std::basic_filebuf<charT,traits>::open(p.BOOST_FILESYSTEM_C_STR, mode)
- ? this : 0;
- }
- };
-
-//--------------------------------------------------------------------------------------//
-// basic_ifstream //
-//--------------------------------------------------------------------------------------//
-
- template < class charT, class traits = std::char_traits<charT> >
- class basic_ifstream : public std::basic_ifstream<charT,traits>
- {
- private: // disallow copying
- basic_ifstream(const basic_ifstream&);
- const basic_ifstream& operator=(const basic_ifstream&);
-
- public:
- basic_ifstream() {}
-
- // use two signatures, rather than one signature with default second
- // argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416)
-
- explicit basic_ifstream(const path& p)
- : std::basic_ifstream<charT,traits>(p.BOOST_FILESYSTEM_C_STR, std::ios_base::in) {}
-
- basic_ifstream(const path& p, std::ios_base::openmode mode)
- : std::basic_ifstream<charT,traits>(p.BOOST_FILESYSTEM_C_STR, mode) {}
-
- void open(const path& p)
- { std::basic_ifstream<charT,traits>::open(p.BOOST_FILESYSTEM_C_STR, std::ios_base::in); }
-
- void open(const path& p, std::ios_base::openmode mode)
- { std::basic_ifstream<charT,traits>::open(p.BOOST_FILESYSTEM_C_STR, mode); }
-
- virtual ~basic_ifstream() {}
- };
-
-//--------------------------------------------------------------------------------------//
-// basic_ofstream //
-//--------------------------------------------------------------------------------------//
-
- template < class charT, class traits = std::char_traits<charT> >
- class basic_ofstream : public std::basic_ofstream<charT,traits>
- {
- private: // disallow copying
- basic_ofstream(const basic_ofstream&);
- const basic_ofstream& operator=(const basic_ofstream&);
-
- public:
- basic_ofstream() {}
-
- // use two signatures, rather than one signature with default second
- // argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416)
-
- explicit basic_ofstream(const path& p)
- : std::basic_ofstream<charT,traits>(p.BOOST_FILESYSTEM_C_STR, std::ios_base::out) {}
-
- basic_ofstream(const path& p, std::ios_base::openmode mode)
- : std::basic_ofstream<charT,traits>(p.BOOST_FILESYSTEM_C_STR, mode) {}
-
- void open(const path& p)
- { std::basic_ofstream<charT,traits>::open(p.BOOST_FILESYSTEM_C_STR, std::ios_base::out); }
-
- void open(const path& p, std::ios_base::openmode mode)
- { std::basic_ofstream<charT,traits>::open(p.BOOST_FILESYSTEM_C_STR, mode); }
-
- virtual ~basic_ofstream() {}
- };
-
-//--------------------------------------------------------------------------------------//
-// basic_fstream //
-//--------------------------------------------------------------------------------------//
-
- template < class charT, class traits = std::char_traits<charT> >
- class basic_fstream : public std::basic_fstream<charT,traits>
- {
- private: // disallow copying
- basic_fstream(const basic_fstream&);
- const basic_fstream & operator=(const basic_fstream&);
-
- public:
- basic_fstream() {}
-
- // use two signatures, rather than one signature with default second
- // argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416)
-
- explicit basic_fstream(const path& p)
- : std::basic_fstream<charT,traits>(p.BOOST_FILESYSTEM_C_STR,
- std::ios_base::in | std::ios_base::out) {}
-
- basic_fstream(const path& p, std::ios_base::openmode mode)
- : std::basic_fstream<charT,traits>(p.BOOST_FILESYSTEM_C_STR, mode) {}
-
- void open(const path& p)
- { std::basic_fstream<charT,traits>::open(p.BOOST_FILESYSTEM_C_STR,
- std::ios_base::in | std::ios_base::out); }
-
- void open(const path& p, std::ios_base::openmode mode)
- { std::basic_fstream<charT,traits>::open(p.BOOST_FILESYSTEM_C_STR, mode); }
-
- virtual ~basic_fstream() {}
-
- };
-
-//--------------------------------------------------------------------------------------//
-// typedefs //
-//--------------------------------------------------------------------------------------//
-
- typedef basic_filebuf<char> filebuf;
- typedef basic_ifstream<char> ifstream;
- typedef basic_ofstream<char> ofstream;
- typedef basic_fstream<char> fstream;
-
- typedef basic_filebuf<wchar_t> wfilebuf;
- typedef basic_ifstream<wchar_t> wifstream;
- typedef basic_ofstream<wchar_t> wofstream;
- typedef basic_fstream<wchar_t> wfstream;
-
-} // namespace filesystem3
-} // namespace boost
-
-//----------------------------------------------------------------------------//
-
-namespace boost
-{
- namespace filesystem
- {
- using filesystem3::filebuf;
- using filesystem3::ifstream;
- using filesystem3::ofstream;
- using filesystem3::fstream;
- using filesystem3::wfilebuf;
- using filesystem3::wifstream;
- using filesystem3::wfstream;
- using filesystem3::wofstream;
- using filesystem3::basic_filebuf;
- using filesystem3::basic_ifstream;
- using filesystem3::basic_ofstream;
- using filesystem3::basic_fstream;
-
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
-# endif
- }
-}
-
-//----------------------------------------------------------------------------//
-
-#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
-#endif // BOOST_FILESYSTEM3_FSTREAM_HPP
diff --git a/boost/filesystem/v3/operations.hpp b/boost/filesystem/v3/operations.hpp
deleted file mode 100644
index ace3bc8f15..0000000000
--- a/boost/filesystem/v3/operations.hpp
+++ /dev/null
@@ -1,1199 +0,0 @@
-// boost/filesystem/operations.hpp ---------------------------------------------------//
-
-// Copyright Beman Dawes 2002-2009
-// Copyright Jan Langer 2002
-// Copyright Dietmar Kuehl 2001
-// Copyright Vladimir Prus 2002
-
-// Distributed under the Boost Software License, Version 1.0.
-// See http://www.boost.org/LICENSE_1_0.txt
-
-// Library home page: http://www.boost.org/libs/filesystem
-
-//--------------------------------------------------------------------------------------//
-
-#ifndef BOOST_FILESYSTEM3_OPERATIONS_HPP
-#define BOOST_FILESYSTEM3_OPERATIONS_HPP
-
-#include <boost/config.hpp>
-
-# if defined( BOOST_NO_STD_WSTRING )
-# error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
-# endif
-
-#include <boost/filesystem/v3/config.hpp>
-#include <boost/filesystem/v3/path.hpp>
-
-#include <boost/detail/scoped_enum_emulation.hpp>
-#include <boost/detail/bitmask.hpp>
-#include <boost/system/error_code.hpp>
-#include <boost/system/system_error.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/utility/enable_if.hpp>
-#include <boost/type_traits/is_same.hpp>
-#include <boost/iterator.hpp>
-#include <boost/cstdint.hpp>
-#include <boost/assert.hpp>
-
-#include <string>
-#include <utility> // for pair
-#include <ctime>
-#include <vector>
-#include <stack>
-
-#ifdef BOOST_WINDOWS_API
-# include <fstream>
-#endif
-
-#include <boost/config/abi_prefix.hpp> // must be the last #include
-
-//--------------------------------------------------------------------------------------//
-
-namespace boost
-{
- namespace filesystem3
- {
-
-//--------------------------------------------------------------------------------------//
-// file_type //
-//--------------------------------------------------------------------------------------//
-
- enum file_type
- {
- status_error,
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
- status_unknown = status_error,
-# endif
- file_not_found,
- regular_file,
- directory_file,
- // the following may not apply to some operating systems or file systems
- symlink_file,
- block_file,
- character_file,
- fifo_file,
- socket_file,
- reparse_file, // Windows: FILE_ATTRIBUTE_REPARSE_POINT that is not a symlink
- type_unknown, // file does exist, but isn't one of the above types or
- // we don't have strong enough permission to find its type
-
- _detail_directory_symlink // internal use only; never exposed to users
- };
-
-//--------------------------------------------------------------------------------------//
-// perms //
-//--------------------------------------------------------------------------------------//
-
- enum perms
- {
- no_perms = 0, // file_not_found is no_perms rather than perms_not_known
-
- // POSIX equivalent macros given in comments.
- // Values are from POSIX and are given in octal per the POSIX standard.
-
- // permission bits
-
- owner_read = 0400, // S_IRUSR, Read permission, owner
- owner_write = 0200, // S_IWUSR, Write permission, owner
- owner_exe = 0100, // S_IXUSR, Execute/search permission, owner
- owner_all = 0700, // S_IRWXU, Read, write, execute/search by owner
-
- group_read = 040, // S_IRGRP, Read permission, group
- group_write = 020, // S_IWGRP, Write permission, group
- group_exe = 010, // S_IXGRP, Execute/search permission, group
- group_all = 070, // S_IRWXG, Read, write, execute/search by group
-
- others_read = 04, // S_IROTH, Read permission, others
- others_write = 02, // S_IWOTH, Write permission, others
- others_exe = 01, // S_IXOTH, Execute/search permission, others
- others_all = 07, // S_IRWXO, Read, write, execute/search by others
-
- all_all = owner_all|group_all|others_all, // 0777
-
- // other POSIX bits
-
- set_uid_on_exe = 04000, // S_ISUID, Set-user-ID on execution
- set_gid_on_exe = 02000, // S_ISGID, Set-group-ID on execution
- sticky_bit = 01000, // S_ISVTX,
- // (POSIX XSI) On directories, restricted deletion flag
- // (V7) 'sticky bit': save swapped text even after use
- // (SunOS) On non-directories: don't cache this file
- // (SVID-v4.2) On directories: restricted deletion flag
- // Also see http://en.wikipedia.org/wiki/Sticky_bit
-
- perms_mask = all_all|set_uid_on_exe|set_gid_on_exe|sticky_bit, // 07777
-
- perms_not_known = 0xFFFF, // present when directory_entry cache not loaded
-
- // options for permissions() function
-
- add_perms = 0x1000, // adds the given permission bits to the current bits
- remove_perms = 0x2000, // removes the given permission bits from the current bits;
- // choose add_perms or remove_perms, not both; if neither add_perms
- // nor remove_perms is given, replace the current bits with
- // the given bits.
-
- symlink_perms = 0x4000 // on POSIX, don't resolve symlinks; implied on Windows
- };
-
- BOOST_BITMASK(perms)
-
-//--------------------------------------------------------------------------------------//
-// file_status //
-//--------------------------------------------------------------------------------------//
-
- class BOOST_FILESYSTEM_DECL file_status
- {
- public:
- file_status() : m_value(status_error), m_perms(perms_not_known) {}
- explicit file_status(file_type v, perms prms = perms_not_known)
- : m_value(v), m_perms(prms) {}
-
- // observers
- file_type type() const { return m_value; }
- perms permissions() const { return m_perms; }
-
- // modifiers
- void type(file_type v) { m_value = v; }
- void permissions(perms prms) { m_perms = prms; }
-
- bool operator==(const file_status& rhs) const { return type() == rhs.type() &&
- permissions() == rhs.permissions(); }
- bool operator!=(const file_status& rhs) const { return !(*this == rhs); }
-
- private:
- file_type m_value;
- enum perms m_perms;
- };
-
- inline bool type_present(file_status f) { return f.type() != status_error; }
- inline bool permissions_present(file_status f)
- {return f.permissions() != perms_not_known;}
- inline bool status_known(file_status f) { return type_present(f) && permissions_present(f); }
- inline bool exists(file_status f) { return f.type() != status_error
- && f.type() != file_not_found; }
- inline bool is_regular_file(file_status f){ return f.type() == regular_file; }
- inline bool is_directory(file_status f) { return f.type() == directory_file; }
- inline bool is_symlink(file_status f) { return f.type() == symlink_file; }
- inline bool is_other(file_status f) { return exists(f) && !is_regular_file(f)
- && !is_directory(f) && !is_symlink(f); }
-
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
- inline bool is_regular(file_status f) { return f.type() == regular_file; }
-# endif
-
- struct space_info
- {
- // all values are byte counts
- boost::uintmax_t capacity;
- boost::uintmax_t free; // <= capacity
- boost::uintmax_t available; // <= free
- };
-
- BOOST_SCOPED_ENUM_START(copy_option)
- {none, fail_if_exists = none, overwrite_if_exists};
- BOOST_SCOPED_ENUM_END
-
-//--------------------------------------------------------------------------------------//
-// implementation details //
-//--------------------------------------------------------------------------------------//
-
- namespace detail
- {
- BOOST_FILESYSTEM_DECL
- file_status status(const path&p, system::error_code* ec=0);
- BOOST_FILESYSTEM_DECL
- file_status symlink_status(const path& p, system::error_code* ec=0);
- BOOST_FILESYSTEM_DECL
- bool is_empty(const path& p, system::error_code* ec=0);
- BOOST_FILESYSTEM_DECL
- path initial_path(system::error_code* ec=0);
- BOOST_FILESYSTEM_DECL
- path canonical(const path& p, const path& base, system::error_code* ec=0);
- BOOST_FILESYSTEM_DECL
- void copy(const path& from, const path& to, system::error_code* ec=0);
- BOOST_FILESYSTEM_DECL
- void copy_directory(const path& from, const path& to, system::error_code* ec=0);
- BOOST_FILESYSTEM_DECL
- void copy_file(const path& from, const path& to,
- BOOST_SCOPED_ENUM(copy_option) option, // See ticket #2925
- system::error_code* ec=0);
- BOOST_FILESYSTEM_DECL
- void copy_symlink(const path& existing_symlink, const path& new_symlink, system::error_code* ec=0);
- BOOST_FILESYSTEM_DECL
- bool create_directories(const path& p, system::error_code* ec=0);
- BOOST_FILESYSTEM_DECL
- bool create_directory(const path& p, system::error_code* ec=0);
- BOOST_FILESYSTEM_DECL
- void create_directory_symlink(const path& to, const path& from,
- system::error_code* ec=0);
- BOOST_FILESYSTEM_DECL
- void create_hard_link(const path& to, const path& from, system::error_code* ec=0);
- BOOST_FILESYSTEM_DECL
- void create_symlink(const path& to, const path& from, system::error_code* ec=0);
- BOOST_FILESYSTEM_DECL
- path current_path(system::error_code* ec=0);
- BOOST_FILESYSTEM_DECL
- void current_path(const path& p, system::error_code* ec=0);
- BOOST_FILESYSTEM_DECL
- bool equivalent(const path& p1, const path& p2, system::error_code* ec=0);
- BOOST_FILESYSTEM_DECL
- boost::uintmax_t file_size(const path& p, system::error_code* ec=0);
- BOOST_FILESYSTEM_DECL
- boost::uintmax_t hard_link_count(const path& p, system::error_code* ec=0);
- BOOST_FILESYSTEM_DECL
- std::time_t last_write_time(const path& p, system::error_code* ec=0);
- BOOST_FILESYSTEM_DECL
- void last_write_time(const path& p, const std::time_t new_time,
- system::error_code* ec=0);
- BOOST_FILESYSTEM_DECL
- void permissions(const path& p, perms prms, system::error_code* ec=0);
- BOOST_FILESYSTEM_DECL
- path read_symlink(const path& p, system::error_code* ec=0);
- BOOST_FILESYSTEM_DECL
- // For standardization, if the committee doesn't like "remove", consider "eliminate"
- bool remove(const path& p, system::error_code* ec=0);
- BOOST_FILESYSTEM_DECL
- boost::uintmax_t remove_all(const path& p, system::error_code* ec=0);
- BOOST_FILESYSTEM_DECL
- void rename(const path& old_p, const path& new_p, system::error_code* ec=0);
- BOOST_FILESYSTEM_DECL
- void resize_file(const path& p, uintmax_t size, system::error_code* ec=0);
- BOOST_FILESYSTEM_DECL
- space_info space(const path& p, system::error_code* ec=0);
- BOOST_FILESYSTEM_DECL
- path system_complete(const path& p, system::error_code* ec=0);
- BOOST_FILESYSTEM_DECL
- path temp_directory_path(system::error_code* ec=0);
- BOOST_FILESYSTEM_DECL
- path unique_path(const path& p, system::error_code* ec=0);
- } // namespace detail
-
-//--------------------------------------------------------------------------------------//
-// //
-// status query functions //
-// //
-//--------------------------------------------------------------------------------------//
-
- inline
- file_status status(const path& p) {return detail::status(p);}
- inline
- file_status status(const path& p, system::error_code& ec)
- {return detail::status(p, &ec);}
- inline
- file_status symlink_status(const path& p) {return detail::symlink_status(p);}
- inline
- file_status symlink_status(const path& p, system::error_code& ec)
- {return detail::symlink_status(p, &ec);}
- inline
- bool exists(const path& p) {return exists(detail::status(p));}
- inline
- bool exists(const path& p, system::error_code& ec)
- {return exists(detail::status(p, &ec));}
- inline
- bool is_directory(const path& p) {return is_directory(detail::status(p));}
- inline
- bool is_directory(const path& p, system::error_code& ec)
- {return is_directory(detail::status(p, &ec));}
- inline
- bool is_regular_file(const path& p) {return is_regular_file(detail::status(p));}
- inline
- bool is_regular_file(const path& p, system::error_code& ec)
- {return is_regular_file(detail::status(p, &ec));}
- inline
- bool is_other(const path& p) {return is_other(detail::status(p));}
- inline
- bool is_other(const path& p, system::error_code& ec)
- {return is_other(detail::status(p, &ec));}
- inline
- bool is_symlink(const path& p) {return is_symlink(detail::symlink_status(p));}
- inline
- bool is_symlink(const path& p, system::error_code& ec)
- {return is_symlink(detail::symlink_status(p, &ec));}
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
- inline
- bool is_regular(const path& p) {return is_regular(detail::status(p));}
- inline
- bool is_regular(const path& p, system::error_code& ec)
- {return is_regular(detail::status(p, &ec));}
-# endif
-
- inline
- bool is_empty(const path& p) {return detail::is_empty(p);}
- inline
- bool is_empty(const path& p, system::error_code& ec)
- {return detail::is_empty(p, &ec);}
-
-//--------------------------------------------------------------------------------------//
-// //
-// operational functions //
-// in alphabetical order, unless otherwise noted //
-// //
-//--------------------------------------------------------------------------------------//
-
- // forward declarations
- path current_path(); // fwd declaration
- path initial_path();
-
- BOOST_FILESYSTEM_DECL
- path absolute(const path& p, const path& base=current_path());
- // If base.is_absolute(), throws nothing. Thus no need for ec argument
-
- inline
- path canonical(const path& p, const path& base=current_path())
- {return detail::canonical(p, base);}
- inline
- path canonical(const path& p, system::error_code& ec)
- {return detail::canonical(p, current_path(), &ec);}
- inline
- path canonical(const path& p, const path& base, system::error_code& ec)
- {return detail::canonical(p, base, &ec);}
-
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
- inline
- path complete(const path& p)
- {
- return absolute(p, initial_path());
- }
-
- inline
- path complete(const path& p, const path& base)
- {
- return absolute(p, base);
- }
-# endif
-
- inline
- void copy(const path& from, const path& to) {detail::copy(from, to);}
-
- inline
- void copy(const path& from, const path& to, system::error_code& ec)
- {detail::copy(from, to, &ec);}
- inline
- void copy_directory(const path& from, const path& to)
- {detail::copy_directory(from, to);}
- inline
- void copy_directory(const path& from, const path& to, system::error_code& ec)
- {detail::copy_directory(from, to, &ec);}
- inline
- void copy_file(const path& from, const path& to, // See ticket #2925
- BOOST_SCOPED_ENUM(copy_option) option)
- {detail::copy_file(from, to, option);}
- inline
- void copy_file(const path& from, const path& to)
- {detail::copy_file(from, to, copy_option::fail_if_exists);}
- inline
- void copy_file(const path& from, const path& to, // See ticket #2925
- BOOST_SCOPED_ENUM(copy_option) option, system::error_code& ec)
- {detail::copy_file(from, to, option, &ec);}
- inline
- void copy_file(const path& from, const path& to, system::error_code& ec)
- {detail::copy_file(from, to, copy_option::fail_if_exists, &ec);}
- inline
- void copy_symlink(const path& existing_symlink, const path& new_symlink) {detail::copy_symlink(existing_symlink, new_symlink);}
-
- inline
- void copy_symlink(const path& existing_symlink, const path& new_symlink, system::error_code& ec)
- {detail::copy_symlink(existing_symlink, new_symlink, &ec);}
- inline
- bool create_directories(const path& p) {return detail::create_directories(p);}
-
- inline
- bool create_directories(const path& p, system::error_code& ec)
- {return detail::create_directories(p, &ec);}
- inline
- bool create_directory(const path& p) {return detail::create_directory(p);}
-
- inline
- bool create_directory(const path& p, system::error_code& ec)
- {return detail::create_directory(p, &ec);}
- inline
- void create_directory_symlink(const path& to, const path& from)
- {detail::create_directory_symlink(to, from);}
- inline
- void create_directory_symlink(const path& to, const path& from, system::error_code& ec)
- {detail::create_directory_symlink(to, from, &ec);}
- inline
- void create_hard_link(const path& to, const path& new_hard_link) {detail::create_hard_link(to, new_hard_link);}
-
- inline
- void create_hard_link(const path& to, const path& new_hard_link, system::error_code& ec)
- {detail::create_hard_link(to, new_hard_link, &ec);}
- inline
- void create_symlink(const path& to, const path& new_symlink) {detail::create_symlink(to, new_symlink);}
-
- inline
- void create_symlink(const path& to, const path& new_symlink, system::error_code& ec)
- {detail::create_symlink(to, new_symlink, &ec);}
- inline
- path current_path() {return detail::current_path();}
-
- inline
- path current_path(system::error_code& ec) {return detail::current_path(&ec);}
-
- inline
- void current_path(const path& p) {detail::current_path(p);}
-
- inline
- void current_path(const path& p, system::error_code& ec) {detail::current_path(p, &ec);}
-
- inline
- bool equivalent(const path& p1, const path& p2) {return detail::equivalent(p1, p2);}
-
- inline
- bool equivalent(const path& p1, const path& p2, system::error_code& ec)
- {return detail::equivalent(p1, p2, &ec);}
- inline
- boost::uintmax_t file_size(const path& p) {return detail::file_size(p);}
-
- inline
- boost::uintmax_t file_size(const path& p, system::error_code& ec)
- {return detail::file_size(p, &ec);}
- inline
- boost::uintmax_t hard_link_count(const path& p) {return detail::hard_link_count(p);}
-
- inline
- boost::uintmax_t hard_link_count(const path& p, system::error_code& ec)
- {return detail::hard_link_count(p, &ec);}
- inline
- path initial_path() {return detail::initial_path();}
-
- inline
- path initial_path(system::error_code& ec) {return detail::initial_path(&ec);}
-
- template <class Path>
- path initial_path() {return initial_path();}
- template <class Path>
- path initial_path(system::error_code& ec) {return detail::initial_path(&ec);}
-
- inline
- std::time_t last_write_time(const path& p) {return detail::last_write_time(p);}
-
- inline
- std::time_t last_write_time(const path& p, system::error_code& ec)
- {return detail::last_write_time(p, &ec);}
- inline
- void last_write_time(const path& p, const std::time_t new_time)
- {detail::last_write_time(p, new_time);}
- inline
- void last_write_time(const path& p, const std::time_t new_time, system::error_code& ec)
- {detail::last_write_time(p, new_time, &ec);}
- inline
- void permissions(const path& p, perms prms)
- {detail::permissions(p, prms);}
- inline
- void permissions(const path& p, perms prms, system::error_code& ec)
- {detail::permissions(p, prms, &ec);}
-
- inline
- path read_symlink(const path& p) {return detail::read_symlink(p);}
-
- inline
- path read_symlink(const path& p, system::error_code& ec)
- {return detail::read_symlink(p, &ec);}
- inline
- // For standardization, if the committee doesn't like "remove", consider "eliminate"
- bool remove(const path& p) {return detail::remove(p);}
-
- inline
- bool remove(const path& p, system::error_code& ec) {return detail::remove(p, &ec);}
-
- inline
- boost::uintmax_t remove_all(const path& p) {return detail::remove_all(p);}
-
- inline
- boost::uintmax_t remove_all(const path& p, system::error_code& ec)
- {return detail::remove_all(p, &ec);}
- inline
- void rename(const path& old_p, const path& new_p) {detail::rename(old_p, new_p);}
-
- inline
- void rename(const path& old_p, const path& new_p, system::error_code& ec)
- {detail::rename(old_p, new_p, &ec);}
- inline // name suggested by Scott McMurray
- void resize_file(const path& p, uintmax_t size) {detail::resize_file(p, size);}
-
- inline
- void resize_file(const path& p, uintmax_t size, system::error_code& ec)
- {detail::resize_file(p, size, &ec);}
- inline
- space_info space(const path& p) {return detail::space(p);}
-
- inline
- space_info space(const path& p, system::error_code& ec) {return detail::space(p, &ec);}
-
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
- inline bool symbolic_link_exists(const path& p)
- { return is_symlink(symlink_status(p)); }
-# endif
-
- inline
- path system_complete(const path& p) {return detail::system_complete(p);}
-
- inline
- path system_complete(const path& p, system::error_code& ec)
- {return detail::system_complete(p, &ec);}
- inline
- path temp_directory_path() {return detail::temp_directory_path();}
-
- inline
- path temp_directory_path(system::error_code& ec)
- {return detail::temp_directory_path(&ec);}
- inline
- path unique_path(const path& p="%%%%-%%%%-%%%%-%%%%")
- { return detail::unique_path(p); }
- inline
- path unique_path(const path& p, system::error_code& ec)
- { return detail::unique_path(p, &ec); }
-
-//--------------------------------------------------------------------------------------//
-// //
-// directory_entry //
-// //
-//--------------------------------------------------------------------------------------//
-
-// GCC has a problem with a member function named path within a namespace or
-// sub-namespace that also has a class named path. The workaround is to always
-// fully qualify the name path when it refers to the class name.
-
-class BOOST_FILESYSTEM_DECL directory_entry
-{
-public:
-
- // compiler generated copy constructor, copy assignment, and destructor apply
-
- directory_entry() {}
- explicit directory_entry(const boost::filesystem::path& p,
- file_status st = file_status(), file_status symlink_st=file_status())
- : m_path(p), m_status(st), m_symlink_status(symlink_st)
- {}
-
- void assign(const boost::filesystem::path& p,
- file_status st = file_status(), file_status symlink_st = file_status())
- { m_path = p; m_status = st; m_symlink_status = symlink_st; }
-
- void replace_filename(const boost::filesystem::path& p,
- file_status st = file_status(), file_status symlink_st = file_status())
- {
- m_path.remove_filename();
- m_path /= p;
- m_status = st;
- m_symlink_status = symlink_st;
- }
-
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
- void replace_leaf(const boost::filesystem::path& p,
- file_status st, file_status symlink_st)
- { replace_filename(p, st, symlink_st); }
-# endif
-
- const boost::filesystem::path& path() const {return m_path;}
- file_status status() const {return m_get_status();}
- file_status status(system::error_code& ec) const {return m_get_status(&ec);}
- file_status symlink_status() const {return m_get_symlink_status();}
- file_status symlink_status(system::error_code& ec) const {return m_get_symlink_status(&ec);}
-
- bool operator==(const directory_entry& rhs) {return m_path == rhs.m_path;}
- bool operator!=(const directory_entry& rhs) {return m_path != rhs.m_path;}
- bool operator< (const directory_entry& rhs) {return m_path < rhs.m_path;}
- bool operator<=(const directory_entry& rhs) {return m_path <= rhs.m_path;}
- bool operator> (const directory_entry& rhs) {return m_path > rhs.m_path;}
- bool operator>=(const directory_entry& rhs) {return m_path >= rhs.m_path;}
-
-private:
- boost::filesystem::path m_path;
- mutable file_status m_status; // stat()-like
- mutable file_status m_symlink_status; // lstat()-like
-
- file_status m_get_status(system::error_code* ec=0) const;
- file_status m_get_symlink_status(system::error_code* ec=0) const;
-}; // directory_entry
-
-//--------------------------------------------------------------------------------------//
-// //
-// directory_iterator helpers //
-// //
-//--------------------------------------------------------------------------------------//
-
-class directory_iterator;
-
-namespace detail
-{
- BOOST_FILESYSTEM_DECL
- system::error_code dir_itr_close(// never throws()
- void *& handle
-# if defined(BOOST_POSIX_API)
- , void *& buffer
-# endif
- );
-
- struct dir_itr_imp
- {
- directory_entry dir_entry;
- void* handle;
-
-# ifdef BOOST_POSIX_API
- void* buffer; // see dir_itr_increment implementation
-# endif
-
- dir_itr_imp() : handle(0)
-# ifdef BOOST_POSIX_API
- , buffer(0)
-# endif
- {}
-
- ~dir_itr_imp() // never throws
- {
- dir_itr_close(handle
-# if defined(BOOST_POSIX_API)
- , buffer
-# endif
- );
- }
- };
-
- // see path::iterator: comment below
- BOOST_FILESYSTEM_DECL void directory_iterator_construct(directory_iterator& it,
- const path& p, system::error_code* ec);
- BOOST_FILESYSTEM_DECL void directory_iterator_increment(directory_iterator& it,
- system::error_code* ec);
-
-} // namespace detail
-
-//--------------------------------------------------------------------------------------//
-// //
-// directory_iterator //
-// //
-//--------------------------------------------------------------------------------------//
-
- class directory_iterator
- : public boost::iterator_facade< directory_iterator,
- directory_entry,
- boost::single_pass_traversal_tag >
- {
- public:
-
- directory_iterator(){} // creates the "end" iterator
-
- // iterator_facade derived classes don't seem to like implementations in
- // separate translation unit dll's, so forward to detail functions
- explicit directory_iterator(const path& p)
- : m_imp(new detail::dir_itr_imp)
- { detail::directory_iterator_construct(*this, p, 0); }
-
- directory_iterator(const path& p, system::error_code& ec)
- : m_imp(new detail::dir_itr_imp)
- { detail::directory_iterator_construct(*this, p, &ec); }
-
- ~directory_iterator() {} // never throws
-
- directory_iterator& increment(system::error_code& ec)
- {
- detail::directory_iterator_increment(*this, &ec);
- return *this;
- }
-
- private:
- friend struct detail::dir_itr_imp;
- friend BOOST_FILESYSTEM_DECL void detail::directory_iterator_construct(directory_iterator& it,
- const path& p, system::error_code* ec);
- friend BOOST_FILESYSTEM_DECL void detail::directory_iterator_increment(directory_iterator& it,
- system::error_code* ec);
-
- // shared_ptr provides shallow-copy semantics required for InputIterators.
- // m_imp.get()==0 indicates the end iterator.
- boost::shared_ptr< detail::dir_itr_imp > m_imp;
-
- friend class boost::iterator_core_access;
-
- boost::iterator_facade<
- directory_iterator,
- directory_entry,
- boost::single_pass_traversal_tag >::reference dereference() const
- {
- BOOST_ASSERT_MSG(m_imp.get(), "attempt to dereference end iterator");
- return m_imp->dir_entry;
- }
-
- void increment() { detail::directory_iterator_increment(*this, 0); }
-
- bool equal(const directory_iterator& rhs) const
- { return m_imp == rhs.m_imp; }
- };
-
-//--------------------------------------------------------------------------------------//
-// //
-// recursive_directory_iterator helpers //
-// //
-//--------------------------------------------------------------------------------------//
-
- BOOST_SCOPED_ENUM_START(symlink_option)
- {
- none,
- no_recurse = none, // don't follow directory symlinks (default behavior)
- recurse, // follow directory symlinks
- _detail_no_push = recurse << 1 // internal use only
- };
- BOOST_SCOPED_ENUM_END
-
- BOOST_BITMASK(BOOST_SCOPED_ENUM(symlink_option))
-
- namespace detail
- {
- struct recur_dir_itr_imp
- {
- typedef directory_iterator element_type;
- std::stack< element_type, std::vector< element_type > > m_stack;
- int m_level;
- BOOST_SCOPED_ENUM(symlink_option) m_options;
-
- recur_dir_itr_imp() : m_level(0), m_options(symlink_option::none) {}
-
- void increment(system::error_code* ec); // ec == 0 means throw on error
-
- void pop();
-
- };
-
- // Implementation is inline to avoid dynamic linking difficulties with m_stack:
- // Microsoft warning C4251, m_stack needs to have dll-interface to be used by
- // clients of struct 'boost::filesystem::detail::recur_dir_itr_imp'
-
- inline
- void recur_dir_itr_imp::increment(system::error_code* ec)
- // ec == 0 means throw on error
- {
- if ((m_options & symlink_option::_detail_no_push) == symlink_option::_detail_no_push)
- m_options &= ~symlink_option::_detail_no_push;
-
- else
- {
- // Logic for following predicate was contributed by Daniel Aarno to handle cyclic
- // symlinks correctly and efficiently, fixing ticket #5652.
- // if (((m_options & symlink_option::recurse) == symlink_option::recurse
- // || !is_symlink(m_stack.top()->symlink_status()))
- // && is_directory(m_stack.top()->status())) ...
- // The predicate code has since been rewritten to pass error_code arguments,
- // per ticket #5653.
- bool or_pred = (m_options & symlink_option::recurse) == symlink_option::recurse
- || (ec == 0 ? !is_symlink(m_stack.top()->symlink_status())
- : !is_symlink(m_stack.top()->symlink_status(*ec)));
- if (ec != 0 && *ec)
- return;
- bool and_pred = or_pred && (ec == 0 ? is_directory(m_stack.top()->status())
- : is_directory(m_stack.top()->status(*ec)));
- if (ec != 0 && *ec)
- return;
-
- if (and_pred)
- {
- if (ec == 0)
- m_stack.push(directory_iterator(m_stack.top()->path()));
- else
- {
- m_stack.push(directory_iterator(m_stack.top()->path(), *ec));
- if (*ec)
- return;
- }
- if (m_stack.top() != directory_iterator())
- {
- ++m_level;
- return;
- }
- m_stack.pop();
- }
- }
-
- while (!m_stack.empty() && ++m_stack.top() == directory_iterator())
- {
- m_stack.pop();
- --m_level;
- }
- }
-
- inline
- void recur_dir_itr_imp::pop()
- {
- BOOST_ASSERT_MSG(m_level > 0,
- "pop() on recursive_directory_iterator with level < 1");
-
- do
- {
- m_stack.pop();
- --m_level;
- }
- while (!m_stack.empty() && ++m_stack.top() == directory_iterator());
- }
- } // namespace detail
-
-//--------------------------------------------------------------------------------------//
-// //
-// recursive_directory_iterator //
-// //
-//--------------------------------------------------------------------------------------//
-
- class recursive_directory_iterator
- : public boost::iterator_facade<
- recursive_directory_iterator,
- directory_entry,
- boost::single_pass_traversal_tag >
- {
- public:
-
- recursive_directory_iterator(){} // creates the "end" iterator
-
- explicit recursive_directory_iterator(const path& dir_path,
- BOOST_SCOPED_ENUM(symlink_option) opt = symlink_option::none)
- : m_imp(new detail::recur_dir_itr_imp)
- {
- m_imp->m_options = opt;
- m_imp->m_stack.push(directory_iterator(dir_path));
- if (m_imp->m_stack.top() == directory_iterator())
- { m_imp.reset (); }
- }
-
- recursive_directory_iterator(const path& dir_path,
- BOOST_SCOPED_ENUM(symlink_option) opt,
- system::error_code & ec)
- : m_imp(new detail::recur_dir_itr_imp)
- {
- m_imp->m_options = opt;
- m_imp->m_stack.push(directory_iterator(dir_path, ec));
- if (m_imp->m_stack.top() == directory_iterator())
- { m_imp.reset (); }
- }
-
- recursive_directory_iterator(const path& dir_path,
- system::error_code & ec)
- : m_imp(new detail::recur_dir_itr_imp)
- {
- m_imp->m_options = symlink_option::none;
- m_imp->m_stack.push(directory_iterator(dir_path, ec));
- if (m_imp->m_stack.top() == directory_iterator())
- { m_imp.reset (); }
- }
-
- recursive_directory_iterator& increment(system::error_code& ec)
- {
- BOOST_ASSERT_MSG(m_imp.get(),
- "increment() on end recursive_directory_iterator");
- m_imp->increment(&ec);
- if (m_imp->m_stack.empty())
- m_imp.reset(); // done, so make end iterator
- return *this;
- }
-
- int level() const
- {
- BOOST_ASSERT_MSG(m_imp.get(),
- "level() on end recursive_directory_iterator");
- return m_imp->m_level;
- }
-
- bool no_push_pending() const
- {
- BOOST_ASSERT_MSG(m_imp.get(),
- "is_no_push_requested() on end recursive_directory_iterator");
- return (m_imp->m_options & symlink_option::_detail_no_push)
- == symlink_option::_detail_no_push;
- }
-
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
- bool no_push_request() const { return no_push_pending(); }
-# endif
-
- void pop()
- {
- BOOST_ASSERT_MSG(m_imp.get(),
- "pop() on end recursive_directory_iterator");
- m_imp->pop();
- if (m_imp->m_stack.empty()) m_imp.reset(); // done, so make end iterator
- }
-
- void no_push(bool value=true)
- {
- BOOST_ASSERT_MSG(m_imp.get(),
- "no_push() on end recursive_directory_iterator");
- if (value)
- m_imp->m_options |= symlink_option::_detail_no_push;
- else
- m_imp->m_options &= ~symlink_option::_detail_no_push;
- }
-
- file_status status() const
- {
- BOOST_ASSERT_MSG(m_imp.get(),
- "status() on end recursive_directory_iterator");
- return m_imp->m_stack.top()->status();
- }
-
- file_status symlink_status() const
- {
- BOOST_ASSERT_MSG(m_imp.get(),
- "symlink_status() on end recursive_directory_iterator");
- return m_imp->m_stack.top()->symlink_status();
- }
-
- private:
-
- // shared_ptr provides shallow-copy semantics required for InputIterators.
- // m_imp.get()==0 indicates the end iterator.
- boost::shared_ptr< detail::recur_dir_itr_imp > m_imp;
-
- friend class boost::iterator_core_access;
-
- boost::iterator_facade<
- recursive_directory_iterator,
- directory_entry,
- boost::single_pass_traversal_tag >::reference
- dereference() const
- {
- BOOST_ASSERT_MSG(m_imp.get(),
- "dereference of end recursive_directory_iterator");
- return *m_imp->m_stack.top();
- }
-
- void increment()
- {
- BOOST_ASSERT_MSG(m_imp.get(),
- "increment of end recursive_directory_iterator");
- m_imp->increment(0);
- if (m_imp->m_stack.empty())
- m_imp.reset(); // done, so make end iterator
- }
-
- bool equal(const recursive_directory_iterator& rhs) const
- { return m_imp == rhs.m_imp; }
-
- };
-
-# if !defined(BOOST_FILESYSTEM_NO_DEPRECATED)
- typedef recursive_directory_iterator wrecursive_directory_iterator;
-# endif
-
-//--------------------------------------------------------------------------------------//
-// //
-// class filesystem_error //
-// //
-//--------------------------------------------------------------------------------------//
-
- class BOOST_SYMBOL_VISIBLE filesystem_error : public system::system_error
- {
- // see http://www.boost.org/more/error_handling.html for design rationale
-
- // all functions are inline to avoid issues with crossing dll boundaries
-
- public:
- // compiler generates copy constructor and copy assignment
-
- filesystem_error(
- const std::string & what_arg, system::error_code ec)
- : system::system_error(ec, what_arg)
- {
- try
- {
- m_imp_ptr.reset(new m_imp);
- }
- catch (...) { m_imp_ptr.reset(); }
- }
-
- filesystem_error(
- const std::string & what_arg, const path& path1_arg,
- system::error_code ec)
- : system::system_error(ec, what_arg)
- {
- try
- {
- m_imp_ptr.reset(new m_imp);
- m_imp_ptr->m_path1 = path1_arg;
- }
- catch (...) { m_imp_ptr.reset(); }
- }
-
- filesystem_error(
- const std::string & what_arg, const path& path1_arg,
- const path& path2_arg, system::error_code ec)
- : system::system_error(ec, what_arg)
- {
- try
- {
- m_imp_ptr.reset(new m_imp);
- m_imp_ptr->m_path1 = path1_arg;
- m_imp_ptr->m_path2 = path2_arg;
- }
- catch (...) { m_imp_ptr.reset(); }
- }
-
- ~filesystem_error() throw() {}
-
- const path& path1() const
- {
- static const path empty_path;
- return m_imp_ptr.get() ? m_imp_ptr->m_path1 : empty_path ;
- }
- const path& path2() const
- {
- static const path empty_path;
- return m_imp_ptr.get() ? m_imp_ptr->m_path2 : empty_path ;
- }
-
- const char* what() const throw()
- {
- if (!m_imp_ptr.get())
- return system::system_error::what();
-
- try
- {
- if (m_imp_ptr->m_what.empty())
- {
- m_imp_ptr->m_what = system::system_error::what();
- if (!m_imp_ptr->m_path1.empty())
- {
- m_imp_ptr->m_what += ": \"";
- m_imp_ptr->m_what += m_imp_ptr->m_path1.string();
- m_imp_ptr->m_what += "\"";
- }
- if (!m_imp_ptr->m_path2.empty())
- {
- m_imp_ptr->m_what += ", \"";
- m_imp_ptr->m_what += m_imp_ptr->m_path2.string();
- m_imp_ptr->m_what += "\"";
- }
- }
- return m_imp_ptr->m_what.c_str();
- }
- catch (...)
- {
- return system::system_error::what();
- }
- }
-
- private:
- struct m_imp
- {
- path m_path1; // may be empty()
- path m_path2; // may be empty()
- std::string m_what; // not built until needed
- };
- boost::shared_ptr<m_imp> m_imp_ptr;
- };
-
-// test helper -----------------------------------------------------------------------//
-
-// Not part of the documented interface since false positives are possible;
-// there is no law that says that an OS that has large stat.st_size
-// actually supports large file sizes.
-
- namespace detail
- {
- BOOST_FILESYSTEM_DECL bool possible_large_file_size_support();
- }
-
- } // namespace filesystem3
-} // namespace boost
-
-//----------------------------------------------------------------------------//
-
-namespace boost
-{
- namespace filesystem
- {
- // permissions
- using filesystem3::no_perms;
- using filesystem3::owner_read;
- using filesystem3::owner_write;
- using filesystem3::owner_exe;
- using filesystem3::owner_all;
- using filesystem3::group_read;
- using filesystem3::group_write;
- using filesystem3::group_exe;
- using filesystem3::group_all;
- using filesystem3::others_read;
- using filesystem3::others_write;
- using filesystem3::others_exe;
- using filesystem3::others_all;
- using filesystem3::all_all;
- using filesystem3::set_uid_on_exe;
- using filesystem3::set_gid_on_exe;
- using filesystem3::sticky_bit;
- using filesystem3::perms_mask;
- using filesystem3::perms_not_known;
- using filesystem3::add_perms;
- using filesystem3::remove_perms;
- using filesystem3::symlink_perms;
-
- using filesystem3::absolute;
- using filesystem3::block_file;
- using filesystem3::canonical;
- using filesystem3::character_file;
-// using filesystem3::copy;
- using filesystem3::copy_file;
- using filesystem3::copy_option;
- using filesystem3::copy_symlink;
- using filesystem3::create_directories;
- using filesystem3::create_directory;
- using filesystem3::create_hard_link;
- using filesystem3::create_symlink;
- using filesystem3::create_directory_symlink;
- using filesystem3::current_path;
- using filesystem3::directory_entry;
- using filesystem3::directory_file;
- using filesystem3::directory_iterator;
- using filesystem3::equivalent;
- using filesystem3::exists;
- using filesystem3::fifo_file;
- using filesystem3::file_not_found;
- using filesystem3::file_size;
- using filesystem3::file_status;
- using filesystem3::file_type;
- using filesystem3::filesystem_error;
- using filesystem3::hard_link_count;
- using filesystem3::initial_path;
- using filesystem3::is_directory;
- using filesystem3::is_directory;
- using filesystem3::is_empty;
- using filesystem3::is_other;
- using filesystem3::is_regular_file;
- using filesystem3::is_symlink;
- using filesystem3::last_write_time;
- using filesystem3::permissions;
- using filesystem3::permissions_present;
- using filesystem3::perms;
- using filesystem3::read_symlink;
- using filesystem3::recursive_directory_iterator;
- using filesystem3::regular_file;
- using filesystem3::reparse_file;
- using filesystem3::remove;
- using filesystem3::remove_all;
- using filesystem3::rename;
- using filesystem3::resize_file;
- using filesystem3::socket_file;
- using filesystem3::space;
- using filesystem3::space_info;
- using filesystem3::status;
- using filesystem3::status_error;
- using filesystem3::status_known;
- using filesystem3::symlink_file;
- using filesystem3::symlink_option;
- using filesystem3::symlink_status;
- using filesystem3::system_complete;
- using filesystem3::temp_directory_path;
- using filesystem3::type_present;
- using filesystem3::type_unknown;
- using filesystem3::unique_path;
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
- using filesystem3::is_regular;
- using filesystem3::status_unknown;
- using filesystem3::symbolic_link_exists;
- //using filesystem3::wdirectory_iterator;
- //using filesystem3::wdirectory_entry;
-# endif
- namespace detail
- {
- using filesystem3::detail::possible_large_file_size_support;
- }
- }
-}
-
-#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
-#endif // BOOST_FILESYSTEM3_OPERATIONS_HPP
diff --git a/boost/filesystem/v3/path.hpp b/boost/filesystem/v3/path.hpp
deleted file mode 100644
index c483671d0f..0000000000
--- a/boost/filesystem/v3/path.hpp
+++ /dev/null
@@ -1,760 +0,0 @@
-// filesystem path.hpp ---------------------------------------------------------------//
-
-// Copyright Beman Dawes 2002-2005, 2009
-// Copyright Vladimir Prus 2002
-
-// Distributed under the Boost Software License, Version 1.0.
-// See http://www.boost.org/LICENSE_1_0.txt
-
-// Library home page: http://www.boost.org/libs/filesystem
-
-// path::stem(), extension(), and replace_extension() are based on
-// basename(), extension(), and change_extension() from the original
-// filesystem/convenience.hpp header by Vladimir Prus.
-
-#ifndef BOOST_FILESYSTEM_PATH_HPP
-#define BOOST_FILESYSTEM_PATH_HPP
-
-#include <boost/config.hpp>
-
-# if defined( BOOST_NO_STD_WSTRING )
-# error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
-# endif
-
-#include <boost/filesystem/v3/config.hpp>
-#include <boost/filesystem/v3/path_traits.hpp> // includes <cwchar>
-#include <boost/system/error_code.hpp>
-#include <boost/system/system_error.hpp>
-#include <boost/iterator/iterator_facade.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/io/detail/quoted_manip.hpp>
-#include <boost/static_assert.hpp>
-#include <boost/functional/hash_fwd.hpp>
-#include <string>
-#include <iterator>
-#include <cstring>
-#include <iosfwd>
-#include <stdexcept>
-#include <cassert>
-#include <locale>
-#include <algorithm>
-
-#include <boost/config/abi_prefix.hpp> // must be the last #include
-
-namespace boost
-{
-namespace filesystem3
-{
- //------------------------------------------------------------------------------------//
- // //
- // class path //
- // //
- //------------------------------------------------------------------------------------//
-
- class BOOST_FILESYSTEM_DECL path
- {
- public:
-
- // value_type is the character type used by the operating system API to
- // represent paths.
-
-# ifdef BOOST_WINDOWS_API
- typedef wchar_t value_type;
-# else
- typedef char value_type;
-# endif
- typedef std::basic_string<value_type> string_type;
- typedef std::codecvt<wchar_t, char, std::mbstate_t> codecvt_type;
-
-
- // ----- character encoding conversions -----
-
- // Following the principle of least astonishment, path input arguments
- // passed to or obtained from the operating system via objects of
- // class path behave as if they were directly passed to or
- // obtained from the O/S API, unless conversion is explicitly requested.
- //
- // POSIX specfies that path strings are passed unchanged to and from the
- // API. Note that this is different from the POSIX command line utilities,
- // which convert according to a locale.
- //
- // Thus for POSIX, char strings do not undergo conversion. wchar_t strings
- // are converted to/from char using the path locale or, if a conversion
- // argument is given, using a conversion object modeled on
- // std::wstring_convert.
- //
- // The path locale, which is global to the thread, can be changed by the
- // imbue() function. It is initialized to an implementation defined locale.
- //
- // For Windows, wchar_t strings do not undergo conversion. char strings
- // are converted using the "ANSI" or "OEM" code pages, as determined by
- // the AreFileApisANSI() function, or, if a conversion argument is given,
- // using a conversion object modeled on std::wstring_convert.
- //
- // See m_pathname comments for further important rationale.
-
- // TODO: rules needed for operating systems that use / or .
- // differently, or format directory paths differently from file paths.
- //
- // **********************************************************************************
- //
- // More work needed: How to handle an operating system that may have
- // slash characters or dot characters in valid filenames, either because
- // it doesn't follow the POSIX standard, or because it allows MBCS
- // filename encodings that may contain slash or dot characters. For
- // example, ISO/IEC 2022 (JIS) encoding which allows switching to
- // JIS x0208-1983 encoding. A valid filename in this set of encodings is
- // 0x1B 0x24 0x42 [switch to X0208-1983] 0x24 0x2F [U+304F Kiragana letter KU]
- // ^^^^
- // Note that 0x2F is the ASCII slash character
- //
- // **********************************************************************************
-
- // Supported source arguments: half-open iterator range, container, c-array,
- // and single pointer to null terminated string.
-
- // All source arguments except pointers to null terminated byte strings support
- // multi-byte character strings which may have embedded nulls. Embedded null
- // support is required for some Asian languages on Windows.
-
- // [defaults] "const codecvt_type& cvt=codecvt()" default arguments are not used
- // because some compilers, such as Microsoft prior to VC++ 10, do not handle defaults
- // correctly in templates.
-
- // ----- constructors -----
-
- path(){}
-
- path(const path& p) : m_pathname(p.m_pathname) {}
-
- template <class Source>
- path(Source const& source,
- typename boost::enable_if<path_traits::is_pathable<
- typename boost::decay<Source>::type> >::type* =0)
- {
- path_traits::dispatch(source, m_pathname, codecvt());
- }
-
- // Overloads for the operating system API's native character type. Rationale:
- // - Avoids use of codecvt() for native value_type strings. This limits the
- // impact of locale("") initialization failures on POSIX systems to programs
- // that actually depend on locale(""). It further ensures that exceptions thrown
- // as a result of such failues occur after main() has started, so can be caught.
- // This is a partial resolution of tickets 4688, 5100, and 5289.
- // - A slight optimization for a common use case, particularly on POSIX since
- // value_type is char and that is the most common useage.
- path(const value_type* s) : m_pathname(s) {}
- path(const std::basic_string<value_type>& s) : m_pathname(s) {}
-
- template <class Source>
- path(Source const& source, const codecvt_type& cvt)
- // see [defaults] note above explaining why codecvt() default arguments are not used
- {
- path_traits::dispatch(source, m_pathname, cvt);
- }
-
- template <class InputIterator>
- path(InputIterator begin, InputIterator end)
- {
- if (begin != end)
- {
- std::basic_string<typename std::iterator_traits<InputIterator>::value_type>
- s(begin, end);
- path_traits::convert(s.c_str(), s.c_str()+s.size(), m_pathname, codecvt());
- }
- }
-
- template <class InputIterator>
- path(InputIterator begin, InputIterator end, const codecvt_type& cvt)
- {
- if (begin != end)
- {
- std::basic_string<typename std::iterator_traits<InputIterator>::value_type>
- s(begin, end);
- path_traits::convert(s.c_str(), s.c_str()+s.size(), m_pathname, cvt);
- }
- }
-
- // ----- assignments -----
-
- path& operator=(const path& p)
- {
- m_pathname = p.m_pathname;
- return *this;
- }
-
- path& operator=(const value_type* ptr) // required in case ptr overlaps *this
- {
- m_pathname = ptr;
- return *this;
- }
-
- template <class Source>
- typename boost::enable_if<path_traits::is_pathable<
- typename boost::decay<Source>::type>, path&>::type
- operator=(Source const& source)
- {
- m_pathname.clear();
- path_traits::dispatch(source, m_pathname, codecvt());
- return *this;
- }
-
- path& assign(const value_type* ptr, const codecvt_type&) // required in case ptr overlaps *this
- {
- m_pathname = ptr;
- return *this;
- }
-
- template <class Source>
- path& assign(Source const& source, const codecvt_type& cvt)
- {
- m_pathname.clear();
- path_traits::dispatch(source, m_pathname, cvt);
- return *this;
- }
-
- template <class InputIterator>
- path& assign(InputIterator begin, InputIterator end)
- {
- return assign(begin, end, codecvt());
- }
-
- template <class InputIterator>
- path& assign(InputIterator begin, InputIterator end, const codecvt_type& cvt)
- {
- m_pathname.clear();
- if (begin != end)
- {
- std::basic_string<typename std::iterator_traits<InputIterator>::value_type>
- s(begin, end);
- path_traits::convert(s.c_str(), s.c_str()+s.size(), m_pathname, cvt);
- }
- return *this;
- }
-
- // ----- appends -----
-
- // if a separator is added, it is the preferred separator for the platform;
- // slash for POSIX, backslash for Windows
-
- path& operator/=(const path& p);
-
- path& operator/=(const value_type* ptr);
-
- template <class Source>
- typename boost::enable_if<path_traits::is_pathable<
- typename boost::decay<Source>::type>, path&>::type
- operator/=(Source const& source)
- {
- return append(source, codecvt());
- }
-
- path& append(const value_type* ptr, const codecvt_type&) // required in case ptr overlaps *this
- {
- this->operator/=(ptr);
- return *this;
- }
-
- template <class Source>
- path& append(Source const& source, const codecvt_type& cvt);
-
- template <class InputIterator>
- path& append(InputIterator begin, InputIterator end)
- {
- return append(begin, end, codecvt());
- }
-
- template <class InputIterator>
- path& append(InputIterator begin, InputIterator end, const codecvt_type& cvt);
-
- // ----- modifiers -----
-
- void clear() { m_pathname.clear(); }
- path& make_preferred()
-# ifdef BOOST_POSIX_API
- { return *this; } // POSIX no effect
-# else // BOOST_WINDOWS_API
- ; // change slashes to backslashes
-# endif
- path& remove_filename();
- path& replace_extension(const path& new_extension = path());
- void swap(path& rhs) { m_pathname.swap(rhs.m_pathname); }
-
- // ----- observers -----
-
- // For operating systems that format file paths differently than directory
- // paths, return values from observers are formatted as file names unless there
- // is a trailing separator, in which case returns are formatted as directory
- // paths. POSIX and Windows make no such distinction.
-
- // Implementations are permitted to return const values or const references.
-
- // The string or path returned by an observer are specified as being formatted
- // as "native" or "generic".
- //
- // For POSIX, these are all the same format; slashes and backslashes are as input and
- // are not modified.
- //
- // For Windows, native: as input; slashes and backslashes are not modified;
- // this is the format of the internally stored string.
- // generic: backslashes are converted to slashes
-
- // ----- native format observers -----
-
- const string_type& native() const { return m_pathname; } // Throws: nothing
- const value_type* c_str() const { return m_pathname.c_str(); } // Throws: nothing
-
- template <class String>
- String string() const;
-
- template <class String>
- String string(const codecvt_type& cvt) const;
-
-# ifdef BOOST_WINDOWS_API
- const std::string string() const { return string(codecvt()); }
- const std::string string(const codecvt_type& cvt) const
- {
- std::string tmp;
- if (!m_pathname.empty())
- path_traits::convert(&*m_pathname.begin(), &*m_pathname.begin()+m_pathname.size(),
- tmp, cvt);
- return tmp;
- }
-
- // string_type is std::wstring, so there is no conversion
- const std::wstring& wstring() const { return m_pathname; }
- const std::wstring& wstring(const codecvt_type&) const { return m_pathname; }
-
-# else // BOOST_POSIX_API
- // string_type is std::string, so there is no conversion
- const std::string& string() const { return m_pathname; }
- const std::string& string(const codecvt_type&) const { return m_pathname; }
-
- const std::wstring wstring() const { return wstring(codecvt()); }
- const std::wstring wstring(const codecvt_type& cvt) const
- {
- std::wstring tmp;
- if (!m_pathname.empty())
- path_traits::convert(&*m_pathname.begin(), &*m_pathname.begin()+m_pathname.size(),
- tmp, cvt);
- return tmp;
- }
-
-# endif
-
- // ----- generic format observers -----
-
- template <class String>
- String generic_string() const;
-
- template <class String>
- String generic_string(const codecvt_type& cvt) const;
-
-# ifdef BOOST_WINDOWS_API
- const std::string generic_string() const { return generic_string(codecvt()); }
- const std::string generic_string(const codecvt_type& cvt) const;
- const std::wstring generic_wstring() const;
- const std::wstring generic_wstring(const codecvt_type&) const { return generic_wstring(); };
-
-# else // BOOST_POSIX_API
- // On POSIX-like systems, the generic format is the same as the native format
- const std::string& generic_string() const { return m_pathname; }
- const std::string& generic_string(const codecvt_type&) const { return m_pathname; }
- const std::wstring generic_wstring() const { return wstring(codecvt()); }
- const std::wstring generic_wstring(const codecvt_type& cvt) const { return wstring(cvt); }
-
-# endif
-
- // ----- decomposition -----
-
- path root_path() const;
- path root_name() const; // returns 0 or 1 element path
- // even on POSIX, root_name() is non-empty() for network paths
- path root_directory() const; // returns 0 or 1 element path
- path relative_path() const;
- path parent_path() const;
- path filename() const; // returns 0 or 1 element path
- path stem() const; // returns 0 or 1 element path
- path extension() const; // returns 0 or 1 element path
-
- // ----- query -----
-
- bool empty() const { return m_pathname.empty(); } // name consistent with std containers
- bool has_root_path() const { return has_root_directory() || has_root_name(); }
- bool has_root_name() const { return !root_name().empty(); }
- bool has_root_directory() const { return !root_directory().empty(); }
- bool has_relative_path() const { return !relative_path().empty(); }
- bool has_parent_path() const { return !parent_path().empty(); }
- bool has_filename() const { return !m_pathname.empty(); }
- bool has_stem() const { return !stem().empty(); }
- bool has_extension() const { return !extension().empty(); }
- bool is_absolute() const
- {
-# ifdef BOOST_WINDOWS_API
- return has_root_name() && has_root_directory();
-# else
- return has_root_directory();
-# endif
- }
- bool is_relative() const { return !is_absolute(); }
-
- // ----- iterators -----
-
- class iterator;
- typedef iterator const_iterator;
-
- iterator begin() const;
- iterator end() const;
-
- // ----- static members -----
-
- // ----- imbue -----
-
- static std::locale imbue(const std::locale& loc);
-
- // ----- codecvt -----
-
- static const codecvt_type& codecvt()
- {
- return *wchar_t_codecvt_facet();
- }
-
- // ----- deprecated functions -----
-
-# if defined(BOOST_FILESYSTEM_DEPRECATED) && defined(BOOST_FILESYSTEM_NO_DEPRECATED)
-# error both BOOST_FILESYSTEM_DEPRECATED and BOOST_FILESYSTEM_NO_DEPRECATED are defined
-# endif
-
-# if !defined(BOOST_FILESYSTEM_NO_DEPRECATED)
- // recently deprecated functions supplied by default
- path& normalize() { return m_normalize(); }
- path& remove_leaf() { return remove_filename(); }
- path leaf() const { return filename(); }
- path branch_path() const { return parent_path(); }
- bool has_leaf() const { return !m_pathname.empty(); }
- bool has_branch_path() const { return !parent_path().empty(); }
- bool is_complete() const { return is_absolute(); }
-# endif
-
-# if defined(BOOST_FILESYSTEM_DEPRECATED)
- // deprecated functions with enough signature or semantic changes that they are
- // not supplied by default
- const std::string file_string() const { return string(); }
- const std::string directory_string() const { return string(); }
- const std::string native_file_string() const { return string(); }
- const std::string native_directory_string() const { return string(); }
- const string_type external_file_string() const { return native(); }
- const string_type external_directory_string() const { return native(); }
-
- // older functions no longer supported
- //typedef bool (*name_check)(const std::string & name);
- //basic_path(const string_type& str, name_check) { operator/=(str); }
- //basic_path(const typename string_type::value_type* s, name_check)
- // { operator/=(s);}
- //static bool default_name_check_writable() { return false; }
- //static void default_name_check(name_check) {}
- //static name_check default_name_check() { return 0; }
- //basic_path& canonize();
-# endif
-
-//--------------------------------------------------------------------------------------//
-// class path private members //
-//--------------------------------------------------------------------------------------//
-
- private:
-# if defined(_MSC_VER)
-# pragma warning(push) // Save warning settings
-# pragma warning(disable : 4251) // disable warning: class 'std::basic_string<_Elem,_Traits,_Ax>'
-# endif // needs to have dll-interface...
-/*
- m_pathname has the type, encoding, and format required by the native
- operating system. Thus for POSIX and Windows there is no conversion for
- passing m_pathname.c_str() to the O/S API or when obtaining a path from the
- O/S API. POSIX encoding is unspecified other than for dot and slash
- characters; POSIX just treats paths as a sequence of bytes. Windows
- encoding is UCS-2 or UTF-16 depending on the version.
-*/
- string_type m_pathname; // Windows: as input; backslashes NOT converted to slashes,
- // slashes NOT converted to backslashes
-# if defined(_MSC_VER)
-# pragma warning(pop) // restore warning settings.
-# endif
-
- string_type::size_type m_append_separator_if_needed();
- // Returns: If separator is to be appended, m_pathname.size() before append. Otherwise 0.
- // Note: An append is never performed if size()==0, so a returned 0 is unambiguous.
-
- void m_erase_redundant_separator(string_type::size_type sep_pos);
- string_type::size_type m_parent_path_end() const;
-
- path& m_normalize();
-
- // Was qualified; como433beta8 reports:
- // warning #427-D: qualified name is not allowed in member declaration
- friend class iterator;
- friend bool operator<(const path& lhs, const path& rhs);
-
- // see path::iterator::increment/decrement comment below
- static void m_path_iterator_increment(path::iterator & it);
- static void m_path_iterator_decrement(path::iterator & it);
-
- static const codecvt_type *& wchar_t_codecvt_facet();
-
- }; // class path
-
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
- typedef path wpath;
-# endif
-
- //------------------------------------------------------------------------------------//
- // class path::iterator //
- //------------------------------------------------------------------------------------//
-
- class path::iterator
- : public boost::iterator_facade<
- path::iterator,
- path const,
- boost::bidirectional_traversal_tag >
- {
- private:
- friend class boost::iterator_core_access;
- friend class boost::filesystem3::path;
- friend void m_path_iterator_increment(path::iterator & it);
- friend void m_path_iterator_decrement(path::iterator & it);
-
- const path& dereference() const { return m_element; }
-
- bool equal(const iterator & rhs) const
- {
- return m_path_ptr == rhs.m_path_ptr && m_pos == rhs.m_pos;
- }
-
- // iterator_facade derived classes don't seem to like implementations in
- // separate translation unit dll's, so forward to class path static members
- void increment() { m_path_iterator_increment(*this); }
- void decrement() { m_path_iterator_decrement(*this); }
-
- path m_element; // current element
- const path * m_path_ptr; // path being iterated over
- string_type::size_type m_pos; // position of name in
- // m_path_ptr->m_pathname. The
- // end() iterator is indicated by
- // m_pos == m_path_ptr->m_pathname.size()
- }; // path::iterator
-
- //------------------------------------------------------------------------------------//
- // //
- // non-member functions //
- // //
- //------------------------------------------------------------------------------------//
-
- // std::lexicographical_compare would infinately recurse because path iterators
- // yield paths, so provide a path aware version
- inline bool lexicographical_compare(path::iterator first1, path::iterator last1,
- path::iterator first2, path::iterator last2)
- {
- for (; first1 != last1 && first2 != last2 ; ++first1, ++first2)
- {
- if (first1->native() < first2->native()) return true;
- if (first2->native() < first1->native()) return false;
- }
- return first1 == last1 && first2 != last2;
- }
-
- inline bool operator<(const path& lhs, const path& rhs)
- {
- return lexicographical_compare(lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
- }
-
- inline bool operator<=(const path& lhs, const path& rhs) { return !(rhs < lhs); }
- inline bool operator> (const path& lhs, const path& rhs) { return rhs < lhs; }
- inline bool operator>=(const path& lhs, const path& rhs) { return !(lhs < rhs); }
-
- // equality operators act as if comparing generic format strings, to achieve the
- // effect of lexicographical_compare element by element compare.
- // operator==() efficiency is a concern; a user reported the original version 2
- // !(lhs < rhs) && !(rhs < lhs) implementation caused a serious performance problem
- // for a map of 10,000 paths.
-
-# ifdef BOOST_WINDOWS_API
- inline bool operator==(const path& lhs, const path::value_type* rhs)
- {
- const path::value_type* l(lhs.c_str());
- while ((*l == *rhs || (*l == L'\\' && *rhs == L'/') || (*l == L'/' && *rhs == L'\\'))
- && *l) { ++l; ++rhs; }
- return *l == *rhs;
- }
- inline bool operator==(const path& lhs, const path& rhs) { return lhs == rhs.c_str(); }
- inline bool operator==(const path& lhs, const path::string_type& rhs) { return lhs == rhs.c_str(); }
- inline bool operator==(const path::string_type& lhs, const path& rhs) { return rhs == lhs.c_str(); }
- inline bool operator==(const path::value_type* lhs, const path& rhs) { return rhs == lhs; }
-
- inline std::size_t hash_value(const path& x)
- {
- std::size_t seed = 0;
- for(const path::value_type* it = x.c_str(); *it; ++it)
- hash_combine(seed, *it == '/' ? L'\\' : *it);
- return seed;
- }
-# else // BOOST_POSIX_API
- inline bool operator==(const path& lhs, const path& rhs) { return lhs.native() == rhs.native(); }
- inline bool operator==(const path& lhs, const path::string_type& rhs) { return lhs.native() == rhs; }
- inline bool operator==(const path& lhs, const path::value_type* rhs) { return lhs.native() == rhs; }
- inline bool operator==(const path::string_type& lhs, const path& rhs) { return lhs == rhs.native(); }
- inline bool operator==(const path::value_type* lhs, const path& rhs) { return lhs == rhs.native(); }
-
- inline std::size_t hash_value(const path& x)
- {
- return hash_range(x.native().begin(), x.native().end());
- }
-# endif
-
- inline bool operator!=(const path& lhs, const path& rhs) { return !(lhs == rhs); }
- inline bool operator!=(const path& lhs, const path::string_type& rhs) { return !(lhs == rhs); }
- inline bool operator!=(const path& lhs, const path::value_type* rhs) { return !(lhs == rhs); }
- inline bool operator!=(const path::string_type& lhs, const path& rhs) { return !(lhs == rhs); }
- inline bool operator!=(const path::value_type* lhs, const path& rhs) { return !(lhs == rhs); }
-
- inline void swap(path& lhs, path& rhs) { lhs.swap(rhs); }
-
- inline path operator/(const path& lhs, const path& rhs) { return path(lhs) /= rhs; }
-
- // inserters and extractors
- // use boost::io::quoted() to handle spaces in paths
- // use '&' as escape character to ease use for Windows paths
-
- template <class Char, class Traits>
- inline std::basic_ostream<Char, Traits>&
- operator<<(std::basic_ostream<Char, Traits>& os, const path& p)
- {
- return os
- << boost::io::quoted(p.template string<std::basic_string<Char> >(), static_cast<Char>('&'));
- }
-
- template <class Char, class Traits>
- inline std::basic_istream<Char, Traits>&
- operator>>(std::basic_istream<Char, Traits>& is, path& p)
- {
- std::basic_string<Char> str;
- is >> boost::io::quoted(str, static_cast<Char>('&'));
- p = str;
- return is;
- }
-
- // name_checks
-
- // These functions are holdovers from version 1. It isn't clear they have much
- // usefulness, or how to generalize them for later versions.
-
- BOOST_FILESYSTEM_DECL bool portable_posix_name(const std::string & name);
- BOOST_FILESYSTEM_DECL bool windows_name(const std::string & name);
- BOOST_FILESYSTEM_DECL bool portable_name(const std::string & name);
- BOOST_FILESYSTEM_DECL bool portable_directory_name(const std::string & name);
- BOOST_FILESYSTEM_DECL bool portable_file_name(const std::string & name);
- BOOST_FILESYSTEM_DECL bool native(const std::string & name);
-
-//--------------------------------------------------------------------------------------//
-// class path member template implementation //
-//--------------------------------------------------------------------------------------//
-
- template <class InputIterator>
- path& path::append(InputIterator begin, InputIterator end, const codecvt_type& cvt)
- {
- if (begin == end)
- return *this;
- string_type::size_type sep_pos(m_append_separator_if_needed());
- std::basic_string<typename std::iterator_traits<InputIterator>::value_type>
- s(begin, end);
- path_traits::convert(s.c_str(), s.c_str()+s.size(), m_pathname, cvt);
- if (sep_pos)
- m_erase_redundant_separator(sep_pos);
- return *this;
- }
-
- template <class Source>
- path& path::append(Source const& source, const codecvt_type& cvt)
- {
- if (path_traits::empty(source))
- return *this;
- string_type::size_type sep_pos(m_append_separator_if_needed());
- path_traits::dispatch(source, m_pathname, cvt);
- if (sep_pos)
- m_erase_redundant_separator(sep_pos);
- return *this;
- }
-
-//--------------------------------------------------------------------------------------//
-// class path member template specializations //
-//--------------------------------------------------------------------------------------//
-
- template <> inline
- std::string path::string<std::string>() const
- { return string(); }
-
- template <> inline
- std::wstring path::string<std::wstring>() const
- { return wstring(); }
-
- template <> inline
- std::string path::string<std::string>(const codecvt_type& cvt) const
- { return string(cvt); }
-
- template <> inline
- std::wstring path::string<std::wstring>(const codecvt_type& cvt) const
- { return wstring(cvt); }
-
- template <> inline
- std::string path::generic_string<std::string>() const
- { return generic_string(); }
-
- template <> inline
- std::wstring path::generic_string<std::wstring>() const
- { return generic_wstring(); }
-
- template <> inline
- std::string path::generic_string<std::string>(const codecvt_type& cvt) const
- { return generic_string(cvt); }
-
- template <> inline
- std::wstring path::generic_string<std::wstring>(const codecvt_type& cvt) const
- { return generic_wstring(cvt); }
-
-
-} // namespace filesystem3
-} // namespace boost
-
-//----------------------------------------------------------------------------//
-
-namespace boost
-{
- namespace filesystem
- {
- using filesystem3::path;
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
- using filesystem3::wpath;
-# endif
- using filesystem3::lexicographical_compare;
- using filesystem3::portable_posix_name;
- using filesystem3::windows_name;
- using filesystem3::portable_name;
- using filesystem3::portable_directory_name;
- using filesystem3::portable_file_name;
- using filesystem3::native;
- using filesystem3::swap;
- using filesystem3::operator<;
- using filesystem3::operator==;
- using filesystem3::operator!=;
- using filesystem3::operator>;
- using filesystem3::operator<=;
- using filesystem3::operator>=;
- using filesystem3::operator/;
- using filesystem3::operator<<;
- using filesystem3::operator>>;
- }
-}
-
-//----------------------------------------------------------------------------//
-
-#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
-
-#endif // BOOST_FILESYSTEM_PATH_HPP
diff --git a/boost/foreach.hpp b/boost/foreach.hpp
index ccfc101b87..43d84c6a1e 100644
--- a/boost/foreach.hpp
+++ b/boost/foreach.hpp
@@ -165,7 +165,7 @@ namespace foreach
// this one works on legacy compilers. Overload boost_foreach_is_lightweight_proxy
// at the global namespace for your type.
template<typename T>
-inline boost::BOOST_FOREACH::is_lightweight_proxy<T> *
+inline boost::foreach::is_lightweight_proxy<T> *
boost_foreach_is_lightweight_proxy(T *&, BOOST_FOREACH_TAG_DEFAULT) { return 0; }
template<typename T>
@@ -190,7 +190,7 @@ boost_foreach_is_lightweight_proxy(T **&, boost::foreach::tag) { return 0; }
// this one works on legacy compilers. Overload boost_foreach_is_noncopyable
// at the global namespace for your type.
template<typename T>
-inline boost::BOOST_FOREACH::is_noncopyable<T> *
+inline boost::foreach::is_noncopyable<T> *
boost_foreach_is_noncopyable(T *&, BOOST_FOREACH_TAG_DEFAULT) { return 0; }
namespace boost
diff --git a/boost/foreach_fwd.hpp b/boost/foreach_fwd.hpp
index 8b246c78e2..4e0bb370c2 100644
--- a/boost/foreach_fwd.hpp
+++ b/boost/foreach_fwd.hpp
@@ -14,8 +14,6 @@
#ifndef BOOST_FOREACH_FWD_HPP
#define BOOST_FOREACH_FWD_HPP
-#include <utility> // for std::pair
-
// This must be at global scope, hence the uglified name
enum boost_foreach_argument_dependent_lookup_hack
{
@@ -27,9 +25,6 @@ namespace boost
namespace foreach
{
- template<typename T>
- std::pair<T, T> in_range(T begin, T end);
-
///////////////////////////////////////////////////////////////////////////////
// boost::foreach::tag
//
@@ -51,24 +46,6 @@ namespace foreach
} // namespace foreach
-// Workaround for unfortunate https://svn.boost.org/trac/boost/ticket/6131
-namespace BOOST_FOREACH
-{
- using foreach::in_range;
- using foreach::tag;
-
- template<typename T>
- struct is_lightweight_proxy
- : foreach::is_lightweight_proxy<T>
- {};
-
- template<typename T>
- struct is_noncopyable
- : foreach::is_noncopyable<T>
- {};
-
-} // namespace BOOST_FOREACH
-
} // namespace boost
#endif
diff --git a/boost/functional/detail/container_fwd.hpp b/boost/functional/detail/container_fwd.hpp
index 9a69d155b2..e2bf86526c 100644
--- a/boost/functional/detail/container_fwd.hpp
+++ b/boost/functional/detail/container_fwd.hpp
@@ -1,11 +1,11 @@
-// Copyright 2005-2008 Daniel James.
+// Copyright 2005-2012 Daniel James.
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// Forwarding header for container_fwd.hpp's new location.
-// This header is deprecated, I'll be adding a warning in a future release,
-// then converting it to an error and finally removing this header completely.
+// This header is deprecated, I'll change the warning to an error in a future
+// release, and then later remove the header completely.
#if !defined(BOOST_FUNCTIONAL_DETAIL_CONTAINER_FWD_HPP)
#define BOOST_FUNCTIONAL_DETAIL_CONTAINER_FWD_HPP
@@ -14,6 +14,14 @@
# pragma once
#endif
+#if defined(__EDG__)
+#elif defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
+#pragma message("Warning: boost/functional/detail/container_fwd.hpp is deprecated, use boost/detail/container_fwd.hpp instead.")
+#elif defined(__GNUC__) || defined(__HP_aCC) || \
+ defined(__SUNPRO_CC) || defined(__IBMCPP__)
+#warning "boost/functional/detail/container_fwd.hpp is deprecated, use boost/detail/container_fwd.hpp instead."
+#endif
+
#include <boost/detail/container_fwd.hpp>
#endif
diff --git a/boost/functional/hash/detail/container_fwd_0x.hpp b/boost/functional/hash/detail/container_fwd_0x.hpp
new file mode 100644
index 0000000000..bed7730fc0
--- /dev/null
+++ b/boost/functional/hash/detail/container_fwd_0x.hpp
@@ -0,0 +1,29 @@
+
+// Copyright 2012 Daniel James.
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#if !defined(BOOST_DETAIL_CONTAINER_FWD_0X_HPP)
+#define BOOST_DETAIL_CONTAINER_FWD_0X_HPP
+
+#include <boost/detail/container_fwd.hpp>
+
+// std::array
+
+#if !defined(BOOST_NO_CXX11_HDR_ARRAY)
+# include <array>
+#endif
+
+// std::tuple
+
+#if !defined(BOOST_NO_CXX11_HDR_TUPLE)
+# include <tuple>
+#endif
+
+// std::shared_ptr/std::unique_ptr
+
+#if !defined(BOOST_NO_CXX11_HDR_MEMORY)
+# include <memory>
+#endif
+
+#endif
diff --git a/boost/functional/hash/detail/hash_float.hpp b/boost/functional/hash/detail/hash_float.hpp
index ea1bc25f48..194be1cae5 100644
--- a/boost/functional/hash/detail/hash_float.hpp
+++ b/boost/functional/hash/detail/hash_float.hpp
@@ -87,9 +87,23 @@ namespace boost
namespace hash_detail
{
template <class T>
+ inline bool is_zero(T v)
+ {
+#if !defined(__GNUC__)
+ return v == 0;
+#else
+ // GCC's '-Wfloat-equal' will complain about comparing
+ // v to 0, but because it disables warnings for system
+ // headers it won't complain if you use std::equal_to to
+ // compare with 0. Resulting in this silliness:
+ return std::equal_to<T>()(v, 0);
+#endif
+ }
+
+ template <class T>
inline std::size_t float_hash_value(T v)
{
- return v == 0 ? 0 : float_hash_impl(v);
+ return boost::hash_detail::is_zero(v) ? 0 : float_hash_impl(v);
}
}
}
diff --git a/boost/functional/hash/extensions.hpp b/boost/functional/hash/extensions.hpp
index 3c587a3bf5..4358736b26 100644
--- a/boost/functional/hash/extensions.hpp
+++ b/boost/functional/hash/extensions.hpp
@@ -14,7 +14,11 @@
#define BOOST_FUNCTIONAL_HASH_EXTENSIONS_HPP
#include <boost/functional/hash/hash.hpp>
-#include <boost/detail/container_fwd.hpp>
+#include <boost/functional/hash/detail/container_fwd_0x.hpp>
+#include <boost/utility/enable_if.hpp>
+#include <boost/static_assert.hpp>
+#include <boost/preprocessor/repetition/repeat_from_to.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
@@ -54,51 +58,51 @@ namespace boost
std::size_t hash_value(std::pair<A, B> const& v)
{
std::size_t seed = 0;
- hash_combine(seed, v.first);
- hash_combine(seed, v.second);
+ boost::hash_combine(seed, v.first);
+ boost::hash_combine(seed, v.second);
return seed;
}
template <class T, class A>
std::size_t hash_value(std::vector<T, A> const& v)
{
- return hash_range(v.begin(), v.end());
+ return boost::hash_range(v.begin(), v.end());
}
template <class T, class A>
std::size_t hash_value(std::list<T, A> const& v)
{
- return hash_range(v.begin(), v.end());
+ return boost::hash_range(v.begin(), v.end());
}
template <class T, class A>
std::size_t hash_value(std::deque<T, A> const& v)
{
- return hash_range(v.begin(), v.end());
+ return boost::hash_range(v.begin(), v.end());
}
template <class K, class C, class A>
std::size_t hash_value(std::set<K, C, A> const& v)
{
- return hash_range(v.begin(), v.end());
+ return boost::hash_range(v.begin(), v.end());
}
template <class K, class C, class A>
std::size_t hash_value(std::multiset<K, C, A> const& v)
{
- return hash_range(v.begin(), v.end());
+ return boost::hash_range(v.begin(), v.end());
}
template <class K, class T, class C, class A>
std::size_t hash_value(std::map<K, T, C, A> const& v)
{
- return hash_range(v.begin(), v.end());
+ return boost::hash_range(v.begin(), v.end());
}
template <class K, class T, class C, class A>
std::size_t hash_value(std::multimap<K, T, C, A> const& v)
{
- return hash_range(v.begin(), v.end());
+ return boost::hash_range(v.begin(), v.end());
}
template <class T>
@@ -110,6 +114,83 @@ namespace boost
return seed;
}
+#if !defined(BOOST_NO_CXX11_HDR_ARRAY)
+ template <class T, std::size_t N>
+ std::size_t hash_value(std::array<T, N> const& v)
+ {
+ return boost::hash_range(v.begin(), v.end());
+ }
+#endif
+
+#if !defined(BOOST_NO_CXX11_HDR_TUPLE)
+ namespace hash_detail {
+ template <std::size_t I, typename T>
+ inline typename boost::enable_if_c<(I == std::tuple_size<T>::value),
+ void>::type
+ hash_combine_tuple(std::size_t&, T const&)
+ {
+ }
+
+ template <std::size_t I, typename T>
+ inline typename boost::enable_if_c<(I < std::tuple_size<T>::value),
+ void>::type
+ hash_combine_tuple(std::size_t& seed, T const& v)
+ {
+ boost::hash_combine(seed, std::get<I>(v));
+ boost::hash_detail::hash_combine_tuple<I + 1>(seed, v);
+ }
+
+ template <typename T>
+ inline std::size_t hash_tuple(T const& v)
+ {
+ std::size_t seed = 0;
+ boost::hash_detail::hash_combine_tuple<0>(seed, v);
+ return seed;
+ }
+ }
+
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
+ template <typename... T>
+ inline std::size_t hash_value(std::tuple<T...> const& v)
+ {
+ return boost::hash_detail::hash_tuple(v);
+ }
+#else
+
+ inline std::size_t hash_value(std::tuple<> const& v)
+ {
+ return boost::hash_detail::hash_tuple(v);
+ }
+
+# define BOOST_HASH_TUPLE_F(z, n, _) \
+ template< \
+ BOOST_PP_ENUM_PARAMS_Z(z, n, typename A) \
+ > \
+ inline std::size_t hash_value(std::tuple< \
+ BOOST_PP_ENUM_PARAMS_Z(z, n, A) \
+ > const& v) \
+ { \
+ return boost::hash_detail::hash_tuple(v); \
+ }
+
+ BOOST_PP_REPEAT_FROM_TO(1, 11, BOOST_HASH_TUPLE_F, _)
+# undef BOOST_HASH_TUPLE_F
+#endif
+
+#endif
+
+#if !defined(BOOST_NO_CXX11_SMART_PTR)
+ template <typename T>
+ inline std::size_t hash_value(std::shared_ptr<T> const& x) {
+ return boost::hash_value(x.get());
+ }
+
+ template <typename T, typename Deleter>
+ inline std::size_t hash_value(std::unique_ptr<T, Deleter> const& x) {
+ return boost::hash_value(x.get());
+ }
+#endif
+
//
// call_hash_impl
//
diff --git a/boost/functional/hash/hash.hpp b/boost/functional/hash/hash.hpp
index 51ec8608c8..c179fab69a 100644
--- a/boost/functional/hash/hash.hpp
+++ b/boost/functional/hash/hash.hpp
@@ -16,15 +16,11 @@
#include <string>
#include <boost/limits.hpp>
-#if defined(BOOST_HASH_NO_IMPLICIT_CASTS)
-#include <boost/static_assert.hpp>
-#endif
-
#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
#include <boost/type_traits/is_pointer.hpp>
#endif
-#if !defined(BOOST_NO_0X_HDR_TYPEINDEX)
+#if !defined(BOOST_NO_CXX11_HDR_TYPEINDEX)
#include <typeindex>
#endif
@@ -37,38 +33,63 @@
namespace boost
{
-#if defined(BOOST_HASH_NO_IMPLICIT_CASTS)
-
- // If you get a static assertion here, it's because hash_value
- // isn't declared for your type.
- template <typename T>
- std::size_t hash_value(T const&) {
- BOOST_STATIC_ASSERT((T*) 0 && false);
- return 0;
- }
-
-#endif
-
- std::size_t hash_value(bool);
- std::size_t hash_value(char);
- std::size_t hash_value(unsigned char);
- std::size_t hash_value(signed char);
- std::size_t hash_value(short);
- std::size_t hash_value(unsigned short);
- std::size_t hash_value(int);
- std::size_t hash_value(unsigned int);
- std::size_t hash_value(long);
- std::size_t hash_value(unsigned long);
+ namespace hash_detail
+ {
+ struct enable_hash_value { typedef std::size_t type; };
+
+ template <typename T> struct basic_numbers {};
+ template <typename T> struct long_numbers {};
+ template <typename T> struct ulong_numbers {};
+ template <typename T> struct float_numbers {};
+
+ template <> struct basic_numbers<bool> :
+ boost::hash_detail::enable_hash_value {};
+ template <> struct basic_numbers<char> :
+ boost::hash_detail::enable_hash_value {};
+ template <> struct basic_numbers<unsigned char> :
+ boost::hash_detail::enable_hash_value {};
+ template <> struct basic_numbers<signed char> :
+ boost::hash_detail::enable_hash_value {};
+ template <> struct basic_numbers<short> :
+ boost::hash_detail::enable_hash_value {};
+ template <> struct basic_numbers<unsigned short> :
+ boost::hash_detail::enable_hash_value {};
+ template <> struct basic_numbers<int> :
+ boost::hash_detail::enable_hash_value {};
+ template <> struct basic_numbers<unsigned int> :
+ boost::hash_detail::enable_hash_value {};
+ template <> struct basic_numbers<long> :
+ boost::hash_detail::enable_hash_value {};
+ template <> struct basic_numbers<unsigned long> :
+ boost::hash_detail::enable_hash_value {};
#if !defined(BOOST_NO_INTRINSIC_WCHAR_T)
- std::size_t hash_value(wchar_t);
+ template <> struct basic_numbers<wchar_t> :
+ boost::hash_detail::enable_hash_value {};
#endif
-
+
#if !defined(BOOST_NO_LONG_LONG)
- std::size_t hash_value(boost::long_long_type);
- std::size_t hash_value(boost::ulong_long_type);
+ template <> struct long_numbers<boost::long_long_type> :
+ boost::hash_detail::enable_hash_value {};
+ template <> struct ulong_numbers<boost::ulong_long_type> :
+ boost::hash_detail::enable_hash_value {};
#endif
+ template <> struct float_numbers<float> :
+ boost::hash_detail::enable_hash_value {};
+ template <> struct float_numbers<double> :
+ boost::hash_detail::enable_hash_value {};
+ template <> struct float_numbers<long double> :
+ boost::hash_detail::enable_hash_value {};
+ }
+
+ template <typename T>
+ typename boost::hash_detail::basic_numbers<T>::type hash_value(T);
+ template <typename T>
+ typename boost::hash_detail::long_numbers<T>::type hash_value(T);
+ template <typename T>
+ typename boost::hash_detail::ulong_numbers<T>::type hash_value(T);
+
#if !BOOST_WORKAROUND(__DMC__, <= 0x848)
template <class T> std::size_t hash_value(T* const&);
#else
@@ -83,15 +104,14 @@ namespace boost
std::size_t hash_value(T (&x)[N]);
#endif
- std::size_t hash_value(float v);
- std::size_t hash_value(double v);
- std::size_t hash_value(long double v);
-
template <class Ch, class A>
std::size_t hash_value(
std::basic_string<Ch, std::BOOST_HASH_CHAR_TRAITS<Ch>, A> const&);
-#if !defined(BOOST_NO_0X_HDR_TYPEINDEX)
+ template <typename T>
+ typename boost::hash_detail::float_numbers<T>::type hash_value(T);
+
+#if !defined(BOOST_NO_CXX11_HDR_TYPEINDEX)
std::size_t hash_value(std::type_index);
#endif
@@ -141,74 +161,23 @@ namespace boost
}
}
- inline std::size_t hash_value(bool v)
- {
- return static_cast<std::size_t>(v);
- }
-
- inline std::size_t hash_value(char v)
- {
- return static_cast<std::size_t>(v);
- }
-
- inline std::size_t hash_value(unsigned char v)
- {
- return static_cast<std::size_t>(v);
- }
-
- inline std::size_t hash_value(signed char v)
- {
- return static_cast<std::size_t>(v);
- }
-
- inline std::size_t hash_value(short v)
- {
- return static_cast<std::size_t>(v);
- }
-
- inline std::size_t hash_value(unsigned short v)
- {
- return static_cast<std::size_t>(v);
- }
-
- inline std::size_t hash_value(int v)
- {
- return static_cast<std::size_t>(v);
- }
-
- inline std::size_t hash_value(unsigned int v)
- {
- return static_cast<std::size_t>(v);
- }
-
- inline std::size_t hash_value(long v)
- {
- return static_cast<std::size_t>(v);
- }
-
- inline std::size_t hash_value(unsigned long v)
- {
- return static_cast<std::size_t>(v);
- }
-
-#if !defined(BOOST_NO_INTRINSIC_WCHAR_T)
- inline std::size_t hash_value(wchar_t v)
+ template <typename T>
+ typename boost::hash_detail::basic_numbers<T>::type hash_value(T v)
{
return static_cast<std::size_t>(v);
}
-#endif
-#if !defined(BOOST_NO_LONG_LONG)
- inline std::size_t hash_value(boost::long_long_type v)
+ template <typename T>
+ typename boost::hash_detail::long_numbers<T>::type hash_value(T v)
{
return hash_detail::hash_value_signed(v);
}
- inline std::size_t hash_value(boost::ulong_long_type v)
+ template <typename T>
+ typename boost::hash_detail::ulong_numbers<T>::type hash_value(T v)
{
return hash_detail::hash_value_unsigned(v);
}
-#endif
// Implementation by Alberto Barbati and Dave Harris.
#if !BOOST_WORKAROUND(__DMC__, <= 0x848)
@@ -324,22 +293,13 @@ namespace boost
return hash_range(v.begin(), v.end());
}
- inline std::size_t hash_value(float v)
- {
- return boost::hash_detail::float_hash_value(v);
- }
-
- inline std::size_t hash_value(double v)
- {
- return boost::hash_detail::float_hash_value(v);
- }
-
- inline std::size_t hash_value(long double v)
+ template <typename T>
+ typename boost::hash_detail::float_numbers<T>::type hash_value(T v)
{
return boost::hash_detail::float_hash_value(v);
}
-#if !defined(BOOST_NO_0X_HDR_TYPEINDEX)
+#if !defined(BOOST_NO_CXX11_HDR_TYPEINDEX)
inline std::size_t hash_value(std::type_index v)
{
return v.hash_code();
@@ -450,7 +410,7 @@ namespace boost
BOOST_HASH_SPECIALIZE(boost::ulong_long_type)
#endif
-#if !defined(BOOST_NO_0X_HDR_TYPEINDEX)
+#if !defined(BOOST_NO_CXX11_HDR_TYPEINDEX)
BOOST_HASH_SPECIALIZE(std::type_index)
#endif
diff --git a/boost/functional/overloaded_function.hpp b/boost/functional/overloaded_function.hpp
new file mode 100644
index 0000000000..83fe4b3849
--- /dev/null
+++ b/boost/functional/overloaded_function.hpp
@@ -0,0 +1,311 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/functional/overloaded_function
+
+#ifndef DOXYGEN // Doxygen documentation only.
+
+#if !BOOST_PP_IS_ITERATING
+# ifndef BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_HPP_
+# define BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_HPP_
+
+# include <boost/functional/overloaded_function/detail/base.hpp>
+# include <boost/functional/overloaded_function/detail/function_type.hpp>
+# include <boost/functional/overloaded_function/config.hpp>
+# include <boost/typeof/typeof.hpp>
+# include <boost/preprocessor/iteration/iterate.hpp>
+# include <boost/preprocessor/repetition/enum.hpp>
+# include <boost/preprocessor/repetition/repeat.hpp>
+# include <boost/preprocessor/control/expr_iif.hpp>
+# include <boost/preprocessor/control/expr_if.hpp>
+# include <boost/preprocessor/comparison/greater.hpp>
+# include <boost/preprocessor/comparison/less.hpp>
+# include <boost/preprocessor/cat.hpp>
+# include <boost/preprocessor/arithmetic/add.hpp>
+# include <boost/preprocessor/arithmetic/sub.hpp>
+# include <boost/preprocessor/tuple/eat.hpp>
+# include <boost/preprocessor/logical/and.hpp>
+# include <boost/preprocessor/logical/not.hpp>
+# include <boost/preprocessor/facilities/expand.hpp>
+
+#define BOOST_FUNCTIONAL_f_type(z, n, unused) \
+ BOOST_PP_CAT(F, n)
+
+#define BOOST_FUNCTIONAL_f_arg(z, n, unused) \
+ BOOST_PP_CAT(f, n)
+
+#define BOOST_FUNCTIONAL_f_tparam(z, n, unused) \
+ typename BOOST_FUNCTIONAL_f_type(z, n, ~) \
+
+#define BOOST_FUNCTIONAL_f_tparam_dflt(z, n, is_tspec) \
+ BOOST_FUNCTIONAL_f_tparam(z, n, ~) \
+ /* overload requires at least 2 functors so F0 and F1 not optional */ \
+ BOOST_PP_EXPR_IIF(BOOST_PP_AND(BOOST_PP_NOT(is_tspec), \
+ BOOST_PP_GREATER(n, 1)), \
+ = void \
+ )
+
+#define BOOST_FUNCTIONAL_f_arg_decl(z, n, unused) \
+ BOOST_FUNCTIONAL_f_type(z, n, ~) /* no qualifier to deduce tparam */ \
+ BOOST_FUNCTIONAL_f_arg(z, n, ~)
+
+#define BOOST_FUNCTIONAL_g_type(z, n, unused) \
+ BOOST_PP_CAT(G, n)
+
+#define BOOST_FUNCTIONAL_g_arg(z, n, unused) \
+ BOOST_PP_CAT(g, n)
+
+#define BOOST_FUNCTIONAL_g_tparam(z, n, unused) \
+ typename BOOST_FUNCTIONAL_g_type(z, n, ~)
+
+#define BOOST_FUNCTIONAL_g_arg_decl(z, n, unused) \
+ BOOST_FUNCTIONAL_g_type(z, n, ~) /* no qualifier to deduce tparam */ \
+ BOOST_FUNCTIONAL_g_arg(z, n, ~)
+
+#define BOOST_FUNCTIONAL_base(z, n, unused) \
+ ::boost::overloaded_function_detail::base< \
+ BOOST_FUNCTIONAL_f_type(z, n, ~) \
+ >
+
+#define BOOST_FUNCTIONAL_inherit(z, n, unused) \
+ public BOOST_FUNCTIONAL_base(z, n, ~)
+
+#define BOOST_FUNCTIONAL_base_init(z, n, unused) \
+ BOOST_FUNCTIONAL_base(z, n, ~)(BOOST_FUNCTIONAL_g_arg(z, n, ~))
+
+#define BOOST_FUNCTIONAL_using_operator_call(z, n, unused) \
+ using BOOST_FUNCTIONAL_base(z, n, ~)::operator();
+
+#define BOOST_FUNCTIONAL_function_type(z, n, unused) \
+ typename ::boost::overloaded_function_detail::function_type< \
+ BOOST_FUNCTIONAL_f_type(z, n, ~) \
+ >::type
+
+# define BOOST_PP_ITERATION_PARAMS_1 \
+ /* at least 2 func to overload so start from 2 to MAX */ \
+ /* (cannot iterate [0, MAX-2) because error on Sun) */ \
+ (3, (2, BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX, \
+ "boost/functional/overloaded_function.hpp"))
+# include BOOST_PP_ITERATE() // Iterate over function arity.
+
+#undef BOOST_FUNCTIONAL_f_type
+#undef BOOST_FUNCTIONAL_f_arg
+#undef BOOST_FUNCTIONAL_f_tparam
+#undef BOOST_FUNCTIONAL_f_arg_decl
+#undef BOOST_FUNCTIONAL_f_tparam_dflt
+#undef BOOST_FUNCTIONAL_g_type
+#undef BOOST_FUNCTIONAL_g_arg
+#undef BOOST_FUNCTIONAL_g_tparam
+#undef BOOST_FUNCTIONAL_g_arg_decl
+#undef BOOST_FUNCTIONAL_base
+#undef BOOST_FUNCTIONAL_inherit
+#undef BOOST_FUNCTIONAL_base_init
+#undef BOOST_FUNCTIONAL_using_operator_call
+#undef BOOST_FUNCTIONAL_function_type
+
+# endif // #include guard
+
+#elif BOOST_PP_ITERATION_DEPTH() == 1
+# define BOOST_FUNCTIONAL_overloads \
+ /* iterate as OVERLOADS, OVERLOADS-1, OVERLOADS-2, ... */ \
+ /* (add 2 because iteration started from 2 to MAX) */ \
+ BOOST_PP_ADD(2, BOOST_PP_SUB( \
+ BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX, \
+ BOOST_PP_FRAME_ITERATION(1)))
+# define BOOST_FUNCTIONAL_is_tspec \
+ /* if template specialization */ \
+ BOOST_PP_LESS(BOOST_FUNCTIONAL_overloads, \
+ BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX)
+
+// For type-of emulation: This must be included at this pp iteration level.
+# include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+namespace boost {
+
+template<
+ BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads, BOOST_FUNCTIONAL_f_tparam_dflt,
+ BOOST_FUNCTIONAL_is_tspec)
+>
+class overloaded_function
+ // Template specialization.
+ BOOST_PP_EXPR_IIF(BOOST_PP_EXPAND(BOOST_FUNCTIONAL_is_tspec), <)
+ BOOST_PP_IIF(BOOST_FUNCTIONAL_is_tspec,
+ BOOST_PP_ENUM
+ ,
+ BOOST_PP_TUPLE_EAT(3)
+ )(BOOST_FUNCTIONAL_overloads, BOOST_FUNCTIONAL_f_type, ~)
+ BOOST_PP_EXPR_IIF(BOOST_PP_EXPAND(BOOST_FUNCTIONAL_is_tspec), >)
+ // Bases (overloads >= 2 so always at least 2 bases).
+ : BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads,
+ BOOST_FUNCTIONAL_inherit, ~)
+{
+public:
+ template<
+ BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads, BOOST_FUNCTIONAL_g_tparam, ~)
+ > /* implicit */ inline overloaded_function(
+ BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads,
+ BOOST_FUNCTIONAL_g_arg_decl, ~))
+ // Overloads >= 2 so always at least 2 bases to initialize.
+ : BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads,
+ BOOST_FUNCTIONAL_base_init, ~)
+ {}
+
+ BOOST_PP_REPEAT(BOOST_FUNCTIONAL_overloads,
+ BOOST_FUNCTIONAL_using_operator_call, ~)
+};
+
+template<
+ BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads, BOOST_FUNCTIONAL_f_tparam, ~)
+>
+overloaded_function<
+ BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads, BOOST_FUNCTIONAL_function_type, ~)
+> make_overloaded_function(
+ BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads, BOOST_FUNCTIONAL_f_arg_decl, ~)
+) {
+ return overloaded_function<
+ BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads,
+ BOOST_FUNCTIONAL_function_type, ~)
+ >(BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads, BOOST_FUNCTIONAL_f_arg, ~));
+}
+
+} // namespace
+
+// For type-of emulation: Register overloaded function type (for _AUTO, etc).
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::overloaded_function,
+ BOOST_FUNCTIONAL_overloads)
+
+# undef BOOST_FUNCTIONAL_overloads
+# undef BOOST_FUNCTIONAL_is_tspec
+#endif // iteration
+
+// DOCUMENTATION //
+
+#else // DOXYGEN
+
+/** @file
+@brief Overload distinct function pointers, function references, and
+monomorphic function objects into a single function object.
+*/
+
+namespace boost {
+
+/**
+@brief Function object to overload functions with distinct signatures.
+
+This function object aggregates together calls to functions of all the
+specified function types <c>F1</c>, <c>F2</c>, etc which must have distinct
+function signatures from one another.
+
+@Params
+@Param{F<em>i</em>,
+Each function type must be specified using the following syntax (which is
+Boost.Function's preferred syntax):
+@code
+ result_type (argument1_type\, argumgnet2_type\, ...)
+@endcode
+}
+@EndParams
+
+In some cases, the @RefFunc{make_overloaded_function} function template can be
+useful to construct an overloaded function object without explicitly
+specifying the function types.
+
+At least two distinct function types must be specified (because there is
+nothing to overload between one or zero functions).
+The maximum number of functions to overload is given by the
+@RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX}
+configuration macro.
+The maximum number of function parameters for each of the specified function
+types is given by the
+@RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX}
+configuration macro.
+
+@See @RefSect{tutorial, Tutorial} section, @RefFunc{make_overloaded_function},
+@RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX},
+@RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX},
+Boost.Function.
+*/
+template<typename F1, typename F2, ...>
+class overloaded_function {
+public:
+ /**
+ @brief Construct the overloaded function object.
+
+ Any function pointer, function reference, and monomorphic function object
+ that can be converted to a <c>boost::function</c> function object can be
+ specified as parameter.
+
+ @Note Unfortunately, it is not possible to support polymorphic function
+ objects (as explained <a
+ href="http://lists.boost.org/Archives/boost/2012/03/191744.php">here</a>).
+ */
+ overloaded_function(const boost::function<F1>&,
+ const boost::function<F2>&, ...);
+
+ /**
+ @brief Call operator matching the signature of the function type specified
+ as 1st template parameter.
+
+ This will in turn invoke the call operator of the 1st function passed to
+ the constructor.
+ */
+ typename boost::function_traits<F1>::result_type operator()(
+ typename boost::function_traits<F1>::arg1_type,
+ typename boost::function_traits<F1>::arg2_type,
+ ...) const;
+
+ /**
+ @brief Call operator matching the signature of the function type specified
+ as 2nd template parameter.
+
+ This will in turn invoke the call operator of the 2nd function passed to
+ the constructor.
+
+ @Note Similar call operators are present for all specified function types
+ <c>F1</c>, <c>F2</c>, etc (even if not exhaustively listed by this
+ documentation).
+ */
+ typename boost::function_traits<F2>::result_type operator()(
+ typename boost::function_traits<F2>::arg1_type,
+ typename boost::function_traits<F2>::arg2_type,
+ ...) const;
+};
+
+/**
+@brief Make an overloaded function object without explicitly specifying the
+function types.
+
+This function template creates and returns an @RefClass{overloaded_function}
+object that overloads all the specified functions <c>f1</c>, <c>f2</c>, etc.
+
+The function types are internally determined from the template parameter types
+so they do not need to be explicitly specified.
+Therefore, this function template usually has a more concise syntax when
+compared with @RefClass{overloaded_function}.
+This is especially useful when the explicit type of the returned
+@RefClass{overloaded_function} object does not need to be known (e.g., when
+used with Boost.Typeof's <c>BOOST_AUTO</c>, C++11 <c>auto</c>, or when the
+overloaded function object is handled using a function template parameter, see
+the @RefSect{tutorial, Tutorial} section).
+
+The maximum number of functions to overload is given by the
+@RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX}
+configuration macro.
+
+@Note In this documentation, <c>__function_type__</c> is a placeholder for a
+symbol that is specific to the implementation of this library.
+
+@See @RefSect{tutorial, Tutorial} section, @RefClass{overloaded_function},
+@RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX}.
+*/
+template<typename F1, typename F2, ...>
+overloaded_function<
+ __function_type__<F1>, __function_type__<F2>, ...
+> make_overloaded_function(F1 f1, F2 f2, ...);
+
+} // namespace
+
+#endif // DOXYGEN
+
diff --git a/boost/functional/overloaded_function/config.hpp b/boost/functional/overloaded_function/config.hpp
new file mode 100644
index 0000000000..2f5d9e1323
--- /dev/null
+++ b/boost/functional/overloaded_function/config.hpp
@@ -0,0 +1,50 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/functional/overloaded_function
+
+#ifndef BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_HPP_
+#define BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_HPP_
+
+/** @file
+@brief Change the compile-time configuration of this library.
+*/
+
+/**
+@brief Specify the maximum number of arguments of the functions being
+overloaded.
+
+If this macro is left undefined by the user, it has a default value of 5
+(increasing this number might increase compilation time).
+When specified by the user, this macro must be a non-negative integer number.
+
+@See @RefSect{getting_started, Getting Started},
+@RefClass{boost::overloaded_function}.
+*/
+#ifndef BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX
+# define BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX 5
+#endif
+
+/**
+@brief Specify the maximum number of functions that can be overloaded.
+
+If this macro is left undefined by the user, it has a default value of 5
+(increasing this number might increase compilation time).
+When defined by the user, this macro must be an integer number greater or
+equal than 2 (because at least two distinct functions need to be specified in
+order to define an overload).
+
+@See @RefSect{getting_started, Getting Started},
+@RefClass{boost::overloaded_function}.
+*/
+#ifndef BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX
+# define BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX 5
+#endif
+#if BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX < 2
+# error "maximum overload macro cannot be less than 2"
+#endif
+
+#endif // #include guard
+
diff --git a/boost/functional/overloaded_function/detail/base.hpp b/boost/functional/overloaded_function/detail/base.hpp
new file mode 100644
index 0000000000..8fd9a0a2c9
--- /dev/null
+++ b/boost/functional/overloaded_function/detail/base.hpp
@@ -0,0 +1,86 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/functional/overloaded_function
+
+#if !BOOST_PP_IS_ITERATING
+# ifndef BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_DETAIL_BASE_HPP_
+# define BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_DETAIL_BASE_HPP_
+
+# include <boost/functional/overloaded_function/config.hpp>
+# include <boost/function.hpp>
+# include <boost/preprocessor/iteration/iterate.hpp>
+# include <boost/preprocessor/repetition/enum.hpp>
+# include <boost/preprocessor/cat.hpp>
+# include <boost/preprocessor/comma_if.hpp>
+
+#define BOOST_FUNCTIONAL_DETAIL_arg_type(z, n, unused) \
+ BOOST_PP_CAT(A, n)
+
+#define BOOST_FUNCTIONAL_DETAIL_arg_name(z, n, unused) \
+ BOOST_PP_CAT(a, n)
+
+#define BOOST_FUNCTIONAL_DETAIL_arg_tparam(z, n, unused) \
+ typename BOOST_FUNCTIONAL_DETAIL_arg_type(z, n, unused)
+
+#define BOOST_FUNCTIONAL_DETAIL_arg(z, n, unused) \
+ BOOST_FUNCTIONAL_DETAIL_arg_type(z, n, unused) \
+ BOOST_FUNCTIONAL_DETAIL_arg_name(z, n, unused)
+
+#define BOOST_FUNCTIONAL_DETAIL_f \
+ R (BOOST_PP_ENUM(BOOST_FUNCTIONAL_DETAIL_arity, \
+ BOOST_FUNCTIONAL_DETAIL_arg_type, ~))
+
+// Do not use namespace ::detail because overloaded_function is already a class.
+namespace boost { namespace overloaded_function_detail {
+
+template<typename F>
+class base {}; // Empty template cannot be used directly (only its spec).
+
+# define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (0, BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX, \
+ "boost/functional/overloaded_function/detail/base.hpp"))
+# include BOOST_PP_ITERATE() // Iterate over funciton arity.
+
+} } // namespace
+
+#undef BOOST_FUNCTIONAL_DETAIL_arg_type
+#undef BOOST_FUNCTIONAL_DETAIL_arg_name
+#undef BOOST_FUNCTIONAL_DETAIL_arg_tparam
+#undef BOOST_FUNCTIONAL_DETAIL_arg
+#undef BOOST_FUNCTIONAL_DETAIL_f
+
+# endif // #include guard
+
+#elif BOOST_PP_ITERATION_DEPTH() == 1
+# define BOOST_FUNCTIONAL_DETAIL_arity BOOST_PP_FRAME_ITERATION(1)
+
+template<
+ typename R
+ BOOST_PP_COMMA_IF(BOOST_FUNCTIONAL_DETAIL_arity)
+ BOOST_PP_ENUM(BOOST_FUNCTIONAL_DETAIL_arity,
+ BOOST_FUNCTIONAL_DETAIL_arg_tparam, ~)
+>
+class base< BOOST_FUNCTIONAL_DETAIL_f > {
+public:
+ /* implicit */ inline base(
+ // This requires specified type to be implicitly convertible to
+ // a boost::function<> functor.
+ boost::function< BOOST_FUNCTIONAL_DETAIL_f > const& f): f_(f)
+ {}
+
+ inline R operator()(BOOST_PP_ENUM(BOOST_FUNCTIONAL_DETAIL_arity,
+ BOOST_FUNCTIONAL_DETAIL_arg, ~)) const {
+ return f_(BOOST_PP_ENUM(BOOST_FUNCTIONAL_DETAIL_arity,
+ BOOST_FUNCTIONAL_DETAIL_arg_name, ~));
+ }
+
+private:
+ boost::function< BOOST_FUNCTIONAL_DETAIL_f > const f_;
+};
+
+# undef BOOST_FUNCTIONAL_DETAIL_arity
+#endif // iteration
+
diff --git a/boost/functional/overloaded_function/detail/function_type.hpp b/boost/functional/overloaded_function/detail/function_type.hpp
new file mode 100644
index 0000000000..0c28607b88
--- /dev/null
+++ b/boost/functional/overloaded_function/detail/function_type.hpp
@@ -0,0 +1,85 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/functional/overloaded_function
+
+#ifndef BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_DETAIL_FUNCTION_TYPE_HPP_
+#define BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_DETAIL_FUNCTION_TYPE_HPP_
+
+#include <boost/function_types/is_function.hpp>
+#include <boost/function_types/is_function_pointer.hpp>
+#include <boost/function_types/is_function_reference.hpp>
+#include <boost/function_types/function_type.hpp>
+#include <boost/function_types/parameter_types.hpp>
+#include <boost/function_types/result_type.hpp>
+#include <boost/type_traits/remove_pointer.hpp>
+#include <boost/type_traits/remove_reference.hpp>
+#include <boost/function.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/identity.hpp>
+#include <boost/mpl/pop_front.hpp>
+#include <boost/mpl/push_front.hpp>
+#include <boost/typeof/typeof.hpp>
+
+// Do not use namespace ::detail because overloaded_function is already a class.
+namespace boost { namespace overloaded_function_detail {
+
+// Requires: F is a monomorphic functor (i.e., has non-template `operator()`).
+// Returns: F's function type `result_type (arg1_type, arg2_type, ...)`.
+// It does not assume F typedef result_type, arg1_type, ... but needs typeof.
+template<typename F>
+class functor_type {
+ // NOTE: clang does not accept extra parenthesis `&(...)`.
+ typedef BOOST_TYPEOF_TPL(&F::operator()) call_ptr;
+public:
+ typedef
+ typename boost::function_types::function_type<
+ typename boost::mpl::push_front<
+ typename boost::mpl::pop_front< // Remove functor type (1st).
+ typename boost::function_types::parameter_types<
+ call_ptr>::type
+ >::type
+ , typename boost::function_types::result_type<call_ptr>::type
+ >::type
+ >::type
+ type;
+};
+
+// NOTE: When using boost::function in Boost.Typeof emulation mode, the user
+// has to register boost::functionN instead of boost::function in oder to
+// do TYPEOF(F::operator()). That is confusing, so boost::function is handled
+// separately so it does not require any Boost.Typeof registration at all.
+template<typename F>
+struct functor_type< boost::function<F> > {
+ typedef F type;
+};
+
+// Requires: F is a function type, pointer, reference, or monomorphic functor.
+// Returns: F's function type `result_type (arg1_type, arg2_type, ...)`.
+template<typename F>
+struct function_type {
+ typedef
+ typename boost::mpl::if_<boost::function_types::is_function<F>,
+ boost::mpl::identity<F>
+ ,
+ typename boost::mpl::if_<boost::function_types::
+ is_function_pointer<F>,
+ boost::remove_pointer<F>
+ ,
+ typename boost::mpl::if_<boost::function_types::
+ is_function_reference<F>,
+ boost::remove_reference<F>
+ , // Else, requires that F is a functor.
+ functor_type<F>
+ >::type
+ >::type
+ >::type
+ ::type type;
+};
+
+} } // namespace
+
+#endif // #include guard
+
diff --git a/boost/fusion/adapted/adt/detail/extension.hpp b/boost/fusion/adapted/adt/detail/extension.hpp
index 50c40cf34e..2f4db4dd09 100644
--- a/boost/fusion/adapted/adt/detail/extension.hpp
+++ b/boost/fusion/adapted/adt/detail/extension.hpp
@@ -12,13 +12,28 @@
#include <boost/type_traits/remove_const.hpp>
#include <boost/type_traits/remove_reference.hpp>
+#include <boost/fusion/support/as_const.hpp>
+#include <boost/fusion/adapted/struct/detail/extension.hpp>
-namespace boost { namespace fusion { namespace detail
-{
+namespace boost { namespace fusion
+{
+ namespace detail
+ {
template <typename T, typename Dummy>
struct get_identity
: remove_const<typename remove_reference<T>::type>
{};
-}}}
+ }
+
+ namespace extension
+ {
+ // Overload as_const() to unwrap adt_attribute_proxy.
+ template <typename T, int N, bool Const>
+ typename adt_attribute_proxy<T, N, Const>::type as_const(const adt_attribute_proxy<T, N, Const>& proxy)
+ {
+ return proxy.get();
+ }
+ }
+}}
#endif
diff --git a/boost/fusion/adapted/std_tuple/detail/at_impl.hpp b/boost/fusion/adapted/std_tuple/detail/at_impl.hpp
index 2f09719ca7..400f366e94 100644
--- a/boost/fusion/adapted/std_tuple/detail/at_impl.hpp
+++ b/boost/fusion/adapted/std_tuple/detail/at_impl.hpp
@@ -9,7 +9,7 @@
#include <tuple>
#include <utility>
-#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/if.hpp>
#include <boost/fusion/support/detail/access.hpp>
#include <boost/type_traits/remove_const.hpp>
@@ -29,13 +29,13 @@ namespace boost { namespace fusion
struct apply
{
typedef typename remove_const<Sequence>::type seq_type;
- typedef std::tuple_element<N::value, seq_type> element;
+ typedef typename std::tuple_element<N::value, seq_type>::type element;
typedef typename
- mpl::eval_if<
+ mpl::if_<
is_const<Sequence>
- , fusion::detail::cref_result<element>
- , fusion::detail::ref_result<element>
+ , typename fusion::detail::cref_result<element>::type
+ , typename fusion::detail::ref_result<element>::type
>::type
type;
diff --git a/boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp b/boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp
index 4998e21d1a..082018a449 100644
--- a/boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp
+++ b/boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp
@@ -12,7 +12,7 @@
#include <boost/type_traits/remove_const.hpp>
#include <boost/fusion/support/detail/access.hpp>
#include <boost/mpl/int.hpp>
-#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/if.hpp>
#include <tuple>
#include <utility>
@@ -48,12 +48,12 @@ namespace boost { namespace fusion
template <typename Iterator>
struct deref
{
- typedef value_of<Iterator> element;
+ typedef typename value_of<Iterator>::type element;
typedef typename
- mpl::eval_if<
+ mpl::if_<
is_const<typename Iterator::tuple_type>
- , fusion::detail::cref_result<element>
- , fusion::detail::ref_result<element>
+ , typename fusion::detail::cref_result<element>::type
+ , typename fusion::detail::ref_result<element>::type
>::type
type;
diff --git a/boost/fusion/adapted/std_tuple/tag_of.hpp b/boost/fusion/adapted/std_tuple/tag_of.hpp
index 10e2e18142..6d7b4d6fb7 100644
--- a/boost/fusion/adapted/std_tuple/tag_of.hpp
+++ b/boost/fusion/adapted/std_tuple/tag_of.hpp
@@ -10,12 +10,6 @@
#include <tuple>
#include <boost/fusion/support/tag_of_fwd.hpp>
-namespace std
-{
- template <typename... Elements>
- class tuple;
-}
-
namespace boost { namespace fusion
{
struct std_tuple_tag;
diff --git a/boost/fusion/adapted/struct.hpp b/boost/fusion/adapted/struct.hpp
index acc12e692b..e51b514b0a 100644
--- a/boost/fusion/adapted/struct.hpp
+++ b/boost/fusion/adapted/struct.hpp
@@ -16,5 +16,6 @@
#include <boost/fusion/adapted/struct/adapt_struct.hpp>
#include <boost/fusion/adapted/struct/define_assoc_struct.hpp>
#include <boost/fusion/adapted/struct/define_struct.hpp>
+#include <boost/fusion/adapted/struct/define_struct_inline.hpp>
#endif
diff --git a/boost/fusion/adapted/struct/define_struct_inline.hpp b/boost/fusion/adapted/struct/define_struct_inline.hpp
new file mode 100644
index 0000000000..9dc5b44cc6
--- /dev/null
+++ b/boost/fusion/adapted/struct/define_struct_inline.hpp
@@ -0,0 +1,25 @@
+/*=============================================================================
+ Copyright (c) 2012 Nathan Ridge
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+
+#ifndef BOOST_FUSION_ADAPTED_STRUCT_DEFINE_STRUCT_INLINE_HPP
+#define BOOST_FUSION_ADAPTED_STRUCT_DEFINE_STRUCT_INLINE_HPP
+
+#include <boost/fusion/adapted/struct/adapt_struct.hpp>
+#include <boost/fusion/adapted/struct/detail/define_struct_inline.hpp>
+
+#define BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE( \
+ TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES) \
+ \
+ BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE_IMPL( \
+ TEMPLATE_PARAMS_SEQ, \
+ NAME, \
+ ATTRIBUTES)
+
+#define BOOST_FUSION_DEFINE_STRUCT_INLINE(NAME, ATTRIBUTES) \
+ BOOST_FUSION_DEFINE_STRUCT_INLINE_IMPL(NAME, ATTRIBUTES) \
+
+#endif
diff --git a/boost/fusion/adapted/struct/detail/define_struct_inline.hpp b/boost/fusion/adapted/struct/detail/define_struct_inline.hpp
new file mode 100644
index 0000000000..a7961ec311
--- /dev/null
+++ b/boost/fusion/adapted/struct/detail/define_struct_inline.hpp
@@ -0,0 +1,375 @@
+/*=============================================================================
+ Copyright (c) 2012 Nathan Ridge
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+
+#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_DEFINE_STRUCT_INLINE_HPP
+#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_DEFINE_STRUCT_INLINE_HPP
+
+#include <boost/fusion/support/category_of.hpp>
+#include <boost/fusion/sequence/sequence_facade.hpp>
+#include <boost/fusion/iterator/iterator_facade.hpp>
+#include <boost/fusion/algorithm/auxiliary/copy.hpp>
+#include <boost/fusion/adapted/struct/detail/define_struct.hpp>
+#include <boost/mpl/int.hpp>
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/identity.hpp>
+#include <boost/mpl/minus.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/type_traits/is_const.hpp>
+#include <boost/preprocessor/comma_if.hpp>
+#include <boost/preprocessor/repeat.hpp>
+#include <boost/preprocessor/seq/for_each_i.hpp>
+#include <boost/preprocessor/seq/size.hpp>
+#include <boost/preprocessor/seq/enum.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+
+#define BOOST_FUSION_MAKE_DEFAULT_INIT_LIST_ENTRY(R, DATA, N, ATTRIBUTE) \
+ BOOST_PP_COMMA_IF(N) BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE)()
+
+#define BOOST_FUSION_MAKE_DEFAULT_INIT_LIST(ATTRIBUTES_SEQ) \
+ : BOOST_PP_SEQ_FOR_EACH_I( \
+ BOOST_FUSION_MAKE_DEFAULT_INIT_LIST_ENTRY, \
+ ~, \
+ ATTRIBUTES_SEQ) \
+
+#define BOOST_FUSION_IGNORE_1(ARG1)
+#define BOOST_FUSION_IGNORE_2(ARG1, ARG2)
+
+#define BOOST_FUSION_MAKE_COPY_CONSTRUCTOR(NAME, ATTRIBUTES_SEQ) \
+ NAME(BOOST_PP_SEQ_FOR_EACH_I( \
+ BOOST_FUSION_MAKE_CONST_REF_PARAM, \
+ ~, \
+ ATTRIBUTES_SEQ)) \
+ : BOOST_PP_SEQ_FOR_EACH_I( \
+ BOOST_FUSION_MAKE_INIT_LIST_ENTRY, \
+ ~, \
+ ATTRIBUTES_SEQ) \
+ { \
+ } \
+
+#define BOOST_FUSION_MAKE_CONST_REF_PARAM(R, DATA, N, ATTRIBUTE) \
+ BOOST_PP_COMMA_IF(N) \
+ BOOST_PP_TUPLE_ELEM(2, 0, ATTRIBUTE) const& \
+ BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE)
+
+#define BOOST_FUSION_MAKE_INIT_LIST_ENTRY_I(NAME) NAME(NAME)
+
+#define BOOST_FUSION_MAKE_INIT_LIST_ENTRY(R, DATA, N, ATTRIBUTE) \
+ BOOST_PP_COMMA_IF(N) \
+ BOOST_FUSION_MAKE_INIT_LIST_ENTRY_I(BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE))
+
+// Note: all template parameter names need to be uglified, otherwise they might
+// shadow a template parameter of the struct when used with
+// BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE
+
+#define BOOST_FUSION_MAKE_ITERATOR_VALUE_OF_SPECS(Z, N, NAME) \
+ template <typename boost_fusion_uglified_Sq> \
+ struct value_of<NAME##_iterator<boost_fusion_uglified_Sq, N> > \
+ : boost::mpl::identity< \
+ typename boost_fusion_uglified_Sq::t##N##_type \
+ > \
+ { \
+ };
+
+#define BOOST_FUSION_MAKE_ITERATOR_DEREF_SPEC( \
+ SPEC_TYPE, CALL_ARG_TYPE, TYPE_QUAL, ATTRIBUTE, N) \
+ \
+ template <typename boost_fusion_uglified_Sq> \
+ struct deref<SPEC_TYPE, N> > \
+ { \
+ typedef typename boost_fusion_uglified_Sq::t##N##_type TYPE_QUAL& type; \
+ static type call(CALL_ARG_TYPE, N> const& iter) \
+ { \
+ return iter.seq_.BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE); \
+ } \
+ };
+
+#define BOOST_FUSION_MAKE_ITERATOR_DEREF_SPECS(R, NAME, N, ATTRIBUTE) \
+ BOOST_FUSION_MAKE_ITERATOR_DEREF_SPEC( \
+ BOOST_PP_CAT(NAME, _iterator)<boost_fusion_uglified_Sq, \
+ BOOST_PP_CAT(NAME, _iterator)<boost_fusion_uglified_Sq, \
+ , \
+ ATTRIBUTE, \
+ N) \
+ BOOST_FUSION_MAKE_ITERATOR_DEREF_SPEC( \
+ BOOST_PP_CAT(NAME, _iterator)<const boost_fusion_uglified_Sq, \
+ BOOST_PP_CAT(NAME, _iterator)<const boost_fusion_uglified_Sq, \
+ const, \
+ ATTRIBUTE, \
+ N) \
+ BOOST_FUSION_MAKE_ITERATOR_DEREF_SPEC( \
+ const BOOST_PP_CAT(NAME, _iterator)<boost_fusion_uglified_Sq, \
+ BOOST_PP_CAT(NAME, _iterator)<boost_fusion_uglified_Sq, \
+ , \
+ ATTRIBUTE, \
+ N) \
+ BOOST_FUSION_MAKE_ITERATOR_DEREF_SPEC( \
+ const BOOST_PP_CAT(NAME, _iterator)<const boost_fusion_uglified_Sq, \
+ BOOST_PP_CAT(NAME, _iterator)<const boost_fusion_uglified_Sq, \
+ const, \
+ ATTRIBUTE, \
+ N) \
+
+#define BOOST_FUSION_MAKE_VALUE_AT_SPECS(Z, N, DATA) \
+ template <typename boost_fusion_uglified_Sq> \
+ struct value_at<boost_fusion_uglified_Sq, boost::mpl::int_<N> > \
+ { \
+ typedef typename boost_fusion_uglified_Sq::t##N##_type type; \
+ };
+
+#define BOOST_FUSION_MAKE_AT_SPECS(R, DATA, N, ATTRIBUTE) \
+ template <typename boost_fusion_uglified_Sq> \
+ struct at<boost_fusion_uglified_Sq, boost::mpl::int_<N> > \
+ { \
+ typedef typename boost::mpl::if_< \
+ boost::is_const<boost_fusion_uglified_Sq>, \
+ typename boost_fusion_uglified_Sq::t##N##_type const&, \
+ typename boost_fusion_uglified_Sq::t##N##_type& \
+ >::type type; \
+ \
+ static type call(boost_fusion_uglified_Sq& sq) \
+ { \
+ return sq. BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE); \
+ } \
+ };
+
+#define BOOST_FUSION_MAKE_TYPEDEF(R, DATA, N, ATTRIBUTE) \
+ typedef BOOST_PP_TUPLE_ELEM(2, 0, ATTRIBUTE) t##N##_type;
+
+#define BOOST_FUSION_MAKE_DATA_MEMBER(R, DATA, N, ATTRIBUTE) \
+ BOOST_PP_TUPLE_ELEM(2, 0, ATTRIBUTE) BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE);
+
+#define BOOST_FUSION_DEFINE_STRUCT_INLINE_IMPL(NAME, ATTRIBUTES) \
+ struct NAME : boost::fusion::sequence_facade< \
+ NAME, \
+ boost::fusion::random_access_traversal_tag \
+ > \
+ { \
+ BOOST_FUSION_DEFINE_STRUCT_INLINE_MEMBERS(NAME, ATTRIBUTES) \
+ };
+
+#define BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE_IMPL( \
+ TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES) \
+ \
+ template < \
+ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS_IMPL( \
+ (0)TEMPLATE_PARAMS_SEQ) \
+ > \
+ struct NAME : boost::fusion::sequence_facade< \
+ NAME< \
+ BOOST_PP_SEQ_ENUM(TEMPLATE_PARAMS_SEQ) \
+ >, \
+ boost::fusion::random_access_traversal_tag \
+ > \
+ { \
+ BOOST_FUSION_DEFINE_STRUCT_INLINE_MEMBERS(NAME, ATTRIBUTES) \
+ };
+
+#define BOOST_FUSION_DEFINE_STRUCT_INLINE_MEMBERS(NAME, ATTRIBUTES) \
+ BOOST_FUSION_DEFINE_STRUCT_MEMBERS_IMPL( \
+ NAME, \
+ BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END))
+
+#define BOOST_FUSION_DEFINE_STRUCT_MEMBERS_IMPL(NAME, ATTRIBUTES_SEQ) \
+ BOOST_FUSION_DEFINE_STRUCT_INLINE_MEMBERS_IMPL_IMPL( \
+ NAME, \
+ ATTRIBUTES_SEQ, \
+ BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ))
+
+#define BOOST_FUSION_DEFINE_STRUCT_INLINE_MEMBERS_IMPL_IMPL( \
+ NAME, ATTRIBUTES_SEQ, ATTRIBUTES_SEQ_SIZE) \
+ \
+ NAME() \
+ BOOST_PP_IF( \
+ BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ), \
+ BOOST_FUSION_MAKE_DEFAULT_INIT_LIST, \
+ BOOST_FUSION_IGNORE_1) \
+ (ATTRIBUTES_SEQ) \
+ { \
+ } \
+ \
+ BOOST_PP_IF( \
+ BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ), \
+ BOOST_FUSION_MAKE_COPY_CONSTRUCTOR, \
+ BOOST_FUSION_IGNORE_2) \
+ (NAME, ATTRIBUTES_SEQ) \
+ \
+ template <typename boost_fusion_uglified_Seq> \
+ NAME(const boost_fusion_uglified_Seq& rhs) \
+ { \
+ boost::fusion::copy(rhs, *this); \
+ } \
+ \
+ template <typename boost_fusion_uglified_Seq> \
+ NAME& operator=(const boost_fusion_uglified_Seq& rhs) \
+ { \
+ boost::fusion::copy(rhs, *this); \
+ return *this; \
+ } \
+ \
+ template <typename boost_fusion_uglified_Seq, int N> \
+ struct NAME##_iterator \
+ : boost::fusion::iterator_facade< \
+ NAME##_iterator<boost_fusion_uglified_Seq, N>, \
+ boost::fusion::random_access_traversal_tag \
+ > \
+ { \
+ typedef boost::mpl::int_<N> index; \
+ typedef boost_fusion_uglified_Seq sequence_type; \
+ \
+ NAME##_iterator(boost_fusion_uglified_Seq& seq) : seq_(seq) {} \
+ \
+ boost_fusion_uglified_Seq& seq_; \
+ \
+ template <typename boost_fusion_uglified_T> struct value_of; \
+ BOOST_PP_REPEAT( \
+ ATTRIBUTES_SEQ_SIZE, \
+ BOOST_FUSION_MAKE_ITERATOR_VALUE_OF_SPECS, \
+ NAME) \
+ \
+ template <typename boost_fusion_uglified_T> struct deref; \
+ BOOST_PP_SEQ_FOR_EACH_I( \
+ BOOST_FUSION_MAKE_ITERATOR_DEREF_SPECS, \
+ NAME, \
+ ATTRIBUTES_SEQ) \
+ \
+ template <typename boost_fusion_uglified_It> \
+ struct next \
+ { \
+ typedef NAME##_iterator< \
+ typename boost_fusion_uglified_It::sequence_type, \
+ boost_fusion_uglified_It::index::value + 1 \
+ > type; \
+ \
+ static type call(boost_fusion_uglified_It const& it) \
+ { \
+ return type(it.seq_); \
+ } \
+ }; \
+ \
+ template <typename boost_fusion_uglified_It> \
+ struct prior \
+ { \
+ typedef NAME##_iterator< \
+ typename boost_fusion_uglified_It::sequence_type, \
+ boost_fusion_uglified_It::index::value - 1 \
+ > type; \
+ \
+ static type call(boost_fusion_uglified_It const& it) \
+ { \
+ return type(it.seq_); \
+ } \
+ }; \
+ \
+ template < \
+ typename boost_fusion_uglified_It1, \
+ typename boost_fusion_uglified_It2 \
+ > \
+ struct distance \
+ { \
+ typedef typename boost::mpl::minus< \
+ typename boost_fusion_uglified_It2::index, \
+ typename boost_fusion_uglified_It1::index \
+ >::type type; \
+ \
+ static type call(boost_fusion_uglified_It1 const& it1, \
+ boost_fusion_uglified_It2 const& it2) \
+ { \
+ return type(); \
+ } \
+ }; \
+ \
+ template < \
+ typename boost_fusion_uglified_It, \
+ typename boost_fusion_uglified_M \
+ > \
+ struct advance \
+ { \
+ typedef NAME##_iterator< \
+ typename boost_fusion_uglified_It::sequence_type, \
+ boost_fusion_uglified_It::index::value \
+ + boost_fusion_uglified_M::value \
+ > type; \
+ \
+ static type call(boost_fusion_uglified_It const& it) \
+ { \
+ return type(it.seq_); \
+ } \
+ }; \
+ }; \
+ \
+ template <typename boost_fusion_uglified_Sq> \
+ struct begin \
+ { \
+ typedef NAME##_iterator<boost_fusion_uglified_Sq, 0> type; \
+ \
+ static type call(boost_fusion_uglified_Sq& sq) \
+ { \
+ return type(sq); \
+ } \
+ }; \
+ \
+ template <typename boost_fusion_uglified_Sq> \
+ struct end \
+ { \
+ typedef NAME##_iterator< \
+ boost_fusion_uglified_Sq, \
+ ATTRIBUTES_SEQ_SIZE \
+ > type; \
+ \
+ static type call(boost_fusion_uglified_Sq& sq) \
+ { \
+ return type(sq); \
+ } \
+ }; \
+ \
+ template <typename boost_fusion_uglified_Sq> \
+ struct size : boost::mpl::int_<ATTRIBUTES_SEQ_SIZE> \
+ { \
+ }; \
+ \
+ template <typename boost_fusion_uglified_Sq> \
+ struct empty : boost::mpl::bool_<ATTRIBUTES_SEQ_SIZE == 0> \
+ { \
+ }; \
+ \
+ template < \
+ typename boost_fusion_uglified_Sq, \
+ typename boost_fusion_uglified_N \
+ > \
+ struct value_at : value_at< \
+ boost_fusion_uglified_Sq, \
+ boost::mpl::int_<boost_fusion_uglified_N::value> \
+ > \
+ { \
+ }; \
+ \
+ BOOST_PP_REPEAT( \
+ ATTRIBUTES_SEQ_SIZE, \
+ BOOST_FUSION_MAKE_VALUE_AT_SPECS, \
+ ~) \
+ \
+ template < \
+ typename boost_fusion_uglified_Sq, \
+ typename boost_fusion_uglified_N \
+ > \
+ struct at : at< \
+ boost_fusion_uglified_Sq, \
+ boost::mpl::int_<boost_fusion_uglified_N::value> \
+ > \
+ { \
+ }; \
+ \
+ BOOST_PP_SEQ_FOR_EACH_I(BOOST_FUSION_MAKE_AT_SPECS, ~, ATTRIBUTES_SEQ) \
+ \
+ BOOST_PP_SEQ_FOR_EACH_I(BOOST_FUSION_MAKE_TYPEDEF, ~, ATTRIBUTES_SEQ) \
+ \
+ BOOST_PP_SEQ_FOR_EACH_I( \
+ BOOST_FUSION_MAKE_DATA_MEMBER, \
+ ~, \
+ ATTRIBUTES_SEQ)
+
+#endif
diff --git a/boost/fusion/algorithm/auxiliary/copy.hpp b/boost/fusion/algorithm/auxiliary/copy.hpp
index 2720627c40..fd866468eb 100644
--- a/boost/fusion/algorithm/auxiliary/copy.hpp
+++ b/boost/fusion/algorithm/auxiliary/copy.hpp
@@ -11,8 +11,11 @@
#include <boost/fusion/sequence/intrinsic/end.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/fusion/sequence/comparison/detail/equal_to.hpp>
+#include <boost/fusion/support/is_sequence.hpp>
#include <boost/config.hpp>
#include <boost/static_assert.hpp>
+#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits/ice.hpp>
#if defined (BOOST_MSVC)
# pragma warning(push)
@@ -54,7 +57,15 @@ namespace boost { namespace fusion
}
template <typename Seq1, typename Seq2>
- inline void
+ inline
+ typename
+ enable_if_c<
+ type_traits::ice_and<
+ traits::is_sequence<Seq1>::value
+ , traits::is_sequence<Seq2>::value
+ >::value,
+ void
+ >::type
copy(Seq1 const& src, Seq2& dest)
{
BOOST_STATIC_ASSERT(
diff --git a/boost/fusion/algorithm/iteration/accumulate.hpp b/boost/fusion/algorithm/iteration/accumulate.hpp
index a8d6a357a2..4b676dea6a 100644
--- a/boost/fusion/algorithm/iteration/accumulate.hpp
+++ b/boost/fusion/algorithm/iteration/accumulate.hpp
@@ -9,6 +9,8 @@
#include <boost/fusion/algorithm/iteration/accumulate_fwd.hpp>
#include <boost/fusion/algorithm/iteration/fold.hpp>
+#include <boost/fusion/support/is_sequence.hpp>
+#include <boost/utility/enable_if.hpp>
namespace boost { namespace fusion
{
@@ -23,14 +25,24 @@ namespace boost { namespace fusion
}
template <typename Sequence, typename State, typename F>
- inline typename result_of::accumulate<Sequence, State const, F>::type
+ inline
+ typename
+ lazy_enable_if<
+ traits::is_sequence<Sequence>
+ , result_of::accumulate<Sequence, State const, F>
+ >::type
accumulate(Sequence& seq, State const& state, F f)
{
return fusion::fold(seq, state, f);
}
template <typename Sequence, typename State, typename F>
- inline typename result_of::accumulate<Sequence const, State const, F>::type
+ inline
+ typename
+ lazy_enable_if<
+ traits::is_sequence<Sequence>
+ , result_of::accumulate<Sequence const, State const, F>
+ >::type
accumulate(Sequence const& seq, State const& state, F f)
{
return fusion::fold(seq, state, f);
diff --git a/boost/fusion/algorithm/iteration/accumulate_fwd.hpp b/boost/fusion/algorithm/iteration/accumulate_fwd.hpp
index 9c0bd115fb..a4ca316c1e 100644
--- a/boost/fusion/algorithm/iteration/accumulate_fwd.hpp
+++ b/boost/fusion/algorithm/iteration/accumulate_fwd.hpp
@@ -7,6 +7,9 @@
#if !defined(BOOST_FUSION_ACCUMULATE_FWD_HPP_INCLUDED)
#define BOOST_FUSION_ACCUMULATE_FWD_HPP_INCLUDED
+#include <boost/fusion/support/is_sequence.hpp>
+#include <boost/utility/enable_if.hpp>
+
namespace boost { namespace fusion
{
namespace result_of
@@ -16,11 +19,19 @@ namespace boost { namespace fusion
}
template <typename Sequence, typename State, typename F>
- typename result_of::accumulate<Sequence, State const, F>::type
+ typename
+ lazy_enable_if<
+ traits::is_sequence<Sequence>
+ , result_of::accumulate<Sequence, State const, F>
+ >::type
accumulate(Sequence& seq, State const& state, F f);
template <typename Sequence, typename State, typename F>
- typename result_of::accumulate<Sequence const, State const, F>::type
+ typename
+ lazy_enable_if<
+ traits::is_sequence<Sequence>
+ , result_of::accumulate<Sequence const, State const, F>
+ >::type
accumulate(Sequence const& seq, State const& state, F f);
}}
diff --git a/boost/fusion/algorithm/iteration/for_each.hpp b/boost/fusion/algorithm/iteration/for_each.hpp
index ab8b8f0e84..17cde34a4b 100644
--- a/boost/fusion/algorithm/iteration/for_each.hpp
+++ b/boost/fusion/algorithm/iteration/for_each.hpp
@@ -11,6 +11,8 @@
#include <boost/fusion/algorithm/iteration/detail/for_each.hpp>
#include <boost/fusion/algorithm/iteration/detail/segmented_for_each.hpp>
#include <boost/fusion/support/is_segmented.hpp>
+#include <boost/fusion/support/is_sequence.hpp>
+#include <boost/utility/enable_if.hpp>
namespace boost { namespace fusion
{
@@ -24,14 +26,24 @@ namespace boost { namespace fusion
}
template <typename Sequence, typename F>
- inline void
+ inline
+ typename
+ enable_if<
+ traits::is_sequence<Sequence>
+ , void
+ >::type
for_each(Sequence& seq, F const& f)
{
detail::for_each(seq, f, typename traits::is_segmented<Sequence>::type());
}
template <typename Sequence, typename F>
- inline void
+ inline
+ typename
+ enable_if<
+ traits::is_sequence<Sequence>
+ , void
+ >::type
for_each(Sequence const& seq, F const& f)
{
detail::for_each(seq, f, typename traits::is_segmented<Sequence>::type());
diff --git a/boost/fusion/algorithm/iteration/for_each_fwd.hpp b/boost/fusion/algorithm/iteration/for_each_fwd.hpp
index 544915d946..b757873e6e 100644
--- a/boost/fusion/algorithm/iteration/for_each_fwd.hpp
+++ b/boost/fusion/algorithm/iteration/for_each_fwd.hpp
@@ -7,6 +7,9 @@
#if !defined(BOOST_FUSION_FOR_EACH_FWD_HPP_INCLUDED)
#define BOOST_FUSION_FOR_EACH_FWD_HPP_INCLUDED
+#include <boost/fusion/support/is_sequence.hpp>
+#include <boost/utility/enable_if.hpp>
+
namespace boost { namespace fusion
{
namespace result_of
@@ -16,11 +19,21 @@ namespace boost { namespace fusion
}
template <typename Sequence, typename F>
- void
+ inline
+ typename
+ enable_if<
+ traits::is_sequence<Sequence>
+ , void
+ >::type
for_each(Sequence& seq, F const& f);
template <typename Sequence, typename F>
- void
+ inline
+ typename
+ enable_if<
+ traits::is_sequence<Sequence>
+ , void
+ >::type
for_each(Sequence const& seq, F const& f);
}}
diff --git a/boost/fusion/algorithm/query/count.hpp b/boost/fusion/algorithm/query/count.hpp
index ade58671a3..0488716327 100644
--- a/boost/fusion/algorithm/query/count.hpp
+++ b/boost/fusion/algorithm/query/count.hpp
@@ -10,6 +10,8 @@
#include <boost/fusion/algorithm/query/count_if.hpp>
#include <boost/fusion/algorithm/query/detail/count.hpp>
+#include <boost/fusion/support/is_sequence.hpp>
+#include <boost/utility/enable_if.hpp>
namespace boost { namespace fusion
{
@@ -23,7 +25,12 @@ namespace boost { namespace fusion
}
template <typename Sequence, typename T>
- inline int
+ inline
+ typename
+ enable_if<
+ traits::is_sequence<Sequence>
+ , int
+ >::type
count(Sequence const& seq, T const& x)
{
detail::count_compare<T> f(x);
diff --git a/boost/fusion/algorithm/query/count_if.hpp b/boost/fusion/algorithm/query/count_if.hpp
index 51112cf0d9..792979733a 100644
--- a/boost/fusion/algorithm/query/count_if.hpp
+++ b/boost/fusion/algorithm/query/count_if.hpp
@@ -10,6 +10,8 @@
#include <boost/fusion/algorithm/query/detail/count_if.hpp>
#include <boost/fusion/support/category_of.hpp>
+#include <boost/fusion/support/is_sequence.hpp>
+#include <boost/utility/enable_if.hpp>
namespace boost { namespace fusion
{
@@ -23,7 +25,12 @@ namespace boost { namespace fusion
}
template <typename Sequence, typename F>
- inline int
+ inline
+ typename
+ enable_if<
+ traits::is_sequence<Sequence>
+ , int
+ >::type
count_if(Sequence const& seq, F f)
{
return detail::count_if(
diff --git a/boost/fusion/algorithm/transformation/erase.hpp b/boost/fusion/algorithm/transformation/erase.hpp
index 304ed4c51e..6ad737fd18 100644
--- a/boost/fusion/algorithm/transformation/erase.hpp
+++ b/boost/fusion/algorithm/transformation/erase.hpp
@@ -16,6 +16,9 @@
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp>
#include <boost/fusion/adapted/mpl/mpl_iterator.hpp>
+#include <boost/fusion/support/is_sequence.hpp>
+#include <boost/utility/enable_if.hpp>
+#include <boost/mpl/if.hpp>
namespace boost { namespace fusion
{
@@ -53,18 +56,38 @@ namespace boost { namespace fusion
}
};
+ struct use_default;
+
+ template <class T, class Default>
+ struct fusion_default_help
+ : mpl::if_<
+ is_same<T, use_default>
+ , Default
+ , T
+ >
+ {
+ };
+
template <
typename Sequence
, typename First
- , typename Last = typename compute_erase_last<Sequence, First>::type>
+ , typename Last = use_default>
struct erase
{
typedef typename result_of::begin<Sequence>::type seq_first_type;
typedef typename result_of::end<Sequence>::type seq_last_type;
BOOST_STATIC_ASSERT((!result_of::equal_to<seq_first_type, seq_last_type>::value));
- typedef typename convert_iterator<First>::type first_type;
- typedef typename convert_iterator<Last>::type last_type;
+ typedef First FirstType;
+ typedef typename
+ fusion_default_help<
+ Last
+ , typename compute_erase_last<Sequence, First>::type
+ >::type
+ LastType;
+
+ typedef typename convert_iterator<FirstType>::type first_type;
+ typedef typename convert_iterator<LastType>::type last_type;
typedef iterator_range<seq_first_type, first_type> left_type;
typedef iterator_range<last_type, seq_last_type> right_type;
typedef joint_view<left_type, right_type> type;
@@ -72,7 +95,11 @@ namespace boost { namespace fusion
}
template <typename Sequence, typename First>
- typename result_of::erase<Sequence const, First>::type
+ typename
+ lazy_enable_if<
+ traits::is_sequence<Sequence>
+ , typename result_of::erase<Sequence const, First>
+ >::type
erase(Sequence const& seq, First const& first)
{
typedef result_of::erase<Sequence const, First> result_of;
diff --git a/boost/fusion/algorithm/transformation/insert.hpp b/boost/fusion/algorithm/transformation/insert.hpp
index ac5bca38a7..2052fc01aa 100644
--- a/boost/fusion/algorithm/transformation/insert.hpp
+++ b/boost/fusion/algorithm/transformation/insert.hpp
@@ -16,6 +16,8 @@
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp>
#include <boost/fusion/adapted/mpl/mpl_iterator.hpp>
+#include <boost/fusion/support/is_sequence.hpp>
+#include <boost/utility/enable_if.hpp>
namespace boost { namespace fusion
{
@@ -38,8 +40,12 @@ namespace boost { namespace fusion
}
template <typename Sequence, typename Position, typename T>
- inline typename result_of::insert<
- Sequence const, Position, T>::type
+ inline
+ typename
+ lazy_enable_if<
+ traits::is_sequence<Sequence>
+ , result_of::insert<Sequence const, Position, T>
+ >::type
insert(Sequence const& seq, Position const& pos, T const& x)
{
typedef result_of::insert<
diff --git a/boost/fusion/algorithm/transformation/push_back.hpp b/boost/fusion/algorithm/transformation/push_back.hpp
index 00a01a806f..9afe538ab2 100644
--- a/boost/fusion/algorithm/transformation/push_back.hpp
+++ b/boost/fusion/algorithm/transformation/push_back.hpp
@@ -10,6 +10,8 @@
#include <boost/fusion/support/detail/as_fusion_element.hpp>
#include <boost/fusion/view/joint_view/joint_view.hpp>
#include <boost/fusion/view/single_view/single_view.hpp>
+#include <boost/fusion/support/is_sequence.hpp>
+#include <boost/utility/enable_if.hpp>
namespace boost { namespace fusion
{
@@ -24,7 +26,12 @@ namespace boost { namespace fusion
}
template <typename Sequence, typename T>
- inline typename result_of::push_back<Sequence const, T>::type
+ inline
+ typename
+ lazy_enable_if<
+ traits::is_sequence<Sequence>
+ , result_of::push_back<Sequence const, T>
+ >::type
push_back(Sequence const& seq, T const& x)
{
typedef typename result_of::push_back<Sequence const, T> push_back;
diff --git a/boost/fusion/algorithm/transformation/push_front.hpp b/boost/fusion/algorithm/transformation/push_front.hpp
index d08ad27987..abe7faadea 100644
--- a/boost/fusion/algorithm/transformation/push_front.hpp
+++ b/boost/fusion/algorithm/transformation/push_front.hpp
@@ -10,6 +10,8 @@
#include <boost/fusion/support/detail/as_fusion_element.hpp>
#include <boost/fusion/view/joint_view/joint_view.hpp>
#include <boost/fusion/view/single_view/single_view.hpp>
+#include <boost/fusion/support/is_sequence.hpp>
+#include <boost/utility/enable_if.hpp>
namespace boost { namespace fusion
{
@@ -24,7 +26,12 @@ namespace boost { namespace fusion
}
template <typename Sequence, typename T>
- inline typename result_of::push_front<Sequence const, T>::type
+ inline
+ typename
+ lazy_enable_if<
+ traits::is_sequence<Sequence>
+ , result_of::push_front<Sequence const, T>
+ >::type
push_front(Sequence const& seq, T const& x)
{
typedef typename result_of::push_front<Sequence const, T> push_front;
diff --git a/boost/fusion/algorithm/transformation/replace.hpp b/boost/fusion/algorithm/transformation/replace.hpp
index bfe186e5af..a92e6e3738 100644
--- a/boost/fusion/algorithm/transformation/replace.hpp
+++ b/boost/fusion/algorithm/transformation/replace.hpp
@@ -9,6 +9,8 @@
#include <boost/fusion/view/transform_view/transform_view.hpp>
#include <boost/fusion/algorithm/transformation/detail/replace.hpp>
+#include <boost/fusion/support/is_sequence.hpp>
+#include <boost/utility/enable_if.hpp>
namespace boost { namespace fusion
{
@@ -22,7 +24,12 @@ namespace boost { namespace fusion
}
template <typename Sequence, typename T>
- inline typename result_of::replace<Sequence const, T>::type
+ inline
+ typename
+ enable_if<
+ traits::is_sequence<Sequence>
+ , typename result_of::replace<Sequence const, T>::type
+ >::type
replace(Sequence const& seq, T const& old_value, T const& new_value)
{
typedef typename result_of::replace<Sequence const, T>::type result;
diff --git a/boost/fusion/algorithm/transformation/replace_if.hpp b/boost/fusion/algorithm/transformation/replace_if.hpp
index 29913436e3..39b9009a79 100644
--- a/boost/fusion/algorithm/transformation/replace_if.hpp
+++ b/boost/fusion/algorithm/transformation/replace_if.hpp
@@ -9,6 +9,7 @@
#include <boost/fusion/view/transform_view/transform_view.hpp>
#include <boost/fusion/algorithm/transformation/detail/replace_if.hpp>
+#include <boost/fusion/support/is_sequence.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/is_same.hpp>
@@ -24,7 +25,12 @@ namespace boost { namespace fusion
}
template <typename Sequence, typename F, typename T>
- inline typename result_of::replace_if<Sequence const, F, T>::type
+ inline
+ typename
+ enable_if<
+ traits::is_sequence<Sequence>
+ , typename result_of::replace_if<Sequence const, F, T>::type
+ >::type
replace_if(Sequence const& seq, F pred, T const& new_value)
{
typedef typename result_of::replace_if<Sequence const, F, T>::type result;
diff --git a/boost/fusion/algorithm/transformation/reverse.hpp b/boost/fusion/algorithm/transformation/reverse.hpp
index 23c4fe6531..923b90fc6a 100644
--- a/boost/fusion/algorithm/transformation/reverse.hpp
+++ b/boost/fusion/algorithm/transformation/reverse.hpp
@@ -8,6 +8,8 @@
#define FUSION_REVERSE_07212005_1230
#include <boost/fusion/view/reverse_view/reverse_view.hpp>
+#include <boost/fusion/support/is_sequence.hpp>
+#include <boost/utility/enable_if.hpp>
namespace boost { namespace fusion
{
@@ -21,7 +23,12 @@ namespace boost { namespace fusion
}
template <typename Sequence>
- inline reverse_view<Sequence const>
+ inline
+ typename
+ enable_if<
+ traits::is_sequence<Sequence>
+ , reverse_view<Sequence const>
+ >::type
reverse(Sequence const& view)
{
return reverse_view<Sequence const>(view);
diff --git a/boost/fusion/container/deque/back_extended_deque.hpp b/boost/fusion/container/deque/back_extended_deque.hpp
index ef8345f7d7..738e05bbdb 100644
--- a/boost/fusion/container/deque/back_extended_deque.hpp
+++ b/boost/fusion/container/deque/back_extended_deque.hpp
@@ -1,36 +1,47 @@
/*=============================================================================
- Copyright (c) 2005-2011 Joel de Guzman
+ Copyright (c) 2005-2012 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
- Distributed under the Boost Software License, Version 1.0. (See accompanying
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_BACK_EXTENDED_DEQUE_26112006_2209)
#define BOOST_FUSION_BACK_EXTENDED_DEQUE_26112006_2209
-#include <boost/fusion/container/deque/detail/keyed_element.hpp>
#include <boost/mpl/int.hpp>
-#include <boost/mpl/plus.hpp>
+
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/fusion/support/sequence_base.hpp>
+#include <boost/fusion/container/deque/detail/keyed_element.hpp>
-#include <boost/type_traits/add_const.hpp>
-#include <boost/type_traits/add_reference.hpp>
-
-namespace boost { namespace fusion {
- template<typename Deque, typename T>
+namespace boost { namespace fusion
+{
+ template <typename Deque, typename T>
struct back_extended_deque
- : detail::keyed_element<typename Deque::next_up, T, Deque>,
- sequence_base<back_extended_deque<Deque, T> >
+ : detail::keyed_element<typename Deque::next_up, T, Deque>
+ , sequence_base<back_extended_deque<Deque, T> >
{
typedef detail::keyed_element<typename Deque::next_up, T, Deque> base;
typedef typename Deque::next_down next_down;
- typedef mpl::int_<mpl::plus<typename Deque::next_up, mpl::int_<1> >::value> next_up;
- typedef mpl::plus<typename result_of::size<Deque>::type, mpl::int_<1> > size;
+ typedef mpl::int_<(Deque::next_up::value + 1)> next_up;
+ typedef mpl::int_<(result_of::size<Deque>::value + 1)> size;
- back_extended_deque(Deque const& deque, typename add_reference<typename add_const<T>::type>::type t)
- : base(t, deque)
+ template <typename Arg>
+ back_extended_deque(Deque const& deque, Arg const& val)
+ : base(val, deque)
{}
+
+#if defined(BOOST_NO_RVALUE_REFERENCES)
+ template <typename Arg>
+ back_extended_deque(Deque const& deque, Arg& val)
+ : base(val, deque)
+ {}
+#else
+ template <typename Arg>
+ back_extended_deque(Deque const& deque, Arg&& val)
+ : base(std::forward<Arg>(val), deque)
+ {}
+#endif
};
}}
diff --git a/boost/fusion/container/deque/convert.hpp b/boost/fusion/container/deque/convert.hpp
index 0f8ea6576e..1910cb84fc 100644
--- a/boost/fusion/container/deque/convert.hpp
+++ b/boost/fusion/container/deque/convert.hpp
@@ -1,5 +1,5 @@
/*=============================================================================
- Copyright (c) 2005-2011 Joel de Guzman
+ Copyright (c) 2005-2012 Joel de Guzman
Copyright (c) 2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -21,7 +21,9 @@ namespace boost { namespace fusion
template <typename Sequence>
struct as_deque
{
- typedef typename detail::as_deque<result_of::size<Sequence>::value> gen;
+ typedef typename
+ detail::as_deque<result_of::size<Sequence>::value>
+ gen;
typedef typename gen::
template apply<typename result_of::begin<Sequence>::type>::type
type;
diff --git a/boost/fusion/container/deque/deque.hpp b/boost/fusion/container/deque/deque.hpp
index 97238f4ada..215981e422 100644
--- a/boost/fusion/container/deque/deque.hpp
+++ b/boost/fusion/container/deque/deque.hpp
@@ -1,5 +1,5 @@
/*=============================================================================
- Copyright (c) 2005-2011 Joel de Guzman
+ Copyright (c) 2005-2012 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -8,20 +8,27 @@
#if !defined(BOOST_FUSION_DEQUE_26112006_1649)
#define BOOST_FUSION_DEQUE_26112006_1649
-#include <boost/fusion/container/deque/limits.hpp>
-#include <boost/fusion/container/deque/front_extended_deque.hpp>
-#include <boost/fusion/container/deque/back_extended_deque.hpp>
-#include <boost/fusion/container/deque/detail/deque_keyed_values.hpp>
-#include <boost/fusion/container/deque/detail/deque_initial_size.hpp>
+#include <boost/config.hpp>
+
+///////////////////////////////////////////////////////////////////////////////
+// With no decltype and variadics, we will use the C++03 version
+///////////////////////////////////////////////////////////////////////////////
+#if (defined(BOOST_NO_DECLTYPE) \
+ || defined(BOOST_NO_VARIADIC_TEMPLATES) \
+ || defined(BOOST_NO_RVALUE_REFERENCES))
+# include <boost/fusion/container/deque/detail/cpp03_deque.hpp>
+#else
+# if !defined(BOOST_FUSION_HAS_CPP11_DEQUE)
+# define BOOST_FUSION_HAS_CPP11_DEQUE
+# endif
+
+///////////////////////////////////////////////////////////////////////////////
+// C++11 interface
+///////////////////////////////////////////////////////////////////////////////
#include <boost/fusion/support/sequence_base.hpp>
+#include <boost/fusion/support/detail/access.hpp>
#include <boost/fusion/container/deque/detail/keyed_element.hpp>
-#include <boost/preprocessor/repetition/enum_params.hpp>
-#include <boost/preprocessor/repetition/enum_binary_params.hpp>
-#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
-#include <boost/type_traits/add_reference.hpp>
-#include <boost/type_traits/add_const.hpp>
-#include <boost/type_traits/is_convertible.hpp>
-
+#include <boost/fusion/container/deque/detail/cpp11_deque_keyed_values.hpp>
#include <boost/fusion/container/deque/deque_fwd.hpp>
#include <boost/fusion/container/deque/detail/value_at_impl.hpp>
#include <boost/fusion/container/deque/detail/at_impl.hpp>
@@ -29,93 +36,67 @@
#include <boost/fusion/container/deque/detail/end_impl.hpp>
#include <boost/fusion/container/deque/detail/is_sequence_impl.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
-#include <boost/mpl/bool.hpp>
-#include <boost/fusion/support/sequence_base.hpp>
-#include <boost/fusion/support/void.hpp>
+#include <boost/mpl/int.hpp>
#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits/is_convertible.hpp>
-#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
-#include <boost/fusion/container/deque/detail/preprocessed/deque.hpp>
-#else
-#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
-#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/deque" FUSION_MAX_DEQUE_SIZE_STR ".hpp")
-#endif
-
-/*=============================================================================
- Copyright (c) 2001-2011 Joel de Guzman
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
- This is an auto-generated file. Do not edit!
-==============================================================================*/
-
-#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
-#pragma wave option(preserve: 1)
-#endif
-
-namespace boost { namespace fusion {
-
+namespace boost { namespace fusion
+{
struct deque_tag;
- template<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename T)>
- struct deque
- :
- detail::deque_keyed_values<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)>::type,
- sequence_base<deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)> >
+ template <typename ...Elements>
+ struct deque : detail::nil_keyed_element
+ {
+ };
+
+ template <typename Head, typename ...Tail>
+ struct deque<Head, Tail...>
+ : detail::deque_keyed_values<Head, Tail...>::type
+ , sequence_base<deque<Head, Tail...>>
{
typedef deque_tag fusion_tag;
typedef bidirectional_traversal_tag category;
- typedef typename detail::deque_keyed_values<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)>::type base;
- typedef typename detail::deque_initial_size<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)>::type size;
+ typedef typename detail::deque_keyed_values<Head, Tail...>::type base;
+ typedef mpl::int_<(sizeof ...(Tail) + 1)> size;
typedef mpl::int_<size::value> next_up;
- typedef mpl::int_<
- mpl::if_<mpl::equal_to<size, mpl::int_<0> >, mpl::int_<0>, mpl::int_<-1> >::type::value> next_down;
+ typedef mpl::int_<mpl::int_<((size::value == 0) ? 0 : -1)>::type::value> next_down;
typedef mpl::false_ is_view;
-#include <boost/fusion/container/deque/detail/deque_forward_ctor.hpp>
-
deque()
- {}
-
- explicit deque(typename add_reference<typename add_const<T0>::type>::type t0)
- : base(t0, detail::nil_keyed_element())
- {}
-
- template<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename U)>
- deque(deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)> const& seq)
- : base(seq)
- {}
-
- template<typename Sequence>
- deque(Sequence const& seq, typename disable_if<is_convertible<Sequence, T0> >::type* /*dummy*/ = 0)
- : base(base::from_iterator(fusion::begin(seq)))
- {}
-
- template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename U)>
- deque&
- operator=(deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)> const& rhs)
+ {}
+
+ template <typename ...Elements>
+ deque(deque<Elements...> const& seq)
+ : base(seq)
+ {}
+
+ explicit deque(typename detail::call_param<Head>::type head
+ , typename detail::call_param<Tail>::type... tail)
+ : base(detail::deque_keyed_values<Head, Tail...>::call(head, tail...))
+ {}
+
+ template <typename Sequence>
+ explicit deque(Sequence const& seq
+ , typename disable_if<is_convertible<Sequence, Head> >::type* /*dummy*/ = 0)
+ : base(base::from_iterator(fusion::begin(seq)))
+ {}
+
+ template <typename ...Elements>
+ deque& operator=(deque<Elements...> const& rhs)
{
base::operator=(rhs);
return *this;
}
template <typename T>
- deque&
- operator=(T const& rhs)
+ deque& operator=(T const& rhs)
{
base::operator=(rhs);
return *this;
}
-
};
}}
-#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
-#pragma wave option(output: null)
#endif
-
-#endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
-
#endif
diff --git a/boost/fusion/container/deque/deque_fwd.hpp b/boost/fusion/container/deque/deque_fwd.hpp
index 7f9a1f9b70..19ca8f8f19 100644
--- a/boost/fusion/container/deque/deque_fwd.hpp
+++ b/boost/fusion/container/deque/deque_fwd.hpp
@@ -1,5 +1,5 @@
/*=============================================================================
- Copyright (c) 2005-2011 Joel de Guzman
+ Copyright (c) 2005-2012 Joel de Guzman
Copyright (c) 2005-2007 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -8,43 +8,28 @@
#if !defined(FUSION_DEQUE_FORWARD_02092007_0749)
#define FUSION_DEQUE_FORWARD_02092007_0749
-#include <boost/fusion/container/deque/limits.hpp>
-#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
+#include <boost/config.hpp>
-#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
-#include <boost/fusion/container/deque/detail/preprocessed/deque_fwd.hpp>
+///////////////////////////////////////////////////////////////////////////////
+// With no decltype and variadics, we will use the C++03 version
+///////////////////////////////////////////////////////////////////////////////
+#if (defined(BOOST_NO_DECLTYPE) \
+ || defined(BOOST_NO_VARIADIC_TEMPLATES) \
+ || defined(BOOST_NO_RVALUE_REFERENCES))
+# include <boost/fusion/container/deque/detail/cpp03_deque_fwd.hpp>
#else
-#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
-#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/deque" FUSION_MAX_DEQUE_SIZE_STR "_fwd.hpp")
-#endif
-
-/*=============================================================================
- Copyright (c) 2001-2011 Joel de Guzman
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
- This is an auto-generated file. Do not edit!
-==============================================================================*/
-
-#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
-#pragma wave option(preserve: 1)
-#endif
+# if !defined(BOOST_FUSION_HAS_CPP11_DEQUE)
+# define BOOST_FUSION_HAS_CPP11_DEQUE
+# endif
+///////////////////////////////////////////////////////////////////////////////
+// C++11 interface
+///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace fusion
{
- struct void_;
-
- template<
- BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
- FUSION_MAX_DEQUE_SIZE, typename T, void_)>
+ template <typename ...T>
struct deque;
}}
-#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
-#pragma wave option(output: null)
#endif
-
-#endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
-
#endif
diff --git a/boost/fusion/container/deque/deque_iterator.hpp b/boost/fusion/container/deque/deque_iterator.hpp
index 3cb02f08f5..d3e5f31eb7 100644
--- a/boost/fusion/container/deque/deque_iterator.hpp
+++ b/boost/fusion/container/deque/deque_iterator.hpp
@@ -1,8 +1,8 @@
/*=============================================================================
- Copyright (c) 2005-2011 Joel de Guzman
+ Copyright (c) 2005-2012 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
- Distributed under the Boost Software License, Version 1.0. (See accompanying
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_DEQUE_ITERATOR_26112006_2154)
@@ -12,13 +12,13 @@
#include <boost/fusion/container/deque/detail/keyed_element.hpp>
#include <boost/mpl/minus.hpp>
#include <boost/mpl/equal_to.hpp>
-#include <boost/type_traits/is_const.hpp>
+#include <boost/type_traits/is_const.hpp>
namespace boost { namespace fusion {
struct bidirectional_traversal_tag;
- template<typename Seq, int Pos>
+ template <typename Seq, int Pos>
struct deque_iterator
: iterator_facade<deque_iterator<Seq, Pos>, bidirectional_traversal_tag>
{
@@ -84,7 +84,7 @@ namespace boost { namespace fusion {
typedef typename
mpl::minus<
typename I2::index, typename I1::index
- >::type
+ >::type
type;
static type
diff --git a/boost/fusion/container/deque/detail/as_deque.hpp b/boost/fusion/container/deque/detail/as_deque.hpp
index bc9ae8461f..906f4fb657 100644
--- a/boost/fusion/container/deque/detail/as_deque.hpp
+++ b/boost/fusion/container/deque/detail/as_deque.hpp
@@ -1,5 +1,5 @@
/*=============================================================================
- Copyright (c) 2005-2011 Joel de Guzman
+ Copyright (c) 2005-2012 Joel de Guzman
Copyright (c) 2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying
diff --git a/boost/fusion/container/deque/detail/at_impl.hpp b/boost/fusion/container/deque/detail/at_impl.hpp
index dc09d31b7c..0684dcf19e 100644
--- a/boost/fusion/container/deque/detail/at_impl.hpp
+++ b/boost/fusion/container/deque/detail/at_impl.hpp
@@ -1,8 +1,8 @@
/*=============================================================================
- Copyright (c) 2005-2011 Joel de Guzman
+ Copyright (c) 2005-2012 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
- Distributed under the Boost Software License, Version 1.0. (See accompanying
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_DEQUE_AT_IMPL_09122006_2017)
@@ -19,15 +19,15 @@
#include <boost/type_traits/add_const.hpp>
#include <boost/type_traits/add_reference.hpp>
-namespace boost { namespace fusion {
-
+namespace boost { namespace fusion
+{
struct deque_tag;
- namespace extension
+ namespace extension
{
template<typename T>
struct at_impl;
-
+
template<>
struct at_impl<deque_tag>
{
@@ -37,15 +37,21 @@ namespace boost { namespace fusion {
typedef typename Sequence::next_up next_up;
typedef typename Sequence::next_down next_down;
BOOST_MPL_ASSERT_RELATION(next_down::value, !=, next_up::value);
-
- typedef mpl::plus<next_down, mpl::int_<1> > offset;
- typedef mpl::int_<mpl::plus<N, offset>::value> adjusted_index;
- typedef typename detail::keyed_element_value_at<Sequence, adjusted_index>::type element_type;
- typedef typename add_reference<
- typename mpl::eval_if<
- is_const<Sequence>,
- add_const<element_type>,
- mpl::identity<element_type> >::type>::type type;
+
+ static int const offset = next_down::value + 1;
+ typedef mpl::int_<(N::value + offset)> adjusted_index;
+ typedef typename
+ detail::keyed_element_value_at<Sequence, adjusted_index>::type
+ element_type;
+
+ typedef typename
+ add_reference<
+ typename mpl::eval_if<
+ is_const<Sequence>,
+ add_const<element_type>,
+ mpl::identity<element_type> >::type
+ >::type
+ type;
static type call(Sequence& seq)
{
diff --git a/boost/fusion/container/deque/detail/begin_impl.hpp b/boost/fusion/container/deque/detail/begin_impl.hpp
index 8c02b9ac8f..1447868a33 100644
--- a/boost/fusion/container/deque/detail/begin_impl.hpp
+++ b/boost/fusion/container/deque/detail/begin_impl.hpp
@@ -1,8 +1,8 @@
/*=============================================================================
- Copyright (c) 2005-2011 Joel de Guzman
+ Copyright (c) 2005-2012 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
- Distributed under the Boost Software License, Version 1.0. (See accompanying
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_DEQUE_BEGIN_IMPL_09122006_2034)
@@ -13,27 +13,29 @@
#include <boost/mpl/equal_to.hpp>
#include <boost/mpl/if.hpp>
-namespace boost { namespace fusion {
-
+namespace boost { namespace fusion
+{
struct deque_tag;
- namespace extension
+ namespace extension
{
template<typename T>
struct begin_impl;
-
+
template<>
struct begin_impl<deque_tag>
{
template<typename Sequence>
struct apply
{
- typedef typename mpl::if_<
- mpl::equal_to<typename Sequence::next_down, typename Sequence::next_up>,
- deque_iterator<Sequence, 0>,
- deque_iterator<
- Sequence, mpl::plus<typename Sequence::next_down, mpl::int_<1> >::value> >::type type;
-
+ typedef typename
+ mpl::if_c<
+ (Sequence::next_down::value == Sequence::next_up::value)
+ , deque_iterator<Sequence, 0>
+ , deque_iterator<Sequence, (Sequence::next_down::value + 1)>
+ >::type
+ type;
+
static type call(Sequence& seq)
{
return type(seq);
diff --git a/boost/fusion/container/deque/detail/convert_impl.hpp b/boost/fusion/container/deque/detail/convert_impl.hpp
index 9693d95d12..1401ef1ac8 100644
--- a/boost/fusion/container/deque/detail/convert_impl.hpp
+++ b/boost/fusion/container/deque/detail/convert_impl.hpp
@@ -1,5 +1,5 @@
/*=============================================================================
- Copyright (c) 2005-2011 Joel de Guzman
+ Copyright (c) 2005-2012 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -28,7 +28,7 @@ namespace boost { namespace fusion
template <typename Sequence>
struct apply
{
- typedef typename detail::as_deque<result_of::size<Sequence>::value> gen;
+ typedef detail::as_deque<result_of::size<Sequence>::value> gen;
typedef typename gen::
template apply<typename result_of::begin<Sequence>::type>::type
type;
diff --git a/boost/fusion/container/deque/detail/cpp03_deque.hpp b/boost/fusion/container/deque/detail/cpp03_deque.hpp
new file mode 100644
index 0000000000..5804d89006
--- /dev/null
+++ b/boost/fusion/container/deque/detail/cpp03_deque.hpp
@@ -0,0 +1,125 @@
+/*=============================================================================
+ Copyright (c) 2005-2012 Joel de Guzman
+ Copyright (c) 2005-2006 Dan Marsden
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+#if !defined(BOOST_CPP03_FUSION_DEQUE_26112006_1649)
+#define BOOST_CPP03_FUSION_DEQUE_26112006_1649
+
+#if defined(BOOST_FUSION_HAS_CPP11_DEQUE)
+#error "C++03 only! This file should not have been included"
+#endif
+
+#include <boost/fusion/container/deque/limits.hpp>
+#include <boost/fusion/container/deque/front_extended_deque.hpp>
+#include <boost/fusion/container/deque/back_extended_deque.hpp>
+#include <boost/fusion/container/deque/detail/cpp03_deque_keyed_values.hpp>
+#include <boost/fusion/container/deque/detail/deque_initial_size.hpp>
+#include <boost/fusion/support/sequence_base.hpp>
+#include <boost/fusion/container/deque/detail/keyed_element.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/enum_binary_params.hpp>
+#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
+#include <boost/type_traits/add_reference.hpp>
+#include <boost/type_traits/add_const.hpp>
+#include <boost/type_traits/is_convertible.hpp>
+
+#include <boost/fusion/container/deque/deque_fwd.hpp>
+#include <boost/fusion/container/deque/detail/value_at_impl.hpp>
+#include <boost/fusion/container/deque/detail/at_impl.hpp>
+#include <boost/fusion/container/deque/detail/begin_impl.hpp>
+#include <boost/fusion/container/deque/detail/end_impl.hpp>
+#include <boost/fusion/container/deque/detail/is_sequence_impl.hpp>
+#include <boost/fusion/sequence/intrinsic/begin.hpp>
+#include <boost/mpl/bool.hpp>
+
+#include <boost/fusion/support/sequence_base.hpp>
+#include <boost/fusion/support/void.hpp>
+#include <boost/utility/enable_if.hpp>
+
+#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
+#include <boost/fusion/container/deque/detail/preprocessed/deque.hpp>
+#else
+#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
+#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/deque" FUSION_MAX_DEQUE_SIZE_STR ".hpp")
+#endif
+
+/*=============================================================================
+ Copyright (c) 2001-2011 Joel de Guzman
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+ This is an auto-generated file. Do not edit!
+==============================================================================*/
+
+#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
+#pragma wave option(preserve: 1)
+#endif
+
+namespace boost { namespace fusion {
+
+ struct deque_tag;
+
+ template<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename T)>
+ struct deque
+ :
+ detail::deque_keyed_values<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)>::type,
+ sequence_base<deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)> >
+ {
+ typedef deque_tag fusion_tag;
+ typedef bidirectional_traversal_tag category;
+ typedef typename detail::deque_keyed_values<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)>::type base;
+ typedef typename detail::deque_initial_size<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)>::type size;
+ typedef mpl::int_<size::value> next_up;
+ typedef mpl::int_<
+ mpl::if_<mpl::equal_to<size, mpl::int_<0> >, mpl::int_<0>, mpl::int_<-1> >::type::value> next_down;
+ typedef mpl::false_ is_view;
+
+#include <boost/fusion/container/deque/detail/deque_forward_ctor.hpp>
+
+ deque()
+ {}
+
+ explicit deque(typename add_reference<typename add_const<T0>::type>::type t0)
+ : base(t0, detail::nil_keyed_element())
+ {}
+
+ template<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename U)>
+ deque(deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)> const& seq)
+ : base(seq)
+ {}
+
+ template<typename Sequence>
+ deque(Sequence const& seq, typename disable_if<is_convertible<Sequence, T0> >::type* /*dummy*/ = 0)
+ : base(base::from_iterator(fusion::begin(seq)))
+ {}
+
+ template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename U)>
+ deque&
+ operator=(deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)> const& rhs)
+ {
+ base::operator=(rhs);
+ return *this;
+ }
+
+ template <typename T>
+ deque&
+ operator=(T const& rhs)
+ {
+ base::operator=(rhs);
+ return *this;
+ }
+
+ };
+}}
+
+#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
+#pragma wave option(output: null)
+#endif
+
+#endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
+
+#endif
diff --git a/boost/fusion/container/deque/detail/cpp03_deque_fwd.hpp b/boost/fusion/container/deque/detail/cpp03_deque_fwd.hpp
new file mode 100644
index 0000000000..3a74447b17
--- /dev/null
+++ b/boost/fusion/container/deque/detail/cpp03_deque_fwd.hpp
@@ -0,0 +1,54 @@
+/*=============================================================================
+ Copyright (c) 2005-2012 Joel de Guzman
+ Copyright (c) 2005-2007 Dan Marsden
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+#if !defined(FUSION_CPP03_DEQUE_FORWARD_02092007_0749)
+#define FUSION_CPP03_DEQUE_FORWARD_02092007_0749
+
+#if defined(BOOST_FUSION_HAS_CPP11_DEQUE)
+#error "C++03 only! This file should not have been included"
+#endif
+
+#include <boost/fusion/container/deque/limits.hpp>
+#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
+
+#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
+#include <boost/fusion/container/deque/detail/preprocessed/deque_fwd.hpp>
+#else
+#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
+#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/deque" FUSION_MAX_DEQUE_SIZE_STR "_fwd.hpp")
+#endif
+
+/*=============================================================================
+ Copyright (c) 2001-2011 Joel de Guzman
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+ This is an auto-generated file. Do not edit!
+==============================================================================*/
+
+#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
+#pragma wave option(preserve: 1)
+#endif
+
+namespace boost { namespace fusion
+{
+ struct void_;
+
+ template<
+ BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
+ FUSION_MAX_DEQUE_SIZE, typename T, void_)>
+ struct deque;
+}}
+
+#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
+#pragma wave option(output: null)
+#endif
+
+#endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
+
+#endif
diff --git a/boost/fusion/container/deque/detail/deque_keyed_values.hpp b/boost/fusion/container/deque/detail/cpp03_deque_keyed_values.hpp
index 898bc46b92..2fee47009b 100644
--- a/boost/fusion/container/deque/detail/deque_keyed_values.hpp
+++ b/boost/fusion/container/deque/detail/cpp03_deque_keyed_values.hpp
@@ -1,5 +1,5 @@
/*=============================================================================
- Copyright (c) 2005-2011 Joel de Guzman
+ Copyright (c) 2005-2012 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -8,6 +8,10 @@
#if !defined(BOOST_FUSION_DEQUE_DETAIL_DEQUE_KEYED_VALUES_26112006_1330)
#define BOOST_FUSION_DEQUE_DETAIL_DEQUE_KEYED_VALUES_26112006_1330
+#if defined(BOOST_FUSION_HAS_CPP11_DEQUE)
+#error "C++03 only! This file should not have been included"
+#endif
+
#include <boost/fusion/container/deque/limits.hpp>
#include <boost/fusion/container/deque/detail/keyed_element.hpp>
diff --git a/boost/fusion/container/deque/detail/cpp11_deque_keyed_values.hpp b/boost/fusion/container/deque/detail/cpp11_deque_keyed_values.hpp
new file mode 100644
index 0000000000..43ed5360a2
--- /dev/null
+++ b/boost/fusion/container/deque/detail/cpp11_deque_keyed_values.hpp
@@ -0,0 +1,56 @@
+/*=============================================================================
+ Copyright (c) 2005-2012 Joel de Guzman
+ Copyright (c) 2005-2006 Dan Marsden
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+#if !defined(BOOST_FUSION_DEQUE_DETAIL_CPP11_DEQUE_KEYED_VALUES_07042012_1901)
+#define BOOST_FUSION_DEQUE_DETAIL_CPP11_DEQUE_KEYED_VALUES_07042012_1901
+
+#include <boost/fusion/container/deque/detail/keyed_element.hpp>
+#include <boost/type_traits/add_reference.hpp>
+#include <boost/type_traits/add_const.hpp>
+#include <boost/mpl/int.hpp>
+
+namespace boost { namespace fusion { namespace detail
+{
+ template<typename Key, typename Value, typename Rest>
+ struct keyed_element;
+
+ template <typename N, typename ...Elements>
+ struct deque_keyed_values_impl;
+
+ template <typename N, typename Head, typename ...Tail>
+ struct deque_keyed_values_impl<N, Head, Tail...>
+ {
+ typedef mpl::int_<(N::value + 1)> next_index;
+ typedef typename deque_keyed_values_impl<next_index, Tail...>::type tail;
+ typedef keyed_element<N, Head, tail> type;
+
+ static type call(
+ typename detail::call_param<Head>::type head
+ , typename detail::call_param<Tail>::type... tail)
+ {
+ return type(
+ head
+ , deque_keyed_values_impl<next_index, Tail...>::call(tail...)
+ );
+ }
+ };
+
+ struct nil_keyed_element;
+
+ template <typename N>
+ struct deque_keyed_values_impl<N>
+ {
+ typedef nil_keyed_element type;
+ static type call() { return type(); }
+ };
+
+ template <typename ...Elements>
+ struct deque_keyed_values
+ : deque_keyed_values_impl<mpl::int_<0>, Elements...> {};
+}}}
+
+#endif
diff --git a/boost/fusion/container/deque/detail/deque_forward_ctor.hpp b/boost/fusion/container/deque/detail/deque_forward_ctor.hpp
index 38d5e6430c..b76916ebd8 100644
--- a/boost/fusion/container/deque/detail/deque_forward_ctor.hpp
+++ b/boost/fusion/container/deque/detail/deque_forward_ctor.hpp
@@ -1,14 +1,18 @@
/*=============================================================================
- Copyright (c) 2005-2011 Joel de Guzman
+ Copyright (c) 2005-2012 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
- Distributed under the Boost Software License, Version 1.0. (See accompanying
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_PP_IS_ITERATING)
#if !defined(BOOST_FUSION_SEQUENCE_DEQUE_DETAIL_DEQUE_FORWARD_CTOR_04122006_2212)
#define BOOST_FUSION_SEQUENCE_DEQUE_DETAIL_DEQUE_FORWARD_CTOR_04122006_2212
+#if defined(BOOST_FUSION_HAS_CPP11_DEQUE)
+#error "C++03 only! This file should not have been included"
+#endif
+
#include <boost/preprocessor/iterate.hpp>
#include <boost/preprocessor/repetition/enum_shifted_params.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
diff --git a/boost/fusion/container/deque/detail/deque_initial_size.hpp b/boost/fusion/container/deque/detail/deque_initial_size.hpp
index 738221ce26..edb3c176cc 100644
--- a/boost/fusion/container/deque/detail/deque_initial_size.hpp
+++ b/boost/fusion/container/deque/detail/deque_initial_size.hpp
@@ -1,5 +1,5 @@
/*=============================================================================
- Copyright (c) 2005-2011 Joel de Guzman
+ Copyright (c) 2005-2012 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -8,6 +8,10 @@
#if !defined(BOOST_FUSION_DEQUE_DETAIL_DEQUE_INITIAL_SIZE_26112006_2139)
#define BOOST_FUSION_DEQUE_DETAIL_DEQUE_INITIAL_SIZE_26112006_2139
+#if defined(BOOST_FUSION_HAS_CPP11_DEQUE)
+#error "C++03 only! This file should not have been included"
+#endif
+
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/mpl/find.hpp>
#include <boost/mpl/begin.hpp>
diff --git a/boost/fusion/container/deque/detail/deque_keyed_values_call.hpp b/boost/fusion/container/deque/detail/deque_keyed_values_call.hpp
index d96f16a0cf..f95960bcfc 100644
--- a/boost/fusion/container/deque/detail/deque_keyed_values_call.hpp
+++ b/boost/fusion/container/deque/detail/deque_keyed_values_call.hpp
@@ -1,5 +1,5 @@
/*=============================================================================
- Copyright (c) 2005-2011 Joel de Guzman
+ Copyright (c) 2005-2012 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -9,6 +9,10 @@
#if !defined(BOOST_FUSION_SEQUENCE_DEQUE_DETAIL_DEQUE_KEYED_VALUES_CALL_04122006_2211)
#define BOOST_FUSION_SEQUENCE_DEQUE_DETAIL_DEQUE_KEYED_VALUES_CALL_04122006_2211
+#if defined(BOOST_FUSION_HAS_CPP11_DEQUE)
+#error "C++03 only! This file should not have been included"
+#endif
+
#include <boost/preprocessor/iterate.hpp>
#include <boost/preprocessor/repetition/enum_shifted_params.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
diff --git a/boost/fusion/container/deque/detail/end_impl.hpp b/boost/fusion/container/deque/detail/end_impl.hpp
index 0727e00f54..8037689abf 100644
--- a/boost/fusion/container/deque/detail/end_impl.hpp
+++ b/boost/fusion/container/deque/detail/end_impl.hpp
@@ -1,8 +1,8 @@
/*=============================================================================
- Copyright (c) 2005-2011 Joel de Guzman
+ Copyright (c) 2005-2012 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
- Distributed under the Boost Software License, Version 1.0. (See accompanying
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_DEQUE_END_IMPL_09122006_2034)
@@ -13,27 +13,29 @@
#include <boost/mpl/equal_to.hpp>
#include <boost/mpl/if.hpp>
-namespace boost { namespace fusion {
-
+namespace boost { namespace fusion
+{
struct deque_tag;
- namespace extension
+ namespace extension
{
template<typename T>
struct end_impl;
-
+
template<>
struct end_impl<deque_tag>
{
template<typename Sequence>
struct apply
{
- typedef typename mpl::if_<
- mpl::equal_to<typename Sequence::next_down, typename Sequence::next_up>,
- deque_iterator<Sequence, 0>,
- deque_iterator<
- Sequence, Sequence::next_up::value> >::type type;
-
+ typedef typename
+ mpl::if_c<
+ (Sequence::next_down::value == Sequence::next_up::value)
+ , deque_iterator<Sequence, 0>
+ , deque_iterator<Sequence, Sequence::next_up::value>
+ >::type
+ type;
+
static type call(Sequence& seq)
{
return type(seq);
diff --git a/boost/fusion/container/deque/detail/is_sequence_impl.hpp b/boost/fusion/container/deque/detail/is_sequence_impl.hpp
index ff88ed6f2c..b4718be41a 100644
--- a/boost/fusion/container/deque/detail/is_sequence_impl.hpp
+++ b/boost/fusion/container/deque/detail/is_sequence_impl.hpp
@@ -1,7 +1,7 @@
/*=============================================================================
Copyright (c) 2010 Christopher Schmidt
- Distributed under the Boost Software License, Version 1.0. (See accompanying
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
@@ -14,18 +14,16 @@ namespace boost { namespace fusion
{
struct deque_tag;
- namespace extension
+ namespace extension
{
template<typename T>
struct is_sequence_impl;
-
+
template<>
struct is_sequence_impl<deque_tag>
{
template<typename Sequence>
- struct apply
- : mpl::true_
- {};
+ struct apply : mpl::true_ {};
};
}
}}
diff --git a/boost/fusion/container/deque/detail/keyed_element.hpp b/boost/fusion/container/deque/detail/keyed_element.hpp
index 1b5e346879..d1b219dee7 100644
--- a/boost/fusion/container/deque/detail/keyed_element.hpp
+++ b/boost/fusion/container/deque/detail/keyed_element.hpp
@@ -1,47 +1,45 @@
/*=============================================================================
- Copyright (c) 2005-2011 Joel de Guzman
+ Copyright (c) 2005-2012 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
- Distributed under the Boost Software License, Version 1.0. (See accompanying
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_DEQUE_DETAIL_KEYED_ELEMENT_26112006_1330)
#define BOOST_FUSION_DEQUE_DETAIL_KEYED_ELEMENT_26112006_1330
-#include <boost/type_traits/add_reference.hpp>
-#include <boost/type_traits/add_const.hpp>
-
+#include <boost/fusion/support/detail/access.hpp>
#include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/iterator/next.hpp>
-namespace boost { namespace fusion {
-
+namespace boost { namespace fusion
+{
struct fusion_sequence_tag;
+}}
-namespace detail {
-
+namespace boost { namespace fusion { namespace detail
+{
struct nil_keyed_element
{
typedef fusion_sequence_tag tag;
void get();
template<typename It>
- static nil_keyed_element
+ static nil_keyed_element
from_iterator(It const&)
{
return nil_keyed_element();
}
};
- template<typename Key, typename Value, typename Rest>
- struct keyed_element
- : Rest
+ template <typename Key, typename Value, typename Rest>
+ struct keyed_element : Rest
{
typedef Rest base;
typedef fusion_sequence_tag tag;
using Rest::get;
- template<typename It>
+ template <typename It>
static keyed_element
from_iterator(It const& it)
{
@@ -49,9 +47,9 @@ namespace detail {
*it, base::from_iterator(fusion::next(it)));
}
- template<typename U, typename Rst>
+ template <typename U, typename Rst>
keyed_element(keyed_element<Key, U, Rst> const& rhs)
- : Rest(rhs.get_base()), value_(rhs.value_)
+ : Rest(rhs.get_base()), value_(rhs.value_)
{}
Rest const get_base() const
@@ -59,17 +57,17 @@ namespace detail {
return *this;
}
- typename add_reference<typename add_const<Value>::type>::type get(Key) const
+ typename cref_result<Value>::type get(Key) const
{
return value_;
}
- typename add_reference<Value>::type get(Key)
+ typename ref_result<Value>::type get(Key)
{
return value_;
}
- keyed_element(typename add_reference<typename add_const<Value>::type>::type value, Rest const& rest)
+ keyed_element(typename call_param<Value>::type value, Rest const& rest)
: Rest(rest), value_(value)
{}
@@ -97,7 +95,7 @@ namespace detail {
template<typename Elem, typename Key>
struct keyed_element_value_at
- : keyed_element_value_at<typename Elem::base, Key>
+ : keyed_element_value_at<typename Elem::base, Key>
{};
template<typename Key, typename Value, typename Rest>
@@ -105,7 +103,6 @@ namespace detail {
{
typedef Value type;
};
-
}}}
#endif
diff --git a/boost/fusion/container/deque/detail/value_at_impl.hpp b/boost/fusion/container/deque/detail/value_at_impl.hpp
index 64dbe5e16f..cba31a3e0a 100644
--- a/boost/fusion/container/deque/detail/value_at_impl.hpp
+++ b/boost/fusion/container/deque/detail/value_at_impl.hpp
@@ -1,8 +1,8 @@
/*=============================================================================
- Copyright (c) 2005-2011 Joel de Guzman
+ Copyright (c) 2005-2012 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
- Distributed under the Boost Software License, Version 1.0. (See accompanying
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_DEQUE_VALUE_AT_IMPL_08122006_0756)
@@ -13,15 +13,15 @@
#include <boost/mpl/equal_to.hpp>
#include <boost/mpl/assert.hpp>
-namespace boost { namespace fusion {
-
+namespace boost { namespace fusion
+{
struct deque_tag;
- namespace extension
+ namespace extension
{
template<typename T>
struct value_at_impl;
-
+
template<>
struct value_at_impl<deque_tag>
{
@@ -31,10 +31,12 @@ namespace boost { namespace fusion {
typedef typename Sequence::next_up next_up;
typedef typename Sequence::next_down next_down;
BOOST_MPL_ASSERT_RELATION(next_down::value, !=, next_up::value);
-
- typedef mpl::plus<next_down, mpl::int_<1> > offset;
- typedef mpl::int_<mpl::plus<N, offset>::value> adjusted_index;
- typedef typename detail::keyed_element_value_at<Sequence, adjusted_index>::type type;
+
+ static int const offset = next_down::value + 1;
+ typedef mpl::int_<(N::value + offset)> adjusted_index;
+ typedef typename
+ detail::keyed_element_value_at<Sequence, adjusted_index>::type
+ type;
};
};
}
diff --git a/boost/fusion/container/deque/front_extended_deque.hpp b/boost/fusion/container/deque/front_extended_deque.hpp
index 7a7f9cee29..2f3654ede2 100644
--- a/boost/fusion/container/deque/front_extended_deque.hpp
+++ b/boost/fusion/container/deque/front_extended_deque.hpp
@@ -1,5 +1,5 @@
/*=============================================================================
- Copyright (c) 2005-2011 Joel de Guzman
+ Copyright (c) 2005-2012 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -8,32 +8,39 @@
#if !defined(BOOST_FUSION_FRONT_EXTENDED_DEQUE_26112006_2209)
#define BOOST_FUSION_FRONT_EXTENDED_DEQUE_26112006_2209
-#include <boost/fusion/container/deque/detail/keyed_element.hpp>
#include <boost/mpl/int.hpp>
-#include <boost/mpl/minus.hpp>
-#include <boost/mpl/plus.hpp>
-#include <boost/fusion/sequence/intrinsic/size.hpp>
-
-#include <boost/type_traits/add_const.hpp>
-#include <boost/type_traits/add_reference.hpp>
-
#include <boost/fusion/support/sequence_base.hpp>
+#include <boost/fusion/sequence/intrinsic/size.hpp>
+#include <boost/fusion/container/deque/detail/keyed_element.hpp>
namespace boost { namespace fusion
{
- template<typename Deque, typename T>
+ template <typename Deque, typename T>
struct front_extended_deque
- : detail::keyed_element<typename Deque::next_down, T, Deque>,
- sequence_base<front_extended_deque<Deque, T> >
+ : detail::keyed_element<typename Deque::next_down, T, Deque>
+ , sequence_base<front_extended_deque<Deque, T> >
{
typedef detail::keyed_element<typename Deque::next_down, T, Deque> base;
- typedef mpl::int_<mpl::minus<typename Deque::next_down, mpl::int_<1> >::value> next_down;
+ typedef mpl::int_<(Deque::next_down::value - 1)> next_down;
typedef typename Deque::next_up next_up;
- typedef mpl::plus<typename result_of::size<Deque>::type, mpl::int_<1> > size;
+ typedef mpl::int_<(result_of::size<Deque>::value + 1)> size;
+
+ template <typename Arg>
+ front_extended_deque(Deque const& deque, Arg const& val)
+ : base(val, deque)
+ {}
- front_extended_deque(Deque const& deque, typename add_reference<typename add_const<T>::type>::type t)
- : base(t, deque)
+#if defined(BOOST_NO_RVALUE_REFERENCES)
+ template <typename Arg>
+ front_extended_deque(Deque const& deque, Arg& val)
+ : base(val, deque)
{}
+#else
+ template <typename Arg>
+ front_extended_deque(Deque const& deque, Arg&& val)
+ : base(std::forward<Arg>(val), deque)
+ {}
+#endif
};
}}
diff --git a/boost/fusion/container/deque/limits.hpp b/boost/fusion/container/deque/limits.hpp
index 891d41ed0f..2a7d219de6 100644
--- a/boost/fusion/container/deque/limits.hpp
+++ b/boost/fusion/container/deque/limits.hpp
@@ -1,5 +1,5 @@
/*=============================================================================
- Copyright (c) 2005-2011 Joel de Guzman
+ Copyright (c) 2005-2012 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -8,6 +8,10 @@
#if !defined(BOOST_FUSION_DEQUE_LIMITS_26112006_1737)
#define BOOST_FUSION_DEQUE_LIMITS_26112006_1737
+#if defined(BOOST_FUSION_HAS_CPP11_DEQUE)
+#error "C++03 only! This file should not have been included"
+#endif
+
#include <boost/fusion/container/vector/limits.hpp>
#if !defined(FUSION_MAX_DEQUE_SIZE)
diff --git a/boost/fusion/container/list/detail/at_impl.hpp b/boost/fusion/container/list/detail/at_impl.hpp
index 145f8aa536..757463928a 100644
--- a/boost/fusion/container/list/detail/at_impl.hpp
+++ b/boost/fusion/container/list/detail/at_impl.hpp
@@ -10,7 +10,7 @@
#include <boost/fusion/support/detail/access.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/add_const.hpp>
-#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/if.hpp>
#include <boost/mpl/bool.hpp>
namespace boost { namespace fusion
@@ -93,15 +93,15 @@ namespace boost { namespace fusion
template <typename Sequence, typename N>
struct apply
{
- typedef detail::cons_deref<
- typename detail::cons_advance<Sequence, N::value>::type>
+ typedef typename detail::cons_deref<
+ typename detail::cons_advance<Sequence, N::value>::type>::type
element;
typedef typename
- mpl::eval_if<
+ mpl::if_<
is_const<Sequence>
- , detail::cref_result<element>
- , detail::ref_result<element>
+ , typename detail::cref_result<element>::type
+ , typename detail::ref_result<element>::type
>::type
type;
diff --git a/boost/fusion/container/map/detail/at_impl.hpp b/boost/fusion/container/map/detail/at_impl.hpp
index f871bee085..025c1724a1 100644
--- a/boost/fusion/container/map/detail/at_impl.hpp
+++ b/boost/fusion/container/map/detail/at_impl.hpp
@@ -28,7 +28,9 @@ namespace boost { namespace fusion
template <typename Sequence, typename N>
struct apply
{
- typedef mpl::at<typename Sequence::storage_type::types, N> element;
+ typedef typename
+ mpl::at<typename Sequence::storage_type::types, N>::type
+ element;
typedef typename detail::ref_result<element>::type type;
static type
@@ -39,9 +41,11 @@ namespace boost { namespace fusion
};
template <typename Sequence, typename N>
- struct apply <Sequence const, N>
+ struct apply<Sequence const, N>
{
- typedef mpl::at<typename Sequence::storage_type::types, N> element;
+ typedef typename
+ mpl::at<typename Sequence::storage_type::types, N>::type
+ element;
typedef typename detail::cref_result<element>::type type;
static type
diff --git a/boost/fusion/container/map/detail/deref_data_impl.hpp b/boost/fusion/container/map/detail/deref_data_impl.hpp
index 07087a39a8..8304c898ee 100644
--- a/boost/fusion/container/map/detail/deref_data_impl.hpp
+++ b/boost/fusion/container/map/detail/deref_data_impl.hpp
@@ -12,8 +12,7 @@
#include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/support/detail/access.hpp>
#include <boost/type_traits/is_const.hpp>
-#include <boost/mpl/eval_if.hpp>
-#include <boost/mpl/identity.hpp>
+#include <boost/mpl/if.hpp>
namespace boost { namespace fusion { namespace extension
{
@@ -29,10 +28,10 @@ namespace boost { namespace fusion { namespace extension
typedef typename result_of::value_of<It>::type::second_type data;
typedef typename
- mpl::eval_if<
+ mpl::if_<
is_const<typename It::seq_type>
- , detail::cref_result<mpl::identity<data> >
- , detail::ref_result<mpl::identity<data> >
+ , typename detail::cref_result<data>::type
+ , typename detail::ref_result<data>::type
>::type
type;
diff --git a/boost/fusion/container/vector/detail/at_impl.hpp b/boost/fusion/container/vector/detail/at_impl.hpp
index 0a006dc33d..0017d9c813 100644
--- a/boost/fusion/container/vector/detail/at_impl.hpp
+++ b/boost/fusion/container/vector/detail/at_impl.hpp
@@ -27,7 +27,7 @@ namespace boost { namespace fusion
template <typename Sequence, typename N>
struct apply
{
- typedef mpl::at<typename Sequence::types, N> element;
+ typedef typename mpl::at<typename Sequence::types, N>::type element;
typedef typename detail::ref_result<element>::type type;
static type
@@ -40,7 +40,7 @@ namespace boost { namespace fusion
template <typename Sequence, typename N>
struct apply <Sequence const, N>
{
- typedef mpl::at<typename Sequence::types, N> element;
+ typedef typename mpl::at<typename Sequence::types, N>::type element;
typedef typename detail::cref_result<element>::type type;
static type
diff --git a/boost/fusion/container/vector/detail/deref_impl.hpp b/boost/fusion/container/vector/detail/deref_impl.hpp
index 1d9ac4a831..8c5fb94207 100644
--- a/boost/fusion/container/vector/detail/deref_impl.hpp
+++ b/boost/fusion/container/vector/detail/deref_impl.hpp
@@ -10,6 +10,7 @@
#include <boost/mpl/at.hpp>
#include <boost/fusion/support/detail/access.hpp>
#include <boost/type_traits/is_const.hpp>
+#include <boost/mpl/if.hpp>
namespace boost { namespace fusion
{
@@ -29,14 +30,14 @@ namespace boost { namespace fusion
typedef typename Iterator::vector vector;
typedef typename Iterator::index index;
typedef typename mpl::at<
- typename vector::types, index>
+ typename vector::types, index>::type
element;
typedef typename
- mpl::eval_if<
+ mpl::if_<
is_const<vector>
- , fusion::detail::cref_result<element>
- , fusion::detail::ref_result<element>
+ , typename fusion::detail::cref_result<element>::type
+ , typename fusion::detail::ref_result<element>::type
>::type
type;
diff --git a/boost/fusion/container/vector/detail/preprocessed/vector10.hpp b/boost/fusion/container/vector/detail/preprocessed/vector10.hpp
index d6258f60aa..8ef9947de9 100644
--- a/boost/fusion/container/vector/detail/preprocessed/vector10.hpp
+++ b/boost/fusion/container/vector/detail/preprocessed/vector10.hpp
@@ -34,6 +34,15 @@ namespace boost { namespace fusion
return vector_data1(*i0);
}
+ template <typename Sequence>
+ static vector_data1
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+
+ return vector_data1(*i0);
+ }
T0 m0;
};
template <typename T0>
@@ -64,6 +73,12 @@ namespace boost { namespace fusion
, typename boost::disable_if<is_convertible<Sequence, T0> >::type* = 0
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector1(
+ Sequence& seq
+ , typename boost::disable_if<is_convertible<Sequence, T0> >::type* = 0
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0>
vector1&
operator=(vector1<U0> const& vec)
@@ -121,6 +136,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0);
return vector_data2(*i0 , *i1);
}
+ template <typename Sequence>
+ static vector_data2
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0);
+ return vector_data2(*i0 , *i1);
+ }
T0 m0; T1 m1;
};
template <typename T0 , typename T1>
@@ -149,6 +173,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector2(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1>
vector2&
operator=(vector2<U0 , U1> const& vec)
@@ -206,6 +235,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1);
return vector_data3(*i0 , *i1 , *i2);
}
+ template <typename Sequence>
+ static vector_data3
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1);
+ return vector_data3(*i0 , *i1 , *i2);
+ }
T0 m0; T1 m1; T2 m2;
};
template <typename T0 , typename T1 , typename T2>
@@ -234,6 +272,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector3(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2>
vector3&
operator=(vector3<U0 , U1 , U2> const& vec)
@@ -291,6 +334,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2);
return vector_data4(*i0 , *i1 , *i2 , *i3);
}
+ template <typename Sequence>
+ static vector_data4
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2);
+ return vector_data4(*i0 , *i1 , *i2 , *i3);
+ }
T0 m0; T1 m1; T2 m2; T3 m3;
};
template <typename T0 , typename T1 , typename T2 , typename T3>
@@ -319,6 +371,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector4(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3>
vector4&
operator=(vector4<U0 , U1 , U2 , U3> const& vec)
@@ -376,6 +433,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3);
return vector_data5(*i0 , *i1 , *i2 , *i3 , *i4);
}
+ template <typename Sequence>
+ static vector_data5
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3);
+ return vector_data5(*i0 , *i1 , *i2 , *i3 , *i4);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4>
@@ -404,6 +470,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector5(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4>
vector5&
operator=(vector5<U0 , U1 , U2 , U3 , U4> const& vec)
@@ -461,6 +532,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4);
return vector_data6(*i0 , *i1 , *i2 , *i3 , *i4 , *i5);
}
+ template <typename Sequence>
+ static vector_data6
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4);
+ return vector_data6(*i0 , *i1 , *i2 , *i3 , *i4 , *i5);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5>
@@ -489,6 +569,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector6(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5>
vector6&
operator=(vector6<U0 , U1 , U2 , U3 , U4 , U5> const& vec)
@@ -546,6 +631,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5);
return vector_data7(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6);
}
+ template <typename Sequence>
+ static vector_data7
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5);
+ return vector_data7(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6>
@@ -574,6 +668,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector7(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6>
vector7&
operator=(vector7<U0 , U1 , U2 , U3 , U4 , U5 , U6> const& vec)
@@ -631,6 +730,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6);
return vector_data8(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7);
}
+ template <typename Sequence>
+ static vector_data8
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6);
+ return vector_data8(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7>
@@ -659,6 +767,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector8(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7>
vector8&
operator=(vector8<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7> const& vec)
@@ -716,6 +829,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7);
return vector_data9(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8);
}
+ template <typename Sequence>
+ static vector_data9
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7);
+ return vector_data9(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8>
@@ -744,6 +866,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector9(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8>
vector9&
operator=(vector9<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8> const& vec)
@@ -801,6 +928,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8);
return vector_data10(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9);
}
+ template <typename Sequence>
+ static vector_data10
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8);
+ return vector_data10(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9>
@@ -829,6 +965,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector10(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9>
vector10&
operator=(vector10<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9> const& vec)
diff --git a/boost/fusion/container/vector/detail/preprocessed/vector20.hpp b/boost/fusion/container/vector/detail/preprocessed/vector20.hpp
index a409b2e7a7..151acbbdc8 100644
--- a/boost/fusion/container/vector/detail/preprocessed/vector20.hpp
+++ b/boost/fusion/container/vector/detail/preprocessed/vector20.hpp
@@ -37,6 +37,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9);
return vector_data11(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10);
}
+ template <typename Sequence>
+ static vector_data11
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9);
+ return vector_data11(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10>
@@ -65,6 +74,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector11(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10>
vector11&
operator=(vector11<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10> const& vec)
@@ -122,6 +136,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10);
return vector_data12(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11);
}
+ template <typename Sequence>
+ static vector_data12
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10);
+ return vector_data12(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11>
@@ -150,6 +173,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector12(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11>
vector12&
operator=(vector12<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11> const& vec)
@@ -207,6 +235,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11);
return vector_data13(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12);
}
+ template <typename Sequence>
+ static vector_data13
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11);
+ return vector_data13(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12>
@@ -235,6 +272,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector13(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12>
vector13&
operator=(vector13<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12> const& vec)
@@ -292,6 +334,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12);
return vector_data14(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13);
}
+ template <typename Sequence>
+ static vector_data14
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12);
+ return vector_data14(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13>
@@ -320,6 +371,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector14(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13>
vector14&
operator=(vector14<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13> const& vec)
@@ -377,6 +433,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13);
return vector_data15(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14);
}
+ template <typename Sequence>
+ static vector_data15
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13);
+ return vector_data15(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14>
@@ -405,6 +470,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector15(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14>
vector15&
operator=(vector15<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14> const& vec)
@@ -462,6 +532,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14);
return vector_data16(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15);
}
+ template <typename Sequence>
+ static vector_data16
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14);
+ return vector_data16(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15>
@@ -490,6 +569,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector16(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15>
vector16&
operator=(vector16<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15> const& vec)
@@ -547,6 +631,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15);
return vector_data17(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16);
}
+ template <typename Sequence>
+ static vector_data17
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15);
+ return vector_data17(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16>
@@ -575,6 +668,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector17(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16>
vector17&
operator=(vector17<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16> const& vec)
@@ -632,6 +730,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16);
return vector_data18(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17);
}
+ template <typename Sequence>
+ static vector_data18
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16);
+ return vector_data18(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17>
@@ -660,6 +767,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector18(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17>
vector18&
operator=(vector18<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17> const& vec)
@@ -717,6 +829,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17);
return vector_data19(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18);
}
+ template <typename Sequence>
+ static vector_data19
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17);
+ return vector_data19(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18>
@@ -745,6 +866,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector19(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18>
vector19&
operator=(vector19<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18> const& vec)
@@ -802,6 +928,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18);
return vector_data20(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19);
}
+ template <typename Sequence>
+ static vector_data20
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18);
+ return vector_data20(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19>
@@ -830,6 +965,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector20(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19>
vector20&
operator=(vector20<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19> const& vec)
diff --git a/boost/fusion/container/vector/detail/preprocessed/vector30.hpp b/boost/fusion/container/vector/detail/preprocessed/vector30.hpp
index 032ff9d294..3810091bcf 100644
--- a/boost/fusion/container/vector/detail/preprocessed/vector30.hpp
+++ b/boost/fusion/container/vector/detail/preprocessed/vector30.hpp
@@ -37,6 +37,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19);
return vector_data21(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20);
}
+ template <typename Sequence>
+ static vector_data21
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19);
+ return vector_data21(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20>
@@ -65,6 +74,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector21(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20>
vector21&
operator=(vector21<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20> const& vec)
@@ -122,6 +136,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20);
return vector_data22(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21);
}
+ template <typename Sequence>
+ static vector_data22
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20);
+ return vector_data22(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21>
@@ -150,6 +173,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector22(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20 , typename U21>
vector22&
operator=(vector22<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21> const& vec)
@@ -207,6 +235,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21);
return vector_data23(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22);
}
+ template <typename Sequence>
+ static vector_data23
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21);
+ return vector_data23(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22>
@@ -235,6 +272,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector23(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20 , typename U21 , typename U22>
vector23&
operator=(vector23<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22> const& vec)
@@ -292,6 +334,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22);
return vector_data24(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23);
}
+ template <typename Sequence>
+ static vector_data24
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22);
+ return vector_data24(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23>
@@ -320,6 +371,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector24(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20 , typename U21 , typename U22 , typename U23>
vector24&
operator=(vector24<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23> const& vec)
@@ -377,6 +433,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23);
return vector_data25(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24);
}
+ template <typename Sequence>
+ static vector_data25
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23);
+ return vector_data25(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24>
@@ -405,6 +470,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector25(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20 , typename U21 , typename U22 , typename U23 , typename U24>
vector25&
operator=(vector25<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24> const& vec)
@@ -462,6 +532,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24);
return vector_data26(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25);
}
+ template <typename Sequence>
+ static vector_data26
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24);
+ return vector_data26(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25>
@@ -490,6 +569,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector26(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20 , typename U21 , typename U22 , typename U23 , typename U24 , typename U25>
vector26&
operator=(vector26<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25> const& vec)
@@ -547,6 +631,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25);
return vector_data27(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26);
}
+ template <typename Sequence>
+ static vector_data27
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25);
+ return vector_data27(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26>
@@ -575,6 +668,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector27(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20 , typename U21 , typename U22 , typename U23 , typename U24 , typename U25 , typename U26>
vector27&
operator=(vector27<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26> const& vec)
@@ -632,6 +730,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26);
return vector_data28(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27);
}
+ template <typename Sequence>
+ static vector_data28
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26);
+ return vector_data28(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26 , typename T27>
@@ -660,6 +767,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector28(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20 , typename U21 , typename U22 , typename U23 , typename U24 , typename U25 , typename U26 , typename U27>
vector28&
operator=(vector28<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26 , U27> const& vec)
@@ -717,6 +829,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27);
return vector_data29(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28);
}
+ template <typename Sequence>
+ static vector_data29
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27);
+ return vector_data29(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26 , typename T27 , typename T28>
@@ -745,6 +866,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector29(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20 , typename U21 , typename U22 , typename U23 , typename U24 , typename U25 , typename U26 , typename U27 , typename U28>
vector29&
operator=(vector29<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26 , U27 , U28> const& vec)
@@ -802,6 +928,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28);
return vector_data30(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29);
}
+ template <typename Sequence>
+ static vector_data30
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28);
+ return vector_data30(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26 , typename T27 , typename T28 , typename T29>
@@ -830,6 +965,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector30(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20 , typename U21 , typename U22 , typename U23 , typename U24 , typename U25 , typename U26 , typename U27 , typename U28 , typename U29>
vector30&
operator=(vector30<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26 , U27 , U28 , U29> const& vec)
diff --git a/boost/fusion/container/vector/detail/preprocessed/vector40.hpp b/boost/fusion/container/vector/detail/preprocessed/vector40.hpp
index 1b5fa58d95..07fac8dcff 100644
--- a/boost/fusion/container/vector/detail/preprocessed/vector40.hpp
+++ b/boost/fusion/container/vector/detail/preprocessed/vector40.hpp
@@ -37,6 +37,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29);
return vector_data31(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30);
}
+ template <typename Sequence>
+ static vector_data31
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29);
+ return vector_data31(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26 , typename T27 , typename T28 , typename T29 , typename T30>
@@ -65,6 +74,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector31(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20 , typename U21 , typename U22 , typename U23 , typename U24 , typename U25 , typename U26 , typename U27 , typename U28 , typename U29 , typename U30>
vector31&
operator=(vector31<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26 , U27 , U28 , U29 , U30> const& vec)
@@ -122,6 +136,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30);
return vector_data32(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31);
}
+ template <typename Sequence>
+ static vector_data32
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30);
+ return vector_data32(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26 , typename T27 , typename T28 , typename T29 , typename T30 , typename T31>
@@ -150,6 +173,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector32(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20 , typename U21 , typename U22 , typename U23 , typename U24 , typename U25 , typename U26 , typename U27 , typename U28 , typename U29 , typename U30 , typename U31>
vector32&
operator=(vector32<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26 , U27 , U28 , U29 , U30 , U31> const& vec)
@@ -207,6 +235,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31);
return vector_data33(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32);
}
+ template <typename Sequence>
+ static vector_data33
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31);
+ return vector_data33(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26 , typename T27 , typename T28 , typename T29 , typename T30 , typename T31 , typename T32>
@@ -235,6 +272,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector33(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20 , typename U21 , typename U22 , typename U23 , typename U24 , typename U25 , typename U26 , typename U27 , typename U28 , typename U29 , typename U30 , typename U31 , typename U32>
vector33&
operator=(vector33<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26 , U27 , U28 , U29 , U30 , U31 , U32> const& vec)
@@ -292,6 +334,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32);
return vector_data34(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33);
}
+ template <typename Sequence>
+ static vector_data34
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32);
+ return vector_data34(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26 , typename T27 , typename T28 , typename T29 , typename T30 , typename T31 , typename T32 , typename T33>
@@ -320,6 +371,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector34(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20 , typename U21 , typename U22 , typename U23 , typename U24 , typename U25 , typename U26 , typename U27 , typename U28 , typename U29 , typename U30 , typename U31 , typename U32 , typename U33>
vector34&
operator=(vector34<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26 , U27 , U28 , U29 , U30 , U31 , U32 , U33> const& vec)
@@ -377,6 +433,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33);
return vector_data35(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34);
}
+ template <typename Sequence>
+ static vector_data35
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33);
+ return vector_data35(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; T34 m34;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26 , typename T27 , typename T28 , typename T29 , typename T30 , typename T31 , typename T32 , typename T33 , typename T34>
@@ -405,6 +470,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector35(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20 , typename U21 , typename U22 , typename U23 , typename U24 , typename U25 , typename U26 , typename U27 , typename U28 , typename U29 , typename U30 , typename U31 , typename U32 , typename U33 , typename U34>
vector35&
operator=(vector35<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26 , U27 , U28 , U29 , U30 , U31 , U32 , U33 , U34> const& vec)
@@ -462,6 +532,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34);
return vector_data36(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35);
}
+ template <typename Sequence>
+ static vector_data36
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34);
+ return vector_data36(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; T34 m34; T35 m35;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26 , typename T27 , typename T28 , typename T29 , typename T30 , typename T31 , typename T32 , typename T33 , typename T34 , typename T35>
@@ -490,6 +569,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector36(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20 , typename U21 , typename U22 , typename U23 , typename U24 , typename U25 , typename U26 , typename U27 , typename U28 , typename U29 , typename U30 , typename U31 , typename U32 , typename U33 , typename U34 , typename U35>
vector36&
operator=(vector36<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26 , U27 , U28 , U29 , U30 , U31 , U32 , U33 , U34 , U35> const& vec)
@@ -547,6 +631,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35);
return vector_data37(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36);
}
+ template <typename Sequence>
+ static vector_data37
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35);
+ return vector_data37(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; T34 m34; T35 m35; T36 m36;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26 , typename T27 , typename T28 , typename T29 , typename T30 , typename T31 , typename T32 , typename T33 , typename T34 , typename T35 , typename T36>
@@ -575,6 +668,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector37(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20 , typename U21 , typename U22 , typename U23 , typename U24 , typename U25 , typename U26 , typename U27 , typename U28 , typename U29 , typename U30 , typename U31 , typename U32 , typename U33 , typename U34 , typename U35 , typename U36>
vector37&
operator=(vector37<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26 , U27 , U28 , U29 , U30 , U31 , U32 , U33 , U34 , U35 , U36> const& vec)
@@ -632,6 +730,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36);
return vector_data38(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37);
}
+ template <typename Sequence>
+ static vector_data38
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36);
+ return vector_data38(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; T34 m34; T35 m35; T36 m36; T37 m37;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26 , typename T27 , typename T28 , typename T29 , typename T30 , typename T31 , typename T32 , typename T33 , typename T34 , typename T35 , typename T36 , typename T37>
@@ -660,6 +767,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector38(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20 , typename U21 , typename U22 , typename U23 , typename U24 , typename U25 , typename U26 , typename U27 , typename U28 , typename U29 , typename U30 , typename U31 , typename U32 , typename U33 , typename U34 , typename U35 , typename U36 , typename U37>
vector38&
operator=(vector38<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26 , U27 , U28 , U29 , U30 , U31 , U32 , U33 , U34 , U35 , U36 , U37> const& vec)
@@ -717,6 +829,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37);
return vector_data39(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38);
}
+ template <typename Sequence>
+ static vector_data39
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37);
+ return vector_data39(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; T34 m34; T35 m35; T36 m36; T37 m37; T38 m38;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26 , typename T27 , typename T28 , typename T29 , typename T30 , typename T31 , typename T32 , typename T33 , typename T34 , typename T35 , typename T36 , typename T37 , typename T38>
@@ -745,6 +866,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector39(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20 , typename U21 , typename U22 , typename U23 , typename U24 , typename U25 , typename U26 , typename U27 , typename U28 , typename U29 , typename U30 , typename U31 , typename U32 , typename U33 , typename U34 , typename U35 , typename U36 , typename U37 , typename U38>
vector39&
operator=(vector39<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26 , U27 , U28 , U29 , U30 , U31 , U32 , U33 , U34 , U35 , U36 , U37 , U38> const& vec)
@@ -802,6 +928,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38);
return vector_data40(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39);
}
+ template <typename Sequence>
+ static vector_data40
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38);
+ return vector_data40(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; T34 m34; T35 m35; T36 m36; T37 m37; T38 m38; T39 m39;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26 , typename T27 , typename T28 , typename T29 , typename T30 , typename T31 , typename T32 , typename T33 , typename T34 , typename T35 , typename T36 , typename T37 , typename T38 , typename T39>
@@ -830,6 +965,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector40(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20 , typename U21 , typename U22 , typename U23 , typename U24 , typename U25 , typename U26 , typename U27 , typename U28 , typename U29 , typename U30 , typename U31 , typename U32 , typename U33 , typename U34 , typename U35 , typename U36 , typename U37 , typename U38 , typename U39>
vector40&
operator=(vector40<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26 , U27 , U28 , U29 , U30 , U31 , U32 , U33 , U34 , U35 , U36 , U37 , U38 , U39> const& vec)
diff --git a/boost/fusion/container/vector/detail/preprocessed/vector50.hpp b/boost/fusion/container/vector/detail/preprocessed/vector50.hpp
index ba6c1771f6..7ef9402e66 100644
--- a/boost/fusion/container/vector/detail/preprocessed/vector50.hpp
+++ b/boost/fusion/container/vector/detail/preprocessed/vector50.hpp
@@ -37,6 +37,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39);
return vector_data41(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40);
}
+ template <typename Sequence>
+ static vector_data41
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39);
+ return vector_data41(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; T34 m34; T35 m35; T36 m36; T37 m37; T38 m38; T39 m39; T40 m40;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26 , typename T27 , typename T28 , typename T29 , typename T30 , typename T31 , typename T32 , typename T33 , typename T34 , typename T35 , typename T36 , typename T37 , typename T38 , typename T39 , typename T40>
@@ -65,6 +74,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector41(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20 , typename U21 , typename U22 , typename U23 , typename U24 , typename U25 , typename U26 , typename U27 , typename U28 , typename U29 , typename U30 , typename U31 , typename U32 , typename U33 , typename U34 , typename U35 , typename U36 , typename U37 , typename U38 , typename U39 , typename U40>
vector41&
operator=(vector41<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26 , U27 , U28 , U29 , U30 , U31 , U32 , U33 , U34 , U35 , U36 , U37 , U38 , U39 , U40> const& vec)
@@ -122,6 +136,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40);
return vector_data42(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41);
}
+ template <typename Sequence>
+ static vector_data42
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40);
+ return vector_data42(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; T34 m34; T35 m35; T36 m36; T37 m37; T38 m38; T39 m39; T40 m40; T41 m41;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26 , typename T27 , typename T28 , typename T29 , typename T30 , typename T31 , typename T32 , typename T33 , typename T34 , typename T35 , typename T36 , typename T37 , typename T38 , typename T39 , typename T40 , typename T41>
@@ -150,6 +173,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector42(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20 , typename U21 , typename U22 , typename U23 , typename U24 , typename U25 , typename U26 , typename U27 , typename U28 , typename U29 , typename U30 , typename U31 , typename U32 , typename U33 , typename U34 , typename U35 , typename U36 , typename U37 , typename U38 , typename U39 , typename U40 , typename U41>
vector42&
operator=(vector42<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26 , U27 , U28 , U29 , U30 , U31 , U32 , U33 , U34 , U35 , U36 , U37 , U38 , U39 , U40 , U41> const& vec)
@@ -207,6 +235,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41);
return vector_data43(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41 , *i42);
}
+ template <typename Sequence>
+ static vector_data43
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41);
+ return vector_data43(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41 , *i42);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; T34 m34; T35 m35; T36 m36; T37 m37; T38 m38; T39 m39; T40 m40; T41 m41; T42 m42;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26 , typename T27 , typename T28 , typename T29 , typename T30 , typename T31 , typename T32 , typename T33 , typename T34 , typename T35 , typename T36 , typename T37 , typename T38 , typename T39 , typename T40 , typename T41 , typename T42>
@@ -235,6 +272,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector43(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20 , typename U21 , typename U22 , typename U23 , typename U24 , typename U25 , typename U26 , typename U27 , typename U28 , typename U29 , typename U30 , typename U31 , typename U32 , typename U33 , typename U34 , typename U35 , typename U36 , typename U37 , typename U38 , typename U39 , typename U40 , typename U41 , typename U42>
vector43&
operator=(vector43<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26 , U27 , U28 , U29 , U30 , U31 , U32 , U33 , U34 , U35 , U36 , U37 , U38 , U39 , U40 , U41 , U42> const& vec)
@@ -292,6 +334,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42);
return vector_data44(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41 , *i42 , *i43);
}
+ template <typename Sequence>
+ static vector_data44
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42);
+ return vector_data44(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41 , *i42 , *i43);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; T34 m34; T35 m35; T36 m36; T37 m37; T38 m38; T39 m39; T40 m40; T41 m41; T42 m42; T43 m43;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26 , typename T27 , typename T28 , typename T29 , typename T30 , typename T31 , typename T32 , typename T33 , typename T34 , typename T35 , typename T36 , typename T37 , typename T38 , typename T39 , typename T40 , typename T41 , typename T42 , typename T43>
@@ -320,6 +371,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector44(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20 , typename U21 , typename U22 , typename U23 , typename U24 , typename U25 , typename U26 , typename U27 , typename U28 , typename U29 , typename U30 , typename U31 , typename U32 , typename U33 , typename U34 , typename U35 , typename U36 , typename U37 , typename U38 , typename U39 , typename U40 , typename U41 , typename U42 , typename U43>
vector44&
operator=(vector44<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26 , U27 , U28 , U29 , U30 , U31 , U32 , U33 , U34 , U35 , U36 , U37 , U38 , U39 , U40 , U41 , U42 , U43> const& vec)
@@ -377,6 +433,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); typedef typename result_of::next< I43>::type I44; I44 i44 = fusion::next(i43);
return vector_data45(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41 , *i42 , *i43 , *i44);
}
+ template <typename Sequence>
+ static vector_data45
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); typedef typename result_of::next< I43>::type I44; I44 i44 = fusion::next(i43);
+ return vector_data45(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41 , *i42 , *i43 , *i44);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; T34 m34; T35 m35; T36 m36; T37 m37; T38 m38; T39 m39; T40 m40; T41 m41; T42 m42; T43 m43; T44 m44;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26 , typename T27 , typename T28 , typename T29 , typename T30 , typename T31 , typename T32 , typename T33 , typename T34 , typename T35 , typename T36 , typename T37 , typename T38 , typename T39 , typename T40 , typename T41 , typename T42 , typename T43 , typename T44>
@@ -405,6 +470,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector45(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20 , typename U21 , typename U22 , typename U23 , typename U24 , typename U25 , typename U26 , typename U27 , typename U28 , typename U29 , typename U30 , typename U31 , typename U32 , typename U33 , typename U34 , typename U35 , typename U36 , typename U37 , typename U38 , typename U39 , typename U40 , typename U41 , typename U42 , typename U43 , typename U44>
vector45&
operator=(vector45<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26 , U27 , U28 , U29 , U30 , U31 , U32 , U33 , U34 , U35 , U36 , U37 , U38 , U39 , U40 , U41 , U42 , U43 , U44> const& vec)
@@ -462,6 +532,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); typedef typename result_of::next< I43>::type I44; I44 i44 = fusion::next(i43); typedef typename result_of::next< I44>::type I45; I45 i45 = fusion::next(i44);
return vector_data46(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41 , *i42 , *i43 , *i44 , *i45);
}
+ template <typename Sequence>
+ static vector_data46
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); typedef typename result_of::next< I43>::type I44; I44 i44 = fusion::next(i43); typedef typename result_of::next< I44>::type I45; I45 i45 = fusion::next(i44);
+ return vector_data46(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41 , *i42 , *i43 , *i44 , *i45);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; T34 m34; T35 m35; T36 m36; T37 m37; T38 m38; T39 m39; T40 m40; T41 m41; T42 m42; T43 m43; T44 m44; T45 m45;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26 , typename T27 , typename T28 , typename T29 , typename T30 , typename T31 , typename T32 , typename T33 , typename T34 , typename T35 , typename T36 , typename T37 , typename T38 , typename T39 , typename T40 , typename T41 , typename T42 , typename T43 , typename T44 , typename T45>
@@ -490,6 +569,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector46(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20 , typename U21 , typename U22 , typename U23 , typename U24 , typename U25 , typename U26 , typename U27 , typename U28 , typename U29 , typename U30 , typename U31 , typename U32 , typename U33 , typename U34 , typename U35 , typename U36 , typename U37 , typename U38 , typename U39 , typename U40 , typename U41 , typename U42 , typename U43 , typename U44 , typename U45>
vector46&
operator=(vector46<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26 , U27 , U28 , U29 , U30 , U31 , U32 , U33 , U34 , U35 , U36 , U37 , U38 , U39 , U40 , U41 , U42 , U43 , U44 , U45> const& vec)
@@ -547,6 +631,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); typedef typename result_of::next< I43>::type I44; I44 i44 = fusion::next(i43); typedef typename result_of::next< I44>::type I45; I45 i45 = fusion::next(i44); typedef typename result_of::next< I45>::type I46; I46 i46 = fusion::next(i45);
return vector_data47(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41 , *i42 , *i43 , *i44 , *i45 , *i46);
}
+ template <typename Sequence>
+ static vector_data47
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); typedef typename result_of::next< I43>::type I44; I44 i44 = fusion::next(i43); typedef typename result_of::next< I44>::type I45; I45 i45 = fusion::next(i44); typedef typename result_of::next< I45>::type I46; I46 i46 = fusion::next(i45);
+ return vector_data47(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41 , *i42 , *i43 , *i44 , *i45 , *i46);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; T34 m34; T35 m35; T36 m36; T37 m37; T38 m38; T39 m39; T40 m40; T41 m41; T42 m42; T43 m43; T44 m44; T45 m45; T46 m46;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26 , typename T27 , typename T28 , typename T29 , typename T30 , typename T31 , typename T32 , typename T33 , typename T34 , typename T35 , typename T36 , typename T37 , typename T38 , typename T39 , typename T40 , typename T41 , typename T42 , typename T43 , typename T44 , typename T45 , typename T46>
@@ -575,6 +668,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector47(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20 , typename U21 , typename U22 , typename U23 , typename U24 , typename U25 , typename U26 , typename U27 , typename U28 , typename U29 , typename U30 , typename U31 , typename U32 , typename U33 , typename U34 , typename U35 , typename U36 , typename U37 , typename U38 , typename U39 , typename U40 , typename U41 , typename U42 , typename U43 , typename U44 , typename U45 , typename U46>
vector47&
operator=(vector47<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26 , U27 , U28 , U29 , U30 , U31 , U32 , U33 , U34 , U35 , U36 , U37 , U38 , U39 , U40 , U41 , U42 , U43 , U44 , U45 , U46> const& vec)
@@ -632,6 +730,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); typedef typename result_of::next< I43>::type I44; I44 i44 = fusion::next(i43); typedef typename result_of::next< I44>::type I45; I45 i45 = fusion::next(i44); typedef typename result_of::next< I45>::type I46; I46 i46 = fusion::next(i45); typedef typename result_of::next< I46>::type I47; I47 i47 = fusion::next(i46);
return vector_data48(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41 , *i42 , *i43 , *i44 , *i45 , *i46 , *i47);
}
+ template <typename Sequence>
+ static vector_data48
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); typedef typename result_of::next< I43>::type I44; I44 i44 = fusion::next(i43); typedef typename result_of::next< I44>::type I45; I45 i45 = fusion::next(i44); typedef typename result_of::next< I45>::type I46; I46 i46 = fusion::next(i45); typedef typename result_of::next< I46>::type I47; I47 i47 = fusion::next(i46);
+ return vector_data48(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41 , *i42 , *i43 , *i44 , *i45 , *i46 , *i47);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; T34 m34; T35 m35; T36 m36; T37 m37; T38 m38; T39 m39; T40 m40; T41 m41; T42 m42; T43 m43; T44 m44; T45 m45; T46 m46; T47 m47;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26 , typename T27 , typename T28 , typename T29 , typename T30 , typename T31 , typename T32 , typename T33 , typename T34 , typename T35 , typename T36 , typename T37 , typename T38 , typename T39 , typename T40 , typename T41 , typename T42 , typename T43 , typename T44 , typename T45 , typename T46 , typename T47>
@@ -660,6 +767,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector48(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20 , typename U21 , typename U22 , typename U23 , typename U24 , typename U25 , typename U26 , typename U27 , typename U28 , typename U29 , typename U30 , typename U31 , typename U32 , typename U33 , typename U34 , typename U35 , typename U36 , typename U37 , typename U38 , typename U39 , typename U40 , typename U41 , typename U42 , typename U43 , typename U44 , typename U45 , typename U46 , typename U47>
vector48&
operator=(vector48<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26 , U27 , U28 , U29 , U30 , U31 , U32 , U33 , U34 , U35 , U36 , U37 , U38 , U39 , U40 , U41 , U42 , U43 , U44 , U45 , U46 , U47> const& vec)
@@ -717,6 +829,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); typedef typename result_of::next< I43>::type I44; I44 i44 = fusion::next(i43); typedef typename result_of::next< I44>::type I45; I45 i45 = fusion::next(i44); typedef typename result_of::next< I45>::type I46; I46 i46 = fusion::next(i45); typedef typename result_of::next< I46>::type I47; I47 i47 = fusion::next(i46); typedef typename result_of::next< I47>::type I48; I48 i48 = fusion::next(i47);
return vector_data49(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41 , *i42 , *i43 , *i44 , *i45 , *i46 , *i47 , *i48);
}
+ template <typename Sequence>
+ static vector_data49
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); typedef typename result_of::next< I43>::type I44; I44 i44 = fusion::next(i43); typedef typename result_of::next< I44>::type I45; I45 i45 = fusion::next(i44); typedef typename result_of::next< I45>::type I46; I46 i46 = fusion::next(i45); typedef typename result_of::next< I46>::type I47; I47 i47 = fusion::next(i46); typedef typename result_of::next< I47>::type I48; I48 i48 = fusion::next(i47);
+ return vector_data49(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41 , *i42 , *i43 , *i44 , *i45 , *i46 , *i47 , *i48);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; T34 m34; T35 m35; T36 m36; T37 m37; T38 m38; T39 m39; T40 m40; T41 m41; T42 m42; T43 m43; T44 m44; T45 m45; T46 m46; T47 m47; T48 m48;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26 , typename T27 , typename T28 , typename T29 , typename T30 , typename T31 , typename T32 , typename T33 , typename T34 , typename T35 , typename T36 , typename T37 , typename T38 , typename T39 , typename T40 , typename T41 , typename T42 , typename T43 , typename T44 , typename T45 , typename T46 , typename T47 , typename T48>
@@ -745,6 +866,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector49(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20 , typename U21 , typename U22 , typename U23 , typename U24 , typename U25 , typename U26 , typename U27 , typename U28 , typename U29 , typename U30 , typename U31 , typename U32 , typename U33 , typename U34 , typename U35 , typename U36 , typename U37 , typename U38 , typename U39 , typename U40 , typename U41 , typename U42 , typename U43 , typename U44 , typename U45 , typename U46 , typename U47 , typename U48>
vector49&
operator=(vector49<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26 , U27 , U28 , U29 , U30 , U31 , U32 , U33 , U34 , U35 , U36 , U37 , U38 , U39 , U40 , U41 , U42 , U43 , U44 , U45 , U46 , U47 , U48> const& vec)
@@ -802,6 +928,15 @@ namespace boost { namespace fusion
typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); typedef typename result_of::next< I43>::type I44; I44 i44 = fusion::next(i43); typedef typename result_of::next< I44>::type I45; I45 i45 = fusion::next(i44); typedef typename result_of::next< I45>::type I46; I46 i46 = fusion::next(i45); typedef typename result_of::next< I46>::type I47; I47 i47 = fusion::next(i46); typedef typename result_of::next< I47>::type I48; I48 i48 = fusion::next(i47); typedef typename result_of::next< I48>::type I49; I49 i49 = fusion::next(i48);
return vector_data50(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41 , *i42 , *i43 , *i44 , *i45 , *i46 , *i47 , *i48 , *i49);
}
+ template <typename Sequence>
+ static vector_data50
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ typedef typename result_of::next< I0>::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next< I1>::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next< I2>::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next< I3>::type I4; I4 i4 = fusion::next(i3); typedef typename result_of::next< I4>::type I5; I5 i5 = fusion::next(i4); typedef typename result_of::next< I5>::type I6; I6 i6 = fusion::next(i5); typedef typename result_of::next< I6>::type I7; I7 i7 = fusion::next(i6); typedef typename result_of::next< I7>::type I8; I8 i8 = fusion::next(i7); typedef typename result_of::next< I8>::type I9; I9 i9 = fusion::next(i8); typedef typename result_of::next< I9>::type I10; I10 i10 = fusion::next(i9); typedef typename result_of::next< I10>::type I11; I11 i11 = fusion::next(i10); typedef typename result_of::next< I11>::type I12; I12 i12 = fusion::next(i11); typedef typename result_of::next< I12>::type I13; I13 i13 = fusion::next(i12); typedef typename result_of::next< I13>::type I14; I14 i14 = fusion::next(i13); typedef typename result_of::next< I14>::type I15; I15 i15 = fusion::next(i14); typedef typename result_of::next< I15>::type I16; I16 i16 = fusion::next(i15); typedef typename result_of::next< I16>::type I17; I17 i17 = fusion::next(i16); typedef typename result_of::next< I17>::type I18; I18 i18 = fusion::next(i17); typedef typename result_of::next< I18>::type I19; I19 i19 = fusion::next(i18); typedef typename result_of::next< I19>::type I20; I20 i20 = fusion::next(i19); typedef typename result_of::next< I20>::type I21; I21 i21 = fusion::next(i20); typedef typename result_of::next< I21>::type I22; I22 i22 = fusion::next(i21); typedef typename result_of::next< I22>::type I23; I23 i23 = fusion::next(i22); typedef typename result_of::next< I23>::type I24; I24 i24 = fusion::next(i23); typedef typename result_of::next< I24>::type I25; I25 i25 = fusion::next(i24); typedef typename result_of::next< I25>::type I26; I26 i26 = fusion::next(i25); typedef typename result_of::next< I26>::type I27; I27 i27 = fusion::next(i26); typedef typename result_of::next< I27>::type I28; I28 i28 = fusion::next(i27); typedef typename result_of::next< I28>::type I29; I29 i29 = fusion::next(i28); typedef typename result_of::next< I29>::type I30; I30 i30 = fusion::next(i29); typedef typename result_of::next< I30>::type I31; I31 i31 = fusion::next(i30); typedef typename result_of::next< I31>::type I32; I32 i32 = fusion::next(i31); typedef typename result_of::next< I32>::type I33; I33 i33 = fusion::next(i32); typedef typename result_of::next< I33>::type I34; I34 i34 = fusion::next(i33); typedef typename result_of::next< I34>::type I35; I35 i35 = fusion::next(i34); typedef typename result_of::next< I35>::type I36; I36 i36 = fusion::next(i35); typedef typename result_of::next< I36>::type I37; I37 i37 = fusion::next(i36); typedef typename result_of::next< I37>::type I38; I38 i38 = fusion::next(i37); typedef typename result_of::next< I38>::type I39; I39 i39 = fusion::next(i38); typedef typename result_of::next< I39>::type I40; I40 i40 = fusion::next(i39); typedef typename result_of::next< I40>::type I41; I41 i41 = fusion::next(i40); typedef typename result_of::next< I41>::type I42; I42 i42 = fusion::next(i41); typedef typename result_of::next< I42>::type I43; I43 i43 = fusion::next(i42); typedef typename result_of::next< I43>::type I44; I44 i44 = fusion::next(i43); typedef typename result_of::next< I44>::type I45; I45 i45 = fusion::next(i44); typedef typename result_of::next< I45>::type I46; I46 i46 = fusion::next(i45); typedef typename result_of::next< I46>::type I47; I47 i47 = fusion::next(i46); typedef typename result_of::next< I47>::type I48; I48 i48 = fusion::next(i47); typedef typename result_of::next< I48>::type I49; I49 i49 = fusion::next(i48);
+ return vector_data50(*i0 , *i1 , *i2 , *i3 , *i4 , *i5 , *i6 , *i7 , *i8 , *i9 , *i10 , *i11 , *i12 , *i13 , *i14 , *i15 , *i16 , *i17 , *i18 , *i19 , *i20 , *i21 , *i22 , *i23 , *i24 , *i25 , *i26 , *i27 , *i28 , *i29 , *i30 , *i31 , *i32 , *i33 , *i34 , *i35 , *i36 , *i37 , *i38 , *i39 , *i40 , *i41 , *i42 , *i43 , *i44 , *i45 , *i46 , *i47 , *i48 , *i49);
+ }
T0 m0; T1 m1; T2 m2; T3 m3; T4 m4; T5 m5; T6 m6; T7 m7; T8 m8; T9 m9; T10 m10; T11 m11; T12 m12; T13 m13; T14 m14; T15 m15; T16 m16; T17 m17; T18 m18; T19 m19; T20 m20; T21 m21; T22 m22; T23 m23; T24 m24; T25 m25; T26 m26; T27 m27; T28 m28; T29 m29; T30 m30; T31 m31; T32 m32; T33 m33; T34 m34; T35 m35; T36 m36; T37 m37; T38 m38; T39 m39; T40 m40; T41 m41; T42 m42; T43 m43; T44 m44; T45 m45; T46 m46; T47 m47; T48 m48; T49 m49;
};
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26 , typename T27 , typename T28 , typename T29 , typename T30 , typename T31 , typename T32 , typename T33 , typename T34 , typename T35 , typename T36 , typename T37 , typename T38 , typename T39 , typename T40 , typename T41 , typename T42 , typename T43 , typename T44 , typename T45 , typename T46 , typename T47 , typename T48 , typename T49>
@@ -830,6 +965,11 @@ namespace boost { namespace fusion
Sequence const& seq
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ vector50(
+ Sequence& seq
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20 , typename U21 , typename U22 , typename U23 , typename U24 , typename U25 , typename U26 , typename U27 , typename U28 , typename U29 , typename U30 , typename U31 , typename U32 , typename U33 , typename U34 , typename U35 , typename U36 , typename U37 , typename U38 , typename U39 , typename U40 , typename U41 , typename U42 , typename U43 , typename U44 , typename U45 , typename U46 , typename U47 , typename U48 , typename U49>
vector50&
operator=(vector50<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26 , U27 , U28 , U29 , U30 , U31 , U32 , U33 , U34 , U35 , U36 , U37 , U38 , U39 , U40 , U41 , U42 , U43 , U44 , U45 , U46 , U47 , U48 , U49> const& vec)
diff --git a/boost/fusion/container/vector/detail/vector_n.hpp b/boost/fusion/container/vector/detail/vector_n.hpp
index 431774b37c..4e249c7fe7 100644
--- a/boost/fusion/container/vector/detail/vector_n.hpp
+++ b/boost/fusion/container/vector/detail/vector_n.hpp
@@ -68,6 +68,16 @@
return BOOST_PP_CAT(vector_data, N)(BOOST_PP_ENUM_PARAMS(N, *i));
}
+ template <typename Sequence>
+ static BOOST_PP_CAT(vector_data, N)
+ init_from_sequence(Sequence& seq)
+ {
+ typedef typename result_of::begin<Sequence>::type I0;
+ I0 i0 = fusion::begin(seq);
+ BOOST_PP_REPEAT_FROM_TO(1, N, FUSION_ITER_DECL_VAR, _)
+ return BOOST_PP_CAT(vector_data, N)(BOOST_PP_ENUM_PARAMS(N, *i));
+ }
+
BOOST_PP_REPEAT(N, FUSION_MEMBER_DECL, _)
};
@@ -109,6 +119,15 @@
)
: base_type(base_type::init_from_sequence(seq)) {}
+ template <typename Sequence>
+ BOOST_PP_CAT(vector, N)(
+ Sequence& seq
+#if (N == 1)
+ , typename boost::disable_if<is_convertible<Sequence, T0> >::type* /*dummy*/ = 0
+#endif
+ )
+ : base_type(base_type::init_from_sequence(seq)) {}
+
template <BOOST_PP_ENUM_PARAMS(N, typename U)>
BOOST_PP_CAT(vector, N)&
operator=(BOOST_PP_CAT(vector, N)<BOOST_PP_ENUM_PARAMS(N, U)> const& vec)
diff --git a/boost/fusion/functional/adapter/unfused.hpp b/boost/fusion/functional/adapter/unfused.hpp
index b0d02bc47c..facd5c5427 100644
--- a/boost/fusion/functional/adapter/unfused.hpp
+++ b/boost/fusion/functional/adapter/unfused.hpp
@@ -100,6 +100,7 @@ namespace boost { namespace fusion
namespace boost
{
+#if !defined(BOOST_RESULT_OF_USE_DECLTYPE) || defined(BOOST_NO_DECLTYPE)
template<class F>
struct result_of< boost::fusion::unfused<F> const () >
{
@@ -110,6 +111,17 @@ namespace boost
{
typedef typename boost::fusion::unfused<F>::call_0_result type;
};
+#endif
+ template<class F>
+ struct tr1_result_of< boost::fusion::unfused<F> const () >
+ {
+ typedef typename boost::fusion::unfused<F>::call_const_0_result type;
+ };
+ template<class F>
+ struct tr1_result_of< boost::fusion::unfused<F>() >
+ {
+ typedef typename boost::fusion::unfused<F>::call_0_result type;
+ };
}
#define BOOST_FUSION_FUNCTIONAL_ADAPTER_UNFUSED_HPP_INCLUDED
diff --git a/boost/fusion/functional/adapter/unfused_typed.hpp b/boost/fusion/functional/adapter/unfused_typed.hpp
index 0f19f28f0b..923c6876c1 100644
--- a/boost/fusion/functional/adapter/unfused_typed.hpp
+++ b/boost/fusion/functional/adapter/unfused_typed.hpp
@@ -80,6 +80,7 @@ namespace boost { namespace fusion
namespace boost
{
+#if !defined(BOOST_RESULT_OF_USE_DECLTYPE) || defined(BOOST_NO_DECLTYPE)
template<class F, class Seq>
struct result_of< boost::fusion::unfused_typed<F,Seq> const () >
: boost::fusion::unfused_typed<F,Seq>::template result<
@@ -90,6 +91,17 @@ namespace boost
: boost::fusion::unfused_typed<F,Seq>::template result<
boost::fusion::unfused_typed<F,Seq> () >
{ };
+#endif
+ template<class F, class Seq>
+ struct tr1_result_of< boost::fusion::unfused_typed<F,Seq> const () >
+ : boost::fusion::unfused_typed<F,Seq>::template result<
+ boost::fusion::unfused_typed<F,Seq> const () >
+ { };
+ template<class F, class Seq>
+ struct tr1_result_of< boost::fusion::unfused_typed<F,Seq>() >
+ : boost::fusion::unfused_typed<F,Seq>::template result<
+ boost::fusion::unfused_typed<F,Seq> () >
+ { };
}
diff --git a/boost/fusion/include/define_struct_inline.hpp b/boost/fusion/include/define_struct_inline.hpp
new file mode 100644
index 0000000000..141ad4e2dd
--- /dev/null
+++ b/boost/fusion/include/define_struct_inline.hpp
@@ -0,0 +1,13 @@
+/*=============================================================================
+ Copyright (c) 2012 Nathan Ridge
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+
+#ifndef BOOST_FUSION_INCLUDE_DEFINE_STRUCT_INLINE_HPP
+#define BOOST_FUSION_INCLUDE_DEFINE_STRUCT_INLINE_HPP
+
+#include <boost/fusion/adapted/struct/define_struct_inline.hpp>
+
+#endif
diff --git a/boost/fusion/include/repetetive_view.hpp b/boost/fusion/include/repetitive_view.hpp
index f56bca8821..f56bca8821 100644
--- a/boost/fusion/include/repetetive_view.hpp
+++ b/boost/fusion/include/repetitive_view.hpp
diff --git a/boost/fusion/sequence/comparison/detail/equal_to.hpp b/boost/fusion/sequence/comparison/detail/equal_to.hpp
index 3e15e63ae5..56cfe1b247 100644
--- a/boost/fusion/sequence/comparison/detail/equal_to.hpp
+++ b/boost/fusion/sequence/comparison/detail/equal_to.hpp
@@ -12,6 +12,7 @@
#include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/iterator/next.hpp>
#include <boost/fusion/iterator/equal_to.hpp>
+#include <boost/fusion/support/as_const.hpp>
namespace boost { namespace fusion { namespace detail
{
@@ -32,7 +33,7 @@ namespace boost { namespace fusion { namespace detail
static bool
call(I1 const& a, I2 const& b, mpl::false_)
{
- return *a == *b
+ return extension::as_const(*a) == extension::as_const(*b)
&& call(fusion::next(a), fusion::next(b));
}
diff --git a/boost/fusion/sequence/comparison/detail/greater.hpp b/boost/fusion/sequence/comparison/detail/greater.hpp
index b4c4b087a6..e61287765f 100644
--- a/boost/fusion/sequence/comparison/detail/greater.hpp
+++ b/boost/fusion/sequence/comparison/detail/greater.hpp
@@ -12,6 +12,7 @@
#include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/iterator/next.hpp>
#include <boost/fusion/iterator/equal_to.hpp>
+#include <boost/fusion/support/as_const.hpp>
namespace boost { namespace fusion { namespace detail
{
@@ -32,8 +33,9 @@ namespace boost { namespace fusion { namespace detail
static bool
call(I1 const& a, I2 const& b, mpl::false_)
{
- return *a > *b ||
- (!(*b > *a) && call(fusion::next(a), fusion::next(b)));
+ return extension::as_const(*a) > extension::as_const(*b) ||
+ (!(extension::as_const(*b) > extension::as_const(*a)) &&
+ call(fusion::next(a), fusion::next(b)));
}
template <typename I1, typename I2>
diff --git a/boost/fusion/sequence/comparison/detail/greater_equal.hpp b/boost/fusion/sequence/comparison/detail/greater_equal.hpp
index f3eccd5d55..6d91e27bbd 100644
--- a/boost/fusion/sequence/comparison/detail/greater_equal.hpp
+++ b/boost/fusion/sequence/comparison/detail/greater_equal.hpp
@@ -12,6 +12,7 @@
#include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/iterator/next.hpp>
#include <boost/fusion/iterator/equal_to.hpp>
+#include <boost/fusion/support/as_const.hpp>
namespace boost { namespace fusion { namespace detail
{
@@ -32,8 +33,9 @@ namespace boost { namespace fusion { namespace detail
static bool
call(I1 const& a, I2 const& b, mpl::false_)
{
- return *a >= *b
- && (!(*b >= *a) || call(fusion::next(a), fusion::next(b)));
+ return extension::as_const(*a) >= extension::as_const(*b)
+ && (!(extension::as_const(*b) >= extension::as_const(*a)) ||
+ call(fusion::next(a), fusion::next(b)));
}
template <typename I1, typename I2>
diff --git a/boost/fusion/sequence/comparison/detail/less.hpp b/boost/fusion/sequence/comparison/detail/less.hpp
index 4957d7bfa8..1342bb1427 100644
--- a/boost/fusion/sequence/comparison/detail/less.hpp
+++ b/boost/fusion/sequence/comparison/detail/less.hpp
@@ -12,6 +12,7 @@
#include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/iterator/next.hpp>
#include <boost/fusion/iterator/equal_to.hpp>
+#include <boost/fusion/support/as_const.hpp>
namespace boost { namespace fusion { namespace detail
{
@@ -32,8 +33,9 @@ namespace boost { namespace fusion { namespace detail
static bool
call(I1 const& a, I2 const& b, mpl::false_)
{
- return *a < *b ||
- (!(*b < *a) && call(fusion::next(a), fusion::next(b)));
+ return extension::as_const(*a) < extension::as_const(*b) ||
+ (!(extension::as_const(*b) < extension::as_const(*a)) &&
+ call(fusion::next(a), fusion::next(b)));
}
template <typename I1, typename I2>
diff --git a/boost/fusion/sequence/comparison/detail/less_equal.hpp b/boost/fusion/sequence/comparison/detail/less_equal.hpp
index 08fe9ec389..5683849a2c 100644
--- a/boost/fusion/sequence/comparison/detail/less_equal.hpp
+++ b/boost/fusion/sequence/comparison/detail/less_equal.hpp
@@ -12,6 +12,7 @@
#include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/iterator/next.hpp>
#include <boost/fusion/iterator/equal_to.hpp>
+#include <boost/fusion/support/as_const.hpp>
namespace boost { namespace fusion { namespace detail
{
@@ -32,8 +33,9 @@ namespace boost { namespace fusion { namespace detail
static bool
call(I1 const& a, I2 const& b, mpl::false_)
{
- return *a <= *b
- && (!(*b <= *a) || call(fusion::next(a), fusion::next(b)));
+ return extension::as_const(*a) <= extension::as_const(*b)
+ && (!(extension::as_const(*b) <= extension::as_const(*a)) ||
+ call(fusion::next(a), fusion::next(b)));
}
template <typename I1, typename I2>
diff --git a/boost/fusion/sequence/comparison/detail/not_equal_to.hpp b/boost/fusion/sequence/comparison/detail/not_equal_to.hpp
index ac54dfb7d4..77c235089f 100644
--- a/boost/fusion/sequence/comparison/detail/not_equal_to.hpp
+++ b/boost/fusion/sequence/comparison/detail/not_equal_to.hpp
@@ -12,6 +12,7 @@
#include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/iterator/next.hpp>
#include <boost/fusion/iterator/equal_to.hpp>
+#include <boost/fusion/support/as_const.hpp>
namespace boost { namespace fusion { namespace detail
{
@@ -32,7 +33,7 @@ namespace boost { namespace fusion { namespace detail
static bool
call(I1 const& a, I2 const& b, mpl::false_)
{
- return *a != *b
+ return extension::as_const(*a) != extension::as_const(*b)
|| call(fusion::next(a), fusion::next(b));
}
diff --git a/boost/fusion/support.hpp b/boost/fusion/support.hpp
index 765b777d90..50bf924f9a 100644
--- a/boost/fusion/support.hpp
+++ b/boost/fusion/support.hpp
@@ -19,5 +19,6 @@
#include <boost/fusion/support/deduce.hpp>
#include <boost/fusion/support/deduce_sequence.hpp>
#include <boost/fusion/support/unused.hpp>
+#include <boost/fusion/support/as_const.hpp>
#endif
diff --git a/boost/fusion/support/as_const.hpp b/boost/fusion/support/as_const.hpp
new file mode 100644
index 0000000000..bb2a96a65d
--- /dev/null
+++ b/boost/fusion/support/as_const.hpp
@@ -0,0 +1,26 @@
+/*=============================================================================
+ Copyright (c) 2012 Nathan Ridge
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+#ifndef BOOST_FUSION_SUPPORT_AS_CONST_HPP
+#define BOOST_FUSION_SUPPORT_AS_CONST_HPP
+
+namespace boost { namespace fusion { namespace extension
+{
+ // A customization point that allows certain wrappers around
+ // Fusion sequence elements (e.g. adt_attribute_proxy) to be
+ // unwrapped in contexts where the element only needs to be
+ // read. The library wraps accesses to Fusion elements in
+ // such contexts with calls to this function. Users can
+ // specialize this function for their own wrappers.
+ template <typename T>
+ const T& as_const(const T& obj)
+ {
+ return obj;
+ }
+
+}}}
+
+#endif
diff --git a/boost/fusion/support/detail/access.hpp b/boost/fusion/support/detail/access.hpp
index 03c9c3191d..ced7cea18b 100644
--- a/boost/fusion/support/detail/access.hpp
+++ b/boost/fusion/support/detail/access.hpp
@@ -15,7 +15,7 @@ namespace boost { namespace fusion { namespace detail
template <typename T>
struct ref_result
{
- typedef typename add_reference<typename T::type>::type type;
+ typedef typename add_reference<T>::type type;
};
template <typename T>
@@ -23,7 +23,7 @@ namespace boost { namespace fusion { namespace detail
{
typedef typename
add_reference<
- typename add_const<typename T::type>::type
+ typename add_const<T>::type
>::type
type;
};
diff --git a/boost/fusion/support/is_segmented.hpp b/boost/fusion/support/is_segmented.hpp
index ba571dc537..6e62eac430 100644
--- a/boost/fusion/support/is_segmented.hpp
+++ b/boost/fusion/support/is_segmented.hpp
@@ -7,6 +7,7 @@
#if !defined(FUSION_IS_SEGMENTED_03202006_0015)
#define FUSION_IS_SEGMENTED_03202006_0015
+#include <boost/mpl/bool.hpp>
#include <boost/fusion/support/tag_of.hpp>
namespace boost { namespace fusion
@@ -41,8 +42,10 @@ namespace boost { namespace fusion
{
template <typename Sequence>
struct is_segmented
- : extension::is_segmented_impl<typename traits::tag_of<Sequence>::type>::
- template apply<Sequence>
+ : mpl::bool_<
+ (bool)extension::is_segmented_impl<typename traits::tag_of<Sequence>::type>::
+ template apply<Sequence>::type::value
+ >
{
};
}
diff --git a/boost/fusion/support/is_sequence.hpp b/boost/fusion/support/is_sequence.hpp
index 2f0ee43331..184bbbb6dc 100644
--- a/boost/fusion/support/is_sequence.hpp
+++ b/boost/fusion/support/is_sequence.hpp
@@ -59,9 +59,11 @@ namespace boost { namespace fusion
{
template <typename T>
struct is_sequence
- : extension::is_sequence_impl<
+ : mpl::bool_<
+ (bool)extension::is_sequence_impl<
typename fusion::detail::tag_of<T>::type
- >::template apply<T>
+ >::template apply<T>::type::value
+ >
{};
template <typename Sequence, typename Enable = void>
diff --git a/boost/fusion/support/is_view.hpp b/boost/fusion/support/is_view.hpp
index dbcc93a9bb..4ec9e06528 100644
--- a/boost/fusion/support/is_view.hpp
+++ b/boost/fusion/support/is_view.hpp
@@ -7,6 +7,7 @@
#if !defined(FUSION_IS_VIEW_03202006_0015)
#define FUSION_IS_VIEW_03202006_0015
+#include <boost/mpl/bool.hpp>
#include <boost/fusion/support/detail/is_view.hpp>
#include <boost/fusion/support/tag_of.hpp>
@@ -54,8 +55,10 @@ namespace boost { namespace fusion
{
template <typename T>
struct is_view :
- extension::is_view_impl<typename fusion::detail::tag_of<T>::type>::
- template apply<T>::type
+ mpl::bool_<
+ (bool)extension::is_view_impl<typename fusion::detail::tag_of<T>::type>::
+ template apply<T>::type::value
+ >
{};
}
}}
diff --git a/boost/fusion/tuple/detail/preprocessed/make_tuple.hpp b/boost/fusion/tuple/detail/preprocessed/make_tuple.hpp
index 53306dabf9..6abb033688 100644
--- a/boost/fusion/tuple/detail/preprocessed/make_tuple.hpp
+++ b/boost/fusion/tuple/detail/preprocessed/make_tuple.hpp
@@ -18,4 +18,4 @@
#include <boost/fusion/tuple/detail/preprocessed/make_tuple50.hpp>
#else
#error "FUSION_MAX_VECTOR_SIZE out of bounds for preprocessed headers"
-#endif \ No newline at end of file
+#endif
diff --git a/boost/fusion/tuple/detail/preprocessed/tuple_fwd.hpp b/boost/fusion/tuple/detail/preprocessed/tuple_fwd.hpp
index ec01d4b7fd..234936c587 100644
--- a/boost/fusion/tuple/detail/preprocessed/tuple_fwd.hpp
+++ b/boost/fusion/tuple/detail/preprocessed/tuple_fwd.hpp
@@ -18,4 +18,4 @@
#include <boost/fusion/tuple/detail/preprocessed/tuple50_fwd.hpp>
#else
#error "FUSION_MAX_VECTOR_SIZE out of bounds for preprocessed headers"
-#endif \ No newline at end of file
+#endif
diff --git a/boost/fusion/tuple/detail/preprocessed/tuple_tie.hpp b/boost/fusion/tuple/detail/preprocessed/tuple_tie.hpp
index 02fd8f7fe8..5898c6b978 100644
--- a/boost/fusion/tuple/detail/preprocessed/tuple_tie.hpp
+++ b/boost/fusion/tuple/detail/preprocessed/tuple_tie.hpp
@@ -18,4 +18,4 @@
#include <boost/fusion/tuple/detail/preprocessed/tuple_tie50.hpp>
#else
#error "FUSION_MAX_VECTOR_SIZE out of bounds for preprocessed headers"
-#endif \ No newline at end of file
+#endif
diff --git a/boost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp b/boost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp
index 489d955383..9bf459c4ec 100644
--- a/boost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp
+++ b/boost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp
@@ -21,6 +21,8 @@
#include <boost/fusion/iterator/equal_to.hpp>
#include <boost/fusion/container/list/detail/reverse_cons.hpp>
#include <boost/fusion/iterator/detail/segment_sequence.hpp>
+#include <boost/fusion/support/is_sequence.hpp>
+#include <boost/utility/enable_if.hpp>
// Invariants:
// - Each segmented iterator has a stack
@@ -45,11 +47,19 @@ namespace boost { namespace fusion
}
template <typename Sequence, typename T>
- typename result_of::push_back<Sequence const, T>::type
+ typename
+ lazy_enable_if<
+ traits::is_sequence<Sequence>
+ , result_of::push_back<Sequence const, T>
+ >::type
push_back(Sequence const& seq, T const& x);
template <typename Sequence, typename T>
- typename result_of::push_front<Sequence const, T>::type
+ typename
+ lazy_enable_if<
+ traits::is_sequence<Sequence>
+ , result_of::push_front<Sequence const, T>
+ >::type
push_front(Sequence const& seq, T const& x);
}}
diff --git a/boost/geometry/algorithms/area.hpp b/boost/geometry/algorithms/area.hpp
index 919ab66fe1..8193200ab9 100644
--- a/boost/geometry/algorithms/area.hpp
+++ b/boost/geometry/algorithms/area.hpp
@@ -92,7 +92,7 @@ struct ring_area
// An open ring has at least three points,
// A closed ring has at least four points,
// if not, there is no (zero) area
- if (boost::size(ring)
+ if (int(boost::size(ring))
< core_detail::closure::minimum_ring_size<Closure>::value)
{
return type();
diff --git a/boost/geometry/algorithms/detail/for_each_range.hpp b/boost/geometry/algorithms/detail/for_each_range.hpp
index b10017c209..7cb01fa9b4 100644
--- a/boost/geometry/algorithms/detail/for_each_range.hpp
+++ b/boost/geometry/algorithms/detail/for_each_range.hpp
@@ -22,6 +22,7 @@
#include <boost/geometry/core/tag_cast.hpp>
#include <boost/geometry/util/add_const_if_c.hpp>
+#include <boost/geometry/views/box_view.hpp>
namespace boost { namespace geometry
diff --git a/boost/geometry/algorithms/detail/get_left_turns.hpp b/boost/geometry/algorithms/detail/get_left_turns.hpp
new file mode 100644
index 0000000000..62f0f7f0f4
--- /dev/null
+++ b/boost/geometry/algorithms/detail/get_left_turns.hpp
@@ -0,0 +1,367 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// Copyright (c) 2012 Barend Gehrels, Amsterdam, the Netherlands.
+
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_GET_LEFT_TURNS_HPP
+#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_GET_LEFT_TURNS_HPP
+
+#include <boost/geometry/iterators/ever_circling_iterator.hpp>
+
+namespace boost { namespace geometry
+{
+
+
+#ifndef DOXYGEN_NO_DETAIL
+namespace detail
+{
+
+// TODO: move this to /util/
+template <typename T>
+static inline std::pair<T, T> ordered_pair(T const& first, T const& second)
+{
+ return first < second ? std::make_pair(first, second) : std::make_pair(second, first);
+}
+
+template <typename AngleInfo>
+inline void debug_left_turn(AngleInfo const& ai, AngleInfo const& previous)
+{
+#ifdef BOOST_GEOMETRY_DEBUG_BUFFER_OCCUPATION
+ std::cout << "Angle: " << (ai.incoming ? "i" : "o")
+ << " " << si(ai.seg_id)
+ << " " << (math::r2d * (ai.angle) )
+ << " turn: " << ai.turn_index << "[" << ai.operation_index << "]"
+ ;
+
+ if (ai.turn_index != previous.turn_index
+ || ai.operation_index != previous.operation_index)
+ {
+ std::cout << " diff: " << math::r2d * math::abs(previous.angle - ai.angle);
+ }
+ std::cout << std::endl;
+#endif
+}
+
+template <typename AngleInfo>
+inline void debug_left_turn(std::string const& caption, AngleInfo const& ai, AngleInfo const& previous,
+ int code = -99, int code2 = -99, int code3 = -99, int code4 = -99)
+{
+#ifdef BOOST_GEOMETRY_DEBUG_BUFFER_OCCUPATION
+ std::cout << " " << caption
+ << " turn: " << ai.turn_index << "[" << ai.operation_index << "]"
+ << " " << si(ai.seg_id)
+ << " " << (ai.incoming ? "i" : "o")
+ << " " << (math::r2d * (ai.angle) )
+ << " turn: " << previous.turn_index << "[" << previous.operation_index << "]"
+ << " " << si(previous.seg_id)
+ << " " << (previous.incoming ? "i" : "o")
+ << " " << (math::r2d * (previous.angle) )
+ ;
+
+ if (code != -99)
+ {
+ std::cout << " code: " << code << " , " << code2 << " , " << code3 << " , " << code4;
+ }
+ std::cout << std::endl;
+#endif
+}
+
+
+template <typename Operation>
+inline bool include_operation(Operation const& op,
+ segment_identifier const& outgoing_seg_id,
+ segment_identifier const& incoming_seg_id)
+{
+ return op.seg_id == outgoing_seg_id
+ && op.other_id == incoming_seg_id
+ && (op.operation == detail::overlay::operation_union
+ ||op.operation == detail::overlay::operation_continue)
+ ;
+}
+
+template <typename Turn>
+inline bool process_include(segment_identifier const& outgoing_seg_id, segment_identifier const& incoming_seg_id,
+ int turn_index, Turn& turn,
+ std::set<int>& keep_indices, int priority)
+{
+ bool result = false;
+ for (int i = 0; i < 2; i++)
+ {
+ if (include_operation(turn.operations[i], outgoing_seg_id, incoming_seg_id))
+ {
+ turn.operations[i].include_in_occupation_map = true;
+ if (priority > turn.priority)
+ {
+ turn.priority = priority;
+ }
+ keep_indices.insert(turn_index);
+ result = true;
+ }
+ }
+ return result;
+}
+
+template <typename AngleInfo, typename Turns, typename TurnSegmentIndices>
+inline bool include_left_turn_of_all(
+ AngleInfo const& outgoing, AngleInfo const& incoming,
+ Turns& turns, TurnSegmentIndices const& turn_segment_indices,
+ std::set<int>& keep_indices, int priority)
+{
+ segment_identifier const& outgoing_seg_id = turns[outgoing.turn_index].operations[outgoing.operation_index].seg_id;
+ segment_identifier const& incoming_seg_id = turns[incoming.turn_index].operations[incoming.operation_index].seg_id;
+
+ if (outgoing.turn_index == incoming.turn_index)
+ {
+ return process_include(outgoing_seg_id, incoming_seg_id, outgoing.turn_index, turns[outgoing.turn_index], keep_indices, priority);
+ }
+
+ bool result = false;
+ std::pair<segment_identifier, segment_identifier> pair = ordered_pair(outgoing_seg_id, incoming_seg_id);
+ auto it = turn_segment_indices.find(pair);
+ if (it != turn_segment_indices.end())
+ {
+ for (auto sit = it->second.begin(); sit != it->second.end(); ++sit)
+ {
+ if (process_include(outgoing_seg_id, incoming_seg_id, *sit, turns[*sit], keep_indices, priority))
+ {
+ result = true;
+ }
+ }
+ }
+ return result;
+}
+
+template <std::size_t Index, typename Turn>
+inline bool corresponds(Turn const& turn, segment_identifier const& seg_id)
+{
+ return turn.operations[Index].operation == detail::overlay::operation_union
+ && turn.operations[Index].seg_id == seg_id;
+}
+
+
+template <typename Turns, typename TurnSegmentIndices>
+inline bool prefer_by_other(Turns const& turns,
+ TurnSegmentIndices const& turn_segment_indices,
+ std::set<int>& indices)
+{
+ std::map<segment_identifier, int> map;
+ for (auto sit = indices.begin(); sit != indices.end(); ++sit)
+ {
+ map[turns[*sit].operations[0].seg_id]++;
+ map[turns[*sit].operations[1].seg_id]++;
+ }
+
+ std::set<segment_identifier> segment_occuring_once;
+ for (auto mit = map.begin(); mit != map.end(); ++mit)
+ {
+ if (mit->second == 1)
+ {
+ segment_occuring_once.insert(mit->first);
+ }
+#ifdef BOOST_GEOMETRY_DEBUG_BUFFER_PREFER
+ std::cout << si(mit->first) << " " << mit->second << std::endl;
+#endif
+ }
+
+ if (segment_occuring_once.size() == 2)
+ {
+ // Try to find within all turns a turn with these two segments
+
+ std::set<segment_identifier>::const_iterator soo_it = segment_occuring_once.begin();
+ segment_identifier front = *soo_it;
+ soo_it++;
+ segment_identifier back = *soo_it;
+
+ std::pair<segment_identifier, segment_identifier> pair = ordered_pair(front, back);
+ auto it = turn_segment_indices.find(pair);
+ if (it != turn_segment_indices.end())
+ {
+ // debug_turns_by_indices("Found", it->second);
+ // Check which is the union/continue
+ segment_identifier good;
+ for (auto sit = it->second.begin(); sit != it->second.end(); ++sit)
+ {
+ if (turns[*sit].operations[0].operation == detail::overlay::operation_union)
+ {
+ good = turns[*sit].operations[0].seg_id;
+ }
+ else if (turns[*sit].operations[1].operation == detail::overlay::operation_union)
+ {
+ good = turns[*sit].operations[1].seg_id;
+ }
+ }
+
+#ifdef BOOST_GEOMETRY_DEBUG_BUFFER_PREFER
+ std::cout << "Good: " << si(good) << std::endl;
+#endif
+
+ // Find in indexes-to-keep this segment with the union. Discard the other one
+ std::set<int> ok_indices;
+ for (auto sit = indices.begin(); sit != indices.end(); ++sit)
+ {
+ if (corresponds<0>(turns[*sit], good) || corresponds<1>(turns[*sit], good))
+ {
+ ok_indices.insert(*sit);
+ }
+ }
+ if (ok_indices.size() > 0 && ok_indices.size() < indices.size())
+ {
+ indices = ok_indices;
+ std::cout << "^";
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+template <typename Turns>
+inline void prefer_by_priority(Turns const& turns, std::set<int>& indices)
+{
+ // Find max prio
+ int min_prio = 1024, max_prio = 0;
+ for (auto sit = indices.begin(); sit != indices.end(); ++sit)
+ {
+ if (turns[*sit].priority > max_prio)
+ {
+ max_prio = turns[*sit].priority;
+ }
+ if (turns[*sit].priority < min_prio)
+ {
+ min_prio = turns[*sit].priority;
+ }
+ }
+
+ if (min_prio == max_prio)
+ {
+ return;
+ }
+
+ // Only keep indices with high prio
+ std::set<int> ok_indices;
+ for (auto sit = indices.begin(); sit != indices.end(); ++sit)
+ {
+ if (turns[*sit].priority >= max_prio)
+ {
+ ok_indices.insert(*sit);
+ }
+ }
+ if (ok_indices.size() > 0 && ok_indices.size() < indices.size())
+ {
+ indices = ok_indices;
+ std::cout << "%";
+ }
+}
+
+template <typename AngleInfo, typename Angles, typename Turns, typename TurnSegmentIndices>
+inline void calculate_left_turns(Angles const& angles,
+ Turns& turns, TurnSegmentIndices const& turn_segment_indices,
+ std::set<int>& keep_indices)
+{
+ bool debug_indicate_size = false;
+
+ typedef typename strategy::side::services::default_strategy
+ <
+ typename cs_tag<typename AngleInfo::point_type>::type
+ >::type side_strategy;
+
+ std::size_t i = 0;
+ std::size_t n = boost::size(angles);
+
+ typedef geometry::ever_circling_range_iterator<Angles const> circling_iterator;
+ circling_iterator cit(angles);
+
+ debug_left_turn(*cit, *cit);
+ for(circling_iterator prev = cit++; i < n; prev = cit++, i++)
+ {
+ debug_left_turn(*cit, *prev);
+
+ bool const include = ! geometry::math::equals(prev->angle, cit->angle)
+ && ! prev->incoming
+ && cit->incoming;
+
+ if (include)
+ {
+ // Go back to possibly include more same left outgoing angles:
+ // Because we check on side too we can take a large "epsilon"
+ circling_iterator back = prev - 1;
+
+ typename AngleInfo::angle_type eps = 0.00001;
+ int b = 1;
+ for(std::size_t d = 0;
+ math::abs(prev->angle - back->angle) < eps
+ && ! back->incoming
+ && d < n;
+ d++)
+ {
+ --back;
+ ++b;
+ }
+
+ // Same but forward to possibly include more incoming angles
+ int f = 1;
+ circling_iterator forward = cit + 1;
+ for(std::size_t d = 0;
+ math::abs(cit->angle - forward->angle) < eps
+ && forward->incoming
+ && d < n;
+ d++)
+ {
+ ++forward;
+ ++f;
+ }
+
+#ifdef BOOST_GEOMETRY_DEBUG_BUFFER_OCCUPATION
+ std::cout << "HANDLE " << b << "/" << f << " ANGLES" << std::endl;
+#endif
+ for(circling_iterator bit = prev; bit != back; --bit)
+ {
+ int code = side_strategy::apply(bit->direction_point, prev->intersection_point, prev->direction_point);
+ int code2 = side_strategy::apply(prev->direction_point, bit->intersection_point, bit->direction_point);
+ for(circling_iterator fit = cit; fit != forward; ++fit)
+ {
+ int code3 = side_strategy::apply(fit->direction_point, cit->intersection_point, cit->direction_point);
+ int code4 = side_strategy::apply(cit->direction_point, fit->intersection_point, fit->direction_point);
+
+ int priority = 2;
+ if (code == -1 && code2 == 1)
+ {
+ // This segment is lying right of the other one.
+ // Cannot ignore it (because of robustness, see a.o. #rt_p21 from unit test).
+ // But if we find more we can prefer later by priority
+ // (a.o. necessary for #rt_o2 from unit test)
+ priority = 1;
+ }
+
+ bool included = include_left_turn_of_all(*bit, *fit, turns, turn_segment_indices, keep_indices, priority);
+ debug_left_turn(included ? "KEEP" : "SKIP", *fit, *bit, code, code2, code3, code4);
+ }
+ }
+ }
+ }
+
+ if (debug_indicate_size)
+ {
+ std::cout << " size=" << keep_indices.size();
+ }
+
+ if (keep_indices.size() >= 2)
+ {
+ prefer_by_other(turns, turn_segment_indices, keep_indices);
+ }
+ if (keep_indices.size() >= 2)
+ {
+ prefer_by_priority(turns, keep_indices);
+ }
+}
+
+} // namespace detail
+#endif // DOXYGEN_NO_DETAIL
+
+
+}} // namespace boost::geometry
+
+#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_GET_LEFT_TURNS_HPP
diff --git a/boost/geometry/algorithms/detail/occupation_info.hpp b/boost/geometry/algorithms/detail/occupation_info.hpp
new file mode 100644
index 0000000000..e147ba12d8
--- /dev/null
+++ b/boost/geometry/algorithms/detail/occupation_info.hpp
@@ -0,0 +1,329 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// Copyright (c) 2012 Barend Gehrels, Amsterdam, the Netherlands.
+
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OCCUPATION_INFO_HPP
+#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OCCUPATION_INFO_HPP
+
+#if ! defined(NDEBUG)
+ #define BOOST_GEOMETRY_DEBUG_BUFFER_OCCUPATION
+#endif
+
+#include <algorithm>
+#include <boost/range.hpp>
+
+#include <boost/geometry/core/coordinate_type.hpp>
+#include <boost/geometry/core/point_type.hpp>
+
+#include <boost/geometry/algorithms/equals.hpp>
+#include <boost/geometry/iterators/closing_iterator.hpp>
+
+#include <boost/geometry/algorithms/detail/get_left_turns.hpp>
+
+
+namespace boost { namespace geometry
+{
+
+
+#ifndef DOXYGEN_NO_DETAIL
+namespace detail
+{
+
+template <typename P>
+class relaxed_less
+{
+ typedef typename geometry::coordinate_type<P>::type coordinate_type;
+
+ coordinate_type epsilon;
+
+public :
+
+ inline relaxed_less()
+ {
+ // TODO: adapt for ttmath, and maybe build the map in another way
+ // (e.g. exact constellations of segment-id's), maybe adaptive.
+ epsilon = std::numeric_limits<double>::epsilon() * 100.0;
+ }
+
+ inline bool operator()(P const& a, P const& b) const
+ {
+ coordinate_type const dx = math::abs(geometry::get<0>(a) - geometry::get<0>(b));
+ coordinate_type const dy = math::abs(geometry::get<1>(a) - geometry::get<1>(b));
+
+
+ if (dx < epsilon && dy < epsilon)
+ {
+ return false;
+ }
+ if (dx < epsilon)
+ {
+ return geometry::get<1>(a) < geometry::get<1>(b);
+ }
+
+ return geometry::get<0>(a) < geometry::get<0>(b);
+ }
+
+ inline bool equals(P const& a, P const& b) const
+ {
+ typedef typename geometry::coordinate_type<P>::type coordinate_type;
+
+ coordinate_type const dx = math::abs(geometry::get<0>(a) - geometry::get<0>(b));
+ coordinate_type const dy = math::abs(geometry::get<1>(a) - geometry::get<1>(b));
+
+ return dx < epsilon && dy < epsilon;
+ };
+};
+
+
+template <typename T, typename P1, typename P2>
+inline T calculate_angle(P1 const& from_point, P2 const& to_point)
+{
+ typedef P1 vector_type;
+ vector_type v = from_point;
+ geometry::subtract_point(v, to_point);
+ return atan2(geometry::get<1>(v), geometry::get<0>(v));
+}
+
+template <typename Iterator, typename Vector>
+inline Iterator advance_circular(Iterator it, Vector const& vector, segment_identifier& seg_id, bool forward = true)
+{
+ int const increment = forward ? 1 : -1;
+ if (it == boost::begin(vector) && increment < 0)
+ {
+ it = boost::end(vector);
+ seg_id.segment_index = boost::size(vector);
+ }
+ it += increment;
+ seg_id.segment_index += increment;
+ if (it == boost::end(vector))
+ {
+ seg_id.segment_index = 0;
+ it = boost::begin(vector);
+ }
+ return it;
+}
+
+template <typename Point, typename T>
+struct angle_info
+{
+ typedef T angle_type;
+ typedef Point point_type;
+
+ segment_identifier seg_id;
+ int turn_index;
+ int operation_index;
+ Point intersection_point;
+ Point direction_point;
+ T angle;
+ bool incoming;
+};
+
+template <typename AngleInfo>
+class occupation_info
+{
+ typedef std::vector<AngleInfo> collection_type;
+
+ struct angle_sort
+ {
+ inline bool operator()(AngleInfo const& left, AngleInfo const& right) const
+ {
+ // In this case we can compare even double using equals
+ // return geometry::math::equals(left.angle, right.angle)
+ return left.angle == right.angle
+ ? int(left.incoming) < int(right.incoming)
+ : left.angle < right.angle
+ ;
+ }
+ };
+
+public :
+ collection_type angles;
+private :
+ bool m_occupied;
+ bool m_calculated;
+
+ inline bool is_occupied()
+ {
+ if (boost::size(angles) <= 1)
+ {
+ return false;
+ }
+
+ std::sort(angles.begin(), angles.end(), angle_sort());
+
+ typedef geometry::closing_iterator<collection_type const> closing_iterator;
+ closing_iterator vit(angles);
+ closing_iterator end(angles, true);
+
+ closing_iterator prev = vit++;
+ for( ; vit != end; prev = vit++)
+ {
+ if (! geometry::math::equals(prev->angle, vit->angle)
+ && ! prev->incoming
+ && vit->incoming)
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
+public :
+ inline occupation_info()
+ : m_occupied(false)
+ , m_calculated(false)
+ {}
+
+ template <typename PointC, typename Point1, typename Point2>
+ inline void add(PointC const& map_point, Point1 const& direction_point, Point2 const& intersection_point,
+ int turn_index, int operation_index,
+ segment_identifier const& seg_id, bool incoming)
+ {
+ //std::cout << "-> adding angle " << geometry::wkt(direction_point) << " .. " << geometry::wkt(intersection_point) << " " << int(incoming) << std::endl;
+ if (geometry::equals(direction_point, intersection_point))
+ {
+ //std::cout << "EQUAL! Skipping" << std::endl;
+ return;
+ }
+
+ AngleInfo info;
+ info.incoming = incoming;
+ info.angle = calculate_angle<typename AngleInfo::angle_type>(direction_point, map_point);
+ info.seg_id = seg_id;
+ info.turn_index = turn_index;
+ info.operation_index = operation_index;
+ info.intersection_point = intersection_point;
+ info.direction_point = direction_point;
+ angles.push_back(info);
+
+ m_calculated = false;
+ }
+
+ inline bool occupied()
+ {
+ if (! m_calculated)
+ {
+ m_occupied = is_occupied();
+ m_calculated = true;
+ }
+ return m_occupied;
+ }
+
+ template <typename Turns, typename TurnSegmentIndices>
+ inline void get_left_turns(
+ Turns& turns, TurnSegmentIndices const& turn_segment_indices,
+ std::set<int>& keep_indices)
+ {
+ std::sort(angles.begin(), angles.end(), angle_sort());
+ calculate_left_turns<AngleInfo>(angles, turns, turn_segment_indices, keep_indices);
+ }
+};
+
+
+template <typename Point, typename Ring, typename Info>
+inline void add_incoming_and_outgoing_angles(Point const& map_point, Point const& intersection_point,
+ Ring const& ring,
+ int turn_index,
+ int operation_index,
+ segment_identifier seg_id,
+ Info& info)
+{
+ typedef typename boost::range_iterator
+ <
+ Ring const
+ >::type iterator_type;
+
+ int const n = boost::size(ring);
+ if (seg_id.segment_index >= n || seg_id.segment_index < 0)
+ {
+ return;
+ }
+
+ segment_identifier real_seg_id = seg_id;
+ iterator_type it = boost::begin(ring) + seg_id.segment_index;
+
+ // TODO: if we use turn-info ("to", "middle"), we know if to advance without resorting to equals
+ relaxed_less<Point> comparator;
+
+ if (comparator.equals(intersection_point, *it))
+ {
+ // It should be equal only once. But otherwise we skip it (in "add")
+ it = advance_circular(it, ring, seg_id, false);
+ }
+
+ info.add(map_point, *it, intersection_point, turn_index, operation_index, real_seg_id, true);
+
+ if (comparator.equals(intersection_point, *it))
+ {
+ it = advance_circular(it, ring, real_seg_id);
+ }
+ else
+ {
+ // Don't upgrade the ID
+ it = advance_circular(it, ring, seg_id);
+ }
+ for (int defensive_check = 0;
+ comparator.equals(intersection_point, *it) && defensive_check < n;
+ defensive_check++)
+ {
+ it = advance_circular(it, ring, real_seg_id);
+ }
+
+ info.add(map_point, *it, intersection_point, turn_index, operation_index, real_seg_id, false);
+}
+
+
+// Map in two senses of the word: it is a std::map where the key is a point.
+// Per point an "occupation_info" record is kept
+// Used for the buffer (but will also be used for intersections/unions having complex self-tangencies)
+template <typename Point, typename OccupationInfo>
+class occupation_map
+{
+public :
+ typedef std::map<Point, OccupationInfo, relaxed_less<Point> > map_type;
+
+ map_type map;
+ std::set<int> turn_indices;
+
+ inline OccupationInfo& find_or_insert(Point const& point, Point& mapped_point)
+ {
+ typename map_type::iterator it = map.find(point);
+ if (it == boost::end(map))
+ {
+ std::pair<typename map_type::iterator, bool> pair
+ = map.insert(std::make_pair(point, OccupationInfo()));
+ it = pair.first;
+ }
+ mapped_point = it->first;
+ return it->second;
+ }
+
+ inline bool contains(Point const& point) const
+ {
+ typename map_type::const_iterator it = map.find(point);
+ return it != boost::end(map);
+ }
+
+ inline bool contains_turn_index(int index) const
+ {
+ return turn_indices.count(index) > 0;
+ }
+
+ inline void insert_turn_index(int index)
+ {
+ turn_indices.insert(index);
+ }
+};
+
+
+} // namespace detail
+#endif // DOXYGEN_NO_DETAIL
+
+
+}} // namespace boost::geometry
+
+#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OCCUPATION_INFO_HPP
diff --git a/boost/geometry/algorithms/detail/overlay/add_rings.hpp b/boost/geometry/algorithms/detail/overlay/add_rings.hpp
index eb3e60e483..74595fedd0 100644
--- a/boost/geometry/algorithms/detail/overlay/add_rings.hpp
+++ b/boost/geometry/algorithms/detail/overlay/add_rings.hpp
@@ -9,6 +9,8 @@
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_ADD_RINGS_HPP
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_ADD_RINGS_HPP
+#include <boost/geometry/core/closure.hpp>
+#include <boost/geometry/algorithms/area.hpp>
#include <boost/geometry/algorithms/detail/overlay/convert_ring.hpp>
#include <boost/geometry/algorithms/detail/overlay/get_ring.hpp>
@@ -73,6 +75,21 @@ inline OutputIterator add_rings(SelectionMap const& map,
OutputIterator out)
{
typedef typename SelectionMap::const_iterator iterator;
+ typedef typename SelectionMap::mapped_type property_type;
+ typedef typename property_type::area_type area_type;
+
+ area_type const zero = 0;
+ std::size_t const min_num_points = core_detail::closure::minimum_ring_size
+ <
+ geometry::closure
+ <
+ typename boost::range_value
+ <
+ RingCollection const
+ >::type
+ >::value
+ >::value;
+
for (iterator it = boost::begin(map);
it != boost::end(map);
@@ -99,7 +116,16 @@ inline OutputIterator add_rings(SelectionMap const& map,
*child_it, mit->second.reversed, true);
}
}
- *out++ = result;
+
+ // Only add rings if they satisfy minimal requirements.
+ // This cannot be done earlier (during traversal), not
+ // everything is figured out yet (sum of positive/negative rings)
+ // TODO: individual rings can still contain less than 3 points.
+ if (geometry::num_points(result) >= min_num_points
+ && math::larger(geometry::area(result), zero))
+ {
+ *out++ = result;
+ }
}
}
return out;
diff --git a/boost/geometry/algorithms/detail/overlay/assign_parents.hpp b/boost/geometry/algorithms/detail/overlay/assign_parents.hpp
index 133530563e..5063f49eb4 100644
--- a/boost/geometry/algorithms/detail/overlay/assign_parents.hpp
+++ b/boost/geometry/algorithms/detail/overlay/assign_parents.hpp
@@ -130,7 +130,7 @@ struct assign_visitor
return;
}
- if (outer.real_area > 0)
+ if (math::larger(outer.real_area, 0))
{
if (inner.real_area < 0 || m_check_for_orientation)
{
@@ -317,13 +317,14 @@ template
>
inline void assign_parents(Geometry const& geometry,
RingCollection const& collection,
- RingMap& ring_map)
+ RingMap& ring_map,
+ bool check_for_orientation)
{
// Call it with an empty geometry
// (ring_map should be empty for source_id==1)
Geometry empty;
- assign_parents(geometry, empty, collection, ring_map, true);
+ assign_parents(geometry, empty, collection, ring_map, check_for_orientation);
}
diff --git a/boost/geometry/algorithms/detail/overlay/calculate_distance_policy.hpp b/boost/geometry/algorithms/detail/overlay/calculate_distance_policy.hpp
index 3e6a8897f5..2003d2350d 100644
--- a/boost/geometry/algorithms/detail/overlay/calculate_distance_policy.hpp
+++ b/boost/geometry/algorithms/detail/overlay/calculate_distance_policy.hpp
@@ -32,9 +32,18 @@ struct calculate_distance_policy
{
static bool const include_no_turn = false;
static bool const include_degenerate = false;
-
- template <typename Point1, typename Point2, typename Info>
- static inline void apply(Info& info, Point1 const& p1, Point2 const& p2)
+ static bool const include_opposite = false;
+
+ template
+ <
+ typename Info,
+ typename Point1,
+ typename Point2,
+ typename IntersectionInfo,
+ typename DirInfo
+ >
+ static inline void apply(Info& info, Point1 const& p1, Point2 const& p2,
+ IntersectionInfo const&, DirInfo const&)
{
info.operations[0].enriched.distance
= geometry::comparable_distance(info.point, p1);
diff --git a/boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp b/boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp
index 379444428f..5e18d0453a 100644
--- a/boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp
+++ b/boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp
@@ -55,14 +55,14 @@ struct copy_segment_point_range
if (second)
{
index++;
- if (index >= boost::size(range))
+ if (index >= int(boost::size(range)))
{
index = 0;
}
}
// Exception?
- if (index >= boost::size(range))
+ if (index >= int(boost::size(range)))
{
return false;
}
diff --git a/boost/geometry/algorithms/detail/overlay/copy_segments.hpp b/boost/geometry/algorithms/detail/overlay/copy_segments.hpp
index b0183a3ac2..805f3923e3 100644
--- a/boost/geometry/algorithms/detail/overlay/copy_segments.hpp
+++ b/boost/geometry/algorithms/detail/overlay/copy_segments.hpp
@@ -78,7 +78,7 @@ struct copy_segments_ring
int const from_index = seg_id.segment_index + 1;
// Sanity check
- BOOST_ASSERT(from_index < boost::size(view));
+ BOOST_ASSERT(from_index < int(boost::size(view)));
ec_iterator it(boost::begin(view), boost::end(view),
boost::begin(view) + from_index);
@@ -89,7 +89,7 @@ struct copy_segments_ring
typedef typename boost::range_difference<Ring>::type size_type;
size_type const count = from_index <= to_index
? to_index - from_index + 1
- : boost::size(view) - from_index + to_index + 1;
+ : int(boost::size(view)) - from_index + to_index + 1;
for (size_type i = 0; i < count; ++i, ++it)
{
@@ -117,7 +117,7 @@ struct copy_segments_linestring
int const from_index = seg_id.segment_index + 1;
// Sanity check
- if (from_index > to_index || from_index < 0 || to_index >= boost::size(ls))
+ if (from_index > to_index || from_index < 0 || to_index >= int(boost::size(ls)))
{
return;
}
diff --git a/boost/geometry/algorithms/detail/overlay/debug_turn_info.hpp b/boost/geometry/algorithms/detail/overlay/debug_turn_info.hpp
index 0bec816946..0cc34255ca 100644
--- a/boost/geometry/algorithms/detail/overlay/debug_turn_info.hpp
+++ b/boost/geometry/algorithms/detail/overlay/debug_turn_info.hpp
@@ -28,6 +28,7 @@ inline char method_char(detail::overlay::method_type const& method)
case method_touch_interior : return 'm';
case method_collinear : return 'c';
case method_equal : return 'e';
+ case method_error : return '!';
default : return '?';
}
}
@@ -42,6 +43,7 @@ inline char operation_char(detail::overlay::operation_type const& operation)
case operation_intersection : return 'i';
case operation_blocked : return 'x';
case operation_continue : return 'c';
+ case operation_opposite : return 'o';
default : return '?';
}
}
diff --git a/boost/geometry/algorithms/detail/overlay/follow.hpp b/boost/geometry/algorithms/detail/overlay/follow.hpp
index 087092a5f2..b110cc9602 100644
--- a/boost/geometry/algorithms/detail/overlay/follow.hpp
+++ b/boost/geometry/algorithms/detail/overlay/follow.hpp
@@ -279,12 +279,12 @@ class follow
{
// In case of turn point at the same location, we want to have continue/blocked LAST
// because that should be followed (intersection) or skipped (difference).
- // By chance the enumeration is ordered like that but we keep the safe way here.
inline int operation_order(Turn const& turn) const
{
operation_type const& operation = turn.operations[0].operation;
switch(operation)
{
+ case operation_opposite : return 0;
case operation_none : return 0;
case operation_union : return 1;
case operation_intersection : return 2;
diff --git a/boost/geometry/algorithms/detail/overlay/get_ring.hpp b/boost/geometry/algorithms/detail/overlay/get_ring.hpp
index ad47665500..c2c6980577 100644
--- a/boost/geometry/algorithms/detail/overlay/get_ring.hpp
+++ b/boost/geometry/algorithms/detail/overlay/get_ring.hpp
@@ -83,7 +83,7 @@ struct get_ring<polygon_tag>
BOOST_ASSERT
(
id.ring_index >= -1
- && id.ring_index < boost::size(interior_rings(polygon))
+ && id.ring_index < int(boost::size(interior_rings(polygon)))
);
return id.ring_index < 0
? exterior_ring(polygon)
diff --git a/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp b/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp
index 663d70d9af..b8320d9b7b 100644
--- a/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp
+++ b/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp
@@ -250,9 +250,15 @@ struct touch : public base_turn_handler
int const side_pk_q2 = SideStrategy::apply(qj, qk, pk);
int const side_pk_p = SideStrategy::apply(pi, pj, pk);
int const side_qk_q = SideStrategy::apply(qi, qj, qk);
+
+ bool const both_continue = side_pk_p == 0 && side_qk_q == 0;
+ bool const robustness_issue_in_continue = both_continue && side_pk_q2 != 0;
+
bool const q_turns_left = side_qk_q == 1;
bool const block_q = side_qk_p1 == 0
- && ! same(side_qi_p1, side_qk_q);
+ && ! same(side_qi_p1, side_qk_q)
+ && ! robustness_issue_in_continue
+ ;
// If Pk at same side as Qi/Qk
// (the "or" is for collinear case)
@@ -278,7 +284,7 @@ struct touch : public base_turn_handler
if (side_pk_q1 == 0)
{
ti.operations[0].operation = operation_blocked;
- // Q turns right -> union (both independant),
+ // Q turns right -> union (both independent),
// Q turns left -> intersection
ti.operations[1].operation = block_q ? operation_blocked
: q_turns_left ? operation_intersection
@@ -466,6 +472,45 @@ struct equal : public base_turn_handler
template
<
typename TurnInfo,
+ typename AssignPolicy
+>
+struct equal_opposite : public base_turn_handler
+{
+ template
+ <
+ typename Point1,
+ typename Point2,
+ typename OutputIterator,
+ typename IntersectionInfo,
+ typename DirInfo
+ >
+ static inline void apply(Point1 const& pi, Point2 const& qi,
+ /* by value: */ TurnInfo tp,
+ OutputIterator& out,
+ IntersectionInfo const& intersection_info,
+ DirInfo const& dir_info)
+ {
+ // For equal-opposite segments, normally don't do anything.
+ if (AssignPolicy::include_opposite)
+ {
+ tp.method = method_equal;
+ for (int i = 0; i < 2; i++)
+ {
+ tp.operations[i].operation = operation_opposite;
+ }
+ for (unsigned int i = 0; i < intersection_info.count; i++)
+ {
+ geometry::convert(intersection_info.intersections[i], tp.point);
+ AssignPolicy::apply(tp, pi, qi, intersection_info, dir_info);
+ *out++ = tp;
+ }
+ }
+ }
+};
+
+template
+<
+ typename TurnInfo,
typename SideStrategy
>
struct collinear : public base_turn_handler
@@ -494,6 +539,13 @@ struct collinear : public base_turn_handler
- if P arrives and P turns right: intersection for P
- if Q arrives and Q turns left: union for Q (=intersection for P)
- if Q arrives and Q turns right: intersection for Q (=union for P)
+
+ ROBUSTNESS: p and q are collinear, so you would expect
+ that side qk//p1 == pk//q1. But that is not always the case
+ in near-epsilon ranges. Then decision logic is different.
+ If p arrives, q is further, so the angle qk//p1 is (normally)
+ more precise than pk//p1
+
*/
template
<
@@ -516,12 +568,18 @@ struct collinear : public base_turn_handler
// Should not be 0, this is checked before
BOOST_ASSERT(arrival != 0);
+ int const side_p = SideStrategy::apply(pi, pj, pk);
+ int const side_q = SideStrategy::apply(qi, qj, qk);
+
// If p arrives, use p, else use q
int const side_p_or_q = arrival == 1
- ? SideStrategy::apply(pi, pj, pk)
- : SideStrategy::apply(qi, qj, qk)
+ ? side_p
+ : side_q
;
+ int const side_pk = SideStrategy::apply(qi, qj, pk);
+ int const side_qk = SideStrategy::apply(pi, pj, qk);
+
// See comments above,
// resulting in a strange sort of mathematic rule here:
// The arrival-info multiplied by the relevant side
@@ -529,7 +587,15 @@ struct collinear : public base_turn_handler
int const product = arrival * side_p_or_q;
- if(product == 0)
+ // Robustness: side_p is supposed to be equal to side_pk (because p/q are collinear)
+ // and side_q to side_qk
+ bool const robustness_issue = side_pk != side_p || side_qk != side_q;
+
+ if (robustness_issue)
+ {
+ handle_robustness(ti, arrival, side_p, side_q, side_pk, side_qk);
+ }
+ else if(product == 0)
{
both(ti, operation_continue);
}
@@ -538,6 +604,38 @@ struct collinear : public base_turn_handler
ui_else_iu(product == 1, ti);
}
}
+
+ static inline void handle_robustness(TurnInfo& ti, int arrival,
+ int side_p, int side_q, int side_pk, int side_qk)
+ {
+ // We take the longer one, i.e. if q arrives in p (arrival == -1),
+ // then p exceeds q and we should take p for a union...
+
+ bool use_p_for_union = arrival == -1;
+
+ // ... unless one of the sides consistently directs to the other side
+ int const consistent_side_p = side_p == side_pk ? side_p : 0;
+ int const consistent_side_q = side_q == side_qk ? side_q : 0;
+ if (arrival == -1 && (consistent_side_p == -1 || consistent_side_q == 1))
+ {
+ use_p_for_union = false;
+ }
+ if (arrival == 1 && (consistent_side_p == 1 || consistent_side_q == -1))
+ {
+ use_p_for_union = true;
+ }
+
+ //std::cout << "ROBUSTNESS -> Collinear "
+ // << " arr: " << arrival
+ // << " dir: " << side_p << " " << side_q
+ // << " rev: " << side_pk << " " << side_qk
+ // << " cst: " << cside_p << " " << cside_q
+ // << std::boolalpha << " " << use_p_for_union
+ // << std::endl;
+
+ ui_else_iu(use_p_for_union, ti);
+ }
+
};
template
@@ -583,6 +681,7 @@ private :
TurnInfo& tp, IntersectionInfo const& intersection_info)
{
int const side_rk_r = SideStrategy::apply(ri, rj, rk);
+ operation_type blocked = operation_blocked;
switch(side_rk_r)
{
@@ -596,15 +695,24 @@ private :
break;
case 0 :
// No turn on opposite collinear: block, do not traverse
- // But this "xx" is ignored here, it is useless to include
- // two operation blocked, so the whole point does not need
+ // But this "xx" is usually ignored, it is useless to include
+ // two operations blocked, so the whole point does not need
// to be generated.
// So return false to indicate nothing is to be done.
- return false;
+ if (AssignPolicy::include_opposite)
+ {
+ tp.operations[Index].operation = operation_opposite;
+ blocked = operation_opposite;
+ }
+ else
+ {
+ return false;
+ }
+ break;
}
// The other direction is always blocked when collinear opposite
- tp.operations[1 - Index].operation = operation_blocked;
+ tp.operations[1 - Index].operation = blocked;
// If P arrives within Q, set info on P (which is done above, index=0),
// this turn-info belongs to the second intersection point, index=1
@@ -633,32 +741,45 @@ public:
IntersectionInfo const& intersection_info,
DirInfo const& dir_info)
{
- /*
- std::cout << "arrivals: "
- << dir_info.arrival[0]
- << "/" << dir_info.arrival[1]
- << std::endl;
- */
-
TurnInfo tp = tp_model;
tp.method = method_collinear;
- // If P arrives within Q, there is a turn dependant on P
+ // If P arrives within Q, there is a turn dependent on P
if (dir_info.arrival[0] == 1
&& set_tp<0>(pi, pj, pk, tp, intersection_info))
{
- AssignPolicy::apply(tp, pi, qi);
+ AssignPolicy::apply(tp, pi, qi, intersection_info, dir_info);
*out++ = tp;
}
- // If Q arrives within P, there is a turn dependant on Q
+ // If Q arrives within P, there is a turn dependent on Q
if (dir_info.arrival[1] == 1
&& set_tp<1>(qi, qj, qk, tp, intersection_info))
{
- AssignPolicy::apply(tp, pi, qi);
+ AssignPolicy::apply(tp, pi, qi, intersection_info, dir_info);
*out++ = tp;
}
+
+ if (AssignPolicy::include_opposite)
+ {
+ // Handle cases not yet handled above
+ if ((dir_info.arrival[1] == -1 && dir_info.arrival[0] == 0)
+ || (dir_info.arrival[0] == -1 && dir_info.arrival[1] == 0))
+ {
+ for (int i = 0; i < 2; i++)
+ {
+ tp.operations[i].operation = operation_opposite;
+ }
+ for (unsigned int i = 0; i < intersection_info.count; i++)
+ {
+ geometry::convert(intersection_info.intersections[i], tp.point);
+ AssignPolicy::apply(tp, pi, qi, intersection_info, dir_info);
+ *out++ = tp;
+ }
+ }
+ }
+
}
};
@@ -722,9 +843,17 @@ struct assign_null_policy
{
static bool const include_no_turn = false;
static bool const include_degenerate = false;
-
- template <typename Point1, typename Point2, typename Info>
- static inline void apply(Info& , Point1 const& , Point2 const& )
+ static bool const include_opposite = false;
+
+ template
+ <
+ typename Info,
+ typename Point1,
+ typename Point2,
+ typename IntersectionInfo,
+ typename DirInfo
+ >
+ static inline void apply(Info& , Point1 const& , Point2 const&, IntersectionInfo const&, DirInfo const&)
{}
};
@@ -763,8 +892,9 @@ struct get_turn_info
typedef typename si::segment_intersection_strategy_type strategy;
-
-
+ // Intersect pi-pj with qi-qj
+ // The points pk and qk are only used do determine more information
+ // about the turn.
template <typename OutputIterator>
static inline OutputIterator apply(
Point1 const& pi, Point1 const& pj, Point1 const& pk,
@@ -796,7 +926,7 @@ struct get_turn_info
{
only_convert<TurnInfo>::apply(tp,
result.template get<0>());
- AssignPolicy::apply(tp, pi, qi);
+ AssignPolicy::apply(tp, pi, qi, result.template get<0>(), result.template get<1>());
*out++ = tp;
}
break;
@@ -824,7 +954,7 @@ struct get_turn_info
policy::template apply<1>(qi, qj, qk, pi, pj, pk,
tp, result.template get<0>(), result.template get<1>());
}
- AssignPolicy::apply(tp, pi, qi);
+ AssignPolicy::apply(tp, pi, qi, result.template get<0>(), result.template get<1>());
*out++ = tp;
}
break;
@@ -838,7 +968,7 @@ struct get_turn_info
policy::apply(pi, pj, pk, qi, qj, qk,
tp, result.template get<0>(), result.template get<1>());
- AssignPolicy::apply(tp, pi, qi);
+ AssignPolicy::apply(tp, pi, qi, result.template get<0>(), result.template get<1>());
*out++ = tp;
}
break;
@@ -853,7 +983,7 @@ struct get_turn_info
policy::apply(pi, pj, pk, qi, qj, qk,
tp, result.template get<0>(), result.template get<1>());
- AssignPolicy::apply(tp, pi, qi);
+ AssignPolicy::apply(tp, pi, qi, result.template get<0>(), result.template get<1>());
*out++ = tp;
}
break;
@@ -871,10 +1001,18 @@ struct get_turn_info
policy::apply(pi, pj, pk, qi, qj, qk,
tp, result.template get<0>(), result.template get<1>());
- AssignPolicy::apply(tp, pi, qi);
+ AssignPolicy::apply(tp, pi, qi, result.template get<0>(), result.template get<1>());
*out++ = tp;
}
- // If they ARE opposite, don't do anything.
+ else
+ {
+ equal_opposite
+ <
+ TurnInfo,
+ AssignPolicy
+ >::apply(pi, qi,
+ tp, out, result.template get<0>(), result.template get<1>());
+ }
}
break;
case 'c' :
@@ -906,7 +1044,7 @@ struct get_turn_info
tp, result.template get<0>(), result.template get<1>());
}
- AssignPolicy::apply(tp, pi, qi);
+ AssignPolicy::apply(tp, pi, qi, result.template get<0>(), result.template get<1>());
*out++ = tp;
}
else
@@ -927,7 +1065,7 @@ struct get_turn_info
if (AssignPolicy::include_degenerate)
{
only_convert<TurnInfo>::apply(tp, result.template get<0>());
- AssignPolicy::apply(tp, pi, qi);
+ AssignPolicy::apply(tp, pi, qi, result.template get<0>(), result.template get<1>());
*out++ = tp;
}
}
diff --git a/boost/geometry/algorithms/detail/overlay/get_turns.hpp b/boost/geometry/algorithms/detail/overlay/get_turns.hpp
index 5740a8b7ba..26629043cb 100644
--- a/boost/geometry/algorithms/detail/overlay/get_turns.hpp
+++ b/boost/geometry/algorithms/detail/overlay/get_turns.hpp
@@ -495,7 +495,7 @@ struct get_turns_cs
int source_id1, Range const& range,
int source_id2, Box const& box,
Turns& turns,
- InterruptPolicy& ,
+ InterruptPolicy& interrupt_policy,
int multi_index = -1, int ring_index = -1)
{
if (boost::size(range) <= 1)
@@ -557,7 +557,7 @@ struct get_turns_cs
get_turns_with_box(seg_id, source_id2,
*prev, *it, *next,
bp[0], bp[1], bp[2], bp[3],
- turns);
+ turns, interrupt_policy);
// Future performance enhancement:
// return if told by the interrupt policy
}
@@ -596,7 +596,8 @@ private:
box_point_type const& bp2,
box_point_type const& bp3,
// Output
- Turns& turns)
+ Turns& turns,
+ InterruptPolicy& interrupt_policy)
{
// Depending on code some relations can be left out
@@ -622,6 +623,12 @@ private:
ti.operations[1].seg_id = segment_identifier(source_id2, -1, -1, 3);
TurnPolicy::apply(rp0, rp1, rp2, bp3, bp0, bp1,
ti, std::back_inserter(turns));
+
+ if (InterruptPolicy::enabled)
+ {
+ interrupt_policy.apply(turns);
+ }
+
}
};
diff --git a/boost/geometry/algorithms/detail/overlay/overlay.hpp b/boost/geometry/algorithms/detail/overlay/overlay.hpp
index ab5b6d123d..41665e0af1 100644
--- a/boost/geometry/algorithms/detail/overlay/overlay.hpp
+++ b/boost/geometry/algorithms/detail/overlay/overlay.hpp
@@ -233,7 +233,7 @@ std::cout << "traverse" << std::endl;
std::cout << "map_turns: " << timer.elapsed() << std::endl;
#endif
- typedef ring_properties<typename geometry::point_type<Geometry1>::type> properties;
+ typedef ring_properties<typename geometry::point_type<GeometryOut>::type> properties;
std::map<ring_identifier, properties> selected;
select_rings<Direction>(geometry1, geometry2, map, selected, ! turn_points.empty());
diff --git a/boost/geometry/algorithms/detail/overlay/turn_info.hpp b/boost/geometry/algorithms/detail/overlay/turn_info.hpp
index aa6b428f19..89a60b21ab 100644
--- a/boost/geometry/algorithms/detail/overlay/turn_info.hpp
+++ b/boost/geometry/algorithms/detail/overlay/turn_info.hpp
@@ -28,7 +28,8 @@ enum operation_type
operation_union,
operation_intersection,
operation_blocked,
- operation_continue
+ operation_continue,
+ operation_opposite
};
@@ -102,6 +103,12 @@ struct turn_info
{
return has12(type, type);
}
+
+ inline bool has(operation_type type) const
+ {
+ return this->operations[0].operation == type
+ || this->operations[1].operation == type;
+ }
inline bool combination(operation_type type1, operation_type type2) const
{
@@ -114,10 +121,13 @@ struct turn_info
{
return both(operation_blocked);
}
+ inline bool opposite() const
+ {
+ return both(operation_opposite);
+ }
inline bool any_blocked() const
{
- return this->operations[0].operation == operation_blocked
- || this->operations[1].operation == operation_blocked;
+ return has(operation_blocked);
}
diff --git a/boost/geometry/algorithms/detail/partition.hpp b/boost/geometry/algorithms/detail/partition.hpp
index 7a7de2cdd3..45ff52ccb1 100644
--- a/boost/geometry/algorithms/detail/partition.hpp
+++ b/boost/geometry/algorithms/detail/partition.hpp
@@ -153,12 +153,12 @@ class partition_one_collection
static inline void next_level(Box const& box,
InputCollection const& collection,
index_vector_type const& input,
- int level, int min_elements,
+ int level, std::size_t min_elements,
Policy& policy, VisitBoxPolicy& box_policy)
{
if (boost::size(input) > 0)
{
- if (boost::size(input) > min_elements && level < 100)
+ if (std::size_t(boost::size(input)) > min_elements && level < 100)
{
sub_divide::apply(box, collection, input, level + 1,
min_elements, policy, box_policy);
@@ -176,7 +176,7 @@ public :
InputCollection const& collection,
index_vector_type const& input,
int level,
- int min_elements,
+ std::size_t min_elements,
Policy& policy, VisitBoxPolicy& box_policy)
{
box_policy.apply(box, level);
@@ -230,13 +230,13 @@ class partition_two_collections
index_vector_type const& input1,
InputCollection const& collection2,
index_vector_type const& input2,
- int level, int min_elements,
+ int level, std::size_t min_elements,
Policy& policy, VisitBoxPolicy& box_policy)
{
if (boost::size(input1) > 0 && boost::size(input2) > 0)
{
- if (boost::size(input1) > min_elements
- && boost::size(input2) > min_elements
+ if (std::size_t(boost::size(input1)) > min_elements
+ && std::size_t(boost::size(input2)) > min_elements
&& level < 100)
{
sub_divide::apply(box, collection1, input1, collection2,
@@ -257,7 +257,7 @@ public :
InputCollection const& collection1, index_vector_type const& input1,
InputCollection const& collection2, index_vector_type const& input2,
int level,
- int min_elements,
+ std::size_t min_elements,
Policy& policy, VisitBoxPolicy& box_policy)
{
box_policy.apply(box, level);
@@ -335,11 +335,11 @@ public :
template <typename InputCollection, typename VisitPolicy>
static inline void apply(InputCollection const& collection,
VisitPolicy& visitor,
- int min_elements = 16,
+ std::size_t min_elements = 16,
VisitBoxPolicy box_visitor = visit_no_policy()
)
{
- if (boost::size(collection) > min_elements)
+ if (std::size_t(boost::size(collection)) > min_elements)
{
index_vector_type index_vector;
Box total;
@@ -377,12 +377,12 @@ public :
static inline void apply(InputCollection const& collection1,
InputCollection const& collection2,
VisitPolicy& visitor,
- int min_elements = 16,
+ std::size_t min_elements = 16,
VisitBoxPolicy box_visitor = visit_no_policy()
)
{
- if (boost::size(collection1) > min_elements
- && boost::size(collection2) > min_elements)
+ if (std::size_t(boost::size(collection1)) > min_elements
+ && std::size_t(boost::size(collection2)) > min_elements)
{
index_vector_type index_vector1, index_vector2;
Box total;
diff --git a/boost/geometry/algorithms/detail/point_on_border.hpp b/boost/geometry/algorithms/detail/point_on_border.hpp
index 33177924aa..b7e15ba3f9 100644
--- a/boost/geometry/algorithms/detail/point_on_border.hpp
+++ b/boost/geometry/algorithms/detail/point_on_border.hpp
@@ -25,6 +25,7 @@
#include <boost/geometry/geometries/concepts/check.hpp>
#include <boost/geometry/algorithms/assign.hpp>
+#include <boost/geometry/algorithms/detail/convert_point_to_point.hpp>
#include <boost/geometry/algorithms/detail/disjoint.hpp>
@@ -50,7 +51,8 @@ struct get_point
template<typename Point, std::size_t Dimension, std::size_t DimensionCount>
struct midpoint_helper
{
- static inline bool apply(Point& p, Point const& p1, Point const& p2)
+ template <typename InputPoint>
+ static inline bool apply(Point& p, InputPoint const& p1, InputPoint const& p2)
{
typename coordinate_type<Point>::type const two = 2;
set<Dimension>(p,
@@ -63,7 +65,8 @@ struct midpoint_helper
template <typename Point, std::size_t DimensionCount>
struct midpoint_helper<Point, DimensionCount, DimensionCount>
{
- static inline bool apply(Point& , Point const& , Point const& )
+ template <typename InputPoint>
+ static inline bool apply(Point& , InputPoint const& , InputPoint const& )
{
return true;
}
@@ -102,7 +105,7 @@ struct point_on_range
if (n > 0)
{
- point = *boost::begin(range);
+ geometry::detail::conversion::convert_point_to_point(*boost::begin(range), point);
return true;
}
return false;
diff --git a/boost/geometry/algorithms/detail/sections/sectionalize.hpp b/boost/geometry/algorithms/detail/sections/sectionalize.hpp
index 36bcbdd6e7..a6e6837fe4 100644
--- a/boost/geometry/algorithms/detail/sections/sectionalize.hpp
+++ b/boost/geometry/algorithms/detail/sections/sectionalize.hpp
@@ -254,7 +254,7 @@ struct sectionalize_part
Range const& range,
ring_identifier ring_id)
{
- if (boost::size(range) <= index)
+ if (int(boost::size(range)) <= index)
{
return;
}
diff --git a/boost/geometry/algorithms/disjoint.hpp b/boost/geometry/algorithms/disjoint.hpp
index f36b8dbdd0..f986cc24af 100644
--- a/boost/geometry/algorithms/disjoint.hpp
+++ b/boost/geometry/algorithms/disjoint.hpp
@@ -27,6 +27,7 @@
#include <boost/geometry/core/reverse_dispatch.hpp>
#include <boost/geometry/algorithms/detail/disjoint.hpp>
+#include <boost/geometry/algorithms/detail/for_each_range.hpp>
#include <boost/geometry/algorithms/detail/point_on_border.hpp>
#include <boost/geometry/algorithms/detail/overlay/get_turns.hpp>
#include <boost/geometry/algorithms/within.hpp>
@@ -44,15 +45,57 @@ namespace boost { namespace geometry
namespace detail { namespace disjoint
{
+template<typename Geometry>
+struct check_each_ring_for_within
+{
+ bool has_within;
+ Geometry const& m_geometry;
+
+ inline check_each_ring_for_within(Geometry const& g)
+ : has_within(false)
+ , m_geometry(g)
+ {}
+
+ template <typename Range>
+ inline void apply(Range const& range)
+ {
+ typename geometry::point_type<Range>::type p;
+ geometry::point_on_border(p, range);
+ if (geometry::within(p, m_geometry))
+ {
+ has_within = true;
+ }
+ }
+};
+
+template <typename FirstGeometry, typename SecondGeometry>
+inline bool rings_containing(FirstGeometry const& geometry1,
+ SecondGeometry const& geometry2)
+{
+ check_each_ring_for_within<FirstGeometry> checker(geometry1);
+ geometry::detail::for_each_range(geometry2, checker);
+ return checker.has_within;
+}
+
+
struct assign_disjoint_policy
{
// We want to include all points:
static bool const include_no_turn = true;
static bool const include_degenerate = true;
+ static bool const include_opposite = true;
// We don't assign extra info:
- template <typename Point1, typename Point2, typename Info>
- static inline void apply(Info& , Point1 const& , Point2 const& )
+ template
+ <
+ typename Info,
+ typename Point1,
+ typename Point2,
+ typename IntersectionInfo,
+ typename DirInfo
+ >
+ static inline void apply(Info& , Point1 const& , Point2 const&,
+ IntersectionInfo const&, DirInfo const&)
{}
};
@@ -107,8 +150,6 @@ struct disjoint_segment
}
};
-
-
template <typename Geometry1, typename Geometry2>
struct general_areal
{
@@ -119,20 +160,10 @@ struct general_areal
return false;
}
- typedef typename geometry::point_type<Geometry1>::type point_type;
-
// If there is no intersection of segments, they might located
// inside each other
- point_type p1;
- geometry::point_on_border(p1, geometry1);
- if (geometry::within(p1, geometry2))
- {
- return false;
- }
-
- typename geometry::point_type<Geometry1>::type p2;
- geometry::point_on_border(p2, geometry2);
- if (geometry::within(p2, geometry1))
+ if (rings_containing(geometry1, geometry2)
+ || rings_containing(geometry2, geometry1))
{
return false;
}
diff --git a/boost/geometry/algorithms/distance.hpp b/boost/geometry/algorithms/distance.hpp
index eca3b03c7b..11c2bc929b 100644
--- a/boost/geometry/algorithms/distance.hpp
+++ b/boost/geometry/algorithms/distance.hpp
@@ -130,7 +130,7 @@ struct point_to_range
// check if other segments are closer
for (++prev, ++it; it != boost::end(view); ++prev, ++it)
{
- return_type const ds = ps_strategy.apply(point, *prev, *it);
+ return_type const ds = eps_strategy.apply(point, *prev, *it);
if (geometry::math::equals(ds, zero))
{
return ds;
diff --git a/boost/geometry/algorithms/touches.hpp b/boost/geometry/algorithms/touches.hpp
new file mode 100644
index 0000000000..7d424af428
--- /dev/null
+++ b/boost/geometry/algorithms/touches.hpp
@@ -0,0 +1,181 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
+// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
+// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
+
+// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
+// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
+
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_GEOMETRY_ALGORITHMS_TOUCHES_HPP
+#define BOOST_GEOMETRY_ALGORITHMS_TOUCHES_HPP
+
+
+#include <deque>
+
+#include <boost/geometry/geometries/concepts/check.hpp>
+#include <boost/geometry/algorithms/detail/overlay/self_turn_points.hpp>
+#include <boost/geometry/algorithms/detail/overlay/get_turns.hpp>
+#include <boost/geometry/algorithms/disjoint.hpp>
+#include <boost/geometry/algorithms/intersects.hpp>
+#include <boost/geometry/algorithms/num_geometries.hpp>
+
+
+namespace boost { namespace geometry
+{
+
+namespace detail { namespace touches
+{
+
+template <typename Turn>
+inline bool ok_for_touch(Turn const& turn)
+{
+ return turn.both(detail::overlay::operation_union)
+ || turn.both(detail::overlay::operation_blocked)
+ || turn.combination(detail::overlay::operation_union, detail::overlay::operation_blocked)
+ ;
+}
+
+template <typename Turns>
+inline bool has_only_turns(Turns const& turns)
+{
+ bool has_touch = false;
+ typedef typename boost::range_iterator<Turns const>::type iterator_type;
+ for (iterator_type it = boost::begin(turns); it != boost::end(turns); ++it)
+ {
+ if (it->has(detail::overlay::operation_intersection))
+ {
+ return false;
+ }
+
+ switch(it->method)
+ {
+ case detail::overlay::method_crosses:
+ return false;
+ case detail::overlay::method_equal:
+ // Segment spatially equal means: at the right side
+ // the polygon internally overlaps. So return false.
+ return false;
+ case detail::overlay::method_touch:
+ case detail::overlay::method_touch_interior:
+ case detail::overlay::method_collinear:
+ if (ok_for_touch(*it))
+ {
+ has_touch = true;
+ }
+ else
+ {
+ return false;
+ }
+ break;
+ case detail::overlay::method_none :
+ case detail::overlay::method_disjoint :
+ case detail::overlay::method_error :
+ break;
+ }
+ }
+ return has_touch;
+}
+
+}}
+
+/*!
+\brief \brief_check{has at least one touching point (self-tangency)}
+\note This function can be called for one geometry (self-tangency) and
+ also for two geometries (touch)
+\ingroup touches
+\tparam Geometry \tparam_geometry
+\param geometry \param_geometry
+\return \return_check{is self-touching}
+
+\qbk{distinguish,one geometry}
+\qbk{[def __one_parameter__]}
+\qbk{[include reference/algorithms/touches.qbk]}
+*/
+template <typename Geometry>
+inline bool touches(Geometry const& geometry)
+{
+ concept::check<Geometry const>();
+
+ typedef detail::overlay::turn_info
+ <
+ typename geometry::point_type<Geometry>::type
+ > turn_info;
+
+ typedef detail::overlay::get_turn_info
+ <
+ typename point_type<Geometry>::type,
+ typename point_type<Geometry>::type,
+ turn_info,
+ detail::overlay::assign_null_policy
+ > policy_type;
+
+ std::deque<turn_info> turns;
+ detail::self_get_turn_points::no_interrupt_policy policy;
+ detail::self_get_turn_points::get_turns
+ <
+ Geometry,
+ std::deque<turn_info>,
+ policy_type,
+ detail::self_get_turn_points::no_interrupt_policy
+ >::apply(geometry, turns, policy);
+
+ return detail::touches::has_only_turns(turns);
+}
+
+
+/*!
+\brief \brief_check2{have at least one touching point (tangent - non overlapping)}
+\ingroup touches
+\tparam Geometry1 \tparam_geometry
+\tparam Geometry2 \tparam_geometry
+\param geometry1 \param_geometry
+\param geometry2 \param_geometry
+\return \return_check2{touch each other}
+
+\qbk{distinguish,two geometries}
+\qbk{[include reference/algorithms/touches.qbk]}
+ */
+template <typename Geometry1, typename Geometry2>
+inline bool touches(Geometry1 const& geometry1, Geometry2 const& geometry2)
+{
+ concept::check<Geometry1 const>();
+ concept::check<Geometry2 const>();
+
+
+ typedef detail::overlay::turn_info
+ <
+ typename geometry::point_type<Geometry1>::type
+ > turn_info;
+
+ typedef detail::overlay::get_turn_info
+ <
+ typename point_type<Geometry1>::type,
+ typename point_type<Geometry2>::type,
+ turn_info,
+ detail::overlay::assign_null_policy
+ > policy_type;
+
+ std::deque<turn_info> turns;
+ detail::get_turns::no_interrupt_policy policy;
+ boost::geometry::get_turns
+ <
+ false, false,
+ detail::overlay::assign_null_policy
+ >(geometry1, geometry2, turns, policy);
+
+ return detail::touches::has_only_turns(turns)
+ && ! geometry::detail::disjoint::rings_containing(geometry1, geometry2)
+ && ! geometry::detail::disjoint::rings_containing(geometry2, geometry1)
+ ;
+}
+
+
+
+}} // namespace boost::geometry
+
+#endif // BOOST_GEOMETRY_ALGORITHMS_TOUCHES_HPP
diff --git a/boost/geometry/algorithms/within.hpp b/boost/geometry/algorithms/within.hpp
index 0e0cb68d53..f1f0993d77 100644
--- a/boost/geometry/algorithms/within.hpp
+++ b/boost/geometry/algorithms/within.hpp
@@ -65,7 +65,7 @@ struct point_in_ring
static inline int apply(Point const& point, Ring const& ring,
Strategy const& strategy)
{
- if (boost::size(ring)
+ if (int(boost::size(ring))
< core_detail::closure::minimum_ring_size<Closure>::value)
{
return -1;
diff --git a/boost/geometry/core/access.hpp b/boost/geometry/core/access.hpp
index a463b8cdc3..cdc8ff9cff 100644
--- a/boost/geometry/core/access.hpp
+++ b/boost/geometry/core/access.hpp
@@ -18,12 +18,13 @@
#include <cstddef>
#include <boost/mpl/assert.hpp>
-#include <boost/type_traits/remove_const.hpp>
#include <boost/concept_check.hpp>
+#include <boost/type_traits/is_pointer.hpp>
#include <boost/geometry/core/coordinate_type.hpp>
#include <boost/geometry/core/point_type.hpp>
#include <boost/geometry/core/tag.hpp>
+#include <boost/geometry/util/bare_type.hpp>
namespace boost { namespace geometry
@@ -79,6 +80,52 @@ struct indexed_access {};
} // namespace traits
+#ifndef DOXYGEN_NO_DETAIL
+namespace detail
+{
+
+template
+<
+ typename Geometry,
+ typename CoordinateType,
+ std::size_t Index,
+ std::size_t Dimension
+>
+struct indexed_access_non_pointer
+{
+ static inline CoordinateType get(Geometry const& geometry)
+ {
+ return traits::indexed_access<Geometry, Index, Dimension>::get(geometry);
+ }
+ static inline void set(Geometry& b, CoordinateType const& value)
+ {
+ traits::indexed_access<Geometry, Index, Dimension>::set(b, value);
+ }
+};
+
+template
+<
+ typename Geometry,
+ typename CoordinateType,
+ std::size_t Index,
+ std::size_t Dimension
+>
+struct indexed_access_pointer
+{
+ static inline CoordinateType get(Geometry const* geometry)
+ {
+ return traits::indexed_access<typename boost::remove_pointer<Geometry>::type, Index, Dimension>::get(*geometry);
+ }
+ static inline void set(Geometry* geometry, CoordinateType const& value)
+ {
+ traits::indexed_access<typename boost::remove_pointer<Geometry>::type, Index, Dimension>::set(*geometry, value);
+ }
+};
+
+
+} // namespace detail
+#endif // DOXYGEN_NO_DETAIL
+
#ifndef DOXYGEN_NO_DISPATCH
namespace core_dispatch
@@ -89,7 +136,9 @@ template
typename Tag,
typename Geometry,
typename
- CoordinateType, std::size_t Dimension
+ CoordinateType,
+ std::size_t Dimension,
+ typename IsPointer
>
struct access
{
@@ -103,7 +152,8 @@ template
typename Geometry,
typename CoordinateType,
std::size_t Index,
- std::size_t Dimension
+ std::size_t Dimension,
+ typename IsPointer
>
struct indexed_access
{
@@ -112,7 +162,7 @@ struct indexed_access
};
template <typename Point, typename CoordinateType, std::size_t Dimension>
-struct access<point_tag, Point, CoordinateType, Dimension>
+struct access<point_tag, Point, CoordinateType, Dimension, boost::false_type>
{
static inline CoordinateType get(Point const& point)
{
@@ -124,6 +174,20 @@ struct access<point_tag, Point, CoordinateType, Dimension>
}
};
+template <typename Point, typename CoordinateType, std::size_t Dimension>
+struct access<point_tag, Point, CoordinateType, Dimension, boost::true_type>
+{
+ static inline CoordinateType get(Point const* point)
+ {
+ return traits::access<typename boost::remove_pointer<Point>::type, Dimension>::get(*point);
+ }
+ static inline void set(Point* p, CoordinateType const& value)
+ {
+ traits::access<typename boost::remove_pointer<Point>::type, Dimension>::set(*p, value);
+ }
+};
+
+
template
<
typename Box,
@@ -131,17 +195,21 @@ template
std::size_t Index,
std::size_t Dimension
>
-struct indexed_access<box_tag, Box, CoordinateType, Index, Dimension>
-{
- static inline CoordinateType get(Box const& box)
- {
- return traits::indexed_access<Box, Index, Dimension>::get(box);
- }
- static inline void set(Box& b, CoordinateType const& value)
- {
- traits::indexed_access<Box, Index, Dimension>::set(b, value);
- }
-};
+struct indexed_access<box_tag, Box, CoordinateType, Index, Dimension, boost::false_type>
+ : detail::indexed_access_non_pointer<Box, CoordinateType, Index, Dimension>
+{};
+
+template
+<
+ typename Box,
+ typename CoordinateType,
+ std::size_t Index,
+ std::size_t Dimension
+>
+struct indexed_access<box_tag, Box, CoordinateType, Index, Dimension, boost::true_type>
+ : detail::indexed_access_pointer<Box, CoordinateType, Index, Dimension>
+{};
+
template
<
@@ -150,17 +218,21 @@ template
std::size_t Index,
std::size_t Dimension
>
-struct indexed_access<segment_tag, Segment, CoordinateType, Index, Dimension>
-{
- static inline CoordinateType get(Segment const& segment)
- {
- return traits::indexed_access<Segment, Index, Dimension>::get(segment);
- }
- static inline void set(Segment& segment, CoordinateType const& value)
- {
- traits::indexed_access<Segment, Index, Dimension>::set(segment, value);
- }
-};
+struct indexed_access<segment_tag, Segment, CoordinateType, Index, Dimension, boost::false_type>
+ : detail::indexed_access_non_pointer<Segment, CoordinateType, Index, Dimension>
+{};
+
+
+template
+<
+ typename Segment,
+ typename CoordinateType,
+ std::size_t Index,
+ std::size_t Dimension
+>
+struct indexed_access<segment_tag, Segment, CoordinateType, Index, Dimension, boost::true_type>
+ : detail::indexed_access_pointer<Segment, CoordinateType, Index, Dimension>
+{};
} // namespace core_dispatch
#endif // DOXYGEN_NO_DISPATCH
@@ -199,14 +271,13 @@ inline typename coordinate_type<Geometry>::type get(Geometry const& geometry
{
boost::ignore_unused_variable_warning(dummy);
- typedef typename boost::remove_const<Geometry>::type ncg_type;
-
typedef core_dispatch::access
<
typename tag<Geometry>::type,
- ncg_type,
- typename coordinate_type<ncg_type>::type,
- Dimension
+ typename geometry::util::bare_type<Geometry>::type,
+ typename coordinate_type<Geometry>::type,
+ Dimension,
+ typename boost::is_pointer<Geometry>::type
> coord_access_type;
return coord_access_type::get(geometry);
@@ -234,14 +305,13 @@ inline void set(Geometry& geometry
{
boost::ignore_unused_variable_warning(dummy);
- typedef typename boost::remove_const<Geometry>::type ncg_type;
-
typedef core_dispatch::access
<
typename tag<Geometry>::type,
- ncg_type,
- typename coordinate_type<ncg_type>::type,
- Dimension
+ typename geometry::util::bare_type<Geometry>::type,
+ typename coordinate_type<Geometry>::type,
+ Dimension,
+ typename boost::is_pointer<Geometry>::type
> coord_access_type;
coord_access_type::set(geometry, value);
@@ -269,15 +339,14 @@ inline typename coordinate_type<Geometry>::type get(Geometry const& geometry
{
boost::ignore_unused_variable_warning(dummy);
- typedef typename boost::remove_const<Geometry>::type ncg_type;
-
typedef core_dispatch::indexed_access
<
typename tag<Geometry>::type,
- ncg_type,
- typename coordinate_type<ncg_type>::type,
+ typename geometry::util::bare_type<Geometry>::type,
+ typename coordinate_type<Geometry>::type,
Index,
- Dimension
+ Dimension,
+ typename boost::is_pointer<Geometry>::type
> coord_access_type;
return coord_access_type::get(geometry);
@@ -306,14 +375,14 @@ inline void set(Geometry& geometry
{
boost::ignore_unused_variable_warning(dummy);
- typedef typename boost::remove_const<Geometry>::type ncg_type;
-
typedef core_dispatch::indexed_access
<
- typename tag<Geometry>::type, ncg_type,
- typename coordinate_type<ncg_type>::type,
+ typename tag<Geometry>::type,
+ typename geometry::util::bare_type<Geometry>::type,
+ typename coordinate_type<Geometry>::type,
Index,
- Dimension
+ Dimension,
+ typename boost::is_pointer<Geometry>::type
> coord_access_type;
coord_access_type::set(geometry, value);
diff --git a/boost/geometry/core/coordinate_dimension.hpp b/boost/geometry/core/coordinate_dimension.hpp
index 84c11e2a55..2f3c914601 100644
--- a/boost/geometry/core/coordinate_dimension.hpp
+++ b/boost/geometry/core/coordinate_dimension.hpp
@@ -20,9 +20,9 @@
#include <boost/mpl/assert.hpp>
#include <boost/mpl/equal_to.hpp>
#include <boost/static_assert.hpp>
-#include <boost/type_traits/remove_const.hpp>
#include <boost/geometry/core/point_type.hpp>
+#include <boost/geometry/util/bare_type.hpp>
namespace boost { namespace geometry
{
@@ -58,7 +58,7 @@ template <typename T, typename G>
struct dimension : dimension<point_tag, typename point_type<T, G>::type> {};
template <typename P>
-struct dimension<point_tag, P> : traits::dimension<P> {};
+struct dimension<point_tag, P> : traits::dimension<typename geometry::util::bare_type<P>::type> {};
} // namespace core_dispatch
#endif
@@ -75,7 +75,7 @@ struct dimension
: core_dispatch::dimension
<
typename tag<Geometry>::type,
- typename boost::remove_const<Geometry>::type
+ typename geometry::util::bare_type<Geometry>::type
>
{};
diff --git a/boost/geometry/core/coordinate_system.hpp b/boost/geometry/core/coordinate_system.hpp
index c23b8af15c..01e5ad1dd7 100644
--- a/boost/geometry/core/coordinate_system.hpp
+++ b/boost/geometry/core/coordinate_system.hpp
@@ -16,8 +16,9 @@
#include <boost/mpl/assert.hpp>
-#include <boost/type_traits/remove_const.hpp>
+
#include <boost/geometry/core/point_type.hpp>
+#include <boost/geometry/util/bare_type.hpp>
namespace boost { namespace geometry
@@ -61,10 +62,13 @@ namespace core_dispatch
};
- template <typename P>
- struct coordinate_system<point_tag, P>
+ template <typename Point>
+ struct coordinate_system<point_tag, Point>
{
- typedef typename traits::coordinate_system<P>::type type;
+ typedef typename traits::coordinate_system
+ <
+ typename geometry::util::bare_type<Point>::type
+ >::type type;
};
@@ -82,11 +86,10 @@ namespace core_dispatch
template <typename Geometry>
struct coordinate_system
{
- typedef typename boost::remove_const<Geometry>::type ncg;
typedef typename core_dispatch::coordinate_system
<
typename tag<Geometry>::type,
- ncg
+ typename geometry::util::bare_type<Geometry>::type
>::type type;
};
diff --git a/boost/geometry/core/coordinate_type.hpp b/boost/geometry/core/coordinate_type.hpp
index 0f901d3f19..d17f66ab73 100644
--- a/boost/geometry/core/coordinate_type.hpp
+++ b/boost/geometry/core/coordinate_type.hpp
@@ -16,9 +16,10 @@
#include <boost/mpl/assert.hpp>
-#include <boost/type_traits/remove_const.hpp>
+#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/point_type.hpp>
+#include <boost/geometry/util/bare_type.hpp>
#include <boost/geometry/util/promote_floating_point.hpp>
@@ -63,12 +64,17 @@ struct coordinate_type
template <typename Point>
struct coordinate_type<point_tag, Point>
{
- typedef typename traits::coordinate_type<Point>::type type;
+ typedef typename traits::coordinate_type
+ <
+ typename geometry::util::bare_type<Point>::type
+ >::type type;
};
+
} // namespace core_dispatch
#endif // DOXYGEN_NO_DISPATCH
+
/*!
\brief \brief_meta{type, coordinate type (int\, float\, double\, etc), \meta_point_type}
\tparam Geometry \tparam_geometry
@@ -79,11 +85,11 @@ struct coordinate_type<point_tag, Point>
template <typename Geometry>
struct coordinate_type
{
- typedef typename core_dispatch::coordinate_type
- <
- typename tag<Geometry>::type,
- typename boost::remove_const<Geometry>::type
- >::type type;
+ typedef typename core_dispatch::coordinate_type
+ <
+ typename tag<Geometry>::type,
+ typename geometry::util::bare_type<Geometry>::type
+ >::type type;
};
template <typename Geometry>
diff --git a/boost/geometry/core/point_type.hpp b/boost/geometry/core/point_type.hpp
index f49a43c56a..e148c84a57 100644
--- a/boost/geometry/core/point_type.hpp
+++ b/boost/geometry/core/point_type.hpp
@@ -22,6 +22,7 @@
#include <boost/geometry/core/ring_type.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tags.hpp>
+#include <boost/geometry/util/bare_type.hpp>
namespace boost { namespace geometry
{
@@ -115,11 +116,10 @@ struct point_type<polygon_tag, Polygon>
template <typename Geometry>
struct point_type
{
- typedef typename boost::remove_const<Geometry>::type ncg;
typedef typename core_dispatch::point_type
<
typename tag<Geometry>::type,
- ncg
+ typename boost::geometry::util::bare_type<Geometry>::type
>::type type;
};
diff --git a/boost/geometry/core/tag.hpp b/boost/geometry/core/tag.hpp
index 5a99c97071..4c790fdc9e 100644
--- a/boost/geometry/core/tag.hpp
+++ b/boost/geometry/core/tag.hpp
@@ -16,9 +16,9 @@
#include <boost/mpl/assert.hpp>
-#include <boost/type_traits/remove_const.hpp>
#include <boost/geometry/core/tags.hpp>
+#include <boost/geometry/util/bare_type.hpp>
namespace boost { namespace geometry
@@ -47,6 +47,7 @@ struct tag
} // namespace traits
+
/*!
\brief \brief_meta{type, tag, \meta_geometry_type}
\details With Boost.Geometry, tags are the driving force of the tag dispatching
@@ -61,7 +62,7 @@ struct tag
{
typedef typename traits::tag
<
- typename boost::remove_const<Geometry>::type
+ typename geometry::util::bare_type<Geometry>::type
>::type type;
};
diff --git a/boost/geometry/geometry.hpp b/boost/geometry/geometry.hpp
index 22d08e2a45..b696b652cf 100644
--- a/boost/geometry/geometry.hpp
+++ b/boost/geometry/geometry.hpp
@@ -64,6 +64,7 @@
#include <boost/geometry/algorithms/reverse.hpp>
#include <boost/geometry/algorithms/simplify.hpp>
#include <boost/geometry/algorithms/sym_difference.hpp>
+#include <boost/geometry/algorithms/touches.hpp>
#include <boost/geometry/algorithms/transform.hpp>
#include <boost/geometry/algorithms/union.hpp>
#include <boost/geometry/algorithms/unique.hpp>
diff --git a/boost/geometry/iterators/ever_circling_iterator.hpp b/boost/geometry/iterators/ever_circling_iterator.hpp
index 03921096e7..566669e26d 100644
--- a/boost/geometry/iterators/ever_circling_iterator.hpp
+++ b/boost/geometry/iterators/ever_circling_iterator.hpp
@@ -95,67 +95,115 @@ private:
bool m_skip_first;
};
-
-
template <typename Range>
-class ever_circling_range_iterator
- : public boost::iterator_adaptor
- <
- ever_circling_range_iterator<Range>,
- typename boost::range_iterator<Range>::type
- >
+struct ever_circling_range_iterator
+ : public boost::iterator_facade
+ <
+ ever_circling_range_iterator<Range>,
+ typename boost::range_value<Range>::type const,
+ boost::random_access_traversal_tag
+ >
{
-public :
- typedef typename boost::range_iterator<Range>::type iterator_type;
+ /// Constructor including the range it is based on
+ explicit inline ever_circling_range_iterator(Range& range)
+ : m_range(&range)
+ , m_iterator(boost::begin(range))
+ , m_size(boost::size(range))
+ , m_index(0)
+ {}
+
+ /// Default constructor
+ explicit inline ever_circling_range_iterator()
+ : m_range(NULL)
+ , m_size(0)
+ , m_index(0)
+ {}
+
+ inline ever_circling_range_iterator<Range>& operator=(ever_circling_range_iterator<Range> const& source)
+ {
+ m_range = source.m_range;
+ m_iterator = source.m_iterator;
+ m_size = source.m_size;
+ m_index = source.m_index;
+ return *this;
+ }
- explicit inline ever_circling_range_iterator(Range& range,
- bool skip_first = false)
- : m_range(range)
- , m_skip_first(skip_first)
+ typedef std::ptrdiff_t difference_type;
+
+private:
+ friend class boost::iterator_core_access;
+
+ inline typename boost::range_value<Range>::type const& dereference() const
{
- this->base_reference() = boost::begin(m_range);
+ return *m_iterator;
}
- explicit inline ever_circling_range_iterator(Range& range, iterator_type start,
- bool skip_first = false)
- : m_range(range)
- , m_skip_first(skip_first)
+ inline difference_type distance_to(ever_circling_range_iterator<Range> const& other) const
{
- this->base_reference() = start;
+ return other.m_index - this->m_index;
}
- /// Navigate to a certain position, should be in [start .. end], if at end
- /// it will circle again.
- inline void moveto(iterator_type it)
+ inline bool equal(ever_circling_range_iterator<Range> const& other) const
{
- this->base_reference() = it;
- check_end();
+ return this->m_range == other.m_range
+ && this->m_index == other.m_index;
}
-private:
+ inline void increment()
+ {
+ ++m_index;
+ if (m_index >= 0 && m_index < m_size)
+ {
+ ++m_iterator;
+ }
+ else
+ {
+ update_iterator();
+ }
+ }
- friend class boost::iterator_core_access;
+ inline void decrement()
+ {
+ --m_index;
+ if (m_index >= 0 && m_index < m_size)
+ {
+ --m_iterator;
+ }
+ else
+ {
+ update_iterator();
+ }
+ }
- inline void increment(bool possibly_skip = true)
+ inline void advance(difference_type n)
{
- (this->base_reference())++;
- check_end(possibly_skip);
+ if (m_index >= 0 && m_index < m_size
+ && m_index + n >= 0 && m_index + n < m_size)
+ {
+ m_index += n;
+ m_iterator += n;
+ }
+ else
+ {
+ m_index += n;
+ update_iterator();
+ }
}
- inline void check_end(bool possibly_skip = true)
+ inline void update_iterator()
{
- if (this->base_reference() == boost::end(m_range))
+ while (m_index < 0)
{
- this->base_reference() = boost::begin(m_range);
- if (m_skip_first && possibly_skip)
- {
- increment(false);
- }
+ m_index += m_size;
}
+ m_index = m_index % m_size;
+ this->m_iterator = boost::begin(*m_range) + m_index;
}
- Range& m_range;
- bool m_skip_first;
+ Range* m_range;
+ typename boost::range_iterator<Range>::type m_iterator;
+ difference_type m_size;
+ difference_type m_index;
};
diff --git a/boost/geometry/multi/algorithms/detail/overlay/copy_segment_point.hpp b/boost/geometry/multi/algorithms/detail/overlay/copy_segment_point.hpp
index 1093a84569..72be5ddbf4 100644
--- a/boost/geometry/multi/algorithms/detail/overlay/copy_segment_point.hpp
+++ b/boost/geometry/multi/algorithms/detail/overlay/copy_segment_point.hpp
@@ -42,7 +42,7 @@ struct copy_segment_point_multi
BOOST_ASSERT
(
seg_id.multi_index >= 0
- && seg_id.multi_index < boost::size(multi)
+ && seg_id.multi_index < int(boost::size(multi))
);
// Call the single-version
diff --git a/boost/geometry/multi/algorithms/detail/overlay/copy_segments.hpp b/boost/geometry/multi/algorithms/detail/overlay/copy_segments.hpp
index a234e240da..f474b12fdf 100644
--- a/boost/geometry/multi/algorithms/detail/overlay/copy_segments.hpp
+++ b/boost/geometry/multi/algorithms/detail/overlay/copy_segments.hpp
@@ -44,7 +44,7 @@ struct copy_segments_multi
BOOST_ASSERT
(
seg_id.multi_index >= 0
- && seg_id.multi_index < boost::size(multi_geometry)
+ && seg_id.multi_index < int(boost::size(multi_geometry))
);
// Call the single-version
diff --git a/boost/geometry/multi/algorithms/detail/overlay/get_ring.hpp b/boost/geometry/multi/algorithms/detail/overlay/get_ring.hpp
index 8cdd7ed970..e23acf99b3 100644
--- a/boost/geometry/multi/algorithms/detail/overlay/get_ring.hpp
+++ b/boost/geometry/multi/algorithms/detail/overlay/get_ring.hpp
@@ -35,7 +35,7 @@ struct get_ring<multi_polygon_tag>
BOOST_ASSERT
(
id.multi_index >= 0
- && id.multi_index < boost::size(multi_polygon)
+ && id.multi_index < int(boost::size(multi_polygon))
);
return get_ring<polygon_tag>::apply(id,
multi_polygon[id.multi_index]);
diff --git a/boost/geometry/multi/algorithms/detail/point_on_border.hpp b/boost/geometry/multi/algorithms/detail/point_on_border.hpp
index 04d76422c6..ac462ed4c5 100644
--- a/boost/geometry/multi/algorithms/detail/point_on_border.hpp
+++ b/boost/geometry/multi/algorithms/detail/point_on_border.hpp
@@ -31,13 +31,13 @@ namespace detail { namespace point_on_border
template
<
- typename MultiGeometry,
typename Point,
+ typename MultiGeometry,
typename Policy
>
struct point_on_multi
{
- static inline bool apply(MultiGeometry const& multi, Point& point)
+ static inline bool apply(Point& point, MultiGeometry const& multi, bool midpoint)
{
// Take a point on the first multi-geometry
// (i.e. the first that is not empty)
@@ -48,7 +48,7 @@ struct point_on_multi
it != boost::end(multi);
++it)
{
- if (Policy::apply(*it, point))
+ if (Policy::apply(point, *it, midpoint))
{
return true;
}
@@ -69,16 +69,16 @@ namespace dispatch
{
-template<typename Multi, typename Point>
-struct point_on_border<multi_polygon_tag, Multi, Point>
+template<typename Point, typename Multi>
+struct point_on_border<multi_polygon_tag, Point, Multi>
: detail::point_on_border::point_on_multi
<
- Multi,
Point,
+ Multi,
detail::point_on_border::point_on_polygon
<
- typename boost::range_value<Multi>::type,
- Point
+ Point,
+ typename boost::range_value<Multi>::type
>
>
{};
diff --git a/boost/geometry/multi/algorithms/detail/sections/range_by_section.hpp b/boost/geometry/multi/algorithms/detail/sections/range_by_section.hpp
index cf4bf5d83b..28a4805ed1 100644
--- a/boost/geometry/multi/algorithms/detail/sections/range_by_section.hpp
+++ b/boost/geometry/multi/algorithms/detail/sections/range_by_section.hpp
@@ -46,7 +46,7 @@ struct full_section_multi
BOOST_ASSERT
(
section.ring_id.multi_index >= 0
- && section.ring_id.multi_index < boost::size(multi)
+ && section.ring_id.multi_index < int(boost::size(multi))
);
return Policy::apply(multi[section.ring_id.multi_index], section);
diff --git a/boost/geometry/multi/io/wkt/read.hpp b/boost/geometry/multi/io/wkt/read.hpp
index 3c75fd8040..218ddf9999 100644
--- a/boost/geometry/multi/io/wkt/read.hpp
+++ b/boost/geometry/multi/io/wkt/read.hpp
@@ -58,6 +58,69 @@ struct multi_parser
handle_close_parenthesis(it, tokens.end(), wkt);
}
+
+ check_end(it, tokens.end(), wkt);
+ }
+};
+
+template <typename P>
+struct noparenthesis_point_parser
+{
+ static inline void apply(tokenizer::iterator& it, tokenizer::iterator end,
+ std::string const& wkt, P& point)
+ {
+ parsing_assigner<P, 0, dimension<P>::value>::apply(it, end, point, wkt);
+ }
+};
+
+template <typename MultiGeometry, typename PrefixPolicy>
+struct multi_point_parser
+{
+ static inline void apply(std::string const& wkt, MultiGeometry& geometry)
+ {
+ traits::clear<MultiGeometry>::apply(geometry);
+
+ tokenizer tokens(wkt, boost::char_separator<char>(" ", ",()"));
+ tokenizer::iterator it;
+
+ if (initialize<MultiGeometry>(tokens, PrefixPolicy::apply(), wkt, it))
+ {
+ handle_open_parenthesis(it, tokens.end(), wkt);
+
+ // If first point definition starts with "(" then parse points as (x y)
+ // otherwise as "x y"
+ bool using_brackets = (it != tokens.end() && *it == "(");
+
+ while(it != tokens.end() && *it != ")")
+ {
+ traits::resize<MultiGeometry>::apply(geometry, boost::size(geometry) + 1);
+
+ if (using_brackets)
+ {
+ point_parser
+ <
+ typename boost::range_value<MultiGeometry>::type
+ >::apply(it, tokens.end(), wkt, geometry.back());
+ }
+ else
+ {
+ noparenthesis_point_parser
+ <
+ typename boost::range_value<MultiGeometry>::type
+ >::apply(it, tokens.end(), wkt, geometry.back());
+ }
+
+ if (it != tokens.end() && *it == ",")
+ {
+ // Skip "," after point is parsed
+ ++it;
+ }
+ }
+
+ handle_close_parenthesis(it, tokens.end(), wkt);
+ }
+
+ check_end(it, tokens.end(), wkt);
}
};
@@ -69,10 +132,9 @@ namespace dispatch
template <typename MultiGeometry>
struct read_wkt<multi_point_tag, MultiGeometry>
- : detail::wkt::multi_parser
+ : detail::wkt::multi_point_parser
<
MultiGeometry,
- detail::wkt::point_parser,
detail::wkt::prefix_multipoint
>
{};
diff --git a/boost/geometry/policies/relate/direction.hpp b/boost/geometry/policies/relate/direction.hpp
index 9090d8b51e..cfbaf7dd15 100644
--- a/boost/geometry/policies/relate/direction.hpp
+++ b/boost/geometry/policies/relate/direction.hpp
@@ -126,7 +126,9 @@ struct segments_direction
typedef typename select_most_precise<coordinate_type, double>::type rtype;
+ template <typename R>
static inline return_type segments_intersect(side_info const& sides,
+ R const&,
coordinate_type const& dx1, coordinate_type const& dy1,
coordinate_type const& dx2, coordinate_type const& dy2,
S1 const& s1, S2 const& s2)
diff --git a/boost/geometry/policies/relate/intersection_points.hpp b/boost/geometry/policies/relate/intersection_points.hpp
index afd1dde501..d7d5199051 100644
--- a/boost/geometry/policies/relate/intersection_points.hpp
+++ b/boost/geometry/policies/relate/intersection_points.hpp
@@ -36,56 +36,33 @@ struct segments_intersection_points
typedef ReturnType return_type;
typedef S1 segment_type1;
typedef S2 segment_type2;
+
typedef typename select_calculation_type
<
S1, S2, CalculationType
>::type coordinate_type;
+ template <typename R>
static inline return_type segments_intersect(side_info const&,
+ R const& r,
coordinate_type const& dx1, coordinate_type const& dy1,
coordinate_type const& dx2, coordinate_type const& dy2,
S1 const& s1, S2 const& s2)
{
- return_type result;
typedef typename geometry::coordinate_type
<
typename return_type::point_type
- >::type coordinate_type;
+ >::type return_coordinate_type;
- // Get the same type, but at least a double (also used for divisions)
- typedef typename select_most_precise
- <
- coordinate_type, double
- >::type promoted_type;
-
- promoted_type const s1x = get<0, 0>(s1);
- promoted_type const s1y = get<0, 1>(s1);
-
- // Calculate other determinants - Cramers rule
- promoted_type const wx = get<0, 0>(s1) - get<0, 0>(s2);
- promoted_type const wy = get<0, 1>(s1) - get<0, 1>(s2);
- promoted_type const d = detail::determinant<promoted_type>(dx1, dy1, dx2, dy2);
- promoted_type const da = detail::determinant<promoted_type>(dx2, dy2, wx, wy);
-
- // r: ratio 0-1 where intersection divides A/B
- promoted_type r = da / d;
- promoted_type const zero = promoted_type();
- promoted_type const one = 1;
- // Handle robustness issues
- if (r < zero)
- {
- r = zero;
- }
- else if (r > one)
- {
- r = one;
- }
+ coordinate_type const s1x = get<0, 0>(s1);
+ coordinate_type const s1y = get<0, 1>(s1);
+ return_type result;
result.count = 1;
set<0>(result.intersections[0],
- boost::numeric_cast<coordinate_type>(s1x + r * promoted_type(dx1)));
+ boost::numeric_cast<return_coordinate_type>(R(s1x) + r * R(dx1)));
set<1>(result.intersections[0],
- boost::numeric_cast<coordinate_type>(s1y + r * promoted_type(dy1)));
+ boost::numeric_cast<return_coordinate_type>(R(s1y) + r * R(dy1)));
return result;
}
diff --git a/boost/geometry/policies/relate/tupled.hpp b/boost/geometry/policies/relate/tupled.hpp
index 853a8a26a8..f6713c44c9 100644
--- a/boost/geometry/policies/relate/tupled.hpp
+++ b/boost/geometry/policies/relate/tupled.hpp
@@ -49,16 +49,18 @@ struct segments_tupled
// Get the same type, but at least a double
typedef typename select_most_precise<coordinate_type, double>::type rtype;
+ template <typename R>
static inline return_type segments_intersect(side_info const& sides,
+ R const& r,
coordinate_type const& dx1, coordinate_type const& dy1,
coordinate_type const& dx2, coordinate_type const& dy2,
segment_type1 const& s1, segment_type2 const& s2)
{
return boost::make_tuple
(
- Policy1::segments_intersect(sides,
+ Policy1::segments_intersect(sides, r,
dx1, dy1, dx2, dy2, s1, s2),
- Policy2::segments_intersect(sides,
+ Policy2::segments_intersect(sides, r,
dx1, dy1, dx2, dy2, s1, s2)
);
}
diff --git a/boost/geometry/strategies/cartesian/cart_intersect.hpp b/boost/geometry/strategies/cartesian/cart_intersect.hpp
index 2bf7b77676..ea92cf37b0 100644
--- a/boost/geometry/strategies/cartesian/cart_intersect.hpp
+++ b/boost/geometry/strategies/cartesian/cart_intersect.hpp
@@ -41,21 +41,17 @@ namespace strategy { namespace intersection
namespace detail
{
-template <typename Segment, size_t Dimension>
-struct segment_arrange
+template <std::size_t Dimension, typename Segment, typename T>
+static inline void segment_arrange(Segment const& s, T& s_1, T& s_2, bool& swapped)
{
- template <typename T>
- static inline void apply(Segment const& s, T& s_1, T& s_2, bool& swapped)
+ s_1 = get<0, Dimension>(s);
+ s_2 = get<1, Dimension>(s);
+ if (s_1 > s_2)
{
- s_1 = get<0, Dimension>(s);
- s_2 = get<1, Dimension>(s);
- if (s_1 > s_2)
- {
- std::swap(s_1, s_2);
- swapped = true;
- }
+ std::swap(s_1, s_2);
+ swapped = true;
}
-};
+}
template <std::size_t Index, typename Segment>
inline typename geometry::point_type<Segment>::type get_from_index(
@@ -121,34 +117,20 @@ struct relate_cartesian_segments
coordinate_type const& dx_a, coordinate_type const& dy_a,
coordinate_type const& dx_b, coordinate_type const& dy_b)
{
- // 1) Handle "disjoint", common case.
- // per dimension, 2 cases: a_1----------a_2 b_1-------b_2 or B left of A
- coordinate_type ax_1, ax_2, bx_1, bx_2;
- bool ax_swapped = false, bx_swapped = false;
- detail::segment_arrange<segment_type1, 0>::apply(a, ax_1, ax_2, ax_swapped);
- detail::segment_arrange<segment_type2, 0>::apply(b, bx_1, bx_2, bx_swapped);
- if (ax_2 < bx_1 || ax_1 > bx_2)
- {
- return Policy::disjoint();
- }
-
- // 1b) In Y-dimension
- coordinate_type ay_1, ay_2, by_1, by_2;
- bool ay_swapped = false, by_swapped = false;
- detail::segment_arrange<segment_type1, 1>::apply(a, ay_1, ay_2, ay_swapped);
- detail::segment_arrange<segment_type2, 1>::apply(b, by_1, by_2, by_swapped);
- if (ay_2 < by_1 || ay_1 > by_2)
- {
- return Policy::disjoint();
- }
-
typedef side::side_by_triangle<coordinate_type> side;
side_info sides;
- // 2) Calculate sides
- // Note: Do NOT yet calculate the determinant here, but use the SIDE strategy.
- // Determinant calculation is not robust; side (orient) can be made robust
- // (and is much robuster even without measures)
+ bool collinear_use_first = math::abs(dx_a) + math::abs(dx_b) >= math::abs(dy_a) + math::abs(dy_b);
+
+ sides.set<0>
+ (
+ side::apply(detail::get_from_index<0>(b)
+ , detail::get_from_index<1>(b)
+ , detail::get_from_index<0>(a)),
+ side::apply(detail::get_from_index<0>(b)
+ , detail::get_from_index<1>(b)
+ , detail::get_from_index<1>(a))
+ );
sides.set<1>
(
side::apply(detail::get_from_index<0>(a)
@@ -159,26 +141,18 @@ struct relate_cartesian_segments
, detail::get_from_index<1>(b))
);
- if (sides.same<1>())
- {
- // Both points are at same side of other segment, we can leave
- return Policy::disjoint();
- }
+ bool collinear = sides.collinear();
- // 2b) For other segment
- sides.set<0>
- (
- side::apply(detail::get_from_index<0>(b)
- , detail::get_from_index<1>(b)
- , detail::get_from_index<0>(a)),
- side::apply(detail::get_from_index<0>(b)
- , detail::get_from_index<1>(b)
- , detail::get_from_index<1>(a))
- );
+ robustness_verify_collinear(a, b, sides, collinear);
+ robustness_verify_meeting(a, b, sides, collinear, collinear_use_first);
- if (sides.same<0>())
+ if (sides.same<0>() || sides.same<1>())
{
- return Policy::disjoint();
+ // Both points are at same side of other segment, we can leave
+ if (robustness_verify_same_side(a, b, sides))
+ {
+ return Policy::disjoint();
+ }
}
// Degenerate cases: segments of single point, lying on other segment, non disjoint
@@ -192,82 +166,343 @@ struct relate_cartesian_segments
return Policy::degenerate(b, false);
}
- bool collinear = sides.collinear();
-
- // Get the same type, but at least a double (also used for divisions)
typedef typename select_most_precise
<
coordinate_type, double
>::type promoted_type;
- // Calculate the determinant/2D cross product
- // (Note, because we only check on zero,
- // the order a/b does not care)
- promoted_type const d = geometry::detail::determinant
- <
- promoted_type
- >(dx_a, dy_a, dx_b, dy_b);
-
- // Determinant d should be nonzero.
- // If it is zero, we have an robustness issue here,
- // (and besides that we cannot divide by it)
- promoted_type const pt_zero = promoted_type();
- if(math::equals(d, pt_zero) && ! collinear)
+ // r: ratio 0-1 where intersection divides A/B
+ // (only calculated for non-collinear segments)
+ promoted_type r;
+ if (! collinear)
{
-#ifdef BOOST_GEOMETRY_DEBUG_INTERSECTION
- std::cout << "Determinant zero? Type : "
- << typeid(coordinate_type).name()
- << std::endl;
-
- std::cout << " dx_a : " << dx_a << std::endl;
- std::cout << " dy_a : " << dy_a << std::endl;
- std::cout << " dx_b : " << dx_b << std::endl;
- std::cout << " dy_b : " << dy_b << std::endl;
-
- std::cout << " side a <-> b.first : " << sides.get<0,0>() << std::endl;
- std::cout << " side a <-> b.second: " << sides.get<0,1>() << std::endl;
- std::cout << " side b <-> a.first : " << sides.get<1,0>() << std::endl;
- std::cout << " side b <-> a.second: " << sides.get<1,1>() << std::endl;
-#endif
-
- if (sides.as_collinear())
+ // Calculate determinants - Cramers rule
+ coordinate_type const wx = get<0, 0>(a) - get<0, 0>(b);
+ coordinate_type const wy = get<0, 1>(a) - get<0, 1>(b);
+ coordinate_type const d = geometry::detail::determinant<coordinate_type>(dx_a, dy_a, dx_b, dy_b);
+ coordinate_type const da = geometry::detail::determinant<coordinate_type>(dx_b, dy_b, wx, wy);
+
+ coordinate_type const zero = coordinate_type();
+ if (math::equals(d, zero))
{
+ // This is still a collinear case (because of FP imprecision this can occur here)
+ // sides.debug();
sides.set<0>(0,0);
sides.set<1>(0,0);
collinear = true;
}
else
{
- return Policy::error("Determinant zero!");
+ r = promoted_type(da) / promoted_type(d);
+
+ if (! robustness_verify_r(a, b, r))
+ {
+ return Policy::disjoint();
+ }
+
+ robustness_handle_meeting(a, b, sides, dx_a, dy_a, wx, wy, d, r);
+
+ if (robustness_verify_disjoint_at_one_collinear(a, b, sides))
+ {
+ return Policy::disjoint();
+ }
+
}
}
if(collinear)
{
- // Segments are collinear. We'll find out how.
- if (math::equals(dx_b, zero))
+ if (collinear_use_first)
{
- // Vertical -> Check y-direction
- return relate_collinear(a, b,
- ay_1, ay_2, by_1, by_2,
- ay_swapped, by_swapped);
+ return relate_collinear<0>(a, b);
}
else
{
- // Check x-direction
- return relate_collinear(a, b,
- ax_1, ax_2, bx_1, bx_2,
- ax_swapped, bx_swapped);
+ // Y direction contains larger segments (maybe dx is zero)
+ return relate_collinear<1>(a, b);
}
}
- return Policy::segments_intersect(sides,
+ return Policy::segments_intersect(sides, r,
dx_a, dy_a, dx_b, dy_b,
a, b);
}
private :
+
+ // Ratio should lie between 0 and 1
+ // Also these three conditions might be of FP imprecision, the segments were actually (nearly) collinear
+ template <typename T>
+ static inline bool robustness_verify_r(
+ segment_type1 const& a, segment_type2 const& b,
+ T& r)
+ {
+ T const zero = 0;
+ T const one = 1;
+ if (r < zero || r > one)
+ {
+ if (verify_disjoint<0>(a, b) || verify_disjoint<1>(a, b))
+ {
+ // Can still be disjoint (even if not one is left or right from another)
+ // This is e.g. in case #snake4 of buffer test.
+ return false;
+ }
+
+ //std::cout << "ROBUSTNESS: correction of r " << r << std::endl;
+ // sides.debug();
+
+ // ROBUSTNESS: the r value can in epsilon-cases much larger than 1, while (with perfect arithmetic)
+ // it should be one. It can be 1.14 or even 1.98049 or 2 (while still intersecting)
+
+ // If segments are crossing (we can see that with the sides)
+ // and one is inside the other, there must be an intersection point.
+ // We correct for that.
+ // This is (only) in case #ggl_list_20110820_christophe in unit tests
+
+ // If segments are touching (two sides zero), of course they should intersect
+ // This is (only) in case #buffer_rt_i in the unit tests)
+
+ // If one touches in the middle, they also should intersect (#buffer_rt_j)
+
+ // Note that even for ttmath r is occasionally > 1, e.g. 1.0000000000000000000000036191231203575
+
+ if (r > one)
+ {
+ r = one;
+ }
+ else if (r < zero)
+ {
+ r = zero;
+ }
+ }
+ return true;
+ }
+
+ static inline void robustness_verify_collinear(
+ segment_type1 const& a, segment_type2 const& b,
+ side_info& sides,
+ bool& collinear)
+ {
+ if ((sides.zero<0>() && ! sides.zero<1>()) || (sides.zero<1>() && ! sides.zero<0>()))
+ {
+ // If one of the segments is collinear, the other must be as well.
+ // So handle it as collinear.
+ // (In float/double epsilon margins it can easily occur that one or two of them are -1/1)
+ // sides.debug();
+ sides.set<0>(0,0);
+ sides.set<1>(0,0);
+ collinear = true;
+ }
+ }
+
+ static inline void robustness_verify_meeting(
+ segment_type1 const& a, segment_type2 const& b,
+ side_info& sides,
+ bool& collinear, bool& collinear_use_first)
+ {
+ if (sides.meeting())
+ {
+ // If two segments meet each other at their segment-points, two sides are zero,
+ // the other two are not (unless collinear but we don't mean those here).
+ // However, in near-epsilon ranges it can happen that two sides are zero
+ // but they do not meet at their segment-points.
+ // In that case they are nearly collinear and handled as such.
+ if (! point_equals
+ (
+ select(sides.zero_index<0>(), a),
+ select(sides.zero_index<1>(), b)
+ )
+ )
+ {
+ sides.set<0>(0,0);
+ sides.set<1>(0,0);
+ collinear = true;
+
+ if (collinear_use_first && analyse_equal<0>(a, b))
+ {
+ collinear_use_first = false;
+ }
+ else if (! collinear_use_first && analyse_equal<1>(a, b))
+ {
+ collinear_use_first = true;
+ }
+
+ }
+ }
+ }
+
+ // Verifies and if necessary correct missed touch because of robustness
+ // This is the case at multi_polygon_buffer unittest #rt_m
+ static inline bool robustness_verify_same_side(
+ segment_type1 const& a, segment_type2 const& b,
+ side_info& sides)
+ {
+ int corrected = 0;
+ if (sides.one_touching<0>())
+ {
+ if (point_equals(
+ select(sides.zero_index<0>(), a),
+ select(0, b)
+ ))
+ {
+ sides.correct_to_zero<1, 0>();
+ corrected = 1;
+ }
+ if (point_equals
+ (
+ select(sides.zero_index<0>(), a),
+ select(1, b)
+ ))
+ {
+ sides.correct_to_zero<1, 1>();
+ corrected = 2;
+ }
+ }
+ else if (sides.one_touching<1>())
+ {
+ if (point_equals(
+ select(sides.zero_index<1>(), b),
+ select(0, a)
+ ))
+ {
+ sides.correct_to_zero<0, 0>();
+ corrected = 3;
+ }
+ if (point_equals
+ (
+ select(sides.zero_index<1>(), b),
+ select(1, a)
+ ))
+ {
+ sides.correct_to_zero<0, 1>();
+ corrected = 4;
+ }
+ }
+
+ return corrected == 0;
+ }
+
+ static inline bool robustness_verify_disjoint_at_one_collinear(
+ segment_type1 const& a, segment_type2 const& b,
+ side_info const& sides)
+ {
+ if (sides.one_of_all_zero())
+ {
+ if (verify_disjoint<0>(a, b) || verify_disjoint<1>(a, b))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+
+ // If r is one, or zero, segments should meet and their endpoints.
+ // Robustness issue: check if this is really the case.
+ // It turns out to be no problem, see buffer test #rt_s1 (and there are many cases generated)
+ // It generates an "ends in the middle" situation which is correct.
+ template <typename T, typename R>
+ static inline void robustness_handle_meeting(segment_type1 const& a, segment_type2 const& b,
+ side_info& sides,
+ T const& dx_a, T const& dy_a, T const& wx, T const& wy,
+ T const& d, R const& r)
+ {
+ return;
+
+ T const db = geometry::detail::determinant<T>(dx_a, dy_a, wx, wy);
+
+ R const zero = 0;
+ R const one = 1;
+ if (math::equals(r, zero) || math::equals(r, one))
+ {
+ R rb = db / d;
+ if (rb <= 0 || rb >= 1 || math::equals(rb, 0) || math::equals(rb, 1))
+ {
+ if (sides.one_zero<0>() && ! sides.one_zero<1>()) // or vice versa
+ {
+#if defined(BOOST_GEOMETRY_COUNT_INTERSECTION_EQUAL)
+ extern int g_count_intersection_equal;
+ g_count_intersection_equal++;
+#endif
+ sides.debug();
+ std::cout << "E r=" << r << " r.b=" << rb << " ";
+ }
+ }
+ }
+ }
+
+ template <std::size_t Dimension>
+ static inline bool verify_disjoint(segment_type1 const& a,
+ segment_type2 const& b)
+ {
+ coordinate_type a_1, a_2, b_1, b_2;
+ bool a_swapped = false, b_swapped = false;
+ detail::segment_arrange<Dimension>(a, a_1, a_2, a_swapped);
+ detail::segment_arrange<Dimension>(b, b_1, b_2, b_swapped);
+ return math::smaller(a_2, b_1) || math::larger(a_1, b_2);
+ }
+
+ template <typename Segment>
+ static inline typename point_type<Segment>::type select(int index, Segment const& segment)
+ {
+ return index == 0
+ ? detail::get_from_index<0>(segment)
+ : detail::get_from_index<1>(segment)
+ ;
+ }
+
+ // We cannot use geometry::equals here. Besides that this will be changed
+ // to compare segment-coordinate-values directly (not necessary to retrieve point first)
+ template <typename Point1, typename Point2>
+ static inline bool point_equals(Point1 const& point1, Point2 const& point2)
+ {
+ return math::equals(get<0>(point1), get<0>(point2))
+ && math::equals(get<1>(point1), get<1>(point2))
+ ;
+ }
+
+ // We cannot use geometry::equals here. Besides that this will be changed
+ // to compare segment-coordinate-values directly (not necessary to retrieve point first)
+ template <typename Point1, typename Point2>
+ static inline bool point_equality(Point1 const& point1, Point2 const& point2,
+ bool& equals_0, bool& equals_1)
+ {
+ equals_0 = math::equals(get<0>(point1), get<0>(point2));
+ equals_1 = math::equals(get<1>(point1), get<1>(point2));
+ return equals_0 && equals_1;
+ }
+
+ template <std::size_t Dimension>
+ static inline bool analyse_equal(segment_type1 const& a, segment_type2 const& b)
+ {
+ coordinate_type const a_1 = geometry::get<0, Dimension>(a);
+ coordinate_type const a_2 = geometry::get<1, Dimension>(a);
+ coordinate_type const b_1 = geometry::get<0, Dimension>(b);
+ coordinate_type const b_2 = geometry::get<1, Dimension>(b);
+ return math::equals(a_1, b_1)
+ || math::equals(a_2, b_1)
+ || math::equals(a_1, b_2)
+ || math::equals(a_2, b_2)
+ ;
+ }
+
+ template <std::size_t Dimension>
+ static inline return_type relate_collinear(segment_type1 const& a,
+ segment_type2 const& b)
+ {
+ coordinate_type a_1, a_2, b_1, b_2;
+ bool a_swapped = false, b_swapped = false;
+ detail::segment_arrange<Dimension>(a, a_1, a_2, a_swapped);
+ detail::segment_arrange<Dimension>(b, b_1, b_2, b_swapped);
+ if (math::smaller(a_2, b_1) || math::larger(a_1, b_2))
+ //if (a_2 < b_1 || a_1 > b_2)
+ {
+ return Policy::disjoint();
+ }
+ return relate_collinear(a, b, a_1, a_2, b_1, b_2, a_swapped, b_swapped);
+ }
+
/// Relate segments known collinear
static inline return_type relate_collinear(segment_type1 const& a
, segment_type2 const& b
@@ -296,33 +531,36 @@ private :
// Handle "equal", in polygon neighbourhood comparisons a common case
- // Check if segments are equal...
- bool const a1_eq_b1 = math::equals(get<0, 0>(a), get<0, 0>(b))
- && math::equals(get<0, 1>(a), get<0, 1>(b));
- bool const a2_eq_b2 = math::equals(get<1, 0>(a), get<1, 0>(b))
- && math::equals(get<1, 1>(a), get<1, 1>(b));
- if (a1_eq_b1 && a2_eq_b2)
- {
- return Policy::segment_equal(a, false);
- }
+ bool const opposite = a_swapped ^ b_swapped;
+ bool const both_swapped = a_swapped && b_swapped;
+
+ // Check if segments are equal or opposite equal...
+ bool const swapped_a1_eq_b1 = math::equals(a_1, b_1);
+ bool const swapped_a2_eq_b2 = math::equals(a_2, b_2);
- // ... or opposite equal
- bool const a1_eq_b2 = math::equals(get<0, 0>(a), get<1, 0>(b))
- && math::equals(get<0, 1>(a), get<1, 1>(b));
- bool const a2_eq_b1 = math::equals(get<1, 0>(a), get<0, 0>(b))
- && math::equals(get<1, 1>(a), get<0, 1>(b));
- if (a1_eq_b2 && a2_eq_b1)
+ if (swapped_a1_eq_b1 && swapped_a2_eq_b2)
{
- return Policy::segment_equal(a, true);
+ return Policy::segment_equal(a, opposite);
}
+ bool const swapped_a2_eq_b1 = math::equals(a_2, b_1);
+ bool const swapped_a1_eq_b2 = math::equals(a_1, b_2);
+
+ bool const a1_eq_b1 = both_swapped ? swapped_a2_eq_b2 : a_swapped ? swapped_a2_eq_b1 : b_swapped ? swapped_a1_eq_b2 : swapped_a1_eq_b1;
+ bool const a2_eq_b2 = both_swapped ? swapped_a1_eq_b1 : a_swapped ? swapped_a1_eq_b2 : b_swapped ? swapped_a2_eq_b1 : swapped_a2_eq_b2;
+
+ bool const a1_eq_b2 = both_swapped ? swapped_a2_eq_b1 : a_swapped ? swapped_a2_eq_b2 : b_swapped ? swapped_a1_eq_b1 : swapped_a1_eq_b2;
+ bool const a2_eq_b1 = both_swapped ? swapped_a1_eq_b2 : a_swapped ? swapped_a1_eq_b1 : b_swapped ? swapped_a2_eq_b2 : swapped_a2_eq_b1;
+
+
+
// The rest below will return one or two intersections.
// The delegated class can decide which is the intersection point, or two, build the Intersection Matrix (IM)
// For IM it is important to know which relates to which. So this information is given,
// without performance penalties to intersection calculation
- bool const has_common_points = a1_eq_b1 || a1_eq_b2 || a2_eq_b1 || a2_eq_b2;
+ bool const has_common_points = swapped_a1_eq_b1 || swapped_a1_eq_b2 || swapped_a2_eq_b1 || swapped_a2_eq_b2;
// "Touch" -> one intersection point -> one but not two common points
@@ -342,7 +580,7 @@ private :
// #4: a2<----a1 b1--->b2 (no arrival at all)
// Where the arranged forms have two forms:
// a_1-----a_2/b_1-------b_2 or reverse (B left of A)
- if (has_common_points && (math::equals(a_2, b_1) || math::equals(b_2, a_1)))
+ if ((swapped_a2_eq_b1 || swapped_a1_eq_b2) && ! swapped_a1_eq_b1 && ! swapped_a2_eq_b2)
{
if (a2_eq_b1) return Policy::collinear_touch(get<1, 0>(a), get<1, 1>(a), 0, -1);
if (a1_eq_b2) return Policy::collinear_touch(get<0, 0>(a), get<0, 1>(a), -1, 0);
@@ -402,7 +640,6 @@ private :
if (a1_eq_b1) return Policy::collinear_interior_boundary_intersect(a_in_b ? a : b, a_in_b, arrival_a, -arrival_a, false);
}
- bool const opposite = a_swapped ^ b_swapped;
// "Inside", a completely within b or b completely within a
@@ -464,7 +701,6 @@ private :
the picture might seem wrong but it (supposed to be) is right.
*/
- bool const both_swapped = a_swapped && b_swapped;
if (b_1 < a_2 && a_2 < b_2)
{
// Left column, from bottom to top
@@ -486,7 +722,7 @@ private :
;
}
// Nothing should goes through. If any we have made an error
- // Robustness: it can occur here...
+ // std::cout << "Robustness issue, non-logical behaviour" << std::endl;
return Policy::error("Robustness issue, non-logical behaviour");
}
};
diff --git a/boost/geometry/strategies/cartesian/distance_projected_point.hpp b/boost/geometry/strategies/cartesian/distance_projected_point.hpp
index e704a33105..13d4168445 100644
--- a/boost/geometry/strategies/cartesian/distance_projected_point.hpp
+++ b/boost/geometry/strategies/cartesian/distance_projected_point.hpp
@@ -75,23 +75,27 @@ template
class projected_point
{
public :
- typedef typename strategy::distance::services::return_type<Strategy>::type calculation_type;
-
-private :
-
// The three typedefs below are necessary to calculate distances
// from segments defined in integer coordinates.
// Integer coordinates can still result in FP distances.
// There is a division, which must be represented in FP.
// So promote.
- typedef typename promote_floating_point<calculation_type>::type fp_type;
+ typedef typename promote_floating_point
+ <
+ typename strategy::distance::services::return_type
+ <
+ Strategy
+ >::type
+ >::type calculation_type;
+
+private :
// A projected point of points in Integer coordinates must be able to be
// represented in FP.
typedef model::point
<
- fp_type,
+ calculation_type,
dimension<PointOfSegment>::value,
typename coordinate_system<PointOfSegment>::type
> fp_point_type;
@@ -139,19 +143,19 @@ public :
boost::ignore_unused_variable_warning(strategy);
calculation_type const zero = calculation_type();
- fp_type const c1 = dot_product(w, v);
+ calculation_type const c1 = dot_product(w, v);
if (c1 <= zero)
{
return strategy.apply(p, p1);
}
- fp_type const c2 = dot_product(v, v);
+ calculation_type const c2 = dot_product(v, v);
if (c2 <= c1)
{
return strategy.apply(p, p2);
}
// See above, c1 > 0 AND c2 > c1 so: c2 != 0
- fp_type const b = c1 / c2;
+ calculation_type const b = c1 / c2;
fp_strategy_type fp_strategy
= strategy::distance::services::get_similar
diff --git a/boost/geometry/strategies/side_info.hpp b/boost/geometry/strategies/side_info.hpp
index 3fc43b8d99..f3a9da0df0 100644
--- a/boost/geometry/strategies/side_info.hpp
+++ b/boost/geometry/strategies/side_info.hpp
@@ -45,6 +45,19 @@ public :
}
template <int Which, int Index>
+ inline void correct_to_zero()
+ {
+ if (Index == 0)
+ {
+ sides[Which].first = 0;
+ }
+ else
+ {
+ sides[Which].second = 0;
+ }
+ }
+
+ template <int Which, int Index>
inline int get() const
{
return Index == 0 ? sides[Which].first : sides[Which].second;
@@ -67,21 +80,81 @@ public :
&& sides[1].second == 0;
}
- // If one of the segments is collinear, the other must be as well.
- // So handle it as collinear.
- // (In floating point margins it can occur that one of them is 1!)
- inline bool as_collinear() const
+ inline bool crossing() const
+ {
+ return sides[0].first * sides[0].second == -1
+ && sides[1].first * sides[1].second == -1;
+ }
+
+ inline bool touching() const
+ {
+ return (sides[0].first * sides[1].first == -1
+ && sides[0].second == 0 && sides[1].second == 0)
+ || (sides[1].first * sides[0].first == -1
+ && sides[1].second == 0 && sides[0].second == 0);
+ }
+
+ template <int Which>
+ inline bool one_touching() const
+ {
+ // This is normally a situation which can't occur:
+ // If one is completely left or right, the other cannot touch
+ return one_zero<Which>()
+ && sides[1 - Which].first * sides[1 - Which].second == 1;
+ }
+
+ inline bool meeting() const
+ {
+ // Two of them (in each segment) zero, two not
+ return one_zero<0>() && one_zero<1>();
+ }
+
+ template <int Which>
+ inline bool zero() const
{
- return sides[0].first * sides[0].second == 0
- || sides[1].first * sides[1].second == 0;
+ return sides[Which].first == 0 && sides[Which].second == 0;
}
+ template <int Which>
+ inline bool one_zero() const
+ {
+ return (sides[Which].first == 0 && sides[Which].second != 0)
+ || (sides[Which].first != 0 && sides[Which].second == 0);
+ }
+
+ inline bool one_of_all_zero() const
+ {
+ int const sum = std::abs(sides[0].first)
+ + std::abs(sides[0].second)
+ + std::abs(sides[1].first)
+ + std::abs(sides[1].second);
+ return sum == 3;
+ }
+
+
+ template <int Which>
+ inline int zero_index() const
+ {
+ return sides[Which].first == 0 ? 0 : 1;
+ }
+
+
+ inline void debug() const
+ {
+ std::cout << sides[0].first << " "
+ << sides[0].second << " "
+ << sides[1].first << " "
+ << sides[1].second
+ << std::endl;
+ }
+
+
inline void reverse()
{
std::swap(sides[0], sides[1]);
}
-private :
+//private :
std::pair<int, int> sides[2];
};
diff --git a/boost/geometry/strategies/spherical/distance_cross_track.hpp b/boost/geometry/strategies/spherical/distance_cross_track.hpp
index ba589223ec..7b353020eb 100644
--- a/boost/geometry/strategies/spherical/distance_cross_track.hpp
+++ b/boost/geometry/strategies/spherical/distance_cross_track.hpp
@@ -101,23 +101,56 @@ public :
{
// http://williams.best.vwh.net/avform.htm#XTE
return_type d1 = m_strategy.apply(sp1, p);
+ return_type d3 = m_strategy.apply(sp1, sp2);
+
+ if (geometry::math::equals(d3, 0.0))
+ {
+ // "Degenerate" segment, return either d1 or d2
+ return d1;
+ }
- // Actually, calculation of d2 not necessary if we know that the projected point is on the great circle...
return_type d2 = m_strategy.apply(sp2, p);
return_type crs_AD = course(sp1, p);
return_type crs_AB = course(sp1, sp2);
- return_type XTD = m_radius * geometry::math::abs(asin(sin(d1 / m_radius) * sin(crs_AD - crs_AB)));
+ return_type crs_BA = crs_AB - geometry::math::pi<return_type>();
+ return_type crs_BD = course(sp2, p);
+ return_type d_crs1 = crs_AD - crs_AB;
+ return_type d_crs2 = crs_BD - crs_BA;
+
+ // d1, d2, d3 are in principle not needed, only the sign matters
+ return_type projection1 = cos( d_crs1 ) * d1 / d3;
+ return_type projection2 = cos( d_crs2 ) * d2 / d3;
#ifdef BOOST_GEOMETRY_DEBUG_CROSS_TRACK
-std::cout << "Course " << dsv(sp1) << " to " << dsv(p) << " " << crs_AD * geometry::math::r2d << std::endl;
-std::cout << "Course " << dsv(sp1) << " to " << dsv(sp2) << " " << crs_AB * geometry::math::r2d << std::endl;
-std::cout << "XTD: " << XTD << " d1: " << d1 << " d2: " << d2 << std::endl;
+ std::cout << "Course " << dsv(sp1) << " to " << dsv(p) << " " << crs_AD * geometry::math::r2d << std::endl;
+ std::cout << "Course " << dsv(sp1) << " to " << dsv(sp2) << " " << crs_AB * geometry::math::r2d << std::endl;
+ std::cout << "Course " << dsv(sp2) << " to " << dsv(p) << " " << crs_BD * geometry::math::r2d << std::endl;
+ std::cout << "Projection AD-AB " << projection1 << " : " << d_crs1 * geometry::math::r2d << std::endl;
+ std::cout << "Projection BD-BA " << projection2 << " : " << d_crs2 * geometry::math::r2d << std::endl;
#endif
+ if(projection1 > 0.0 && projection2 > 0.0)
+ {
+ return_type XTD = m_radius * geometry::math::abs( asin( sin( d1 / m_radius ) * sin( d_crs1 ) ));
+
+ #ifdef BOOST_GEOMETRY_DEBUG_CROSS_TRACK
+ std::cout << "Projection ON the segment" << std::endl;
+ std::cout << "XTD: " << XTD << " d1: " << d1 << " d2: " << d2 << std::endl;
+#endif
+
+ // Return shortest distance, projected point on segment sp1-sp2
+ return return_type(XTD);
+ }
+ else
+ {
+#ifdef BOOST_GEOMETRY_DEBUG_CROSS_TRACK
+ std::cout << "Projection OUTSIDE the segment" << std::endl;
+#endif
- // Return shortest distance, either to projected point on segment sp1-sp2, or to sp1, or to sp2
- return return_type((std::min)((std::min)(d1, d2), XTD));
+ // Return shortest distance, project either on point sp1 or sp2
+ return return_type( (std::min)( d1 , d2 ) );
+ }
}
inline return_type radius() const { return m_radius; }
diff --git a/boost/geometry/strategies/strategy_transform.hpp b/boost/geometry/strategies/strategy_transform.hpp
index 7a1f060169..61a408c617 100644
--- a/boost/geometry/strategies/strategy_transform.hpp
+++ b/boost/geometry/strategies/strategy_transform.hpp
@@ -23,7 +23,9 @@
#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/arithmetic/arithmetic.hpp>
#include <boost/geometry/core/access.hpp>
+#include <boost/geometry/core/radian_access.hpp>
#include <boost/geometry/core/coordinate_dimension.hpp>
+#include <boost/geometry/strategies/transform.hpp>
#include <boost/geometry/util/math.hpp>
#include <boost/geometry/util/select_coordinate_type.hpp>
@@ -251,6 +253,23 @@ namespace detail
return false;
}
+ template <typename P, typename T>
+ inline bool cartesian_to_spherical_equatorial3(T x, T y, T z, P& p)
+ {
+ assert_dimension<P, 3>();
+
+ // http://en.wikipedia.org/wiki/List_of_canonical_coordinate_transformations#From_Cartesian_coordinates
+ T const r = sqrt(x * x + y * y + z * z);
+ set<2>(p, r);
+ set_from_radian<0>(p, atan2(y, x));
+ if (r > 0.0)
+ {
+ set_from_radian<1>(p, asin(z / r));
+ return true;
+ }
+ return false;
+ }
+
} // namespace detail
#endif // DOXYGEN_NO_DETAIL
@@ -361,6 +380,16 @@ struct from_cartesian_3_to_spherical_polar_3
}
};
+template <typename P1, typename P2>
+struct from_cartesian_3_to_spherical_equatorial_3
+{
+ inline bool apply(P1 const& p1, P2& p2) const
+ {
+ assert_dimension<P1, 3>();
+ return detail::cartesian_to_spherical_equatorial3(get<0>(p1), get<1>(p1), get<2>(p1), p2);
+ }
+};
+
#ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
namespace services
@@ -454,6 +483,11 @@ struct default_strategy<cartesian_tag, spherical_polar_tag, CoordSys1, CoordSys2
{
typedef from_cartesian_3_to_spherical_polar_3<P1, P2> type;
};
+template <typename CoordSys1, typename CoordSys2, typename P1, typename P2>
+struct default_strategy<cartesian_tag, spherical_equatorial_tag, CoordSys1, CoordSys2, 3, 3, P1, P2>
+{
+ typedef from_cartesian_3_to_spherical_equatorial_3<P1, P2> type;
+};
} // namespace services
diff --git a/boost/geometry/util/bare_type.hpp b/boost/geometry/util/bare_type.hpp
new file mode 100644
index 0000000000..1b49de6436
--- /dev/null
+++ b/boost/geometry/util/bare_type.hpp
@@ -0,0 +1,38 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// Copyright (c) 2012 Barend Gehrels, Amsterdam, the Netherlands.
+// Copyright (c) 2012 Bruno Lalande, Paris, France.
+// Copyright (c) 2012 Mateusz Loskot, London, UK.
+
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_GEOMETRY_UTIL_BARE_TYPE_HPP
+#define BOOST_GEOMETRY_UTIL_BARE_TYPE_HPP
+
+#include <boost/type_traits.hpp>
+
+
+namespace boost { namespace geometry
+{
+
+namespace util
+{
+
+template <typename T>
+struct bare_type
+{
+ typedef typename boost::remove_const
+ <
+ typename boost::remove_pointer<T>::type
+ >::type type;
+};
+
+
+} // namespace util
+
+}} // namespace boost::geometry
+
+
+#endif // BOOST_GEOMETRY_UTIL_BARE_TYPE_HPP
diff --git a/boost/geometry/util/math.hpp b/boost/geometry/util/math.hpp
index edfa961b15..95cbdf2ce4 100644
--- a/boost/geometry/util/math.hpp
+++ b/boost/geometry/util/math.hpp
@@ -44,11 +44,43 @@ struct equals
template <typename Type>
struct equals<Type, true>
{
+ static inline Type get_max(Type const& a, Type const& b, Type const& c)
+ {
+ return (std::max)((std::max)(a, b), c);
+ }
+
static inline bool apply(Type const& a, Type const& b)
{
+ if (a == b)
+ {
+ return true;
+ }
+
// See http://www.parashift.com/c++-faq-lite/newbie.html#faq-29.17,
// FUTURE: replace by some boost tool or boost::test::close_at_tolerance
- return std::abs(a - b) <= std::numeric_limits<Type>::epsilon() * std::abs(a);
+ return std::abs(a - b) <= std::numeric_limits<Type>::epsilon() * get_max(std::abs(a), std::abs(b), 1.0);
+ }
+};
+
+template <typename Type, bool IsFloatingPoint>
+struct smaller
+{
+ static inline bool apply(Type const& a, Type const& b)
+ {
+ return a < b;
+ }
+};
+
+template <typename Type>
+struct smaller<Type, true>
+{
+ static inline bool apply(Type const& a, Type const& b)
+ {
+ if (equals<Type, true>::apply(a, b))
+ {
+ return false;
+ }
+ return a < b;
}
};
@@ -116,6 +148,28 @@ inline bool equals_with_epsilon(T1 const& a, T2 const& b)
>::apply(a, b);
}
+template <typename T1, typename T2>
+inline bool smaller(T1 const& a, T2 const& b)
+{
+ typedef typename select_most_precise<T1, T2>::type select_type;
+ return detail::smaller
+ <
+ select_type,
+ boost::is_floating_point<select_type>::type::value
+ >::apply(a, b);
+}
+
+template <typename T1, typename T2>
+inline bool larger(T1 const& a, T2 const& b)
+{
+ typedef typename select_most_precise<T1, T2>::type select_type;
+ return detail::smaller
+ <
+ select_type,
+ boost::is_floating_point<select_type>::type::value
+ >::apply(b, a);
+}
+
double const d2r = geometry::math::pi<double>() / 180.0;
diff --git a/boost/graph/adj_list_serialize.hpp b/boost/graph/adj_list_serialize.hpp
index c1ff4111d0..01db50282f 100644
--- a/boost/graph/adj_list_serialize.hpp
+++ b/boost/graph/adj_list_serialize.hpp
@@ -61,6 +61,8 @@ inline void save(
ar << serialization::make_nvp("v" , indices[target(e,graph)]);
ar << serialization::make_nvp("edge_property", get(edge_all_t(), graph, e) );
}
+
+ ar << serialization::make_nvp("graph_property", get_property(graph, graph_all_t()) );
}
@@ -95,6 +97,7 @@ inline void load(
boost::tie(e,inserted) = add_edge(verts[u], verts[v], graph);
ar >> serialization::make_nvp("edge_property", get(edge_all_t(), graph, e) );
}
+ ar >> serialization::make_nvp("graph_property", get_property(graph, graph_all_t()) );
}
template<class Archive, class OEL, class VL, class D, class VP, class EP, class GP, class EL>
diff --git a/boost/graph/adjacency_list.hpp b/boost/graph/adjacency_list.hpp
index 5034fec5a5..21b7500d26 100644
--- a/boost/graph/adjacency_list.hpp
+++ b/boost/graph/adjacency_list.hpp
@@ -51,11 +51,6 @@ namespace boost {
// adjacency_list, and the container_gen traits class which is used
// to map the selectors to the container type used to implement the
// graph.
- //
- // The main container_gen traits class uses partial specialization,
- // so we also include a workaround.
-
-#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
#if !defined BOOST_NO_SLIST
struct slistS {};
@@ -130,93 +125,6 @@ namespace boost {
typedef boost::unordered_multiset<ValueType> type;
};
-#else // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-
-#if !defined BOOST_NO_SLIST
- struct slistS {
- template <class T>
- struct bind_ { typedef BOOST_STD_EXTENSION_NAMESPACE::slist<T> type; };
- };
-#endif
-
- struct vecS {
- template <class T>
- struct bind_ { typedef std::vector<T> type; };
- };
-
- struct listS {
- template <class T>
- struct bind_ { typedef std::list<T> type; };
- };
-
- struct setS {
- template <class T>
- struct bind_ { typedef std::set<T, std::less<T> > type; };
- };
-
-
- struct mapS {
- template <class T>
- struct bind_ { typedef std::set<T, std::less<T> > type; };
- };
-
- struct multisetS {
- template <class T>
- struct bind_ { typedef std::multiset<T, std::less<T> > type; };
- };
-
- struct multimapS {
- template <class T>
- struct bind_ { typedef std::multiset<T, std::less<T> > type; };
- };
-
- struct hash_setS {
- template <class T>
- struct bind_ { typedef boost::unordered_set<T> type; };
- };
-
- struct hash_mapS {
- template <class T>
- struct bind_ { typedef boost::unordered_set<T> type; };
- };
-
- struct hash_multisetS {
- template <class T>
- struct bind_ { typedef boost::unordered_multiset<T> type; };
- };
-
- struct hash_multimapS {
- template <class T>
- struct bind_ { typedef boost::unordered_multiset<T> type; };
- };
-
- template <class Selector> struct container_selector {
- typedef vecS type;
- };
-
-#define BOOST_CONTAINER_SELECTOR(NAME) \
- template <> struct container_selector<NAME> { \
- typedef NAME type; \
- }
-
- BOOST_CONTAINER_SELECTOR(vecS);
- BOOST_CONTAINER_SELECTOR(listS);
- BOOST_CONTAINER_SELECTOR(mapS);
- BOOST_CONTAINER_SELECTOR(setS);
- BOOST_CONTAINER_SELECTOR(multisetS);
- BOOST_CONTAINER_SELECTOR(hash_mapS);
-#if !defined BOOST_NO_SLIST
- BOOST_CONTAINER_SELECTOR(slistS);
-#endif
-
- template <class Selector, class ValueType>
- struct container_gen {
- typedef typename container_selector<Selector>::type Select;
- typedef typename Select:: template bind_<ValueType>::type type;
- };
-
-#endif // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-
template <class StorageSelector>
struct parallel_edge_traits { };
@@ -354,13 +262,7 @@ namespace boost {
adjacency_list<OutEdgeListS,VertexListS,DirectedS,
VertexProperty,EdgeProperty,GraphProperty,EdgeListS>,
VertexListS, OutEdgeListS, DirectedS,
-#if !defined(BOOST_GRAPH_NO_BUNDLED_PROPERTIES)
- typename detail::retag_property_list<vertex_bundle_t,
- VertexProperty>::type,
- typename detail::retag_property_list<edge_bundle_t, EdgeProperty>::type,
-#else
VertexProperty, EdgeProperty,
-#endif
GraphProperty, EdgeListS>::type,
// Support for named vertices
public graph::maybe_named_graph<
@@ -371,25 +273,14 @@ namespace boost {
VertexProperty>
{
public:
-#if !defined(BOOST_GRAPH_NO_BUNDLED_PROPERTIES)
- typedef typename graph_detail::graph_prop<GraphProperty>::property graph_property_type;
- typedef typename graph_detail::graph_prop<GraphProperty>::bundle graph_bundled;
-
- typedef typename graph_detail::vertex_prop<VertexProperty>::property vertex_property_type;
- typedef typename graph_detail::vertex_prop<VertexProperty>::bundle vertex_bundled;
-
- typedef typename graph_detail::edge_prop<EdgeProperty>::property edge_property_type;
- typedef typename graph_detail::edge_prop<EdgeProperty>::bundle edge_bundled;
-#else
typedef GraphProperty graph_property_type;
- typedef no_graph_bundle graph_bundled;
+ typedef typename lookup_one_property<GraphProperty, graph_bundle_t>::type graph_bundled;
typedef VertexProperty vertex_property_type;
- typedef no_vertex_bundle vertex_bundled;
+ typedef typename lookup_one_property<VertexProperty, vertex_bundle_t>::type vertex_bundled;
typedef EdgeProperty edge_property_type;
- typedef no_edge_bundle edge_bundled;
-#endif
+ typedef typename lookup_one_property<EdgeProperty, edge_bundle_t>::type edge_bundled;
private:
typedef adjacency_list self;
@@ -502,20 +393,20 @@ namespace boost {
#define ADJLIST adjacency_list<OEL,VL,D,VP,EP,GP,EL>
template<ADJLIST_PARAMS, typename Tag, typename Value>
- inline void set_property(ADJLIST& g, Tag, Value const& value) {
- get_property_value(*g.m_property, Tag()) = value;
+ inline void set_property(ADJLIST& g, Tag tag, Value const& value) {
+ get_property_value(*g.m_property, tag) = value;
}
template<ADJLIST_PARAMS, typename Tag>
inline typename graph_property<ADJLIST, Tag>::type&
- get_property(ADJLIST& g, Tag) {
- return get_property_value(*g.m_property, Tag());
+ get_property(ADJLIST& g, Tag tag) {
+ return get_property_value(*g.m_property, tag);
}
template<ADJLIST_PARAMS, typename Tag>
inline typename graph_property<ADJLIST, Tag>::type const&
- get_property(ADJLIST const& g, Tag) {
- return get_property_value(*g.m_property, Tag());
+ get_property(ADJLIST const& g, Tag tag) {
+ return get_property_value(*g.m_property, tag);
}
// dwa 09/25/00 - needed to be more explicit so reverse_graph would work.
@@ -545,58 +436,6 @@ namespace boost {
return e.m_target;
}
- // Support for bundled properties
-#ifndef BOOST_GRAPH_NO_BUNDLED_PROPERTIES
- template<typename OutEdgeListS, typename VertexListS, typename DirectedS, typename VertexProperty,
- typename EdgeProperty, typename GraphProperty, typename EdgeListS, typename T, typename Bundle>
- inline
- typename property_map<adjacency_list<OutEdgeListS, VertexListS, DirectedS, VertexProperty, EdgeProperty,
- GraphProperty, EdgeListS>, T Bundle::*>::type
- get(T Bundle::* p, adjacency_list<OutEdgeListS, VertexListS, DirectedS, VertexProperty, EdgeProperty,
- GraphProperty, EdgeListS>& g)
- {
- typedef typename property_map<adjacency_list<OutEdgeListS, VertexListS, DirectedS, VertexProperty,
- EdgeProperty, GraphProperty, EdgeListS>, T Bundle::*>::type
- result_type;
- return result_type(&g, p);
- }
-
- template<typename OutEdgeListS, typename VertexListS, typename DirectedS, typename VertexProperty,
- typename EdgeProperty, typename GraphProperty, typename EdgeListS, typename T, typename Bundle>
- inline
- typename property_map<adjacency_list<OutEdgeListS, VertexListS, DirectedS, VertexProperty, EdgeProperty,
- GraphProperty, EdgeListS>, T Bundle::*>::const_type
- get(T Bundle::* p, adjacency_list<OutEdgeListS, VertexListS, DirectedS, VertexProperty, EdgeProperty,
- GraphProperty, EdgeListS> const & g)
- {
- typedef typename property_map<adjacency_list<OutEdgeListS, VertexListS, DirectedS, VertexProperty,
- EdgeProperty, GraphProperty, EdgeListS>, T Bundle::*>::const_type
- result_type;
- return result_type(&g, p);
- }
-
- template<typename OutEdgeListS, typename VertexListS, typename DirectedS, typename VertexProperty,
- typename EdgeProperty, typename GraphProperty, typename EdgeListS, typename T, typename Bundle,
- typename Key>
- inline T
- get(T Bundle::* p, adjacency_list<OutEdgeListS, VertexListS, DirectedS, VertexProperty, EdgeProperty,
- GraphProperty, EdgeListS> const & g, const Key& key)
- {
- return get(get(p, g), key);
- }
-
- template<typename OutEdgeListS, typename VertexListS, typename DirectedS, typename VertexProperty,
- typename EdgeProperty, typename GraphProperty, typename EdgeListS, typename T, typename Bundle,
- typename Key>
- inline void
- put(T Bundle::* p, adjacency_list<OutEdgeListS, VertexListS, DirectedS, VertexProperty, EdgeProperty,
- GraphProperty, EdgeListS>& g, const Key& key, const T& value)
- {
- put(get(p, g), key, value);
- }
-
-#endif
-
// Mutability Traits
template <ADJLIST_PARAMS>
struct graph_mutability_traits<ADJLIST> {
diff --git a/boost/graph/adjacency_list_io.hpp b/boost/graph/adjacency_list_io.hpp
index 91b0b465d7..aaba8a43c3 100644
--- a/boost/graph/adjacency_list_io.hpp
+++ b/boost/graph/adjacency_list_io.hpp
@@ -40,7 +40,7 @@ namespace boost {
template<class Tag, class Value, class Next>
std::istream& operator >> ( std::istream& in, property<Tag,Value,Next>& p )
{
- in >> p.m_value >> *(static_cast<Next*>(&p)); // houpla !!
+ in >> p.m_value >> p.m_base; // houpla !!
return in;
}
@@ -65,7 +65,7 @@ template<class Tag, class Value, class Next, class V, class Stag>
void get
( property<Tag,Value,Next>& p, const V& v, Stag s )
{
- get( *(static_cast<Next*>(&p)),v,s );
+ get( p.m_base,v,s );
}
template<class Value, class Next, class V, class Stag>
@@ -82,7 +82,7 @@ void getSubset
( property<Tag,Value,Next>& p, const property<Stag,Svalue,Snext>& s )
{
get( p, s.m_value, Stag() );
- getSubset( p, Snext(s) );
+ getSubset( p, s.m_base );
}
template<class Tag, class Value, class Next,
@@ -215,7 +215,7 @@ struct PropertyPrinter
template<class Val>
PropertyPrinter& operator () ( std::ostream& out, const Val& v )
{
- typename property_map<Graph,Tag>::type ps = get(Tag(), *graph);
+ typename property_map<Graph,Tag>::const_type ps = get(Tag(), *graph);
out << ps[ v ] <<" ";
PropertyPrinter<Graph,Next> print(*graph);
print(out, v);
@@ -248,7 +248,7 @@ struct PropertyPrinter<Graph, property<Tag, Value, Next> >
template<class Val>
PropertyPrinter& operator () ( std::ostream& out, const Val& v )
{
- typename property_map<Graph,Tag>::type ps = get(Tag(), *graph);
+ typename property_map<Graph,Tag>::const_type ps = get(Tag(), *graph);
out << ps[ v ] <<" ";
PropertyPrinter<Graph,Next> print(*graph);
print(out, v);
diff --git a/boost/graph/adjacency_matrix.hpp b/boost/graph/adjacency_matrix.hpp
index 47d8d5f28a..65cf27a57d 100644
--- a/boost/graph/adjacency_matrix.hpp
+++ b/boost/graph/adjacency_matrix.hpp
@@ -21,6 +21,7 @@
#include <boost/graph/graph_mutability_traits.hpp>
#include <boost/graph/graph_selectors.hpp>
#include <boost/mpl/if.hpp>
+#include <boost/mpl/bool.hpp>
#include <boost/graph/adjacency_iterator.hpp>
#include <boost/graph/detail/edge.hpp>
#include <boost/iterator/iterator_adaptor.hpp>
@@ -29,7 +30,10 @@
#include <boost/graph/properties.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/static_assert.hpp>
-#include <boost/type_traits/ice.hpp>
+#include <boost/type_traits.hpp>
+#include <boost/property_map/property_map.hpp>
+#include <boost/property_map/transform_value_property_map.hpp>
+#include <boost/property_map/function_property_map.hpp>
namespace boost {
@@ -484,25 +488,14 @@ namespace boost {
BOOST_STATIC_ASSERT(!(is_same<Directed, bidirectionalS>::value));
#endif
-#if !defined(BOOST_GRAPH_NO_BUNDLED_PROPERTIES)
- typedef typename graph_detail::graph_prop<GraphProperty>::property graph_property_type;
- typedef typename graph_detail::graph_prop<GraphProperty>::bundle graph_bundled;
-
- typedef typename graph_detail::vertex_prop<VertexProperty>::property vertex_property_type;
- typedef typename graph_detail::vertex_prop<VertexProperty>::bundle vertex_bundled;
-
- typedef typename graph_detail::edge_prop<EdgeProperty>::property edge_property_type;
- typedef typename graph_detail::edge_prop<EdgeProperty>::bundle edge_bundled;
-#else
typedef GraphProperty graph_property_type;
- typedef no_graph_bundle graph_bundled;
+ typedef typename lookup_one_property<GraphProperty, graph_bundle_t>::type graph_bundled;
typedef VertexProperty vertex_property_type;
- typedef no_vertex_bundle vertex_bundled;
+ typedef typename lookup_one_property<VertexProperty, vertex_bundle_t>::type vertex_bundled;
typedef EdgeProperty edge_property_type;
- typedef no_edge_bundle edge_bundled;
-#endif
+ typedef typename lookup_one_property<EdgeProperty, edge_bundle_t>::type edge_bundled;
public: // should be private
typedef typename mpl::if_<typename has_property<edge_property_type>::type,
@@ -640,16 +633,16 @@ namespace boost {
#ifndef BOOST_GRAPH_NO_BUNDLED_PROPERTIES
// Directly access a vertex or edge bundle
vertex_bundled& operator[](vertex_descriptor v)
- { return get(vertex_bundle, *this)[v]; }
+ { return get(vertex_bundle, *this, v); }
const vertex_bundled& operator[](vertex_descriptor v) const
- { return get(vertex_bundle, *this)[v]; }
+ { return get(vertex_bundle, *this, v); }
edge_bundled& operator[](edge_descriptor e)
- { return get(edge_bundle, *this)[e]; }
+ { return get(edge_bundle, *this, e); }
const edge_bundled& operator[](edge_descriptor e) const
- { return get(edge_bundle, *this)[e]; }
+ { return get(edge_bundle, *this, e); }
graph_bundled& operator[](graph_bundle_t)
{ return get_property(*this); }
@@ -1035,326 +1028,211 @@ namespace boost {
//=========================================================================
// Functions required by the PropertyGraph concept
- // O(1)
- template <typename D, typename VP, typename EP, typename GP, typename A,
- typename Tag, typename Value>
- inline void
- set_property(adjacency_matrix<D,VP,EP,GP,A>& g, Tag, const Value& value)
- {
- get_property_value(g.m_property, Tag()) = value;
- }
-
template <typename D, typename VP, typename EP, typename GP, typename A,
- typename Tag>
- inline typename graph_property<adjacency_matrix<D,VP,EP,GP,A>, Tag>::type&
- get_property(adjacency_matrix<D,VP,EP,GP,A>& g, Tag)
- {
- return get_property_value(g.m_property, Tag());
- }
+ typename Prop, typename Kind>
+ struct adj_mat_pm_helper;
template <typename D, typename VP, typename EP, typename GP, typename A,
- typename Tag>
- inline const typename graph_property<adjacency_matrix<D,VP,EP,GP,A>, Tag>::type&
- get_property(const adjacency_matrix<D,VP,EP,GP,A>& g, Tag)
- {
- return get_property_value(g.m_property, Tag());
- }
+ typename Prop>
+ struct adj_mat_pm_helper<D, VP, EP, GP, A, Prop, vertex_property_tag> {
+ typedef typename graph_traits<adjacency_matrix<D, VP, EP, GP, A> >::vertex_descriptor arg_type;
+ typedef typed_identity_property_map<arg_type> vi_map_type;
+ typedef iterator_property_map<typename std::vector<VP>::iterator, vi_map_type> all_map_type;
+ typedef iterator_property_map<typename std::vector<VP>::const_iterator, vi_map_type> all_map_const_type;
+ typedef transform_value_property_map<
+ detail::lookup_one_property_f<VP, Prop>,
+ all_map_type>
+ type;
+ typedef transform_value_property_map<
+ detail::lookup_one_property_f<const VP, Prop>,
+ all_map_const_type>
+ const_type;
+ typedef typename property_traits<type>::reference single_nonconst_type;
+ typedef typename property_traits<const_type>::reference single_const_type;
+
+ static type get_nonconst(adjacency_matrix<D, VP, EP, GP, A>& g, Prop prop) {
+ return type(prop, all_map_type(g.m_vertex_properties.begin(), vi_map_type()));
+ }
- //=========================================================================
- // Vertex Property Map
+ static const_type get_const(const adjacency_matrix<D, VP, EP, GP, A>& g, Prop prop) {
+ return const_type(prop, all_map_const_type(g.m_vertex_properties.begin(), vi_map_type()));
+ }
- template <typename GraphPtr, typename Vertex, typename T, typename R,
- typename Tag>
- class adj_matrix_vertex_property_map
- : public put_get_helper<R,
- adj_matrix_vertex_property_map<GraphPtr, Vertex, T, R, Tag> >
- {
- public:
- typedef T value_type;
- typedef R reference;
- typedef Vertex key_type;
- typedef boost::lvalue_property_map_tag category;
- adj_matrix_vertex_property_map() { }
- adj_matrix_vertex_property_map(GraphPtr g) : m_g(g) { }
- inline reference operator[](key_type v) const {
- return get_property_value(m_g->m_vertex_properties[v], Tag());
+ static single_nonconst_type get_nonconst_one(adjacency_matrix<D, VP, EP, GP, A>& g, Prop prop, arg_type v) {
+ return lookup_one_property<VP, Prop>::lookup(g.m_vertex_properties[v], prop);
}
- GraphPtr m_g;
- };
- template <class Property, class Vertex>
- struct adj_matrix_vertex_id_map
- : public boost::put_get_helper<Vertex,
- adj_matrix_vertex_id_map<Property, Vertex> >
- {
- typedef Vertex value_type;
- typedef Vertex reference;
- typedef Vertex key_type;
- typedef boost::readable_property_map_tag category;
- adj_matrix_vertex_id_map() { }
- template <class Graph>
- inline adj_matrix_vertex_id_map(const Graph&) { }
- inline value_type operator[](key_type v) const { return v; }
+ static single_const_type get_const_one(const adjacency_matrix<D, VP, EP, GP, A>& g, Prop prop, arg_type v) {
+ return lookup_one_property<const VP, Prop>::lookup(g.m_vertex_properties[v], prop);
+ }
};
- namespace detail {
-
- struct adj_matrix_any_vertex_pa {
- template <class Tag, class Graph, class Property>
- struct bind_ {
- typedef typename property_value<Property,Tag>::type Value;
- typedef typename boost::graph_traits<Graph>::vertex_descriptor Vertex;
-
- typedef adj_matrix_vertex_property_map<Graph*, Vertex, Value, Value&,
- Tag> type;
- typedef adj_matrix_vertex_property_map<const Graph*, Vertex, Value,
- const Value&, Tag> const_type;
- };
- };
- struct adj_matrix_id_vertex_pa {
- template <class Tag, class Graph, class Property>
- struct bind_ {
- typedef typename Graph::vertex_descriptor Vertex;
- typedef adj_matrix_vertex_id_map<Property, Vertex> type;
- typedef adj_matrix_vertex_id_map<Property, Vertex> const_type;
- };
- };
-
- template <class Tag>
- struct adj_matrix_choose_vertex_pa_helper {
- typedef adj_matrix_any_vertex_pa type;
- };
- template <>
- struct adj_matrix_choose_vertex_pa_helper<vertex_index_t> {
- typedef adj_matrix_id_vertex_pa type;
- };
-
- template <class Tag, class Graph, class Property>
- struct adj_matrix_choose_vertex_pa {
- typedef typename adj_matrix_choose_vertex_pa_helper<Tag>::type Helper;
- typedef typename Helper::template bind_<Tag,Graph,Property> Bind;
- typedef typename Bind::type type;
- typedef typename Bind::const_type const_type;
- };
-
- struct adj_matrix_vertex_property_selector {
- template <class Graph, class Property, class Tag>
- struct bind_ {
- typedef adj_matrix_choose_vertex_pa<Tag,Graph,Property> Choice;
- typedef typename Choice::type type;
- typedef typename Choice::const_type const_type;
- };
+ template <typename D, typename VP, typename EP, typename GP, typename A,
+ typename Tag>
+ struct adj_mat_pm_helper<D, VP, EP, GP, A, Tag, edge_property_tag> {
+ typedef typename graph_traits<adjacency_matrix<D, VP, EP, GP, A> >::edge_descriptor edge_descriptor;
+
+ template <typename IsConst>
+ struct lookup_property_from_edge {
+ Tag tag;
+ lookup_property_from_edge(Tag tag): tag(tag) {}
+ typedef typename boost::mpl::if_<IsConst, const EP, EP>::type ep_type_nonref;
+ typedef ep_type_nonref& ep_type;
+ typedef typename lookup_one_property<ep_type_nonref, Tag>::type& result_type;
+ result_type operator()(edge_descriptor e) const {
+ return lookup_one_property<ep_type_nonref, Tag>::lookup(*static_cast<ep_type_nonref*>(e.get_property()), tag);
+ }
};
- } // namespace detail
-
- template <>
- struct vertex_property_selector<adjacency_matrix_class_tag> {
- typedef detail::adj_matrix_vertex_property_selector type;
- };
+ typedef function_property_map<
+ lookup_property_from_edge<boost::mpl::false_>,
+ typename graph_traits<adjacency_matrix<D, VP, EP, GP, A> >::edge_descriptor> type;
+ typedef function_property_map<
+ lookup_property_from_edge<boost::mpl::true_>,
+ typename graph_traits<adjacency_matrix<D, VP, EP, GP, A> >::edge_descriptor> const_type;
+ typedef edge_descriptor arg_type;
+ typedef typename lookup_property_from_edge<boost::mpl::false_>::result_type single_nonconst_type;
+ typedef typename lookup_property_from_edge<boost::mpl::true_>::result_type single_const_type;
+
+ static type get_nonconst(adjacency_matrix<D, VP, EP, GP, A>& g, Tag tag) {
+ return type(tag);
+ }
- //=========================================================================
- // Edge Property Map
+ static const_type get_const(const adjacency_matrix<D, VP, EP, GP, A>& g, Tag tag) {
+ return const_type(tag);
+ }
+ static single_nonconst_type get_nonconst_one(adjacency_matrix<D, VP, EP, GP, A>& g, Tag tag, edge_descriptor e) {
+ return lookup_one_property<EP, Tag>::lookup(*static_cast<EP*>(e.get_property()), tag);
+ }
- template <typename Directed, typename Property, typename Vertex,
- typename T, typename R, typename Tag>
- class adj_matrix_edge_property_map
- : public put_get_helper<R,
- adj_matrix_edge_property_map<Directed, Property, Vertex, T, R, Tag> >
- {
- public:
- typedef T value_type;
- typedef R reference;
- typedef detail::matrix_edge_desc_impl<Directed, Vertex> key_type;
- typedef boost::lvalue_property_map_tag category;
- inline reference operator[](key_type e) const {
- Property& p = *(Property*)e.get_property();
- return get_property_value(p, Tag());
+ static single_const_type get_const_one(const adjacency_matrix<D, VP, EP, GP, A>& g, Tag tag, edge_descriptor e) {
+ return lookup_one_property<const EP, Tag>::lookup(*static_cast<const EP*>(e.get_property()), tag);
}
};
- struct adj_matrix_edge_property_selector {
- template <class Graph, class Property, class Tag>
- struct bind_ {
- typedef typename property_value<Property,Tag>::type T;
- typedef typename Graph::vertex_descriptor Vertex;
- typedef adj_matrix_edge_property_map<typename Graph::directed_category,
- Property, Vertex, T, T&, Tag> type;
- typedef adj_matrix_edge_property_map<typename Graph::directed_category,
- Property, Vertex, T, const T&, Tag> const_type;
- };
- };
- template <>
- struct edge_property_selector<adjacency_matrix_class_tag> {
- typedef adj_matrix_edge_property_selector type;
- };
- //=========================================================================
- // Functions required by PropertyGraph
+ template <typename D, typename VP, typename EP, typename GP, typename A,
+ typename Tag>
+ struct property_map<adjacency_matrix<D,VP,EP,GP,A>, Tag>
+ : adj_mat_pm_helper<D, VP, EP, GP, A, Tag,
+ typename detail::property_kind_from_graph<adjacency_matrix<D, VP, EP, GP, A>, Tag>::type> {};
- namespace detail {
+ template <typename D, typename VP, typename EP, typename GP, typename A,
+ typename Tag>
+ typename property_map<adjacency_matrix<D, VP, EP, GP, A>, Tag>::type
+ get(Tag tag, adjacency_matrix<D, VP, EP, GP, A>& g) {
+ return property_map<adjacency_matrix<D, VP, EP, GP, A>, Tag>::get_nonconst(g, tag);
+ }
- template <typename Property, typename D, typename VP, typename EP,
- typename GP, typename A>
- typename boost::property_map<adjacency_matrix<D,VP,EP,GP,A>,
- Property>::type
- get_dispatch(adjacency_matrix<D,VP,EP,GP,A>& g, Property,
- vertex_property_tag)
- {
- typedef adjacency_matrix<D,VP,EP,GP,A> Graph;
- typedef typename boost::property_map<adjacency_matrix<D,VP,EP,GP,A>,
- Property>::type PA;
- return PA(&g);
- }
- template <typename Property, typename D, typename VP, typename EP,
- typename GP, typename A>
- typename boost::property_map<adjacency_matrix<D,VP,EP,GP,A>,
- Property>::type
- get_dispatch(adjacency_matrix<D,VP,EP,GP,A>&, Property,
- edge_property_tag)
- {
- typedef typename boost::property_map<adjacency_matrix<D,VP,EP,GP,A>,
- Property>::type PA;
- return PA();
- }
- template <typename Property, typename D, typename VP, typename EP,
- typename GP, typename A>
- typename boost::property_map<adjacency_matrix<D,VP,EP,GP,A>,
- Property>::const_type
- get_dispatch(const adjacency_matrix<D,VP,EP,GP,A>& g, Property,
- vertex_property_tag)
- {
- typedef adjacency_matrix<D,VP,EP,GP,A> Graph;
- typedef typename boost::property_map<adjacency_matrix<D,VP,EP,GP,A>,
- Property>::const_type PA;
- return PA(&g);
- }
- template <typename Property, typename D, typename VP, typename EP,
- typename GP, typename A>
- typename boost::property_map<adjacency_matrix<D,VP,EP,GP,A>,
- Property>::const_type
- get_dispatch(const adjacency_matrix<D,VP,EP,GP,A>&, Property,
- edge_property_tag)
- {
- typedef typename boost::property_map<adjacency_matrix<D,VP,EP,GP,A>,
- Property>::const_type PA;
- return PA();
- }
+ template <typename D, typename VP, typename EP, typename GP, typename A,
+ typename Tag>
+ typename property_map<adjacency_matrix<D, VP, EP, GP, A>, Tag>::const_type
+ get(Tag tag, const adjacency_matrix<D, VP, EP, GP, A>& g) {
+ return property_map<adjacency_matrix<D, VP, EP, GP, A>, Tag>::get_const(g, tag);
+ }
- } // namespace detail
+ template <typename D, typename VP, typename EP, typename GP, typename A,
+ typename Tag>
+ typename property_map<adjacency_matrix<D, VP, EP, GP, A>, Tag>::single_nonconst_type
+ get(Tag tag, adjacency_matrix<D, VP, EP, GP, A>& g, typename property_map<adjacency_matrix<D, VP, EP, GP, A>, Tag>::arg_type a) {
+ return property_map<adjacency_matrix<D, VP, EP, GP, A>, Tag>::get_nonconst_one(g, tag, a);
+ }
- template <typename Property, typename D, typename VP, typename EP,
- typename GP, typename A>
- inline
- typename property_map<adjacency_matrix<D,VP,EP,GP,A>, Property>::type
- get(Property p, adjacency_matrix<D,VP,EP,GP,A>& g)
- {
- typedef typename property_kind<Property>::type Kind;
- return detail::get_dispatch(g, p, Kind());
+ template <typename D, typename VP, typename EP, typename GP, typename A,
+ typename Tag>
+ typename property_map<adjacency_matrix<D, VP, EP, GP, A>, Tag>::single_const_type
+ get(Tag tag, const adjacency_matrix<D, VP, EP, GP, A>& g, typename property_map<adjacency_matrix<D, VP, EP, GP, A>, Tag>::arg_type a) {
+ return property_map<adjacency_matrix<D, VP, EP, GP, A>, Tag>::get_const_one(g, tag, a);
+ }
+
+ template <typename D, typename VP, typename EP, typename GP, typename A,
+ typename Tag>
+ void
+ put(Tag tag,
+ adjacency_matrix<D, VP, EP, GP, A>& g,
+ typename property_map<adjacency_matrix<D, VP, EP, GP, A>, Tag>::arg_type a,
+ typename property_map<adjacency_matrix<D, VP, EP, GP, A>, Tag>::single_const_type val) {
+ property_map<adjacency_matrix<D, VP, EP, GP, A>, Tag>::get_nonconst_one(g, tag, a) = val;
}
- template <typename Property, typename D, typename VP, typename EP,
- typename GP, typename A>
- inline
- typename property_map<adjacency_matrix<D,VP,EP,GP,A>, Property>::const_type
- get(Property p, const adjacency_matrix<D,VP,EP,GP,A>& g)
+ // O(1)
+ template <typename D, typename VP, typename EP, typename GP, typename A,
+ typename Tag, typename Value>
+ inline void
+ set_property(adjacency_matrix<D,VP,EP,GP,A>& g, Tag tag, const Value& value)
{
- typedef typename property_kind<Property>::type Kind;
- return detail::get_dispatch(g, p, Kind());
+ get_property_value(g.m_property, tag) = value;
}
- template <typename Property, typename D, typename VP, typename EP,
- typename GP, typename A, typename Key>
- inline
- typename property_traits<
- typename property_map<adjacency_matrix<D,VP,EP,GP,A>, Property>::const_type
- >::value_type
- get(Property p, const adjacency_matrix<D,VP,EP,GP,A>& g,
- const Key& key)
+ template <typename D, typename VP, typename EP, typename GP, typename A,
+ typename Tag>
+ inline typename graph_property<adjacency_matrix<D,VP,EP,GP,A>, Tag>::type&
+ get_property(adjacency_matrix<D,VP,EP,GP,A>& g, Tag tag)
{
- return get(get(p, g), key);
+ return get_property_value(g.m_property, tag);
}
- template <typename Property, typename D, typename VP, typename EP,
- typename GP, typename A, typename Key, typename Value>
- inline void
- put(Property p, adjacency_matrix<D,VP,EP,GP,A>& g,
- const Key& key, const Value& value)
+ template <typename D, typename VP, typename EP, typename GP, typename A,
+ typename Tag>
+ inline const typename graph_property<adjacency_matrix<D,VP,EP,GP,A>, Tag>::type&
+ get_property(const adjacency_matrix<D,VP,EP,GP,A>& g, Tag tag)
{
- typedef adjacency_matrix<D,VP,EP,GP,A> Graph;
- typedef typename boost::property_map<Graph, Property>::type Map;
- Map pmap = get(p, g);
- put(pmap, key, value);
+ return get_property_value(g.m_property, tag);
}
//=========================================================================
- // Other Functions
+ // Vertex Property Map
template <typename D, typename VP, typename EP, typename GP, typename A>
- typename adjacency_matrix<D,VP,EP,GP,A>::vertex_descriptor
- vertex(typename adjacency_matrix<D,VP,EP,GP,A>::vertices_size_type n,
- const adjacency_matrix<D,VP,EP,GP,A>&)
- {
- return n;
+ struct property_map<adjacency_matrix<D, VP, EP, GP, A>, vertex_index_t> {
+ typedef typename adjacency_matrix<D, VP, EP, GP, A>::vertex_descriptor Vertex;
+ typedef typed_identity_property_map<Vertex> type;
+ typedef type const_type;
+ };
+
+ template <typename D, typename VP, typename EP, typename GP, typename A>
+ typename property_map<adjacency_matrix<D, VP, EP, GP, A>, vertex_index_t>::const_type
+ get(vertex_index_t, adjacency_matrix<D, VP, EP, GP, A>&) {
+ return typename property_map<adjacency_matrix<D, VP, EP, GP, A>, vertex_index_t>::const_type();
}
- // Support for bundled properties
-#ifndef BOOST_GRAPH_NO_BUNDLED_PROPERTIES
- template <typename Directed, typename VertexProperty, typename EdgeProperty, typename GraphProperty,
- typename Allocator, typename T, typename Bundle>
- inline
- typename property_map<adjacency_matrix<Directed, VertexProperty, EdgeProperty, GraphProperty, Allocator>,
- T Bundle::*>::type
- get(T Bundle::* p, adjacency_matrix<Directed, VertexProperty, EdgeProperty, GraphProperty, Allocator>& g)
- {
- typedef typename property_map<adjacency_matrix<Directed, VertexProperty, EdgeProperty, GraphProperty, Allocator>,
- T Bundle::*>::type
- result_type;
- return result_type(&g, p);
+ template <typename D, typename VP, typename EP, typename GP, typename A>
+ typename adjacency_matrix<D, VP, EP, GP, A>::vertex_descriptor
+ get(vertex_index_t,
+ adjacency_matrix<D, VP, EP, GP, A>&,
+ typename adjacency_matrix<D, VP, EP, GP, A>::vertex_descriptor v) {
+ return v;
}
- template <typename Directed, typename VertexProperty, typename EdgeProperty, typename GraphProperty,
- typename Allocator, typename T, typename Bundle>
- inline
- typename property_map<adjacency_matrix<Directed, VertexProperty, EdgeProperty, GraphProperty, Allocator>,
- T Bundle::*>::const_type
- get(T Bundle::* p, adjacency_matrix<Directed, VertexProperty, EdgeProperty, GraphProperty, Allocator> const & g)
- {
- typedef typename property_map<adjacency_matrix<Directed, VertexProperty, EdgeProperty, GraphProperty, Allocator>,
- T Bundle::*>::const_type
- result_type;
- return result_type(&g, p);
+ template <typename D, typename VP, typename EP, typename GP, typename A>
+ typename property_map<adjacency_matrix<D, VP, EP, GP, A>, vertex_index_t>::const_type
+ get(vertex_index_t, const adjacency_matrix<D, VP, EP, GP, A>&) {
+ return typename property_map<adjacency_matrix<D, VP, EP, GP, A>, vertex_index_t>::const_type();
}
- template <typename Directed, typename VertexProperty, typename EdgeProperty, typename GraphProperty,
- typename Allocator, typename T, typename Bundle, typename Key>
- inline T
- get(T Bundle::* p, adjacency_matrix<Directed, VertexProperty, EdgeProperty, GraphProperty, Allocator> const & g,
- const Key& key)
- {
- return get(get(p, g), key);
+ template <typename D, typename VP, typename EP, typename GP, typename A>
+ typename adjacency_matrix<D, VP, EP, GP, A>::vertex_descriptor
+ get(vertex_index_t,
+ const adjacency_matrix<D, VP, EP, GP, A>&,
+ typename adjacency_matrix<D, VP, EP, GP, A>::vertex_descriptor v) {
+ return v;
}
- template <typename Directed, typename VertexProperty, typename EdgeProperty, typename GraphProperty,
- typename Allocator, typename T, typename Bundle, typename Key>
- inline void
- put(T Bundle::* p, adjacency_matrix<Directed, VertexProperty, EdgeProperty, GraphProperty, Allocator>& g,
- const Key& key, const T& value)
+ //=========================================================================
+ // Other Functions
+
+ template <typename D, typename VP, typename EP, typename GP, typename A>
+ typename adjacency_matrix<D,VP,EP,GP,A>::vertex_descriptor
+ vertex(typename adjacency_matrix<D,VP,EP,GP,A>::vertices_size_type n,
+ const adjacency_matrix<D,VP,EP,GP,A>&)
{
- put(get(p, g), key, value);
+ return n;
}
-#endif
-
-#define ADJMAT_PARAMS \
- typename D, typename VP, typename EP, typename GP, typename A
-#define ADJMAT adjacency_matrix<D,VP,EP,GP,A>
-template <ADJMAT_PARAMS>
-struct graph_mutability_traits<ADJMAT> {
- typedef mutable_edge_property_graph_tag category;
+template <typename D, typename VP, typename EP, typename GP, typename A>
+struct graph_mutability_traits<adjacency_matrix<D, VP, EP, GP, A> > {
+ typedef mutable_edge_property_graph_tag category;
};
-#undef ADJMAT_PARAMS
-#undef ADJMAT
} // namespace boost
diff --git a/boost/graph/astar_search.hpp b/boost/graph/astar_search.hpp
index 316e706390..132dca021c 100644
--- a/boost/graph/astar_search.hpp
+++ b/boost/graph/astar_search.hpp
@@ -158,6 +158,7 @@ namespace boost {
template <class Edge, class Graph>
void tree_edge(Edge e, const Graph& g) {
+ using boost::get;
m_decreased = relax(e, g, m_weight, m_predecessor, m_distance,
m_combine, m_compare);
@@ -173,6 +174,7 @@ namespace boost {
template <class Edge, class Graph>
void gray_target(Edge e, const Graph& g) {
+ using boost::get;
m_decreased = relax(e, g, m_weight, m_predecessor, m_distance,
m_combine, m_compare);
@@ -189,6 +191,7 @@ namespace boost {
template <class Edge, class Graph>
void black_target(Edge e, const Graph& g) {
+ using boost::get;
m_decreased = relax(e, g, m_weight, m_predecessor, m_distance,
m_combine, m_compare);
diff --git a/boost/graph/bellman_ford_shortest_paths.hpp b/boost/graph/bellman_ford_shortest_paths.hpp
index c80ebe7c7d..e102d92209 100644
--- a/boost/graph/bellman_ford_shortest_paths.hpp
+++ b/boost/graph/bellman_ford_shortest_paths.hpp
@@ -171,7 +171,7 @@ namespace boost {
bool
bellman_dispatch2
(VertexAndEdgeListGraph& g,
- detail::error_property_not_found,
+ param_not_found,
Size N, WeightMap weight, PredecessorMap pred, DistanceMap distance,
const bgl_named_params<P, T, R>& params)
{
diff --git a/boost/graph/betweenness_centrality.hpp b/boost/graph/betweenness_centrality.hpp
index 052f0633c1..a4de175330 100644
--- a/boost/graph/betweenness_centrality.hpp
+++ b/boost/graph/betweenness_centrality.hpp
@@ -498,14 +498,14 @@ namespace detail { namespace graph {
};
template<>
- struct brandes_betweenness_centrality_dispatch1<error_property_not_found>
+ struct brandes_betweenness_centrality_dispatch1<param_not_found>
{
template<typename Graph, typename CentralityMap,
typename EdgeCentralityMap, typename VertexIndexMap>
static void
run(const Graph& g, CentralityMap centrality,
EdgeCentralityMap edge_centrality_map, VertexIndexMap vertex_index,
- error_property_not_found)
+ param_not_found)
{
brandes_betweenness_centrality_dispatch2(g, centrality, edge_centrality_map,
vertex_index);
@@ -532,7 +532,7 @@ brandes_betweenness_centrality(const Graph& g,
{
typedef bgl_named_params<Param,Tag,Rest> named_params;
- typedef typename property_value<named_params, edge_weight_t>::type ew;
+ typedef typename get_param_type<edge_weight_t, named_params>::type ew;
detail::graph::brandes_betweenness_centrality_dispatch1<ew>::run(
g,
choose_param(get_param(params, vertex_centrality),
diff --git a/boost/graph/biconnected_components.hpp b/boost/graph/biconnected_components.hpp
index 9586f9a211..1669f69522 100644
--- a/boost/graph/biconnected_components.hpp
+++ b/boost/graph/biconnected_components.hpp
@@ -21,6 +21,7 @@
#include <boost/graph/depth_first_search.hpp>
#include <boost/graph/graph_utility.hpp>
#include <boost/concept/assert.hpp>
+#include <boost/assert.hpp>
namespace boost
{
@@ -28,17 +29,23 @@ namespace boost
{
template<typename ComponentMap, typename DiscoverTimeMap,
typename LowPointMap, typename PredecessorMap,
- typename OutputIterator, typename Stack,
+ typename OutputIterator, typename Stack,
+ typename ArticulationVector, typename IndexMap,
typename DFSVisitor>
struct biconnected_components_visitor : public dfs_visitor<>
{
biconnected_components_visitor
- (ComponentMap comp, std::size_t& c, DiscoverTimeMap dtm,
+ (ComponentMap comp, std::size_t& c,
+ std::size_t& children_of_root, DiscoverTimeMap dtm,
std::size_t& dfs_time, LowPointMap lowpt, PredecessorMap pred,
- OutputIterator out, Stack& S, DFSVisitor vis)
- : comp(comp), c(c), children_of_root(0), dtm(dtm),
- dfs_time(dfs_time), lowpt(lowpt),
- pred(pred), out(out), S(S), vis(vis) { }
+ OutputIterator out, Stack& S,
+ ArticulationVector& is_articulation_point, IndexMap index_map,
+ DFSVisitor vis)
+ : comp(comp), c(c), children_of_root(children_of_root),
+ dtm(dtm), dfs_time(dfs_time), lowpt(lowpt),
+ pred(pred), out(out), S(S),
+ is_articulation_point(is_articulation_point),
+ index_map(index_map), vis(vis) { }
template <typename Vertex, typename Graph>
void initialize_vertex(const Vertex& u, Graph& g)
@@ -89,8 +96,7 @@ namespace boost
typename boost::graph_traits<Graph>::vertex_descriptor src = source(e, g);
typename boost::graph_traits<Graph>::vertex_descriptor tgt = target(e, g);
- if ( ( tgt != get(pred, src) || get(pred, src) == src ) &&
- get(dtm, tgt) < get(dtm, src) ) {
+ if ( tgt != get(pred, src) ) {
S.push(e);
put(lowpt, src,
min BOOST_PREVENT_MACRO_SUBSTITUTION(get(lowpt, src),
@@ -111,40 +117,41 @@ namespace boost
BOOST_USING_STD_MIN();
Vertex parent = get(pred, u);
if (parent == u) { // Root of tree is special
- if (children_of_root >= 2) {
- *out++ = u;
- }
- return;
- }
- put(lowpt, parent,
- min BOOST_PREVENT_MACRO_SUBSTITUTION(get(lowpt, parent),
+ is_articulation_point[get(index_map, u)] = (children_of_root > 1);
+ } else {
+ put(lowpt, parent,
+ min BOOST_PREVENT_MACRO_SUBSTITUTION(get(lowpt, parent),
get(lowpt, u)));
- if ( get(lowpt, u) >= get(dtm, parent) ) {
- if ( get(pred, parent) != parent ) {
- *out++ = parent;
- }
- while ( get(dtm, source(S.top(), g)) >= get(dtm, u) ) {
+ if ( get(lowpt, u) >= get(dtm, parent) ) {
+ is_articulation_point[get(index_map, parent)] = true;
+ while ( get(dtm, source(S.top(), g)) >= get(dtm, u) ) {
+ put(comp, S.top(), c);
+ S.pop();
+ }
+ BOOST_ASSERT (source(S.top(), g) == parent);
+ BOOST_ASSERT (target(S.top(), g) == u);
put(comp, S.top(), c);
S.pop();
+ ++c;
}
- assert (source(S.top(), g) == parent);
- assert (target(S.top(), g) == u);
- put(comp, S.top(), c);
- S.pop();
- ++c;
+ }
+ if ( is_articulation_point[get(index_map, u)] ) {
+ *out++ = u;
}
vis.finish_vertex(u, g);
}
ComponentMap comp;
std::size_t& c;
- std::size_t children_of_root;
+ std::size_t& children_of_root;
DiscoverTimeMap dtm;
std::size_t& dfs_time;
LowPointMap lowpt;
PredecessorMap pred;
OutputIterator out;
Stack& S;
+ ArticulationVector& is_articulation_point;
+ IndexMap index_map;
DFSVisitor vis;
};
@@ -168,14 +175,16 @@ namespace boost
vertex_t> ));
std::size_t num_components = 0;
+ std::size_t children_of_root;
std::size_t dfs_time = 0;
- std::stack<edge_t> S;
+ std::stack<edge_t> S;
+ std::vector<char> is_articulation_point(num_vertices(g));
- biconnected_components_visitor<ComponentMap, DiscoverTimeMap,
- LowPointMap, PredecessorMap, OutputIterator, std::stack<edge_t>,
- DFSVisitor>
- vis(comp, num_components, dtm, dfs_time, lowpt, pred, out,
- S, dfs_vis);
+ biconnected_components_visitor<ComponentMap, DiscoverTimeMap,
+ LowPointMap, PredecessorMap, OutputIterator, std::stack<edge_t>,
+ std::vector<char>, VertexIndexMap, DFSVisitor>
+ vis(comp, num_components, children_of_root, dtm, dfs_time,
+ lowpt, pred, out, S, is_articulation_point, index_map, dfs_vis);
depth_first_search(g, visitor(vis).vertex_index_map(index_map));
@@ -201,7 +210,7 @@ namespace boost
};
template <>
- struct bicomp_dispatch3<error_property_not_found>
+ struct bicomp_dispatch3<param_not_found>
{
template<typename Graph, typename ComponentMap, typename OutputIterator,
typename VertexIndexMap, typename DiscoverTimeMap,
@@ -210,7 +219,7 @@ namespace boost
ComponentMap comp, OutputIterator out, VertexIndexMap index_map,
DiscoverTimeMap dtm, LowPointMap lowpt,
const bgl_named_params<P, T, R>& params,
- error_property_not_found)
+ param_not_found)
{
typedef typename graph_traits<Graph>::vertex_descriptor vertex_t;
std::vector<vertex_t> pred(num_vertices(g));
@@ -235,8 +244,7 @@ namespace boost
DiscoverTimeMap dtm, const bgl_named_params<P, T, R>& params,
LowPointMap lowpt)
{
- typedef typename property_value< bgl_named_params<P,T,R>,
- vertex_predecessor_t>::type dispatch_type;
+ typedef typename get_param_type< vertex_predecessor_t, bgl_named_params<P,T,R> >::type dispatch_type;
return bicomp_dispatch3<dispatch_type>::apply
(g, comp, out, index_map, dtm, lowpt, params,
@@ -246,7 +254,7 @@ namespace boost
template <>
- struct bicomp_dispatch2<error_property_not_found>
+ struct bicomp_dispatch2<param_not_found>
{
template<typename Graph, typename ComponentMap, typename OutputIterator,
typename VertexIndexMap, typename DiscoverTimeMap,
@@ -254,15 +262,14 @@ namespace boost
static std::pair<std::size_t, OutputIterator> apply (const Graph& g,
ComponentMap comp, OutputIterator out, VertexIndexMap index_map,
DiscoverTimeMap dtm, const bgl_named_params<P, T, R>& params,
- error_property_not_found)
+ param_not_found)
{
typedef typename graph_traits<Graph>::vertices_size_type
vertices_size_type;
std::vector<vertices_size_type> lowpt(num_vertices(g));
vertices_size_type vst(0);
- typedef typename property_value< bgl_named_params<P,T,R>,
- vertex_predecessor_t>::type dispatch_type;
+ typedef typename get_param_type< vertex_predecessor_t, bgl_named_params<P,T,R> >::type dispatch_type;
return bicomp_dispatch3<dispatch_type>::apply
(g, comp, out, index_map, dtm,
@@ -280,8 +287,7 @@ namespace boost
ComponentMap comp, OutputIterator out, VertexIndexMap index_map,
const bgl_named_params<P, T, R>& params, DiscoverTimeMap dtm)
{
- typedef typename property_value< bgl_named_params<P,T,R>,
- vertex_lowpoint_t>::type dispatch_type;
+ typedef typename get_param_type< vertex_lowpoint_t, bgl_named_params<P,T,R> >::type dispatch_type;
return bicomp_dispatch2<dispatch_type>::apply
(g, comp, out, index_map, dtm, params,
@@ -290,21 +296,20 @@ namespace boost
};
template <>
- struct bicomp_dispatch1<error_property_not_found>
+ struct bicomp_dispatch1<param_not_found>
{
template<typename Graph, typename ComponentMap, typename OutputIterator,
typename VertexIndexMap, class P, class T, class R>
static std::pair<std::size_t, OutputIterator> apply(const Graph& g,
ComponentMap comp, OutputIterator out, VertexIndexMap index_map,
- const bgl_named_params<P, T, R>& params, error_property_not_found)
+ const bgl_named_params<P, T, R>& params, param_not_found)
{
typedef typename graph_traits<Graph>::vertices_size_type
vertices_size_type;
std::vector<vertices_size_type> discover_time(num_vertices(g));
vertices_size_type vst(0);
- typedef typename property_value< bgl_named_params<P,T,R>,
- vertex_lowpoint_t>::type dispatch_type;
+ typedef typename get_param_type< vertex_lowpoint_t, bgl_named_params<P,T,R> >::type dispatch_type;
return bicomp_dispatch2<dispatch_type>::apply
(g, comp, out, index_map,
@@ -321,14 +326,14 @@ namespace boost
biconnected_components(const Graph& g, ComponentMap comp,
OutputIterator out, DiscoverTimeMap dtm, LowPointMap lowpt)
{
- typedef detail::error_property_not_found dispatch_type;
+ typedef param_not_found dispatch_type;
return detail::bicomp_dispatch3<dispatch_type>::apply
(g, comp, out,
get(vertex_index, g),
dtm, lowpt,
bgl_named_params<int, buffer_param_t>(0),
- detail::error_property_not_found());
+ param_not_found());
}
template <typename Graph, typename ComponentMap, typename OutputIterator,
@@ -337,8 +342,7 @@ namespace boost
biconnected_components(const Graph& g, ComponentMap comp, OutputIterator out,
const bgl_named_params<P, T, R>& params)
{
- typedef typename property_value< bgl_named_params<P,T,R>,
- vertex_discover_time_t>::type dispatch_type;
+ typedef typename get_param_type< vertex_discover_time_t, bgl_named_params<P,T,R> >::type dispatch_type;
return detail::bicomp_dispatch1<dispatch_type>::apply(g, comp, out,
choose_const_pmap(get_param(params, vertex_index), g, vertex_index),
diff --git a/boost/graph/breadth_first_search.hpp b/boost/graph/breadth_first_search.hpp
index f65e47572a..18bc24f5cf 100644
--- a/boost/graph/breadth_first_search.hpp
+++ b/boost/graph/breadth_first_search.hpp
@@ -53,11 +53,12 @@ namespace boost {
};
+ // Multiple-source version
template <class IncidenceGraph, class Buffer, class BFSVisitor,
- class ColorMap>
+ class ColorMap, class SourceIterator>
void breadth_first_visit
(const IncidenceGraph& g,
- typename graph_traits<IncidenceGraph>::vertex_descriptor s,
+ SourceIterator sources_begin, SourceIterator sources_end,
Buffer& Q, BFSVisitor vis, ColorMap color)
{
BOOST_CONCEPT_ASSERT(( IncidenceGraphConcept<IncidenceGraph> ));
@@ -70,8 +71,11 @@ namespace boost {
typedef color_traits<ColorValue> Color;
typename GTraits::out_edge_iterator ei, ei_end;
- put(color, s, Color::gray()); vis.discover_vertex(s, g);
- Q.push(s);
+ for (; sources_begin != sources_end; ++sources_begin) {
+ Vertex s = *sources_begin;
+ put(color, s, Color::gray()); vis.discover_vertex(s, g);
+ Q.push(s);
+ }
while (! Q.empty()) {
Vertex u = Q.top(); Q.pop(); vis.examine_vertex(u, g);
for (boost::tie(ei, ei_end) = out_edges(u, g); ei != ei_end; ++ei) {
@@ -89,12 +93,25 @@ namespace boost {
} // end while
} // breadth_first_visit
+ // Single-source version
+ template <class IncidenceGraph, class Buffer, class BFSVisitor,
+ class ColorMap>
+ void breadth_first_visit
+ (const IncidenceGraph& g,
+ typename graph_traits<IncidenceGraph>::vertex_descriptor s,
+ Buffer& Q, BFSVisitor vis, ColorMap color)
+ {
+ typename graph_traits<IncidenceGraph>::vertex_descriptor sources[1] = {s};
+ breadth_first_visit(g, sources, sources + 1, Q, vis, color);
+ }
+
- template <class VertexListGraph, class Buffer, class BFSVisitor,
+ template <class VertexListGraph, class SourceIterator,
+ class Buffer, class BFSVisitor,
class ColorMap>
void breadth_first_search
(const VertexListGraph& g,
- typename graph_traits<VertexListGraph>::vertex_descriptor s,
+ SourceIterator sources_begin, SourceIterator sources_end,
Buffer& Q, BFSVisitor vis, ColorMap color)
{
// Initialization
@@ -105,7 +122,18 @@ namespace boost {
vis.initialize_vertex(*i, g);
put(color, *i, Color::white());
}
- breadth_first_visit(g, s, Q, vis, color);
+ breadth_first_visit(g, sources_begin, sources_end, Q, vis, color);
+ }
+
+ template <class VertexListGraph, class Buffer, class BFSVisitor,
+ class ColorMap>
+ void breadth_first_search
+ (const VertexListGraph& g,
+ typename graph_traits<VertexListGraph>::vertex_descriptor s,
+ Buffer& Q, BFSVisitor vis, ColorMap color)
+ {
+ typename graph_traits<VertexListGraph>::vertex_descriptor sources[1] = {s};
+ breadth_first_search(g, sources, sources + 1, Q, vis, color);
}
namespace graph { struct bfs_visitor_event_not_overridden {}; }
@@ -270,13 +298,13 @@ namespace boost {
};
template <>
- struct bfs_dispatch<detail::error_property_not_found> {
+ struct bfs_dispatch<param_not_found> {
template <class VertexListGraph, class P, class T, class R>
static void apply
(VertexListGraph& g,
typename graph_traits<VertexListGraph>::vertex_descriptor s,
const bgl_named_params<P, T, R>& params,
- detail::error_property_not_found)
+ param_not_found)
{
null_visitor null_vis;
@@ -294,7 +322,7 @@ namespace boost {
} // namespace detail
-
+#if 1
// Named Parameter Variant
template <class VertexListGraph, class P, class T, class R>
void breadth_first_search
@@ -307,11 +335,11 @@ namespace boost {
// graph is not really const since we may write to property maps
// of the graph.
VertexListGraph& ng = const_cast<VertexListGraph&>(g);
- typedef typename property_value< bgl_named_params<P,T,R>,
- vertex_color_t>::type C;
+ typedef typename get_param_type< vertex_color_t, bgl_named_params<P,T,R> >::type C;
detail::bfs_dispatch<C>::apply(ng, s, params,
get_param(params, vertex_color));
}
+#endif
// This version does not initialize colors, user has to.
@@ -343,6 +371,33 @@ namespace boost {
);
}
+ namespace graph {
+ namespace detail {
+ template <typename Graph, typename Source>
+ struct breadth_first_search_impl {
+ typedef void result_type;
+ template <typename ArgPack>
+ void operator()(const Graph& g, const Source& source, const ArgPack& arg_pack) {
+ using namespace boost::graph::keywords;
+ typename boost::graph_traits<Graph>::vertex_descriptor sources[1] = {source};
+ boost::queue<typename boost::graph_traits<Graph>::vertex_descriptor> Q;
+ boost::breadth_first_search(g,
+ &sources[0],
+ &sources[1],
+ boost::unwrap_ref(arg_pack[_buffer | boost::ref(Q)]),
+ arg_pack[_visitor | make_bfs_visitor(null_visitor())],
+ boost::detail::make_color_map_from_arg_pack(g, arg_pack));
+ }
+ };
+ }
+ BOOST_GRAPH_MAKE_FORWARDING_FUNCTION(breadth_first_search, 2, 4)
+ }
+
+#if 0
+ // Named Parameter Variant
+ BOOST_GRAPH_MAKE_OLD_STYLE_PARAMETER_FUNCTION(breadth_first_search, 2)
+#endif
+
} // namespace boost
#ifdef BOOST_GRAPH_USE_MPI
diff --git a/boost/graph/bron_kerbosch_all_cliques.hpp b/boost/graph/bron_kerbosch_all_cliques.hpp
index 1466dfe5f0..b663cf95f0 100644
--- a/boost/graph/bron_kerbosch_all_cliques.hpp
+++ b/boost/graph/bron_kerbosch_all_cliques.hpp
@@ -224,7 +224,7 @@ namespace detail
// otherwise, iterate over candidates and and test
// for maxmimal cliquiness.
- typename Container::iterator i, j, end = cands.end();
+ typename Container::iterator i, j;
for(i = cands.begin(); i != cands.end(); ) {
Vertex candidate = *i;
@@ -270,7 +270,6 @@ bron_kerbosch_all_cliques(const Graph& g, Visitor vis, std::size_t min)
{
BOOST_CONCEPT_ASSERT(( IncidenceGraphConcept<Graph> ));
BOOST_CONCEPT_ASSERT(( VertexListGraphConcept<Graph> ));
- BOOST_CONCEPT_ASSERT(( VertexIndexGraphConcept<Graph> ));
BOOST_CONCEPT_ASSERT(( AdjacencyMatrixConcept<Graph> )); // Structural requirement only
typedef typename graph_traits<Graph>::vertex_descriptor Vertex;
typedef typename graph_traits<Graph>::vertex_iterator VertexIterator;
diff --git a/boost/graph/chrobak_payne_drawing.hpp b/boost/graph/chrobak_payne_drawing.hpp
index ef6ae5c9c6..4d026986c2 100644
--- a/boost/graph/chrobak_payne_drawing.hpp
+++ b/boost/graph/chrobak_payne_drawing.hpp
@@ -13,7 +13,6 @@
#include <list>
#include <stack>
#include <boost/config.hpp>
-#include <boost/utility.hpp> //for next and prior
#include <boost/graph/graph_traits.hpp>
#include <boost/property_map/property_map.hpp>
diff --git a/boost/graph/clustering_coefficient.hpp b/boost/graph/clustering_coefficient.hpp
index dad4695a77..5345ed999a 100644
--- a/boost/graph/clustering_coefficient.hpp
+++ b/boost/graph/clustering_coefficient.hpp
@@ -7,7 +7,7 @@
#ifndef BOOST_GRAPH_CLUSTERING_COEFFICIENT_HPP
#define BOOST_GRAPH_CLUSTERING_COEFFICIENT_HPP
-#include <boost/utility.hpp>
+#include <boost/next_prior.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/graph_concepts.hpp>
#include <boost/graph/lookup_edge.hpp>
diff --git a/boost/graph/compressed_sparse_row_graph.hpp b/boost/graph/compressed_sparse_row_graph.hpp
index caa27a9060..59e8bb4aba 100644
--- a/boost/graph/compressed_sparse_row_graph.hpp
+++ b/boost/graph/compressed_sparse_row_graph.hpp
@@ -41,12 +41,9 @@
#include <boost/graph/properties.hpp>
#include <boost/static_assert.hpp>
#include <boost/functional/hash.hpp>
-#include <boost/utility.hpp>
-
-#ifdef BOOST_GRAPH_NO_BUNDLED_PROPERTIES
-# error The Compressed Sparse Row graph only supports bundled properties.
-# error You will need a compiler that conforms better to the C++ standard.
-#endif
+#include <boost/next_prior.hpp>
+#include <boost/property_map/transform_value_property_map.hpp>
+#include <boost/mpl/print.hpp>
namespace boost {
@@ -195,8 +192,8 @@ class compressed_sparse_row_graph<directedS, VertexProperty, EdgeProperty, Graph
public:
// For Property Graph
- typedef typename graph_detail::graph_prop<GraphProperty>::property graph_property_type;
- typedef typename graph_detail::graph_prop<GraphProperty>::bundle graph_bundled;
+ typedef GraphProperty graph_property_type;
+ typedef typename lookup_one_property<GraphProperty, graph_bundle_t>::type graph_bundled;
typedef detail::compressed_sparse_row_structure<EdgeProperty, Vertex, EdgeIndex> forward_type;
@@ -746,8 +743,8 @@ class compressed_sparse_row_graph<bidirectionalS, VertexProperty, EdgeProperty,
public:
// For Property Graph
- typedef typename graph_detail::graph_prop<GraphProperty>::property graph_property_type;
- typedef typename graph_detail::graph_prop<GraphProperty>::bundle graph_bundled;
+ typedef GraphProperty graph_property_type;
+ typedef typename lookup_one_property<GraphProperty, graph_bundle_t>::type graph_bundled;
// typedef GraphProperty graph_property_type;
typedef detail::compressed_sparse_row_structure<EdgeProperty, Vertex, EdgeIndex> forward_type;
@@ -933,6 +930,7 @@ class compressed_sparse_row_graph<bidirectionalS, VertexProperty, EdgeProperty,
{
m_forward.assign(g, vi, numverts, numedges);
inherited_vertex_properties::resize(numverts);
+ set_up_backward_property_links();
}
// Requires the above, plus VertexListGraph and EdgeListGraph
@@ -946,6 +944,7 @@ class compressed_sparse_row_graph<bidirectionalS, VertexProperty, EdgeProperty,
vertices_size_type numverts = num_vertices(g);
m_forward.assign(g, vi, numverts, numedges);
inherited_vertex_properties::resize(numverts);
+ set_up_backward_property_links();
}
// Requires the above, plus a vertex_index map.
@@ -959,125 +958,7 @@ class compressed_sparse_row_graph<bidirectionalS, VertexProperty, EdgeProperty,
vertices_size_type numverts = num_vertices(g);
m_forward.assign(g, get(vertex_index, g), numverts, numedges);
inherited_vertex_properties::resize(numverts);
- }
-
- // Add edges from a sorted (smallest sources first) range of pairs and edge
- // properties
- template <typename BidirectionalIteratorOrig, typename EPIterOrig,
- typename GlobalToLocal>
- void
- add_edges_sorted_internal(
- BidirectionalIteratorOrig first_sorted,
- BidirectionalIteratorOrig last_sorted,
- EPIterOrig ep_iter_sorted,
- const GlobalToLocal& global_to_local) {
- m_forward.add_edges_sorted_internal(first_sorted, last_sorted, ep_iter_sorted, global_to_local);
- }
-
- template <typename BidirectionalIteratorOrig, typename EPIterOrig>
- void
- add_edges_sorted_internal(
- BidirectionalIteratorOrig first_sorted,
- BidirectionalIteratorOrig last_sorted,
- EPIterOrig ep_iter_sorted) {
- m_forward.add_edges_sorted_internal(first_sorted, last_sorted, ep_iter_sorted, typed_identity_property_map<Vertex>());
- }
-
- // Add edges from a sorted (smallest sources first) range of pairs
- template <typename BidirectionalIteratorOrig>
- void
- add_edges_sorted_internal(
- BidirectionalIteratorOrig first_sorted,
- BidirectionalIteratorOrig last_sorted) {
- m_forward.add_edges_sorted_internal(first_sorted, last_sorted, detail::default_construct_iterator<edge_bundled>());
- }
-
- template <typename BidirectionalIteratorOrig, typename GlobalToLocal>
- void
- add_edges_sorted_internal_global(
- BidirectionalIteratorOrig first_sorted,
- BidirectionalIteratorOrig last_sorted,
- const GlobalToLocal& global_to_local) {
- m_forward.add_edges_sorted_internal(first_sorted, last_sorted, detail::default_construct_iterator<edge_bundled>(), global_to_local);
- }
-
- template <typename BidirectionalIteratorOrig, typename EPIterOrig,
- typename GlobalToLocal>
- void
- add_edges_sorted_internal_global(
- BidirectionalIteratorOrig first_sorted,
- BidirectionalIteratorOrig last_sorted,
- EPIterOrig ep_iter_sorted,
- const GlobalToLocal& global_to_local) {
- m_forward.add_edges_sorted_internal(first_sorted, last_sorted, ep_iter_sorted, global_to_local);
- }
-
- // Add edges from a range of (source, target) pairs that are unsorted
- template <typename InputIterator, typename GlobalToLocal>
- inline void
- add_edges_internal(InputIterator first, InputIterator last,
- const GlobalToLocal& global_to_local) {
- typedef compressed_sparse_row_graph Graph;
- typedef typename boost::graph_traits<Graph>::vertex_descriptor vertex_t;
- typedef typename boost::graph_traits<Graph>::vertices_size_type vertex_num;
- typedef typename boost::graph_traits<Graph>::edges_size_type edge_num;
- typedef std::vector<std::pair<vertex_t, vertex_t> > edge_vector_t;
- edge_vector_t new_edges(first, last);
- if (new_edges.empty()) return;
- std::sort(new_edges.begin(), new_edges.end());
- this->add_edges_sorted_internal_global(new_edges.begin(), new_edges.end(), global_to_local);
- }
-
- template <typename InputIterator>
- inline void
- add_edges_internal(InputIterator first, InputIterator last) {
- this->add_edges_internal(first, last, typed_identity_property_map<Vertex>());
- }
-
- // Add edges from a range of (source, target) pairs and edge properties that
- // are unsorted
- template <typename InputIterator, typename EPIterator, typename GlobalToLocal>
- inline void
- add_edges_internal(InputIterator first, InputIterator last,
- EPIterator ep_iter, EPIterator ep_iter_end,
- const GlobalToLocal& global_to_local) {
- typedef compressed_sparse_row_graph Graph;
- typedef typename boost::graph_traits<Graph>::vertex_descriptor vertex_t;
- typedef typename boost::graph_traits<Graph>::vertices_size_type vertex_num;
- typedef typename boost::graph_traits<Graph>::edges_size_type edge_num;
- typedef std::pair<vertex_t, vertex_t> vertex_pair;
- typedef std::vector<
- boost::tuple<vertex_pair,
- edge_bundled> >
- edge_vector_t;
- edge_vector_t new_edges
- (boost::make_zip_iterator(boost::make_tuple(first, ep_iter)),
- boost::make_zip_iterator(boost::make_tuple(last, ep_iter_end)));
- if (new_edges.empty()) return;
- std::sort(new_edges.begin(), new_edges.end(),
- boost::detail::compare_first<
- std::less<vertex_pair> >());
- m_forward.add_edges_sorted_internal
- (boost::make_transform_iterator(
- new_edges.begin(),
- boost::detail::my_tuple_get_class<0, vertex_pair>()),
- boost::make_transform_iterator(
- new_edges.end(),
- boost::detail::my_tuple_get_class<0, vertex_pair>()),
- boost::make_transform_iterator(
- new_edges.begin(),
- boost::detail::my_tuple_get_class
- <1, edge_bundled>()),
- global_to_local);
- }
-
- // Add edges from a range of (source, target) pairs and edge properties that
- // are unsorted
- template <typename InputIterator, typename EPIterator>
- inline void
- add_edges_internal(InputIterator first, InputIterator last,
- EPIterator ep_iter, EPIterator ep_iter_end) {
- this->add_edges_internal(first, last, ep_iter, ep_iter_end, typed_identity_property_map<Vertex>());
+ set_up_backward_property_links();
}
using inherited_vertex_properties::operator[];
@@ -1134,7 +1015,6 @@ add_vertices(typename BOOST_DIR_CSR_GRAPH_TYPE::vertices_size_type count, BOOST_
Vertex old_num_verts_plus_one = g.m_forward.m_rowstart.size();
EdgeIndex numedges = g.m_forward.m_rowstart.back();
g.m_forward.m_rowstart.resize(old_num_verts_plus_one + count, numedges);
- g.m_backward.m_rowstart.resize(old_num_verts_plus_one + count, numedges);
g.vertex_properties().resize(num_vertices(g));
return old_num_verts_plus_one - 1;
}
@@ -1383,26 +1263,110 @@ edges(const BOOST_CSR_GRAPH_TYPE& g)
// Graph properties
template<BOOST_CSR_GRAPH_TEMPLATE_PARMS, class Tag, class Value>
inline void
-set_property(BOOST_CSR_GRAPH_TYPE& g, Tag, const Value& value)
+set_property(BOOST_CSR_GRAPH_TYPE& g, Tag tag, const Value& value)
{
- get_property_value(g.m_property, Tag()) = value;
+ get_property_value(g.m_property, tag) = value;
}
template<BOOST_CSR_GRAPH_TEMPLATE_PARMS, class Tag>
inline
typename graph_property<BOOST_CSR_GRAPH_TYPE, Tag>::type&
-get_property(BOOST_CSR_GRAPH_TYPE& g, Tag)
+get_property(BOOST_CSR_GRAPH_TYPE& g, Tag tag)
{
- return get_property_value(g.m_property, Tag());
+ return get_property_value(g.m_property, tag);
}
template<BOOST_CSR_GRAPH_TEMPLATE_PARMS, class Tag>
inline
const
typename graph_property<BOOST_CSR_GRAPH_TYPE, Tag>::type&
-get_property(const BOOST_CSR_GRAPH_TYPE& g, Tag)
+get_property(const BOOST_CSR_GRAPH_TYPE& g, Tag tag)
{
- return get_property_value(g.m_property, Tag());
+ return get_property_value(g.m_property, tag);
+}
+
+template <typename G, typename Tag, typename Kind>
+struct csr_property_map_helper {};
+// Kind == void for invalid property tags, so we can use that to SFINAE out
+
+template <BOOST_CSR_GRAPH_TEMPLATE_PARMS, typename Tag>
+struct csr_property_map_helper<BOOST_CSR_GRAPH_TYPE, Tag, vertex_property_tag> {
+ typedef vertex_all_t all_tag;
+ typedef typename property_traits<typename property_map<BOOST_CSR_GRAPH_TYPE, vertex_all_t>::type>::key_type key_type;
+ typedef VertexProperty plist_type;
+ typedef typename property_map<BOOST_CSR_GRAPH_TYPE, vertex_all_t>::type all_type;
+ typedef typename property_map<BOOST_CSR_GRAPH_TYPE, vertex_all_t>::const_type all_const_type;
+ typedef transform_value_property_map<detail::lookup_one_property_f<plist_type, Tag>, all_type> type;
+ typedef transform_value_property_map<detail::lookup_one_property_f<const plist_type, Tag>, all_const_type> const_type;
+};
+
+template <BOOST_CSR_GRAPH_TEMPLATE_PARMS, typename Tag>
+struct csr_property_map_helper<BOOST_CSR_GRAPH_TYPE, Tag, edge_property_tag> {
+ typedef edge_all_t all_tag;
+ typedef typename property_traits<typename property_map<BOOST_CSR_GRAPH_TYPE, edge_all_t>::type>::key_type key_type;
+ typedef EdgeProperty plist_type;
+ typedef typename property_map<BOOST_CSR_GRAPH_TYPE, edge_all_t>::type all_type;
+ typedef typename property_map<BOOST_CSR_GRAPH_TYPE, edge_all_t>::const_type all_const_type;
+ typedef transform_value_property_map<detail::lookup_one_property_f<plist_type, Tag>, all_type> type;
+ typedef transform_value_property_map<detail::lookup_one_property_f<const plist_type, Tag>, all_const_type> const_type;
+};
+
+template <BOOST_CSR_GRAPH_TEMPLATE_PARMS, typename Tag>
+struct csr_property_map_helper<BOOST_CSR_GRAPH_TYPE, Tag, graph_property_tag> {
+ typedef graph_all_t all_tag;
+ typedef BOOST_CSR_GRAPH_TYPE* key_type;
+ typedef GraphProperty plist_type;
+ typedef typename property_map<BOOST_CSR_GRAPH_TYPE, graph_all_t>::type all_type;
+ typedef typename property_map<BOOST_CSR_GRAPH_TYPE, graph_all_t>::const_type all_const_type;
+ typedef transform_value_property_map<detail::lookup_one_property_f<plist_type, Tag>, all_type> type;
+ typedef transform_value_property_map<detail::lookup_one_property_f<const plist_type, Tag>, all_const_type> const_type;
+};
+
+template <BOOST_CSR_GRAPH_TEMPLATE_PARMS, typename Tag>
+struct property_map<BOOST_CSR_GRAPH_TYPE, Tag>:
+ csr_property_map_helper<
+ BOOST_CSR_GRAPH_TYPE,
+ Tag,
+ typename detail::property_kind_from_graph<BOOST_CSR_GRAPH_TYPE, Tag>
+ ::type> {};
+
+template <BOOST_CSR_GRAPH_TEMPLATE_PARMS, typename Tag>
+typename property_map<BOOST_CSR_GRAPH_TYPE, Tag>::type
+get(Tag tag, BOOST_CSR_GRAPH_TYPE& g) {
+ return typename property_map<BOOST_CSR_GRAPH_TYPE, Tag>::type(tag, get(typename property_map<BOOST_CSR_GRAPH_TYPE, Tag>::all_tag(), g));
+}
+
+template <BOOST_CSR_GRAPH_TEMPLATE_PARMS, typename Tag>
+typename property_map<BOOST_CSR_GRAPH_TYPE, Tag>::const_type
+get(Tag tag, const BOOST_CSR_GRAPH_TYPE& g) {
+ return typename property_map<BOOST_CSR_GRAPH_TYPE, Tag>::const_type(tag, get(typename property_map<BOOST_CSR_GRAPH_TYPE, Tag>::all_tag(), g));
+}
+
+template <BOOST_CSR_GRAPH_TEMPLATE_PARMS, typename Tag>
+typename property_traits<typename property_map<BOOST_CSR_GRAPH_TYPE, Tag>::type>::reference
+get(Tag tag, BOOST_CSR_GRAPH_TYPE& g, typename property_map<BOOST_CSR_GRAPH_TYPE, Tag>::key_type k) {
+ typedef typename property_map<BOOST_CSR_GRAPH_TYPE, Tag>::all_tag all_tag;
+ typedef typename property_map<BOOST_CSR_GRAPH_TYPE, all_tag>::type outer_pm;
+ return lookup_one_property<typename property_traits<outer_pm>::value_type, Tag>::lookup(get(all_tag(), g, k), tag);
+}
+
+template <BOOST_CSR_GRAPH_TEMPLATE_PARMS, typename Tag>
+typename property_traits<typename property_map<BOOST_CSR_GRAPH_TYPE, Tag>::const_type>::reference
+get(Tag tag, const BOOST_CSR_GRAPH_TYPE& g, typename property_map<BOOST_CSR_GRAPH_TYPE, Tag>::key_type k) {
+ typedef typename property_map<BOOST_CSR_GRAPH_TYPE, Tag>::all_tag all_tag;
+ typedef typename property_map<BOOST_CSR_GRAPH_TYPE, all_tag>::const_type outer_pm;
+ return lookup_one_property<const typename property_traits<outer_pm>::value_type, Tag>::lookup(get(all_tag(), g, k), tag);
+}
+
+template <BOOST_CSR_GRAPH_TEMPLATE_PARMS, typename Tag>
+void
+put(Tag tag,
+ BOOST_CSR_GRAPH_TYPE& g,
+ typename property_map<BOOST_CSR_GRAPH_TYPE, Tag>::key_type k,
+ typename lookup_one_property<typename property_map<BOOST_CSR_GRAPH_TYPE, Tag>::plist_type, Tag>::type val) {
+ typedef typename property_map<BOOST_CSR_GRAPH_TYPE, Tag>::all_tag all_tag;
+ typedef typename property_map<BOOST_CSR_GRAPH_TYPE, all_tag>::type outer_pm;
+ lookup_one_property<typename property_map<BOOST_CSR_GRAPH_TYPE, Tag>::plist_type, Tag>::lookup(get(all_tag(), g, k), tag) = val;
}
template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
@@ -1420,20 +1384,27 @@ struct property_map<BOOST_CSR_GRAPH_TYPE, edge_index_t>
};
template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
-struct property_map<BOOST_CSR_GRAPH_TYPE, vertex_bundle_t>
+struct property_map<BOOST_CSR_GRAPH_TYPE, vertex_all_t>
{
typedef typename BOOST_CSR_GRAPH_TYPE::inherited_vertex_properties::vertex_map_type type;
typedef typename BOOST_CSR_GRAPH_TYPE::inherited_vertex_properties::const_vertex_map_type const_type;
};
template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
-struct property_map<BOOST_CSR_GRAPH_TYPE, edge_bundle_t>
+struct property_map<BOOST_CSR_GRAPH_TYPE, edge_all_t>
{
typedef typename BOOST_CSR_GRAPH_TYPE::forward_type::inherited_edge_properties::edge_map_type type;
typedef typename BOOST_CSR_GRAPH_TYPE::forward_type::inherited_edge_properties::const_edge_map_type const_type;
};
template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
+struct property_map<BOOST_CSR_GRAPH_TYPE, graph_all_t>
+{
+ typedef boost::ref_property_map<BOOST_CSR_GRAPH_TYPE*, typename BOOST_CSR_GRAPH_TYPE::graph_property_type> type;
+ typedef boost::ref_property_map<BOOST_CSR_GRAPH_TYPE*, const typename BOOST_CSR_GRAPH_TYPE::graph_property_type> const_type;
+};
+
+template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
inline typed_identity_property_map<Vertex>
get(vertex_index_t, const BOOST_CSR_GRAPH_TYPE&)
{
@@ -1449,6 +1420,21 @@ get(vertex_index_t,
}
template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
+inline typed_identity_property_map<Vertex>
+get(vertex_index_t, BOOST_CSR_GRAPH_TYPE&)
+{
+ return typed_identity_property_map<Vertex>();
+}
+
+template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
+inline Vertex
+get(vertex_index_t,
+ BOOST_CSR_GRAPH_TYPE&, Vertex v)
+{
+ return v;
+}
+
+template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
inline typename property_map<BOOST_CSR_GRAPH_TYPE, edge_index_t>::const_type
get(edge_index_t, const BOOST_CSR_GRAPH_TYPE&)
{
@@ -1466,125 +1452,144 @@ get(edge_index_t, const BOOST_CSR_GRAPH_TYPE&,
}
template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
-inline typename property_map<BOOST_CSR_GRAPH_TYPE, vertex_bundle_t>::type
-get(vertex_bundle_t, BOOST_CSR_GRAPH_TYPE& g)
+inline typename property_map<BOOST_CSR_GRAPH_TYPE, edge_index_t>::const_type
+get(edge_index_t, BOOST_CSR_GRAPH_TYPE&)
+{
+ typedef typename property_map<BOOST_CSR_GRAPH_TYPE, edge_index_t>::const_type
+ result_type;
+ return result_type();
+}
+
+template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
+inline EdgeIndex
+get(edge_index_t, BOOST_CSR_GRAPH_TYPE&,
+ typename BOOST_CSR_GRAPH_TYPE::edge_descriptor e)
+{
+ return e.idx;
+}
+
+template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
+inline typename property_map<BOOST_CSR_GRAPH_TYPE, vertex_all_t>::type
+get(vertex_all_t, BOOST_CSR_GRAPH_TYPE& g)
{
return g.get_vertex_bundle(get(vertex_index, g));
}
template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
-inline typename property_map<BOOST_CSR_GRAPH_TYPE, vertex_bundle_t>::const_type
-get(vertex_bundle_t, const BOOST_CSR_GRAPH_TYPE& g)
+inline typename property_map<BOOST_CSR_GRAPH_TYPE, vertex_all_t>::const_type
+get(vertex_all_t, const BOOST_CSR_GRAPH_TYPE& g)
{
return g.get_vertex_bundle(get(vertex_index, g));
}
template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
inline VertexProperty&
-get(vertex_bundle_t,
+get(vertex_all_t,
BOOST_CSR_GRAPH_TYPE& g, Vertex v)
{
- return get(vertex_bundle, g)[v];
+ return get(vertex_all, g)[v];
}
template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
inline const VertexProperty&
-get(vertex_bundle_t,
+get(vertex_all_t,
const BOOST_CSR_GRAPH_TYPE& g, Vertex v)
{
- return get(vertex_bundle, g)[v];
+ return get(vertex_all, g)[v];
}
template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
inline void
-put(vertex_bundle_t,
+put(vertex_all_t,
BOOST_CSR_GRAPH_TYPE& g,
Vertex v,
const VertexProperty& val)
{
- put(get(vertex_bundle, g), v, val);
+ put(get(vertex_all, g), v, val);
}
template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
-inline typename property_map<BOOST_CSR_GRAPH_TYPE, edge_bundle_t>::type
-get(edge_bundle_t, BOOST_CSR_GRAPH_TYPE& g)
+inline typename property_map<BOOST_CSR_GRAPH_TYPE, edge_all_t>::type
+get(edge_all_t, BOOST_CSR_GRAPH_TYPE& g)
{
return g.m_forward.get_edge_bundle(get(edge_index, g));
}
template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
-inline typename property_map<BOOST_CSR_GRAPH_TYPE, edge_bundle_t>::const_type
-get(edge_bundle_t, const BOOST_CSR_GRAPH_TYPE& g)
+inline typename property_map<BOOST_CSR_GRAPH_TYPE, edge_all_t>::const_type
+get(edge_all_t, const BOOST_CSR_GRAPH_TYPE& g)
{
return g.m_forward.get_edge_bundle(get(edge_index, g));
}
template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
inline EdgeProperty&
-get(edge_bundle_t,
+get(edge_all_t,
BOOST_CSR_GRAPH_TYPE& g,
const typename BOOST_CSR_GRAPH_TYPE::edge_descriptor& e)
{
- return get(edge_bundle, g)[e];
+ return get(edge_all, g)[e];
}
template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
inline const EdgeProperty&
-get(edge_bundle_t,
+get(edge_all_t,
const BOOST_CSR_GRAPH_TYPE& g,
const typename BOOST_CSR_GRAPH_TYPE::edge_descriptor& e)
{
- return get(edge_bundle, g)[e];
+ return get(edge_all, g)[e];
}
template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
inline void
-put(edge_bundle_t,
+put(edge_all_t,
BOOST_CSR_GRAPH_TYPE& g,
const typename BOOST_CSR_GRAPH_TYPE::edge_descriptor& e,
const EdgeProperty& val)
{
- put(get(edge_bundle, g), e, val);
+ put(get(edge_all, g), e, val);
}
-template<BOOST_CSR_GRAPH_TEMPLATE_PARMS, typename T, typename Bundle>
-inline
-typename property_map<BOOST_CSR_GRAPH_TYPE, T Bundle::*>::type
-get(T Bundle::* p, BOOST_CSR_GRAPH_TYPE& g)
+template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
+inline typename property_map<BOOST_CSR_GRAPH_TYPE, graph_all_t>::type
+get(graph_all_t, BOOST_CSR_GRAPH_TYPE& g)
{
- typedef typename property_map<BOOST_CSR_GRAPH_TYPE,
- T Bundle::*>::type
- result_type;
- return result_type(&g, p);
+ return typename property_map<BOOST_CSR_GRAPH_TYPE, graph_all_t>::type(g.m_property);
}
-template<BOOST_CSR_GRAPH_TEMPLATE_PARMS, typename T, typename Bundle>
-inline
-typename property_map<BOOST_CSR_GRAPH_TYPE, T Bundle::*>::const_type
-get(T Bundle::* p, BOOST_CSR_GRAPH_TYPE const & g)
+template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
+inline typename property_map<BOOST_CSR_GRAPH_TYPE, graph_all_t>::const_type
+get(graph_all_t, const BOOST_CSR_GRAPH_TYPE& g)
{
- typedef typename property_map<BOOST_CSR_GRAPH_TYPE,
- T Bundle::*>::const_type
- result_type;
- return result_type(&g, p);
+ return typename property_map<BOOST_CSR_GRAPH_TYPE, graph_all_t>::const_type(g.m_property);
}
-template<BOOST_CSR_GRAPH_TEMPLATE_PARMS, typename T, typename Bundle,
- typename Key>
-inline T
-get(T Bundle::* p, BOOST_CSR_GRAPH_TYPE const & g,
- const Key& key)
+template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
+inline GraphProperty&
+get(graph_all_t,
+ BOOST_CSR_GRAPH_TYPE& g,
+ BOOST_CSR_GRAPH_TYPE*)
{
- return get(get(p, g), key);
+ return g.m_property;
}
-template<BOOST_CSR_GRAPH_TEMPLATE_PARMS, typename T, typename Bundle,
- typename Key>
+template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
+inline const GraphProperty&
+get(graph_all_t,
+ const BOOST_CSR_GRAPH_TYPE& g,
+ BOOST_CSR_GRAPH_TYPE*)
+{
+ return g.m_property;
+}
+
+template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
inline void
-put(T Bundle::* p, BOOST_CSR_GRAPH_TYPE& g,
- const Key& key, const T& value)
+put(graph_all_t,
+ BOOST_CSR_GRAPH_TYPE& g,
+ BOOST_CSR_GRAPH_TYPE*,
+ const GraphProperty& val)
{
- put(get(p, g), key, value);
+ g.m_property = val;
}
#undef BOOST_CSR_GRAPH_TYPE
diff --git a/boost/graph/copy.hpp b/boost/graph/copy.hpp
index 0dc6c664a2..21bb0fb01e 100644
--- a/boost/graph/copy.hpp
+++ b/boost/graph/copy.hpp
@@ -280,7 +280,7 @@ namespace boost {
typedef choose_copier_parameter type;
};
template <>
- struct choose_edge_copy<detail::error_property_not_found> {
+ struct choose_edge_copy<param_not_found> {
typedef choose_default_edge_copier type;
};
template <class Param, class G1, class G2>
@@ -314,7 +314,7 @@ namespace boost {
typedef choose_copier_parameter type;
};
template <>
- struct choose_vertex_copy<detail::error_property_not_found> {
+ struct choose_vertex_copy<param_not_found> {
typedef choose_default_vertex_copier type;
};
template <class Param, class G1, class G2>
diff --git a/boost/graph/depth_first_search.hpp b/boost/graph/depth_first_search.hpp
index d38ad603d0..34d73a2fdd 100644
--- a/boost/graph/depth_first_search.hpp
+++ b/boost/graph/depth_first_search.hpp
@@ -21,6 +21,7 @@
#include <boost/graph/named_function_params.hpp>
#include <boost/ref.hpp>
#include <boost/implicit_cast.hpp>
+#include <boost/parameter.hpp>
#include <boost/concept/assert.hpp>
#include <vector>
@@ -198,7 +199,7 @@ namespace boost {
put(color, u, Color::white()); vis.initialize_vertex(u, g);
}
- if (start_vertex != implicit_cast<Vertex>(*vertices(g).first)){ vis.start_vertex(start_vertex, g);
+ if (start_vertex != detail::get_default_starting_vertex(g)){ vis.start_vertex(start_vertex, g);
detail::depth_first_visit_impl(g, start_vertex, vis, color,
detail::nontruth2());
}
@@ -221,7 +222,7 @@ namespace boost {
if (verts.first == verts.second)
return;
- depth_first_search(g, vis, color, *verts.first);
+ depth_first_search(g, vis, color, detail::get_default_starting_vertex(g));
}
template <class Visitors = null_visitor>
@@ -282,27 +283,27 @@ namespace boost {
}
typedef dfs_visitor<> default_dfs_visitor;
- // Named Parameter Variant
- template <class VertexListGraph, class P, class T, class R>
- void
- depth_first_search(const VertexListGraph& g,
- const bgl_named_params<P, T, R>& params)
- {
- typedef typename boost::graph_traits<VertexListGraph>::vertex_iterator vi;
- std::pair<vi, vi> verts = vertices(g);
- if (verts.first == verts.second)
- return;
- using namespace boost::graph::keywords;
- typedef bgl_named_params<P, T, R> params_type;
- BOOST_GRAPH_DECLARE_CONVERTED_PARAMETERS(params_type, params)
- depth_first_search
- (g,
- arg_pack[_visitor | make_dfs_visitor(null_visitor())],
- boost::detail::make_color_map_from_arg_pack(g, arg_pack),
- arg_pack[_root_vertex | *vertices(g).first]
- );
+ // Boost.Parameter named parameter variant
+ namespace graph {
+ namespace detail {
+ template <typename Graph>
+ struct depth_first_search_impl {
+ typedef void result_type;
+ template <typename ArgPack>
+ void operator()(const Graph& g, const ArgPack& arg_pack) const {
+ using namespace boost::graph::keywords;
+ boost::depth_first_search(g,
+ arg_pack[_visitor | make_dfs_visitor(null_visitor())],
+ boost::detail::make_color_map_from_arg_pack(g, arg_pack),
+ arg_pack[_root_vertex || boost::detail::get_default_starting_vertex_t<Graph>(g)]);
+ }
+ };
+ }
+ BOOST_GRAPH_MAKE_FORWARDING_FUNCTION(depth_first_search, 1, 4)
}
+ BOOST_GRAPH_MAKE_OLD_STYLE_PARAMETER_FUNCTION(depth_first_search, 1)
+
template <class IncidenceGraph, class DFSVisitor, class ColorMap>
void depth_first_visit
(const IncidenceGraph& g,
diff --git a/boost/graph/detail/adjacency_list.hpp b/boost/graph/detail/adjacency_list.hpp
index 100c44ba7f..fa39898907 100644
--- a/boost/graph/detail/adjacency_list.hpp
+++ b/boost/graph/detail/adjacency_list.hpp
@@ -37,11 +37,6 @@
#include <boost/static_assert.hpp>
#include <boost/assert.hpp>
-// Symbol truncation problems with MSVC, trying to shorten names.
-#define stored_edge se_
-#define stored_edge_property sep_
-#define stored_edge_iter sei_
-
/*
Outline for this file:
@@ -67,11 +62,6 @@
*/
-#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
-// Stay out of the way of the concept checking class
-# define Graph Graph_
-#endif
-
namespace boost {
namespace detail {
@@ -727,8 +717,10 @@ namespace boost {
typename Config::OutEdgeList& out_el = g.out_edge_list(source(e, g));
typename Config::OutEdgeList::iterator out_i = out_el.begin();
+ typename Config::EdgeIter edge_iter_to_erase;
for (; out_i != out_el.end(); ++out_i)
if (&(*out_i).get_property() == &p) {
+ edge_iter_to_erase = (*out_i).get_iter();
out_el.erase(out_i);
break;
}
@@ -736,10 +728,10 @@ namespace boost {
typename Config::OutEdgeList::iterator in_i = in_el.begin();
for (; in_i != in_el.end(); ++in_i)
if (&(*in_i).get_property() == &p) {
- g.m_edges.erase((*in_i).get_iter());
in_el.erase(in_i);
- return;
+ break;
}
+ g.m_edges.erase(edge_iter_to_erase);
}
};
@@ -760,8 +752,10 @@ namespace boost {
no_property* p = (no_property*)e.get_property();
typename Config::OutEdgeList& out_el = g.out_edge_list(source(e, g));
typename Config::OutEdgeList::iterator out_i = out_el.begin();
+ typename Config::EdgeIter edge_iter_to_erase;
for (; out_i != out_el.end(); ++out_i)
if (&(*out_i).get_property() == p) {
+ edge_iter_to_erase = (*out_i).get_iter();
out_el.erase(out_i);
break;
}
@@ -769,10 +763,10 @@ namespace boost {
typename Config::OutEdgeList::iterator in_i = in_el.begin();
for (; in_i != in_el.end(); ++in_i)
if (&(*in_i).get_property() == p) {
- g.m_edges.erase((*in_i).get_iter());
in_el.erase(in_i);
- return;
+ break;
}
+ g.m_edges.erase(edge_iter_to_erase);
}
};
@@ -811,6 +805,7 @@ namespace boost {
typedef typename EdgeList::value_type StoredEdge;
typename EdgeList::iterator i = el.find(StoredEdge(v)), end = el.end();
+ BOOST_ASSERT ((i != end));
if (i != end) {
g.m_edges.erase((*i).get_iter());
el.erase(i);
@@ -991,24 +986,12 @@ namespace boost {
typedef typename Config::graph_type graph_type;
typedef typename Config::edge_parallel_category Cat;
graph_type& g = static_cast<graph_type&>(g_);
- typename Config::OutEdgeList& el = g.out_edge_list(u);
- typename Config::OutEdgeList::iterator
- ei = el.begin(), ei_end = el.end();
- for (; ei != ei_end; /* Increment below */ ) {
- bool is_self_loop = (*ei).get_target() == u;
- // Don't erase from our own incidence list in the case of a self-loop
- // since we're clearing it anyway.
- if (!is_self_loop) {
- detail::erase_from_incidence_list
- (g.out_edge_list((*ei).get_target()), u, Cat());
- typename Config::OutEdgeList::iterator ei_copy = ei;
- ++ei;
- if (!is_self_loop) g.m_edges.erase((*ei_copy).get_iter());
- } else {
- ++ei;
- }
+ while (true) {
+ typename Config::out_edge_iterator ei, ei_end;
+ boost::tie(ei, ei_end) = out_edges(u, g);
+ if (ei == ei_end) break;
+ remove_edge(*ei, g);
}
- g.out_edge_list(u).clear();
}
// O(1) for allow_parallel_edge_tag
// O(log(E/V)) for disallow_parallel_edge_tag
@@ -1511,10 +1494,16 @@ namespace boost {
typedef typename Config::edges_size_type edges_size_type;
typedef typename Config::degree_size_type degree_size_type;
typedef typename Config::StoredEdge StoredEdge;
+ typedef typename Config::vertex_property_type vertex_property_type;
typedef typename Config::edge_property_type edge_property_type;
+ typedef typename Config::graph_property_type graph_property_type;
typedef typename Config::global_edgelist_selector
global_edgelist_selector;
+
+ typedef typename lookup_one_property<vertex_property_type, vertex_bundle_t>::type vertex_bundled;
+ typedef typename lookup_one_property<edge_property_type, edge_bundle_t>::type edge_bundled;
+ typedef typename lookup_one_property<graph_property_type, graph_bundle_t>::type graph_bundled;
};
template <class Config, class Base>
@@ -1645,43 +1634,43 @@ namespace boost {
inline
typename boost::property_map<typename Config::graph_type,
Property>::type
- get_dispatch(adj_list_helper<Config,Base>&, Property,
+ get_dispatch(adj_list_helper<Config,Base>&, Property p,
boost::edge_property_tag) {
typedef typename Config::graph_type Graph;
typedef typename boost::property_map<Graph, Property>::type PA;
- return PA();
+ return PA(p);
}
template <class Config, class Base, class Property>
inline
typename boost::property_map<typename Config::graph_type,
Property>::const_type
- get_dispatch(const adj_list_helper<Config,Base>&, Property,
+ get_dispatch(const adj_list_helper<Config,Base>&, Property p,
boost::edge_property_tag) {
typedef typename Config::graph_type Graph;
typedef typename boost::property_map<Graph, Property>::const_type PA;
- return PA();
+ return PA(p);
}
template <class Config, class Base, class Property>
inline
typename boost::property_map<typename Config::graph_type,
Property>::type
- get_dispatch(adj_list_helper<Config,Base>& g, Property,
+ get_dispatch(adj_list_helper<Config,Base>& g, Property p,
boost::vertex_property_tag) {
typedef typename Config::graph_type Graph;
typedef typename boost::property_map<Graph, Property>::type PA;
- return PA(&static_cast<Graph&>(g));
+ return PA(&static_cast<Graph&>(g), p);
}
template <class Config, class Base, class Property>
inline
typename boost::property_map<typename Config::graph_type,
Property>::const_type
- get_dispatch(const adj_list_helper<Config, Base>& g, Property,
+ get_dispatch(const adj_list_helper<Config, Base>& g, Property p,
boost::vertex_property_tag) {
typedef typename Config::graph_type Graph;
typedef typename boost::property_map<Graph, Property>::const_type PA;
const Graph& cg = static_cast<const Graph&>(g);
- return PA(&cg);
+ return PA(&cg, p);
}
} // namespace detail
@@ -1691,7 +1680,7 @@ namespace boost {
inline
typename boost::property_map<typename Config::graph_type, Property>::type
get(Property p, adj_list_helper<Config, Base>& g) {
- typedef typename property_kind<Property>::type Kind;
+ typedef typename detail::property_kind_from_graph<adj_list_helper<Config, Base>, Property>::type Kind;
return detail::get_dispatch(g, p, Kind());
}
template <class Config, class Base, class Property>
@@ -1699,7 +1688,7 @@ namespace boost {
typename boost::property_map<typename Config::graph_type,
Property>::const_type
get(Property p, const adj_list_helper<Config, Base>& g) {
- typedef typename property_kind<Property>::type Kind;
+ typedef typename detail::property_kind_from_graph<adj_list_helper<Config, Base>, Property>::type Kind;
return detail::get_dispatch(g, p, Kind());
}
@@ -2427,15 +2416,15 @@ namespace boost {
typedef Reference reference;
typedef typename Graph::vertex_descriptor key_type;
typedef boost::lvalue_property_map_tag category;
- inline adj_list_vertex_property_map() { }
- inline adj_list_vertex_property_map(const Graph*) { }
+ inline adj_list_vertex_property_map(const Graph* = 0, Tag tag = Tag()): m_tag(tag) { }
inline Reference operator[](key_type v) const {
StoredVertex* sv = (StoredVertex*)v;
- return get_property_value(sv->m_property, Tag());
+ return get_property_value(sv->m_property, m_tag);
}
inline Reference operator()(key_type v) const {
return this->operator[](v);
}
+ Tag m_tag;
};
template <class Graph, class Property, class PropRef>
@@ -2449,8 +2438,7 @@ namespace boost {
typedef PropRef reference;
typedef typename Graph::vertex_descriptor key_type;
typedef boost::lvalue_property_map_tag category;
- inline adj_list_vertex_all_properties_map() { }
- inline adj_list_vertex_all_properties_map(const Graph*) { }
+ inline adj_list_vertex_all_properties_map(const Graph* = 0, vertex_all_t = vertex_all_t()) { }
inline PropRef operator[](key_type v) const {
StoredVertex* sv = (StoredVertex*)v;
return sv->m_property;
@@ -2473,15 +2461,15 @@ namespace boost {
typedef Reference reference;
typedef typename boost::graph_traits<Graph>::vertex_descriptor key_type;
typedef boost::lvalue_property_map_tag category;
- vec_adj_list_vertex_property_map() { }
- vec_adj_list_vertex_property_map(GraphPtr g) : m_g(g) { }
+ vec_adj_list_vertex_property_map(GraphPtr g = 0, Tag tag = Tag()) : m_g(g), m_tag(tag) { }
inline Reference operator[](key_type v) const {
- return get_property_value(m_g->m_vertices[v].m_property, Tag());
+ return get_property_value(m_g->m_vertices[v].m_property, m_tag);
}
inline Reference operator()(key_type v) const {
return this->operator[](v);
}
GraphPtr m_g;
+ Tag m_tag;
};
template <class Graph, class GraphPtr, class Property, class PropertyRef>
@@ -2495,8 +2483,7 @@ namespace boost {
typedef PropertyRef reference;
typedef typename boost::graph_traits<Graph>::vertex_descriptor key_type;
typedef boost::lvalue_property_map_tag category;
- vec_adj_list_vertex_all_properties_map() { }
- vec_adj_list_vertex_all_properties_map(GraphPtr g) : m_g(g) { }
+ vec_adj_list_vertex_all_properties_map(GraphPtr g = 0, vertex_all_t = vertex_all_t()) : m_g(g) { }
inline PropertyRef operator[](key_type v) const {
return m_g->m_vertices[v].m_property;
}
@@ -2542,7 +2529,7 @@ namespace boost {
typedef boost::readable_property_map_tag category;
inline vec_adj_list_vertex_id_map() { }
template <class Graph>
- inline vec_adj_list_vertex_id_map(const Graph&) { }
+ inline vec_adj_list_vertex_id_map(const Graph&, vertex_index_t) { }
inline value_type operator[](key_type v) const { return v; }
inline value_type operator()(key_type v) const { return v; }
};
@@ -2579,21 +2566,14 @@ namespace boost {
};
};
namespace detail {
- template <class Tag>
- struct adj_list_choose_vertex_pa_helper {
- typedef adj_list_any_vertex_pa type;
- };
- template <>
- struct adj_list_choose_vertex_pa_helper<vertex_all_t> {
- typedef adj_list_all_vertex_pa type;
- };
template <class Tag, class Graph, class Property>
- struct adj_list_choose_vertex_pa {
- typedef typename adj_list_choose_vertex_pa_helper<Tag>::type Helper;
- typedef typename Helper::template bind_<Tag,Graph,Property> Bind;
- typedef typename Bind::type type;
- typedef typename Bind::const_type const_type;
- };
+ struct adj_list_choose_vertex_pa
+ : boost::mpl::if_<
+ boost::is_same<Tag, vertex_all_t>,
+ adj_list_all_vertex_pa,
+ adj_list_any_vertex_pa>::type
+ ::template bind_<Tag, Graph, Property>
+ {};
template <class Tag>
@@ -2609,12 +2589,9 @@ namespace boost {
typedef vec_adj_list_all_vertex_pa type;
};
template <class Tag, class Graph, class Property>
- struct vec_adj_list_choose_vertex_pa {
- typedef typename vec_adj_list_choose_vertex_pa_helper<Tag>::type Helper;
- typedef typename Helper::template bind_<Tag,Graph,Property> Bind;
- typedef typename Bind::type type;
- typedef typename Bind::const_type const_type;
- };
+ struct vec_adj_list_choose_vertex_pa
+ : vec_adj_list_choose_vertex_pa_helper<Tag>::type::template bind_<Tag,Graph,Property>
+ {};
} // namespace detail
//=========================================================================
@@ -2629,13 +2606,16 @@ namespace boost {
Tag>
>
{
+ Tag tag;
+ explicit adj_list_edge_property_map(Tag tag = Tag()): tag(tag) {}
+
typedef Value value_type;
typedef Ref reference;
typedef detail::edge_desc_impl<Directed, Vertex> key_type;
typedef boost::lvalue_property_map_tag category;
inline Ref operator[](key_type e) const {
Property& p = *(Property*)e.get_property();
- return get_property_value(p, Tag());
+ return get_property_value(p, tag);
}
inline Ref operator()(key_type e) const {
return this->operator[](e);
@@ -2650,6 +2630,7 @@ namespace boost {
PropPtr, Vertex>
>
{
+ explicit adj_list_edge_all_properties_map(edge_all_t = edge_all_t()) {}
typedef Property value_type;
typedef PropRef reference;
typedef detail::edge_desc_impl<Directed, Vertex> key_type;
@@ -2701,19 +2682,12 @@ namespace boost {
typedef adj_list_all_edge_pmap type;
};
template <class Tag, class Graph, class Property>
- struct adj_list_choose_edge_pmap {
- typedef typename adj_list_choose_edge_pmap_helper<Tag>::type Helper;
- typedef typename Helper::template bind_<Graph,Property,Tag> Bind;
- typedef typename Bind::type type;
- typedef typename Bind::const_type const_type;
- };
+ struct adj_list_choose_edge_pmap
+ : adj_list_choose_edge_pmap_helper<Tag>::type::template bind_<Graph, Property, Tag>
+ {};
struct adj_list_edge_property_selector {
template <class Graph, class Property, class Tag>
- struct bind_ {
- typedef adj_list_choose_edge_pmap<Tag,Graph,Property> Choice;
- typedef typename Choice::type type;
- typedef typename Choice::const_type const_type;
- };
+ struct bind_: adj_list_choose_edge_pmap<Tag, Graph, Property> {};
};
} // namespace detail
@@ -2730,11 +2704,9 @@ namespace boost {
struct adj_list_vertex_property_selector {
template <class Graph, class Property, class Tag>
- struct bind_ {
- typedef detail::adj_list_choose_vertex_pa<Tag,Graph,Property> Choice;
- typedef typename Choice::type type;
- typedef typename Choice::const_type const_type;
- };
+ struct bind_
+ : detail::adj_list_choose_vertex_pa<Tag,Graph,Property>
+ {};
};
template <>
struct vertex_property_selector<adj_list_tag> {
@@ -2743,11 +2715,7 @@ namespace boost {
struct vec_adj_list_vertex_property_selector {
template <class Graph, class Property, class Tag>
- struct bind_ {
- typedef detail::vec_adj_list_choose_vertex_pa<Tag,Graph,Property> Choice;
- typedef typename Choice::type type;
- typedef typename Choice::const_type const_type;
- };
+ struct bind_: detail::vec_adj_list_choose_vertex_pa<Tag,Graph,Property> {};
};
template <>
struct vertex_property_selector<vec_adj_list_tag> {
@@ -2793,15 +2761,6 @@ namespace boost {
#endif
-#undef stored_edge
-#undef stored_edge_property
-#undef stored_edge_iter
-
-#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
-// Stay out of the way of the concept checking class
-#undef Graph
-#endif
-
#endif // BOOST_GRAPH_DETAIL_DETAIL_ADJACENCY_LIST_CCT
/*
diff --git a/boost/graph/detail/compressed_sparse_row_struct.hpp b/boost/graph/detail/compressed_sparse_row_struct.hpp
index 75ac96204d..56495f3436 100644
--- a/boost/graph/detail/compressed_sparse_row_struct.hpp
+++ b/boost/graph/detail/compressed_sparse_row_struct.hpp
@@ -44,7 +44,6 @@
#include <boost/graph/graph_selectors.hpp>
#include <boost/static_assert.hpp>
#include <boost/functional/hash.hpp>
-#include <boost/utility.hpp>
namespace boost {
diff --git a/boost/graph/detail/histogram_sort.hpp b/boost/graph/detail/histogram_sort.hpp
index b359a73ded..ca6266a528 100644
--- a/boost/graph/detail/histogram_sort.hpp
+++ b/boost/graph/detail/histogram_sort.hpp
@@ -60,6 +60,7 @@ count_starts
// Put the degree of each vertex v into m_rowstart[v + 1]
for (KeyIterator i = begin; i != end; ++i) {
if (key_filter(*i)) {
+ BOOST_ASSERT (key_transform(*i) < numkeys);
++starts[key_transform(*i) + 1];
}
}
@@ -99,6 +100,7 @@ histogram_sort(KeyIterator key_begin, KeyIterator key_end,
for (KeyIterator i = key_begin; i != key_end; ++i, ++v1i) {
if (key_filter(*i)) {
vertices_size_type source = key_transform(*i);
+ BOOST_ASSERT (source < numkeys);
EdgeIndex insert_pos = current_insert_positions[source];
++current_insert_positions[source];
values1_out[insert_pos] = *v1i;
@@ -137,6 +139,7 @@ histogram_sort(KeyIterator key_begin, KeyIterator key_end,
for (KeyIterator i = key_begin; i != key_end; ++i, ++v1i, ++v2i) {
if (key_filter(*i)) {
vertices_size_type source = key_transform(*i);
+ BOOST_ASSERT (source < numkeys);
EdgeIndex insert_pos = current_insert_positions[source];
++current_insert_positions[source];
values1_out[insert_pos] = *v1i;
@@ -163,6 +166,7 @@ histogram_sort_inplace(KeyIterator key_begin,
std::vector<EdgeIndex> insert_positions(rowstart, rowstart + numkeys);
// 2. Swap the sources and targets into place
for (size_t i = 0; i < rowstart[numkeys]; ++i) {
+ BOOST_ASSERT (key_transform(key_begin[i]) < numkeys);
// While edge i is not in the right bucket:
while (!(i >= rowstart[key_transform(key_begin[i])] && i < insert_positions[key_transform(key_begin[i])])) {
// Add a slot in the right bucket
@@ -197,6 +201,7 @@ histogram_sort_inplace(KeyIterator key_begin,
std::vector<EdgeIndex> insert_positions(rowstart, rowstart + numkeys);
// 2. Swap the sources and targets into place
for (size_t i = 0; i < rowstart[numkeys]; ++i) {
+ BOOST_ASSERT (key_transform(key_begin[i]) < numkeys);
// While edge i is not in the right bucket:
while (!(i >= rowstart[key_transform(key_begin[i])] && i < insert_positions[key_transform(key_begin[i])])) {
// Add a slot in the right bucket
diff --git a/boost/graph/detail/read_graphviz_spirit.hpp b/boost/graph/detail/read_graphviz_spirit.hpp
index 4e8b22e5eb..9946469883 100644
--- a/boost/graph/detail/read_graphviz_spirit.hpp
+++ b/boost/graph/detail/read_graphviz_spirit.hpp
@@ -604,7 +604,9 @@ bool read_graphviz_spirit(MultiPassIterator begin, MultiPassIterator end,
scanner_t scan(begin, end, policies);
- return p.parse(scan);
+ bool ok = p.parse(scan);
+ m_graph.finish_building_graph();
+ return ok;
}
} // namespace boost
diff --git a/boost/graph/directed_graph.hpp b/boost/graph/directed_graph.hpp
index 0bf0251905..250d0b63d7 100644
--- a/boost/graph/directed_graph.hpp
+++ b/boost/graph/directed_graph.hpp
@@ -7,7 +7,6 @@
#ifndef BOOST_GRAPH_DIRECTED_GRAPH_HPP
#define BOOST_GRAPH_DIRECTED_GRAPH_HPP
-#include <boost/utility.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/properties.hpp>
@@ -33,14 +32,12 @@ template <
class directed_graph
{
public:
- typedef typename graph_detail::graph_prop<GraphProp>::property graph_property_type;
- typedef typename graph_detail::graph_prop<GraphProp>::bundle graph_bundled;
-
- typedef typename graph_detail::vertex_prop<VertexProp>::property vertex_property_type;
- typedef typename graph_detail::vertex_prop<VertexProp>::bundle vertex_bundled;
-
- typedef typename graph_detail::edge_prop<EdgeProp>::property edge_property_type;
- typedef typename graph_detail::edge_prop<EdgeProp>::bundle edge_bundled;
+ typedef GraphProp graph_property_type;
+ typedef VertexProp vertex_property_type;
+ typedef EdgeProp edge_property_type;
+ typedef typename lookup_one_property<GraphProp, graph_bundle_t>::type graph_bundled;
+ typedef typename lookup_one_property<VertexProp, vertex_bundle_t>::type vertex_bundled;
+ typedef typename lookup_one_property<EdgeProp, edge_bundle_t>::type edge_bundled;
private:
// Wrap the user-specified properties with an index.
@@ -590,35 +587,6 @@ void
set_property(DIRECTED_GRAPH& g, Property p, Value v)
{ return set_property(g.impl(), p, v); }
-#ifndef BOOST_GRAPH_NO_BUNDLED_PROPERTIES
-
-template <DIRECTED_GRAPH_PARAMS, typename Type, typename Bundle>
-inline typename property_map<DIRECTED_GRAPH, Type Bundle::*>::type
-get(Type Bundle::* p, DIRECTED_GRAPH& g) {
- typedef typename property_map<
- DIRECTED_GRAPH, Type Bundle::*
- >::type return_type;
- return return_type(&g, p);
-}
-
-template <DIRECTED_GRAPH_PARAMS, typename Type, typename Bundle>
-inline typename property_map<DIRECTED_GRAPH, Type Bundle::*>::const_type
-get(Type Bundle::* p, DIRECTED_GRAPH const& g) {
- typedef typename property_map<
- DIRECTED_GRAPH, Type Bundle::*
- >::const_type return_type;
- return return_type(&g, p);
-}
-
-template <DIRECTED_GRAPH_PARAMS, typename Type, typename Bundle, typename Key>
-inline Type get(Type Bundle::* p, DIRECTED_GRAPH const& g, Key const& k)
-{ return get(p, g.impl(), k); }
-
-template <DIRECTED_GRAPH_PARAMS, typename Type, typename Bundle, typename Key, typename Value>
-inline void put(Type Bundle::* p, DIRECTED_GRAPH& g, Key const& k, Value const& v)
-{ put(p, g.impl(), k, v); }
-#endif
-
// Vertex index management
template <DIRECTED_GRAPH_PARAMS>
diff --git a/boost/graph/distributed/adjacency_list.hpp b/boost/graph/distributed/adjacency_list.hpp
index d0bbbfe55f..264ede512e 100644
--- a/boost/graph/distributed/adjacency_list.hpp
+++ b/boost/graph/distributed/adjacency_list.hpp
@@ -1882,6 +1882,30 @@ namespace boost {
}
//---------------------------------------------------------------------
+ //---------------------------------------------------------------------
+ // Opposite of above.
+ edge_property_type split_edge_property(const base_edge_property_type& p)
+ { return split_edge_property(p, directed_selector()); }
+
+ edge_property_type
+ split_edge_property(const base_edge_property_type& p, directedS)
+ {
+ return p.m_base;
+ }
+
+ edge_property_type
+ split_edge_property(const base_edge_property_type& p, bidirectionalS)
+ {
+ return p.m_base;
+ }
+
+ edge_property_type
+ split_edge_property(const base_edge_property_type& p, undirectedS)
+ {
+ return p.m_base.m_base;
+ }
+ //---------------------------------------------------------------------
+
/** The set of messages that can be transmitted and received by
* a distributed adjacency list. This list will eventually be
* exhaustive, but is currently quite limited.
diff --git a/boost/graph/distributed/adjlist/redistribute.hpp b/boost/graph/distributed/adjlist/redistribute.hpp
index 064aaba191..5401f1240a 100644
--- a/boost/graph/distributed/adjlist/redistribute.hpp
+++ b/boost/graph/distributed/adjlist/redistribute.hpp
@@ -237,8 +237,8 @@ PBGL_DISTRIB_ADJLIST_TYPE
|| get(vertex_to_processor, src) != src.owner
|| get(vertex_to_processor, tgt) != tgt.owner)
redistributed_edges[get(vertex_to_processor, source(*ei, *this))]
- .push_back(redistributed_edge(*ei, get(edge_all_t(), base(),
- ei->local)));
+ .push_back(redistributed_edge(*ei, split_edge_property(get(edge_all_t(), base(),
+ ei->local))));
}
inplace_all_to_all(pg, redistributed_edges);
diff --git a/boost/graph/distributed/betweenness_centrality.hpp b/boost/graph/distributed/betweenness_centrality.hpp
index b6ca7d06ef..04d249a5b8 100644
--- a/boost/graph/distributed/betweenness_centrality.hpp
+++ b/boost/graph/distributed/betweenness_centrality.hpp
@@ -1389,7 +1389,7 @@ namespace graph { namespace parallel { namespace detail {
};
template<>
- struct brandes_betweenness_centrality_dispatch1<boost::detail::error_property_not_found>
+ struct brandes_betweenness_centrality_dispatch1<boost::param_not_found>
{
template<typename Graph, typename CentralityMap, typename EdgeCentralityMap,
typename VertexIndexMap, typename Buffer>
@@ -1397,7 +1397,7 @@ namespace graph { namespace parallel { namespace detail {
run(const Graph& g, CentralityMap centrality, EdgeCentralityMap edge_centrality_map,
VertexIndexMap vertex_index, Buffer sources,
typename graph_traits<Graph>::edges_size_type delta,
- boost::detail::error_property_not_found)
+ boost::param_not_found)
{
boost::graph::parallel::detail::brandes_betweenness_centrality_dispatch2(
g, centrality, edge_centrality_map, vertex_index, sources, delta);
@@ -1417,7 +1417,8 @@ brandes_betweenness_centrality(const Graph& g,
typedef queue<typename graph_traits<Graph>::vertex_descriptor> queue_t;
queue_t q;
- typedef typename property_value<named_params, edge_weight_t>::type ew;
+ typedef typename get_param_type<edge_weight_t, named_params>::type ew_param;
+ typedef typename detail::choose_impl_result<mpl::true_, Graph, ew_param, edge_weight_t>::type ew;
graph::parallel::detail::brandes_betweenness_centrality_dispatch1<ew>::run(
g,
choose_param(get_param(params, vertex_centrality),
@@ -1427,7 +1428,7 @@ brandes_betweenness_centrality(const Graph& g,
choose_const_pmap(get_param(params, vertex_index), g, vertex_index),
choose_param(get_param(params, buffer_param_t()), boost::ref(q)),
choose_param(get_param(params, lookahead_t()), 0),
- get_param(params, edge_weight));
+ choose_const_pmap(get_param(params, edge_weight), g, edge_weight));
}
template<typename Graph, typename CentralityMap>
@@ -1605,14 +1606,14 @@ namespace detail { namespace graph {
};
template<>
- struct non_distributed_brandes_betweenness_centrality_dispatch1<detail::error_property_not_found>
+ struct non_distributed_brandes_betweenness_centrality_dispatch1<param_not_found>
{
template<typename ProcessGroup, typename Graph, typename CentralityMap,
typename EdgeCentralityMap, typename VertexIndexMap, typename Buffer>
static void
run(const ProcessGroup& pg, const Graph& g, CentralityMap centrality,
EdgeCentralityMap edge_centrality_map, VertexIndexMap vertex_index,
- Buffer sources, detail::error_property_not_found)
+ Buffer sources, param_not_found)
{
non_distributed_brandes_betweenness_centrality_dispatch2(pg, g, centrality, edge_centrality_map,
vertex_index, sources);
@@ -1631,7 +1632,8 @@ non_distributed_brandes_betweenness_centrality(const ProcessGroup& pg, const Gra
typedef queue<int> queue_t;
queue_t q;
- typedef typename property_value<named_params, edge_weight_t>::type ew;
+ typedef typename get_param_type<edge_weight_t, named_params>::type ew_param;
+ typedef typename detail::choose_impl_result<mpl::true_, Graph, ew_param, edge_weight_t>::type ew;
detail::graph::non_distributed_brandes_betweenness_centrality_dispatch1<ew>::run(
pg, g,
choose_param(get_param(params, vertex_centrality),
@@ -1640,7 +1642,7 @@ non_distributed_brandes_betweenness_centrality(const ProcessGroup& pg, const Gra
dummy_property_map()),
choose_const_pmap(get_param(params, vertex_index), g, vertex_index),
choose_param(get_param(params, buffer_param_t()), boost::ref(q)),
- get_param(params, edge_weight));
+ choose_const_pmap(get_param(params, edge_weight), g, edge_weight));
}
template<typename ProcessGroup, typename Graph, typename CentralityMap>
diff --git a/boost/graph/distributed/breadth_first_search.hpp b/boost/graph/distributed/breadth_first_search.hpp
index c987585f5f..36e2df8bb7 100644
--- a/boost/graph/distributed/breadth_first_search.hpp
+++ b/boost/graph/distributed/breadth_first_search.hpp
@@ -118,7 +118,7 @@ namespace boost {
typename graph_traits<DistributedGraph>::vertex_descriptor s,
ColorMap color,
BFSVisitor vis,
- error_property_not_found,
+ boost::param_not_found,
VertexIndexMap vertex_index)
{
using boost::graph::parallel::process_group;
diff --git a/boost/graph/distributed/compressed_sparse_row_graph.hpp b/boost/graph/distributed/compressed_sparse_row_graph.hpp
index 01d32cfb88..33861c47b4 100644
--- a/boost/graph/distributed/compressed_sparse_row_graph.hpp
+++ b/boost/graph/distributed/compressed_sparse_row_graph.hpp
@@ -365,30 +365,22 @@ class compressed_sparse_row_graph<
// Directly access a vertex or edge bundle
vertex_bundled& operator[](vertex_descriptor v)
{
- std::pair<process_id_type, vertex_descriptor> locator
- = get(vertex_global, *this, v);
- BOOST_ASSERT(locator.first == process_id(m_process_group));
- return base().m_vertex_properties[locator.second];
+ return get(vertex_bundle, *this, v);
}
const vertex_bundled& operator[](vertex_descriptor v) const
{
- std::pair<process_id_type, vertex_descriptor> locator
- = get(vertex_global, *this, v);
- BOOST_ASSERT(locator.first == process_id(m_process_group));
- return base().m_process_group[locator.second];
+ return get(vertex_bundle, *this, v);
}
edge_bundled& operator[](edge_descriptor e)
{
- BOOST_ASSERT(get(vertex_owner, *this, e.src) == process_id(m_process_group));
- return base().m_edge_properties[e.idx];
+ return get(edge_bundle, *this, e);
}
const edge_bundled& operator[](edge_descriptor e) const
{
- BOOST_ASSERT(get(vertex_owner, *this, e.src) == process_id(m_process_group));
- return base().m_edge_properties[e.idx];
+ return get(edge_bundle, *this, e);
}
// Create a vertex descriptor from a process ID and a local index.
@@ -1757,19 +1749,22 @@ class csr_edge_global_map
public:
// -----------------------------------------------------------------
// Readable Property Map concept requirements
- typedef std::pair<ProcessID, EdgeIndex> value_type;
- typedef value_type reference;
typedef detail::csr_edge_descriptor<Vertex, EdgeIndex> key_type;
+ typedef std::pair<ProcessID, detail::csr_edge_descriptor<Vertex, EdgeIndex> > value_type;
+ typedef value_type reference;
typedef readable_property_map_tag category;
};
template<typename ProcessID, typename Vertex, typename EdgeIndex>
-inline std::pair<ProcessID, EdgeIndex>
+inline std::pair<ProcessID, detail::csr_edge_descriptor<Vertex, EdgeIndex> >
get(csr_edge_global_map<ProcessID, Vertex, EdgeIndex> pm,
typename csr_edge_global_map<ProcessID, Vertex, EdgeIndex>::key_type k)
{
const int local_index_bits = sizeof(Vertex) * CHAR_BIT - processor_bits;
- return std::pair<ProcessID, EdgeIndex>(k.src >> local_index_bits, k.idx);
+ const Vertex local_index_mask = Vertex(-1) >> processor_bits;
+ return std::pair<ProcessID, detail::csr_edge_descriptor<Vertex, EdgeIndex> >
+ ((k.src >> local_index_bits),
+ detail::csr_edge_descriptor<Vertex, EdgeIndex>(k.src & local_index_mask, k.idx));
}
template<BOOST_DISTRIB_CSR_GRAPH_TEMPLATE_PARMS>
@@ -1796,7 +1791,7 @@ get(edge_global_t, BOOST_DISTRIB_CSR_GRAPH_TYPE& g)
template<BOOST_DISTRIB_CSR_GRAPH_TEMPLATE_PARMS>
inline
std::pair<typename ProcessGroup::process_id_type,
- typename BOOST_DISTRIB_CSR_GRAPH_TYPE::edges_size_type>
+ typename BOOST_DISTRIB_CSR_GRAPH_TYPE::base_type::edge_descriptor>
get(edge_global_t, BOOST_DISTRIB_CSR_GRAPH_TYPE& g,
typename BOOST_DISTRIB_CSR_GRAPH_TYPE::edge_descriptor k)
{
@@ -1818,7 +1813,7 @@ get(edge_global_t, const BOOST_DISTRIB_CSR_GRAPH_TYPE& g)
template<BOOST_DISTRIB_CSR_GRAPH_TEMPLATE_PARMS>
inline
std::pair<typename ProcessGroup::process_id_type,
- typename BOOST_DISTRIB_CSR_GRAPH_TYPE::edges_size_type>
+ typename BOOST_DISTRIB_CSR_GRAPH_TYPE::base_type::edge_descriptor>
get(edge_global_t, const BOOST_DISTRIB_CSR_GRAPH_TYPE& g,
typename BOOST_DISTRIB_CSR_GRAPH_TYPE::edge_descriptor k)
{
@@ -1827,12 +1822,16 @@ get(edge_global_t, const BOOST_DISTRIB_CSR_GRAPH_TYPE& g,
const int local_index_bits =
sizeof(vertex_descriptor) * CHAR_BIT - processor_bits;
+ const typename BOOST_DISTRIB_CSR_GRAPH_TYPE::edges_size_type local_index_mask =
+ typename BOOST_DISTRIB_CSR_GRAPH_TYPE::edges_size_type(-1) >> processor_bits;
typedef std::pair<typename ProcessGroup::process_id_type,
- typename BOOST_DISTRIB_CSR_GRAPH_TYPE::edges_size_type>
+ typename BOOST_DISTRIB_CSR_GRAPH_TYPE::base_type::edge_descriptor>
result_type;
- return result_type(k.src >> local_index_bits, k.idx);
+ return result_type(k.src >> local_index_bits,
+ typename BOOST_DISTRIB_CSR_GRAPH_TYPE::base_type::edge_descriptor
+ (k.src & local_index_mask, k.idx));
}
// -----------------------------------------------------------------
@@ -1847,7 +1846,8 @@ class property_map<BOOST_DISTRIB_CSR_GRAPH_TYPE, edge_index_t>
typedef local_property_map<
typename BOOST_DISTRIB_CSR_GRAPH_TYPE::process_group_type,
global_map,
- identity_property_map> type;
+ typename property_map<typename BOOST_DISTRIB_CSR_GRAPH_TYPE::base_type, edge_index_t>::type
+ > type;
typedef type const_type;
};
@@ -1859,7 +1859,7 @@ get(edge_index_t, BOOST_DISTRIB_CSR_GRAPH_TYPE& g)
typedef typename property_map<BOOST_DISTRIB_CSR_GRAPH_TYPE, edge_index_t>
::type result_type;
return result_type(g.process_group(), get(edge_global, g),
- identity_property_map());
+ get(edge_index, g.base()));
}
template<BOOST_DISTRIB_CSR_GRAPH_TEMPLATE_PARMS>
@@ -1878,7 +1878,7 @@ get(edge_index_t, const BOOST_DISTRIB_CSR_GRAPH_TYPE& g)
typedef typename property_map<BOOST_DISTRIB_CSR_GRAPH_TYPE, edge_index_t>
::const_type result_type;
return result_type(g.process_group(), get(edge_global, g),
- identity_property_map());
+ get(edge_index, g.base()));
}
template<BOOST_DISTRIB_CSR_GRAPH_TEMPLATE_PARMS>
@@ -1889,229 +1889,67 @@ get(edge_index_t, const BOOST_DISTRIB_CSR_GRAPH_TYPE& g,
return k.idx;
}
-/* Common traits for getting vertex_bundle and edge_bundle maps */
-
-namespace detail {
- template <typename Graph, typename T> struct get_bundles;
-
- template<BOOST_DISTRIB_CSR_GRAPH_TEMPLATE_PARMS, typename T>
- class get_bundles<BOOST_DISTRIB_CSR_GRAPH_TYPE, T> {
- typedef BOOST_DISTRIB_CSR_GRAPH_TYPE Graph;
- typedef typename Graph::process_group_type process_group_type;
-
- // Extract the global property map for our key type.
- typedef typename property_map<Graph, vertex_global_t>::const_type vertex_global_map;
- typedef typename property_traits<vertex_global_map>::value_type vertex_locator;
- typedef typename property_map<Graph, edge_global_t>::const_type edge_global_map;
- typedef typename property_traits<edge_global_map>::value_type edge_locator;
-
- // Build the local property map
- typedef bundle_property_map<std::vector<VertexProperty>,
- typename vertex_locator::second_type,
- VertexProperty,
- T> vertex_local_pmap;
-
- // Build the local const property map
- typedef bundle_property_map<const std::vector<VertexProperty>,
- typename vertex_locator::second_type,
- VertexProperty,
- const T> vertex_local_const_pmap;
-
- // Build the local property map
- typedef bundle_property_map<std::vector<EdgeProperty>,
- typename edge_locator::second_type,
- EdgeProperty,
- T> edge_local_pmap;
-
- // Build the local const property map
- typedef bundle_property_map<const std::vector<EdgeProperty>,
- typename edge_locator::second_type,
- EdgeProperty,
- const T> edge_local_const_pmap;
-
- public:
- typedef ::boost::parallel::distributed_property_map<
- process_group_type, vertex_global_map, vertex_local_pmap> vertex_map_type;
-
- typedef ::boost::parallel::distributed_property_map<
- process_group_type, vertex_global_map, vertex_local_const_pmap> vertex_map_const_type;
-
- typedef ::boost::parallel::distributed_property_map<
- process_group_type, edge_global_map, edge_local_pmap> edge_map_type;
-
- typedef ::boost::parallel::distributed_property_map<
- process_group_type, edge_global_map, edge_local_const_pmap> edge_map_const_type;
-
- };
-
- template <typename Graph> struct get_full_bundles;
-
- template<BOOST_DISTRIB_CSR_GRAPH_TEMPLATE_PARMS>
- class get_full_bundles<BOOST_DISTRIB_CSR_GRAPH_TYPE> { // For vertex_bundle_t and edge_bundle_t
- typedef BOOST_DISTRIB_CSR_GRAPH_TYPE Graph;
- typedef typename Graph::process_group_type process_group_type;
-
- // Extract the global property map for our key type.
- typedef typename property_map<Graph, vertex_global_t>::const_type vertex_global_map;
- typedef typename property_traits<vertex_global_map>::value_type vertex_locator;
- typedef typename property_map<Graph, edge_global_t>::const_type edge_global_map;
- typedef typename property_traits<edge_global_map>::value_type edge_locator;
-
- // Build the local property maps
- typedef typename property_map<typename Graph::base_type, vertex_bundle_t>::type vertex_local_pmap;
- typedef typename property_map<typename Graph::base_type, vertex_bundle_t>::const_type vertex_local_const_pmap;
- typedef typename property_map<typename Graph::base_type, edge_bundle_t>::type edge_local_pmap;
- typedef typename property_map<typename Graph::base_type, edge_bundle_t>::const_type edge_local_const_pmap;
-
- public:
- typedef ::boost::parallel::distributed_property_map<
- process_group_type, vertex_global_map, vertex_local_pmap> vertex_map_type;
-
- typedef ::boost::parallel::distributed_property_map<
- process_group_type, vertex_global_map, vertex_local_const_pmap> vertex_map_const_type;
-
- typedef ::boost::parallel::distributed_property_map<
- process_group_type, edge_global_map, edge_local_pmap> edge_map_type;
-
- typedef ::boost::parallel::distributed_property_map<
- process_group_type, edge_global_map, edge_local_const_pmap> edge_map_const_type;
-
- };
-}
-
-template<BOOST_DISTRIB_CSR_GRAPH_TEMPLATE_PARMS>
-struct property_map<BOOST_DISTRIB_CSR_GRAPH_TYPE, vertex_bundle_t>
-{
- typedef typename detail::get_full_bundles<BOOST_DISTRIB_CSR_GRAPH_TYPE>::vertex_map_type type;
- typedef typename detail::get_full_bundles<BOOST_DISTRIB_CSR_GRAPH_TYPE>::vertex_map_const_type const_type;
-};
-
-template<BOOST_DISTRIB_CSR_GRAPH_TEMPLATE_PARMS>
-struct property_map<BOOST_DISTRIB_CSR_GRAPH_TYPE, edge_bundle_t>
-{
- typedef typename detail::get_full_bundles<BOOST_DISTRIB_CSR_GRAPH_TYPE>::edge_map_type type;
- typedef typename detail::get_full_bundles<BOOST_DISTRIB_CSR_GRAPH_TYPE>::edge_map_const_type const_type;
-};
-
-// -----------------------------------------------------------------
-// Bundled Properties
-template<BOOST_DISTRIB_CSR_GRAPH_TEMPLATE_PARMS, typename T, typename Bundle>
-class property_map<BOOST_DISTRIB_CSR_GRAPH_TYPE, T Bundle::*>
-{
- typedef BOOST_DISTRIB_CSR_GRAPH_TYPE Graph;
- typedef typename Graph::process_group_type process_group_type;
+template <BOOST_DISTRIB_CSR_GRAPH_TEMPLATE_PARMS, typename Tag>
+class property_map<BOOST_DISTRIB_CSR_GRAPH_TYPE, Tag> {
+ typedef BOOST_DISTRIB_CSR_GRAPH_TYPE graph_type;
+ typedef typename graph_type::process_group_type process_group_type;
+ typedef typename graph_type::base_type base_graph_type;
+ typedef typename property_map<base_graph_type, Tag>::type
+ local_pmap;
+ typedef typename property_map<base_graph_type, Tag>::const_type
+ local_const_pmap;
+
+ typedef graph_traits<graph_type> traits;
+ typedef typename graph_traits<base_graph_type>::vertex_descriptor local_vertex;
+ typedef typename property_traits<local_pmap>::key_type local_key_type;
+
+ typedef typename property_traits<local_pmap>::value_type value_type;
+
+ typedef typename property_map<graph_type, vertex_global_t>::const_type
+ vertex_global_map;
+ typedef typename property_map<graph_type, edge_global_t>::const_type
+ edge_global_map;
+
+ typedef typename mpl::if_<is_same<typename detail::property_kind_from_graph<base_graph_type, Tag>::type,
+ vertex_property_tag>,
+ vertex_global_map, edge_global_map>::type
+ global_map;
public:
- typedef typename mpl::if_<detail::is_vertex_bundle<VertexProperty,
- EdgeProperty,
- Bundle>,
- typename detail::get_bundles<BOOST_DISTRIB_CSR_GRAPH_TYPE, T>::vertex_map_type,
- typename detail::get_bundles<BOOST_DISTRIB_CSR_GRAPH_TYPE, T>::edge_map_type>
- ::type type;
-
- typedef typename mpl::if_<detail::is_vertex_bundle<VertexProperty,
- EdgeProperty,
- Bundle>,
- typename detail::get_bundles<BOOST_DISTRIB_CSR_GRAPH_TYPE, T>::vertex_map_const_type,
- typename detail::get_bundles<BOOST_DISTRIB_CSR_GRAPH_TYPE, T>::edge_map_const_type>
- ::type const_type;
-};
-
-namespace detail {
- // Retrieve the local bundle_property_map corresponding to a
- // non-const vertex property.
- template<typename Graph, typename T, typename Bundle>
- inline bundle_property_map<std::vector<typename Graph::vertex_bundled>,
- typename Graph::vertex_descriptor,
- typename Graph::vertex_bundled, T>
- get_distrib_csr_bundle(T Bundle::* p, Graph& g, mpl::true_)
- {
- typedef bundle_property_map<std::vector<typename Graph::vertex_bundled>,
- typename Graph::vertex_descriptor,
- typename Graph::vertex_bundled, T> result_type;
- return result_type(&g.base().vertex_properties().m_vertex_properties, p);
- }
-
- // Retrieve the local bundle_property_map corresponding to a
- // const vertex property.
- template<typename Graph, typename T, typename Bundle>
- inline bundle_property_map<const std::vector<typename Graph::vertex_bundled>,
- typename Graph::vertex_descriptor,
- typename Graph::vertex_bundled, const T>
- get_distrib_csr_bundle(T Bundle::* p, const Graph& g, mpl::true_)
- {
- typedef bundle_property_map<
- const std::vector<typename Graph::vertex_bundled>,
- typename Graph::vertex_descriptor,
- typename Graph::vertex_bundled, const T> result_type;
- return result_type(&g.base().vertex_properties().m_vertex_properties, p);
- }
+ typedef ::boost::parallel::distributed_property_map<
+ process_group_type, global_map, local_pmap> type;
- // Retrieve the local bundle_property_map corresponding to a
- // non-const edge property.
- template<typename Graph, typename T, typename Bundle>
- inline bundle_property_map<std::vector<typename Graph::edge_bundled>,
- typename Graph::edges_size_type,
- typename Graph::edge_bundled, T>
- get_distrib_csr_bundle(T Bundle::* p, Graph& g, mpl::false_)
- {
- typedef bundle_property_map<std::vector<typename Graph::edge_bundled>,
- typename Graph::edges_size_type,
- typename Graph::edge_bundled, T> result_type;
- return result_type(&g.base().edge_properties().m_edge_properties, p);
- }
-
- // Retrieve the local bundle_property_map corresponding to a
- // const edge property.
- template<typename Graph, typename T, typename Bundle>
- inline bundle_property_map<const std::vector<typename Graph::edge_bundled>,
- typename Graph::edges_size_type,
- typename Graph::edge_bundled, const T>
- get_distrib_csr_bundle(T Bundle::* p, const Graph& g, mpl::false_)
- {
- typedef bundle_property_map<
- const std::vector<typename Graph::edge_bundled>,
- typename Graph::edges_size_type,
- typename Graph::edge_bundled, const T> result_type;
- return result_type(&g.base().edge_properties().m_edge_properties, p);
- }
-}
+ typedef ::boost::parallel::distributed_property_map<
+ process_group_type, global_map, local_const_pmap> const_type;
+};
-template<BOOST_DISTRIB_CSR_GRAPH_TEMPLATE_PARMS, typename T, typename Bundle>
-typename property_map<BOOST_DISTRIB_CSR_GRAPH_TYPE, T Bundle::*>::type
-get(T Bundle::* p, BOOST_DISTRIB_CSR_GRAPH_TYPE& g)
+template <BOOST_DISTRIB_CSR_GRAPH_TEMPLATE_PARMS, typename Tag>
+typename property_map<BOOST_DISTRIB_CSR_GRAPH_TYPE, Tag>::type
+get(Tag tag, BOOST_DISTRIB_CSR_GRAPH_TYPE& g)
{
typedef BOOST_DISTRIB_CSR_GRAPH_TYPE Graph;
- typedef typename property_map<Graph, T Bundle::*>::type result_type;
-
- // Resolver
+ typedef typename property_map<Graph, Tag>::type result_type;
typedef typename property_traits<result_type>::value_type value_type;
- typedef typename property_reduce<T Bundle::*>::template apply<value_type>
+ typedef typename property_reduce<Tag>::template apply<value_type>
reduce;
- typedef typename property_traits<result_type>::key_type descriptor;
- typedef typename graph_traits<Graph>::vertex_descriptor vertex_descriptor;
- typedef typename mpl::if_<is_same<descriptor, vertex_descriptor>,
+ typedef typename mpl::if_<is_same<typename detail::property_kind_from_graph<Graph, Tag>::type,
+ vertex_property_tag>,
vertex_global_t, edge_global_t>::type
global_map_t;
return result_type(g.process_group(), get(global_map_t(), g),
- detail::get_distrib_csr_bundle
- (p, g, mpl::bool_<is_same<descriptor,
- vertex_descriptor>::value>()),
- reduce());
+ get(tag, g.base()), reduce());
}
-template<BOOST_DISTRIB_CSR_GRAPH_TEMPLATE_PARMS, typename T, typename Bundle>
-typename property_map<BOOST_DISTRIB_CSR_GRAPH_TYPE, T Bundle::*>::const_type
-get(T Bundle::* p, const BOOST_DISTRIB_CSR_GRAPH_TYPE& g)
+template<BOOST_DISTRIB_CSR_GRAPH_TEMPLATE_PARMS, typename Tag>
+typename property_map<BOOST_DISTRIB_CSR_GRAPH_TYPE, Tag>::const_type
+get(Tag tag, const BOOST_DISTRIB_CSR_GRAPH_TYPE& g)
{
typedef BOOST_DISTRIB_CSR_GRAPH_TYPE Graph;
- typedef typename property_map<Graph, T Bundle::*>::const_type result_type;
-
- // Resolver
+ typedef typename property_map<Graph, Tag>::const_type result_type;
typedef typename property_traits<result_type>::value_type value_type;
- typedef typename property_reduce<T Bundle::*>::template apply<value_type>
+ typedef typename property_reduce<Tag>::template apply<value_type>
reduce;
typedef typename property_traits<result_type>::key_type descriptor;
@@ -2121,10 +1959,7 @@ get(T Bundle::* p, const BOOST_DISTRIB_CSR_GRAPH_TYPE& g)
global_map_t;
return result_type(g.process_group(), get(global_map_t(), g),
- detail::get_distrib_csr_bundle
- (p, g, mpl::bool_<is_same<descriptor,
- vertex_descriptor>::value>()),
- reduce());
+ get(tag, g.base()), reduce());
}
namespace mpi {
diff --git a/boost/graph/distributed/dijkstra_shortest_paths.hpp b/boost/graph/distributed/dijkstra_shortest_paths.hpp
index f72fa11a50..acfd194400 100644
--- a/boost/graph/distributed/dijkstra_shortest_paths.hpp
+++ b/boost/graph/distributed/dijkstra_shortest_paths.hpp
@@ -49,7 +49,7 @@ namespace boost {
};
template<>
- struct parallel_dijkstra_impl2< ::boost::detail::error_property_not_found >
+ struct parallel_dijkstra_impl2< ::boost::param_not_found >
{
template<typename DistributedGraph, typename DijkstraVisitor,
typename PredecessorMap, typename DistanceMap,
@@ -60,7 +60,7 @@ namespace boost {
run(const DistributedGraph& g,
typename graph_traits<DistributedGraph>::vertex_descriptor s,
PredecessorMap predecessor, DistanceMap distance,
- ::boost::detail::error_property_not_found,
+ ::boost::param_not_found,
WeightMap weight, IndexMap index_map, ColorMap color_map,
Compare compare, Combine combine, DistInf inf, DistZero zero,
DijkstraVisitor vis)
@@ -95,7 +95,7 @@ namespace boost {
};
template<>
- struct parallel_dijkstra_impl< ::boost::detail::error_property_not_found >
+ struct parallel_dijkstra_impl< ::boost::param_not_found >
{
private:
template<typename DistributedGraph, typename DijkstraVisitor,
@@ -131,7 +131,7 @@ namespace boost {
typename graph_traits<DistributedGraph>::vertex_descriptor s,
PredecessorMap predecessor, DistanceMap distance,
Lookahead lookahead, WeightMap weight, IndexMap index_map,
- ::boost::detail::error_property_not_found,
+ ::boost::param_not_found,
Compare compare, Combine combine, DistInf inf, DistZero zero,
DijkstraVisitor vis)
{
@@ -190,8 +190,7 @@ namespace boost {
IndexMap> DefColorMap;
DefColorMap color_map(color.begin(), index_map);
- typedef typename property_value< bgl_named_params<T, Tag, Base>,
- vertex_color_t>::type color_map_type;
+ typedef typename get_param_type< vertex_color_t, bgl_named_params<T, Tag, Base> >::type color_map_type;
graph::detail::parallel_dijkstra_impl<color_map_type>
::run(g, s, predecessor, distance,
diff --git a/boost/graph/distributed/page_rank.hpp b/boost/graph/distributed/page_rank.hpp
index c2c230d387..1fc43ed683 100644
--- a/boost/graph/distributed/page_rank.hpp
+++ b/boost/graph/distributed/page_rank.hpp
@@ -93,6 +93,7 @@ page_rank_impl(const Graph& g, RankMap rank_map, Done done,
::const_type vertex_owner_map;
typename property_map<Graph, vertex_owner_t>::const_type
owner = get(vertex_owner, g);
+ (void)owner;
typedef typename boost::graph::parallel::process_group_type<Graph>
::type process_group_type;
diff --git a/boost/graph/eccentricity.hpp b/boost/graph/eccentricity.hpp
index a8b3e48547..63797a8309 100644
--- a/boost/graph/eccentricity.hpp
+++ b/boost/graph/eccentricity.hpp
@@ -7,7 +7,7 @@
#ifndef BOOST_GRAPH_ECCENTRICITY_HPP
#define BOOST_GRAPH_ECCENTRICITY_HPP
-#include <boost/utility.hpp>
+#include <boost/next_prior.hpp>
#include <boost/config.hpp>
#include <boost/graph/detail/geodesic.hpp>
#include <boost/concept/assert.hpp>
diff --git a/boost/graph/edmonds_karp_max_flow.hpp b/boost/graph/edmonds_karp_max_flow.hpp
index 43cc592d2e..8f86fb2026 100644
--- a/boost/graph/edmonds_karp_max_flow.hpp
+++ b/boost/graph/edmonds_karp_max_flow.hpp
@@ -52,21 +52,21 @@ namespace boost {
// find minimum residual capacity along the augmenting path
FlowValue delta = (std::numeric_limits<FlowValue>::max)();
- e = p[sink];
+ e = get(p, sink);
do {
BOOST_USING_STD_MIN();
- delta = min BOOST_PREVENT_MACRO_SUBSTITUTION(delta, residual_capacity[e]);
+ delta = min BOOST_PREVENT_MACRO_SUBSTITUTION(delta, get(residual_capacity, e));
u = source(e, g);
- e = p[u];
+ e = get(p, u);
} while (u != src);
// push delta units of flow along the augmenting path
- e = p[sink];
+ e = get(p, sink);
do {
- residual_capacity[e] -= delta;
- residual_capacity[reverse_edge[e]] += delta;
+ put(residual_capacity, e, get(residual_capacity, e) - delta);
+ put(residual_capacity, get(reverse_edge, e), get(residual_capacity, get(reverse_edge, e)) + delta);
u = source(e, g);
- e = p[u];
+ e = get(p, u);
} while (u != src);
}
@@ -94,22 +94,22 @@ namespace boost {
typename graph_traits<Graph>::out_edge_iterator ei, e_end;
for (boost::tie(u_iter, u_end) = vertices(g); u_iter != u_end; ++u_iter)
for (boost::tie(ei, e_end) = out_edges(*u_iter, g); ei != e_end; ++ei)
- res[*ei] = cap[*ei];
+ put(res, *ei, get(cap, *ei));
- color[sink] = Color::gray();
- while (color[sink] != Color::white()) {
+ put(color, sink, Color::gray());
+ while (get(color, sink) != Color::white()) {
boost::queue<vertex_t> Q;
breadth_first_search
(detail::residual_graph(g, res), src, Q,
make_bfs_visitor(record_edge_predecessors(pred, on_tree_edge())),
color);
- if (color[sink] != Color::white())
+ if (get(color, sink) != Color::white())
detail::augment(g, src, sink, pred, res, rev);
} // while
typename property_traits<CapacityEdgeMap>::value_type flow = 0;
for (boost::tie(ei, e_end) = out_edges(src, g); ei != e_end; ++ei)
- flow += (cap[*ei] - res[*ei]);
+ flow += (get(cap, *ei) - get(res, *ei));
return flow;
} // edmonds_karp_max_flow()
@@ -140,7 +140,7 @@ namespace boost {
}
};
template<>
- struct edmonds_karp_dispatch2<detail::error_property_not_found> {
+ struct edmonds_karp_dispatch2<param_not_found> {
template <class Graph, class PredMap, class P, class T, class R>
static typename edge_capacity_value<Graph, P, T, R>::type
apply
@@ -149,7 +149,7 @@ namespace boost {
typename graph_traits<Graph>::vertex_descriptor sink,
PredMap pred,
const bgl_named_params<P, T, R>& params,
- detail::error_property_not_found)
+ param_not_found)
{
typedef typename graph_traits<Graph>::edge_descriptor edge_descriptor;
typedef typename graph_traits<Graph>::vertices_size_type size_type;
@@ -183,13 +183,13 @@ namespace boost {
const bgl_named_params<P, T, R>& params,
PredMap pred)
{
- typedef typename property_value< bgl_named_params<P,T,R>, vertex_color_t>::type C;
+ typedef typename get_param_type< vertex_color_t, bgl_named_params<P,T,R> >::type C;
return edmonds_karp_dispatch2<C>::apply
(g, src, sink, pred, params, get_param(params, vertex_color));
}
};
template<>
- struct edmonds_karp_dispatch1<detail::error_property_not_found> {
+ struct edmonds_karp_dispatch1<param_not_found> {
template <class Graph, class P, class T, class R>
static typename edge_capacity_value<Graph, P, T, R>::type
@@ -198,7 +198,7 @@ namespace boost {
typename graph_traits<Graph>::vertex_descriptor src,
typename graph_traits<Graph>::vertex_descriptor sink,
const bgl_named_params<P, T, R>& params,
- detail::error_property_not_found)
+ param_not_found)
{
typedef typename graph_traits<Graph>::edge_descriptor edge_descriptor;
typedef typename graph_traits<Graph>::vertices_size_type size_type;
@@ -206,7 +206,7 @@ namespace boost {
num_vertices(g) : 1;
std::vector<edge_descriptor> pred_vec(n);
- typedef typename property_value< bgl_named_params<P,T,R>, vertex_color_t>::type C;
+ typedef typename get_param_type< vertex_color_t, bgl_named_params<P,T,R> >::type C;
return edmonds_karp_dispatch2<C>::apply
(g, src, sink,
make_iterator_property_map(pred_vec.begin(), choose_const_pmap
@@ -227,7 +227,7 @@ namespace boost {
typename graph_traits<Graph>::vertex_descriptor sink,
const bgl_named_params<P, T, R>& params)
{
- typedef typename property_value< bgl_named_params<P,T,R>, vertex_predecessor_t>::type Pred;
+ typedef typename get_param_type< vertex_predecessor_t, bgl_named_params<P,T,R> >::type Pred;
return detail::edmonds_karp_dispatch1<Pred>::apply
(g, src, sink, params, get_param(params, vertex_predecessor));
}
diff --git a/boost/graph/fruchterman_reingold.hpp b/boost/graph/fruchterman_reingold.hpp
index 4ce502e83b..bab353f334 100644
--- a/boost/graph/fruchterman_reingold.hpp
+++ b/boost/graph/fruchterman_reingold.hpp
@@ -363,7 +363,7 @@ namespace detail {
};
template<>
- struct fr_force_directed_layout<error_property_not_found>
+ struct fr_force_directed_layout<param_not_found>
{
template<typename Topology, typename Graph, typename PositionMap,
typename AttractiveForce, typename RepulsiveForce,
@@ -377,7 +377,7 @@ namespace detail {
RepulsiveForce repulsive_force,
ForcePairs force_pairs,
Cooling cool,
- error_property_not_found,
+ param_not_found,
const bgl_named_params<Param, Tag, Rest>& params)
{
typedef typename Topology::point_difference_type PointDiff;
@@ -404,8 +404,7 @@ fruchterman_reingold_force_directed_layout
const Topology& topology,
const bgl_named_params<Param, Tag, Rest>& params)
{
- typedef typename property_value<bgl_named_params<Param,Tag,Rest>,
- vertex_displacement_t>::type D;
+ typedef typename get_param_type<vertex_displacement_t, bgl_named_params<Param,Tag,Rest> >::type D;
detail::fr_force_directed_layout<D>::run
(g, position, topology,
diff --git a/boost/graph/graph_archetypes.hpp b/boost/graph/graph_archetypes.hpp
index 9b364bb814..81f9c2c8a8 100644
--- a/boost/graph/graph_archetypes.hpp
+++ b/boost/graph/graph_archetypes.hpp
@@ -53,6 +53,8 @@ namespace boost { // should use a different namespace for this
typedef void in_edge_iterator;
typedef void vertex_iterator;
typedef void edge_iterator;
+
+ static vertex_descriptor null_vertex() {return vertex_descriptor();}
};
template <typename V, typename D, typename P, typename B>
V source(const typename incidence_graph_archetype<V,D,P,B>::edge_descriptor&,
@@ -105,6 +107,8 @@ namespace boost { // should use a different namespace for this
typedef void out_edge_iterator;
typedef void vertex_iterator;
typedef void edge_iterator;
+
+ static vertex_descriptor null_vertex() {return vertex_descriptor();}
};
template <typename V, typename D, typename P, typename B>
@@ -154,6 +158,8 @@ namespace boost { // should use a different namespace for this
typedef void in_edge_iterator;
typedef void edge_iterator;
+
+ static vertex_descriptor null_vertex() {return vertex_descriptor();}
};
template <typename V, typename D, typename P, typename B>
diff --git a/boost/graph/graph_test.hpp b/boost/graph/graph_test.hpp
index 7b3a5402bd..69d89f34f2 100644
--- a/boost/graph/graph_test.hpp
+++ b/boost/graph/graph_test.hpp
@@ -325,10 +325,10 @@ namespace boost {
template <typename PropVal, typename PropertyTag>
void test_readable_vertex_property_graph
- (const std::vector<PropVal>& vertex_prop, PropertyTag, const Graph& g)
+ (const std::vector<PropVal>& vertex_prop, PropertyTag tag, const Graph& g)
{
typedef typename property_map<Graph, PropertyTag>::const_type const_Map;
- const_Map pmap = get(PropertyTag(), g);
+ const_Map pmap = get(tag, g);
typename std::vector<PropVal>::const_iterator i = vertex_prop.begin();
for (typename boost::graph_traits<Graph>::vertex_iterator
@@ -339,7 +339,7 @@ namespace boost {
++bgl_first_9) {
//BGL_FORALL_VERTICES_T(v, g, Graph) {
typename property_traits<const_Map>::value_type
- pval1 = get(pmap, v), pval2 = get(PropertyTag(), g, v);
+ pval1 = get(pmap, v), pval2 = get(tag, g, v);
BOOST_CHECK(pval1 == pval2);
BOOST_CHECK(pval1 == *i++);
}
@@ -350,7 +350,7 @@ namespace boost {
(const std::vector<PropVal>& vertex_prop, PropertyTag tag, Graph& g)
{
typedef typename property_map<Graph, PropertyTag>::type PMap;
- PMap pmap = get(PropertyTag(), g);
+ PMap pmap = get(tag, g);
typename std::vector<PropVal>::const_iterator i = vertex_prop.begin();
for (typename boost::graph_traits<Graph>::vertex_iterator
bgl_first_9 = vertices(g).first, bgl_last_9 = vertices(g).second;
@@ -368,7 +368,7 @@ namespace boost {
typename std::vector<PropVal>::const_iterator j = vertex_prop.begin();
BGL_FORALL_VERTICES_T(v, g, Graph)
- put(PropertyTag(), g, v, *j++);
+ put(tag, g, v, *j++);
test_readable_vertex_property_graph(vertex_prop, tag, g);
}
diff --git a/boost/graph/graph_traits.hpp b/boost/graph/graph_traits.hpp
index fad82f9d2f..625429e611 100644
--- a/boost/graph/graph_traits.hpp
+++ b/boost/graph/graph_traits.hpp
@@ -15,8 +15,11 @@
#include <utility> /* Primarily for std::pair */
#include <boost/tuple/tuple.hpp>
#include <boost/mpl/if.hpp>
+#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/not.hpp>
+#include <boost/mpl/has_xxx.hpp>
+#include <boost/mpl/void.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/iterator/iterator_categories.hpp>
#include <boost/iterator/iterator_adaptor.hpp>
@@ -218,28 +221,31 @@ namespace boost {
//?? not the right place ?? Lee
typedef boost::forward_traversal_tag multi_pass_input_iterator_tag;
- // Forward declare graph_bundle_t property name (from
- // boost/graph/properties.hpp, which includes this file) for
- // bundled_result.
- enum graph_bundle_t {graph_bundle};
+ namespace detail {
+ BOOST_MPL_HAS_XXX_TRAIT_DEF(graph_property_type)
+ BOOST_MPL_HAS_XXX_TRAIT_DEF(edge_property_type)
+ BOOST_MPL_HAS_XXX_TRAIT_DEF(vertex_property_type)
+
+ template <typename G> struct get_graph_property_type {typedef typename G::graph_property_type type;};
+ template <typename G> struct get_edge_property_type {typedef typename G::edge_property_type type;};
+ template <typename G> struct get_vertex_property_type {typedef typename G::vertex_property_type type;};
+ }
template <typename G>
- struct graph_property_type {
- typedef typename G::graph_property_type type;
- };
+ struct graph_property_type
+ : boost::mpl::eval_if<detail::has_graph_property_type<G>,
+ detail::get_graph_property_type<G>,
+ no_property> {};
template <typename G>
- struct edge_property_type {
- typedef typename G::edge_property_type type;
- };
+ struct edge_property_type
+ : boost::mpl::eval_if<detail::has_edge_property_type<G>,
+ detail::get_edge_property_type<G>,
+ no_property> {};
template <typename G>
- struct vertex_property_type {
- typedef typename G::vertex_property_type type;
- };
-
- struct no_bundle { };
- struct no_graph_bundle : no_bundle { };
- struct no_vertex_bundle : no_bundle { };
- struct no_edge_bundle : no_bundle { };
+ struct vertex_property_type
+ : boost::mpl::eval_if<detail::has_vertex_property_type<G>,
+ detail::get_vertex_property_type<G>,
+ no_property> {};
template<typename G>
struct graph_bundle_type {
@@ -281,7 +287,7 @@ namespace boost {
// A helper metafunction for determining whether or not a type is
// bundled.
template <typename T>
- struct is_no_bundle : mpl::bool_<is_convertible<T, no_bundle>::value>
+ struct is_no_bundle : mpl::bool_<is_same<T, no_property>::value>
{ };
} // namespace graph_detail
diff --git a/boost/graph/graphml.hpp b/boost/graph/graphml.hpp
index 2239d96661..028cdc26ca 100644
--- a/boost/graph/graphml.hpp
+++ b/boost/graph/graphml.hpp
@@ -262,7 +262,7 @@ write_graphml(std::ostream& out, const Graph& g, VertexIndexMap vertex_index,
for (dynamic_properties::const_iterator i = dp.begin(); i != dp.end(); ++i)
{
std::string key_id = "key" + lexical_cast<std::string>(key_count++);
- if (i->second->key() == typeid(Graph))
+ if (i->second->key() == typeid(Graph*))
graph_key_ids[i->first] = key_id;
else if (i->second->key() == typeid(vertex_descriptor))
vertex_key_ids[i->first] = key_id;
@@ -273,7 +273,7 @@ write_graphml(std::ostream& out, const Graph& g, VertexIndexMap vertex_index,
std::string type_name = "string";
mpl::for_each<value_types>(get_type_name<value_types>(i->second->value(), type_names, type_name));
out << " <key id=\"" << encode_char_entities(key_id) << "\" for=\""
- << (i->second->key() == typeid(Graph) ? "graph" : (i->second->key() == typeid(vertex_descriptor) ? "node" : "edge")) << "\""
+ << (i->second->key() == typeid(Graph*) ? "graph" : (i->second->key() == typeid(vertex_descriptor) ? "node" : "edge")) << "\""
<< " attr.name=\"" << i->first << "\""
<< " attr.type=\"" << type_name << "\""
<< " />\n";
@@ -287,10 +287,12 @@ write_graphml(std::ostream& out, const Graph& g, VertexIndexMap vertex_index,
// Output graph data
for (dynamic_properties::const_iterator i = dp.begin(); i != dp.end(); ++i)
{
- if (i->second->key() == typeid(Graph))
+ if (i->second->key() == typeid(Graph*))
{
+ // The const_cast here is just to get typeid correct for property
+ // map key; the graph should not be mutated using it.
out << " <data key=\"" << graph_key_ids[i->first] << "\">"
- << encode_char_entities(i->second->get_string(g)) << "</data>\n";
+ << encode_char_entities(i->second->get_string(const_cast<Graph*>(&g))) << "</data>\n";
}
}
diff --git a/boost/graph/graphviz.hpp b/boost/graph/graphviz.hpp
index 718220ffec..aedce5553c 100644
--- a/boost/graph/graphviz.hpp
+++ b/boost/graph/graphviz.hpp
@@ -25,10 +25,14 @@
#include <boost/property_map/dynamic_property_map.hpp>
#include <boost/graph/overloading.hpp>
#include <boost/graph/dll_import_export.hpp>
+#include <boost/graph/compressed_sparse_row_graph.hpp>
+#include <boost/graph/iteration_macros.hpp>
#include <boost/spirit/include/classic_multi_pass.hpp>
#include <boost/lexical_cast.hpp>
+#include <boost/static_assert.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/xpressive/xpressive_static.hpp>
+#include <boost/foreach.hpp>
namespace boost {
@@ -713,6 +717,9 @@ class mutate_graph
virtual void // RG: need new second parameter to support BGL subgraphs
set_graph_property(const id_t& key, const id_t& value) = 0;
+
+ virtual void
+ finish_building_graph() = 0;
};
template<typename MutableGraph>
@@ -781,6 +788,8 @@ class mutate_graph_impl : public mutate_graph
put(key, dp_, &graph_, value);
}
+ void finish_building_graph() {}
+
protected:
MutableGraph& graph_;
@@ -790,6 +799,109 @@ class mutate_graph_impl : public mutate_graph
std::map<edge_t, bgl_edge_t> bgl_edges;
};
+template<typename Directed,
+ typename VertexProperty,
+ typename EdgeProperty,
+ typename GraphProperty,
+ typename Vertex,
+ typename EdgeIndex>
+class mutate_graph_impl<compressed_sparse_row_graph<Directed, VertexProperty, EdgeProperty, GraphProperty, Vertex, EdgeIndex> >
+ : public mutate_graph
+{
+ typedef compressed_sparse_row_graph<Directed, VertexProperty, EdgeProperty, GraphProperty, Vertex, EdgeIndex> CSRGraph;
+ typedef typename graph_traits<CSRGraph>::vertices_size_type bgl_vertex_t;
+ typedef typename graph_traits<CSRGraph>::edges_size_type bgl_edge_t;
+ typedef typename graph_traits<CSRGraph>::edge_descriptor edge_descriptor;
+
+ public:
+ mutate_graph_impl(CSRGraph& graph, dynamic_properties& dp,
+ std::string node_id_prop)
+ : graph_(graph), dp_(dp), vertex_count(0), node_id_prop_(node_id_prop) { }
+
+ ~mutate_graph_impl() {}
+
+ void finish_building_graph() {
+ typedef compressed_sparse_row_graph<directedS, no_property, bgl_edge_t, GraphProperty, Vertex, EdgeIndex> TempCSRGraph;
+ TempCSRGraph temp(edges_are_unsorted_multi_pass,
+ edges_to_add.begin(), edges_to_add.end(),
+ counting_iterator<bgl_edge_t>(0),
+ vertex_count);
+ set_property(temp, graph_all, get_property(graph_, graph_all));
+ graph_.assign(temp); // Copies structure, not properties
+ std::vector<edge_descriptor> edge_permutation_from_sorting(num_edges(temp));
+ BGL_FORALL_EDGES_T(e, temp, TempCSRGraph) {
+ edge_permutation_from_sorting[temp[e]] = e;
+ }
+ typedef boost::tuple<id_t, bgl_vertex_t, id_t> v_prop;
+ BOOST_FOREACH(const v_prop& t, vertex_props) {
+ put(boost::get<0>(t), dp_, boost::get<1>(t), boost::get<2>(t));
+ }
+ typedef boost::tuple<id_t, bgl_edge_t, id_t> e_prop;
+ BOOST_FOREACH(const e_prop& t, edge_props) {
+ put(boost::get<0>(t), dp_, edge_permutation_from_sorting[boost::get<1>(t)], boost::get<2>(t));
+ }
+ }
+
+ bool is_directed() const
+ {
+ return
+ boost::is_convertible<
+ typename boost::graph_traits<CSRGraph>::directed_category,
+ boost::directed_tag>::value;
+ }
+
+ virtual void do_add_vertex(const node_t& node)
+ {
+ // Add the node to the graph.
+ bgl_vertex_t v = vertex_count++;
+
+ // Set up a mapping from name to BGL vertex.
+ bgl_nodes.insert(std::make_pair(node, v));
+
+ // node_id_prop_ allows the caller to see the real id names for nodes.
+ vertex_props.push_back(boost::make_tuple(node_id_prop_, v, node));
+ }
+
+ void
+ do_add_edge(const edge_t& edge, const node_t& source, const node_t& target)
+ {
+ bgl_edge_t result = edges_to_add.size();
+ edges_to_add.push_back(std::make_pair(bgl_nodes[source], bgl_nodes[target]));
+ bgl_edges.insert(std::make_pair(edge, result));
+ }
+
+ void
+ set_node_property(const id_t& key, const node_t& node, const id_t& value)
+ {
+ vertex_props.push_back(boost::make_tuple(key, bgl_nodes[node], value));
+ }
+
+ void
+ set_edge_property(const id_t& key, const edge_t& edge, const id_t& value)
+ {
+ edge_props.push_back(boost::make_tuple(key, bgl_edges[edge], value));
+ }
+
+ void
+ set_graph_property(const id_t& key, const id_t& value)
+ {
+ /* RG: pointer to graph prevents copying */
+ put(key, dp_, &graph_, value);
+ }
+
+
+ protected:
+ CSRGraph& graph_;
+ dynamic_properties& dp_;
+ bgl_vertex_t vertex_count;
+ std::string node_id_prop_;
+ std::vector<boost::tuple<id_t, bgl_vertex_t, id_t> > vertex_props;
+ std::vector<boost::tuple<id_t, bgl_edge_t, id_t> > edge_props;
+ std::vector<std::pair<bgl_vertex_t, bgl_vertex_t> > edges_to_add;
+ std::map<node_t, bgl_vertex_t> bgl_nodes;
+ std::map<edge_t, bgl_edge_t> bgl_edges;
+};
+
} } } // end namespace boost::detail::graph
#ifdef BOOST_GRAPH_USE_SPIRIT_PARSER
diff --git a/boost/graph/grid_graph.hpp b/boost/graph/grid_graph.hpp
index f63f3d01e6..7bb3732422 100644
--- a/boost/graph/grid_graph.hpp
+++ b/boost/graph/grid_graph.hpp
@@ -17,7 +17,6 @@
#include <boost/array.hpp>
#include <boost/bind.hpp>
#include <boost/limits.hpp>
-#include <boost/make_shared.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/properties.hpp>
#include <boost/iterator/counting_iterator.hpp>
@@ -63,14 +62,14 @@ namespace boost {
grid_graph_index_map() { }
grid_graph_index_map(const Graph& graph) :
- m_graph(make_shared<Graph>(graph)) { }
+ m_graph(&graph) { }
value_type operator[](key_type key) const {
return (m_graph->index_of(key));
}
protected:
- shared_ptr<Graph> m_graph;
+ const Graph* m_graph;
};
template<BOOST_GRID_GRAPH_TEMPLATE_PARAMS>
diff --git a/boost/graph/is_kuratowski_subgraph.hpp b/boost/graph/is_kuratowski_subgraph.hpp
index 8791b4cf18..1dd314d317 100644
--- a/boost/graph/is_kuratowski_subgraph.hpp
+++ b/boost/graph/is_kuratowski_subgraph.hpp
@@ -9,7 +9,6 @@
#define __IS_KURATOWSKI_SUBGRAPH_HPP__
#include <boost/config.hpp>
-#include <boost/utility.hpp> //for next/prior
#include <boost/tuple/tuple.hpp> //for tie
#include <boost/property_map/property_map.hpp>
#include <boost/graph/properties.hpp>
@@ -301,11 +300,11 @@ namespace boost
if (target_graph == detail::tg_k_5)
{
- return isomorphism(K_5,contracted_graph);
+ return boost::isomorphism(K_5,contracted_graph);
}
else //target_graph == tg_k_3_3
{
- return isomorphism(K_3_3,contracted_graph);
+ return boost::isomorphism(K_3_3,contracted_graph);
}
diff --git a/boost/graph/is_straight_line_drawing.hpp b/boost/graph/is_straight_line_drawing.hpp
index 74775b44f5..c471cde8be 100644
--- a/boost/graph/is_straight_line_drawing.hpp
+++ b/boost/graph/is_straight_line_drawing.hpp
@@ -9,7 +9,7 @@
#define __IS_STRAIGHT_LINE_DRAWING_HPP__
#include <boost/config.hpp>
-#include <boost/utility.hpp> //for next and prior
+#include <boost/next_prior.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/tuple/tuple_comparison.hpp>
#include <boost/property_map/property_map.hpp>
@@ -19,6 +19,7 @@
#include <algorithm>
#include <vector>
#include <set>
+#include <map>
@@ -34,12 +35,12 @@ namespace boost
// defines how far away from the endpoints of s1 and s2 we want to consider
// an intersection.
- bool intersects(double x1, double y1,
- double x2, double y2,
- double a1, double b1,
- double a2, double b2,
- double epsilon = 0.000001
- )
+ inline bool intersects(double x1, double y1,
+ double x2, double y2,
+ double a1, double b1,
+ double a2, double b2,
+ double epsilon = 0.000001
+ )
{
if (x1 - x2 == 0)
diff --git a/boost/graph/isomorphism.hpp b/boost/graph/isomorphism.hpp
index bbdd1f7b41..99055f35c8 100644
--- a/boost/graph/isomorphism.hpp
+++ b/boost/graph/isomorphism.hpp
@@ -11,8 +11,9 @@
#include <iterator>
#include <algorithm>
#include <boost/config.hpp>
+#include <boost/assert.hpp>
+#include <boost/smart_ptr.hpp>
#include <boost/graph/depth_first_search.hpp>
-#include <boost/utility.hpp>
#include <boost/detail/algorithm.hpp>
#include <boost/pending/indirect_cmp.hpp> // for make_indirect_pmap
#include <boost/concept/assert.hpp>
@@ -134,6 +135,10 @@ namespace boost {
bool test_isomorphism()
{
+ // reset isomapping
+ BGL_FORALL_VERTICES_T(v, G1, Graph1)
+ f[v] = graph_traits<Graph2>::null_vertex();
+
{
std::vector<invar1_value> invar1_array;
BGL_FORALL_VERTICES_T(v, G1, Graph1)
@@ -195,69 +200,130 @@ namespace boost {
}
private:
+ struct match_continuation {
+ enum {pos_G2_vertex_loop, pos_fi_adj_loop, pos_dfs_num} position;
+ typedef typename graph_traits<Graph2>::vertex_iterator vertex_iterator;
+ std::pair<vertex_iterator, vertex_iterator> G2_verts;
+ typedef typename graph_traits<Graph2>::adjacency_iterator adjacency_iterator;
+ std::pair<adjacency_iterator, adjacency_iterator> fi_adj;
+ edge_iter iter;
+ int dfs_num_k;
+ };
+
bool match(edge_iter iter, int dfs_num_k)
{
+ std::vector<match_continuation> k;
+ typedef typename graph_traits<Graph2>::vertex_iterator vertex_iterator;
+ std::pair<vertex_iterator, vertex_iterator> G2_verts(vertices(G2));
+ typedef typename graph_traits<Graph2>::adjacency_iterator adjacency_iterator;
+ std::pair<adjacency_iterator, adjacency_iterator> fi_adj;
+ vertex1_t i, j;
+
+ recur:
if (iter != ordered_edges.end()) {
- vertex1_t i = source(*iter, G1), j = target(*iter, G2);
+ i = source(*iter, G1);
+ j = target(*iter, G2);
if (dfs_num[i] > dfs_num_k) {
- vertex1_t kp1 = dfs_vertices[dfs_num_k + 1];
- BGL_FORALL_VERTICES_T(u, G2, Graph2) {
- if (invariant1(kp1) == invariant2(u) && in_S[u] == false) {
- f[kp1] = u;
- in_S[u] = true;
- num_edges_on_k = 0;
-
- if (match(iter, dfs_num_k + 1))
-#if 0
- // dwa 2003/7/11 -- this *HAS* to be a bug!
- ;
-#endif
- return true;
+ G2_verts = vertices(G2);
+ while (G2_verts.first != G2_verts.second) {
+ {
+ vertex2_t u = *G2_verts.first;
+ vertex1_t kp1 = dfs_vertices[dfs_num_k + 1];
+ if (invariant1(kp1) == invariant2(u) && in_S[u] == false) {
+ {
+ f[kp1] = u;
+ in_S[u] = true;
+ num_edges_on_k = 0;
- in_S[u] = false;
+ match_continuation new_k;
+ new_k.position = match_continuation::pos_G2_vertex_loop;
+ new_k.G2_verts = G2_verts;
+ new_k.iter = iter;
+ new_k.dfs_num_k = dfs_num_k;
+ k.push_back(new_k);
+ ++dfs_num_k;
+ goto recur;
+ }
+ }
}
+G2_loop_k: ++G2_verts.first;
}
}
else if (dfs_num[j] > dfs_num_k) {
- vertex1_t k = dfs_vertices[dfs_num_k];
- num_edges_on_k -=
- count_if(adjacent_vertices(f[k], G2), make_indirect_pmap(in_S));
-
- for (int jj = 0; jj < dfs_num_k; ++jj) {
- vertex1_t j = dfs_vertices[jj];
- num_edges_on_k -= count(adjacent_vertices(f[j], G2), f[k]);
+ {
+ vertex1_t vk = dfs_vertices[dfs_num_k];
+ num_edges_on_k -=
+ count_if(adjacent_vertices(f[vk], G2), make_indirect_pmap(in_S));
+
+ for (int jj = 0; jj < dfs_num_k; ++jj) {
+ vertex1_t j = dfs_vertices[jj];
+ num_edges_on_k -= count(adjacent_vertices(f[j], G2), f[vk]);
+ }
}
if (num_edges_on_k != 0)
- return false;
- BGL_FORALL_ADJ_T(f[i], v, G2, Graph2)
- if (invariant2(v) == invariant1(j) && in_S[v] == false) {
- f[j] = v;
- in_S[v] = true;
- num_edges_on_k = 1;
- BOOST_USING_STD_MAX();
- int next_k = max BOOST_PREVENT_MACRO_SUBSTITUTION(dfs_num_k, max BOOST_PREVENT_MACRO_SUBSTITUTION(dfs_num[i], dfs_num[j]));
- if (match(boost::next(iter), next_k))
- return true;
- in_S[v] = false;
+ goto return_point_false;
+ fi_adj = adjacent_vertices(f[i], G2);
+ while (fi_adj.first != fi_adj.second) {
+ {
+ vertex2_t v = *fi_adj.first;
+ if (invariant2(v) == invariant1(j) && in_S[v] == false) {
+ f[j] = v;
+ in_S[v] = true;
+ num_edges_on_k = 1;
+ BOOST_USING_STD_MAX();
+ int next_k = max BOOST_PREVENT_MACRO_SUBSTITUTION(dfs_num_k, max BOOST_PREVENT_MACRO_SUBSTITUTION(dfs_num[i], dfs_num[j]));
+ match_continuation new_k;
+ new_k.position = match_continuation::pos_fi_adj_loop;
+ new_k.fi_adj = fi_adj;
+ new_k.iter = iter;
+ new_k.dfs_num_k = dfs_num_k;
+ ++iter;
+ dfs_num_k = next_k;
+ k.push_back(new_k);
+ goto recur;
+ }
}
-
-
+fi_adj_loop_k:++fi_adj.first;
+ }
}
else {
if (container_contains(adjacent_vertices(f[i], G2), f[j])) {
++num_edges_on_k;
- if (match(boost::next(iter), dfs_num_k))
- return true;
+ match_continuation new_k;
+ new_k.position = match_continuation::pos_dfs_num;
+ k.push_back(new_k);
+ ++iter;
+ goto recur;
}
}
} else
- return true;
- return false;
- }
+ goto return_point_true;
+ goto return_point_false;
+ {
+ return_point_true: return true;
+
+ return_point_false:
+ if (k.empty()) return false;
+ const match_continuation& this_k = k.back();
+ switch (this_k.position) {
+ case match_continuation::pos_G2_vertex_loop: {G2_verts = this_k.G2_verts; iter = this_k.iter; dfs_num_k = this_k.dfs_num_k; k.pop_back(); in_S[*G2_verts.first] = false; i = source(*iter, G1); j = target(*iter, G2); goto G2_loop_k;}
+ case match_continuation::pos_fi_adj_loop: {fi_adj = this_k.fi_adj; iter = this_k.iter; dfs_num_k = this_k.dfs_num_k; k.pop_back(); in_S[*fi_adj.first] = false; i = source(*iter, G1); j = target(*iter, G2); goto fi_adj_loop_k;}
+ case match_continuation::pos_dfs_num: {k.pop_back(); goto return_point_false;}
+ default: {
+ BOOST_ASSERT(!"Bad position");
+#ifdef UNDER_CE
+ exit(-1);
+#else
+ abort();
+#endif
+ }
+ }
+ }
+ }
};
@@ -404,39 +470,68 @@ namespace boost {
index_map1, index_map2
);
}
+
+ template <typename G, typename Index>
+ struct make_degree_invariant {
+ const G& g;
+ const Index& index;
+ make_degree_invariant(const G& g, const Index& index): g(g), index(index) {}
+ typedef typename boost::graph_traits<G>::degree_size_type degree_size_type;
+ typedef shared_array_property_map<degree_size_type, Index> prop_map_type;
+ typedef degree_vertex_invariant<prop_map_type, G> result_type;
+ result_type operator()() const {
+ prop_map_type pm = make_shared_array_property_map(num_vertices(g), degree_size_type(), index);
+ compute_in_degree(g, pm);
+ return result_type(pm, g);
+ }
+ };
} // namespace detail
-
- // Named parameter interface
- template <typename Graph1, typename Graph2, class P, class T, class R>
- bool isomorphism(const Graph1& g1,
- const Graph2& g2,
- const bgl_named_params<P,T,R>& params)
- {
- typedef typename graph_traits<Graph2>::vertex_descriptor vertex2_t;
- typename std::vector<vertex2_t>::size_type n = num_vertices(g1);
- std::vector<vertex2_t> f(n);
- return detail::isomorphism_impl
- (g1, g2,
- choose_param(get_param(params, vertex_isomorphism_t()),
- make_safe_iterator_property_map(f.begin(), f.size(),
- choose_const_pmap(get_param(params, vertex_index1),
- g1, vertex_index), vertex2_t())),
- choose_const_pmap(get_param(params, vertex_index1), g1, vertex_index),
- choose_const_pmap(get_param(params, vertex_index2), g2, vertex_index),
- params
- );
- }
-
- // All defaults interface
- template <typename Graph1, typename Graph2>
- bool isomorphism(const Graph1& g1, const Graph2& g2)
- {
- return isomorphism(g1, g2,
- bgl_named_params<int, buffer_param_t>(0));// bogus named param
+ namespace graph {
+ namespace detail {
+ template <typename Graph1, typename Graph2>
+ struct isomorphism_impl {
+ typedef bool result_type;
+ template <typename ArgPack>
+ bool operator()(const Graph1& g1, const Graph2& g2, const ArgPack& arg_pack) const {
+ using namespace boost::graph::keywords;
+ typedef typename boost::detail::override_const_property_result<ArgPack, tag::vertex_index1_map, boost::vertex_index_t, Graph1>::type index1_map_type;
+ typedef typename boost::detail::override_const_property_result<ArgPack, tag::vertex_index2_map, boost::vertex_index_t, Graph2>::type index2_map_type;
+ index1_map_type index1_map = boost::detail::override_const_property(arg_pack, _vertex_index1_map, g1, boost::vertex_index);
+ index2_map_type index2_map = boost::detail::override_const_property(arg_pack, _vertex_index2_map, g2, boost::vertex_index);
+ typedef typename graph_traits<Graph2>::vertex_descriptor vertex2_t;
+ typename std::vector<vertex2_t>::size_type n = (typename std::vector<vertex2_t>::size_type)num_vertices(g1);
+ std::vector<vertex2_t> f(n);
+ typename boost::parameter::lazy_binding<
+ ArgPack,
+ tag::vertex_invariant1,
+ boost::detail::make_degree_invariant<Graph1, index1_map_type> >::type
+ invariant1 =
+ arg_pack[_vertex_invariant1 || boost::detail::make_degree_invariant<Graph1, index1_map_type>(g1, index1_map)];
+ typename boost::parameter::lazy_binding<
+ ArgPack,
+ tag::vertex_invariant2,
+ boost::detail::make_degree_invariant<Graph2, index2_map_type> >::type
+ invariant2 =
+ arg_pack[_vertex_invariant2 || boost::detail::make_degree_invariant<Graph2, index2_map_type>(g2, index2_map)];
+ return boost::isomorphism
+ (g1, g2,
+ choose_param(arg_pack[_isomorphism_map | boost::param_not_found()],
+ make_shared_array_property_map(num_vertices(g1), vertex2_t(), index1_map)),
+ invariant1,
+ invariant2,
+ arg_pack[_vertex_max_invariant | (invariant2.max)()],
+ index1_map,
+ index2_map);
+ }
+ };
+ }
+ BOOST_GRAPH_MAKE_FORWARDING_FUNCTION(isomorphism, 2, 6)
}
+ // Named parameter interface
+ BOOST_GRAPH_MAKE_OLD_STYLE_PARAMETER_FUNCTION(isomorphism, 2)
// Verify that the given mapping iso_map from the vertices of g1 to the
// vertices of g2 describes an isomorphism.
diff --git a/boost/graph/johnson_all_pairs_shortest.hpp b/boost/graph/johnson_all_pairs_shortest.hpp
index 32e2b5cdcd..b8da0fe19a 100644
--- a/boost/graph/johnson_all_pairs_shortest.hpp
+++ b/boost/graph/johnson_all_pairs_shortest.hpp
@@ -121,8 +121,6 @@ namespace boost {
(g2, *u, pred, d, w_hat, id2, compare, combine, inf, zero,dvis);
for (boost::tie(v, v_end) = vertices(g2); v != v_end; ++v) {
if (*u != s && *v != s) {
- typename Traits1::vertex_descriptor u1, v1;
- u1 = verts1[get(id2, *u)]; v1 = verts1[get(id2, *v)];
D[get(id2, *u)-1][get(id2, *v)-1] = combine(get(d, *v), (get(h, *v) - get(h, *u)));
}
}
diff --git a/boost/graph/make_connected.hpp b/boost/graph/make_connected.hpp
index de6c861ddd..a2f8b1ee48 100644
--- a/boost/graph/make_connected.hpp
+++ b/boost/graph/make_connected.hpp
@@ -9,7 +9,7 @@
#define __MAKE_CONNECTED_HPP__
#include <boost/config.hpp>
-#include <boost/utility.hpp> //for next
+#include <boost/next_prior.hpp>
#include <boost/tuple/tuple.hpp> //for tie
#include <boost/graph/connected_components.hpp>
#include <boost/property_map/property_map.hpp>
diff --git a/boost/graph/matrix_as_graph.hpp b/boost/graph/matrix_as_graph.hpp
index b39d126a23..fb727940d7 100644
--- a/boost/graph/matrix_as_graph.hpp
+++ b/boost/graph/matrix_as_graph.hpp
@@ -14,7 +14,7 @@
#include <utility>
#include <boost/config.hpp>
#include <boost/operators.hpp>
-#include <boost/int_iterator.hpp>
+#include <boost/pending/detail/int_iterator.hpp>
#include <boost/graph/graph_traits.hpp>
namespace boost {
diff --git a/boost/graph/max_cardinality_matching.hpp b/boost/graph/max_cardinality_matching.hpp
index 043f701478..5516bebc47 100644
--- a/boost/graph/max_cardinality_matching.hpp
+++ b/boost/graph/max_cardinality_matching.hpp
@@ -16,7 +16,6 @@
#include <algorithm> // for std::sort and std::stable_sort
#include <utility> // for std::pair
#include <boost/property_map/property_map.hpp>
-#include <boost/utility.hpp> // for boost::tie
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/visitors.hpp>
#include <boost/graph/depth_first_search.hpp>
diff --git a/boost/graph/named_function_params.hpp b/boost/graph/named_function_params.hpp
index c5e35fa54e..32dd580232 100644
--- a/boost/graph/named_function_params.hpp
+++ b/boost/graph/named_function_params.hpp
@@ -13,11 +13,12 @@
#include <functional>
#include <vector>
#include <boost/ref.hpp>
+#include <boost/utility/result_of.hpp>
+#include <boost/preprocessor.hpp>
#include <boost/parameter/name.hpp>
#include <boost/parameter/binding.hpp>
-#include <boost/type_traits/is_same.hpp>
+#include <boost/type_traits.hpp>
#include <boost/mpl/not.hpp>
-#include <boost/type_traits/add_reference.hpp>
#include <boost/graph/properties.hpp>
#include <boost/graph/detail/d_ary_heap.hpp>
#include <boost/property_map/property_map.hpp>
@@ -111,15 +112,16 @@ namespace boost {
BOOST_BGL_ONE_PARAM_REF(max_priority_queue, max_priority_queue)
template <typename T, typename Tag, typename Base = no_property>
- struct bgl_named_params : public Base
+ struct bgl_named_params
{
typedef bgl_named_params self;
typedef Base next_type;
typedef Tag tag_type;
typedef T value_type;
bgl_named_params(T v = T()) : m_value(v) { }
- bgl_named_params(T v, const Base& b) : Base(b), m_value(v) { }
+ bgl_named_params(T v, const Base& b) : m_value(v), m_base(b) { }
T m_value;
+ Base m_base;
#define BOOST_BGL_ONE_PARAM_REF(name, key) \
template <typename PType> \
@@ -182,145 +184,147 @@ BOOST_BGL_DECLARE_NAMED_PARAMS
//===========================================================================
// Functions for extracting parameters from bgl_named_params
- template <class Tag1, class Tag2, class T1, class Base>
- inline
- typename property_value< bgl_named_params<T1,Tag1,Base>, Tag2>::type
- get_param(const bgl_named_params<T1,Tag1,Base>& p, Tag2 tag2)
- {
- enum { match = detail::same_property<Tag1,Tag2>::value };
- typedef typename
- property_value< bgl_named_params<T1,Tag1,Base>, Tag2>::type T2;
- T2* t2 = 0;
- typedef detail::property_value_dispatch<match> Dispatcher;
- return Dispatcher::const_get_value(p, t2, tag2);
- }
+ template <typename Tag, typename Args>
+ struct lookup_named_param {};
+ template <typename T, typename Tag, typename Base>
+ struct lookup_named_param<Tag, bgl_named_params<T, Tag, Base> > {
+ typedef T type;
+ static const T& get(const bgl_named_params<T, Tag, Base>& p) {
+ return p.m_value;
+ }
+ };
- namespace detail {
- // MSVC++ workaround
- template <class Param>
- struct choose_param_helper {
- template <class Default> struct result { typedef Param type; };
- template <typename Default>
- static const Param& apply(const Param& p, const Default&) { return p; }
- };
- template <>
- struct choose_param_helper<error_property_not_found> {
- template <class Default> struct result { typedef Default type; };
- template <typename Default>
- static const Default& apply(const error_property_not_found&, const Default& d)
- { return d; }
- };
- } // namespace detail
+ template <typename Tag1, typename T, typename Tag, typename Base>
+ struct lookup_named_param<Tag1, bgl_named_params<T, Tag, Base> > {
+ typedef typename lookup_named_param<Tag1, Base>::type type;
+ static const type& get(const bgl_named_params<T, Tag, Base>& p) {
+ return lookup_named_param<Tag1, Base>::get(p.m_base);
+ }
+ };
+
+ template <typename Tag, typename Args, typename Def>
+ struct lookup_named_param_def {
+ typedef Def type;
+ static const Def& get(const Args&, const Def& def) {return def;}
+ };
+
+ template <typename T, typename Tag, typename Base, typename Def>
+ struct lookup_named_param_def<Tag, bgl_named_params<T, Tag, Base>, Def> {
+ typedef T type;
+ static const type& get(const bgl_named_params<T, Tag, Base>& p, const Def&) {
+ return p.m_value;
+ }
+ };
+
+ template <typename Tag1, typename T, typename Tag, typename Base, typename Def>
+ struct lookup_named_param_def<Tag1, bgl_named_params<T, Tag, Base>, Def> {
+ typedef typename lookup_named_param_def<Tag1, Base, Def>::type type;
+ static const type& get(const bgl_named_params<T, Tag, Base>& p, const Def& def) {
+ return lookup_named_param_def<Tag1, Base, Def>::get(p.m_base, def);
+ }
+ };
+
+ struct param_not_found {};
+
+ template <typename Tag, typename Args>
+ struct get_param_type:
+ lookup_named_param_def<Tag, Args, param_not_found> {};
+
+ template <class Tag, typename Args>
+ inline
+ const typename lookup_named_param_def<Tag, Args, param_not_found>::type&
+ get_param(const Args& p, Tag) {
+ return lookup_named_param_def<Tag, Args, param_not_found>::get(p, param_not_found());
+ }
template <class P, class Default>
- const typename detail::choose_param_helper<P>::template result<Default>::type&
- choose_param(const P& param, const Default& d) {
- return detail::choose_param_helper<P>::apply(param, d);
+ const P& choose_param(const P& param, const Default&) {
+ return param;
+ }
+
+ template <class Default>
+ Default choose_param(const param_not_found&, const Default& d) {
+ return d;
}
template <typename T>
inline bool is_default_param(const T&) { return false; }
- inline bool is_default_param(const detail::error_property_not_found&)
+ inline bool is_default_param(const param_not_found&)
{ return true; }
namespace detail {
+ template <typename T>
+ struct const_type_as_type {typedef typename T::const_type type;};
+ } // namespace detail
+
- struct choose_parameter {
- template <class P, class Graph, class Tag>
- struct bind_ {
- typedef const P& const_result_type;
- typedef const P& result_type;
- typedef P type;
- };
-
- template <class P, class Graph, class Tag>
- static typename bind_<P, Graph, Tag>::const_result_type
- const_apply(const P& p, const Graph&, Tag&)
- { return p; }
+ // Use this function instead of choose_param() when you want
+ // to avoid requiring get(tag, g) when it is not used.
+ namespace detail {
+ template <typename GraphIsConst, typename Graph, typename Param, typename Tag>
+ struct choose_impl_result:
+ boost::mpl::eval_if<
+ boost::is_same<Param, param_not_found>,
+ boost::mpl::eval_if<
+ GraphIsConst,
+ detail::const_type_as_type<property_map<Graph, Tag> >,
+ property_map<Graph, Tag> >,
+ boost::mpl::identity<Param> > {};
+
+ // Parameters of f are (GraphIsConst, Graph, Param, Tag)
+ template <bool Found> struct choose_impl_helper;
+
+ template <> struct choose_impl_helper<false> {
+ template <typename Param, typename Graph, typename PropertyTag>
+ static typename property_map<Graph, PropertyTag>::const_type
+ f(boost::mpl::true_, const Graph& g, const Param&, PropertyTag tag) {
+ return get(tag, g);
+ }
- template <class P, class Graph, class Tag>
- static typename bind_<P, Graph, Tag>::result_type
- apply(const P& p, Graph&, Tag&)
- { return p; }
+ template <typename Param, typename Graph, typename PropertyTag>
+ static typename property_map<Graph, PropertyTag>::type
+ f(boost::mpl::false_, Graph& g, const Param&, PropertyTag tag) {
+ return get(tag, g);
+ }
};
- struct choose_default_param {
- template <class P, class Graph, class Tag>
- struct bind_ {
- typedef typename property_map<Graph, Tag>::type
- result_type;
- typedef typename property_map<Graph, Tag>::const_type
- const_result_type;
- typedef typename property_map<Graph, Tag>::const_type
- type;
- };
-
- template <class P, class Graph, class Tag>
- static typename bind_<P, Graph, Tag>::const_result_type
- const_apply(const P&, const Graph& g, Tag tag) {
- return get(tag, g);
- }
- template <class P, class Graph, class Tag>
- static typename bind_<P, Graph, Tag>::result_type
- apply(const P&, Graph& g, Tag tag) {
- return get(tag, g);
+ template <> struct choose_impl_helper<true> {
+ template <typename GraphIsConst, typename Param, typename Graph, typename PropertyTag>
+ static Param f(GraphIsConst, const Graph&, const Param& p, PropertyTag) {
+ return p;
}
};
+ }
- template <class Param>
- struct choose_property_map {
- typedef choose_parameter type;
- };
- template <>
- struct choose_property_map<detail::error_property_not_found> {
- typedef choose_default_param type;
- };
+ template <typename Param, typename Graph, typename PropertyTag>
+ typename detail::choose_impl_result<boost::mpl::true_, Graph, Param, PropertyTag>::type
+ choose_const_pmap(const Param& p, const Graph& g, PropertyTag tag)
+ {
+ return detail::choose_impl_helper<!boost::is_same<Param, param_not_found>::value>
+ ::f(boost::mpl::true_(), g, p, tag);
+ }
- template <class Param, class Graph, class Tag>
- struct choose_pmap_helper {
- typedef typename choose_property_map<Param>::type Selector;
- typedef typename Selector:: template bind_<Param, Graph, Tag> Bind;
- typedef Bind type;
- typedef typename Bind::result_type result_type;
- typedef typename Bind::const_result_type const_result_type;
- typedef typename Bind::type result;
- };
+ template <typename Param, typename Graph, typename PropertyTag>
+ typename detail::choose_impl_result<boost::mpl::false_, Graph, Param, PropertyTag>::type
+ choose_pmap(const Param& p, Graph& g, PropertyTag tag)
+ {
+ return detail::choose_impl_helper<!boost::is_same<Param, param_not_found>::value>
+ ::f(boost::mpl::false_(), g, p, tag);
+ }
+
+ namespace detail {
// used in the max-flow algorithms
template <class Graph, class P, class T, class R>
struct edge_capacity_value
{
typedef bgl_named_params<P, T, R> Params;
- typedef typename property_value< Params, edge_capacity_t>::type Param;
- typedef typename detail::choose_pmap_helper<Param, Graph,
- edge_capacity_t>::result CapacityEdgeMap;
+ typedef typename detail::choose_impl_result<boost::mpl::true_, Graph, typename get_param_type<Params, edge_capacity_t>::type, edge_capacity_t>::type CapacityEdgeMap;
typedef typename property_traits<CapacityEdgeMap>::value_type type;
};
- } // namespace detail
-
-
- // Use this function instead of choose_param() when you want
- // to avoid requiring get(tag, g) when it is not used.
- template <typename Param, typename Graph, typename PropertyTag>
- typename
- detail::choose_pmap_helper<Param,Graph,PropertyTag>::const_result_type
- choose_const_pmap(const Param& p, const Graph& g, PropertyTag tag)
- {
- typedef typename
- detail::choose_pmap_helper<Param,Graph,PropertyTag>::Selector Choice;
- return Choice::const_apply(p, g, tag);
- }
-
- template <typename Param, typename Graph, typename PropertyTag>
- typename detail::choose_pmap_helper<Param,Graph,PropertyTag>::result_type
- choose_pmap(const Param& p, Graph& g, PropertyTag tag)
- {
- typedef typename
- detail::choose_pmap_helper<Param,Graph,PropertyTag>::Selector Choice;
- return Choice::apply(p, g, tag);
}
// Declare all new tags
@@ -353,7 +357,7 @@ BOOST_BGL_DECLARE_NAMED_PARAMS
typedef convert_bgl_params_to_boost_parameter<typename T::next_type> rest_conv;
typedef boost::parameter::aux::arg_list<tagged_arg_type, typename rest_conv::type> type;
static type conv(const T& x) {
- return type(tagged_arg_type(x.m_value), rest_conv::conv(x));
+ return type(tagged_arg_type(x.m_value), rest_conv::conv(x.m_base));
}
};
@@ -362,7 +366,7 @@ BOOST_BGL_DECLARE_NAMED_PARAMS
typedef convert_bgl_params_to_boost_parameter<R> rest_conv;
typedef typename rest_conv::type type;
static type conv(const bgl_named_params<P, int, R>& x) {
- return rest_conv::conv(x);
+ return rest_conv::conv(x.m_base);
}
};
@@ -375,7 +379,7 @@ BOOST_BGL_DECLARE_NAMED_PARAMS
template <>
struct convert_bgl_params_to_boost_parameter<boost::no_named_parameters> {
typedef boost::parameter::aux::empty_arg_list type;
- static type conv(const boost::no_property&) {return type();}
+ static type conv(const boost::no_named_parameters&) {return type();}
};
struct bgl_parameter_not_found_type {};
@@ -460,6 +464,78 @@ BOOST_BGL_DECLARE_NAMED_PARAMS
>()(g, ap[t | 0]);
}
+ template <typename F> struct make_arg_pack_type;
+ template <> struct make_arg_pack_type<void()> {typedef boost::parameter::aux::empty_arg_list type;};
+ template <typename K, typename A>
+ struct make_arg_pack_type<void(K, A)> {
+ typedef boost::parameter::aux::tagged_argument<K, A> type;
+ };
+
+#define BOOST_GRAPH_OPENING_PART_OF_PAIR(z, i, n) boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<BOOST_PP_CAT(Keyword, BOOST_PP_SUB(n, i)), BOOST_PP_CAT(Arg, BOOST_PP_SUB(n, i))>,
+#define BOOST_GRAPH_MAKE_PAIR_PARAM(z, i, _) const boost::parameter::aux::tagged_argument<BOOST_PP_CAT(Keyword, i), BOOST_PP_CAT(Arg, i)>& BOOST_PP_CAT(kw, i)
+
+#define BOOST_GRAPH_MAKE_AP_TYPE_SPECIALIZATION(z, i, _) \
+ template <BOOST_PP_ENUM_PARAMS(i, typename Keyword), BOOST_PP_ENUM_PARAMS(i, typename Arg)> \
+ struct make_arg_pack_type<void(BOOST_PP_ENUM_PARAMS(i, Keyword), BOOST_PP_ENUM_PARAMS(i, Arg))> { \
+ typedef \
+ BOOST_PP_REPEAT(i, BOOST_GRAPH_OPENING_PART_OF_PAIR, BOOST_PP_DEC(i)) boost::parameter::aux::empty_arg_list BOOST_PP_REPEAT(i, > BOOST_PP_TUPLE_EAT(3), ~) \
+ type; \
+ };
+ BOOST_PP_REPEAT_FROM_TO(2, 11, BOOST_GRAPH_MAKE_AP_TYPE_SPECIALIZATION, ~)
+#undef BOOST_GRAPH_MAKE_AP_TYPE_SPECIALIZATION
+
+#define BOOST_GRAPH_MAKE_FORWARDING_FUNCTION(name, nfixed, nnamed_max) \
+ /* Entry point for conversion from BGL-style named parameters */ \
+ template <BOOST_PP_ENUM_PARAMS(nfixed, typename Param) BOOST_PP_COMMA_IF(nfixed) typename ArgPack> \
+ typename boost::result_of< \
+ detail::BOOST_PP_CAT(name, _impl)<BOOST_PP_ENUM_PARAMS(nfixed, Param)>(BOOST_PP_ENUM_PARAMS(nfixed, Param) BOOST_PP_COMMA_IF(nfixed) const ArgPack&) \
+ >::type \
+ BOOST_PP_CAT(name, _with_named_params)(BOOST_PP_ENUM_BINARY_PARAMS(nfixed, const Param, & param) BOOST_PP_COMMA_IF(nfixed) const ArgPack& arg_pack) { \
+ return detail::BOOST_PP_CAT(name, _impl)<BOOST_PP_ENUM_PARAMS(nfixed, Param)>()(BOOST_PP_ENUM_PARAMS(nfixed, param) BOOST_PP_COMMA_IF(nfixed) arg_pack); \
+ } \
+ /* Individual functions taking Boost.Parameter-style keyword arguments */ \
+ BOOST_PP_REPEAT(BOOST_PP_INC(nnamed_max), BOOST_GRAPH_MAKE_FORWARDING_FUNCTION_ONE, (name)(nfixed))
+
+#define BOOST_GRAPH_MAKE_FORWARDING_FUNCTION_ONE(z, nnamed, seq) \
+ BOOST_GRAPH_MAKE_FORWARDING_FUNCTION_ONEX(z, nnamed, BOOST_PP_SEQ_ELEM(0, seq), BOOST_PP_SEQ_ELEM(1, seq))
+
+#define BOOST_GRAPH_MAKE_FORWARDING_FUNCTION_ONEX(z, nnamed, name, nfixed) \
+ template <BOOST_PP_ENUM_PARAMS(nfixed, typename Param) BOOST_PP_ENUM_TRAILING_PARAMS(nnamed, typename Keyword) BOOST_PP_ENUM_TRAILING_PARAMS(nnamed, typename Arg)> \
+ typename boost::result_of< \
+ detail::BOOST_PP_CAT(name, _impl)<BOOST_PP_ENUM_PARAMS(nfixed, Param)> \
+ (BOOST_PP_ENUM_PARAMS(nfixed, Param) BOOST_PP_COMMA_IF(nfixed) \
+ const typename boost::detail::make_arg_pack_type<void(BOOST_PP_ENUM_PARAMS(nnamed, Keyword) BOOST_PP_COMMA_IF(nnamed) BOOST_PP_ENUM_PARAMS(nnamed, Arg))>::type&) \
+ >::type \
+ name(BOOST_PP_ENUM_BINARY_PARAMS(nfixed, const Param, & param) \
+ BOOST_PP_ENUM_TRAILING(nnamed, BOOST_GRAPH_MAKE_PAIR_PARAM, ~)) { \
+ return detail::BOOST_PP_CAT(name, _impl)<BOOST_PP_ENUM_PARAMS(nfixed, Param)>() \
+ (BOOST_PP_ENUM_PARAMS(nfixed, param), \
+ (boost::parameter::aux::empty_arg_list() BOOST_PP_ENUM_TRAILING_PARAMS(nnamed, kw))); \
+ }
+
+#define BOOST_GRAPH_MAKE_OLD_STYLE_PARAMETER_FUNCTION(name, nfixed) \
+ template <BOOST_PP_ENUM_PARAMS(nfixed, typename Param) BOOST_PP_COMMA_IF(nfixed) class P, class T, class R> \
+ typename boost::result_of< \
+ ::boost::graph::detail::BOOST_PP_CAT(name, _impl) BOOST_PP_EXPR_IF(nfixed, <) BOOST_PP_ENUM_PARAMS(nfixed, Param) BOOST_PP_EXPR_IF(nfixed, >) \
+ (BOOST_PP_ENUM_PARAMS(nfixed, Param) BOOST_PP_COMMA_IF(nfixed) \
+ const typename boost::detail::convert_bgl_params_to_boost_parameter<boost::bgl_named_params<P, T, R> >::type &) \
+ >::type \
+ name(BOOST_PP_ENUM_BINARY_PARAMS(nfixed, const Param, & param) BOOST_PP_COMMA_IF(nfixed) const boost::bgl_named_params<P, T, R>& old_style_params) { \
+ typedef boost::bgl_named_params<P, T, R> old_style_params_type; \
+ BOOST_GRAPH_DECLARE_CONVERTED_PARAMETERS(old_style_params_type, old_style_params) \
+ return ::boost::graph::BOOST_PP_CAT(name, _with_named_params)(BOOST_PP_ENUM_PARAMS(nfixed, param) BOOST_PP_COMMA_IF(nfixed) arg_pack); \
+ } \
+ \
+ BOOST_PP_EXPR_IF(nfixed, template <) BOOST_PP_ENUM_PARAMS(nfixed, typename Param) BOOST_PP_EXPR_IF(nfixed, >) \
+ BOOST_PP_EXPR_IF(nfixed, typename) boost::result_of< \
+ ::boost::graph::detail::BOOST_PP_CAT(name, _impl) BOOST_PP_EXPR_IF(nfixed, <) BOOST_PP_ENUM_PARAMS(nfixed, Param) BOOST_PP_EXPR_IF(nfixed, >) \
+ (BOOST_PP_ENUM_PARAMS(nfixed, Param) BOOST_PP_COMMA_IF(nfixed) const boost::parameter::aux::empty_arg_list &) \
+ >::type \
+ name(BOOST_PP_ENUM_BINARY_PARAMS(nfixed, const Param, & param)) { \
+ BOOST_GRAPH_DECLARE_CONVERTED_PARAMETERS(boost::no_named_parameters, boost::no_named_parameters()) \
+ return ::boost::graph::BOOST_PP_CAT(name, _with_named_params)(BOOST_PP_ENUM_PARAMS(nfixed, param) BOOST_PP_COMMA_IF(nfixed) arg_pack); \
+ }
+
}
namespace detail {
@@ -609,6 +685,13 @@ BOOST_BGL_DECLARE_NAMED_PARAMS
make_priority_queue_from_arg_pack_gen(KeyT defaultKey_) : defaultKey(defaultKey_) { }
+ template <class F>
+ struct result {
+ typedef typename remove_const<typename remove_reference<typename function_traits<F>::arg1_type>::type>::type graph_type;
+ typedef typename remove_const<typename remove_reference<typename function_traits<F>::arg2_type>::type>::type arg_pack_type;
+ typedef typename priority_queue_maker<graph_type, arg_pack_type, KeyT, ValueT, PriorityQueueTag, KeyMapTag, IndexInHeapMapTag, Compare>::priority_queue_type type;
+ };
+
template <class Graph, class ArgPack>
typename priority_queue_maker<Graph, ArgPack, KeyT, ValueT, PriorityQueueTag, KeyMapTag, IndexInHeapMapTag, Compare>::priority_queue_type
operator()(const Graph& g, const ArgPack& ap) const {
@@ -616,6 +699,25 @@ BOOST_BGL_DECLARE_NAMED_PARAMS
}
};
+ template <typename G>
+ typename boost::graph_traits<G>::vertex_descriptor
+ get_null_vertex(const G&) {return boost::graph_traits<G>::null_vertex();}
+
+ template <typename G>
+ typename boost::graph_traits<G>::vertex_descriptor
+ get_default_starting_vertex(const G& g) {
+ std::pair<typename boost::graph_traits<G>::vertex_iterator, typename boost::graph_traits<G>::vertex_iterator> iters = vertices(g);
+ return (iters.first == iters.second) ? boost::graph_traits<G>::null_vertex() : *iters.first;
+ }
+
+ template <typename G>
+ struct get_default_starting_vertex_t {
+ typedef typename boost::graph_traits<G>::vertex_descriptor result_type;
+ const G& g;
+ get_default_starting_vertex_t(const G& g): g(g) {}
+ result_type operator()() const {return get_default_starting_vertex(g);}
+ };
+
} // namespace detail
} // namespace boost
diff --git a/boost/graph/named_graph.hpp b/boost/graph/named_graph.hpp
index 38f4ca0e1e..f49c09707d 100644
--- a/boost/graph/named_graph.hpp
+++ b/boost/graph/named_graph.hpp
@@ -156,51 +156,6 @@ struct internal_vertex_constructor<property<Tag, T, Base> >
#endif
/*******************************************************************
- * Named graph-specific metafunctions *
- *******************************************************************/
-namespace detail {
- /** @internal
- * Extracts the type of a bundled vertex property from a vertex
- * property. The primary template matches when we have hit the end
- * of the @c property<> list.
- */
- template<typename VertexProperty>
- struct extract_bundled_vertex
- {
- typedef VertexProperty type;
- };
-
- /** @internal
- * Recursively extract the bundled vertex property from a vertex
- * property.
- */
- template<typename Tag, typename T, typename Base>
- struct extract_bundled_vertex<property<Tag, T, Base> >
- : extract_bundled_vertex<Base>
- { };
-
- /**
- * We have found the bundled vertex property type, marked with
- * vertex_bundle_t.
- */
- template<typename T, typename Base>
- struct extract_bundled_vertex<property<vertex_bundle_t, T, Base> >
- {
- typedef T type;
- };
-
- /**
- * Translate @c no_property into @c error_property_not_found when we
- * have failed to extract a bundled vertex property type.
- */
- template<>
- struct extract_bundled_vertex<no_property>
- {
- typedef boost::detail::error_property_not_found type;
- };
-}
-
-/*******************************************************************
* Named graph mixin *
*******************************************************************/
@@ -228,7 +183,7 @@ public:
typedef typename internal_vertex_name<VertexProperty>::type extract_name_type;
/// The type of the "bundled" property, from which the name can be
/// extracted.
- typedef typename detail::extract_bundled_vertex<VertexProperty>::type
+ typedef typename lookup_one_property<VertexProperty, vertex_bundle_t>::type
bundled_vertex_property_type;
/// The type of the function object that generates vertex properties
@@ -477,7 +432,7 @@ struct maybe_named_graph<Graph, Vertex, VertexProperty, void>
{
/// The type of the "bundled" property, from which the name can be
/// extracted.
- typedef typename detail::extract_bundled_vertex<VertexProperty>::type
+ typedef typename lookup_one_property<VertexProperty, vertex_bundle_t>::type
bundled_vertex_property_type;
/// Notify the named_graph that we have added the given vertex. This
diff --git a/boost/graph/neighbor_bfs.hpp b/boost/graph/neighbor_bfs.hpp
index 4585f2e298..4830dcc4ed 100644
--- a/boost/graph/neighbor_bfs.hpp
+++ b/boost/graph/neighbor_bfs.hpp
@@ -250,13 +250,13 @@ namespace boost {
};
template <>
- struct neighbor_bfs_dispatch<detail::error_property_not_found> {
+ struct neighbor_bfs_dispatch<param_not_found> {
template <class VertexListGraph, class P, class T, class R>
static void apply
(VertexListGraph& g,
typename graph_traits<VertexListGraph>::vertex_descriptor s,
const bgl_named_params<P, T, R>& params,
- detail::error_property_not_found)
+ param_not_found)
{
std::vector<default_color_type> color_vec(num_vertices(g));
null_visitor null_vis;
@@ -288,8 +288,7 @@ namespace boost {
// graph is not really const since we may write to property maps
// of the graph.
VertexListGraph& ng = const_cast<VertexListGraph&>(g);
- typedef typename property_value< bgl_named_params<P,T,R>,
- vertex_color_t>::type C;
+ typedef typename get_param_type< vertex_color_t, bgl_named_params<P,T,R> >::type C;
detail::neighbor_bfs_dispatch<C>::apply(ng, s, params,
get_param(params, vertex_color));
}
diff --git a/boost/graph/planar_canonical_ordering.hpp b/boost/graph/planar_canonical_ordering.hpp
index 6cb7bdb824..86203aaf38 100644
--- a/boost/graph/planar_canonical_ordering.hpp
+++ b/boost/graph/planar_canonical_ordering.hpp
@@ -12,7 +12,7 @@
#include <vector>
#include <list>
#include <boost/config.hpp>
-#include <boost/utility.hpp> //for next and prior
+#include <boost/next_prior.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/property_map/property_map.hpp>
diff --git a/boost/graph/planar_detail/boyer_myrvold_impl.hpp b/boost/graph/planar_detail/boyer_myrvold_impl.hpp
index 71607fcbc2..41ba2bc575 100644
--- a/boost/graph/planar_detail/boyer_myrvold_impl.hpp
+++ b/boost/graph/planar_detail/boyer_myrvold_impl.hpp
@@ -10,7 +10,7 @@
#include <vector>
#include <list>
-#include <boost/utility.hpp> //for boost::next
+#include <boost/next_prior.hpp>
#include <boost/config.hpp> //for std::min macros
#include <boost/shared_ptr.hpp>
#include <boost/tuple/tuple.hpp>
diff --git a/boost/graph/planar_face_traversal.hpp b/boost/graph/planar_face_traversal.hpp
index bcd565528d..6befa43bac 100644
--- a/boost/graph/planar_face_traversal.hpp
+++ b/boost/graph/planar_face_traversal.hpp
@@ -10,8 +10,11 @@
#define __PLANAR_FACE_TRAVERSAL_HPP__
#include <vector>
-#include <boost/utility.hpp> //for next and prior
+#include <set>
+#include <map>
+#include <boost/next_prior.hpp>
#include <boost/graph/graph_traits.hpp>
+#include <boost/graph/properties.hpp>
namespace boost
diff --git a/boost/graph/properties.hpp b/boost/graph/properties.hpp
index bc498bbf9c..6b5ade974a 100644
--- a/boost/graph/properties.hpp
+++ b/boost/graph/properties.hpp
@@ -68,26 +68,20 @@ namespace boost {
struct vertex_property_tag { };
struct edge_property_tag { };
-#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
// See examples/edge_property.cpp for how to use this.
#define BOOST_INSTALL_PROPERTY(KIND, NAME) \
template <> struct property_kind<KIND##_##NAME##_t> { \
typedef KIND##_property_tag type; \
}
-#else
-#define BOOST_INSTALL_PROPERTY(KIND, NAME) \
- template <> struct property_kind<KIND##_##NAME##_t> { \
- typedef KIND##_property_tag type; \
- }
-#endif
#define BOOST_DEF_PROPERTY(KIND, NAME) \
enum KIND##_##NAME##_t { KIND##_##NAME }; \
BOOST_INSTALL_PROPERTY(KIND, NAME)
- BOOST_DEF_PROPERTY(vertex, all);
- BOOST_DEF_PROPERTY(edge, all);
- BOOST_DEF_PROPERTY(graph, all);
+ // These three are defined in boost/pending/property.hpp
+ BOOST_INSTALL_PROPERTY(vertex, all);
+ BOOST_INSTALL_PROPERTY(edge, all);
+ BOOST_INSTALL_PROPERTY(graph, all);
BOOST_DEF_PROPERTY(vertex, index);
BOOST_DEF_PROPERTY(vertex, index1);
BOOST_DEF_PROPERTY(vertex, index2);
@@ -128,10 +122,10 @@ namespace boost {
BOOST_DEF_PROPERTY(graph, visitor);
// These tags are used for property bundles
- // BOOST_DEF_PROPERTY(graph, bundle); -- needed in graph_traits.hpp, so enum is defined there
+ // These three are defined in boost/pending/property.hpp
BOOST_INSTALL_PROPERTY(graph, bundle);
- BOOST_DEF_PROPERTY(vertex, bundle);
- BOOST_DEF_PROPERTY(edge, bundle);
+ BOOST_INSTALL_PROPERTY(vertex, bundle);
+ BOOST_INSTALL_PROPERTY(edge, bundle);
// These tags are used to denote the owners and local descriptors
// for the vertices and edges of a distributed graph.
@@ -148,6 +142,25 @@ namespace boost {
namespace detail {
+ template <typename G, typename Tag>
+ struct property_kind_from_graph: property_kind<Tag> {};
+
+#ifndef BOOST_GRAPH_NO_BUNDLED_PROPERTIES
+ template <typename G, typename R, typename T>
+ struct property_kind_from_graph<G, R T::*> {
+ typedef typename boost::mpl::if_<
+ boost::is_same<T, typename vertex_bundle_type<G>::type>,
+ vertex_property_tag,
+ typename boost::mpl::if_<
+ boost::is_same<T, typename edge_bundle_type<G>::type>,
+ edge_property_tag,
+ typename boost::mpl::if_<
+ boost::is_same<T, typename graph_bundle_type<G>::type>,
+ graph_property_tag,
+ void>::type>::type>::type type;
+ };
+#endif
+
struct dummy_edge_property_selector {
template <class Graph, class Property, class Tag>
struct bind_ {
@@ -192,70 +205,32 @@ namespace boost {
};
template <class Graph, class PropertyTag>
- struct edge_property_map {
- typedef typename edge_property_type<Graph>::type Property;
- typedef typename graph_tag_or_void<Graph>::type graph_tag;
- typedef typename edge_property_selector<graph_tag>::type Selector;
- typedef typename Selector::template bind_<Graph,Property,PropertyTag>
- Bind;
- typedef typename Bind::type type;
- typedef typename Bind::const_type const_type;
- };
+ struct edge_property_map
+ : edge_property_selector<
+ typename graph_tag_or_void<Graph>::type
+ >::type::template bind_<
+ Graph,
+ typename edge_property_type<Graph>::type,
+ PropertyTag>
+ {};
template <class Graph, class PropertyTag>
- class vertex_property_map {
- public:
- typedef typename vertex_property_type<Graph>::type Property;
- typedef typename graph_tag_or_void<Graph>::type graph_tag;
- typedef typename vertex_property_selector<graph_tag>::type Selector;
- typedef typename Selector::template bind_<Graph,Property,PropertyTag>
- Bind;
- public:
- typedef typename Bind::type type;
- typedef typename Bind::const_type const_type;
- };
-
- // This selects the kind of property map, whether is maps from
- // edges or from vertices.
- //
- // It is overly complicated because it's a workaround for
- // partial specialization.
- struct choose_vertex_property_map {
- template <class Graph, class Property>
- struct bind_ {
- typedef vertex_property_map<Graph, Property> type;
- };
- };
- struct choose_edge_property_map {
- template <class Graph, class Property>
- struct bind_ {
- typedef edge_property_map<Graph, Property> type;
- };
- };
- template <class Kind>
- struct property_map_kind_selector {
- // VC++ gets confused if this isn't defined, even though
- // this never gets used.
- typedef choose_vertex_property_map type;
- };
- template <> struct property_map_kind_selector<vertex_property_tag> {
- typedef choose_vertex_property_map type;
- };
- template <> struct property_map_kind_selector<edge_property_tag> {
- typedef choose_edge_property_map type;
- };
+ struct vertex_property_map
+ : vertex_property_selector<
+ typename graph_tag_or_void<Graph>::type
+ >::type::template bind_<
+ Graph,
+ typename vertex_property_type<Graph>::type,
+ PropertyTag>
+ {};
} // namespace detail
template <class Graph, class Property>
- struct property_map {
- // private:
- typedef typename property_kind<Property>::type Kind;
- typedef typename detail::property_map_kind_selector<Kind>::type Selector;
- typedef typename Selector::template bind_<Graph, Property> Bind;
- typedef typename Bind::type Map;
- public:
- typedef typename Map::type type;
- typedef typename Map::const_type const_type;
- };
+ struct property_map:
+ mpl::if_<
+ is_same<typename detail::property_kind_from_graph<Graph, Property>::type, edge_property_tag>,
+ detail::edge_property_map<Graph, Property>,
+ detail::vertex_property_map<Graph, Property> >::type
+ {};
// shortcut for accessing the value type of the property map
template <class Graph, class Property>
@@ -273,16 +248,8 @@ namespace boost {
>::type type;
};
- template <class Graph>
- class vertex_property {
- public:
- typedef typename Graph::vertex_property_type type;
- };
- template <class Graph>
- class edge_property {
- public:
- typedef typename Graph::edge_property_type type;
- };
+ template <class Graph> class vertex_property: vertex_property_type<Graph> {};
+ template <class Graph> class edge_property: edge_property_type<Graph> {};
template <typename Graph>
class degree_property_map
@@ -383,99 +350,6 @@ namespace boost {
# define BOOST_GRAPH_NO_BUNDLED_PROPERTIES
#endif
-#ifndef BOOST_GRAPH_NO_BUNDLED_PROPERTIES
- template<typename Graph, typename Descriptor, typename Bundle, typename T>
- struct bundle_property_map
- : put_get_helper<T&, bundle_property_map<Graph, Descriptor, Bundle, T> >
- {
- typedef Descriptor key_type;
- typedef typename remove_const<T>::type value_type;
- typedef T& reference;
- typedef lvalue_property_map_tag category;
-
- bundle_property_map() { }
- bundle_property_map(Graph* g_, T Bundle::* pm_) : g(g_), pm(pm_) {}
-
- reference operator[](key_type k) const { return (*g)[k].*pm; }
- private:
- Graph* g;
- T Bundle::* pm;
- };
-
- namespace detail {
- template<typename VertexBundle, typename EdgeBundle, typename Bundle>
- struct is_vertex_bundle
- : mpl::and_<is_convertible<VertexBundle*, Bundle*>,
- mpl::and_<mpl::not_<is_void<VertexBundle> >,
- mpl::not_<is_same<VertexBundle, no_property> > > >
- { };
- }
-
- // Specialize the property map template to generate bundled property maps.
- template <typename Graph, typename T, typename Bundle>
- struct property_map<Graph, T Bundle::*>
- {
- private:
- typedef graph_traits<Graph> traits;
- typedef typename Graph::vertex_bundled vertex_bundled;
- typedef typename Graph::edge_bundled edge_bundled;
- typedef typename mpl::if_c<(detail::is_vertex_bundle<vertex_bundled, edge_bundled, Bundle>::value),
- typename traits::vertex_descriptor,
- typename traits::edge_descriptor>::type
- descriptor;
- typedef typename mpl::if_c<(detail::is_vertex_bundle<vertex_bundled, edge_bundled, Bundle>::value),
- vertex_bundled,
- edge_bundled>::type
- actual_bundle;
-
- public:
- typedef bundle_property_map<Graph, descriptor, actual_bundle, T> type;
- typedef bundle_property_map<const Graph, descriptor, actual_bundle, const T>
- const_type;
- };
-#endif
-
-// These metafunctions help implement the process of determining the vertex
-// and edge properties of a graph.
-namespace graph_detail {
- template<typename Retag>
- struct retagged_property {
- typedef typename Retag::type type;
- };
-
- // Search the normalized PropList (as returned by retagged<>::type) for
- // the given bundle. Return the type error if no such bundle can be found.
- template <typename PropList, typename Bundle>
- struct retagged_bundle {
- typedef typename property_value<PropList, Bundle>::type Value;
- typedef typename mpl::if_<
- is_same<Value, detail::error_property_not_found>, no_bundle, Value
- >::type type;
- };
-
- template<typename Prop, typename Bundle>
- class normal_property {
- // Normalize the property into a property list.
- typedef detail::retag_property_list<Bundle, Prop> List;
- public:
- // Extract the normalized property and bundle types.
- typedef typename retagged_property<List>::type property;
- typedef typename retagged_bundle<property, Bundle>::type bundle;
- };
-
- template<typename Prop>
- struct graph_prop : normal_property<Prop, graph_bundle_t>
- { };
-
- template<typename Prop>
- struct vertex_prop : normal_property<Prop, vertex_bundle_t>
- { };
-
- template<typename Prop>
- struct edge_prop : normal_property<Prop, edge_bundle_t>
- { };
-} // namespace graph_detail
-
// NOTE: These functions are declared, but never defined since they need to
// be overloaded by graph implementations. However, we need them to be
// declared for the functions below.
@@ -498,17 +372,11 @@ get_property(Graph& g) {
template<typename Graph>
inline typename graph_property<Graph, graph_bundle_t>::type const&
-get_property(Graph const& g) {
+get_property(const Graph& g) {
return get_property(g, graph_bundle);
}
#endif
} // namespace boost
-#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
-// Stay out of the way of the concept checking class
-# undef Graph
-# undef RandomAccessIterator
-#endif
-
-#endif /* BOOST_GRAPH_PROPERTIES_HPPA */
+#endif /* BOOST_GRAPH_PROPERTIES_HPP */
diff --git a/boost/graph/property_maps/null_property_map.hpp b/boost/graph/property_maps/null_property_map.hpp
index f6273481b0..09ff55e348 100644
--- a/boost/graph/property_maps/null_property_map.hpp
+++ b/boost/graph/property_maps/null_property_map.hpp
@@ -29,7 +29,7 @@ namespace boost
// The null_property_map<K,V> only has a put() function.
template <typename K, typename V>
- void put(null_property_map<K,V>& pm, const K& key, const V& value)
+ void put(null_property_map<K,V>& /*pm*/, const K& /*key*/, const V& /*value*/)
{ }
// A helper function for intantiating null property maps.
diff --git a/boost/graph/reverse_graph.hpp b/boost/graph/reverse_graph.hpp
index 48c4e0576e..96fc32d3ae 100644
--- a/boost/graph/reverse_graph.hpp
+++ b/boost/graph/reverse_graph.hpp
@@ -105,6 +105,7 @@ class reverse_graph {
typedef graph_traits<BidirectionalGraph> Traits;
public:
typedef BidirectionalGraph base_type;
+ typedef GraphRef base_ref_type;
// Constructor
reverse_graph(GraphRef g) : m_g(g) {}
@@ -358,47 +359,38 @@ namespace detail {
}
};
- struct reverse_graph_vertex_property_selector {
- template <class ReverseGraph, class Property, class Tag>
- struct bind_ {
- typedef typename ReverseGraph::base_type Graph;
- typedef property_map<Graph, Tag> PMap;
- typedef typename PMap::type type;
- typedef typename PMap::const_type const_type;
- };
- };
-
- struct reverse_graph_edge_property_selector {
- template <class ReverseGraph, class Property, class Tag>
- struct bind_ {
- typedef typename ReverseGraph::base_type Graph;
- typedef property_map<Graph, Tag> PMap;
- typedef reverse_graph_edge_property_map<typename PMap::type> type;
- typedef reverse_graph_edge_property_map<typename PMap::const_type> const_type;
- };
- };
-
} // namespace detail
-template <>
-struct vertex_property_selector<reverse_graph_tag> {
- typedef detail::reverse_graph_vertex_property_selector type;
+template <class BidirGraph, class GRef, class Property>
+struct property_map<reverse_graph<BidirGraph, GRef>, Property> {
+ typedef boost::is_same<typename detail::property_kind_from_graph<BidirGraph, Property>::type, edge_property_tag> is_edge_prop;
+ typedef typename property_map<BidirGraph, Property>::type orig_type;
+ typedef typename property_map<BidirGraph, Property>::const_type orig_const_type;
+ typedef typename boost::mpl::if_<is_edge_prop, detail::reverse_graph_edge_property_map<orig_type>, orig_type>::type type;
+ typedef typename boost::mpl::if_<is_edge_prop, detail::reverse_graph_edge_property_map<orig_const_type>, orig_const_type>::type const_type;
};
-template <>
-struct edge_property_selector<reverse_graph_tag> {
- typedef detail::reverse_graph_edge_property_selector type;
+template <class BidirGraph, class GRef, class Property>
+struct property_map<const reverse_graph<BidirGraph, GRef>, Property> {
+ typedef boost::is_same<typename detail::property_kind_from_graph<BidirGraph, Property>::type, edge_property_tag> is_edge_prop;
+ typedef typename property_map<BidirGraph, Property>::const_type orig_const_type;
+ typedef typename boost::mpl::if_<is_edge_prop, detail::reverse_graph_edge_property_map<orig_const_type>, orig_const_type>::type const_type;
+ typedef const_type type;
};
template <class BidirGraph, class GRef, class Property>
-typename property_map<reverse_graph<BidirGraph,GRef>, Property>::type
+typename disable_if<
+ is_same<Property, edge_underlying_t>,
+ typename property_map<reverse_graph<BidirGraph,GRef>, Property>::type>::type
get(Property p, reverse_graph<BidirGraph,GRef>& g)
{
return typename property_map<reverse_graph<BidirGraph,GRef>, Property>::type(get(p, g.m_g));
}
template <class BidirGraph, class GRef, class Property>
-typename property_map<reverse_graph<BidirGraph,GRef>, Property>::const_type
+typename disable_if<
+ is_same<Property, edge_underlying_t>,
+ typename property_map<reverse_graph<BidirGraph,GRef>, Property>::const_type>::type
get(Property p, const reverse_graph<BidirGraph,GRef>& g)
{
const BidirGraph& gref = g.m_g; // in case GRef is non-const
@@ -406,9 +398,11 @@ get(Property p, const reverse_graph<BidirGraph,GRef>& g)
}
template <class BidirectionalGraph, class GRef, class Property, class Key>
-typename property_traits<
- typename property_map<BidirectionalGraph, Property>::const_type
->::value_type
+typename disable_if<
+ is_same<Property, edge_underlying_t>,
+ typename property_traits<
+ typename property_map<reverse_graph<BidirectionalGraph, GRef>, Property>::const_type
+ >::value_type>::type
get(Property p, const reverse_graph<BidirectionalGraph,GRef>& g, const Key& k)
{
return get(get(p, g), k);
@@ -459,19 +453,40 @@ struct property_map<reverse_graph<Graph, GRef>, edge_underlying_t> {
typedef detail::underlying_edge_desc_map_type<ed> const_type;
};
-template <class Graph, class GRef>
-detail::underlying_edge_desc_map_type<typename graph_traits<Graph>::edge_descriptor>
+template <typename T> struct is_reverse_graph: boost::mpl::false_ {};
+template <typename G, typename R> struct is_reverse_graph<reverse_graph<G, R> >: boost::mpl::true_ {};
+
+template <class G>
+typename enable_if<is_reverse_graph<G>,
+ detail::underlying_edge_desc_map_type<typename graph_traits<typename G::base_type>::edge_descriptor> >::type
get(edge_underlying_t,
- const reverse_graph<Graph,GRef>& g)
+ G& g)
{
- return detail::underlying_edge_desc_map_type<typename graph_traits<Graph>::edge_descriptor>();
+ return detail::underlying_edge_desc_map_type<typename graph_traits<typename G::base_type>::edge_descriptor>();
}
-template <class Graph, class GRef>
-typename graph_traits<Graph>::edge_descriptor
+template <class G>
+typename enable_if<is_reverse_graph<G>, typename graph_traits<typename G::base_type>::edge_descriptor>::type
+get(edge_underlying_t,
+ G& g,
+ const typename graph_traits<G>::edge_descriptor& k)
+{
+ return k.underlying_descx;
+}
+
+template <class G>
+typename enable_if<is_reverse_graph<G>, detail::underlying_edge_desc_map_type<typename graph_traits<typename G::base_type>::edge_descriptor> >::type
+get(edge_underlying_t,
+ const G& g)
+{
+ return detail::underlying_edge_desc_map_type<typename graph_traits<typename G::base_type>::edge_descriptor>();
+}
+
+template <class G>
+typename enable_if<is_reverse_graph<G>, typename graph_traits<typename G::base_type>::edge_descriptor>::type
get(edge_underlying_t,
- const reverse_graph<Graph,GRef>& g,
- const typename graph_traits<reverse_graph<Graph, GRef> >::edge_descriptor& k)
+ const G& g,
+ const typename graph_traits<G>::edge_descriptor& k)
{
return k.underlying_descx;
}
diff --git a/boost/graph/stanford_graph.hpp b/boost/graph/stanford_graph.hpp
index 0bb798c0f3..89f5e34b29 100644
--- a/boost/graph/stanford_graph.hpp
+++ b/boost/graph/stanford_graph.hpp
@@ -318,13 +318,15 @@ namespace boost {
class sgb_vertex_util_map
: public boost::put_get_helper<Ref, sgb_vertex_util_map<Tag, Ref> >
{
+ Tag tag;
public:
+ explicit sgb_vertex_util_map(Tag tag = Tag()): tag(tag) {}
typedef boost::lvalue_property_map_tag category;
typedef typename Tag::type value_type;
typedef Vertex* key_type;
typedef Ref reference;
reference operator[](Vertex* v) const {
- return get_util_field(v, Tag());
+ return get_util_field(v, tag);
}
};
@@ -333,13 +335,15 @@ namespace boost {
class sgb_edge_util_map
: public boost::put_get_helper<Ref, sgb_edge_util_map<Tag, Ref> >
{
+ Tag tag;
public:
+ explicit sgb_edge_util_map(Tag tag = Tag()): tag(tag) {}
typedef boost::lvalue_property_map_tag category;
typedef typename Tag::type value_type;
typedef Vertex* key_type;
typedef Ref reference;
reference operator[](const sgb_edge& e) const {
- return get_util_field(e._arc, Tag());
+ return get_util_field(e._arc, tag);
}
};
diff --git a/boost/graph/stoer_wagner_min_cut.hpp b/boost/graph/stoer_wagner_min_cut.hpp
index 814eae0ce8..060f51b4a6 100644
--- a/boost/graph/stoer_wagner_min_cut.hpp
+++ b/boost/graph/stoer_wagner_min_cut.hpp
@@ -20,7 +20,7 @@
#include <boost/graph/detail/d_ary_heap.hpp>
#include <boost/property_map/property_map.hpp>
#include <boost/tuple/tuple.hpp>
-#include <boost/typeof/typeof.hpp>
+#include <boost/utility/result_of.hpp>
namespace boost {
@@ -218,7 +218,9 @@ namespace boost {
typedef boost::bgl_named_params<P, T, R> params_type;
BOOST_GRAPH_DECLARE_CONVERTED_PARAMETERS(params_type, params)
- BOOST_AUTO(pq, (boost::detail::make_priority_queue_from_arg_pack_gen<boost::graph::keywords::tag::max_priority_queue, weight_type, vertex_descriptor, std::greater<weight_type> >(choose_param(get_param(params, boost::distance_zero_t()), weight_type(0)))(g, arg_pack)));
+ typedef boost::detail::make_priority_queue_from_arg_pack_gen<boost::graph::keywords::tag::max_priority_queue, weight_type, vertex_descriptor, std::greater<weight_type> > gen_type;
+ gen_type gen(choose_param(get_param(params, boost::distance_zero_t()), weight_type(0)));
+ typename boost::result_of<gen_type(const UndirectedGraph&, const arg_pack_type&)>::type pq = gen(g, arg_pack);
return boost::detail::stoer_wagner_min_cut(g,
weights,
diff --git a/boost/graph/strong_components.hpp b/boost/graph/strong_components.hpp
index ba5d45907a..61345bdcb8 100644
--- a/boost/graph/strong_components.hpp
+++ b/boost/graph/strong_components.hpp
@@ -131,7 +131,7 @@ namespace boost {
template <>
- struct strong_comp_dispatch2<detail::error_property_not_found> {
+ struct strong_comp_dispatch2<param_not_found> {
template <class Graph, class ComponentMap, class RootMap,
class P, class T, class R>
inline static typename property_traits<ComponentMap>::value_type
@@ -139,7 +139,7 @@ namespace boost {
ComponentMap comp,
RootMap r_map,
const bgl_named_params<P, T, R>& params,
- detail::error_property_not_found)
+ param_not_found)
{
typedef typename graph_traits<Graph>::vertices_size_type size_type;
size_type n = num_vertices(g) > 0 ? num_vertices(g) : 1;
@@ -179,7 +179,7 @@ namespace boost {
}
};
template <>
- struct strong_comp_dispatch1<detail::error_property_not_found> {
+ struct strong_comp_dispatch1<param_not_found> {
template <class Graph, class ComponentMap,
class P, class T, class R>
@@ -187,7 +187,7 @@ namespace boost {
apply(const Graph& g,
ComponentMap comp,
const bgl_named_params<P, T, R>& params,
- detail::error_property_not_found)
+ param_not_found)
{
typedef typename graph_traits<Graph>::vertex_descriptor Vertex;
typename std::vector<Vertex>::size_type
diff --git a/boost/graph/subgraph.hpp b/boost/graph/subgraph.hpp
index b98c390267..22706bc617 100644
--- a/boost/graph/subgraph.hpp
+++ b/boost/graph/subgraph.hpp
@@ -24,7 +24,9 @@
#include <boost/static_assert.hpp>
#include <boost/assert.hpp>
-#include <boost/type_traits/is_same.hpp>
+#include <boost/type_traits.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/or.hpp>
namespace boost {
@@ -103,13 +105,11 @@ public:
typedef typename Traits::in_edge_iterator in_edge_iterator;
- typedef typename Graph::edge_property_type edge_property_type;
- typedef typename Graph::vertex_property_type vertex_property_type;
- typedef typename Graph::vertex_bundled vertex_bundled;
- typedef typename Graph::edge_bundled edge_bundled;
+ typedef typename edge_property_type<Graph>::type edge_property_type;
+ typedef typename vertex_property_type<Graph>::type vertex_property_type;
typedef subgraph_tag graph_tag;
typedef Graph graph_type;
- typedef typename Graph::graph_property_type graph_property_type;
+ typedef typename graph_property_type<Graph>::type graph_property_type;
// Create the main graph, the root of the subgraph tree
subgraph()
@@ -131,15 +131,29 @@ public:
// copy constructor
subgraph(const subgraph& x)
- : m_graph(x.m_graph), m_parent(x.m_parent), m_edge_counter(x.m_edge_counter)
+ : m_parent(x.m_parent), m_edge_counter(x.m_edge_counter)
, m_global_vertex(x.m_global_vertex), m_global_edge(x.m_global_edge)
{
- // Do a deep copy (recursive).
- for(typename ChildrenList::const_iterator i = x.m_children.begin();
- i != x.m_children.end(); ++i)
+ if(x.is_root())
{
- m_children.push_back(new subgraph<Graph>( **i ));
+ m_graph = x.m_graph;
}
+ // Do a deep copy (recursive).
+ // Only the root graph is copied, the subgraphs contain
+ // only references to the global vertices they own.
+ typename subgraph<Graph>::children_iterator i,i_end;
+ boost::tie(i,i_end) = x.children();
+ for(; i != i_end; ++i)
+ {
+ subgraph<Graph> child = this->create_subgraph();
+ child = *i;
+ vertex_iterator vi,vi_end;
+ boost::tie(vi,vi_end) = vertices(*i);
+ for (;vi!=vi_end;++vi)
+ {
+ add_vertex(*vi,child);
+ }
+ }
}
@@ -334,9 +348,6 @@ public: // Probably shouldn't be public....
}
};
-#ifndef BOOST_GRAPH_NO_BUNDLED_PROPERTIES
-// TODO: I don't think these are required since the default metafunction
-// returns Graph::vertex_bundled.
template <typename Graph>
struct vertex_bundle_type<subgraph<Graph> >
: vertex_bundle_type<Graph>
@@ -346,7 +357,11 @@ template<typename Graph>
struct edge_bundle_type<subgraph<Graph> >
: edge_bundle_type<Graph>
{ };
-#endif // BOOST_GRAPH_NO_BUNDLED_PROPERTIES
+
+template<typename Graph>
+struct graph_bundle_type<subgraph<Graph> >
+ : graph_bundle_type<Graph>
+{ };
//===========================================================================
// Functions special to the Subgraph Class
@@ -764,7 +779,10 @@ class subgraph_global_property_map
{
typedef property_traits<PropertyMap> Traits;
public:
- typedef typename Traits::category category;
+ typedef typename mpl::if_<is_const<typename remove_pointer<GraphPtr>::type>,
+ readable_property_map_tag,
+ typename Traits::category>::type
+ category;
typedef typename Traits::value_type value_type;
typedef typename Traits::key_type key_type;
typedef typename Traits::reference reference;
@@ -772,18 +790,19 @@ public:
subgraph_global_property_map()
{ }
- subgraph_global_property_map(GraphPtr g)
- : m_g(g)
+ subgraph_global_property_map(GraphPtr g, Tag tag)
+ : m_g(g), m_tag(tag)
{ }
reference operator[](key_type e) const {
- PropertyMap pmap = get(Tag(), m_g->root().m_graph);
+ PropertyMap pmap = get(m_tag, m_g->root().m_graph);
return m_g->is_root()
? pmap[e]
: pmap[m_g->local_to_global(e)];
}
GraphPtr m_g;
+ Tag m_tag;
};
/**
@@ -799,7 +818,10 @@ class subgraph_local_property_map
{
typedef property_traits<PropertyMap> Traits;
public:
- typedef typename Traits::category category;
+ typedef typename mpl::if_<is_const<typename remove_pointer<GraphPtr>::type>,
+ readable_property_map_tag,
+ typename Traits::category>::type
+ category;
typedef typename Traits::value_type value_type;
typedef typename Traits::key_type key_type;
typedef typename Traits::reference reference;
@@ -810,17 +832,18 @@ public:
subgraph_local_property_map()
{ }
- subgraph_local_property_map(GraphPtr g)
- : m_g(g)
+ subgraph_local_property_map(GraphPtr g, Tag tag)
+ : m_g(g), m_tag(tag)
{ }
reference operator[](key_type e) const {
// Get property map on the underlying graph.
- PropertyMap pmap = get(Tag(), m_g->m_graph);
+ PropertyMap pmap = get(m_tag, m_g->m_graph);
return pmap[e];
}
GraphPtr m_g;
+ Tag m_tag;
};
namespace detail {
@@ -935,139 +958,37 @@ struct edge_property_selector<subgraph_tag> {
typedef detail::subgraph_property_generator type;
};
-#ifndef BOOST_GRAPH_NO_BUNDLED_PROPERTIES
-/** @internal
- * This property map implements local or global bundled property access on
- * an underlying graph. The LocalGlobal template template parameter must be
- * one of the local_property or global_property templates.
- */
-template <
- typename Graph, typename Descriptor, typename Bundle, typename T,
- template <typename> class LocalGlobal>
-struct subgraph_lg_bundle_property_map
- : put_get_helper<
- T&,
- subgraph_lg_bundle_property_map<Graph, Descriptor, Bundle, T, LocalGlobal>
- >
-{
-private:
- typedef LocalGlobal<Descriptor> Wrap;
-public:
- typedef Descriptor key_type;
- typedef typename remove_const<T>::type value_type;
- typedef T& reference;
- typedef lvalue_property_map_tag category;
-
- subgraph_lg_bundle_property_map()
- { }
-
- subgraph_lg_bundle_property_map(Graph* g, T Bundle::* p)
- : m_g(g), m_prop(p)
- { }
-
- reference operator[](key_type k) const
- { return (*m_g)[Wrap(k)].*m_prop; }
-
-private:
- Graph* m_g;
- T Bundle::* m_prop;
-};
-
-// Specialize the property map template to generate bundled property maps.
-// NOTE: I'm cheating (actually double-dipping) with the local/global subgraph
-// property templates. I'm not using them store descriptors, just specialize
-// the property map template for specific lookups.
-namespace graph_detail {
- // Help decoding some of the types required for property map definitions.
- template <typename Graph, typename T, typename Bundle>
- struct bundled_subgraph_pmap_helper {
- typedef subgraph<Graph> Subgraph;
- typedef graph_traits<Subgraph> Traits;
- typedef typename Subgraph::vertex_bundled VertBundled;
- typedef typename Subgraph::edge_bundled EdgeBundled;
-
- // Deduce the descriptor from the template params
- typedef typename mpl::if_<
- detail::is_vertex_bundle<VertBundled, EdgeBundled, Bundle>,
- typename Traits::vertex_descriptor, typename Traits::edge_descriptor
- >::type Desc;
-
- // Deduce the bundled property type
- typedef typename mpl::if_<
- detail::is_vertex_bundle<VertBundled, EdgeBundled, Bundle>,
- VertBundled, EdgeBundled
- >::type Prop;
- };
-} // namespace graph_detail
-
-template <typename Graph, typename T, typename Bundle>
-struct property_map<subgraph<Graph>, local_property<T Bundle::*> >
- : graph_detail::bundled_subgraph_pmap_helper<Graph, T, Bundle>
-{
-private:
- typedef graph_detail::bundled_subgraph_pmap_helper<Graph, T, Bundle> Base;
- typedef typename Base::Subgraph Subgraph;
- typedef typename Base::Desc Desc;
- typedef typename Base::Prop Prop;
-public:
- typedef subgraph_lg_bundle_property_map<
- Subgraph, Desc, Prop, T, local_property
- > type;
- typedef subgraph_lg_bundle_property_map<
- Subgraph const, Desc, Prop, T const, local_property
- > const_type;
-};
-
-template <typename Graph, typename T, typename Bundle>
-struct property_map<subgraph<Graph>, global_property<T Bundle::*> >
- : graph_detail::bundled_subgraph_pmap_helper<Graph, T, Bundle>
-{
-private:
- typedef graph_detail::bundled_subgraph_pmap_helper<Graph, T, Bundle> Base;
- typedef typename Base::Subgraph Subgraph;
- typedef typename Base::Desc Desc;
- typedef typename Base::Prop Prop;
-public:
- typedef subgraph_lg_bundle_property_map<
- Subgraph, Desc, Prop, T, global_property
- > type;
- typedef subgraph_lg_bundle_property_map<
- Subgraph const, Desc, Prop, T const, global_property
- > const_type;
-};
-#endif
-
// ==================================================
// get(p, g), get(p, g, k), and put(p, g, k, v)
// ==================================================
template <typename G, typename Property>
typename property_map<subgraph<G>, Property>::type
-get(Property, subgraph<G>& g) {
+get(Property p, subgraph<G>& g) {
typedef typename property_map< subgraph<G>, Property>::type PMap;
- return PMap(&g);
+ return PMap(&g, p);
}
template <typename G, typename Property>
typename property_map<subgraph<G>, Property>::const_type
-get(Property, const subgraph<G>& g) {
+get(Property p, const subgraph<G>& g) {
typedef typename property_map< subgraph<G>, Property>::const_type PMap;
- return PMap(&g);
+ return PMap(&g, p);
}
template <typename G, typename Property, typename Key>
typename property_traits<
typename property_map<subgraph<G>, Property>::const_type
>::value_type
-get(Property, const subgraph<G>& g, const Key& k) {
+get(Property p, const subgraph<G>& g, const Key& k) {
typedef typename property_map< subgraph<G>, Property>::const_type PMap;
- PMap pmap(&g);
+ PMap pmap(&g, p);
return pmap[k];
}
template <typename G, typename Property, typename Key, typename Value>
-void put(Property, subgraph<G>& g, const Key& k, const Value& val) {
+void put(Property p, subgraph<G>& g, const Key& k, const Value& val) {
typedef typename property_map< subgraph<G>, Property>::type PMap;
- PMap pmap(&g);
+ PMap pmap(&g, p);
pmap[k] = val;
}
@@ -1077,20 +998,20 @@ void put(Property, subgraph<G>& g, const Key& k, const Value& val) {
// ==================================================
template <typename G, typename Property>
typename property_map<subgraph<G>, global_property<Property> >::type
-get(global_property<Property>, subgraph<G>& g) {
+get(global_property<Property> p, subgraph<G>& g) {
typedef typename property_map<
subgraph<G>, global_property<Property>
>::type Map;
- return Map(&g);
+ return Map(&g, p.value);
}
template <typename G, typename Property>
typename property_map<subgraph<G>, global_property<Property> >::const_type
-get(global_property<Property>, const subgraph<G>& g) {
+get(global_property<Property> p, const subgraph<G>& g) {
typedef typename property_map<
subgraph<G>, global_property<Property>
>::const_type Map;
- return Map(&g);
+ return Map(&g, p.value);
}
// ==================================================
@@ -1099,112 +1020,22 @@ get(global_property<Property>, const subgraph<G>& g) {
// ==================================================
template <typename G, typename Property>
typename property_map<subgraph<G>, local_property<Property> >::type
-get(local_property<Property>, subgraph<G>& g) {
+get(local_property<Property> p, subgraph<G>& g) {
typedef typename property_map<
subgraph<G>, local_property<Property>
>::type Map;
- return Map(&g);
+ return Map(&g, p.value);
}
template <typename G, typename Property>
typename property_map<subgraph<G>, local_property<Property> >::const_type
-get(local_property<Property>, const subgraph<G>& g) {
+get(local_property<Property> p, const subgraph<G>& g) {
typedef typename property_map<
subgraph<G>, local_property<Property>
>::const_type Map;
- return Map(&g);
-}
-
-#ifndef BOOST_GRAPH_NO_BUNDLED_PROPERTIES
-// ==================================================
-// get(bundle(p), g)
-// ==================================================
-
-template<typename G, typename T, typename Bundle>
-inline typename property_map<subgraph<G>, T Bundle::*>::type
-get(T Bundle::* p, subgraph<G>& g) {
- typedef typename property_map<subgraph<G>, T Bundle::*>::type Map;
- return Map(&g, p);
-}
-
-template<typename G, typename T, typename Bundle>
-inline typename property_map<subgraph<G>, T Bundle::*>::const_type
-get(T Bundle::* p, subgraph<G> const& g) {
- typedef typename property_map<subgraph<G>, T Bundle::*>::const_type Map;
- return Map(&g, p);
-}
-
-template <typename Graph, typename Type, typename Bundle, typename Key>
-inline Type get(Type Bundle::* p, subgraph<Graph> const& g, Key const& k)
-{ return get(get(p, g), k); }
-
-template <typename Graph, typename Type, typename Bundle, typename Key,
- typename Value>
-inline void put(Type Bundle::* p, Graph& g, Key const& k, Value const& v)
-{ put(get(p, g), k, v); }
-
-// =========================================================
-// Local bundled, get
-
-template<typename G, typename T, typename Bundle>
-inline typename property_map<
- subgraph<G>, local_property<T Bundle::*>
->::type
-get(local_property<T Bundle::*> p, subgraph<G>& g) {
- typedef typename property_map<
- subgraph<G>, local_property<T Bundle::*>
- >::type Map;
- return Map(&g, p.value);
-}
-
-template<typename G, typename T, typename Bundle>
-inline typename property_map<
- subgraph<G>, local_property<T Bundle::*>
->::const_type
-get(local_property<T Bundle::*> p, subgraph<G> const& g) {
- typedef typename property_map<
- subgraph<G>, local_property<T Bundle::*>
- >::const_type Map;
- return Map(&g, p.value);
-}
-
-template <typename Graph, typename Type, typename Bundle, typename Key>
-inline Type get(local_property<Type Bundle::*> p, subgraph<Graph> const& g,
- Key const& k)
-{ return get(get(p, g), k); }
-
-// =========================================================
-// Global bundled, get
-
-template<typename G, typename T, typename Bundle>
-inline typename property_map<
- subgraph<G>, global_property<T Bundle::*>
->::type
-get(global_property<T Bundle::*> p, subgraph<G>& g) {
- typedef typename property_map<
- subgraph<G>, global_property<T Bundle::*>
- >::type Map;
- return Map(&g, p.value);
-}
-
-template<typename G, typename T, typename Bundle>
-inline typename property_map<
- subgraph<G>, global_property<T Bundle::*>
->::const_type
-get(global_property<T Bundle::*> p, subgraph<G> const& g) {
- typedef typename property_map<
- subgraph<G>, global_property<T Bundle::*>
- >::const_type Map;
return Map(&g, p.value);
}
-template <typename Graph, typename Type, typename Bundle, typename Key>
-inline Type get(global_property<Type Bundle::*> p, subgraph<Graph> const& g,
- Key const& k)
-{ return get(get(p, g), k); }
-
-#endif
-
template <typename G, typename Tag>
inline typename graph_property<G, Tag>::type&
get_property(subgraph<G>& g, Tag tag) {
diff --git a/boost/graph/two_graphs_common_spanning_trees.hpp b/boost/graph/two_graphs_common_spanning_trees.hpp
new file mode 100644
index 0000000000..86d57ece07
--- /dev/null
+++ b/boost/graph/two_graphs_common_spanning_trees.hpp
@@ -0,0 +1,870 @@
+// Copyright (C) 2012, Michele Caini.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// Two Graphs Common Spanning Trees Algorithm
+// Based on academic article of Mint, Read and Tarjan
+// Efficient Algorithm for Common Spanning Tree Problem
+// Electron. Lett., 28 April 1983, Volume 19, Issue 9, p.346-347
+
+
+#ifndef BOOST_GRAPH_TWO_GRAPHS_COMMON_SPANNING_TREES_HPP
+#define BOOST_GRAPH_TWO_GRAPHS_COMMON_SPANNING_TREES_HPP
+
+
+#include <boost/config.hpp>
+
+#include <boost/bimap.hpp>
+#include <boost/type_traits.hpp>
+#include <boost/concept/requires.hpp>
+#include <boost/graph/graph_traits.hpp>
+#include <boost/graph/undirected_dfs.hpp>
+#include <boost/graph/connected_components.hpp>
+#include <boost/graph/filtered_graph.hpp>
+#include <vector>
+#include <stack>
+#include <map>
+
+
+namespace boost
+{
+
+
+namespace detail {
+
+
+ template
+ <
+ typename TreeMap,
+ typename PredMap,
+ typename DistMap,
+ typename LowMap,
+ typename Buffer
+ >
+ struct bridges_visitor: public default_dfs_visitor
+ {
+ bridges_visitor(
+ TreeMap tree,
+ PredMap pred,
+ DistMap dist,
+ LowMap low,
+ Buffer& buffer
+ ): mTree(tree), mPred(pred), mDist(dist), mLow(low), mBuffer(buffer)
+ { mNum = -1; }
+
+ template <typename Vertex, typename Graph>
+ void initialize_vertex(const Vertex& u, const Graph& g)
+ {
+ put(mPred, u, u);
+ put(mDist, u, -1);
+ }
+
+ template <typename Vertex, typename Graph>
+ void discover_vertex(const Vertex& u, const Graph& g)
+ {
+ put(mDist, u, ++mNum);
+ put(mLow, u, get(mDist, u));
+ }
+
+ template <typename Edge, typename Graph>
+ void tree_edge(const Edge& e, const Graph& g)
+ {
+ put(mPred, target(e, g), source(e, g));
+ put(mTree, target(e, g), e);
+ }
+
+ template <typename Edge, typename Graph>
+ void back_edge(const Edge& e, const Graph& g)
+ {
+ put(mLow, source(e, g),
+ (std::min)(get(mLow, source(e, g)), get(mDist, target(e, g))));
+ }
+
+ template <typename Vertex, typename Graph>
+ void finish_vertex(const Vertex& u, const Graph& g)
+ {
+ Vertex parent = get(mPred, u);
+ if(get(mLow, u) > get(mDist, parent))
+ mBuffer.push(get(mTree, u));
+ put(mLow, parent,
+ (std::min)(get(mLow, parent), get(mLow, u)));
+ }
+
+ TreeMap mTree;
+ PredMap mPred;
+ DistMap mDist;
+ LowMap mLow;
+ Buffer& mBuffer;
+ int mNum;
+ };
+
+
+ template <typename Buffer>
+ struct cycle_finder: public base_visitor< cycle_finder<Buffer> >
+ {
+ typedef on_back_edge event_filter;
+ cycle_finder(): mBuffer(0) { }
+ cycle_finder(Buffer* buffer)
+ : mBuffer(buffer) { }
+ template <typename Edge, typename Graph>
+ void operator()(const Edge& e, const Graph& g)
+ {
+ if(mBuffer)
+ mBuffer->push(e);
+ }
+ Buffer* mBuffer;
+ };
+
+
+ template <typename DeletedMap>
+ struct deleted_edge_status
+ {
+ deleted_edge_status() { }
+ deleted_edge_status(DeletedMap map): mMap(map) { }
+ template <typename Edge>
+ bool operator()(const Edge& e) const
+ { return (!get(mMap, e)); }
+ DeletedMap mMap;
+ };
+
+
+ template <typename InLMap>
+ struct inL_edge_status
+ {
+ inL_edge_status() { }
+ inL_edge_status(InLMap map): mMap(map) { }
+ template <typename Edge>
+ bool operator()(const Edge& e) const
+ { return get(mMap, e); }
+ InLMap mMap;
+ };
+
+
+ template <
+ typename Graph,
+ typename Func,
+ typename Seq,
+ typename Map
+ >
+ void rec_two_graphs_common_spanning_trees
+ (
+ const Graph& iG,
+ bimap<
+ bimaps::set_of<int>,
+ bimaps::set_of< typename graph_traits<Graph>::edge_descriptor >
+ > iG_bimap,
+ Map aiG_inL,
+ Map diG,
+ const Graph& vG,
+ bimap<
+ bimaps::set_of<int>,
+ bimaps::set_of< typename graph_traits<Graph>::edge_descriptor >
+ > vG_bimap,
+ Map avG_inL,
+ Map dvG,
+ Func func,
+ Seq inL
+ )
+ {
+ typedef graph_traits<Graph> GraphTraits;
+
+ typedef typename GraphTraits::vertex_descriptor vertex_descriptor;
+ typedef typename GraphTraits::edge_descriptor edge_descriptor;
+
+ typedef typename Seq::size_type seq_size_type;
+
+ int edges = num_vertices(iG) - 1;
+//
+// [ Michele Caini ]
+//
+// Using the condition (edges != 0) leads to the accidental submission of
+// sub-graphs ((V-1+1)-fake-tree, named here fat-tree).
+// Remove this condition is a workaround for the problem of fat-trees.
+// Please do not add that condition, even if it improves performance.
+//
+// Here is proposed the previous guard (that was wrong):
+// for(seq_size_type i = 0; (i < inL.size()) && (edges != 0); ++i)
+//
+ {
+ for(seq_size_type i = 0; i < inL.size(); ++i)
+ if(inL[i])
+ --edges;
+
+ if(edges < 0)
+ return;
+ }
+
+ bool is_tree = (edges == 0);
+ if(is_tree) {
+ func(inL);
+ } else {
+ std::map<vertex_descriptor, default_color_type> vertex_color;
+ std::map<edge_descriptor, default_color_type> edge_color;
+
+ std::stack<edge_descriptor> iG_buf, vG_buf;
+ bool found = false;
+
+ seq_size_type m;
+ for(seq_size_type j = 0; j < inL.size() && !found; ++j) {
+ if(!inL[j]
+ && !get(diG, iG_bimap.left.at(j))
+ && !get(dvG, vG_bimap.left.at(j)))
+ {
+ put(aiG_inL, iG_bimap.left.at(j), true);
+ put(avG_inL, vG_bimap.left.at(j), true);
+
+ undirected_dfs(
+ make_filtered_graph(iG,
+ detail::inL_edge_status< associative_property_map<
+ std::map<edge_descriptor, bool> > >(aiG_inL)),
+ make_dfs_visitor(
+ detail::cycle_finder< std::stack<edge_descriptor> > (&iG_buf)),
+ associative_property_map<
+ std::map<vertex_descriptor, default_color_type> >(vertex_color),
+ associative_property_map<
+ std::map<edge_descriptor, default_color_type> >(edge_color)
+ );
+ undirected_dfs(
+ make_filtered_graph(vG,
+ detail::inL_edge_status< associative_property_map<
+ std::map<edge_descriptor, bool> > >(avG_inL)),
+ make_dfs_visitor(
+ detail::cycle_finder< std::stack<edge_descriptor> > (&vG_buf)),
+ associative_property_map<
+ std::map<vertex_descriptor, default_color_type> >(vertex_color),
+ associative_property_map<
+ std::map<edge_descriptor, default_color_type> >(edge_color)
+ );
+
+ if(iG_buf.empty() && vG_buf.empty()) {
+ inL[j] = true;
+ found = true;
+ m = j;
+ } else {
+ while(!iG_buf.empty()) iG_buf.pop();
+ while(!vG_buf.empty()) vG_buf.pop();
+ put(aiG_inL, iG_bimap.left.at(j), false);
+ put(avG_inL, vG_bimap.left.at(j), false);
+ }
+ }
+ }
+
+ if(found) {
+
+ std::stack<edge_descriptor> iG_buf_copy, vG_buf_copy;
+ for(seq_size_type j = 0; j < inL.size(); ++j) {
+ if(!inL[j]
+ && !get(diG, iG_bimap.left.at(j))
+ && !get(dvG, vG_bimap.left.at(j)))
+ {
+
+ put(aiG_inL, iG_bimap.left.at(j), true);
+ put(avG_inL, vG_bimap.left.at(j), true);
+
+ undirected_dfs(
+ make_filtered_graph(iG,
+ detail::inL_edge_status< associative_property_map<
+ std::map<edge_descriptor, bool> > >(aiG_inL)),
+ make_dfs_visitor(
+ detail::cycle_finder<
+ std::stack<edge_descriptor> > (&iG_buf)),
+ associative_property_map< std::map<
+ vertex_descriptor, default_color_type> >(vertex_color),
+ associative_property_map<
+ std::map<edge_descriptor, default_color_type> >(edge_color)
+ );
+ undirected_dfs(
+ make_filtered_graph(vG,
+ detail::inL_edge_status< associative_property_map<
+ std::map<edge_descriptor, bool> > >(avG_inL)),
+ make_dfs_visitor(
+ detail::cycle_finder<
+ std::stack<edge_descriptor> > (&vG_buf)),
+ associative_property_map< std::map<
+ vertex_descriptor, default_color_type> >(vertex_color),
+ associative_property_map<
+ std::map<edge_descriptor, default_color_type> >(edge_color)
+ );
+
+ if(!iG_buf.empty() || !vG_buf.empty()) {
+ while(!iG_buf.empty()) iG_buf.pop();
+ while(!vG_buf.empty()) vG_buf.pop();
+ put(diG, iG_bimap.left.at(j), true);
+ put(dvG, vG_bimap.left.at(j), true);
+ iG_buf_copy.push(iG_bimap.left.at(j));
+ vG_buf_copy.push(vG_bimap.left.at(j));
+ }
+
+ put(aiG_inL, iG_bimap.left.at(j), false);
+ put(avG_inL, vG_bimap.left.at(j), false);
+ }
+ }
+
+ // REC
+ detail::rec_two_graphs_common_spanning_trees<Graph, Func, Seq, Map>
+ (iG, iG_bimap, aiG_inL, diG, vG, vG_bimap, aiG_inL, dvG, func, inL);
+
+ while(!iG_buf_copy.empty()) {
+ put(diG, iG_buf_copy.top(), false);
+ put(dvG, vG_bimap.left.at(
+ iG_bimap.right.at(iG_buf_copy.top())), false);
+ iG_buf_copy.pop();
+ }
+ while(!vG_buf_copy.empty()) {
+ put(dvG, vG_buf_copy.top(), false);
+ put(diG, iG_bimap.left.at(
+ vG_bimap.right.at(vG_buf_copy.top())), false);
+ vG_buf_copy.pop();
+ }
+
+ inL[m] = false;
+ put(aiG_inL, iG_bimap.left.at(m), false);
+ put(avG_inL, vG_bimap.left.at(m), false);
+
+ put(diG, iG_bimap.left.at(m), true);
+ put(dvG, vG_bimap.left.at(m), true);
+
+ std::map<vertex_descriptor, edge_descriptor> tree_map;
+ std::map<vertex_descriptor, vertex_descriptor> pred_map;
+ std::map<vertex_descriptor, int> dist_map, low_map;
+
+ detail::bridges_visitor<
+ associative_property_map<
+ std::map<vertex_descriptor, edge_descriptor>
+ >,
+ associative_property_map<
+ std::map<vertex_descriptor, vertex_descriptor>
+ >,
+ associative_property_map< std::map<vertex_descriptor, int> >,
+ associative_property_map< std::map<vertex_descriptor, int> >,
+ std::stack<edge_descriptor>
+ >
+ iG_vis(
+ associative_property_map<
+ std::map< vertex_descriptor, edge_descriptor> >(tree_map),
+ associative_property_map<
+ std::map< vertex_descriptor, vertex_descriptor> >(pred_map),
+ associative_property_map<
+ std::map< vertex_descriptor, int> >(dist_map),
+ associative_property_map<
+ std::map< vertex_descriptor, int> >(low_map),
+ iG_buf
+ ),
+ vG_vis(
+ associative_property_map<
+ std::map< vertex_descriptor, edge_descriptor> >(tree_map),
+ associative_property_map<
+ std::map< vertex_descriptor, vertex_descriptor> >(pred_map),
+ associative_property_map<
+ std::map< vertex_descriptor, int> >(dist_map),
+ associative_property_map<
+ std::map< vertex_descriptor, int> >(low_map),
+ vG_buf
+ );
+
+ undirected_dfs(make_filtered_graph(iG,
+ detail::deleted_edge_status< associative_property_map<
+ std::map<edge_descriptor, bool> > >(diG)),
+ iG_vis,
+ associative_property_map<
+ std::map<vertex_descriptor, default_color_type> >(vertex_color),
+ associative_property_map<
+ std::map<edge_descriptor, default_color_type> >(edge_color)
+ );
+ undirected_dfs(make_filtered_graph(vG,
+ detail::deleted_edge_status< associative_property_map<
+ std::map<edge_descriptor, bool> > >(dvG)),
+ vG_vis,
+ associative_property_map<
+ std::map<vertex_descriptor, default_color_type> >(vertex_color),
+ associative_property_map<
+ std::map<edge_descriptor, default_color_type> >(edge_color)
+ );
+
+ found = false;
+ std::stack<edge_descriptor> iG_buf_tmp, vG_buf_tmp;
+ while(!iG_buf.empty() && !found) {
+ if(!inL[iG_bimap.right.at(iG_buf.top())]) {
+ put(aiG_inL, iG_buf.top(), true);
+ put(avG_inL, vG_bimap.left.at(
+ iG_bimap.right.at(iG_buf.top())), true);
+
+ undirected_dfs(
+ make_filtered_graph(iG,
+ detail::inL_edge_status< associative_property_map<
+ std::map<edge_descriptor, bool> > >(aiG_inL)),
+ make_dfs_visitor(
+ detail::cycle_finder<
+ std::stack<edge_descriptor> > (&iG_buf_tmp)),
+ associative_property_map<
+ std::map<
+ vertex_descriptor, default_color_type> >(vertex_color),
+ associative_property_map<
+ std::map<edge_descriptor, default_color_type> >(edge_color)
+ );
+ undirected_dfs(
+ make_filtered_graph(vG,
+ detail::inL_edge_status< associative_property_map<
+ std::map<edge_descriptor, bool> > >(avG_inL)),
+ make_dfs_visitor(
+ detail::cycle_finder<
+ std::stack<edge_descriptor> > (&vG_buf_tmp)),
+ associative_property_map<
+ std::map<
+ vertex_descriptor, default_color_type> >(vertex_color),
+ associative_property_map<
+ std::map<edge_descriptor, default_color_type> >(edge_color)
+ );
+
+ if(!iG_buf_tmp.empty() || !vG_buf_tmp.empty()) {
+ found = true;
+ } else {
+ while(!iG_buf_tmp.empty()) iG_buf_tmp.pop();
+ while(!vG_buf_tmp.empty()) vG_buf_tmp.pop();
+ iG_buf_copy.push(iG_buf.top());
+ }
+
+ put(aiG_inL, iG_buf.top(), false);
+ put(avG_inL, vG_bimap.left.at(
+ iG_bimap.right.at(iG_buf.top())), false);
+ }
+ iG_buf.pop();
+ }
+ while(!vG_buf.empty() && !found) {
+ if(!inL[vG_bimap.right.at(vG_buf.top())]) {
+ put(avG_inL, vG_buf.top(), true);
+ put(aiG_inL, iG_bimap.left.at(
+ vG_bimap.right.at(vG_buf.top())), true);
+
+ undirected_dfs(
+ make_filtered_graph(iG,
+ detail::inL_edge_status< associative_property_map<
+ std::map<edge_descriptor, bool> > >(aiG_inL)),
+ make_dfs_visitor(
+ detail::cycle_finder<
+ std::stack<edge_descriptor> > (&iG_buf_tmp)),
+ associative_property_map<
+ std::map<
+ vertex_descriptor, default_color_type> >(vertex_color),
+ associative_property_map<
+ std::map<edge_descriptor, default_color_type> >(edge_color)
+ );
+ undirected_dfs(
+ make_filtered_graph(vG,
+ detail::inL_edge_status< associative_property_map<
+ std::map<edge_descriptor, bool> > >(avG_inL)),
+ make_dfs_visitor(
+ detail::cycle_finder<
+ std::stack<edge_descriptor> > (&vG_buf_tmp)),
+ associative_property_map<
+ std::map<
+ vertex_descriptor, default_color_type> >(vertex_color),
+ associative_property_map<
+ std::map<edge_descriptor, default_color_type> >(edge_color)
+ );
+
+ if(!iG_buf_tmp.empty() || !vG_buf_tmp.empty()) {
+ found = true;
+ } else {
+ while(!iG_buf_tmp.empty()) iG_buf_tmp.pop();
+ while(!vG_buf_tmp.empty()) vG_buf_tmp.pop();
+ vG_buf_copy.push(vG_buf.top());
+ }
+
+ put(avG_inL, vG_buf.top(), false);
+ put(aiG_inL, iG_bimap.left.at(
+ vG_bimap.right.at(vG_buf.top())), false);
+ }
+ vG_buf.pop();
+ }
+
+ if(!found) {
+
+ while(!iG_buf_copy.empty()) {
+ inL[iG_bimap.right.at(iG_buf_copy.top())] = true;
+ put(aiG_inL, iG_buf_copy.top(), true);
+ put(avG_inL, vG_bimap.left.at(
+ iG_bimap.right.at(iG_buf_copy.top())), true);
+ iG_buf.push(iG_buf_copy.top());
+ iG_buf_copy.pop();
+ }
+ while(!vG_buf_copy.empty()) {
+ inL[vG_bimap.right.at(vG_buf_copy.top())] = true;
+ put(avG_inL, vG_buf_copy.top(), true);
+ put(aiG_inL, iG_bimap.left.at(
+ vG_bimap.right.at(vG_buf_copy.top())), true);
+ vG_buf.push(vG_buf_copy.top());
+ vG_buf_copy.pop();
+ }
+
+ // REC
+ detail::rec_two_graphs_common_spanning_trees<
+ Graph, Func, Seq, Map>
+ (iG, iG_bimap, aiG_inL, diG, vG, vG_bimap, aiG_inL, dvG, func, inL);
+
+ while(!iG_buf.empty()) {
+ inL[iG_bimap.right.at(iG_buf.top())] = false;
+ put(aiG_inL, iG_buf.top(), false);
+ put(avG_inL, vG_bimap.left.at(
+ iG_bimap.right.at(iG_buf.top())), false);
+ iG_buf.pop();
+ }
+ while(!vG_buf.empty()) {
+ inL[vG_bimap.right.at(vG_buf.top())] = false;
+ put(avG_inL, vG_buf.top(), false);
+ put(aiG_inL, iG_bimap.left.at(
+ vG_bimap.right.at(vG_buf.top())), false);
+ vG_buf.pop();
+ }
+
+ }
+
+ put(diG, iG_bimap.left.at(m), false);
+ put(dvG, vG_bimap.left.at(m), false);
+
+ }
+ }
+ }
+
+} // namespace detail
+
+
+
+template <typename Coll, typename Seq>
+struct tree_collector
+{
+
+public:
+ BOOST_CONCEPT_ASSERT((BackInsertionSequence<Coll>));
+ BOOST_CONCEPT_ASSERT((RandomAccessContainer<Seq>));
+ BOOST_CONCEPT_ASSERT((CopyConstructible<Seq>));
+
+ typedef typename Coll::value_type coll_value_type;
+ typedef typename Seq::value_type seq_value_type;
+
+ BOOST_STATIC_ASSERT((is_same<coll_value_type, Seq>::value));
+ BOOST_STATIC_ASSERT((is_same<seq_value_type, bool>::value));
+
+ tree_collector(Coll& seqs): mSeqs(seqs) { }
+
+ inline void operator()(Seq seq)
+ { mSeqs.push_back(seq); }
+
+private:
+ Coll& mSeqs;
+
+};
+
+
+
+template <
+ typename Graph,
+ typename Order,
+ typename Func,
+ typename Seq
+>
+BOOST_CONCEPT_REQUIRES(
+ ((RandomAccessContainer<Order>))
+ ((IncidenceGraphConcept<Graph>))
+ ((UnaryFunction<Func, void, Seq>))
+ ((Mutable_RandomAccessContainer<Seq>))
+ ((VertexAndEdgeListGraphConcept<Graph>)),
+ (void)
+)
+two_graphs_common_spanning_trees
+ (
+ const Graph& iG,
+ Order iG_map,
+ const Graph& vG,
+ Order vG_map,
+ Func func,
+ Seq inL
+ )
+{
+ typedef graph_traits<Graph> GraphTraits;
+
+ typedef typename GraphTraits::directed_category directed_category;
+ typedef typename GraphTraits::vertex_descriptor vertex_descriptor;
+ typedef typename GraphTraits::edge_descriptor edge_descriptor;
+
+ typedef typename GraphTraits::edges_size_type edges_size_type;
+ typedef typename GraphTraits::edge_iterator edge_iterator;
+
+ typedef typename Seq::const_iterator seq_const_iterator;
+ typedef typename Seq::difference_type seq_diff_type;
+ typedef typename Seq::value_type seq_value_type;
+ typedef typename Seq::size_type seq_size_type;
+ typedef typename Seq::iterator seq_iterator;
+
+ typedef typename Order::const_iterator order_const_iterator;
+ typedef typename Order::difference_type order_diff_type;
+ typedef typename Order::value_type order_value_type;
+ typedef typename Order::size_type order_size_type;
+ typedef typename Order::iterator order_iterator;
+
+ BOOST_STATIC_ASSERT((is_same<order_value_type, edge_descriptor>::value));
+ BOOST_CONCEPT_ASSERT((Convertible<order_size_type, edges_size_type>));
+
+ BOOST_CONCEPT_ASSERT((Convertible<seq_size_type, edges_size_type>));
+ BOOST_STATIC_ASSERT((is_same<seq_value_type, bool>::value));
+
+ BOOST_STATIC_ASSERT((is_same<directed_category, undirected_tag>::value));
+
+ if(num_vertices(iG) != num_vertices(vG))
+ return;
+
+ if(inL.size() != num_edges(iG)
+ || inL.size() != num_edges(vG))
+ return;
+
+ if(iG_map.size() != num_edges(iG)
+ || vG_map.size() != num_edges(vG))
+ return;
+
+ typedef bimaps::bimap<
+ bimaps::set_of< int >,
+ bimaps::set_of< order_value_type >
+ > bimap_type;
+ typedef typename bimap_type::value_type bimap_value;
+
+ bimap_type iG_bimap, vG_bimap;
+ for(order_size_type i = 0; i < iG_map.size(); ++i)
+ iG_bimap.insert(bimap_value(i, iG_map[i]));
+ for(order_size_type i = 0; i < vG_map.size(); ++i)
+ vG_bimap.insert(bimap_value(i, vG_map[i]));
+
+ edge_iterator current, last;
+ boost::tuples::tie(current, last) = edges(iG);
+ for(; current != last; ++current)
+ if(iG_bimap.right.find(*current) == iG_bimap.right.end())
+ return;
+ boost::tuples::tie(current, last) = edges(vG);
+ for(; current != last; ++current)
+ if(vG_bimap.right.find(*current) == vG_bimap.right.end())
+ return;
+
+ std::stack<edge_descriptor> iG_buf, vG_buf;
+
+ std::map<vertex_descriptor, edge_descriptor> tree_map;
+ std::map<vertex_descriptor, vertex_descriptor> pred_map;
+ std::map<vertex_descriptor, int> dist_map, low_map;
+
+ detail::bridges_visitor<
+ associative_property_map<
+ std::map<vertex_descriptor, edge_descriptor>
+ >,
+ associative_property_map<
+ std::map<vertex_descriptor, vertex_descriptor>
+ >,
+ associative_property_map< std::map<vertex_descriptor, int> >,
+ associative_property_map< std::map<vertex_descriptor, int> >,
+ std::stack<edge_descriptor>
+ >
+ iG_vis(
+ associative_property_map<
+ std::map< vertex_descriptor, edge_descriptor> >(tree_map),
+ associative_property_map<
+ std::map< vertex_descriptor, vertex_descriptor> >(pred_map),
+ associative_property_map<std::map< vertex_descriptor, int> >(dist_map),
+ associative_property_map<std::map< vertex_descriptor, int> >(low_map),
+ iG_buf
+ ),
+ vG_vis(
+ associative_property_map<
+ std::map< vertex_descriptor, edge_descriptor> >(tree_map),
+ associative_property_map<
+ std::map< vertex_descriptor, vertex_descriptor> >(pred_map),
+ associative_property_map<std::map< vertex_descriptor, int> >(dist_map),
+ associative_property_map<std::map< vertex_descriptor, int> >(low_map),
+ vG_buf
+ );
+
+ std::map<vertex_descriptor, default_color_type> vertex_color;
+ std::map<edge_descriptor, default_color_type> edge_color;
+
+ undirected_dfs(iG, iG_vis,
+ associative_property_map<
+ std::map<vertex_descriptor, default_color_type> >(vertex_color),
+ associative_property_map<
+ std::map<edge_descriptor, default_color_type> >(edge_color)
+ );
+ undirected_dfs(vG, vG_vis,
+ associative_property_map<
+ std::map<vertex_descriptor, default_color_type> >(vertex_color),
+ associative_property_map<
+ std::map<edge_descriptor, default_color_type> >(edge_color)
+ );
+
+ while(!iG_buf.empty()) {
+ inL[iG_bimap.right.at(iG_buf.top())] = true;
+ iG_buf.pop();
+ }
+ while(!vG_buf.empty()) {
+ inL[vG_bimap.right.at(vG_buf.top())] = true;
+ vG_buf.pop();
+ }
+
+ std::map<edge_descriptor, bool> iG_inL, vG_inL;
+ associative_property_map< std::map<edge_descriptor, bool> >
+ aiG_inL(iG_inL), avG_inL(vG_inL);
+
+ for(seq_size_type i = 0; i < inL.size(); ++i)
+ {
+ if(inL[i]) {
+ put(aiG_inL, iG_bimap.left.at(i), true);
+ put(avG_inL, vG_bimap.left.at(i), true);
+ } else {
+ put(aiG_inL, iG_bimap.left.at(i), false);
+ put(avG_inL, vG_bimap.left.at(i), false);
+ }
+ }
+
+ undirected_dfs(
+ make_filtered_graph(iG,
+ detail::inL_edge_status< associative_property_map<
+ std::map<edge_descriptor, bool> > >(aiG_inL)),
+ make_dfs_visitor(
+ detail::cycle_finder< std::stack<edge_descriptor> > (&iG_buf)),
+ associative_property_map<
+ std::map<vertex_descriptor, default_color_type> >(vertex_color),
+ associative_property_map<
+ std::map<edge_descriptor, default_color_type> >(edge_color)
+ );
+ undirected_dfs(
+ make_filtered_graph(vG,
+ detail::inL_edge_status< associative_property_map<
+ std::map<edge_descriptor, bool> > >(avG_inL)),
+ make_dfs_visitor(
+ detail::cycle_finder< std::stack<edge_descriptor> > (&vG_buf)),
+ associative_property_map<
+ std::map<vertex_descriptor, default_color_type> >(vertex_color),
+ associative_property_map<
+ std::map<edge_descriptor, default_color_type> >(edge_color)
+ );
+
+ if(iG_buf.empty() && vG_buf.empty()) {
+
+ std::map<edge_descriptor, bool> iG_deleted, vG_deleted;
+ associative_property_map< std::map<edge_descriptor, bool> > diG(iG_deleted);
+ associative_property_map< std::map<edge_descriptor, bool> > dvG(vG_deleted);
+
+ boost::tuples::tie(current, last) = edges(iG);
+ for(; current != last; ++current)
+ put(diG, *current, false);
+ boost::tuples::tie(current, last) = edges(vG);
+ for(; current != last; ++current)
+ put(dvG, *current, false);
+
+ for(seq_size_type j = 0; j < inL.size(); ++j) {
+ if(!inL[j]) {
+ put(aiG_inL, iG_bimap.left.at(j), true);
+ put(avG_inL, vG_bimap.left.at(j), true);
+
+ undirected_dfs(
+ make_filtered_graph(iG,
+ detail::inL_edge_status< associative_property_map<
+ std::map<edge_descriptor, bool> > >(aiG_inL)),
+ make_dfs_visitor(
+ detail::cycle_finder< std::stack<edge_descriptor> > (&iG_buf)),
+ associative_property_map<
+ std::map<vertex_descriptor, default_color_type> >(vertex_color),
+ associative_property_map<
+ std::map<edge_descriptor, default_color_type> >(edge_color)
+ );
+ undirected_dfs(
+ make_filtered_graph(vG,
+ detail::inL_edge_status< associative_property_map<
+ std::map<edge_descriptor, bool> > >(avG_inL)),
+ make_dfs_visitor(
+ detail::cycle_finder< std::stack<edge_descriptor> > (&vG_buf)),
+ associative_property_map<
+ std::map<vertex_descriptor, default_color_type> >(vertex_color),
+ associative_property_map<
+ std::map<edge_descriptor, default_color_type> >(edge_color)
+ );
+
+ if(!iG_buf.empty() || !vG_buf.empty()) {
+ while(!iG_buf.empty()) iG_buf.pop();
+ while(!vG_buf.empty()) vG_buf.pop();
+ put(diG, iG_bimap.left.at(j), true);
+ put(dvG, vG_bimap.left.at(j), true);
+ }
+
+ put(aiG_inL, iG_bimap.left.at(j), false);
+ put(avG_inL, vG_bimap.left.at(j), false);
+ }
+ }
+
+ int cc = 0;
+
+ std::map<vertex_descriptor, int> com_map;
+ cc += connected_components(
+ make_filtered_graph(iG,
+ detail::deleted_edge_status<associative_property_map<
+ std::map<edge_descriptor, bool> > >(diG)),
+ associative_property_map<std::map<vertex_descriptor, int> >(com_map)
+ );
+ cc += connected_components(
+ make_filtered_graph(vG,
+ detail::deleted_edge_status<associative_property_map<
+ std::map<edge_descriptor, bool> > >(dvG)),
+ associative_property_map< std::map<vertex_descriptor, int> >(com_map)
+ );
+
+ if(cc != 2)
+ return;
+
+ // REC
+ detail::rec_two_graphs_common_spanning_trees<Graph, Func, Seq,
+ associative_property_map< std::map<edge_descriptor, bool> > >
+ (iG, iG_bimap, aiG_inL, diG, vG, vG_bimap, aiG_inL, dvG, func, inL);
+
+ }
+
+}
+
+
+template <
+ typename Graph,
+ typename Func,
+ typename Seq
+>
+BOOST_CONCEPT_REQUIRES(
+ ((IncidenceGraphConcept<Graph>))
+ ((EdgeListGraphConcept<Graph>)),
+ (void)
+)
+two_graphs_common_spanning_trees
+ (
+ const Graph& iG,
+ const Graph& vG,
+ Func func,
+ Seq inL
+ )
+{
+ typedef graph_traits<Graph> GraphTraits;
+
+ typedef typename GraphTraits::edge_descriptor edge_descriptor;
+ typedef typename GraphTraits::edges_size_type edges_size_type;
+ typedef typename GraphTraits::edge_iterator edge_iterator;
+
+ std::vector<edge_descriptor> iGO, vGO;
+ edge_iterator curr, last;
+
+ boost::tuples::tie(curr, last) = edges(iG);
+ for(; curr != last; ++curr)
+ iGO.push_back(*curr);
+
+ boost::tuples::tie(curr, last) = edges(vG);
+ for(; curr != last; ++curr)
+ vGO.push_back(*curr);
+
+ two_graphs_common_spanning_trees(iG, iGO, vG, vGO, func, inL);
+}
+
+
+} // namespace boost
+
+
+#endif // BOOST_GRAPH_TWO_GRAPHS_COMMON_SPANNING_TREES_HPP
diff --git a/boost/graph/undirected_dfs.hpp b/boost/graph/undirected_dfs.hpp
index df31d22b2b..a3e1c038fd 100644
--- a/boost/graph/undirected_dfs.hpp
+++ b/boost/graph/undirected_dfs.hpp
@@ -188,7 +188,7 @@ namespace boost {
};
template <>
- struct udfs_dispatch<detail::error_property_not_found> {
+ struct udfs_dispatch<param_not_found> {
template <typename Graph, typename Vertex, typename DFSVisitor,
typename EdgeColorMap,
typename P, typename T, typename R>
@@ -196,7 +196,7 @@ namespace boost {
apply(const Graph& g, DFSVisitor vis, Vertex start_vertex,
const bgl_named_params<P, T, R>& params,
EdgeColorMap edge_color,
- detail::error_property_not_found)
+ param_not_found)
{
std::vector<default_color_type> color_vec(num_vertices(g));
default_color_type c = white_color; // avoid warning about un-init
@@ -219,8 +219,7 @@ namespace boost {
undirected_dfs(const Graph& g,
const bgl_named_params<P, T, R>& params)
{
- typedef typename property_value< bgl_named_params<P, T, R>,
- vertex_color_t>::type C;
+ typedef typename get_param_type< vertex_color_t, bgl_named_params<P, T, R> >::type C;
detail::udfs_dispatch<C>::apply
(g,
choose_param(get_param(params, graph_visitor),
diff --git a/boost/graph/undirected_graph.hpp b/boost/graph/undirected_graph.hpp
index 3178b42afd..adcc86e515 100644
--- a/boost/graph/undirected_graph.hpp
+++ b/boost/graph/undirected_graph.hpp
@@ -7,7 +7,6 @@
#ifndef BOOST_GRAPH_UNDIRECTED_GRAPH_HPP
#define BOOST_GRAPH_UNDIRECTED_GRAPH_HPP
-#include <boost/utility.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/properties.hpp>
@@ -38,14 +37,12 @@ template <
class undirected_graph
{
public:
- typedef typename graph_detail::graph_prop<GraphProp>::property graph_property_type;
- typedef typename graph_detail::graph_prop<GraphProp>::bundle graph_bundled;
-
- typedef typename graph_detail::vertex_prop<VertexProp>::property vertex_property_type;
- typedef typename graph_detail::vertex_prop<VertexProp>::bundle vertex_bundled;
-
- typedef typename graph_detail::edge_prop<EdgeProp>::property edge_property_type;
- typedef typename graph_detail::edge_prop<EdgeProp>::bundle edge_bundled;
+ typedef GraphProp graph_property_type;
+ typedef VertexProp vertex_property_type;
+ typedef EdgeProp edge_property_type;
+ typedef typename lookup_one_property<GraphProp, graph_bundle_t>::type graph_bundled;
+ typedef typename lookup_one_property<VertexProp, vertex_bundle_t>::type vertex_bundled;
+ typedef typename lookup_one_property<EdgeProp, edge_bundle_t>::type edge_bundled;
private:
// Embed indices into the vertex type.
@@ -530,36 +527,8 @@ remove_in_edge_if(typename UNDIRECTED_GRAPH::vertex_descriptor v,
UNDIRECTED_GRAPH& g)
{ return remove_in_edge_if(v, pred, g.impl()); }
-// Helper code for working with property maps
-namespace detail {
- struct undirected_graph_vertex_property_selector {
- template <class UndirectedGraph, class Property, class Tag>
- struct bind_ {
- typedef typename UndirectedGraph::graph_type Graph;
- typedef property_map<Graph, Tag> PropertyMap;
- typedef typename PropertyMap::type type;
- typedef typename PropertyMap::const_type const_type;
- };
- };
-
- struct undirected_graph_edge_property_selector {
- template <class UndirectedGraph, class Property, class Tag>
- struct bind_ {
- typedef typename UndirectedGraph::graph_type Graph;
- typedef property_map<Graph, Tag> PropertyMap;
- typedef typename PropertyMap::type type;
- typedef typename PropertyMap::const_type const_type;
- };
- };
-} // namespace detail
-
-template <>
-struct vertex_property_selector<undirected_graph_tag>
-{ typedef detail::undirected_graph_vertex_property_selector type; };
-
-template <>
-struct edge_property_selector<undirected_graph_tag>
-{ typedef detail::undirected_graph_edge_property_selector type; };
+template <UNDIRECTED_GRAPH_PARAMS, typename Property>
+struct property_map<UNDIRECTED_GRAPH, Property>: property_map<typename UNDIRECTED_GRAPH::graph_type, Property> {};
// PropertyGraph concepts
template <UNDIRECTED_GRAPH_PARAMS, typename Property>
@@ -599,36 +568,6 @@ template <UNDIRECTED_GRAPH_PARAMS, class Property, class Value>
inline void set_property(UNDIRECTED_GRAPH& g, Property p, Value v)
{ return set_property(g.impl(), p, v); }
-#ifndef BOOST_GRAPH_NO_BUNDLED_PROPERTIES
-template <UNDIRECTED_GRAPH_PARAMS, typename Type, typename Bundle>
-inline typename property_map<UNDIRECTED_GRAPH, Type Bundle::*>::type
-get(Type Bundle::* p, UNDIRECTED_GRAPH& g) {
- typedef typename property_map<
- UNDIRECTED_GRAPH, Type Bundle::*
- >::type return_type;
- return return_type(&g, p);
-}
-
-template <UNDIRECTED_GRAPH_PARAMS, typename Type, typename Bundle>
-inline typename property_map<UNDIRECTED_GRAPH, Type Bundle::*>::const_type
-get(Type Bundle::* p, UNDIRECTED_GRAPH const& g) {
- typedef typename property_map<
- UNDIRECTED_GRAPH, Type Bundle::*
- >::const_type return_type;
- return return_type(&g, p);
-}
-
-template <UNDIRECTED_GRAPH_PARAMS, typename Type, typename Bundle, typename Key>
-inline Type
-get(Type Bundle::* p, UNDIRECTED_GRAPH const& g, Key const& k)
-{ return get(p, g.impl(), k); }
-
-template <UNDIRECTED_GRAPH_PARAMS, typename Type, typename Bundle, typename Key, typename Value>
-inline void
-put(Type Bundle::* p, UNDIRECTED_GRAPH& g, Key const& k, Value const& v)
-{ put(p, g.impl(), k, v); }
-#endif
-
// Indexed Vertex graph
template <UNDIRECTED_GRAPH_PARAMS>
diff --git a/boost/graph/vector_as_graph.hpp b/boost/graph/vector_as_graph.hpp
index ee0df4bc90..7bc8ac3802 100644
--- a/boost/graph/vector_as_graph.hpp
+++ b/boost/graph/vector_as_graph.hpp
@@ -19,6 +19,7 @@
#include <vector>
#include <cstddef>
#include <boost/iterator.hpp>
+#include <boost/iterator/counting_iterator.hpp>
#include <boost/range/irange.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/property_map/property_map.hpp>
@@ -71,13 +72,14 @@ namespace boost {
out_edge_iterator;
typedef void in_edge_iterator;
typedef void edge_iterator;
- typedef typename integer_range<V>::iterator vertex_iterator;
+ typedef counting_iterator<V> vertex_iterator;
typedef directed_tag directed_category;
typedef allow_parallel_edge_tag edge_parallel_category;
typedef vector_as_graph_traversal_tag traversal_category;
typedef typename std::vector<EdgeList>::size_type vertices_size_type;
typedef void edges_size_type;
typedef typename EdgeList::size_type degree_size_type;
+ static V null_vertex() {return V(-1);}
};
template <class EdgeList>
struct edge_property_type< std::vector<EdgeList> >
@@ -178,14 +180,11 @@ namespace boost {
// source() and target() already provided for pairs in graph_traits.hpp
template <class EdgeList, class Alloc>
- std::pair<typename boost::integer_range<typename EdgeList::value_type>
- ::iterator,
- typename boost::integer_range<typename EdgeList::value_type>
- ::iterator >
+ std::pair<boost::counting_iterator<typename EdgeList::value_type>,
+ boost::counting_iterator<typename EdgeList::value_type> >
vertices(const std::vector<EdgeList, Alloc>& v)
{
- typedef typename boost::integer_range<typename EdgeList::value_type>
- ::iterator Iter;
+ typedef boost::counting_iterator<typename EdgeList::value_type> Iter;
return std::make_pair(Iter(0), Iter(v.size()));
}
diff --git a/boost/heap/binomial_heap.hpp b/boost/heap/binomial_heap.hpp
index 742754f68d..8ebc7d056f 100644
--- a/boost/heap/binomial_heap.hpp
+++ b/boost/heap/binomial_heap.hpp
@@ -62,6 +62,10 @@ struct make_binomial_heap_base
{}
#ifdef BOOST_HAS_RVALUE_REFS
+ type(type const & rhs):
+ base_type(rhs), allocator_type(rhs)
+ {}
+
type(type && rhs):
base_type(std::move(static_cast<base_type&>(rhs))),
allocator_type(std::move(static_cast<allocator_type&>(rhs)))
@@ -145,6 +149,7 @@ private:
typedef typename base_maker::compare_argument value_compare;
typedef typename base_maker::allocator_type allocator_type;
+ typedef typename base_maker::node_type node;
typedef typename allocator_type::pointer node_pointer;
typedef typename allocator_type::const_pointer const_node_pointer;
@@ -569,7 +574,8 @@ public:
/// \copydoc boost::heap::d_ary_heap_mutable::s_handle_from_iterator
static handle_type s_handle_from_iterator(iterator const & it)
{
- return handle_type(&*it);
+ node_type * ptr = const_cast<node_type *>(it.get_node());
+ return handle_type(ptr);
}
/// \copydoc boost::heap::priority_queue::value_comp
diff --git a/boost/heap/d_ary_heap.hpp b/boost/heap/d_ary_heap.hpp
index 6a9cc8f336..2bfa187595 100644
--- a/boost/heap/d_ary_heap.hpp
+++ b/boost/heap/d_ary_heap.hpp
@@ -753,7 +753,7 @@ public:
static handle_type s_handle_from_iterator(iterator const & it)
{
BOOST_STATIC_ASSERT(is_mutable);
- return super_t::handle_type(it);
+ return super_t::s_handle_from_iterator(it);
}
/// \copydoc boost::heap::priority_queue::pop
@@ -769,13 +769,25 @@ public:
}
/// \copydoc boost::heap::priority_queue::begin
- iterator begin(void) const
+ const_iterator begin(void) const
+ {
+ return super_t::begin();
+ }
+
+ /// \copydoc boost::heap::priority_queue::begin
+ iterator begin(void)
{
return super_t::begin();
}
/// \copydoc boost::heap::priority_queue::end
- iterator end(void) const
+ iterator end(void)
+ {
+ return super_t::end();
+ }
+
+ /// \copydoc boost::heap::priority_queue::end
+ const_iterator end(void) const
{
return super_t::end();
}
diff --git a/boost/heap/detail/mutable_heap.hpp b/boost/heap/detail/mutable_heap.hpp
index 37f6ddfebb..02731f59cb 100644
--- a/boost/heap/detail/mutable_heap.hpp
+++ b/boost/heap/detail/mutable_heap.hpp
@@ -94,6 +94,10 @@ public:
handle_type (void)
{}
+ handle_type(handle_type const & rhs):
+ iterator(rhs.iterator)
+ {}
+
private:
explicit handle_type(list_iterator const & it):
iterator(it)
@@ -166,25 +170,27 @@ protected:
public:
- class iterator:
- public boost::iterator_adaptor<iterator,
- const_list_iterator,
+ template <typename iterator_type>
+ class iterator_base:
+ public boost::iterator_adaptor<iterator_base<iterator_type>,
+ iterator_type,
value_type const,
boost::bidirectional_traversal_tag>
{
- typedef boost::iterator_adaptor<iterator,
- const_list_iterator,
+ typedef boost::iterator_adaptor<iterator_base<iterator_type>,
+ iterator_type,
value_type const,
boost::bidirectional_traversal_tag> super_t;
friend class boost::iterator_core_access;
friend class priority_queue_mutable_wrapper;
- iterator(void):
+ iterator_base(void):
super_t(0)
{}
- explicit iterator(const_list_iterator const & it):
+ template <typename T>
+ explicit iterator_base(T const & it):
super_t(it)
{}
@@ -192,9 +198,16 @@ public:
{
return super_t::base()->first;
}
+
+ iterator_type get_list_iterator() const
+ {
+ return super_t::base_reference();
+ }
};
- typedef iterator const_iterator;
+ typedef iterator_base<list_iterator> iterator;
+ typedef iterator_base<const_list_iterator> const_iterator;
+
typedef typename object_list::difference_type difference_type;
class ordered_iterator:
@@ -464,12 +477,22 @@ public:
objects.erase(it);
}
- iterator begin(void) const
+ const_iterator begin(void) const
+ {
+ return const_iterator(objects.begin());
+ }
+
+ const_iterator end(void) const
+ {
+ return const_iterator(objects.end());
+ }
+
+ iterator begin(void)
{
return iterator(objects.begin());
}
- iterator end(void) const
+ iterator end(void)
{
return iterator(objects.end());
}
@@ -489,7 +512,7 @@ public:
static handle_type s_handle_from_iterator(iterator const & it)
{
- return handle_type(it);
+ return handle_type(it.get_list_iterator());
}
value_compare const & value_comp(void) const
diff --git a/boost/heap/detail/stable_heap.hpp b/boost/heap/detail/stable_heap.hpp
index e9f3f2cd87..f9101afd10 100644
--- a/boost/heap/detail/stable_heap.hpp
+++ b/boost/heap/detail/stable_heap.hpp
@@ -263,6 +263,11 @@ struct heap_base<T, Cmp, constant_time_size, StabilityCounterType, true>:
rhs.counter_ = 0;
}
+ heap_base(heap_base & rhs):
+ Cmp(static_cast<Cmp&>(rhs)),
+ size_holder_type(static_cast<size_holder_type&>(rhs)), counter_(rhs.counter_)
+ {}
+
heap_base & operator=(heap_base && rhs)
{
Cmp::operator=(std::move(static_cast<Cmp&>(rhs)));
diff --git a/boost/heap/detail/tree_iterator.hpp b/boost/heap/detail/tree_iterator.hpp
index 7a184310dd..83c8d3fb4c 100644
--- a/boost/heap/detail/tree_iterator.hpp
+++ b/boost/heap/detail/tree_iterator.hpp
@@ -254,6 +254,11 @@ public:
return !operator!=(rhs);
}
+ const Node * get_node() const
+ {
+ return adaptor_type::base_reference();
+ }
+
private:
void increment(void)
{
@@ -373,6 +378,11 @@ public:
{
return static_cast<const Node *>(&*it);
}
+
+ const Node * get_node() const
+ {
+ return get_node(adaptor_type::base_reference());
+ }
};
diff --git a/boost/heap/fibonacci_heap.hpp b/boost/heap/fibonacci_heap.hpp
index 907d442307..76d1cfae65 100644
--- a/boost/heap/fibonacci_heap.hpp
+++ b/boost/heap/fibonacci_heap.hpp
@@ -68,6 +68,11 @@ struct make_fibonacci_heap_base
allocator_type(std::move(static_cast<allocator_type&>(rhs)))
{}
+ type(type & rhs):
+ base_type(static_cast<base_type&>(rhs)),
+ allocator_type(static_cast<allocator_type&>(rhs))
+ {}
+
type & operator=(type && rhs)
{
base_type::operator=(std::move(static_cast<base_type&>(rhs)));
@@ -232,6 +237,13 @@ public:
rhs.top_element = NULL;
}
+ fibonacci_heap(fibonacci_heap & rhs):
+ super_t(rhs), top_element(rhs.top_element)
+ {
+ roots.splice(roots.begin(), rhs.roots);
+ rhs.top_element = NULL;
+ }
+
/// \copydoc boost::heap::priority_queue::operator=(priority_queue &&)
fibonacci_heap & operator=(fibonacci_heap && rhs)
{
@@ -605,7 +617,8 @@ public:
/// \copydoc boost::heap::d_ary_heap_mutable::s_handle_from_iterator
static handle_type s_handle_from_iterator(iterator const & it)
{
- return super_t::s_handle_from_iterator(&*it);
+ node * ptr = const_cast<node *>(it.get_node());
+ return handle_type(ptr);
}
/// \copydoc boost::heap::priority_queue::value_comp
@@ -701,6 +714,9 @@ private:
void consolidate(void)
{
+ if (roots.empty())
+ return;
+
static const size_type max_log2 = sizeof(size_type) * 8;
boost::array<node_pointer, max_log2> aux;
aux.assign(NULL);
diff --git a/boost/heap/pairing_heap.hpp b/boost/heap/pairing_heap.hpp
index 577fdc534b..238a9ff2c6 100644
--- a/boost/heap/pairing_heap.hpp
+++ b/boost/heap/pairing_heap.hpp
@@ -63,6 +63,10 @@ struct make_pairing_heap_base
{}
#ifdef BOOST_HAS_RVALUE_REFS
+ type(type const & rhs):
+ base_type(rhs), allocator_type(rhs)
+ {}
+
type(type && rhs):
base_type(std::move(static_cast<base_type&>(rhs))),
allocator_type(std::move(static_cast<allocator_type&>(rhs)))
@@ -549,7 +553,8 @@ public:
/// \copydoc boost::heap::d_ary_heap_mutable::s_handle_from_iterator
static handle_type s_handle_from_iterator(iterator const & it)
{
- return super_t::s_handle_from_iterator(&*it);
+ node * ptr = const_cast<node *>(it.get_node());
+ return handle_type(ptr);
}
/**
diff --git a/boost/heap/skew_heap.hpp b/boost/heap/skew_heap.hpp
index de89a63a88..c388ed1c9c 100644
--- a/boost/heap/skew_heap.hpp
+++ b/boost/heap/skew_heap.hpp
@@ -205,6 +205,11 @@ struct make_skew_heap_base
allocator_type(std::move(static_cast<allocator_type&>(rhs)))
{}
+ type(type const & rhs):
+ base_type(rhs),
+ allocator_type(rhs)
+ {}
+
type & operator=(type && rhs)
{
base_type::operator=(std::move(static_cast<base_type&>(rhs)));
@@ -616,7 +621,8 @@ public:
/// \copydoc boost::heap::d_ary_heap::s_handle_from_iterator
static handle_type s_handle_from_iterator(iterator const & it)
{
- return handle_type(&*it);
+ node * ptr = const_cast<node *>(it.get_node());
+ return handle_type(ptr);
}
/**
diff --git a/boost/icl/concept/interval_associator.hpp b/boost/icl/concept/interval_associator.hpp
index 75d8622af3..24c6c4f043 100644
--- a/boost/icl/concept/interval_associator.hpp
+++ b/boost/icl/concept/interval_associator.hpp
@@ -346,7 +346,7 @@ template<class Type, class OperandT>
typename enable_if<is_binary_intra_combinable<Type, OperandT>, Type>::type
operator + (const Type& object, const OperandT& operand)
{
- Type temp = object;
+ Type temp = object;
return boost::move(temp += operand);
}
@@ -380,7 +380,7 @@ template<class Type, class OperandT>
typename enable_if<is_binary_intra_combinable<Type, OperandT>, Type>::type
operator + (const OperandT& operand, const Type& object)
{
- Type temp = object;
+ Type temp = object;
return boost::move(temp += operand);
}
@@ -414,7 +414,7 @@ template<class Type>
typename enable_if<is_interval_container<Type>, Type>::type
operator + (const Type& object, const Type& operand)
{
- Type temp = object;
+ Type temp = object;
return boost::move(temp += operand);
}
@@ -498,7 +498,7 @@ template<class Type, class OperandT>
typename enable_if<is_binary_intra_combinable<Type, OperandT>, Type>::type
operator | (const Type& object, const OperandT& operand)
{
- Type temp = object;
+ Type temp = object;
return boost::move(temp += operand);
}
@@ -532,7 +532,7 @@ template<class Type, class OperandT>
typename enable_if<is_binary_intra_combinable<Type, OperandT>, Type>::type
operator | (const OperandT& operand, const Type& object)
{
- Type temp = object;
+ Type temp = object;
return boost::move(temp += operand);
}
@@ -565,7 +565,7 @@ template<class Type>
typename enable_if<is_interval_container<Type>, Type>::type
operator | (const Type& object, const Type& operand)
{
- Type temp = object;
+ Type temp = object;
return boost::move(temp += operand);
}
@@ -605,7 +605,7 @@ insert(Type& object, const OperandT& operand)
{
typename Type::iterator prior_ = object.end();
ICL_const_FORALL(typename OperandT, elem_, operand)
- insert(object, *elem_);
+ insert(object, prior_, *elem_);
return object;
}
@@ -724,7 +724,7 @@ template<class Type, class OperandT>
typename enable_if<is_right_inter_combinable<Type, OperandT>, Type>::type
operator - (const Type& object, const OperandT& operand)
{
- Type temp = object;
+ Type temp = object;
return boost::move(temp -= operand);
}
@@ -793,7 +793,7 @@ template<class Type, class OperandT>
typename enable_if<is_binary_inter_combinable<Type, OperandT>, Type>::type
operator & (const Type& object, const OperandT& operand)
{
- Type temp = object;
+ Type temp = object;
return boost::move(temp &= operand);
}
@@ -823,7 +823,7 @@ template<class Type, class OperandT>
typename enable_if<is_binary_inter_combinable<Type, OperandT>, Type>::type
operator & (const OperandT& operand, const Type& object)
{
- Type temp = object;
+ Type temp = object;
return boost::move(temp &= operand);
}
@@ -853,7 +853,7 @@ template<class Type>
typename enable_if<is_interval_container<Type>, Type>::type
operator & (const Type& object, const Type& operand)
{
- Type temp = object;
+ Type temp = object;
return boost::move(temp &= operand);
}
@@ -1028,7 +1028,7 @@ template<class Type, class OperandT>
typename enable_if<is_binary_intra_combinable<Type, OperandT>, Type>::type
operator ^ (const Type& object, const OperandT& operand)
{
- Type temp = object;
+ Type temp = object;
return boost::move(temp ^= operand);
}
@@ -1058,7 +1058,7 @@ template<class Type, class OperandT>
typename enable_if<is_binary_intra_combinable<Type, OperandT>, Type>::type
operator ^ (const OperandT& operand, const Type& object)
{
- Type temp = object;
+ Type temp = object;
return boost::move(temp ^= operand);
}
@@ -1088,7 +1088,7 @@ template<class Type>
typename enable_if<is_interval_container<Type>, Type>::type
operator ^ (const Type& object, const Type& operand)
{
- Type temp = object;
+ Type temp = object;
return boost::move(temp ^= operand);
}
diff --git a/boost/icl/functors.hpp b/boost/icl/functors.hpp
index 1b4758fc5a..2401b2b801 100644
--- a/boost/icl/functors.hpp
+++ b/boost/icl/functors.hpp
@@ -22,14 +22,14 @@ namespace boost{namespace icl
template <typename Type> struct identity_based_inplace_combine
: public std::binary_function<Type&, const Type&, void>
{
- static Type identity_element() { return boost::icl::identity_element<Type>::value(); }
+ inline static Type identity_element() { return boost::icl::identity_element<Type>::value(); }
};
// ------------------------------------------------------------------------
template <typename Type> struct unit_element_based_inplace_combine
: public std::binary_function<Type&, const Type&, void>
{
- static Type identity_element() { return boost::icl::unit_element<Type>::value(); }
+ inline static Type identity_element() { return boost::icl::unit_element<Type>::value(); }
};
// ------------------------------------------------------------------------
@@ -49,11 +49,13 @@ namespace boost{namespace icl
: public identity_based_inplace_combine<Type>
{
typedef inplace_erasure<Type> type;
+ typedef identity_based_inplace_combine<Type> base_type;
void operator()(Type& object, const Type& operand)const
{
if(object == operand)
- object = Type();
+ //identity_element(); //JODO Old gcc-3.4.4 does not compile this
+ object = base_type::identity_element(); //<-- but this.
}
};
@@ -112,8 +114,6 @@ namespace boost{namespace icl
void operator()(Type& object, const Type& operand)const
{ object &= ~operand; }
-
- static Type identity_element() { return boost::icl::identity_element<Type>::value(); }
};
template<>
@@ -140,8 +140,6 @@ namespace boost{namespace icl
void operator()(Type& object, const Type& operand)const
{ object ^= operand; }
-
- static Type identity_element() { return boost::icl::identity_element<Type>::value(); }
};
// ------------------------------------------------------------------------
@@ -165,8 +163,6 @@ namespace boost{namespace icl
void operator()(Type& object, const Type& operand)const
{ object ^= operand; }
-
- static Type identity_element() { return boost::icl::identity_element<Type>::value(); }
};
template<>
@@ -180,8 +176,6 @@ namespace boost{namespace icl
void operator()(Type& object, const Type& operand)const
{ insert(object,operand); }
-
- static Type identity_element() { return boost::icl::identity_element<Type>::value(); }
};
template<>
@@ -195,8 +189,6 @@ namespace boost{namespace icl
void operator()(Type& object, const Type& operand)const
{ erase(object,operand); }
-
- static Type identity_element() { return boost::icl::identity_element<Type>::value(); }
};
template<>
@@ -204,14 +196,12 @@ namespace boost{namespace icl
// ------------------------------------------------------------------------
template <typename Type> struct inplace_star
- : public identity_based_inplace_combine<Type>
+ : public identity_based_inplace_combine<Type> //JODO unit_element_
{
typedef inplace_star<Type> type;
void operator()(Type& object, const Type& operand)const
{ object *= operand; }
-
- static Type identity_element() { return boost::icl::identity_element<Type>::value(); }
};
template<>
@@ -219,14 +209,12 @@ namespace boost{namespace icl
// ------------------------------------------------------------------------
template <typename Type> struct inplace_slash
- : public identity_based_inplace_combine<Type>
+ : public identity_based_inplace_combine<Type> //JODO unit_element_
{
typedef inplace_slash<Type> type;
void operator()(Type& object, const Type& operand)const
{ object /= operand; }
-
- static Type identity_element() { return boost::icl::identity_element<Type>::value(); }
};
template<>
@@ -243,8 +231,6 @@ namespace boost{namespace icl
if(object < operand)
object = operand;
}
-
- static Type identity_element() { return boost::icl::identity_element<Type>::value(); }
};
template<>
@@ -261,8 +247,6 @@ namespace boost{namespace icl
if(object > operand)
object = operand;
}
-
- static Type identity_element() { return boost::icl::identity_element<Type>::value(); }
};
template<>
@@ -340,6 +324,19 @@ namespace boost{namespace icl
struct inverse<icl::inplace_min<Type> >
{ typedef icl::inplace_max<Type> type; };
+ template<class Type>
+ struct inverse<icl::inplace_identity<Type> >
+ { typedef icl::inplace_erasure<Type> type; };
+
+ // If a Functor
+ template<class Functor>
+ struct inverse
+ {
+ typedef typename
+ remove_reference<typename Functor::first_argument_type>::type argument_type;
+ typedef icl::inplace_erasure<argument_type> type;
+ };
+
//--------------------------------------------------------------------------
// Inverse inter_section functor
diff --git a/boost/icl/gregorian.hpp b/boost/icl/gregorian.hpp
index 883299c610..a101617093 100644
--- a/boost/icl/gregorian.hpp
+++ b/boost/icl/gregorian.hpp
@@ -77,12 +77,12 @@ namespace boost{namespace icl
// ------------------------------------------------------------------------
- boost::gregorian::date operator ++(boost::gregorian::date& x)
+ inline boost::gregorian::date operator ++(boost::gregorian::date& x)
{
return x += boost::gregorian::date::duration_type::unit();
}
- boost::gregorian::date operator --(boost::gregorian::date& x)
+ inline boost::gregorian::date operator --(boost::gregorian::date& x)
{
return x -= boost::gregorian::date::duration_type::unit();
}
@@ -107,12 +107,12 @@ namespace boost{namespace icl
typedef boost::gregorian::date_duration type;
};
- boost::gregorian::date_duration operator ++(boost::gregorian::date_duration& x)
+ inline boost::gregorian::date_duration operator ++(boost::gregorian::date_duration& x)
{
return x += boost::gregorian::date::duration_type::unit();
}
- boost::gregorian::date_duration operator --(boost::gregorian::date_duration& x)
+ inline boost::gregorian::date_duration operator --(boost::gregorian::date_duration& x)
{
return x -= boost::gregorian::date::duration_type::unit();
}
diff --git a/boost/icl/map.hpp b/boost/icl/map.hpp
index 7092906a79..1aa37d6ec6 100644
--- a/boost/icl/map.hpp
+++ b/boost/icl/map.hpp
@@ -192,7 +192,7 @@ public:
insert(key_value_pair);
}
- map& operator = (map& src)
+ map& operator = (const map& src)
{
base_type::operator=(src);
return *this;
diff --git a/boost/icl/ptime.hpp b/boost/icl/ptime.hpp
index 455963f199..42c2235ec2 100644
--- a/boost/icl/ptime.hpp
+++ b/boost/icl/ptime.hpp
@@ -76,12 +76,12 @@ namespace boost{namespace icl
};
// ------------------------------------------------------------------------
- boost::posix_time::ptime operator ++(boost::posix_time::ptime& x)
+ inline boost::posix_time::ptime operator ++(boost::posix_time::ptime& x)
{
return x += boost::posix_time::ptime::time_duration_type::unit();
}
- boost::posix_time::ptime operator --(boost::posix_time::ptime& x)
+ inline boost::posix_time::ptime operator --(boost::posix_time::ptime& x)
{
return x -= boost::posix_time::ptime::time_duration_type::unit();
}
@@ -106,12 +106,12 @@ namespace boost{namespace icl
typedef boost::posix_time::time_duration type;
};
- boost::posix_time::time_duration operator ++(boost::posix_time::time_duration& x)
+ inline boost::posix_time::time_duration operator ++(boost::posix_time::time_duration& x)
{
return x += boost::posix_time::ptime::time_duration_type::unit();
}
- boost::posix_time::time_duration operator --(boost::posix_time::time_duration& x)
+ inline boost::posix_time::time_duration operator --(boost::posix_time::time_duration& x)
{
return x -= boost::posix_time::ptime::time_duration_type::unit();
}
diff --git a/boost/integer.hpp b/boost/integer.hpp
index fc0b3983b9..35a1e10988 100644
--- a/boost/integer.hpp
+++ b/boost/integer.hpp
@@ -20,6 +20,7 @@
#include <boost/integer_traits.hpp> // for boost::::boost::integer_traits
#include <boost/limits.hpp> // for ::std::numeric_limits
#include <boost/cstdint.hpp> // for boost::int64_t and BOOST_NO_INTEGRAL_INT64_T
+#include <boost/static_assert.hpp>
//
// We simply cannot include this header on gcc without getting copious warnings of the kind:
@@ -51,6 +52,7 @@ namespace boost
// convert category to type
template< int Category > struct int_least_helper {}; // default is empty
+ template< int Category > struct uint_least_helper {}; // default is empty
// specializatons: 1=long, 2=int, 3=short, 4=signed char,
// 6=unsigned long, 7=unsigned int, 8=unsigned short, 9=unsigned char
@@ -65,14 +67,14 @@ namespace boost
template<> struct int_least_helper<4> { typedef short least; };
template<> struct int_least_helper<5> { typedef signed char least; };
#ifdef BOOST_HAS_LONG_LONG
- template<> struct int_least_helper<6> { typedef boost::ulong_long_type least; };
+ template<> struct uint_least_helper<1> { typedef boost::ulong_long_type least; };
#elif defined(BOOST_HAS_MS_INT64)
- template<> struct int_least_helper<6> { typedef unsigned __int64 least; };
+ template<> struct uint_least_helper<1> { typedef unsigned __int64 least; };
#endif
- template<> struct int_least_helper<7> { typedef unsigned long least; };
- template<> struct int_least_helper<8> { typedef unsigned int least; };
- template<> struct int_least_helper<9> { typedef unsigned short least; };
- template<> struct int_least_helper<10> { typedef unsigned char least; };
+ template<> struct uint_least_helper<2> { typedef unsigned long least; };
+ template<> struct uint_least_helper<3> { typedef unsigned int least; };
+ template<> struct uint_least_helper<4> { typedef unsigned short least; };
+ template<> struct uint_least_helper<5> { typedef unsigned char least; };
template <int Bits>
struct exact_signed_base_helper{};
@@ -111,10 +113,12 @@ namespace boost
template< int Bits > // bits (including sign) required
struct int_t : public detail::exact_signed_base_helper<Bits>
{
+ BOOST_STATIC_ASSERT_MSG(Bits <= (int)(sizeof(boost::intmax_t) * CHAR_BIT),
+ "No suitable signed integer type with the requested number of bits is available.");
typedef typename detail::int_least_helper
<
#ifdef BOOST_HAS_LONG_LONG
- (Bits-1 <= (int)(sizeof(boost::long_long_type) * CHAR_BIT)) +
+ (Bits <= (int)(sizeof(boost::long_long_type) * CHAR_BIT)) +
#else
1 +
#endif
@@ -130,6 +134,8 @@ namespace boost
template< int Bits > // bits required
struct uint_t : public detail::exact_unsigned_base_helper<Bits>
{
+ BOOST_STATIC_ASSERT_MSG(Bits <= (int)(sizeof(boost::uintmax_t) * CHAR_BIT),
+ "No suitable unsigned integer type with the requested number of bits is available.");
#if (defined(__BORLANDC__) || defined(__CODEGEAR__)) && defined(BOOST_NO_INTEGRAL_INT64_T)
// It's really not clear why this workaround should be needed... shrug I guess! JM
BOOST_STATIC_CONSTANT(int, s =
@@ -140,11 +146,10 @@ namespace boost
(Bits <= ::std::numeric_limits<unsigned char>::digits));
typedef typename detail::int_least_helper< ::boost::uint_t<Bits>::s>::least least;
#else
- typedef typename detail::int_least_helper
+ typedef typename detail::uint_least_helper
<
- 5 +
#ifdef BOOST_HAS_LONG_LONG
- (Bits-1 <= (int)(sizeof(boost::long_long_type) * CHAR_BIT)) +
+ (Bits <= (int)(sizeof(boost::long_long_type) * CHAR_BIT)) +
#else
1 +
#endif
@@ -217,7 +222,7 @@ namespace boost
// It's really not clear why this workaround should be needed... shrug I guess! JM
#if defined(BOOST_NO_INTEGRAL_INT64_T)
BOOST_STATIC_CONSTANT(unsigned, which =
- 6 +
+ 1 +
(MaxValue <= ::boost::integer_traits<unsigned long>::const_max) +
(MaxValue <= ::boost::integer_traits<unsigned int>::const_max) +
(MaxValue <= ::boost::integer_traits<unsigned short>::const_max) +
@@ -225,18 +230,17 @@ namespace boost
typedef typename detail::int_least_helper< ::boost::uint_value_t<MaxValue>::which>::least least;
#else // BOOST_NO_INTEGRAL_INT64_T
BOOST_STATIC_CONSTANT(unsigned, which =
- 5 +
+ 1 +
(MaxValue <= ::boost::integer_traits<boost::ulong_long_type>::const_max) +
(MaxValue <= ::boost::integer_traits<unsigned long>::const_max) +
(MaxValue <= ::boost::integer_traits<unsigned int>::const_max) +
(MaxValue <= ::boost::integer_traits<unsigned short>::const_max) +
(MaxValue <= ::boost::integer_traits<unsigned char>::const_max));
- typedef typename detail::int_least_helper< ::boost::uint_value_t<MaxValue>::which>::least least;
+ typedef typename detail::uint_least_helper< ::boost::uint_value_t<MaxValue>::which>::least least;
#endif // BOOST_NO_INTEGRAL_INT64_T
#else
- typedef typename detail::int_least_helper
+ typedef typename detail::uint_least_helper
<
- 5 +
#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG)
(MaxValue <= ::boost::integer_traits<boost::ulong_long_type>::const_max) +
#else
diff --git a/boost/integer_traits.hpp b/boost/integer_traits.hpp
index c6d761a71c..e504cd12e3 100644
--- a/boost/integer_traits.hpp
+++ b/boost/integer_traits.hpp
@@ -5,7 +5,7 @@
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
- * $Id: integer_traits.hpp 76784 2012-01-29 21:58:13Z eric_niebler $
+ * $Id: integer_traits.hpp 79771 2012-07-27 18:15:55Z jewillco $
*
* Idea by Beman Dawes, Ed Brey, Steve Cleary, and Nathan Myers
*/
diff --git a/boost/interprocess/allocators/adaptive_pool.hpp b/boost/interprocess/allocators/adaptive_pool.hpp
index 846df5d413..a85202b4ee 100644
--- a/boost/interprocess/allocators/adaptive_pool.hpp
+++ b/boost/interprocess/allocators/adaptive_pool.hpp
@@ -35,7 +35,7 @@
#include <cstddef>
//!\file
-//!Describes adaptive_pool pooled shared memory STL compatible allocator
+//!Describes adaptive_pool pooled shared memory STL compatible allocator
namespace boost {
namespace interprocess {
@@ -101,11 +101,11 @@ class adaptive_pool_base
typedef boost::container::container_detail::transform_multiallocation_chain
<typename SegmentManager::multiallocation_chain, T>multiallocation_chain;
- //!Obtains adaptive_pool_base from
+ //!Obtains adaptive_pool_base from
//!adaptive_pool_base
template<class T2>
struct rebind
- {
+ {
typedef adaptive_pool_base<Version, T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> other;
};
@@ -122,15 +122,15 @@ class adaptive_pool_base
//!Constructor from a segment manager. If not present, constructs a node
//!pool. Increments the reference count of the associated node pool.
//!Can throw boost::interprocess::bad_alloc
- adaptive_pool_base(segment_manager *segment_mngr)
+ adaptive_pool_base(segment_manager *segment_mngr)
: mp_node_pool(ipcdetail::get_or_create_node_pool<typename node_pool<0>::type>(segment_mngr)) { }
- //!Copy constructor from other adaptive_pool_base. Increments the reference
+ //!Copy constructor from other adaptive_pool_base. Increments the reference
//!count of the associated node pool. Never throws
- adaptive_pool_base(const adaptive_pool_base &other)
- : mp_node_pool(other.get_node_pool())
- {
- node_pool<0>::get(ipcdetail::to_raw_pointer(mp_node_pool))->inc_ref_count();
+ adaptive_pool_base(const adaptive_pool_base &other)
+ : mp_node_pool(other.get_node_pool())
+ {
+ node_pool<0>::get(ipcdetail::to_raw_pointer(mp_node_pool))->inc_ref_count();
}
//!Assignment from other adaptive_pool_base
@@ -151,7 +151,7 @@ class adaptive_pool_base
//!Destructor, removes node_pool_t from memory
//!if its reference count reaches to zero. Never throws
- ~adaptive_pool_base()
+ ~adaptive_pool_base()
{ ipcdetail::destroy_node_pool_if_last_link(node_pool<0>::get(ipcdetail::to_raw_pointer(mp_node_pool))); }
//!Returns a pointer to the node pool.
@@ -178,14 +178,14 @@ class adaptive_pool_base
//!Equality test for same type
//!of adaptive_pool_base
template<unsigned int V, class T, class S, std::size_t NPC, std::size_t F, unsigned char OP> inline
-bool operator==(const adaptive_pool_base<V, T, S, NPC, F, OP> &alloc1,
+bool operator==(const adaptive_pool_base<V, T, S, NPC, F, OP> &alloc1,
const adaptive_pool_base<V, T, S, NPC, F, OP> &alloc2)
{ return alloc1.get_node_pool() == alloc2.get_node_pool(); }
//!Inequality test for same type
//!of adaptive_pool_base
template<unsigned int V, class T, class S, std::size_t NPC, std::size_t F, unsigned char OP> inline
-bool operator!=(const adaptive_pool_base<V, T, S, NPC, F, OP> &alloc1,
+bool operator!=(const adaptive_pool_base<V, T, S, NPC, F, OP> &alloc1,
const adaptive_pool_base<V, T, S, NPC, F, OP> &alloc2)
{ return alloc1.get_node_pool() != alloc2.get_node_pool(); }
@@ -211,11 +211,11 @@ class adaptive_pool_v1
template<class T2>
struct rebind
- {
+ {
typedef adaptive_pool_v1<T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> other;
};
- adaptive_pool_v1(SegmentManager *segment_mngr)
+ adaptive_pool_v1(SegmentManager *segment_mngr)
: base_t(segment_mngr)
{}
@@ -230,13 +230,13 @@ class adaptive_pool_v1
/// @endcond
-//!An STL node allocator that uses a segment manager as memory
+//!An STL node allocator that uses a segment manager as memory
//!source. The internal pointer type will of the same type (raw, smart) as
//!"typename SegmentManager::void_pointer" type. This allows
//!placing the allocator in shared memory, memory mapped-files, etc...
//!
-//!This node allocator shares a segregated storage between all instances
-//!of adaptive_pool with equal sizeof(T) placed in the same segment
+//!This node allocator shares a segregated storage between all instances
+//!of adaptive_pool with equal sizeof(T) placed in the same segment
//!group. NodesPerBlock is the number of nodes allocated at once when the allocator
//!needs runs out of nodes. MaxFreeBlocks is the maximum number of totally free blocks
//!that the adaptive node pool will hold. The rest of the totally free blocks will be
@@ -271,11 +271,11 @@ class adaptive_pool
template<class T2>
struct rebind
- {
+ {
typedef adaptive_pool<T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> other;
};
- adaptive_pool(SegmentManager *segment_mngr)
+ adaptive_pool(SegmentManager *segment_mngr)
: base_t(segment_mngr)
{}
@@ -299,11 +299,11 @@ class adaptive_pool
typedef typename segment_manager::size_type size_type;
typedef typename segment_manager::difference_type difference_type;
- //!Obtains adaptive_pool from
+ //!Obtains adaptive_pool from
//!adaptive_pool
template<class T2>
struct rebind
- {
+ {
typedef adaptive_pool<T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> other;
};
@@ -314,7 +314,7 @@ class adaptive_pool
adaptive_pool& operator=
(const adaptive_pool<T2, SegmentManager2, N2, F2, OP2>&);
- //!Not assignable from
+ //!Not assignable from
//!other adaptive_pool
//adaptive_pool& operator=(const adaptive_pool&);
@@ -324,7 +324,7 @@ class adaptive_pool
//!Can throw boost::interprocess::bad_alloc
adaptive_pool(segment_manager *segment_mngr);
- //!Copy constructor from other adaptive_pool. Increments the reference
+ //!Copy constructor from other adaptive_pool. Increments the reference
//!count of the associated node pool. Never throws
adaptive_pool(const adaptive_pool &other);
@@ -351,7 +351,7 @@ class adaptive_pool
//!Never throws
size_type max_size() const;
- //!Allocate memory for an array of count elements.
+ //!Allocate memory for an array of count elements.
//!Throws boost::interprocess::bad_alloc if there is no enough memory
pointer allocate(size_type count, cvoid_pointer hint = 0);
@@ -375,7 +375,7 @@ class adaptive_pool
//!Never throws
const_pointer address(const_reference value) const;
/*
- //!Copy construct an object.
+ //!Copy construct an object.
//!Throws if T's copy constructor throws
void construct(const pointer &ptr, const_reference v);
@@ -390,7 +390,7 @@ class adaptive_pool
std::pair<pointer, bool>
allocation_command(boost::interprocess::allocation_type command,
- size_type limit_size,
+ size_type limit_size,
size_type preferred_size,
size_type &received_size, const pointer &reuse = 0);
@@ -448,13 +448,13 @@ class adaptive_pool
//!Equality test for same type
//!of adaptive_pool
template<class T, class S, std::size_t NodesPerBlock, std::size_t F, unsigned char OP> inline
-bool operator==(const adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc1,
+bool operator==(const adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc1,
const adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc2);
//!Inequality test for same type
//!of adaptive_pool
template<class T, class S, std::size_t NodesPerBlock, std::size_t F, unsigned char OP> inline
-bool operator!=(const adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc1,
+bool operator!=(const adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc1,
const adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc2);
#endif
diff --git a/boost/interprocess/allocators/allocator.hpp b/boost/interprocess/allocators/allocator.hpp
index aa4b22dcc9..38e8c6901a 100644
--- a/boost/interprocess/allocators/allocator.hpp
+++ b/boost/interprocess/allocators/allocator.hpp
@@ -45,12 +45,12 @@ namespace boost {
namespace interprocess {
-//!An STL compatible allocator that uses a segment manager as
+//!An STL compatible allocator that uses a segment manager as
//!memory source. The internal pointer type will of the same type (raw, smart) as
//!"typename SegmentManager::void_pointer" type. This allows
//!placing the allocator in shared memory, memory mapped-files, etc...
template<class T, class SegmentManager>
-class allocator
+class allocator
{
public:
//Segment manager
@@ -115,7 +115,7 @@ class allocator
//!objects of type T2
template<class T2>
struct rebind
- {
+ {
typedef allocator<T2, SegmentManager> other;
};
@@ -126,21 +126,21 @@ class allocator
//!Constructor from the segment manager.
//!Never throws
- allocator(segment_manager *segment_mngr)
+ allocator(segment_manager *segment_mngr)
: mp_mngr(segment_mngr) { }
//!Constructor from other allocator.
//!Never throws
- allocator(const allocator &other)
+ allocator(const allocator &other)
: mp_mngr(other.get_segment_manager()){ }
//!Constructor from related allocator.
//!Never throws
template<class T2>
- allocator(const allocator<T2, SegmentManager> &other)
+ allocator(const allocator<T2, SegmentManager> &other)
: mp_mngr(other.get_segment_manager()){}
- //!Allocates memory for an array of count elements.
+ //!Allocates memory for an array of count elements.
//!Throws boost::interprocess::bad_alloc if there is no enough memory
pointer allocate(size_type count, cvoid_ptr hint = 0)
{
@@ -169,13 +169,13 @@ class allocator
//!pointed by p can hold. This size only works for memory allocated with
//!allocate, allocation_command and allocate_many.
size_type size(const pointer &p) const
- {
+ {
return (size_type)mp_mngr->size(ipcdetail::to_raw_pointer(p))/sizeof(T);
}
std::pair<pointer, bool>
allocation_command(boost::interprocess::allocation_type command,
- size_type limit_size,
+ size_type limit_size,
size_type preferred_size,
size_type &received_size, const pointer &reuse = 0)
{
@@ -273,14 +273,14 @@ class allocator
//!Equality test for same type
//!of allocator
template<class T, class SegmentManager> inline
-bool operator==(const allocator<T , SegmentManager> &alloc1,
+bool operator==(const allocator<T , SegmentManager> &alloc1,
const allocator<T, SegmentManager> &alloc2)
{ return alloc1.get_segment_manager() == alloc2.get_segment_manager(); }
//!Inequality test for same type
//!of allocator
template<class T, class SegmentManager> inline
-bool operator!=(const allocator<T, SegmentManager> &alloc1,
+bool operator!=(const allocator<T, SegmentManager> &alloc1,
const allocator<T, SegmentManager> &alloc2)
{ return alloc1.get_segment_manager() != alloc2.get_segment_manager(); }
diff --git a/boost/interprocess/allocators/cached_adaptive_pool.hpp b/boost/interprocess/allocators/cached_adaptive_pool.hpp
index bec1050de5..98af033fe6 100644
--- a/boost/interprocess/allocators/cached_adaptive_pool.hpp
+++ b/boost/interprocess/allocators/cached_adaptive_pool.hpp
@@ -28,7 +28,7 @@
#include <cstddef>
//!\file
-//!Describes cached_adaptive_pool pooled shared memory STL compatible allocator
+//!Describes cached_adaptive_pool pooled shared memory STL compatible allocator
namespace boost {
namespace interprocess {
@@ -69,7 +69,7 @@ class cached_adaptive_pool_v1
template<class T2>
struct rebind
- {
+ {
typedef cached_adaptive_pool_v1
<T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> other;
};
@@ -77,7 +77,7 @@ class cached_adaptive_pool_v1
typedef typename base_t::size_type size_type;
cached_adaptive_pool_v1(SegmentManager *segment_mngr,
- size_type max_cached_nodes = base_t::DEFAULT_MAX_CACHED_NODES)
+ size_type max_cached_nodes = base_t::DEFAULT_MAX_CACHED_NODES)
: base_t(segment_mngr, max_cached_nodes)
{}
@@ -93,12 +93,12 @@ class cached_adaptive_pool_v1
/// @endcond
-//!An STL node allocator that uses a segment manager as memory
+//!An STL node allocator that uses a segment manager as memory
//!source. The internal pointer type will of the same type (raw, smart) as
//!"typename SegmentManager::void_pointer" type. This allows
//!placing the allocator in shared memory, memory mapped-files, etc...
//!
-//!This node allocator shares a segregated storage between all instances of
+//!This node allocator shares a segregated storage between all instances of
//!cached_adaptive_pool with equal sizeof(T) placed in the same
//!memory segment. But also caches some nodes privately to
//!avoid some synchronization overhead.
@@ -149,13 +149,13 @@ class cached_adaptive_pool
template<class T2>
struct rebind
- {
+ {
typedef cached_adaptive_pool
<T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> other;
};
cached_adaptive_pool(SegmentManager *segment_mngr,
- std::size_t max_cached_nodes = base_t::DEFAULT_MAX_CACHED_NODES)
+ std::size_t max_cached_nodes = base_t::DEFAULT_MAX_CACHED_NODES)
: base_t(segment_mngr, max_cached_nodes)
{}
@@ -179,11 +179,11 @@ class cached_adaptive_pool
typedef typename segment_manager::size_type size_type;
typedef typename segment_manager::difference_type difference_type;
- //!Obtains cached_adaptive_pool from
+ //!Obtains cached_adaptive_pool from
//!cached_adaptive_pool
template<class T2>
struct rebind
- {
+ {
typedef cached_adaptive_pool<T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> other;
};
@@ -194,7 +194,7 @@ class cached_adaptive_pool
cached_adaptive_pool& operator=
(const cached_adaptive_pool<T2, SegmentManager2, N2, F2, OP2>&);
- //!Not assignable from
+ //!Not assignable from
//!other cached_adaptive_pool
cached_adaptive_pool& operator=(const cached_adaptive_pool&);
@@ -204,7 +204,7 @@ class cached_adaptive_pool
//!Can throw boost::interprocess::bad_alloc
cached_adaptive_pool(segment_manager *segment_mngr);
- //!Copy constructor from other cached_adaptive_pool. Increments the reference
+ //!Copy constructor from other cached_adaptive_pool. Increments the reference
//!count of the associated node pool. Never throws
cached_adaptive_pool(const cached_adaptive_pool &other);
@@ -231,7 +231,7 @@ class cached_adaptive_pool
//!Never throws
size_type max_size() const;
- //!Allocate memory for an array of count elements.
+ //!Allocate memory for an array of count elements.
//!Throws boost::interprocess::bad_alloc if there is no enough memory
pointer allocate(size_type count, cvoid_pointer hint = 0);
@@ -255,7 +255,7 @@ class cached_adaptive_pool
//!Never throws
const_pointer address(const_reference value) const;
- //!Copy construct an object.
+ //!Copy construct an object.
//!Throws if T's copy constructor throws
void construct(const pointer &ptr, const_reference v);
@@ -270,7 +270,7 @@ class cached_adaptive_pool
std::pair<pointer, bool>
allocation_command(boost::interprocess::allocation_type command,
- size_type limit_size,
+ size_type limit_size,
size_type preferred_size,
size_type &received_size, const pointer &reuse = 0);
@@ -335,13 +335,13 @@ class cached_adaptive_pool
//!Equality test for same type
//!of cached_adaptive_pool
template<class T, class S, std::size_t NodesPerBlock, std::size_t F, std::size_t OP> inline
-bool operator==(const cached_adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc1,
+bool operator==(const cached_adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc1,
const cached_adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc2);
//!Inequality test for same type
//!of cached_adaptive_pool
template<class T, class S, std::size_t NodesPerBlock, std::size_t F, std::size_t OP> inline
-bool operator!=(const cached_adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc1,
+bool operator!=(const cached_adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc1,
const cached_adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc2);
#endif
diff --git a/boost/interprocess/allocators/cached_node_allocator.hpp b/boost/interprocess/allocators/cached_node_allocator.hpp
index 03398156db..b0ad0e4ebc 100644
--- a/boost/interprocess/allocators/cached_node_allocator.hpp
+++ b/boost/interprocess/allocators/cached_node_allocator.hpp
@@ -28,7 +28,7 @@
#include <cstddef>
//!\file
-//!Describes cached_cached_node_allocator pooled shared memory STL compatible allocator
+//!Describes cached_cached_node_allocator pooled shared memory STL compatible allocator
namespace boost {
namespace interprocess {
@@ -64,7 +64,7 @@ class cached_node_allocator_v1
template<class T2>
struct rebind
- {
+ {
typedef cached_node_allocator_v1
<T2, SegmentManager, NodesPerBlock> other;
};
@@ -72,7 +72,7 @@ class cached_node_allocator_v1
typedef typename base_t::size_type size_type;
cached_node_allocator_v1(SegmentManager *segment_mngr,
- size_type max_cached_nodes = base_t::DEFAULT_MAX_CACHED_NODES)
+ size_type max_cached_nodes = base_t::DEFAULT_MAX_CACHED_NODES)
: base_t(segment_mngr, max_cached_nodes)
{}
@@ -122,12 +122,12 @@ class cached_node_allocator
template<class T2>
struct rebind
- {
+ {
typedef cached_node_allocator<T2, SegmentManager, NodesPerBlock> other;
};
cached_node_allocator(SegmentManager *segment_mngr,
- size_type max_cached_nodes = base_t::DEFAULT_MAX_CACHED_NODES)
+ size_type max_cached_nodes = base_t::DEFAULT_MAX_CACHED_NODES)
: base_t(segment_mngr, max_cached_nodes)
{}
@@ -151,11 +151,11 @@ class cached_node_allocator
typedef typename SegmentManager::size_type size_type;
typedef typename SegmentManager::difference_type difference_type;
- //!Obtains cached_node_allocator from
+ //!Obtains cached_node_allocator from
//!cached_node_allocator
template<class T2>
struct rebind
- {
+ {
typedef cached_node_allocator<T2, SegmentManager> other;
};
@@ -166,7 +166,7 @@ class cached_node_allocator
cached_node_allocator& operator=
(const cached_node_allocator<T2, SegmentManager2, N2>&);
- //!Not assignable from
+ //!Not assignable from
//!other cached_node_allocator
cached_node_allocator& operator=(const cached_node_allocator&);
@@ -176,7 +176,7 @@ class cached_node_allocator
//!Can throw boost::interprocess::bad_alloc
cached_node_allocator(segment_manager *segment_mngr);
- //!Copy constructor from other cached_node_allocator. Increments the reference
+ //!Copy constructor from other cached_node_allocator. Increments the reference
//!count of the associated node pool. Never throws
cached_node_allocator(const cached_node_allocator &other);
@@ -203,7 +203,7 @@ class cached_node_allocator
//!Never throws
size_type max_size() const;
- //!Allocate memory for an array of count elements.
+ //!Allocate memory for an array of count elements.
//!Throws boost::interprocess::bad_alloc if there is no enough memory
pointer allocate(size_type count, cvoid_pointer hint = 0);
@@ -227,7 +227,7 @@ class cached_node_allocator
//!Never throws
const_pointer address(const_reference value) const;
- //!Default construct an object.
+ //!Default construct an object.
//!Throws if T's default constructor throws
void construct(const pointer &ptr, const_reference v);
@@ -242,7 +242,7 @@ class cached_node_allocator
std::pair<pointer, bool>
allocation_command(boost::interprocess::allocation_type command,
- size_type limit_size,
+ size_type limit_size,
size_type preferred_size,
size_type &received_size, const pointer &reuse = 0);
@@ -307,13 +307,13 @@ class cached_node_allocator
//!Equality test for same type
//!of cached_node_allocator
template<class T, class S, std::size_t NPC> inline
-bool operator==(const cached_node_allocator<T, S, NPC> &alloc1,
+bool operator==(const cached_node_allocator<T, S, NPC> &alloc1,
const cached_node_allocator<T, S, NPC> &alloc2);
//!Inequality test for same type
//!of cached_node_allocator
template<class T, class S, std::size_t NPC> inline
-bool operator!=(const cached_node_allocator<T, S, NPC> &alloc1,
+bool operator!=(const cached_node_allocator<T, S, NPC> &alloc1,
const cached_node_allocator<T, S, NPC> &alloc2);
#endif
diff --git a/boost/interprocess/allocators/detail/adaptive_node_pool.hpp b/boost/interprocess/allocators/detail/adaptive_node_pool.hpp
index 4ccc920663..abe183146f 100644
--- a/boost/interprocess/allocators/detail/adaptive_node_pool.hpp
+++ b/boost/interprocess/allocators/detail/adaptive_node_pool.hpp
@@ -74,7 +74,7 @@ class private_adaptive_node_pool
};
//!Pooled shared memory allocator using adaptive pool. Includes
-//!a reference count but the class does not delete itself, this is
+//!a reference count but the class does not delete itself, this is
//!responsibility of user classes. Node size (NodeSize) and the number of
//!nodes allocated per block (NodesPerBlock) are known at compile time
template< class SegmentManager
@@ -83,7 +83,7 @@ template< class SegmentManager
, std::size_t MaxFreeBlocks
, unsigned char OverheadPercent
>
-class shared_adaptive_node_pool
+class shared_adaptive_node_pool
: public ipcdetail::shared_pool_impl
< private_adaptive_node_pool
<SegmentManager, NodeSize, NodesPerBlock, MaxFreeBlocks, OverheadPercent>
diff --git a/boost/interprocess/allocators/detail/allocator_common.hpp b/boost/interprocess/allocators/detail/allocator_common.hpp
index ea660b1a90..ba14d3f64d 100644
--- a/boost/interprocess/allocators/detail/allocator_common.hpp
+++ b/boost/interprocess/allocators/detail/allocator_common.hpp
@@ -73,7 +73,7 @@ namespace ipcdetail {
template<class NodePool>
struct get_or_create_node_pool_func
{
-
+
//!This connects or constructs the unique instance of node_pool_t
//!Can throw boost::interprocess::bad_alloc
void operator()()
@@ -90,7 +90,7 @@ struct get_or_create_node_pool_func
//!object parameters
get_or_create_node_pool_func(typename NodePool::segment_manager *mngr)
: mp_segment_manager(mngr){}
-
+
NodePool *mp_node_pool;
typename NodePool::segment_manager *mp_segment_manager;
};
@@ -103,13 +103,13 @@ inline NodePool *get_or_create_node_pool(typename NodePool::segment_manager *mgn
return func.mp_node_pool;
}
-//!Object function that decrements the reference count. If the count
-//!reaches to zero destroys the node allocator from memory.
+//!Object function that decrements the reference count. If the count
+//!reaches to zero destroys the node allocator from memory.
//!Never throws
template<class NodePool>
struct destroy_if_last_link_func
{
- //!Decrements reference count and destroys the object if there is no
+ //!Decrements reference count and destroys the object if there is no
//!more attached allocators. Never throws
void operator()()
{
@@ -117,19 +117,19 @@ struct destroy_if_last_link_func
if(mp_node_pool->dec_ref_count() != 0) return;
//Last link, let's destroy the segment_manager
- mp_node_pool->get_segment_manager()->template destroy<NodePool>(boost::interprocess::unique_instance);
- }
+ mp_node_pool->get_segment_manager()->template destroy<NodePool>(boost::interprocess::unique_instance);
+ }
//!Constructor. Initializes function
//!object parameters
- destroy_if_last_link_func(NodePool *pool)
+ destroy_if_last_link_func(NodePool *pool)
: mp_node_pool(pool)
{}
NodePool *mp_node_pool;
};
-//!Destruction function, initializes and executes destruction function
+//!Destruction function, initializes and executes destruction function
//!object. Never throws
template<class NodePool>
inline void destroy_node_pool_if_last_link(NodePool *pool)
@@ -173,7 +173,7 @@ class cache_impl
~cache_impl()
{
this->deallocate_all_cached_nodes();
- ipcdetail::destroy_node_pool_if_last_link(ipcdetail::to_raw_pointer(mp_node_pool));
+ ipcdetail::destroy_node_pool_if_last_link(ipcdetail::to_raw_pointer(mp_node_pool));
}
NodePool *get_node_pool() const
@@ -227,7 +227,7 @@ class cache_impl
//Check if cache is full
if(m_cached_nodes.size() >= m_max_cached_nodes){
//This only occurs if this allocator deallocate memory allocated
- //with other equal allocator. Since the cache is full, and more
+ //with other equal allocator. Since the cache is full, and more
//deallocations are probably coming, we'll make some room in cache
//in a single, efficient multi node deallocation.
this->priv_deallocate_n_nodes(m_cached_nodes.size() - m_max_cached_nodes/2);
@@ -242,7 +242,7 @@ class cache_impl
//Check if cache is full
if(m_cached_nodes.size() >= m_max_cached_nodes){
//This only occurs if this allocator deallocate memory allocated
- //with other equal allocator. Since the cache is full, and more
+ //with other equal allocator. Since the cache is full, and more
//deallocations are probably coming, we'll make some room in cache
//in a single, efficient multi node deallocation.
this->priv_deallocate_n_nodes(m_cached_nodes.size() - m_max_cached_nodes/2);
@@ -279,7 +279,7 @@ class cache_impl
void priv_deallocate_n_nodes(size_type n)
{
//This only occurs if this allocator deallocate memory allocated
- //with other equal allocator. Since the cache is full, and more
+ //with other equal allocator. Since the cache is full, and more
//deallocations are probably coming, we'll make some room in cache
//in a single, efficient multi node deallocation.
size_type count(n);
@@ -296,10 +296,10 @@ class cache_impl
public:
void swap(cache_impl &other)
{
- ipcdetail::do_swap(mp_node_pool, other.mp_node_pool);
- m_cached_nodes.swap(other.m_cached_nodes);
- ipcdetail::do_swap(m_max_cached_nodes, other.m_max_cached_nodes);
- }
+ ipcdetail::do_swap(mp_node_pool, other.mp_node_pool);
+ m_cached_nodes.swap(other.m_cached_nodes);
+ ipcdetail::do_swap(m_max_cached_nodes, other.m_max_cached_nodes);
+ }
};
template<class Derived, class T, class SegmentManager>
@@ -335,13 +335,13 @@ class array_allocation_impl
//!pointed by p can hold. This size only works for memory allocated with
//!allocate, allocation_command and allocate_many.
size_type size(const pointer &p) const
- {
+ {
return (size_type)this->derived()->get_segment_manager()->size(ipcdetail::to_raw_pointer(p))/sizeof(T);
}
std::pair<pointer, bool>
allocation_command(boost::interprocess::allocation_type command,
- size_type limit_size,
+ size_type limit_size,
size_type preferred_size,
size_type &received_size, const pointer &reuse = 0)
{
@@ -450,7 +450,7 @@ class node_pool_allocation_impl
};
public:
- //!Allocate memory for an array of count elements.
+ //!Allocate memory for an array of count elements.
//!Throws boost::interprocess::bad_alloc if there is no enough memory
pointer allocate(size_type count, cvoid_pointer hint = 0)
{
@@ -599,7 +599,7 @@ class cached_allocator_impl
size_type get_max_cached_nodes() const
{ return m_cache.get_max_cached_nodes(); }
- //!Allocate memory for an array of count elements.
+ //!Allocate memory for an array of count elements.
//!Throws boost::interprocess::bad_alloc if there is no enough memory
pointer allocate(size_type count, cvoid_pointer hint = 0)
{
@@ -612,7 +612,7 @@ class cached_allocator_impl
}
else{
ret = this->get_segment_manager()->allocate(sizeof(T)*count);
- }
+ }
return pointer(static_cast<T*>(ret));
}
@@ -686,20 +686,20 @@ class cached_allocator_impl
//!Equality test for same type of
//!cached_allocator_impl
template<class T, class N, unsigned int V> inline
-bool operator==(const cached_allocator_impl<T, N, V> &alloc1,
+bool operator==(const cached_allocator_impl<T, N, V> &alloc1,
const cached_allocator_impl<T, N, V> &alloc2)
{ return alloc1.get_node_pool() == alloc2.get_node_pool(); }
//!Inequality test for same type of
//!cached_allocator_impl
template<class T, class N, unsigned int V> inline
-bool operator!=(const cached_allocator_impl<T, N, V> &alloc1,
+bool operator!=(const cached_allocator_impl<T, N, V> &alloc1,
const cached_allocator_impl<T, N, V> &alloc2)
{ return alloc1.get_node_pool() != alloc2.get_node_pool(); }
//!Pooled shared memory allocator using adaptive pool. Includes
-//!a reference count but the class does not delete itself, this is
+//!a reference count but the class does not delete itself, this is
//!responsibility of user classes. Node size (NodeSize) and the number of
//!nodes allocated per block (NodesPerBlock) are known at compile time
template<class private_node_allocator_t>
@@ -736,7 +736,7 @@ class shared_pool_impl
//-----------------------
return private_node_allocator_t::allocate_node();
}
-
+
//!Deallocates an array pointed by ptr. Never throws
void deallocate_node(void *ptr)
{
@@ -756,7 +756,7 @@ class shared_pool_impl
return private_node_allocator_t::allocate_nodes(nodes, n);
}
*/
- //!Allocates n nodes.
+ //!Allocates n nodes.
//!Can throw boost::interprocess::bad_alloc
multiallocation_chain allocate_nodes(const size_type n)
{
diff --git a/boost/interprocess/allocators/detail/node_pool.hpp b/boost/interprocess/allocators/detail/node_pool.hpp
index 7327ff92d5..562b64863b 100644
--- a/boost/interprocess/allocators/detail/node_pool.hpp
+++ b/boost/interprocess/allocators/detail/node_pool.hpp
@@ -37,7 +37,7 @@ namespace ipcdetail {
//!Pooled shared memory allocator using single segregated storage. Includes
-//!a reference count but the class does not delete itself, this is
+//!a reference count but the class does not delete itself, this is
//!responsibility of user classes. Node size (NodeSize) and the number of
//!nodes allocated per block (NodesPerBlock) are known at compile time
template< class SegmentManager, std::size_t NodeSize, std::size_t NodesPerBlock >
@@ -73,18 +73,18 @@ class private_node_pool
//!Pooled shared memory allocator using single segregated storage. Includes
-//!a reference count but the class does not delete itself, this is
+//!a reference count but the class does not delete itself, this is
//!responsibility of user classes. Node size (NodeSize) and the number of
//!nodes allocated per block (NodesPerBlock) are known at compile time
//!Pooled shared memory allocator using adaptive pool. Includes
-//!a reference count but the class does not delete itself, this is
+//!a reference count but the class does not delete itself, this is
//!responsibility of user classes. Node size (NodeSize) and the number of
//!nodes allocated per block (NodesPerBlock) are known at compile time
template< class SegmentManager
, std::size_t NodeSize
, std::size_t NodesPerBlock
>
-class shared_node_pool
+class shared_node_pool
: public ipcdetail::shared_pool_impl
< private_node_pool
<SegmentManager, NodeSize, NodesPerBlock>
diff --git a/boost/interprocess/allocators/node_allocator.hpp b/boost/interprocess/allocators/node_allocator.hpp
index f1c3259d73..2c1fe566a3 100644
--- a/boost/interprocess/allocators/node_allocator.hpp
+++ b/boost/interprocess/allocators/node_allocator.hpp
@@ -34,7 +34,7 @@
#include <cstddef>
//!\file
-//!Describes node_allocator pooled shared memory STL compatible allocator
+//!Describes node_allocator pooled shared memory STL compatible allocator
namespace boost {
namespace interprocess {
@@ -98,11 +98,11 @@ class node_allocator_base
typedef boost::container::container_detail::transform_multiallocation_chain
<typename SegmentManager::multiallocation_chain, T>multiallocation_chain;
- //!Obtains node_allocator_base from
+ //!Obtains node_allocator_base from
//!node_allocator_base
template<class T2>
struct rebind
- {
+ {
typedef node_allocator_base<Version, T2, SegmentManager, NodesPerBlock> other;
};
@@ -121,15 +121,15 @@ class node_allocator_base
//!Constructor from a segment manager. If not present, constructs a node
//!pool. Increments the reference count of the associated node pool.
//!Can throw boost::interprocess::bad_alloc
- node_allocator_base(segment_manager *segment_mngr)
+ node_allocator_base(segment_manager *segment_mngr)
: mp_node_pool(ipcdetail::get_or_create_node_pool<typename node_pool<0>::type>(segment_mngr)) { }
- //!Copy constructor from other node_allocator_base. Increments the reference
+ //!Copy constructor from other node_allocator_base. Increments the reference
//!count of the associated node pool. Never throws
- node_allocator_base(const node_allocator_base &other)
- : mp_node_pool(other.get_node_pool())
- {
- node_pool<0>::get(ipcdetail::to_raw_pointer(mp_node_pool))->inc_ref_count();
+ node_allocator_base(const node_allocator_base &other)
+ : mp_node_pool(other.get_node_pool())
+ {
+ node_pool<0>::get(ipcdetail::to_raw_pointer(mp_node_pool))->inc_ref_count();
}
//!Copy constructor from related node_allocator_base. If not present, constructs
@@ -150,7 +150,7 @@ class node_allocator_base
//!Destructor, removes node_pool_t from memory
//!if its reference count reaches to zero. Never throws
- ~node_allocator_base()
+ ~node_allocator_base()
{ ipcdetail::destroy_node_pool_if_last_link(node_pool<0>::get(ipcdetail::to_raw_pointer(mp_node_pool))); }
//!Returns a pointer to the node pool.
@@ -177,14 +177,14 @@ class node_allocator_base
//!Equality test for same type
//!of node_allocator_base
template<unsigned int V, class T, class S, std::size_t NPC> inline
-bool operator==(const node_allocator_base<V, T, S, NPC> &alloc1,
+bool operator==(const node_allocator_base<V, T, S, NPC> &alloc1,
const node_allocator_base<V, T, S, NPC> &alloc2)
{ return alloc1.get_node_pool() == alloc2.get_node_pool(); }
//!Inequality test for same type
//!of node_allocator_base
template<unsigned int V, class T, class S, std::size_t NPC> inline
-bool operator!=(const node_allocator_base<V, T, S, NPC> &alloc1,
+bool operator!=(const node_allocator_base<V, T, S, NPC> &alloc1,
const node_allocator_base<V, T, S, NPC> &alloc2)
{ return alloc1.get_node_pool() != alloc2.get_node_pool(); }
@@ -206,11 +206,11 @@ class node_allocator_v1
template<class T2>
struct rebind
- {
+ {
typedef node_allocator_v1<T2, SegmentManager, NodesPerBlock> other;
};
- node_allocator_v1(SegmentManager *segment_mngr)
+ node_allocator_v1(SegmentManager *segment_mngr)
: base_t(segment_mngr)
{}
@@ -225,12 +225,12 @@ class node_allocator_v1
/// @endcond
-//!An STL node allocator that uses a segment manager as memory
+//!An STL node allocator that uses a segment manager as memory
//!source. The internal pointer type will of the same type (raw, smart) as
//!"typename SegmentManager::void_pointer" type. This allows
//!placing the allocator in shared memory, memory mapped-files, etc...
-//!This node allocator shares a segregated storage between all instances
-//!of node_allocator with equal sizeof(T) placed in the same segment
+//!This node allocator shares a segregated storage between all instances
+//!of node_allocator with equal sizeof(T) placed in the same segment
//!group. NodesPerBlock is the number of nodes allocated at once when the allocator
//!needs runs out of nodes
template < class T
@@ -256,11 +256,11 @@ class node_allocator
template<class T2>
struct rebind
- {
+ {
typedef node_allocator<T2, SegmentManager, NodesPerBlock> other;
};
- node_allocator(SegmentManager *segment_mngr)
+ node_allocator(SegmentManager *segment_mngr)
: base_t(segment_mngr)
{}
@@ -284,11 +284,11 @@ class node_allocator
typedef typename segment_manager::size_type size_type;
typedef typename segment_manager::difference_type difference_type;
- //!Obtains node_allocator from
+ //!Obtains node_allocator from
//!node_allocator
template<class T2>
struct rebind
- {
+ {
typedef node_allocator<T2, SegmentManager, NodesPerBlock> other;
};
@@ -299,7 +299,7 @@ class node_allocator
node_allocator& operator=
(const node_allocator<T2, SegmentManager2, N2>&);
- //!Not assignable from
+ //!Not assignable from
//!other node_allocator
//node_allocator& operator=(const node_allocator&);
@@ -309,7 +309,7 @@ class node_allocator
//!Can throw boost::interprocess::bad_alloc
node_allocator(segment_manager *segment_mngr);
- //!Copy constructor from other node_allocator. Increments the reference
+ //!Copy constructor from other node_allocator. Increments the reference
//!count of the associated node pool. Never throws
node_allocator(const node_allocator &other);
@@ -336,7 +336,7 @@ class node_allocator
//!Never throws
size_type max_size() const;
- //!Allocate memory for an array of count elements.
+ //!Allocate memory for an array of count elements.
//!Throws boost::interprocess::bad_alloc if there is no enough memory
pointer allocate(size_type count, cvoid_pointer hint = 0);
@@ -360,7 +360,7 @@ class node_allocator
//!Never throws
const_pointer address(const_reference value) const;
- //!Copy construct an object.
+ //!Copy construct an object.
//!Throws if T's copy constructor throws
void construct(const pointer &ptr, const_reference v);
@@ -375,7 +375,7 @@ class node_allocator
std::pair<pointer, bool>
allocation_command(boost::interprocess::allocation_type command,
- size_type limit_size,
+ size_type limit_size,
size_type preferred_size,
size_type &received_size, const pointer &reuse = 0);
@@ -433,13 +433,13 @@ class node_allocator
//!Equality test for same type
//!of node_allocator
template<class T, class S, std::size_t NPC> inline
-bool operator==(const node_allocator<T, S, NPC> &alloc1,
+bool operator==(const node_allocator<T, S, NPC> &alloc1,
const node_allocator<T, S, NPC> &alloc2);
//!Inequality test for same type
//!of node_allocator
template<class T, class S, std::size_t NPC> inline
-bool operator!=(const node_allocator<T, S, NPC> &alloc1,
+bool operator!=(const node_allocator<T, S, NPC> &alloc1,
const node_allocator<T, S, NPC> &alloc2);
#endif
diff --git a/boost/interprocess/allocators/private_adaptive_pool.hpp b/boost/interprocess/allocators/private_adaptive_pool.hpp
index 301fb92daa..febe85c69d 100644
--- a/boost/interprocess/allocators/private_adaptive_pool.hpp
+++ b/boost/interprocess/allocators/private_adaptive_pool.hpp
@@ -33,7 +33,7 @@
#include <cstddef>
//!\file
-//!Describes private_adaptive_pool_base pooled shared memory STL compatible allocator
+//!Describes private_adaptive_pool_base pooled shared memory STL compatible allocator
namespace boost {
namespace interprocess {
@@ -102,7 +102,7 @@ class private_adaptive_pool_base
//!Obtains node_allocator from other node_allocator
template<class T2>
struct rebind
- {
+ {
typedef private_adaptive_pool_base
<Version, T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> other;
};
@@ -154,7 +154,7 @@ class private_adaptive_pool_base
{}
//!Destructor, frees all used memory. Never throws
- ~private_adaptive_pool_base()
+ ~private_adaptive_pool_base()
{}
//!Returns the segment manager. Never throws
@@ -178,13 +178,13 @@ class private_adaptive_pool_base
//!Equality test for same type of private_adaptive_pool_base
template<unsigned int V, class T, class S, std::size_t NodesPerBlock, std::size_t F, unsigned char OP> inline
-bool operator==(const private_adaptive_pool_base<V, T, S, NodesPerBlock, F, OP> &alloc1,
+bool operator==(const private_adaptive_pool_base<V, T, S, NodesPerBlock, F, OP> &alloc1,
const private_adaptive_pool_base<V, T, S, NodesPerBlock, F, OP> &alloc2)
{ return &alloc1 == &alloc2; }
//!Inequality test for same type of private_adaptive_pool_base
template<unsigned int V, class T, class S, std::size_t NodesPerBlock, std::size_t F, unsigned char OP> inline
-bool operator!=(const private_adaptive_pool_base<V, T, S, NodesPerBlock, F, OP> &alloc1,
+bool operator!=(const private_adaptive_pool_base<V, T, S, NodesPerBlock, F, OP> &alloc1,
const private_adaptive_pool_base<V, T, S, NodesPerBlock, F, OP> &alloc2)
{ return &alloc1 != &alloc2; }
@@ -210,11 +210,11 @@ class private_adaptive_pool_v1
template<class T2>
struct rebind
- {
+ {
typedef private_adaptive_pool_v1<T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> other;
};
- private_adaptive_pool_v1(SegmentManager *segment_mngr)
+ private_adaptive_pool_v1(SegmentManager *segment_mngr)
: base_t(segment_mngr)
{}
@@ -229,7 +229,7 @@ class private_adaptive_pool_v1
/// @endcond
-//!An STL node allocator that uses a segment manager as memory
+//!An STL node allocator that uses a segment manager as memory
//!source. The internal pointer type will of the same type (raw, smart) as
//!"typename SegmentManager::void_pointer" type. This allows
//!placing the allocator in shared memory, memory mapped-files, etc...
@@ -269,12 +269,12 @@ class private_adaptive_pool
template<class T2>
struct rebind
- {
+ {
typedef private_adaptive_pool
<T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> other;
};
- private_adaptive_pool(SegmentManager *segment_mngr)
+ private_adaptive_pool(SegmentManager *segment_mngr)
: base_t(segment_mngr)
{}
@@ -298,11 +298,11 @@ class private_adaptive_pool
typedef typename segment_manager::size_type size_type;
typedef typename segment_manager::difference_type difference_type;
- //!Obtains private_adaptive_pool from
+ //!Obtains private_adaptive_pool from
//!private_adaptive_pool
template<class T2>
struct rebind
- {
+ {
typedef private_adaptive_pool
<T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent> other;
};
@@ -314,7 +314,7 @@ class private_adaptive_pool
private_adaptive_pool& operator=
(const private_adaptive_pool<T2, SegmentManager2, N2, F2>&);
- //!Not assignable from
+ //!Not assignable from
//!other private_adaptive_pool
private_adaptive_pool& operator=(const private_adaptive_pool&);
@@ -324,7 +324,7 @@ class private_adaptive_pool
//!Can throw boost::interprocess::bad_alloc
private_adaptive_pool(segment_manager *segment_mngr);
- //!Copy constructor from other private_adaptive_pool. Increments the reference
+ //!Copy constructor from other private_adaptive_pool. Increments the reference
//!count of the associated node pool. Never throws
private_adaptive_pool(const private_adaptive_pool &other);
@@ -351,7 +351,7 @@ class private_adaptive_pool
//!Never throws
size_type max_size() const;
- //!Allocate memory for an array of count elements.
+ //!Allocate memory for an array of count elements.
//!Throws boost::interprocess::bad_alloc if there is no enough memory
pointer allocate(size_type count, cvoid_pointer hint = 0);
@@ -375,7 +375,7 @@ class private_adaptive_pool
//!Never throws
const_pointer address(const_reference value) const;
- //!Copy construct an object.
+ //!Copy construct an object.
//!Throws if T's copy constructor throws
void construct(const pointer &ptr, const_reference v);
@@ -390,7 +390,7 @@ class private_adaptive_pool
std::pair<pointer, bool>
allocation_command(boost::interprocess::allocation_type command,
- size_type limit_size,
+ size_type limit_size,
size_type preferred_size,
size_type &received_size, const pointer &reuse = 0);
@@ -448,13 +448,13 @@ class private_adaptive_pool
//!Equality test for same type
//!of private_adaptive_pool
template<class T, class S, std::size_t NodesPerBlock, std::size_t F, unsigned char OP> inline
-bool operator==(const private_adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc1,
+bool operator==(const private_adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc1,
const private_adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc2);
//!Inequality test for same type
//!of private_adaptive_pool
template<class T, class S, std::size_t NodesPerBlock, std::size_t F, unsigned char OP> inline
-bool operator!=(const private_adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc1,
+bool operator!=(const private_adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc1,
const private_adaptive_pool<T, S, NodesPerBlock, F, OP> &alloc2);
#endif
diff --git a/boost/interprocess/allocators/private_node_allocator.hpp b/boost/interprocess/allocators/private_node_allocator.hpp
index f202e316fa..46b7dd6097 100644
--- a/boost/interprocess/allocators/private_node_allocator.hpp
+++ b/boost/interprocess/allocators/private_node_allocator.hpp
@@ -33,7 +33,7 @@
#include <cstddef>
//!\file
-//!Describes private_node_allocator_base pooled shared memory STL compatible allocator
+//!Describes private_node_allocator_base pooled shared memory STL compatible allocator
namespace boost {
namespace interprocess {
@@ -97,7 +97,7 @@ class private_node_allocator_base
//!Obtains node_allocator from other node_allocator
template<class T2>
struct rebind
- {
+ {
typedef private_node_allocator_base
<Version, T2, SegmentManager, NodesPerBlock> other;
};
@@ -146,7 +146,7 @@ class private_node_allocator_base
{}
//!Destructor, frees all used memory. Never throws
- ~private_node_allocator_base()
+ ~private_node_allocator_base()
{}
//!Returns the segment manager. Never throws
@@ -170,13 +170,13 @@ class private_node_allocator_base
//!Equality test for same type of private_node_allocator_base
template<unsigned int V, class T, class S, std::size_t NPC> inline
-bool operator==(const private_node_allocator_base<V, T, S, NPC> &alloc1,
+bool operator==(const private_node_allocator_base<V, T, S, NPC> &alloc1,
const private_node_allocator_base<V, T, S, NPC> &alloc2)
{ return &alloc1 == &alloc2; }
//!Inequality test for same type of private_node_allocator_base
template<unsigned int V, class T, class S, std::size_t NPC> inline
-bool operator!=(const private_node_allocator_base<V, T, S, NPC> &alloc1,
+bool operator!=(const private_node_allocator_base<V, T, S, NPC> &alloc1,
const private_node_allocator_base<V, T, S, NPC> &alloc2)
{ return &alloc1 != &alloc2; }
@@ -198,11 +198,11 @@ class private_node_allocator_v1
template<class T2>
struct rebind
- {
+ {
typedef private_node_allocator_v1<T2, SegmentManager, NodesPerBlock> other;
};
- private_node_allocator_v1(SegmentManager *segment_mngr)
+ private_node_allocator_v1(SegmentManager *segment_mngr)
: base_t(segment_mngr)
{}
@@ -217,11 +217,11 @@ class private_node_allocator_v1
/// @endcond
-//!An STL node allocator that uses a segment manager as memory
+//!An STL node allocator that uses a segment manager as memory
//!source. The internal pointer type will of the same type (raw, smart) as
//!"typename SegmentManager::void_pointer" type. This allows
//!placing the allocator in shared memory, memory mapped-files, etc...
-//!This allocator has its own node pool. NodesPerBlock is the number of nodes allocated
+//!This allocator has its own node pool. NodesPerBlock is the number of nodes allocated
//!at once when the allocator needs runs out of nodes
template < class T
, class SegmentManager
@@ -246,12 +246,12 @@ class private_node_allocator
template<class T2>
struct rebind
- {
+ {
typedef private_node_allocator
<T2, SegmentManager, NodesPerBlock> other;
};
- private_node_allocator(SegmentManager *segment_mngr)
+ private_node_allocator(SegmentManager *segment_mngr)
: base_t(segment_mngr)
{}
@@ -275,11 +275,11 @@ class private_node_allocator
typedef typename segment_manager::size_type size_type;
typedef typename segment_manage::difference_type difference_type;
- //!Obtains private_node_allocator from
+ //!Obtains private_node_allocator from
//!private_node_allocator
template<class T2>
struct rebind
- {
+ {
typedef private_node_allocator
<T2, SegmentManager, NodesPerBlock> other;
};
@@ -291,7 +291,7 @@ class private_node_allocator
private_node_allocator& operator=
(const private_node_allocator<T2, SegmentManager2, N2>&);
- //!Not assignable from
+ //!Not assignable from
//!other private_node_allocator
private_node_allocator& operator=(const private_node_allocator&);
@@ -301,7 +301,7 @@ class private_node_allocator
//!Can throw boost::interprocess::bad_alloc
private_node_allocator(segment_manager *segment_mngr);
- //!Copy constructor from other private_node_allocator. Increments the reference
+ //!Copy constructor from other private_node_allocator. Increments the reference
//!count of the associated node pool. Never throws
private_node_allocator(const private_node_allocator &other);
@@ -328,7 +328,7 @@ class private_node_allocator
//!Never throws
size_type max_size() const;
- //!Allocate memory for an array of count elements.
+ //!Allocate memory for an array of count elements.
//!Throws boost::interprocess::bad_alloc if there is no enough memory
pointer allocate(size_type count, cvoid_pointer hint = 0);
@@ -352,7 +352,7 @@ class private_node_allocator
//!Never throws
const_pointer address(const_reference value) const;
- //!Copy construct an object.
+ //!Copy construct an object.
//!Throws if T's copy constructor throws
void construct(const pointer &ptr, const_reference v);
@@ -367,7 +367,7 @@ class private_node_allocator
std::pair<pointer, bool>
allocation_command(boost::interprocess::allocation_type command,
- size_type limit_size,
+ size_type limit_size,
size_type preferred_size,
size_type &received_size, const pointer &reuse = 0);
@@ -425,13 +425,13 @@ class private_node_allocator
//!Equality test for same type
//!of private_node_allocator
template<class T, class S, std::size_t NodesPerBlock, std::size_t F, unsigned char OP> inline
-bool operator==(const private_node_allocator<T, S, NodesPerBlock, F, OP> &alloc1,
+bool operator==(const private_node_allocator<T, S, NodesPerBlock, F, OP> &alloc1,
const private_node_allocator<T, S, NodesPerBlock, F, OP> &alloc2);
//!Inequality test for same type
//!of private_node_allocator
template<class T, class S, std::size_t NodesPerBlock, std::size_t F, unsigned char OP> inline
-bool operator!=(const private_node_allocator<T, S, NodesPerBlock, F, OP> &alloc1,
+bool operator!=(const private_node_allocator<T, S, NodesPerBlock, F, OP> &alloc1,
const private_node_allocator<T, S, NodesPerBlock, F, OP> &alloc2);
#endif
diff --git a/boost/interprocess/anonymous_shared_memory.hpp b/boost/interprocess/anonymous_shared_memory.hpp
index 7184306a6d..624f57f9c3 100644
--- a/boost/interprocess/anonymous_shared_memory.hpp
+++ b/boost/interprocess/anonymous_shared_memory.hpp
@@ -20,7 +20,7 @@
#include <cstddef>
#if (!defined(BOOST_INTERPROCESS_WINDOWS))
-# include <fcntl.h> //open, O_CREAT, O_*...
+# include <fcntl.h> //open, O_CREAT, O_*...
# include <sys/mman.h> //mmap
# include <sys/stat.h> //mode_t, S_IRWXG, S_IRWXO, S_IRWXU,
#else
@@ -43,12 +43,10 @@ namespace ipcdetail{
{
public:
static mapped_region
- create_posix_mapped_region(void *address, offset_t offset, std::size_t size)
+ create_posix_mapped_region(void *address, std::size_t size)
{
mapped_region region;
region.m_base = address;
- region.m_offset = offset;
- region.m_extra_offset = 0;
region.m_size = size;
return region;
}
@@ -92,16 +90,16 @@ anonymous_shared_memory(std::size_t size, void *address = 0)
, 0);
if(address == MAP_FAILED){
- if(fd != -1)
+ if(fd != -1)
close(fd);
error_info err = system_error_code();
throw interprocess_exception(err);
}
- if(fd != -1)
+ if(fd != -1)
close(fd);
- return ipcdetail::raw_mapped_region_creator::create_posix_mapped_region(address, 0, size);
+ return ipcdetail::raw_mapped_region_creator::create_posix_mapped_region(address, size);
}
#else
{
diff --git a/boost/interprocess/detail/atomic.hpp b/boost/interprocess/detail/atomic.hpp
index f7551f3dda..aab1533985 100644
--- a/boost/interprocess/detail/atomic.hpp
+++ b/boost/interprocess/detail/atomic.hpp
@@ -117,23 +117,6 @@ inline boost::uint32_t atomic_cas32
: "cc");
return prev;
-/*
- asm volatile( "lock\n\t"
- "cmpxchg %3,%1"
- : "=a" (prev), "=m" (*(mem))
- : "0" (prev), "r" (with)
- : "memory", "cc");
-*/
-/*
- boost::uint32_t prev;
-
- asm volatile ("lock; cmpxchgl %1, %2"
- : "=a" (prev)
- : "r" (with), "m" (*(mem)), "0"(cmp));
- asm volatile("" : : : "memory");
-
- return prev;
-*/
}
//! Atomically add 'val' to an boost::uint32_t
@@ -158,14 +141,6 @@ inline boost::uint32_t atomic_add32
);
return r;
-/*
- asm volatile( "lock\n\t; xaddl %0,%1"
- : "=r"(val), "=m"(*mem)
- : "0"(val), "m"(*mem));
- asm volatile("" : : : "memory");
-
- return val;
-*/
}
//! Atomically increment an apr_uint32_t by 1
@@ -208,17 +183,14 @@ inline boost::uint32_t atomic_add32(volatile boost::uint32_t *mem, boost::uint32
{
boost::uint32_t prev, temp;
- asm volatile ("0:\n\t" // retry local label
- "lwarx %0,0,%2\n\t" // load prev and reserve
- "add %1,%0,%3\n\t" // temp = prev + val
- "stwcx. %1,0,%2\n\t" // conditionally store
- "bne- 0b" // start over if we lost
- // the reservation
- //XXX find a cleaner way to define the temp
- //it's not an output
- : "=&r" (prev), "=&r" (temp) // output, temp
- : "b" (mem), "r" (val) // inputs
- : "memory", "cc"); // clobbered
+ asm volatile ("1:\n\t"
+ "lwarx %0,0,%2\n\t"
+ "add %1,%0,%3\n\t"
+ "stwcx. %1,0,%2\n\t"
+ "bne- 1b"
+ : "=&r" (prev), "=&r" (temp)
+ : "b" (mem), "r" (val)
+ : "cc", "memory");
return prev;
}
@@ -233,19 +205,16 @@ inline boost::uint32_t atomic_cas32
{
boost::uint32_t prev;
- asm volatile ("0:\n\t" // retry local label
- "lwarx %0,0,%1\n\t" // load prev and reserve
- "cmpw %0,%3\n\t" // does it match cmp?
- "bne- 1f\n\t" // ...no, bail out
- "stwcx. %2,0,%1\n\t" // ...yes, conditionally
- // store with
- "bne- 0b\n\t" // start over if we lost
- // the reservation
- "1:" // exit local label
-
- : "=&r"(prev) // output
- : "b" (mem), "r" (with), "r"(cmp) // inputs
- : "memory", "cc"); // clobbered
+ asm volatile ("1:\n\t"
+ "lwarx %0,0,%1\n\t"
+ "cmpw %0,%3\n\t"
+ "bne- 2f\n\t"
+ "stwcx. %2,0,%1\n\t"
+ "bne- 1b\n\t"
+ "2:"
+ : "=&r"(prev)
+ : "b" (mem), "r"(cmp), "r" (with)
+ : "cc", "memory");
return prev;
}
@@ -275,56 +244,6 @@ inline void atomic_write32(volatile boost::uint32_t *mem, boost::uint32_t val)
} //namespace interprocess{
} //namespace boost{
-#elif defined(__GNUC__) && ( __GNUC__ * 100 + __GNUC_MINOR__ >= 401 )
-
-namespace boost {
-namespace interprocess {
-namespace ipcdetail{
-
-//! Atomically add 'val' to an boost::uint32_t
-//! "mem": pointer to the object
-//! "val": amount to add
-//! Returns the old value pointed to by mem
-inline boost::uint32_t atomic_add32
- (volatile boost::uint32_t *mem, boost::uint32_t val)
-{ return __sync_fetch_and_add(const_cast<boost::uint32_t *>(mem), val); }
-
-//! Atomically increment an apr_uint32_t by 1
-//! "mem": pointer to the object
-//! Returns the old value pointed to by mem
-inline boost::uint32_t atomic_inc32(volatile boost::uint32_t *mem)
-{ return atomic_add32(mem, 1); }
-
-//! Atomically decrement an boost::uint32_t by 1
-//! "mem": pointer to the atomic value
-//! Returns the old value pointed to by mem
-inline boost::uint32_t atomic_dec32(volatile boost::uint32_t *mem)
-{ return atomic_add32(mem, (boost::uint32_t)-1); }
-
-//! Atomically read an boost::uint32_t from memory
-inline boost::uint32_t atomic_read32(volatile boost::uint32_t *mem)
-{ return *mem; }
-
-//! Compare an boost::uint32_t's value with "cmp".
-//! If they are the same swap the value with "with"
-//! "mem": pointer to the value
-//! "with" what to swap it with
-//! "cmp": the value to compare it to
-//! Returns the old value of *mem
-inline boost::uint32_t atomic_cas32
- (volatile boost::uint32_t *mem, boost::uint32_t with, boost::uint32_t cmp)
-{ return __sync_val_compare_and_swap(const_cast<boost::uint32_t *>(mem), cmp, with); }
-
-//! Atomically set an boost::uint32_t in memory
-//! "mem": pointer to the object
-//! "param": val value that the object will assume
-inline void atomic_write32(volatile boost::uint32_t *mem, boost::uint32_t val)
-{ *mem = val; }
-
-} //namespace ipcdetail{
-} //namespace interprocess{
-} //namespace boost{
-
#elif (defined(sun) || defined(__sun))
#include <atomic.h>
@@ -471,97 +390,147 @@ inline boost::uint32_t atomic_cas32(
} //namespace interprocess{
} //namespace boost{
-#elif defined(__IBMCPP__) && (__IBMCPP__ >= 800) && defined(_AIX)
-
-#include <builtins.h>
-
-namespace boost {
-namespace interprocess {
-namespace ipcdetail{
-
-//first define boost::uint32_t versions of __lwarx and __stwcx to avoid poluting
-//all the functions with casts
-
-//! From XLC documenation :
-//! This function can be used with a subsequent stwcxu call to implement a
-//! read-modify-write on a specified memory location. The two functions work
-//! together to ensure that if the store is successfully performed, no other
-//! processor or mechanism can modify the target doubleword between the time
-//! lwarxu function is executed and the time the stwcxu functio ncompletes.
-//! "mem" : pointer to the object
-//! Returns the value at pointed to by mem
-inline boost::uint32_t lwarxu(volatile boost::uint32_t *mem)
-{
- return static_cast<boost::uint32_t>(__lwarx(reinterpret_cast<volatile int*>(mem)));
-}
-
-//! "mem" : pointer to the object
-//! "val" : the value to store
-//! Returns true if the update of mem is successful and false if it is
-//!unsuccessful
-inline bool stwcxu(volatile boost::uint32_t* mem, boost::uint32_t val)
-{
- return (__stwcx(reinterpret_cast<volatile int*>(mem), static_cast<int>(val)) != 0);
-}
-
-//! "mem": pointer to the object
-//! "val": amount to add
-//! Returns the old value pointed to by mem
-inline boost::uint32_t atomic_add32
- (volatile boost::uint32_t *mem, boost::uint32_t val)
-{
- boost::uint32_t oldValue;
- do
- {
- oldValue = lwarxu(mem);
- }while (!stwcxu(mem, oldValue+val));
- return oldValue;
-}
-
-//! Atomically increment an apr_uint32_t by 1
-//! "mem": pointer to the object
-//! Returns the old value pointed to by mem
-inline boost::uint32_t atomic_inc32(volatile boost::uint32_t *mem)
-{ return atomic_add32(mem, 1); }
-
-//! Atomically decrement an boost::uint32_t by 1
-//! "mem": pointer to the atomic value
-//! Returns the old value pointed to by mem
-inline boost::uint32_t atomic_dec32(volatile boost::uint32_t *mem)
-{ return atomic_add32(mem, (boost::uint32_t)-1); }
-
-//! Atomically read an boost::uint32_t from memory
-inline boost::uint32_t atomic_read32(volatile boost::uint32_t *mem)
-{ return *mem; }
-
-//! Compare an boost::uint32_t's value with "cmp".
-//! If they are the same swap the value with "with"
-//! "mem": pointer to the value
-//! "with" what to swap it with
-//! "cmp": the value to compare it to
-//! Returns the old value of *mem
-inline boost::uint32_t atomic_cas32
- (volatile boost::uint32_t *mem, boost::uint32_t with, boost::uint32_t cmp)
-{
- boost::uint32_t oldValue;
- boost::uint32_t valueToStore;
- do
- {
- oldValue = lwarxu(mem);
- } while (!stwcxu(mem, (oldValue == with) ? cmp : oldValue));
-
- return oldValue;
-}
-
-//! Atomically set an boost::uint32_t in memory
-//! "mem": pointer to the object
-//! "param": val value that the object will assume
-inline void atomic_write32(volatile boost::uint32_t *mem, boost::uint32_t val)
-{ *mem = val; }
-
-} //namespace ipcdetail
-} //namespace interprocess
-} //namespace boost
+#elif defined(__IBMCPP__) && (__IBMCPP__ >= 800) && defined(_AIX)
+
+#include <builtins.h>
+
+namespace boost {
+namespace interprocess {
+namespace ipcdetail{
+
+//first define boost::uint32_t versions of __lwarx and __stwcx to avoid poluting
+//all the functions with casts
+
+//! From XLC documenation :
+//! This function can be used with a subsequent stwcxu call to implement a
+//! read-modify-write on a specified memory location. The two functions work
+//! together to ensure that if the store is successfully performed, no other
+//! processor or mechanism can modify the target doubleword between the time
+//! lwarxu function is executed and the time the stwcxu functio ncompletes.
+//! "mem" : pointer to the object
+//! Returns the value at pointed to by mem
+inline boost::uint32_t lwarxu(volatile boost::uint32_t *mem)
+{
+ return static_cast<boost::uint32_t>(__lwarx(reinterpret_cast<volatile int*>(mem)));
+}
+
+//! "mem" : pointer to the object
+//! "val" : the value to store
+//! Returns true if the update of mem is successful and false if it is
+//!unsuccessful
+inline bool stwcxu(volatile boost::uint32_t* mem, boost::uint32_t val)
+{
+ return (__stwcx(reinterpret_cast<volatile int*>(mem), static_cast<int>(val)) != 0);
+}
+
+//! "mem": pointer to the object
+//! "val": amount to add
+//! Returns the old value pointed to by mem
+inline boost::uint32_t atomic_add32
+ (volatile boost::uint32_t *mem, boost::uint32_t val)
+{
+ boost::uint32_t oldValue;
+ do
+ {
+ oldValue = lwarxu(mem);
+ }while (!stwcxu(mem, oldValue+val));
+ return oldValue;
+}
+
+//! Atomically increment an apr_uint32_t by 1
+//! "mem": pointer to the object
+//! Returns the old value pointed to by mem
+inline boost::uint32_t atomic_inc32(volatile boost::uint32_t *mem)
+{ return atomic_add32(mem, 1); }
+
+//! Atomically decrement an boost::uint32_t by 1
+//! "mem": pointer to the atomic value
+//! Returns the old value pointed to by mem
+inline boost::uint32_t atomic_dec32(volatile boost::uint32_t *mem)
+{ return atomic_add32(mem, (boost::uint32_t)-1); }
+
+//! Atomically read an boost::uint32_t from memory
+inline boost::uint32_t atomic_read32(volatile boost::uint32_t *mem)
+{ return *mem; }
+
+//! Compare an boost::uint32_t's value with "cmp".
+//! If they are the same swap the value with "with"
+//! "mem": pointer to the value
+//! "with" what to swap it with
+//! "cmp": the value to compare it to
+//! Returns the old value of *mem
+inline boost::uint32_t atomic_cas32
+ (volatile boost::uint32_t *mem, boost::uint32_t with, boost::uint32_t cmp)
+{
+ boost::uint32_t oldValue;
+ boost::uint32_t valueToStore;
+ do
+ {
+ oldValue = lwarxu(mem);
+ } while (!stwcxu(mem, (oldValue == with) ? cmp : oldValue));
+
+ return oldValue;
+}
+
+//! Atomically set an boost::uint32_t in memory
+//! "mem": pointer to the object
+//! "param": val value that the object will assume
+inline void atomic_write32(volatile boost::uint32_t *mem, boost::uint32_t val)
+{ *mem = val; }
+
+} //namespace ipcdetail
+} //namespace interprocess
+} //namespace boost
+
+#elif defined(__GNUC__) && ( __GNUC__ * 100 + __GNUC_MINOR__ >= 401 )
+
+namespace boost {
+namespace interprocess {
+namespace ipcdetail{
+
+//! Atomically add 'val' to an boost::uint32_t
+//! "mem": pointer to the object
+//! "val": amount to add
+//! Returns the old value pointed to by mem
+inline boost::uint32_t atomic_add32
+ (volatile boost::uint32_t *mem, boost::uint32_t val)
+{ return __sync_fetch_and_add(const_cast<boost::uint32_t *>(mem), val); }
+
+//! Atomically increment an apr_uint32_t by 1
+//! "mem": pointer to the object
+//! Returns the old value pointed to by mem
+inline boost::uint32_t atomic_inc32(volatile boost::uint32_t *mem)
+{ return atomic_add32(mem, 1); }
+
+//! Atomically decrement an boost::uint32_t by 1
+//! "mem": pointer to the atomic value
+//! Returns the old value pointed to by mem
+inline boost::uint32_t atomic_dec32(volatile boost::uint32_t *mem)
+{ return atomic_add32(mem, (boost::uint32_t)-1); }
+
+//! Atomically read an boost::uint32_t from memory
+inline boost::uint32_t atomic_read32(volatile boost::uint32_t *mem)
+{ return *mem; }
+
+//! Compare an boost::uint32_t's value with "cmp".
+//! If they are the same swap the value with "with"
+//! "mem": pointer to the value
+//! "with" what to swap it with
+//! "cmp": the value to compare it to
+//! Returns the old value of *mem
+inline boost::uint32_t atomic_cas32
+ (volatile boost::uint32_t *mem, boost::uint32_t with, boost::uint32_t cmp)
+{ return __sync_val_compare_and_swap(const_cast<boost::uint32_t *>(mem), cmp, with); }
+
+//! Atomically set an boost::uint32_t in memory
+//! "mem": pointer to the object
+//! "param": val value that the object will assume
+inline void atomic_write32(volatile boost::uint32_t *mem, boost::uint32_t val)
+{ *mem = val; }
+
+} //namespace ipcdetail{
+} //namespace interprocess{
+} //namespace boost{
#else
@@ -583,9 +552,9 @@ inline bool atomic_add_unless32
return c != unless_this;
}
-} //namespace ipcdetail
-} //namespace interprocess
-} //namespace boost
+} //namespace ipcdetail
+} //namespace interprocess
+} //namespace boost
#include <boost/interprocess/detail/config_end.hpp>
diff --git a/boost/interprocess/detail/config_begin.hpp b/boost/interprocess/detail/config_begin.hpp
index 559331ab32..a72f6df1fe 100644
--- a/boost/interprocess/detail/config_begin.hpp
+++ b/boost/interprocess/detail/config_begin.hpp
@@ -44,4 +44,5 @@
// with /GR-; unpredictable behavior may result
#pragma warning (disable : 4673) // throwing '' the following types will not be considered at the catch site
#pragma warning (disable : 4671) // the copy constructor is inaccessible
+ #pragma warning (disable : 4250) // inherits 'x' via dominance
#endif
diff --git a/boost/interprocess/detail/file_locking_helpers.hpp b/boost/interprocess/detail/file_locking_helpers.hpp
new file mode 100644
index 0000000000..2b96e2b6d5
--- /dev/null
+++ b/boost/interprocess/detail/file_locking_helpers.hpp
@@ -0,0 +1,298 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2009-2012. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/interprocess for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTERPROCESS_FILE_LOCKING_HELPERS_HPP
+#define BOOST_INTERPROCESS_FILE_LOCKING_HELPERS_HPP
+
+#if defined(_MSC_VER)&&(_MSC_VER>=1200)
+#pragma once
+#endif
+
+#include <boost/interprocess/detail/config_begin.hpp>
+#include <boost/interprocess/detail/workaround.hpp>
+
+#include <sstream>
+#include <string>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <errno.h>
+#include <cstddef>
+#include <boost/interprocess/detail/os_file_functions.hpp>
+
+#include <boost/interprocess/detail/tmp_dir_helpers.hpp>
+
+#if defined(BOOST_INTERPROCESS_WINDOWS)
+
+#include <fcntl.h>
+#include <io.h>
+#include <sys/locking.h>
+
+#else //defined(BOOST_INTERPROCESS_WINDOWS)
+
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#endif //defined(BOOST_INTERPROCESS_WINDOWS)
+
+namespace boost{
+namespace interprocess{
+namespace ipcdetail{
+
+#if defined(BOOST_INTERPROCESS_WINDOWS)
+
+struct locking_file_serial_id
+{
+ int fd;
+ unsigned long dwVolumeSerialNumber;
+ unsigned long nFileIndexHigh;
+ unsigned long nFileIndexLow;
+ //This reference count counts the number of modules attached
+ //to the shared memory and lock file. This serves to unlink
+ //the locking file and shared memory when all modules are
+ //done with the global memory (shared memory)
+ volatile boost::uint32_t modules_attached_to_gmem_count;
+};
+
+inline bool lock_locking_file(int fd)
+{
+ int ret = 0;
+ while(ret != 0 && errno == EDEADLK){
+ ret = _locking(fd, _LK_LOCK, 1/*lock_file_contents_length()*/);
+ }
+ return 0 == ret;
+}
+
+inline bool try_lock_locking_file(int fd)
+{
+ return 0 == _locking(fd, _LK_NBLCK , 1);
+}
+
+inline int open_or_create_and_lock_file(const char *name)
+{
+ permissions p;
+ p.set_unrestricted();
+ while(1){
+ file_handle_t handle = create_or_open_file(name, read_write, p);
+ int fd = _open_osfhandle((intptr_t)handle, _O_TEXT);
+ if(fd < 0){
+ close_file(handle);
+ return fd;
+ }
+ if(!try_lock_locking_file(fd)){
+ _close(fd);
+ return -1;
+ }
+ struct _stat s;
+ if(0 == _stat(name, &s)){
+ return fd;
+ }
+ else{
+ _close(fd);
+ }
+ }
+}
+
+inline int try_open_and_lock_file(const char *name)
+{
+ file_handle_t handle = open_existing_file(name, read_write);
+ int fd = _open_osfhandle((intptr_t)handle, _O_TEXT);
+ if(fd < 0){
+ close_file(handle);
+ return fd;
+ }
+ if(!try_lock_locking_file(fd)){
+ _close(fd);
+ return -1;
+ }
+ return fd;
+}
+
+inline void close_lock_file(int fd)
+{ _close(fd); }
+
+inline bool is_valid_fd(int fd)
+{
+ struct _stat s;
+ return EBADF != _fstat(fd, &s);
+}
+
+inline bool is_normal_file(int fd)
+{
+ if(_isatty(fd))
+ return false;
+ struct _stat s;
+ if(0 != _fstat(fd, &s))
+ return false;
+ return 0 != (s.st_mode & _S_IFREG);
+}
+
+inline std::size_t get_size(int fd)
+{
+ struct _stat s;
+ if(0 != _fstat(fd, &s))
+ return 0u;
+ return (std::size_t)s.st_size;
+}
+
+inline bool fill_file_serial_id(int fd, locking_file_serial_id &id)
+{
+ winapi::interprocess_by_handle_file_information info;
+ if(!winapi::get_file_information_by_handle((void*)_get_osfhandle(fd), &info))
+ return false;
+ id.fd = fd;
+ id.dwVolumeSerialNumber = info.dwVolumeSerialNumber;
+ id.nFileIndexHigh = info.nFileIndexHigh;
+ id.nFileIndexLow = info.nFileIndexLow;
+ id.modules_attached_to_gmem_count = 1; //Initialize attached count
+ return true;
+}
+
+inline bool compare_file_serial(int fd, const locking_file_serial_id &id)
+{
+ winapi::interprocess_by_handle_file_information info;
+ if(!winapi::get_file_information_by_handle((void*)_get_osfhandle(fd), &info))
+ return false;
+
+ return id.dwVolumeSerialNumber == info.dwVolumeSerialNumber &&
+ id.nFileIndexHigh == info.nFileIndexHigh &&
+ id.nFileIndexLow == info.nFileIndexLow;
+}
+
+#else //UNIX
+
+struct locking_file_serial_id
+{
+ int fd;
+ dev_t st_dev;
+ ino_t st_ino;
+ //This reference count counts the number of modules attached
+ //to the shared memory and lock file. This serves to unlink
+ //the locking file and shared memory when all modules are
+ //done with the global memory (shared memory)
+ volatile boost::uint32_t modules_attached_to_gmem_count;
+};
+
+inline bool lock_locking_file(int fd)
+{
+ int ret = 0;
+ while(ret != 0 && errno != EINTR){
+ struct flock lock;
+ lock.l_type = F_WRLCK;
+ lock.l_whence = SEEK_SET;
+ lock.l_start = 0;
+ lock.l_len = 1;
+ ret = fcntl (fd, F_SETLKW, &lock);
+ }
+ return 0 == ret;
+}
+
+inline bool try_lock_locking_file(int fd)
+{
+ struct flock lock;
+ lock.l_type = F_WRLCK;
+ lock.l_whence = SEEK_SET;
+ lock.l_start = 0;
+ lock.l_len = 1;
+ return 0 == fcntl (fd, F_SETLK, &lock);
+}
+
+inline int open_or_create_and_lock_file(const char *name)
+{
+ permissions p;
+ p.set_unrestricted();
+ while(1){
+ int fd = create_or_open_file(name, read_write, p);
+ if(fd < 0){
+ return fd;
+ }
+ if(!try_lock_locking_file(fd)){
+ close(fd);
+ return -1;
+ }
+ struct stat s;
+ if(0 == stat(name, &s)){
+ return fd;
+ }
+ else{
+ close(fd);
+ }
+ }
+}
+
+inline int try_open_and_lock_file(const char *name)
+{
+ int fd = open_existing_file(name, read_write);
+ if(fd < 0){
+ return fd;
+ }
+ if(!try_lock_locking_file(fd)){
+ close(fd);
+ return -1;
+ }
+ return fd;
+}
+
+inline void close_lock_file(int fd)
+{ close(fd); }
+
+inline bool is_valid_fd(int fd)
+{
+ struct stat s;
+ return EBADF != fstat(fd, &s);
+}
+
+inline bool is_normal_file(int fd)
+{
+ struct stat s;
+ if(0 != fstat(fd, &s))
+ return false;
+ return 0 != (s.st_mode & S_IFREG);
+}
+
+inline std::size_t get_size(int fd)
+{
+ struct stat s;
+ if(0 != fstat(fd, &s))
+ return 0u;
+ return (std::size_t)s.st_size;
+}
+
+inline bool fill_file_serial_id(int fd, locking_file_serial_id &id)
+{
+ struct stat s;
+ if(0 != fstat(fd, &s))
+ return false;
+ id.fd = fd;
+ id.st_dev = s.st_dev;
+ id.st_ino = s.st_ino;
+ id.modules_attached_to_gmem_count = 1; //Initialize attached count
+ return true;
+}
+
+inline bool compare_file_serial(int fd, const locking_file_serial_id &id)
+{
+ struct stat info;
+ if(0 != fstat(fd, &info))
+ return false;
+
+ return id.st_dev == info.st_dev &&
+ id.st_ino == info.st_ino;
+}
+
+#endif
+
+} //namespace ipcdetail{
+} //namespace interprocess{
+} //namespace boost{
+
+#include <boost/interprocess/detail/config_end.hpp>
+
+#endif //BOOST_INTERPROCESS_FILE_LOCKING_HELPERS_HPP
diff --git a/boost/interprocess/detail/file_wrapper.hpp b/boost/interprocess/detail/file_wrapper.hpp
index 7b53f36ac8..586e20db4d 100644
--- a/boost/interprocess/detail/file_wrapper.hpp
+++ b/boost/interprocess/detail/file_wrapper.hpp
@@ -44,13 +44,13 @@ class file_wrapper
file_wrapper(open_or_create_t, const char *name, mode_t mode, const permissions &perm = permissions())
{ this->priv_open_or_create(ipcdetail::DoOpenOrCreate, name, mode, perm); }
- //!Tries to open a file with name "name", with the access mode "mode".
+ //!Tries to open a file with name "name", with the access mode "mode".
//!If the file does not previously exist, it throws an error.
file_wrapper(open_only_t, const char *name, mode_t mode)
{ this->priv_open_or_create(ipcdetail::DoOpen, name, mode, permissions()); }
- //!Moves the ownership of "moved"'s file to *this.
- //!After the call, "moved" does not represent any file.
+ //!Moves the ownership of "moved"'s file to *this.
+ //!After the call, "moved" does not represent any file.
//!Does not throw
file_wrapper(BOOST_RV_REF(file_wrapper) moved)
: m_handle(file_handle_t(ipcdetail::invalid_file()))
@@ -60,10 +60,10 @@ class file_wrapper
//!After the call, "moved" does not represent any file.
//!Does not throw
file_wrapper &operator=(BOOST_RV_REF(file_wrapper) moved)
- {
+ {
file_wrapper tmp(boost::move(moved));
this->swap(tmp);
- return *this;
+ return *this;
}
//!Swaps to file_wrappers.
@@ -73,7 +73,7 @@ class file_wrapper
//!Erases a file from the system.
//!Returns false on error. Never throws
static bool remove(const char *name);
-
+
//!Sets the size of the file
void truncate(offset_t length);
@@ -108,11 +108,11 @@ class file_wrapper
std::string m_filename;
};
-inline file_wrapper::file_wrapper()
+inline file_wrapper::file_wrapper()
: m_handle(file_handle_t(ipcdetail::invalid_file()))
{}
-inline file_wrapper::~file_wrapper()
+inline file_wrapper::~file_wrapper()
{ this->priv_close(); }
inline const char *file_wrapper::get_name() const
@@ -122,10 +122,10 @@ inline bool file_wrapper::get_size(offset_t &size) const
{ return get_file_size((file_handle_t)m_handle, size); }
inline void file_wrapper::swap(file_wrapper &other)
-{
+{
std::swap(m_handle, other.m_handle);
std::swap(m_mode, other.m_mode);
- m_filename.swap(other.m_filename);
+ m_filename.swap(other.m_filename);
}
inline mapping_handle_t file_wrapper::get_mapping_handle() const
@@ -135,7 +135,7 @@ inline mode_t file_wrapper::get_mode() const
{ return m_mode; }
inline bool file_wrapper::priv_open_or_create
- (ipcdetail::create_enum_t type,
+ (ipcdetail::create_enum_t type,
const char *filename,
mode_t mode,
const permissions &perm = permissions())
diff --git a/boost/interprocess/detail/in_place_interface.hpp b/boost/interprocess/detail/in_place_interface.hpp
index 0e69452a40..b43b2ce165 100644
--- a/boost/interprocess/detail/in_place_interface.hpp
+++ b/boost/interprocess/detail/in_place_interface.hpp
@@ -25,7 +25,7 @@
//!Describes an abstract interface for placement construction and destruction.
namespace boost {
-namespace interprocess {
+namespace interprocess {
namespace ipcdetail {
struct in_place_interface
diff --git a/boost/interprocess/detail/intermodule_singleton.hpp b/boost/interprocess/detail/intermodule_singleton.hpp
index 4bffbe9d4e..054322699d 100644
--- a/boost/interprocess/detail/intermodule_singleton.hpp
+++ b/boost/interprocess/detail/intermodule_singleton.hpp
@@ -18,1163 +18,27 @@
#include <boost/interprocess/detail/config_begin.hpp>
#include <boost/interprocess/detail/workaround.hpp>
-#if defined(BOOST_INTERPROCESS_WINDOWS)
-#include <boost/interprocess/windows_shared_memory.hpp>
-#endif
-
-#include <boost/interprocess/shared_memory_object.hpp>
-
-#include <boost/interprocess/offset_ptr.hpp>
-#include <boost/interprocess/sync/spin/mutex.hpp>
-#include <boost/interprocess/sync/spin/recursive_mutex.hpp>
-#include <boost/interprocess/detail/managed_memory_impl.hpp>
-#include <boost/interprocess/detail/managed_open_or_create_impl.hpp>
-#include <boost/interprocess/mem_algo/rbtree_best_fit.hpp>
-#include <boost/interprocess/indexes/iset_index.hpp>
-#include <boost/interprocess/creation_tags.hpp>
-#include <boost/interprocess/permissions.hpp>
-
-
-#include <boost/interprocess/detail/atomic.hpp>
-#include <boost/interprocess/detail/os_thread_functions.hpp>
-#include <boost/interprocess/detail/tmp_dir_helpers.hpp>
-#include <boost/interprocess/detail/os_file_functions.hpp>
-#include <boost/interprocess/detail/mpl.hpp>
-#include <boost/type_traits/type_with_alignment.hpp>
-#include <boost/assert.hpp>
-#include <cstddef>
-#include <cstdio>
-#include <cstring>
-#include <string>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-
-#if defined(BOOST_INTERPROCESS_WINDOWS)
-#include <fcntl.h>
-#include <io.h>
-
-#include <sys/locking.h>
-#else
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <unistd.h>
+#ifdef BOOST_INTERPROCESS_WINDOWS
+ #include <boost/interprocess/detail/windows_intermodule_singleton.hpp>
#endif
+#include <boost/interprocess/detail/portable_intermodule_singleton.hpp>
namespace boost{
namespace interprocess{
namespace ipcdetail{
-struct intermodule_singleton_mutex_family
-{
- typedef boost::interprocess::ipcdetail::spin_mutex mutex_type;
- typedef boost::interprocess::ipcdetail::spin_recursive_mutex recursive_mutex_type;
-};
-
-struct intermodule_types
-{
- //We must use offset_ptr since a loaded DLL can map the singleton holder shared memory
- //at a different address than other DLLs/main executables
- typedef rbtree_best_fit<intermodule_singleton_mutex_family, offset_ptr<void> > mem_algo;
- template<class Device, bool FileBased>
- struct open_or_create
- {
- typedef managed_open_or_create_impl
- <Device, mem_algo::Alignment, FileBased> type;
- };
-};
-
-template<class Device, bool FileBased>
-class basic_managed_global_memory
- : public basic_managed_memory_impl
- < char
- , intermodule_types::mem_algo
- , iset_index
- , intermodule_types::open_or_create<Device, FileBased>::type::ManagedOpenOrCreateUserOffset
- >
- , private intermodule_types::open_or_create<Device, FileBased>::type
-{
- /// @cond
- typedef typename intermodule_types::template open_or_create<Device, FileBased>::type base2_t;
-
- typedef basic_managed_memory_impl
- < char
- , intermodule_types::mem_algo
- , iset_index
- , base2_t::ManagedOpenOrCreateUserOffset
- > base_t;
-
- typedef create_open_func<base_t> create_open_func_t;
-
- basic_managed_global_memory *get_this_pointer()
- { return this; }
-
- public:
- typedef typename base_t::size_type size_type;
-
- private:
- typedef typename base_t::char_ptr_holder_t char_ptr_holder_t;
- BOOST_MOVABLE_BUT_NOT_COPYABLE(basic_managed_global_memory)
- /// @endcond
-
- public: //functions
-/*
- basic_managed_global_memory()
- {}
-
- basic_managed_global_memory(create_only_t create_only, const char *name,
- size_type size, const void *addr = 0, const permissions& perm = permissions())
- : base_t()
- , base2_t(create_only, name, size, read_write, addr,
- create_open_func_t(get_this_pointer(), DoCreate), perm)
- {}
-*/
- basic_managed_global_memory (open_or_create_t open_or_create,
- const char *name, size_type size,
- const void *addr = 0, const permissions& perm = permissions())
- : base_t()
- , base2_t(open_or_create, name, size, read_write, addr,
- create_open_func_t(get_this_pointer(),
- DoOpenOrCreate), perm)
- {}
-
- basic_managed_global_memory (open_only_t open_only, const char* name,
- const void *addr = 0)
- : base_t()
- , base2_t(open_only, name, read_write, addr,
- create_open_func_t(get_this_pointer(),
- DoOpen))
- {}
-
-/*
- basic_managed_global_memory (open_copy_on_write_t, const char* name,
- const void *addr = 0)
- : base_t()
- , base2_t(open_only, name, copy_on_write, addr,
- create_open_func_t(get_this_pointer(),
- DoOpen))
- {}
-
- //!Connects to a created shared memory and its segment manager.
- //!in read-only mode.
- //!This can throw.
- basic_managed_global_memory (open_read_only_t, const char* name,
- const void *addr = 0)
- : base_t()
- , base2_t(open_only, name, read_only, addr,
- create_open_func_t(get_this_pointer(),
- DoOpen))
- {}
-
- //!Moves the ownership of "moved"'s managed memory to *this.
- //!Does not throw
- basic_managed_global_memory(BOOST_RV_REF(basic_managed_global_memory) moved)
- {
- basic_managed_global_memory tmp;
- this->swap(moved);
- tmp.swap(moved);
- }
-
- //!Moves the ownership of "moved"'s managed memory to *this.
- //!Does not throw
- basic_managed_global_memory &operator=(BOOST_RV_REF(basic_managed_global_memory) moved)
- {
- basic_managed_global_memory tmp(boost::move(moved));
- this->swap(tmp);
- return *this;
- }*/
-};
-
-#if defined(BOOST_INTERPROCESS_WINDOWS)
-typedef basic_managed_global_memory<windows_shared_memory, false> windows_managed_global_memory;
-#endif
-
-typedef basic_managed_global_memory<shared_memory_object, true> managed_global_memory;
-
-namespace file_locking_helpers {
-
-inline void get_pid_creation_time_str(std::string &s)
-{
- std::stringstream stream;
- stream << get_current_process_id() << '_';
- stream.precision(6);
- stream << std::fixed << get_current_process_creation_time();
- s = stream.str();
-}
-
-inline void create_tmp_subdir_and_get_pid_based_filepath(const char *subdir_name, const char *file_prefix, OS_process_id_t pid, std::string &s, bool creation_time = false)
-{
- //Let's create a lock file for each process gmem that will mark if
- //the process is alive or not
- create_tmp_and_clean_old(s);
- s += "/";
- s += subdir_name;
- if(!open_or_create_directory(s.c_str())){
- throw interprocess_exception(error_info(system_error_code()));
- }
- s += "/";
- s += file_prefix;
- if(creation_time){
- std::string sstamp;
- get_pid_creation_time_str(sstamp);
- s += sstamp;
- }
- else{
- pid_str_t pid_str;
- get_pid_str(pid_str, pid);
- s += pid_str;
- }
-}
-
-inline bool check_if_filename_complies_with_pid
- (const char *filename, const char *prefix, OS_process_id_t pid, std::string &file_suffix, bool creation_time = false)
-{
- //Check if filename complies with lock file name pattern
- std::string fname(filename);
- std::string fprefix(prefix);
- if(fname.size() <= fprefix.size()){
- return false;
- }
- fname.resize(fprefix.size());
- if(fname != fprefix){
- return false;
- }
-
- //If not our lock file, delete it if we can lock it
- fname = filename;
- fname.erase(0, fprefix.size());
- pid_str_t pid_str;
- get_pid_str(pid_str, pid);
- file_suffix = pid_str;
- if(creation_time){
- std::size_t p = fname.find('_');
- if (p == std::string::npos){
- return false;
- }
- std::string save_suffix(fname);
- fname.erase(p);
- fname.swap(file_suffix);
- bool ret = (file_suffix == fname);
- file_suffix.swap(save_suffix);
- return ret;
- }
- else{
- fname.swap(file_suffix);
- return (file_suffix == fname);
- }
-}
-
-} //file_locking_helpers
-
-namespace intermodule_singleton_helpers {
-
-const int GMemMarkToBeRemoved = -1;
-const int GMemNotPresent = -2;
-
-inline const char *get_lock_file_subdir_name()
-{ return "gmem"; }
-
-inline const char *get_lock_file_base_name()
-{ return "lck"; }
-
-inline void create_and_get_singleton_lock_file_path(std::string &s)
-{
- file_locking_helpers::create_tmp_subdir_and_get_pid_based_filepath
- (get_lock_file_subdir_name(), get_lock_file_base_name(), get_current_process_id(), s, true);
-}
-
-inline const char *get_shm_base_name()
-{ return "bip.gmem.shm."; }
-
-inline void get_shm_name(std::string &shm_name)
-{
- file_locking_helpers::get_pid_creation_time_str(shm_name);
- shm_name.insert(0, get_shm_base_name());
-}
-
-inline std::size_t get_shm_size()
-{ return 65536; }
-
-template<class ManagedShMem>
-struct managed_sh_dependant
-{
- static void apply_gmem_erase_logic(const char *filepath, const char *filename);
-
- static bool remove_old_gmem()
- {
- std::string refcstrRootDirectory;
- tmp_folder(refcstrRootDirectory);
- refcstrRootDirectory += "/";
- refcstrRootDirectory += get_lock_file_subdir_name();
- return for_each_file_in_dir(refcstrRootDirectory.c_str(), apply_gmem_erase_logic);
- }
-};
-
-#if defined(BOOST_INTERPROCESS_WINDOWS)
-
-template<>
-struct managed_sh_dependant<windows_managed_global_memory>
-{
- static void apply_gmem_erase_logic(const char *, const char *){}
-
- static bool remove_old_gmem()
- { return true; }
-};
-
-
-struct locking_file_serial_id
-{
- int fd;
- unsigned long dwVolumeSerialNumber;
- unsigned long nFileIndexHigh;
- unsigned long nFileIndexLow;
- //This reference count counts the number of modules attached
- //to the shared memory and lock file. This serves to unlink
- //the locking file and shared memory when all modules are
- //done with the global memory (shared memory)
- volatile boost::uint32_t modules_attached_to_gmem_count;
-};
-
-inline bool lock_locking_file(int fd)
-{
- int ret = 0;
- while(ret != 0 && errno == EDEADLK){
- ret = _locking(fd, _LK_LOCK, 1/*lock_file_contents_length()*/);
- }
- return 0 == ret;
-}
-
-inline bool try_lock_locking_file(int fd)
-{
- return 0 == _locking(fd, _LK_NBLCK , 1);
-}
-
-inline int open_or_create_and_lock_file(const char *name)
-{
- permissions p;
- p.set_unrestricted();
- while(1){
- file_handle_t handle = create_or_open_file(name, read_write, p);
- int fd = _open_osfhandle((intptr_t)handle, _O_TEXT);
- if(fd < 0){
- close_file(handle);
- return fd;
- }
- if(!try_lock_locking_file(fd)){
- _close(fd);
- return -1;
- }
- struct _stat s;
- if(0 == _stat(name, &s)){
- return fd;
- }
- else{
- _close(fd);
- }
- }
-}
-
-inline int try_open_and_lock_file(const char *name)
-{
- file_handle_t handle = open_existing_file(name, read_write);
- int fd = _open_osfhandle((intptr_t)handle, _O_TEXT);
- if(fd < 0){
- close_file(handle);
- return fd;
- }
- if(!try_lock_locking_file(fd)){
- _close(fd);
- return -1;
- }
- return fd;
-}
-
-inline void close_lock_file(int fd)
-{ _close(fd); }
-
-inline bool is_valid_fd(int fd)
-{
- struct _stat s;
- return EBADF != _fstat(fd, &s);
-}
-
-inline bool is_normal_file(int fd)
-{
- if(_isatty(fd))
- return false;
- struct _stat s;
- if(0 != _fstat(fd, &s))
- return false;
- return 0 != (s.st_mode & _S_IFREG);
-}
-
-inline std::size_t get_size(int fd)
-{
- struct _stat s;
- if(0 != _fstat(fd, &s))
- return 0u;
- return (std::size_t)s.st_size;
-}
-
-inline bool fill_file_serial_id(int fd, locking_file_serial_id &id)
-{
- winapi::interprocess_by_handle_file_information info;
- if(!winapi::get_file_information_by_handle((void*)_get_osfhandle(fd), &info))
- return false;
- id.fd = fd;
- id.dwVolumeSerialNumber = info.dwVolumeSerialNumber;
- id.nFileIndexHigh = info.nFileIndexHigh;
- id.nFileIndexLow = info.nFileIndexLow;
- id.modules_attached_to_gmem_count = 1; //Initialize attached count
- return true;
-}
-
-inline bool compare_file_serial(int fd, const locking_file_serial_id &id)
-{
- winapi::interprocess_by_handle_file_information info;
- if(!winapi::get_file_information_by_handle((void*)_get_osfhandle(fd), &info))
- return false;
-
- return id.dwVolumeSerialNumber == info.dwVolumeSerialNumber &&
- id.nFileIndexHigh == info.nFileIndexHigh &&
- id.nFileIndexLow == info.nFileIndexLow;
-}
-
-#else //UNIX
-
-struct locking_file_serial_id
-{
- int fd;
- dev_t st_dev;
- ino_t st_ino;
- //This reference count counts the number of modules attached
- //to the shared memory and lock file. This serves to unlink
- //the locking file and shared memory when all modules are
- //done with the global memory (shared memory)
- volatile boost::uint32_t modules_attached_to_gmem_count;
-};
-
-inline bool lock_locking_file(int fd)
-{
- int ret = 0;
- while(ret != 0 && errno != EINTR){
- struct flock lock;
- lock.l_type = F_WRLCK;
- lock.l_whence = SEEK_SET;
- lock.l_start = 0;
- lock.l_len = 1;
- ret = fcntl (fd, F_SETLKW, &lock);
- }
- return 0 == ret;
-}
-
-inline bool try_lock_locking_file(int fd)
-{
- struct flock lock;
- lock.l_type = F_WRLCK;
- lock.l_whence = SEEK_SET;
- lock.l_start = 0;
- lock.l_len = 1;
- return 0 == fcntl (fd, F_SETLK, &lock);
-}
-
-inline int open_or_create_and_lock_file(const char *name)
-{
- permissions p;
- p.set_unrestricted();
- while(1){
- int fd = create_or_open_file(name, read_write, p);
- if(fd < 0){
- return fd;
- }
- if(!try_lock_locking_file(fd)){
- close(fd);
- return -1;
- }
- struct stat s;
- if(0 == stat(name, &s)){
- return fd;
- }
- else{
- close(fd);
- }
- }
-}
-
-inline int try_open_and_lock_file(const char *name)
-{
- int fd = open_existing_file(name, read_write);
- if(fd < 0){
- return fd;
- }
- if(!try_lock_locking_file(fd)){
- close(fd);
- return -1;
- }
- return fd;
-}
-
-inline void close_lock_file(int fd)
-{ close(fd); }
-
-inline bool is_valid_fd(int fd)
-{
- struct stat s;
- return EBADF != fstat(fd, &s);
-}
-
-inline bool is_normal_file(int fd)
-{
- struct stat s;
- if(0 != fstat(fd, &s))
- return false;
- return 0 != (s.st_mode & S_IFREG);
-}
-
-inline std::size_t get_size(int fd)
-{
- struct stat s;
- if(0 != fstat(fd, &s))
- return 0u;
- return (std::size_t)s.st_size;
-}
-
-inline bool fill_file_serial_id(int fd, locking_file_serial_id &id)
-{
- struct stat s;
- if(0 != fstat(fd, &s))
- return false;
- id.fd = fd;
- id.st_dev = s.st_dev;
- id.st_ino = s.st_ino;
- id.modules_attached_to_gmem_count = 1; //Initialize attached count
- return true;
-}
-
-inline bool compare_file_serial(int fd, const locking_file_serial_id &id)
-{
- struct stat info;
- if(0 != fstat(fd, &info))
- return false;
-
- return id.st_dev == info.st_dev &&
- id.st_ino == info.st_ino;
-}
-
-#endif
-
-template<class ManagedShMem>
-struct gmem_erase_func
-{
- gmem_erase_func(const char *shm_name, const char *singleton_lock_file_path, ManagedShMem & shm)
- :shm_name_(shm_name), singleton_lock_file_path_(singleton_lock_file_path), shm_(shm)
- {}
-
- void operator()()
- {
- locking_file_serial_id *pserial_id = shm_.template find<locking_file_serial_id>("lock_file_fd").first;
- if(pserial_id){
- pserial_id->fd = GMemMarkToBeRemoved;
- }
- delete_file(singleton_lock_file_path_);
- shared_memory_object::remove(shm_name_);
- }
-
- const char * const shm_name_;
- const char * const singleton_lock_file_path_;
- ManagedShMem & shm_;
-};
-
-//This function applies shared memory erasure logic based on the passed lock file.
-template<class ManagedShMem>
-void managed_sh_dependant<ManagedShMem>::
- apply_gmem_erase_logic(const char *filepath, const char *filename)
-{
- int fd = GMemMarkToBeRemoved;
- try{
- std::string str;
- //If the filename is current process lock file, then avoid it
- if(file_locking_helpers::check_if_filename_complies_with_pid
- (filename, get_lock_file_base_name(), get_current_process_id(), str, true)){
- return;
- }
- //Open and lock the other process' lock file
- fd = try_open_and_lock_file(filepath);
- if(fd < 0){
- return;
- }
- //If done, then the process is dead so take global shared memory name
- //(the name is based on the lock file name) and try to apply erasure logic
- str.insert(0, get_shm_base_name());
- try{
- ManagedShMem shm(open_only, str.c_str());
- gmem_erase_func<ManagedShMem> func(str.c_str(), filepath, shm);
- shm.try_atomic_func(func);
- }
- catch(interprocess_exception &e){
- //If shared memory is not found erase the lock file
- if(e.get_error_code() == not_found_error){
- delete_file(filepath);
- }
- }
- }
- catch(...){
-
- }
- if(fd >= 0){
- close_lock_file(fd);
- }
-}
-
-} //namespace intermodule_singleton_helpers {
-
-
-
-namespace intermodule_singleton_helpers {
-
-//The lock file logic creates uses a unique instance to a file
-template <class ManagedShMem>
-struct lock_file_logic
-{
- lock_file_logic(ManagedShMem &shm)
- : mshm(shm)
- { shm.atomic_func(*this); }
-
- void operator()(void)
- {
- retry_with_new_shm = false;
-
- //First find the file locking descriptor id
- locking_file_serial_id *pserial_id =
- mshm.template find<locking_file_serial_id>("lock_file_fd").first;
-
- int fd;
- //If not found schedule a creation
- if(!pserial_id){
- fd = GMemNotPresent;
- }
- //Else get it
- else{
- fd = pserial_id->fd;
- }
- //If we need to create a new one, do it
- if(fd == GMemNotPresent){
- std::string lck_str;
- //Create a unique current pid based lock file path
- create_and_get_singleton_lock_file_path(lck_str);
- //Open or create and lock file
- int fd = intermodule_singleton_helpers::open_or_create_and_lock_file(lck_str.c_str());
- //If failed, write a bad file descriptor to notify other modules that
- //something was wrong and unlink shared memory. Mark the function object
- //to tell caller to retry with another shared memory
- if(fd < 0){
- this->register_lock_file(GMemMarkToBeRemoved);
- std::string s;
- get_shm_name(s);
- shared_memory_object::remove(s.c_str());
- retry_with_new_shm = true;
- }
- //If successful, register the file descriptor
- else{
- this->register_lock_file(fd);
- }
- }
- //If the fd was invalid (maybe a previous try failed) notify caller that
- //should retry creation logic, since this shm might have been already
- //unlinked since the shm was removed
- else if (fd == GMemMarkToBeRemoved){
- retry_with_new_shm = true;
- }
- //If the stored fd is not valid (a open fd, a normal file with the
- //expected size, or does not have the same file id number,
- //then it's an old shm from an old process with the same pid.
- //If that's the case, mark it as invalid
- else if(!is_valid_fd(fd) ||
- !is_normal_file(fd) ||
- 0 != get_size(fd) ||
- !compare_file_serial(fd, *pserial_id)){
- pserial_id->fd = GMemMarkToBeRemoved;
- std::string s;
- get_shm_name(s);
- shared_memory_object::remove(s.c_str());
- retry_with_new_shm = true;
- }
- else{
- //If the lock file is ok, increment reference count of
- //attached modules to shared memory
- atomic_inc32(&pserial_id->modules_attached_to_gmem_count);
- }
- }
-
- private:
- locking_file_serial_id * register_lock_file(int fd)
- {
- locking_file_serial_id *pinfo = mshm.template construct<locking_file_serial_id>("lock_file_fd")();
- fill_file_serial_id(fd, *pinfo);
- return pinfo;
- }
-
- public:
- ManagedShMem &mshm;
- bool retry_with_new_shm;
-};
-
-#if defined(BOOST_INTERPROCESS_WINDOWS)
-
-template<>
-struct lock_file_logic<windows_managed_global_memory>
-{
- lock_file_logic(windows_managed_global_memory &)
- : retry_with_new_shm(false)
- {}
-
- void operator()(void){}
- const bool retry_with_new_shm;
-};
-
-#endif
-
-} //namespace intermodule_singleton_helpers {
-
-//This class contains common code for all singleton types, so that we instantiate this
-//code just once per module. This class also holds a reference counted shared memory
-//to be used by all instances
-
-template<class ManagedShMem>
-class intermodule_singleton_common
-{
- public:
- typedef void*(singleton_constructor_t)(ManagedShMem &);
- typedef void (singleton_destructor_t)(void *, ManagedShMem &);
-
- static const ::boost::uint32_t Uninitialized = 0u;
- static const ::boost::uint32_t Initializing = 1u;
- static const ::boost::uint32_t Initialized = 2u;
- static const ::boost::uint32_t Broken = 3u;
-
- static void finalize_singleton_logic(void *ptr, singleton_destructor_t destructor)
- {
- if(ptr)
- destructor(ptr, get_shm());
- //If this is the last singleton of this module
- //apply shm destruction.
- //Note: singletons are destroyed when the module is unloaded
- //so no threads should be executing or holding references
- //to this module
- if(1 == atomic_dec32(&this_module_singleton_count)){
- destroy_shm();
- }
- }
-
- static void initialize_singleton_logic
- (void *&ptr, volatile boost::uint32_t &this_module_singleton_initialized, singleton_constructor_t ini_func);
-
- private:
- static ManagedShMem &get_shm()
- {
- return *static_cast<ManagedShMem *>(static_cast<void *>(&mem_holder.shm_mem));
- }
-
- static void initialize_shm();
- static void destroy_shm();
- //Static data, zero-initalized without any dependencies
- //this_module_singleton_count is the number of singletons used by this module
- static volatile boost::uint32_t this_module_singleton_count;
- //this_module_shm_initialized is the state of this module's shm class object
- static volatile boost::uint32_t this_module_shm_initialized;
- static struct mem_holder_t
- {
- ::boost::detail::max_align aligner;
- char shm_mem [sizeof(ManagedShMem)];
- } mem_holder;
-};
-
-template<class ManagedShMem>
-volatile boost::uint32_t intermodule_singleton_common<ManagedShMem>::this_module_singleton_count;
-
-template<class ManagedShMem>
-volatile boost::uint32_t intermodule_singleton_common<ManagedShMem>::this_module_shm_initialized;
-
-template<class ManagedShMem>
-typename intermodule_singleton_common<ManagedShMem>::mem_holder_t
- intermodule_singleton_common<ManagedShMem>::mem_holder;
-
-template<class ManagedShMem>
-void intermodule_singleton_common<ManagedShMem>::initialize_shm()
-{
- //Obtain unique shm name and size
- std::string s;
- while(1){
- //Try to pass shm state to initializing
- ::boost::uint32_t tmp = atomic_cas32(&this_module_shm_initialized, Initializing, Uninitialized);
- if(tmp >= Initialized){
- break;
- }
- //If some other thread is doing the work wait
- else if(tmp == Initializing){
- thread_yield();
- }
- else{ //(tmp == Uninitialized)
- //If not initialized try it again?
- try{
- //Remove old shared memory from the system
- intermodule_singleton_helpers::managed_sh_dependant<ManagedShMem>::remove_old_gmem();
- //
- if(s.empty()){
- intermodule_singleton_helpers::get_shm_name(s);
- }
- const char *ShmName = s.c_str();
- const std::size_t ShmSize = intermodule_singleton_helpers::get_shm_size();;
-
- //in-place construction of the shared memory class
- ::new (&get_shm())ManagedShMem(open_or_create, ShmName, ShmSize);
- //Use shared memory internal lock to initialize the lock file
- //that will mark this gmem as "in use".
- intermodule_singleton_helpers::lock_file_logic<ManagedShMem> f(get_shm());
- //If function failed (maybe a competing process has erased the shared
- //memory between creation and file locking), retry with a new instance.
- if(f.retry_with_new_shm){
- get_shm().~ManagedShMem();
- atomic_write32(&this_module_shm_initialized, Uninitialized);
- }
- else{
- //Locking succeeded, so this shared memory module-instance is ready
- atomic_write32(&this_module_shm_initialized, Initialized);
- break;
- }
- }
- catch(...){
- //
- throw;
- }
- }
- }
-}
-
-template<class ManagedShMem>
-struct unlink_shmlogic
-{
- unlink_shmlogic(ManagedShMem &mshm)
- : mshm_(mshm)
- { mshm.atomic_func(*this); }
- void operator()()
- {
- intermodule_singleton_helpers::locking_file_serial_id *pserial_id =
- mshm_.template find<intermodule_singleton_helpers::locking_file_serial_id>
- ("lock_file_fd").first;
- BOOST_ASSERT(0 != pserial_id);
- if(1 == atomic_dec32(&pserial_id->modules_attached_to_gmem_count)){
- int fd = pserial_id->fd;
- if(fd > 0){
- pserial_id->fd = intermodule_singleton_helpers::GMemMarkToBeRemoved;
- std::string s;
- intermodule_singleton_helpers::create_and_get_singleton_lock_file_path(s);
- delete_file(s.c_str());
- intermodule_singleton_helpers::close_lock_file(fd);
- intermodule_singleton_helpers::get_shm_name(s);
- shared_memory_object::remove(s.c_str());
- }
- }
- }
- ManagedShMem &mshm_;
-};
-
-#if defined(BOOST_INTERPROCESS_WINDOWS)
-
-template<>
-struct unlink_shmlogic<windows_managed_global_memory>
-{
- unlink_shmlogic(windows_managed_global_memory &)
- {}
- void operator()(){}
-};
-
-#endif
-
-
-template<class ManagedShMem>
-void intermodule_singleton_common<ManagedShMem>::destroy_shm()
-{
- if(!atomic_read32(&this_module_singleton_count)){
- //This module is being unloaded, so destroy
- //the shared memory object of this module
- //and unlink the shared memory if it's the last
- unlink_shmlogic<ManagedShMem> f(get_shm());
- (get_shm()).~ManagedShMem();
- atomic_write32(&this_module_shm_initialized, Uninitialized);
- //Do some cleanup for other processes old gmem instances
- intermodule_singleton_helpers::managed_sh_dependant<ManagedShMem>::remove_old_gmem();
- }
-}
-
-//Initialize this_module_singleton_ptr, creates the shared memory if needed and also creates an unique
-//opaque type in shared memory through a singleton_constructor_t function call,
-//initializing the passed pointer to that unique instance.
-//
-//We have two concurrency types here. a)the shared memory/singleton creation must
-//be safe between threads of this process but in different modules/dlls. b)
-//the pointer to the singleton is per-module, so we have to protect this
-//initization between threads of the same module.
-//
-//All static variables declared here are shared between inside a module
-//so atomic operations will synchronize only threads of the same module.
-template<class ManagedShMem>
-void intermodule_singleton_common<ManagedShMem>::initialize_singleton_logic
- (void *&ptr, volatile boost::uint32_t &this_module_singleton_initialized, singleton_constructor_t constructor)
-{
- //If current module is not initialized enter to lock free logic
- if(atomic_read32(&this_module_singleton_initialized) != Initialized){
- //Now a single thread of the module will succeed in this CAS.
- //trying to pass from Uninitialized to Initializing
- ::boost::uint32_t previous_module_singleton_initialized = atomic_cas32
- (&this_module_singleton_initialized, Initializing, Uninitialized);
- //If the thread succeeded the CAS (winner) it will compete with other
- //winner threads from other modules to create the shared memory
- if(previous_module_singleton_initialized == Uninitialized){
- try{
- //Now initialize shm, this function solves concurrency issues
- //between threads of several modules
- initialize_shm();
- //Increment the module reference count that reflects how many
- //singletons this module holds, so that we can safely destroy
- //module shared memory object when no singleton is left
- atomic_inc32(&this_module_singleton_count);
- //Now try to create the singleton in shared memory.
- //This function solves concurrency issues
- //between threads of several modules
- void *tmp = constructor(get_shm());
- //Insert a barrier before assigning the pointer to
- //make sure this assignment comes after the initialization
- atomic_write32(&this_module_singleton_initialized, Initializing);
- //Assign the singleton address to the module-local pointer
- ptr = tmp;
- //Memory barrier inserted, all previous operations should complete
- //before this one. Now marked as initialized
- atomic_inc32(&this_module_singleton_initialized);
- }
- catch(...){
- //Mark singleton failed to initialize
- atomic_write32(&this_module_singleton_initialized, Broken);
- throw;
- }
- }
- //If previous state was initializing, this means that another winner thread is
- //trying to initialize the singleton. Just wait until completes its work.
- else if(previous_module_singleton_initialized == Initializing){
- while(1){
- previous_module_singleton_initialized = atomic_read32(&this_module_singleton_initialized);
- if(previous_module_singleton_initialized >= Initialized){
- //Already initialized, or exception thrown by initializer thread
- break;
- }
- else if(previous_module_singleton_initialized == Initializing){
- thread_yield();
- }
- else{
- //This can't be happening!
- BOOST_ASSERT(0);
- }
- }
- }
- else if(previous_module_singleton_initialized == Initialized){
- //Nothing to do here, the singleton is ready
- }
- //If previous state was greater than initialized, then memory is broken
- //trying to initialize the singleton.
- else{//(previous_module_singleton_initialized > Initialized)
- throw interprocess_exception("boost::interprocess::intermodule_singleton initialization failed");
- }
- }
- BOOST_ASSERT(ptr != 0);
-}
-
-//Now this class is a singleton, initializing the singleton in
-//the first get() function call if LazyInit is false. If true
-//then the singleton will be initialized when loading the module.
-template<typename C, bool LazyInit, class ManagedShMem>
-class intermodule_singleton_impl
-{
- public:
- static C& get() //Let's make inlining easy
- {
- if(!this_module_singleton_ptr){
- if(lifetime.dummy_function()) //This forces lifetime instantiation, for reference counted destruction
- intermodule_singleton_common<ManagedShMem>::initialize_singleton_logic
- (this_module_singleton_ptr, this_module_singleton_initialized, singleton_constructor);
- }
- return *static_cast<C*>(this_module_singleton_ptr);
- }
-
- private:
-
- struct ref_count_ptr
- {
- ref_count_ptr(C *p, boost::uint32_t count)
- : ptr(p), singleton_ref_count(count)
- {}
- C *ptr;
- //This reference count serves to count the number of attached
- //modules to this singleton
- volatile boost::uint32_t singleton_ref_count;
- };
-
- //These statics will be zero-initialized without any constructor call dependency
- //this_module_singleton_ptr will be a module-local pointer to the singleton
- static void* this_module_singleton_ptr;
- //this_module_singleton_count will be used to synchronize threads of the same module
- //for access to a singleton instance, and to flag the state of the
- //singleton.
- static volatile boost::uint32_t this_module_singleton_initialized;
-
- //This class destructor will trigger singleton destruction
- struct lifetime_type_lazy
- {
- bool dummy_function()
- { return m_dummy == 0; }
-
- ~lifetime_type_lazy()
- {
- intermodule_singleton_common<ManagedShMem>::finalize_singleton_logic
- (this_module_singleton_ptr, singleton_destructor);
- }
- //Dummy volatile so that the compiler can't resolve its value at compile-time
- //and can't avoid lifetime_type instantiation if dummy_function() is called.
- static volatile int m_dummy;
- };
-
- struct lifetime_type_static
- : public lifetime_type_lazy
- {
- lifetime_type_static()
- {
- intermodule_singleton_common<ManagedShMem>::initialize_singleton_logic
- (this_module_singleton_ptr, this_module_singleton_initialized, singleton_constructor);
- }
- };
-
- typedef typename if_c
- <LazyInit, lifetime_type_lazy, lifetime_type_static>::type lifetime_type;
-
- static lifetime_type lifetime;
-
- //A functor to be executed inside shared memory lock that just
- //searches for the singleton in shm and if not present creates a new one.
- //If singleton constructor throws, the exception is propagated
- struct init_atomic_func
- {
- init_atomic_func(ManagedShMem &m)
- : mshm(m)
- {}
-
- void operator()()
- {
- ref_count_ptr *rcount = mshm.template find<ref_count_ptr>(unique_instance).first;
- if(!rcount){
- C *p = new C();
- try{
- rcount = mshm.template construct<ref_count_ptr>(unique_instance)(p, 0u);
- }
- catch(...){
- delete p;
- throw;
- }
- }
- atomic_inc32(&rcount->singleton_ref_count);
- ret_ptr = rcount->ptr;
- }
- ManagedShMem &mshm;
- void *ret_ptr;
- };
-
- //A functor to be executed inside shared memory lock that just
- //deletes the singleton in shm if the attached count reaches to zero
- struct fini_atomic_func
- {
- fini_atomic_func(ManagedShMem &m)
- : mshm(m)
- {}
-
- void operator()()
- {
- ref_count_ptr *rcount = mshm.template find<ref_count_ptr>(unique_instance).first;
- //The object must exist
- BOOST_ASSERT(rcount);
- //Check if last reference
- if(atomic_dec32(&rcount->singleton_ref_count) == 1){
- //If last, destroy the object
- BOOST_ASSERT(rcount->ptr != 0);
- delete rcount->ptr;
- //Now destroy shm entry
- bool destroyed = mshm.template destroy<ref_count_ptr>(unique_instance);
- (void)destroyed; BOOST_ASSERT(destroyed == true);
- }
- }
- ManagedShMem &mshm;
- void *ret_ptr;
- };
-
- //A wrapper to execute init_atomic_func
- static void *singleton_constructor(ManagedShMem &mshm)
- {
- init_atomic_func f(mshm);
- mshm.atomic_func(f);
- return f.ret_ptr;
- }
-
- //A wrapper to execute fini_atomic_func
- static void singleton_destructor(void *p, ManagedShMem &mshm)
- { (void)p;
- fini_atomic_func f(mshm);
- mshm.atomic_func(f);
- }
-};
-
-template <typename C, bool L, class ManagedShMem>
-volatile int intermodule_singleton_impl<C, L, ManagedShMem>::lifetime_type_lazy::m_dummy = 0;
-
-//These will be zero-initialized by the loader
-template <typename C, bool L, class ManagedShMem>
-void *intermodule_singleton_impl<C, L, ManagedShMem>::this_module_singleton_ptr = 0;
-
-template <typename C, bool L, class ManagedShMem>
-volatile boost::uint32_t intermodule_singleton_impl<C, L, ManagedShMem>::this_module_singleton_initialized = 0;
-
-template <typename C, bool L, class ManagedShMem>
-typename intermodule_singleton_impl<C, L, ManagedShMem>::lifetime_type
- intermodule_singleton_impl<C, L, ManagedShMem>::lifetime;
-
-template<typename C, bool LazyInit = false>
-class portable_intermodule_singleton
- : public intermodule_singleton_impl<C, LazyInit, managed_global_memory>
-{};
-
-#if defined(BOOST_INTERPROCESS_WINDOWS)
-
-template<typename C, bool LazyInit = false>
-class windows_intermodule_singleton
- : public intermodule_singleton_impl
- < C
- , LazyInit
- , windows_managed_global_memory
- >
-{};
-
-#endif
-
//Now this class is a singleton, initializing the singleton in
//the first get() function call if LazyInit is false. If true
//then the singleton will be initialized when loading the module.
-template<typename C, bool LazyInit = false>
+template<typename C, bool LazyInit = true, bool Phoenix = true>
class intermodule_singleton
#ifdef BOOST_INTERPROCESS_WINDOWS
- : public windows_intermodule_singleton<C, LazyInit>
+ : public windows_intermodule_singleton<C, LazyInit, Phoenix>
#else
- : public portable_intermodule_singleton<C, LazyInit>
+ : public portable_intermodule_singleton<C, LazyInit, Phoenix>
#endif
{};
-
} //namespace ipcdetail{
} //namespace interprocess{
} //namespace boost{
diff --git a/boost/interprocess/detail/intermodule_singleton_common.hpp b/boost/interprocess/detail/intermodule_singleton_common.hpp
new file mode 100644
index 0000000000..0710c0bbc1
--- /dev/null
+++ b/boost/interprocess/detail/intermodule_singleton_common.hpp
@@ -0,0 +1,495 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2009-2011. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/interprocess for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTERPROCESS_INTERMODULE_SINGLETON_COMMON_HPP
+#define BOOST_INTERPROCESS_INTERMODULE_SINGLETON_COMMON_HPP
+
+#if defined(_MSC_VER)&&(_MSC_VER>=1200)
+#pragma once
+#endif
+
+#include <boost/interprocess/detail/config_begin.hpp>
+#include <boost/interprocess/detail/workaround.hpp>
+
+#include <boost/interprocess/detail/atomic.hpp>
+#include <boost/interprocess/detail/os_thread_functions.hpp>
+#include <boost/type_traits/type_with_alignment.hpp>
+#include <boost/interprocess/detail/mpl.hpp>
+#include <boost/assert.hpp>
+#include <cstddef>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <string>
+#include <sstream>
+
+namespace boost{
+namespace interprocess{
+namespace ipcdetail{
+
+namespace intermodule_singleton_helpers {
+
+inline void get_pid_creation_time_str(std::string &s)
+{
+ std::stringstream stream;
+ stream << get_current_process_id() << '_';
+ stream.precision(6);
+ stream << std::fixed << get_current_process_creation_time();
+ s = stream.str();
+}
+
+inline const char *get_map_base_name()
+{ return "bip.gmem.map."; }
+
+inline void get_map_name(std::string &map_name)
+{
+ get_pid_creation_time_str(map_name);
+ map_name.insert(0, get_map_base_name());
+}
+
+inline std::size_t get_map_size()
+{ return 65536; }
+
+template<class ThreadSafeGlobalMap>
+struct thread_safe_global_map_dependant;
+
+} //namespace intermodule_singleton_helpers {
+
+//This class contains common code for all singleton types, so that we instantiate this
+//code just once per module. This class also holds a thread soafe global map
+//to be used by all instances protected with a reference count
+template<class ThreadSafeGlobalMap>
+class intermodule_singleton_common
+{
+ public:
+ typedef void*(singleton_constructor_t)(ThreadSafeGlobalMap &);
+ typedef void (singleton_destructor_t)(void *, ThreadSafeGlobalMap &);
+
+ static const ::boost::uint32_t Uninitialized = 0u;
+ static const ::boost::uint32_t Initializing = 1u;
+ static const ::boost::uint32_t Initialized = 2u;
+ static const ::boost::uint32_t Broken = 3u;
+ static const ::boost::uint32_t Destroyed = 4u;
+
+ //Initialize this_module_singleton_ptr, creates the global map if needed and also creates an unique
+ //opaque type in global map through a singleton_constructor_t function call,
+ //initializing the passed pointer to that unique instance.
+ //
+ //We have two concurrency types here. a)the global map/singleton creation must
+ //be safe between threads of this process but in different modules/dlls. b)
+ //the pointer to the singleton is per-module, so we have to protect this
+ //initization between threads of the same module.
+ //
+ //All static variables declared here are shared between inside a module
+ //so atomic operations will synchronize only threads of the same module.
+ static void initialize_singleton_logic
+ (void *&ptr, volatile boost::uint32_t &this_module_singleton_initialized, singleton_constructor_t constructor, bool phoenix)
+ {
+ //If current module is not initialized enter to lock free logic
+ if(atomic_read32(&this_module_singleton_initialized) != Initialized){
+ //Now a single thread of the module will succeed in this CAS.
+ //trying to pass from Uninitialized to Initializing
+ ::boost::uint32_t previous_module_singleton_initialized = atomic_cas32
+ (&this_module_singleton_initialized, Initializing, Uninitialized);
+ //If the thread succeeded the CAS (winner) it will compete with other
+ //winner threads from other modules to create the global map
+ if(previous_module_singleton_initialized == Destroyed){
+ //Trying to resurrect a dead Phoenix singleton. Just try to
+ //mark it as uninitialized and start again
+ if(phoenix){
+ atomic_cas32(&this_module_singleton_initialized, Uninitialized, Destroyed);
+ previous_module_singleton_initialized = atomic_cas32
+ (&this_module_singleton_initialized, Initializing, Uninitialized);
+ }
+ //Trying to resurrect a non-Phoenix dead singleton is an error
+ else{
+ throw interprocess_exception("Boost.Interprocess: Dead reference on non-Phoenix singleton of type");
+ }
+ }
+ if(previous_module_singleton_initialized == Uninitialized){
+ try{
+ //Now initialize the global map, this function must solve concurrency
+ //issues between threads of several modules
+ initialize_global_map_handle();
+ //Now try to create the singleton in global map.
+ //This function solves concurrency issues
+ //between threads of several modules
+ void *tmp = constructor(get_map());
+ //Increment the module reference count that reflects how many
+ //singletons this module holds, so that we can safely destroy
+ //module global map object when no singleton is left
+ atomic_inc32(&this_module_singleton_count);
+ //Insert a barrier before assigning the pointer to
+ //make sure this assignment comes after the initialization
+ atomic_write32(&this_module_singleton_initialized, Initializing);
+ //Assign the singleton address to the module-local pointer
+ ptr = tmp;
+ //Memory barrier inserted, all previous operations should complete
+ //before this one. Now marked as initialized
+ atomic_write32(&this_module_singleton_initialized, Initialized);
+ }
+ catch(...){
+ //Mark singleton failed to initialize
+ atomic_write32(&this_module_singleton_initialized, Broken);
+ throw;
+ }
+ }
+ //If previous state was initializing, this means that another winner thread is
+ //trying to initialize the singleton. Just wait until completes its work.
+ else if(previous_module_singleton_initialized == Initializing){
+ while(1){
+ previous_module_singleton_initialized = atomic_read32(&this_module_singleton_initialized);
+ if(previous_module_singleton_initialized >= Initialized){
+ //Already initialized, or exception thrown by initializer thread
+ break;
+ }
+ else if(previous_module_singleton_initialized == Initializing){
+ thread_yield();
+ }
+ else{
+ //This can't be happening!
+ BOOST_ASSERT(0);
+ }
+ }
+ }
+ else if(previous_module_singleton_initialized == Initialized){
+ //Nothing to do here, the singleton is ready
+ }
+ //If previous state was greater than initialized, then memory is broken
+ //trying to initialize the singleton.
+ else{//(previous_module_singleton_initialized > Initialized)
+ throw interprocess_exception("boost::interprocess::intermodule_singleton initialization failed");
+ }
+ }
+ BOOST_ASSERT(ptr != 0);
+ }
+
+ static void finalize_singleton_logic(void *&ptr, volatile boost::uint32_t &this_module_singleton_initialized, singleton_destructor_t destructor)
+ {
+ //Protect destruction against lazy singletons not initialized in this execution
+ if(ptr){
+ //Note: this destructor might provoke a Phoenix singleton
+ //resurrection. This means that this_module_singleton_count
+ //might change after this call.
+ destructor(ptr, get_map());
+ ptr = 0;
+
+ //Memory barrier to make sure pointer is nulled.
+ //Mark this singleton as destroyed.
+ atomic_write32(&this_module_singleton_initialized, Destroyed);
+
+ //If this is the last singleton of this module
+ //apply map destruction.
+ //Note: singletons are destroyed when the module is unloaded
+ //so no threads should be executing or holding references
+ //to this module
+ if(1 == atomic_dec32(&this_module_singleton_count)){
+ destroy_global_map_handle();
+ }
+ }
+ }
+
+ private:
+ static ThreadSafeGlobalMap &get_map()
+ {
+ return *static_cast<ThreadSafeGlobalMap *>(static_cast<void *>(&mem_holder.map_mem));
+ }
+
+ static void initialize_global_map_handle()
+ {
+ //Obtain unique map name and size
+ while(1){
+ //Try to pass map state to initializing
+ ::boost::uint32_t tmp = atomic_cas32(&this_module_map_initialized, Initializing, Uninitialized);
+ if(tmp == Initialized || tmp == Broken){
+ break;
+ }
+ else if(tmp == Destroyed){
+ tmp = atomic_cas32(&this_module_map_initialized, Uninitialized, Destroyed);
+ continue;
+ }
+ //If some other thread is doing the work wait
+ else if(tmp == Initializing){
+ thread_yield();
+ }
+ else{ //(tmp == Uninitialized)
+ //If not initialized try it again?
+ try{
+ //Remove old global map from the system
+ intermodule_singleton_helpers::thread_safe_global_map_dependant<ThreadSafeGlobalMap>::remove_old_gmem();
+ //in-place construction of the global map class
+ intermodule_singleton_helpers::thread_safe_global_map_dependant
+ <ThreadSafeGlobalMap>::construct_map(static_cast<void*>(&get_map()));
+ //Use global map's internal lock to initialize the lock file
+ //that will mark this gmem as "in use".
+ typename intermodule_singleton_helpers::thread_safe_global_map_dependant<ThreadSafeGlobalMap>::
+ lock_file_logic f(get_map());
+ //If function failed (maybe a competing process has erased the shared
+ //memory between creation and file locking), retry with a new instance.
+ if(f.retry()){
+ get_map().~ThreadSafeGlobalMap();
+ atomic_write32(&this_module_map_initialized, Destroyed);
+ }
+ else{
+ //Locking succeeded, so this global map module-instance is ready
+ atomic_write32(&this_module_map_initialized, Initialized);
+ break;
+ }
+ }
+ catch(...){
+ //
+ throw;
+ }
+ }
+ }
+ }
+
+ static void destroy_global_map_handle()
+ {
+ if(!atomic_read32(&this_module_singleton_count)){
+ //This module is being unloaded, so destroy
+ //the global map object of this module
+ //and unlink the global map if it's the last
+ typename intermodule_singleton_helpers::thread_safe_global_map_dependant<ThreadSafeGlobalMap>::
+ unlink_map_logic f(get_map());
+ (get_map()).~ThreadSafeGlobalMap();
+ atomic_write32(&this_module_map_initialized, Destroyed);
+ //Do some cleanup for other processes old gmem instances
+ intermodule_singleton_helpers::thread_safe_global_map_dependant<ThreadSafeGlobalMap>::remove_old_gmem();
+ }
+ }
+
+ //Static data, zero-initalized without any dependencies
+ //this_module_singleton_count is the number of singletons used by this module
+ static volatile boost::uint32_t this_module_singleton_count;
+
+ //this_module_map_initialized is the state of this module's map class object.
+ //Values: Uninitialized, Initializing, Initialized, Broken
+ static volatile boost::uint32_t this_module_map_initialized;
+
+ //Raw memory to construct the global map manager
+ static struct mem_holder_t
+ {
+ ::boost::detail::max_align aligner;
+ char map_mem [sizeof(ThreadSafeGlobalMap)];
+ } mem_holder;
+};
+
+template<class ThreadSafeGlobalMap>
+volatile boost::uint32_t intermodule_singleton_common<ThreadSafeGlobalMap>::this_module_singleton_count;
+
+template<class ThreadSafeGlobalMap>
+volatile boost::uint32_t intermodule_singleton_common<ThreadSafeGlobalMap>::this_module_map_initialized;
+
+template<class ThreadSafeGlobalMap>
+typename intermodule_singleton_common<ThreadSafeGlobalMap>::mem_holder_t
+ intermodule_singleton_common<ThreadSafeGlobalMap>::mem_holder;
+
+//A reference count to be stored in global map holding the number
+//of singletons (one per module) attached to the instance pointed by
+//the internal ptr.
+struct ref_count_ptr
+{
+ ref_count_ptr(void *p, boost::uint32_t count)
+ : ptr(p), singleton_ref_count(count)
+ {}
+ void *ptr;
+ //This reference count serves to count the number of attached
+ //modules to this singleton
+ volatile boost::uint32_t singleton_ref_count;
+};
+
+
+//Now this class is a singleton, initializing the singleton in
+//the first get() function call if LazyInit is false. If true
+//then the singleton will be initialized when loading the module.
+template<typename C, bool LazyInit, bool Phoenix, class ThreadSafeGlobalMap>
+class intermodule_singleton_impl
+{
+ public:
+
+ static C& get() //Let's make inlining easy
+ {
+ if(!this_module_singleton_ptr){
+ if(lifetime.dummy_function()){ //This forces lifetime instantiation, for reference counted destruction
+ atentry_work();
+ }
+ }
+ return *static_cast<C*>(this_module_singleton_ptr);
+ }
+
+ private:
+
+ static void atentry_work()
+ {
+ intermodule_singleton_common<ThreadSafeGlobalMap>::initialize_singleton_logic
+ (this_module_singleton_ptr, this_module_singleton_initialized, singleton_constructor, Phoenix);
+ }
+
+ static void atexit_work()
+ {
+ intermodule_singleton_common<ThreadSafeGlobalMap>::finalize_singleton_logic
+ (this_module_singleton_ptr, this_module_singleton_initialized, singleton_destructor);
+ }
+
+ //These statics will be zero-initialized without any constructor call dependency
+ //this_module_singleton_ptr will be a module-local pointer to the singleton
+ static void* this_module_singleton_ptr;
+
+ //this_module_singleton_count will be used to synchronize threads of the same module
+ //for access to a singleton instance, and to flag the state of the
+ //singleton.
+ static volatile boost::uint32_t this_module_singleton_initialized;
+
+ //This class destructor will trigger singleton destruction
+ struct lifetime_type_lazy
+ {
+ bool dummy_function()
+ { return m_dummy == 0; }
+
+ ~lifetime_type_lazy()
+ {
+ if(!Phoenix){
+ atexit_work();
+ }
+ }
+
+ //Dummy volatile so that the compiler can't resolve its value at compile-time
+ //and can't avoid lifetime_type instantiation if dummy_function() is called.
+ static volatile int m_dummy;
+ };
+
+ struct lifetime_type_static
+ : public lifetime_type_lazy
+ {
+ lifetime_type_static()
+ { atentry_work(); }
+ };
+
+ typedef typename if_c
+ <LazyInit, lifetime_type_lazy, lifetime_type_static>::type lifetime_type;
+
+ static lifetime_type lifetime;
+
+ //A functor to be executed inside global map lock that just
+ //searches for the singleton in map and if not present creates a new one.
+ //If singleton constructor throws, the exception is propagated
+ struct init_atomic_func
+ {
+ init_atomic_func(ThreadSafeGlobalMap &m)
+ : m_map(m)
+ {}
+
+ void operator()()
+ {
+ ref_count_ptr *rcount = intermodule_singleton_helpers::thread_safe_global_map_dependant
+ <ThreadSafeGlobalMap>::find(m_map, typeid(C).name());
+ if(!rcount){
+ C *p = new C;
+ try{
+ ref_count_ptr val(p, 0u);
+ rcount = intermodule_singleton_helpers::thread_safe_global_map_dependant
+ <ThreadSafeGlobalMap>::insert(m_map, typeid(C).name(), val);
+ }
+ catch(...){
+ intermodule_singleton_helpers::thread_safe_global_map_dependant
+ <ThreadSafeGlobalMap>::erase(m_map, typeid(C).name());
+ delete p;
+ throw;
+ }
+ }
+ if(Phoenix){
+ std::atexit(&atexit_work);
+ }
+ atomic_inc32(&rcount->singleton_ref_count);
+ ret_ptr = rcount->ptr;
+ }
+ void *data() const
+ { return ret_ptr; }
+
+ private:
+ ThreadSafeGlobalMap &m_map;
+ void *ret_ptr;
+ };
+
+ //A functor to be executed inside global map lock that just
+ //deletes the singleton in map if the attached count reaches to zero
+ struct fini_atomic_func
+ {
+ fini_atomic_func(ThreadSafeGlobalMap &m)
+ : m_map(m)
+ {}
+
+ void operator()()
+ {
+ ref_count_ptr *rcount = intermodule_singleton_helpers::thread_safe_global_map_dependant
+ <ThreadSafeGlobalMap>::find(m_map, typeid(C).name());
+ //The object must exist
+ BOOST_ASSERT(rcount);
+ BOOST_ASSERT(rcount->singleton_ref_count > 0);
+ //Check if last reference
+ if(atomic_dec32(&rcount->singleton_ref_count) == 1){
+ //If last, destroy the object
+ BOOST_ASSERT(rcount->ptr != 0);
+ C *pc = static_cast<C*>(rcount->ptr);
+ //Now destroy map entry
+ bool destroyed = intermodule_singleton_helpers::thread_safe_global_map_dependant
+ <ThreadSafeGlobalMap>::erase(m_map, typeid(C).name());
+ (void)destroyed; BOOST_ASSERT(destroyed == true);
+ delete pc;
+ }
+ }
+ void *data() const
+ { return ret_ptr; }
+
+ private:
+ ThreadSafeGlobalMap &m_map;
+ void *ret_ptr;
+ };
+
+ //A wrapper to execute init_atomic_func
+ static void *singleton_constructor(ThreadSafeGlobalMap &map)
+ {
+ init_atomic_func f(map);
+ intermodule_singleton_helpers::thread_safe_global_map_dependant
+ <ThreadSafeGlobalMap>::atomic_func(map, f);
+ return f.data();
+ }
+
+ //A wrapper to execute fini_atomic_func
+ static void singleton_destructor(void *p, ThreadSafeGlobalMap &map)
+ { (void)p;
+ fini_atomic_func f(map);
+ intermodule_singleton_helpers::thread_safe_global_map_dependant
+ <ThreadSafeGlobalMap>::atomic_func(map, f);
+ }
+};
+
+template <typename C, bool L, bool P, class ThreadSafeGlobalMap>
+volatile int intermodule_singleton_impl<C, L, P, ThreadSafeGlobalMap>::lifetime_type_lazy::m_dummy = 0;
+
+//These will be zero-initialized by the loader
+template <typename C, bool L, bool P, class ThreadSafeGlobalMap>
+void *intermodule_singleton_impl<C, L, P, ThreadSafeGlobalMap>::this_module_singleton_ptr = 0;
+
+template <typename C, bool L, bool P, class ThreadSafeGlobalMap>
+volatile boost::uint32_t intermodule_singleton_impl<C, L, P, ThreadSafeGlobalMap>::this_module_singleton_initialized = 0;
+
+template <typename C, bool L, bool P, class ThreadSafeGlobalMap>
+typename intermodule_singleton_impl<C, L, P, ThreadSafeGlobalMap>::lifetime_type
+ intermodule_singleton_impl<C, L, P, ThreadSafeGlobalMap>::lifetime;
+
+} //namespace ipcdetail{
+} //namespace interprocess{
+} //namespace boost{
+
+#include <boost/interprocess/detail/config_end.hpp>
+
+#endif //#ifndef BOOST_INTERPROCESS_INTERMODULE_SINGLETON_COMMON_HPP
diff --git a/boost/interprocess/detail/intersegment_ptr.hpp b/boost/interprocess/detail/intersegment_ptr.hpp
index 92970923d0..16d3505883 100644
--- a/boost/interprocess/detail/intersegment_ptr.hpp
+++ b/boost/interprocess/detail/intersegment_ptr.hpp
@@ -68,8 +68,8 @@ struct intersegment_base
static const std::size_t begin_bits = max_segment_size_bits - align_bits;
static const std::size_t pow_size_bits_helper = static_log2<max_segment_size_bits>::value;
- static const std::size_t pow_size_bits =
- (max_segment_size_bits == (std::size_t(1) << pow_size_bits_helper)) ?
+ static const std::size_t pow_size_bits =
+ (max_segment_size_bits == (std::size_t(1) << pow_size_bits_helper)) ?
pow_size_bits_helper : pow_size_bits_helper + 1;
static const std::size_t frc_size_bits =
size_t_bits - ctrl_bits - begin_bits - pow_size_bits;
@@ -177,7 +177,7 @@ struct intersegment_base
void set_mode(std::size_t mode)
{
- BOOST_ASSERT(mode < is_max_mode);
+ BOOST_ASSERT(mode < is_max_mode);
members.direct.ctrl = mode;
}
@@ -185,7 +185,7 @@ struct intersegment_base
//!null pointer
bool is_null() const
{
- return (this->get_mode() < is_relative) &&
+ return (this->get_mode() < is_relative) &&
!members.direct.dummy &&
!members.direct.addr;
}
@@ -309,13 +309,13 @@ struct flat_map_intersegment
void *ptr_base;
void *this_base;
get_segment_info_and_offset(this, this_info, this_offset, this_base);
-
+
if(!this_info.group){
this->set_mode(is_in_stack);
this->members.direct.addr = const_cast<void*>(ptr);
}
else{
- get_segment_info_and_offset(ptr, ptr_info, ptr_offset, ptr_base);
+ get_segment_info_and_offset(ptr, ptr_info, ptr_offset, ptr_base);
if(ptr_info.group != this_info.group){
this->set_mode(is_pointee_outside);
@@ -340,7 +340,7 @@ struct flat_map_intersegment
}
}
- //!Sets the object internals to represent the address pointed
+ //!Sets the object internals to represent the address pointed
//!by another flat_map_intersegment
void set_from_other(const self_t &other)
{
@@ -383,7 +383,7 @@ struct flat_map_intersegment
};
vector<segment_data> m_segments;
multi_segment_services &m_ms_services;
-
+
public:
segment_group_t(multi_segment_services &ms_services)
: m_ms_services(ms_services)
@@ -434,7 +434,7 @@ struct flat_map_intersegment
typedef set<segment_group_t> segment_groups_t;
typedef boost::interprocess::flat_map
- <const void *
+ <const void *
,segment_info_t
,std::less<const void *> > ptr_to_segment_info_t;
@@ -443,9 +443,9 @@ struct flat_map_intersegment
//!Mutex to preserve integrity in multi-threaded
//!enviroments
typedef Mutex mutex_type;
- //!Maps base addresses and segment information
+ //!Maps base addresses and segment information
//!(size and segment group and id)*
-
+
ptr_to_segment_info_t m_ptr_to_segment_info;
~mappings_t()
@@ -476,7 +476,7 @@ struct flat_map_intersegment
return;
}
//Find the first base address greater than ptr
- typename ptr_to_segment_info_t::iterator it
+ typename ptr_to_segment_info_t::iterator it
= s_map.m_ptr_to_segment_info.upper_bound(ptr);
if(it == s_map.m_ptr_to_segment_info.begin()){
segment = segment_info_t();
@@ -486,7 +486,7 @@ struct flat_map_intersegment
--it;
char * segment_base = const_cast<char*>(reinterpret_cast<const char*>(it->first));
std::size_t segment_size = it->second.size;
-
+
if(segment_base <= reinterpret_cast<const char*>(ptr) &&
(segment_base + segment_size) >= reinterpret_cast<const char*>(ptr)){
segment = it->second;
@@ -552,7 +552,7 @@ struct flat_map_intersegment
s_groups.insert(segment_group_t(*services));
BOOST_ASSERT(ret.second);
return &*ret.first;
- }
+ }
}
static bool delete_group(segment_group_id id)
@@ -574,23 +574,23 @@ struct flat_map_intersegment
}
}
return success;
- }
+ }
}
};
//!Static map-segment_info associated with
//!flat_map_intersegment<>
template <class Mutex>
-typename flat_map_intersegment<Mutex>::mappings_t
+typename flat_map_intersegment<Mutex>::mappings_t
flat_map_intersegment<Mutex>::s_map;
//!Static segment group container associated with
//!flat_map_intersegment<>
template <class Mutex>
-typename flat_map_intersegment<Mutex>::segment_groups_t
+typename flat_map_intersegment<Mutex>::segment_groups_t
flat_map_intersegment<Mutex>::s_groups;
-//!A smart pointer that can point to a pointee that resides in another memory
+//!A smart pointer that can point to a pointee that resides in another memory
//!memory mapped or shared memory segment.
template <class T>
class intersegment_ptr : public flat_map_intersegment<interprocess_mutex>
@@ -623,13 +623,13 @@ class intersegment_ptr : public flat_map_intersegment<interprocess_mutex>
//!Constructor from other intersegment_ptr
//!Never throws
- intersegment_ptr(const intersegment_ptr& ptr)
+ intersegment_ptr(const intersegment_ptr& ptr)
{ base_t::set_from_other(ptr); }
- //!Constructor from other intersegment_ptr. If pointers of pointee types are
+ //!Constructor from other intersegment_ptr. If pointers of pointee types are
//!convertible, intersegment_ptrs will be convertibles. Never throws.
template<class T2>
- intersegment_ptr(const intersegment_ptr<T2> &ptr)
+ intersegment_ptr(const intersegment_ptr<T2> &ptr)
{ pointer p(ptr.get()); (void)p; base_t::set_from_other(ptr); }
//!Emulates static_cast operator.
@@ -663,17 +663,17 @@ class intersegment_ptr : public flat_map_intersegment<interprocess_mutex>
//!Pointer-like -> operator. It can return 0 pointer.
//!Never throws.
- pointer operator->() const
+ pointer operator->() const
{ return self_t::get(); }
- //!Dereferencing operator, if it is a null intersegment_ptr behavior
+ //!Dereferencing operator, if it is a null intersegment_ptr behavior
//!is undefined. Never throws.
- reference operator* () const
+ reference operator* () const
{ return *(self_t::get()); }
//!Indexing operator.
//!Never throws.
- reference operator[](std::ptrdiff_t idx) const
+ reference operator[](std::ptrdiff_t idx) const
{ return self_t::get()[idx]; }
//!Assignment from pointer (saves extra conversion).
@@ -686,19 +686,19 @@ class intersegment_ptr : public flat_map_intersegment<interprocess_mutex>
intersegment_ptr& operator= (const intersegment_ptr &ptr)
{ base_t::set_from_other(ptr); return *this; }
- //!Assignment from related intersegment_ptr. If pointers of pointee types
+ //!Assignment from related intersegment_ptr. If pointers of pointee types
//!are assignable, intersegment_ptrs will be assignable. Never throws.
template <class T2>
intersegment_ptr& operator= (const intersegment_ptr<T2> & ptr)
- {
- pointer p(ptr.get()); (void)p;
- base_t::set_from_other(ptr); return *this;
+ {
+ pointer p(ptr.get()); (void)p;
+ base_t::set_from_other(ptr); return *this;
}
-
+
//!intersegment_ptr + std::ptrdiff_t.
//!Never throws.
- intersegment_ptr operator+ (std::ptrdiff_t idx) const
- {
+ intersegment_ptr operator+ (std::ptrdiff_t idx) const
+ {
intersegment_ptr result (*this);
result.inc_offset(idx*sizeof(T));
return result;
@@ -706,8 +706,8 @@ class intersegment_ptr : public flat_map_intersegment<interprocess_mutex>
//!intersegment_ptr - std::ptrdiff_t.
//!Never throws.
- intersegment_ptr operator- (std::ptrdiff_t idx) const
- {
+ intersegment_ptr operator- (std::ptrdiff_t idx) const
+ {
intersegment_ptr result (*this);
result.dec_offset(idx*sizeof(T));
return result;
@@ -727,7 +727,7 @@ class intersegment_ptr : public flat_map_intersegment<interprocess_mutex>
//!Never throws.
intersegment_ptr& operator++ (void)
{ base_t::inc_offset(sizeof(T)); return *this; }
-
+
//!intersegment_ptr++.
//!Never throws.
intersegment_ptr operator++ (int)
@@ -745,10 +745,10 @@ class intersegment_ptr : public flat_map_intersegment<interprocess_mutex>
//!Safe bool conversion operator.
//!Never throws.
- operator unspecified_bool_type() const
+ operator unspecified_bool_type() const
{ return base_t::is_null()? 0 : &self_t::unspecified_bool_type_func; }
- //!Not operator. Not needed in theory, but improves portability.
+ //!Not operator. Not needed in theory, but improves portability.
//!Never throws.
bool operator! () const
{ return base_t::is_null(); }
@@ -784,12 +784,12 @@ class intersegment_ptr : public flat_map_intersegment<interprocess_mutex>
template <class T1, class T2> inline
bool operator ==(const intersegment_ptr<T1> &left,
const intersegment_ptr<T2> &right)
-{
+{
//Make sure both pointers can be compared
bool e = typename intersegment_ptr<T1>::pointer(0) ==
typename intersegment_ptr<T2>::pointer(0);
(void)e;
- return left._equal(right);
+ return left._equal(right);
}
//!Returns true if *this is less than other.
@@ -798,74 +798,74 @@ bool operator ==(const intersegment_ptr<T1> &left,
template <class T1, class T2> inline
bool operator <(const intersegment_ptr<T1> &left,
const intersegment_ptr<T2> &right)
-{
+{
//Make sure both pointers can be compared
bool e = typename intersegment_ptr<T1>::pointer(0) <
typename intersegment_ptr<T2>::pointer(0);
(void)e;
- return left._less(right);
+ return left._less(right);
}
template<class T1, class T2> inline
-bool operator!= (const intersegment_ptr<T1> &pt1,
+bool operator!= (const intersegment_ptr<T1> &pt1,
const intersegment_ptr<T2> &pt2)
{ return !(pt1 ==pt2); }
//!intersegment_ptr<T1> <= intersegment_ptr<T2>.
//!Never throws.
template<class T1, class T2> inline
-bool operator<= (const intersegment_ptr<T1> &pt1,
+bool operator<= (const intersegment_ptr<T1> &pt1,
const intersegment_ptr<T2> &pt2)
{ return !(pt1 > pt2); }
//!intersegment_ptr<T1> > intersegment_ptr<T2>.
//!Never throws.
template<class T1, class T2> inline
-bool operator> (const intersegment_ptr<T1> &pt1,
+bool operator> (const intersegment_ptr<T1> &pt1,
const intersegment_ptr<T2> &pt2)
{ return (pt2 < pt1); }
//!intersegment_ptr<T1> >= intersegment_ptr<T2>.
//!Never throws.
template<class T1, class T2> inline
-bool operator>= (const intersegment_ptr<T1> &pt1,
+bool operator>= (const intersegment_ptr<T1> &pt1,
const intersegment_ptr<T2> &pt2)
{ return !(pt1 < pt2); }
//!operator<<
template<class E, class T, class U> inline
-std::basic_ostream<E, T> & operator<<
+std::basic_ostream<E, T> & operator<<
(std::basic_ostream<E, T> & os, const intersegment_ptr<U> & p)
{ return os << p.get(); }
//!operator>>
template<class E, class T, class U> inline
-std::basic_istream<E, T> & operator>>
+std::basic_istream<E, T> & operator>>
(std::basic_istream<E, T> & os, intersegment_ptr<U> & p)
{ U * tmp; return os >> tmp; p = tmp; }
-//!std::ptrdiff_t + intersegment_ptr.
+//!std::ptrdiff_t + intersegment_ptr.
//!The result is another pointer of the same segment
template<class T> inline
intersegment_ptr<T> operator+
(std::ptrdiff_t diff, const intersegment_ptr<T>& right)
{ return right + diff; }
-//!intersegment_ptr - intersegment_ptr.
+//!intersegment_ptr - intersegment_ptr.
//!This only works with two intersegment_ptr-s that point to the
//!same segment
template <class T, class T2> inline
-std::ptrdiff_t operator- (const intersegment_ptr<T> &pt,
+std::ptrdiff_t operator- (const intersegment_ptr<T> &pt,
const intersegment_ptr<T2> &pt2)
{ return pt._diff(pt2)/sizeof(T); }
//! swap specialization
template<class T> inline
-void swap (boost::interprocess::intersegment_ptr<T> &pt,
+void swap (boost::interprocess::intersegment_ptr<T> &pt,
boost::interprocess::intersegment_ptr<T> &pt2)
{ pt.swap(pt2); }
-//!to_raw_pointer() enables boost::mem_fn to recognize intersegment_ptr.
+//!to_raw_pointer() enables boost::mem_fn to recognize intersegment_ptr.
//!Never throws.
template<class T> inline
T * to_raw_pointer(boost::interprocess::intersegment_ptr<T> const & p)
@@ -873,19 +873,19 @@ T * to_raw_pointer(boost::interprocess::intersegment_ptr<T> const & p)
//!Simulation of static_cast between pointers.
//!Never throws.
-template<class T, class U> inline
+template<class T, class U> inline
boost::interprocess::intersegment_ptr<T> static_pointer_cast(const boost::interprocess::intersegment_ptr<U> &r)
{ return boost::interprocess::intersegment_ptr<T>(r, boost::interprocess::ipcdetail::static_cast_tag()); }
//!Simulation of const_cast between pointers.
//!Never throws.
-template<class T, class U> inline
+template<class T, class U> inline
boost::interprocess::intersegment_ptr<T> const_pointer_cast(const boost::interprocess::intersegment_ptr<U> &r)
{ return boost::interprocess::intersegment_ptr<T>(r, boost::interprocess::ipcdetail::const_cast_tag()); }
//!Simulation of dynamic_cast between pointers.
//!Never throws.
-template<class T, class U> inline
+template<class T, class U> inline
boost::interprocess::intersegment_ptr<T> dynamic_pointer_cast(const boost::interprocess::intersegment_ptr<U> &r)
{ return boost::interprocess::intersegment_ptr<T>(r, boost::interprocess::ipcdetail::dynamic_cast_tag()); }
@@ -895,7 +895,7 @@ template<class T, class U> inline
boost::interprocess::intersegment_ptr<T> reinterpret_pointer_cast(const boost::interprocess::intersegment_ptr<U> &r)
{ return boost::interprocess::intersegment_ptr<T>(r, boost::interprocess::ipcdetail::reinterpret_cast_tag()); }
-//!Trait class to detect if an smart pointer has
+//!Trait class to detect if an smart pointer has
//!multi-segment addressing capabilities.
template <class T>
struct is_multisegment_ptr
@@ -907,7 +907,7 @@ struct is_multisegment_ptr
} //namespace interprocess {
#if defined(_MSC_VER) && (_MSC_VER < 1400)
-//!to_raw_pointer() enables boost::mem_fn to recognize intersegment_ptr.
+//!to_raw_pointer() enables boost::mem_fn to recognize intersegment_ptr.
//!Never throws.
template<class T> inline
T * to_raw_pointer(boost::interprocess::intersegment_ptr<T> const & p)
@@ -918,14 +918,14 @@ T * to_raw_pointer(boost::interprocess::intersegment_ptr<T> const & p)
//!for optimizations
template <class T>
struct has_trivial_constructor
- < boost::interprocess::intersegment_ptr<T> >
+ < boost::interprocess::intersegment_ptr<T> >
: public true_type{};
//!has_trivial_destructor<> == true_type specialization
//!for optimizations
template <class T>
struct has_trivial_destructor
- < boost::interprocess::intersegment_ptr<T> >
+ < boost::interprocess::intersegment_ptr<T> >
: public true_type{};
} //namespace boost {
@@ -950,7 +950,7 @@ struct has_trivial_destructor
// std::size_t offset;
//RELATIVE_SIZE_BITS = SIZE_T_BITS -
-// MAX_SEGMENT_BITS -
+// MAX_SEGMENT_BITS -
// CTRL_BITS 10 10
//MAX_SEGMENT_SIZE = SIZE_T_BITS - ALIGN_BITS 20 52
diff --git a/boost/interprocess/detail/managed_global_memory.hpp b/boost/interprocess/detail/managed_global_memory.hpp
new file mode 100644
index 0000000000..39dd0b1e6d
--- /dev/null
+++ b/boost/interprocess/detail/managed_global_memory.hpp
@@ -0,0 +1,115 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2009-2012. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/interprocess for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTERPROCESS_BASIC_GLOBAL_MEMORY_HPP
+#define BOOST_INTERPROCESS_BASIC_GLOBAL_MEMORY_HPP
+
+#if defined(_MSC_VER)&&(_MSC_VER>=1200)
+#pragma once
+#endif
+
+#include <boost/interprocess/detail/config_begin.hpp>
+#include <boost/interprocess/detail/workaround.hpp>
+
+#include <boost/interprocess/offset_ptr.hpp>
+#include <boost/interprocess/sync/spin/mutex.hpp>
+#include <boost/interprocess/sync/spin/recursive_mutex.hpp>
+#include <boost/interprocess/detail/managed_memory_impl.hpp>
+#include <boost/interprocess/detail/managed_open_or_create_impl.hpp>
+#include <boost/interprocess/mem_algo/rbtree_best_fit.hpp>
+#include <boost/interprocess/indexes/iset_index.hpp>
+#include <boost/interprocess/creation_tags.hpp>
+#include <boost/interprocess/permissions.hpp>
+
+namespace boost{
+namespace interprocess{
+namespace ipcdetail{
+
+struct intermodule_singleton_mutex_family
+{
+ typedef boost::interprocess::ipcdetail::spin_mutex mutex_type;
+ typedef boost::interprocess::ipcdetail::spin_recursive_mutex recursive_mutex_type;
+};
+
+struct intermodule_types
+{
+ //We must use offset_ptr since a loaded DLL can map the singleton holder shared memory
+ //at a different address than other DLLs or the main executable
+ typedef rbtree_best_fit<intermodule_singleton_mutex_family, offset_ptr<void> > mem_algo;
+ template<class Device, bool FileBased>
+ struct open_or_create
+ {
+ typedef managed_open_or_create_impl
+ <Device, mem_algo::Alignment, FileBased> type;
+ };
+};
+
+//we must implement our own managed shared memory to avoid circular dependencies
+template<class Device, bool FileBased>
+class basic_managed_global_memory
+ : public basic_managed_memory_impl
+ < char
+ , intermodule_types::mem_algo
+ , iset_index
+ , intermodule_types::open_or_create<Device, FileBased>::type::ManagedOpenOrCreateUserOffset
+ >
+ , private intermodule_types::open_or_create<Device, FileBased>::type
+{
+ /// @cond
+ typedef typename intermodule_types::template open_or_create<Device, FileBased>::type base2_t;
+
+ typedef basic_managed_memory_impl
+ < char
+ , intermodule_types::mem_algo
+ , iset_index
+ , base2_t::ManagedOpenOrCreateUserOffset
+ > base_t;
+
+ typedef create_open_func<base_t> create_open_func_t;
+
+ basic_managed_global_memory *get_this_pointer()
+ { return this; }
+
+ public:
+ typedef typename base_t::size_type size_type;
+
+ private:
+ typedef typename base_t::char_ptr_holder_t char_ptr_holder_t;
+ BOOST_MOVABLE_BUT_NOT_COPYABLE(basic_managed_global_memory)
+ /// @endcond
+
+ public: //functions
+
+ basic_managed_global_memory (open_or_create_t open_or_create,
+ const char *name, size_type size,
+ const void *addr = 0, const permissions& perm = permissions())
+ : base_t()
+ , base2_t(open_or_create, name, size, read_write, addr,
+ create_open_func_t(get_this_pointer(),
+ DoOpenOrCreate), perm)
+ {}
+
+ basic_managed_global_memory (open_only_t open_only, const char* name,
+ const void *addr = 0)
+ : base_t()
+ , base2_t(open_only, name, read_write, addr,
+ create_open_func_t(get_this_pointer(),
+ DoOpen))
+ {}
+};
+
+
+} //namespace ipcdetail{
+} //namespace interprocess{
+} //namespace boost{
+
+#include <boost/interprocess/detail/config_end.hpp>
+
+#endif //#ifndef BOOST_INTERPROCESS_BASIC_GLOBAL_MEMORY_HPP
diff --git a/boost/interprocess/detail/managed_memory_impl.hpp b/boost/interprocess/detail/managed_memory_impl.hpp
index 31c3804439..f9ecb8a860 100644
--- a/boost/interprocess/detail/managed_memory_impl.hpp
+++ b/boost/interprocess/detail/managed_memory_impl.hpp
@@ -34,7 +34,7 @@
#include <boost/assert.hpp>
//!\file
-//!Describes a named shared memory allocation user class.
+//!Describes a named shared memory allocation user class.
//!
namespace boost {
@@ -45,7 +45,7 @@ template<class BasicManagedMemoryImpl>
class create_open_func;
template<
- class CharType,
+ class CharType,
class MemoryAlgorithm,
template<class IndexConfig> class IndexType
>
@@ -54,14 +54,14 @@ struct segment_manager_type
typedef segment_manager<CharType, MemoryAlgorithm, IndexType> type;
};
-//!This class is designed to be a base class to classes that manage
-//!creation of objects in a fixed size memory buffer. Apart
-//!from allocating raw memory, the user can construct named objects. To
+//!This class is designed to be a base class to classes that manage
+//!creation of objects in a fixed size memory buffer. Apart
+//!from allocating raw memory, the user can construct named objects. To
//!achieve this, this class uses the reserved space provided by the allocation
//!algorithm to place a named_allocator_algo, who takes care of name mappings.
//!The class can be customized with the char type used for object names
//!and the memory allocation algorithm to be used.*/
-template < class CharType
+template < class CharType
, class MemoryAlgorithm
, template<class IndexConfig> class IndexType
, std::size_t Offset = 0
@@ -92,7 +92,7 @@ class basic_managed_memory_impl
/// @cond
- typedef typename
+ typedef typename
segment_manager::char_ptr_holder_t char_ptr_holder_t;
//Experimental. Don't use.
@@ -153,7 +153,7 @@ class basic_managed_memory_impl
}
//!Constructor. Allocates basic resources. Never throws.
- basic_managed_memory_impl()
+ basic_managed_memory_impl()
: mp_header(0){}
//!Destructor. Calls close. Never throws.
@@ -169,19 +169,19 @@ class basic_managed_memory_impl
if(size < segment_manager::get_min_size())
return false;
- //This function should not throw. The index construction can
+ //This function should not throw. The index construction can
//throw if constructor allocates memory. So we must catch it.
BOOST_TRY{
- //Let's construct the allocator in memory
+ //Let's construct the allocator in memory
mp_header = new(addr) segment_manager(size);
}
BOOST_CATCH(...){
return false;
}
BOOST_CATCH_END
- return true;
+ return true;
}
-
+
//!Connects to a segment manager in the reserved buffer. Never throws.
bool open_impl (void *addr, size_type)
{
@@ -192,7 +192,7 @@ class basic_managed_memory_impl
//!Frees resources. Never throws.
bool close_impl()
- {
+ {
bool ret = mp_header != 0;
mp_header = 0;
return ret;
@@ -249,40 +249,40 @@ class basic_managed_memory_impl
void zero_free_memory()
{ mp_header->zero_free_memory(); }
- //!Transforms an absolute address into an offset from base address.
+ //!Transforms an absolute address into an offset from base address.
//!The address must belong to the memory segment. Never throws.
handle_t get_handle_from_address (const void *ptr) const
{
- return (handle_t)(reinterpret_cast<const char*>(ptr) -
- reinterpret_cast<const char*>(this->get_address()));
+ return (handle_t)(reinterpret_cast<const char*>(ptr) -
+ reinterpret_cast<const char*>(this->get_address()));
}
//!Returns true if the address belongs to the managed memory segment
bool belongs_to_segment (const void *ptr) const
- {
- return ptr >= this->get_address() &&
+ {
+ return ptr >= this->get_address() &&
ptr < (reinterpret_cast<const char*>(this->get_address()) + this->get_size());
}
- //!Transforms previously obtained offset into an absolute address in the
+ //!Transforms previously obtained offset into an absolute address in the
//!process space of the current process. Never throws.*/
void * get_address_from_handle (handle_t offset) const
{ return reinterpret_cast<char*>(this->get_address()) + offset; }
//!Searches for nbytes of free memory in the segment, marks the
- //!memory as used and return the pointer to the memory. If no
+ //!memory as used and return the pointer to the memory. If no
//!memory is available throws a boost::interprocess::bad_alloc exception
void* allocate (size_type nbytes)
{ return mp_header->allocate(nbytes); }
- //!Searches for nbytes of free memory in the segment, marks the
- //!memory as used and return the pointer to the memory. If no memory
+ //!Searches for nbytes of free memory in the segment, marks the
+ //!memory as used and return the pointer to the memory. If no memory
//!is available returns 0. Never throws.
void* allocate (size_type nbytes, std::nothrow_t nothrow)
{ return mp_header->allocate(nbytes, nothrow); }
//!Allocates nbytes bytes aligned to "alignment" bytes. "alignment"
- //!must be power of two. If no memory
+ //!must be power of two. If no memory
//!is available returns 0. Never throws.
void * allocate_aligned (size_type nbytes, size_type alignment, std::nothrow_t nothrow)
{ return mp_header->allocate_aligned(nbytes, alignment, nothrow); }
@@ -292,13 +292,13 @@ class basic_managed_memory_impl
allocation_command (boost::interprocess::allocation_type command, size_type limit_size,
size_type preferred_size,size_type &received_size,
T *reuse_ptr = 0)
- {
+ {
return mp_header->allocation_command
(command, limit_size, preferred_size, received_size, reuse_ptr);
}
//!Allocates nbytes bytes aligned to "alignment" bytes. "alignment"
- //!must be power of two. If no
+ //!must be power of two. If no
//!memory is available throws a boost::interprocess::bad_alloc exception
void * allocate_aligned(size_type nbytes, size_type alignment)
{ return mp_header->allocate_aligned(nbytes, alignment); }
@@ -342,18 +342,18 @@ class basic_managed_memory_impl
//!Creates a named object or array in memory
//!
- //!Allocates and constructs a T object or an array of T in memory,
- //!associates this with the given name and returns a pointer to the
+ //!Allocates and constructs a T object or an array of T in memory,
+ //!associates this with the given name and returns a pointer to the
//!created object. If an array is being constructed all objects are
//!created using the same parameters given to this function.
//!
//!-> If the name was previously used, returns 0.
//!
- //!-> Throws boost::interprocess::bad_alloc if there is no available memory
+ //!-> Throws boost::interprocess::bad_alloc if there is no available memory
//!
//!-> If T's constructor throws, the function throws that exception.
//!
- //!Memory is freed automatically if T's constructor throws and if an
+ //!Memory is freed automatically if T's constructor throws and if an
//!array was being constructed, destructors of created objects are called
//!before freeing the memory.
template <class T>
@@ -363,18 +363,18 @@ class basic_managed_memory_impl
//!Finds or creates a named object or array in memory
//!
- //!Tries to find an object with the given name in memory. If
- //!found, returns the pointer to this pointer. If the object is not found,
- //!allocates and constructs a T object or an array of T in memory,
- //!associates this with the given name and returns a pointer to the
+ //!Tries to find an object with the given name in memory. If
+ //!found, returns the pointer to this pointer. If the object is not found,
+ //!allocates and constructs a T object or an array of T in memory,
+ //!associates this with the given name and returns a pointer to the
//!created object. If an array is being constructed all objects are
//!created using the same parameters given to this function.
//!
- //!-> Throws boost::interprocess::bad_alloc if there is no available memory
+ //!-> Throws boost::interprocess::bad_alloc if there is no available memory
//!
//!-> If T's constructor throws, the function throws that exception.
//!
- //!Memory is freed automatically if T's constructor throws and if an
+ //!Memory is freed automatically if T's constructor throws and if an
//!array was being constructed, destructors of created objects are called
//!before freeing the memory.
template <class T>
@@ -384,18 +384,18 @@ class basic_managed_memory_impl
//!Creates a named object or array in memory
//!
- //!Allocates and constructs a T object or an array of T in memory,
- //!associates this with the given name and returns a pointer to the
+ //!Allocates and constructs a T object or an array of T in memory,
+ //!associates this with the given name and returns a pointer to the
//!created object. If an array is being constructed all objects are
//!created using the same parameters given to this function.
//!
//!-> If the name was previously used, returns 0.
//!
- //!-> Returns 0 if there is no available memory
+ //!-> Returns 0 if there is no available memory
//!
//!-> If T's constructor throws, the function throws that exception.
//!
- //!Memory is freed automatically if T's constructor throws and if an
+ //!Memory is freed automatically if T's constructor throws and if an
//!array was being constructed, destructors of created objects are called
//!before freeing the memory.
template <class T>
@@ -405,18 +405,18 @@ class basic_managed_memory_impl
//!Finds or creates a named object or array in memory
//!
- //!Tries to find an object with the given name in memory. If
- //!found, returns the pointer to this pointer. If the object is not found,
- //!allocates and constructs a T object or an array of T in memory,
- //!associates this with the given name and returns a pointer to the
+ //!Tries to find an object with the given name in memory. If
+ //!found, returns the pointer to this pointer. If the object is not found,
+ //!allocates and constructs a T object or an array of T in memory,
+ //!associates this with the given name and returns a pointer to the
//!created object. If an array is being constructed all objects are
//!created using the same parameters given to this function.
//!
- //!-> Returns 0 if there is no available memory
+ //!-> Returns 0 if there is no available memory
//!
//!-> If T's constructor throws, the function throws that exception.
//!
- //!Memory is freed automatically if T's constructor throws and if an
+ //!Memory is freed automatically if T's constructor throws and if an
//!array was being constructed, destructors of created objects are called
//!before freeing the memory.
template <class T>
@@ -424,54 +424,54 @@ class basic_managed_memory_impl
find_or_construct(char_ptr_holder_t name, std::nothrow_t nothrow)
{ return mp_header->template find_or_construct<T>(name, nothrow); }
- //!Creates a named array from iterators in memory
+ //!Creates a named array from iterators in memory
//!
- //!Allocates and constructs an array of T in memory,
- //!associates this with the given name and returns a pointer to the
+ //!Allocates and constructs an array of T in memory,
+ //!associates this with the given name and returns a pointer to the
//!created object. Each element in the array is created using the
//!objects returned when dereferencing iterators as parameters
//!and incrementing all iterators for each element.
//!
//!-> If the name was previously used, returns 0.
//!
- //!-> Throws boost::interprocess::bad_alloc if there is no available memory
+ //!-> Throws boost::interprocess::bad_alloc if there is no available memory
//!
//!-> If T's constructor throws, the function throws that exception.
//!
- //!Memory is freed automatically if T's constructor throws and
+ //!Memory is freed automatically if T's constructor throws and
//!destructors of created objects are called before freeing the memory.
template <class T>
typename segment_manager::template construct_iter_proxy<T>::type
construct_it(char_ptr_holder_t name)
{ return mp_header->template construct_it<T>(name); }
- //!Finds or creates a named array from iterators in memory
+ //!Finds or creates a named array from iterators in memory
//!
- //!Tries to find an object with the given name in memory. If
- //!found, returns the pointer to this pointer. If the object is not found,
- //!allocates and constructs an array of T in memory,
- //!associates this with the given name and returns a pointer to the
+ //!Tries to find an object with the given name in memory. If
+ //!found, returns the pointer to this pointer. If the object is not found,
+ //!allocates and constructs an array of T in memory,
+ //!associates this with the given name and returns a pointer to the
//!created object. Each element in the array is created using the
//!objects returned when dereferencing iterators as parameters
//!and incrementing all iterators for each element.
//!
//!-> If the name was previously used, returns 0.
//!
- //!-> Throws boost::interprocess::bad_alloc if there is no available memory
+ //!-> Throws boost::interprocess::bad_alloc if there is no available memory
//!
//!-> If T's constructor throws, the function throws that exception.
//!
- //!Memory is freed automatically if T's constructor throws and
+ //!Memory is freed automatically if T's constructor throws and
//!destructors of created objects are called before freeing the memory.
template <class T>
typename segment_manager::template construct_iter_proxy<T>::type
find_or_construct_it(char_ptr_holder_t name)
{ return mp_header->template find_or_construct_it<T>(name); }
- //!Creates a named array from iterators in memory
+ //!Creates a named array from iterators in memory
//!
- //!Allocates and constructs an array of T in memory,
- //!associates this with the given name and returns a pointer to the
+ //!Allocates and constructs an array of T in memory,
+ //!associates this with the given name and returns a pointer to the
//!created object. Each element in the array is created using the
//!objects returned when dereferencing iterators as parameters
//!and incrementing all iterators for each element.
@@ -482,19 +482,19 @@ class basic_managed_memory_impl
//!
//!-> If T's constructor throws, the function throws that exception.
//!
- //!Memory is freed automatically if T's constructor throws and
+ //!Memory is freed automatically if T's constructor throws and
//!destructors of created objects are called before freeing the memory.*/
template <class T>
typename segment_manager::template construct_iter_proxy<T>::type
construct_it(char_ptr_holder_t name, std::nothrow_t nothrow)
{ return mp_header->template construct_it<T>(name, nothrow); }
- //!Finds or creates a named array from iterators in memory
+ //!Finds or creates a named array from iterators in memory
//!
- //!Tries to find an object with the given name in memory. If
- //!found, returns the pointer to this pointer. If the object is not found,
- //!allocates and constructs an array of T in memory,
- //!associates this with the given name and returns a pointer to the
+ //!Tries to find an object with the given name in memory. If
+ //!found, returns the pointer to this pointer. If the object is not found,
+ //!allocates and constructs an array of T in memory,
+ //!associates this with the given name and returns a pointer to the
//!created object. Each element in the array is created using the
//!objects returned when dereferencing iterators as parameters
//!and incrementing all iterators for each element.
@@ -505,7 +505,7 @@ class basic_managed_memory_impl
//!
//!-> If T's constructor throws, the function throws that exception.
//!
- //!Memory is freed automatically if T's constructor throws and
+ //!Memory is freed automatically if T's constructor throws and
//!destructors of created objects are called before freeing the memory.*/
template <class T>
typename segment_manager::template construct_iter_proxy<T>::type
@@ -537,11 +537,11 @@ class basic_managed_memory_impl
//!
//!Exception Handling:
//!
- //!When deleting a dynamically object or array, the Standard
+ //!When deleting a dynamically object or array, the Standard
//!does not guarantee that dynamically allocated memory, will be released.
- //!Also, when deleting arrays, the Standard doesn't require calling
- //!destructors for the rest of the objects if for one of them the destructor
- //!terminated with an exception.
+ //!Also, when deleting arrays, the Standard doesn't require calling
+ //!destructors for the rest of the objects if for one of them the destructor
+ //!terminated with an exception.
//!
//!Destroying an object:
//!
@@ -550,13 +550,13 @@ class basic_managed_memory_impl
//!
//!Destroying an array:
//!
- //!When destroying an array, if a destructor throws, the rest of
+ //!When destroying an array, if a destructor throws, the rest of
//!destructors are called. If any of these throws, the exceptions are
//!ignored. The name association will be erased, memory will be freed and
//!the first exception will be thrown. This guarantees the unlocking of
//!mutexes and other resources.
//!
- //!For all theses reasons, classes with throwing destructors are not
+ //!For all theses reasons, classes with throwing destructors are not
//!recommended.
template <class T>
bool destroy(const CharType *name)
@@ -568,7 +568,7 @@ class basic_managed_memory_impl
//!
//!Exception Handling:
//!
- //!When deleting a dynamically object, the Standard does not
+ //!When deleting a dynamically object, the Standard does not
//!guarantee that dynamically allocated memory will be released.
//!
//!Destroying an object:
@@ -576,7 +576,7 @@ class basic_managed_memory_impl
//!If the destructor throws, the memory will be freed and that exception
//!will be thrown.
//!
- //!For all theses reasons, classes with throwing destructors are not
+ //!For all theses reasons, classes with throwing destructors are not
//!recommended for memory.
template <class T>
bool destroy(const unique_instance_t *const )
@@ -588,7 +588,7 @@ class basic_managed_memory_impl
//!
//!Exception Handling:
//!
- //!When deleting a dynamically object, the Standard does not
+ //!When deleting a dynamically object, the Standard does not
//!guarantee that dynamically allocated memory will be released.
//!
//!Destroying an object:
@@ -596,7 +596,7 @@ class basic_managed_memory_impl
//!If the destructor throws, the memory will be freed and that exception
//!will be thrown.
//!
- //!For all theses reasons, classes with throwing destructors are not
+ //!For all theses reasons, classes with throwing destructors are not
//!recommended for memory.
template <class T>
void destroy_ptr(const T *ptr)
@@ -620,13 +620,13 @@ class basic_managed_memory_impl
static size_type get_instance_length(const T *ptr)
{ return segment_manager::get_instance_length(ptr); }
- //!Preallocates needed index resources to optimize the
+ //!Preallocates needed index resources to optimize the
//!creation of "num" named objects in the memory segment.
//!Can throw boost::interprocess::bad_alloc if there is no enough memory.
void reserve_named_objects(size_type num)
{ mp_header->reserve_named_objects(num); }
- //!Preallocates needed index resources to optimize the
+ //!Preallocates needed index resources to optimize the
//!creation of "num" unique objects in the memory segment.
//!Can throw boost::interprocess::bad_alloc if there is no enough memory.
void reserve_unique_objects(size_type num)
@@ -652,7 +652,7 @@ class basic_managed_memory_impl
const_named_iterator named_begin() const
{ return mp_header->named_begin(); }
- //!Returns a constant iterator to the end of the index
+ //!Returns a constant iterator to the end of the index
//!storing the named allocations. NOT thread-safe. Never throws.
const_named_iterator named_end() const
{ return mp_header->named_end(); }
@@ -662,7 +662,7 @@ class basic_managed_memory_impl
const_unique_iterator unique_begin() const
{ return mp_header->unique_begin(); }
- //!Returns a constant iterator to the end of the index
+ //!Returns a constant iterator to the end of the index
//!storing the unique allocations. NOT thread-safe. Never throws.
const_unique_iterator unique_end() const
{ return mp_header->unique_end(); }
@@ -724,8 +724,8 @@ class create_open_func
: m_frontend(frontend), m_type(type){}
bool operator()(void *addr, typename BasicManagedMemoryImpl::size_type size, bool created) const
- {
- if(((m_type == DoOpen) && created) ||
+ {
+ if(((m_type == DoOpen) && created) ||
((m_type == DoCreate) && !created))
return false;
diff --git a/boost/interprocess/detail/managed_multi_shared_memory.hpp b/boost/interprocess/detail/managed_multi_shared_memory.hpp
index 579d1ad6ff..654c8bb9f3 100644
--- a/boost/interprocess/detail/managed_multi_shared_memory.hpp
+++ b/boost/interprocess/detail/managed_multi_shared_memory.hpp
@@ -36,7 +36,7 @@
#include <boost/assert.hpp>
//These includes needed to fulfill default template parameters of
//predeclarations in interprocess_fwd.hpp
-#include <boost/interprocess/mem_algo/rbtree_best_fit.hpp>
+#include <boost/interprocess/mem_algo/rbtree_best_fit.hpp>
#include <boost/interprocess/sync/mutex_family.hpp>
//!\file
@@ -51,25 +51,25 @@ namespace interprocess {
//-Use GetSecurityInfo?
//-Change everything to use only a shared memory object expanded via truncate()?
-//!A basic shared memory named object creation class. Initializes the
-//!shared memory segment. Inherits all basic functionality from
+//!A basic shared memory named object creation class. Initializes the
+//!shared memory segment. Inherits all basic functionality from
//!basic_managed_memory_impl<CharType, MemoryAlgorithm, IndexType>
template
<
- class CharType,
- class MemoryAlgorithm,
+ class CharType,
+ class MemoryAlgorithm,
template<class IndexConfig> class IndexType
>
-class basic_managed_multi_shared_memory
+class basic_managed_multi_shared_memory
: public ipcdetail::basic_managed_memory_impl
<CharType, MemoryAlgorithm, IndexType>
{
typedef basic_managed_multi_shared_memory
<CharType, MemoryAlgorithm, IndexType> self_t;
- typedef ipcdetail::basic_managed_memory_impl
+ typedef ipcdetail::basic_managed_memory_impl
<CharType, MemoryAlgorithm, IndexType> base_t;
-
+
typedef typename MemoryAlgorithm::void_pointer void_pointer;
typedef typename ipcdetail::
managed_open_or_create_impl<shared_memory_object, MemoryAlgorithm::Alignment> managed_impl;
@@ -91,7 +91,7 @@ class basic_managed_multi_shared_memory
// {
// public:
// segment_creator(shared_memory &shmem,
-// const char *mem_name,
+// const char *mem_name,
// const void *addr)
// : m_shmem(shmem), m_mem_name(mem_name), m_addr(addr){}
//
@@ -99,8 +99,8 @@ class basic_managed_multi_shared_memory
// {
// if(!m_shmem.create(m_mem_name, size, m_addr))
// return 0;
-// return m_shmem.get_address();
-// }
+// return m_shmem.get_address();
+// }
// private:
// shared_memory &m_shmem;
// const char *m_mem_name;
@@ -113,7 +113,7 @@ class basic_managed_multi_shared_memory
public:
typedef std::pair<void *, size_type> result_type;
typedef basic_managed_multi_shared_memory frontend_t;
- typedef typename
+ typedef typename
basic_managed_multi_shared_memory::void_pointer void_pointer;
typedef typename void_pointer::segment_group_id segment_group_id;
group_services(frontend_t *const frontend)
@@ -127,14 +127,14 @@ class basic_managed_multi_shared_memory
alloc_size += 1;
//If requested size is less than minimum, update that
- alloc_size = (m_min_segment_size > alloc_size) ?
+ alloc_size = (m_min_segment_size > alloc_size) ?
m_min_segment_size : alloc_size;
if(mp_frontend->priv_new_segment(create_open_func::DoCreate,
alloc_size, 0, permissions())){
typename shmem_list_t::value_type &m_impl = *mp_frontend->m_shmem_list.rbegin();
return result_type(m_impl.get_real_address(), m_impl.get_real_size()-1);
}*/
- return result_type(static_cast<void *>(0), 0);
+ return result_type(static_cast<void *>(0), 0);
}
virtual bool update_segments ()
@@ -166,7 +166,7 @@ class basic_managed_multi_shared_memory
struct create_open_func
{
enum type_t { DoCreate, DoOpen, DoOpenOrCreate };
- typedef typename
+ typedef typename
basic_managed_multi_shared_memory::void_pointer void_pointer;
create_open_func(self_t * const frontend,
@@ -174,8 +174,8 @@ class basic_managed_multi_shared_memory
: mp_frontend(frontend), m_type(type), m_segment_number(segment_number){}
bool operator()(void *addr, size_type size, bool created) const
- {
- if(((m_type == DoOpen) && created) ||
+ {
+ if(((m_type == DoOpen) && created) ||
((m_type == DoCreate) && !created))
return false;
segment_group_id group = mp_frontend->m_group_services.get_group();
@@ -191,7 +191,7 @@ class basic_managed_multi_shared_memory
//Check if this is the master segment
if(!m_segment_number){
//Create or open the Interprocess machinery
- if((impl_done = created ?
+ if((impl_done = created ?
mp_frontend->create_impl(addr, size) : mp_frontend->open_impl(addr, size))){
return true;
}
@@ -219,14 +219,14 @@ class basic_managed_multi_shared_memory
//!Functor to execute atomically when closing a shared memory segment.
struct close_func
{
- typedef typename
+ typedef typename
basic_managed_multi_shared_memory::void_pointer void_pointer;
close_func(self_t * const frontend)
: mp_frontend(frontend){}
void operator()(const mapped_region &region, bool last) const
- {
+ {
if(last) mp_frontend->destroy_impl();
else mp_frontend->close_impl();
}
@@ -251,7 +251,7 @@ class basic_managed_multi_shared_memory
const permissions &perm = permissions())
: m_group_services(get_this_pointer())
{
- priv_open_or_create(create_open_func::DoCreate,name, size, perm);
+ priv_open_or_create(create_open_func::DoCreate,name, size, perm);
}
basic_managed_multi_shared_memory(open_or_create_t,
@@ -273,7 +273,7 @@ class basic_managed_multi_shared_memory
{ this->priv_close(); }
private:
- bool priv_open_or_create(typename create_open_func::type_t type,
+ bool priv_open_or_create(typename create_open_func::type_t type,
const char *name,
size_type size,
const permissions &perm)
@@ -301,7 +301,7 @@ class basic_managed_multi_shared_memory
if(group){
void_pointer::delete_group(group);
}
- return false;
+ return false;
}
bool priv_new_segment(typename create_open_func::type_t type,
@@ -312,7 +312,7 @@ class basic_managed_multi_shared_memory
BOOST_TRY{
//Get the number of groups of this multi_segment group
size_type segment_id = m_shmem_list.size();
- //Format the name of the shared memory: append segment number.
+ //Format the name of the shared memory: append segment number.
boost::interprocess::basic_ovectorstream<boost::interprocess::string> formatter;
//Pre-reserve string size
size_type str_size = m_root_name.length()+10;
@@ -368,7 +368,7 @@ class basic_managed_multi_shared_memory
//!Frees resources. Never throws.
void priv_close()
- {
+ {
if(!m_shmem_list.empty()){
bool ret;
//Obtain group identifier
@@ -385,7 +385,7 @@ class basic_managed_multi_shared_memory
m_shmem_list.clear();
}
}
-
+
private:
shmem_list_t m_shmem_list;
group_services m_group_services;
diff --git a/boost/interprocess/detail/managed_open_or_create_impl.hpp b/boost/interprocess/detail/managed_open_or_create_impl.hpp
index 4d6997f330..a4f1f15817 100644
--- a/boost/interprocess/detail/managed_open_or_create_impl.hpp
+++ b/boost/interprocess/detail/managed_open_or_create_impl.hpp
@@ -48,12 +48,12 @@ class xsi_key;
template<>
struct managed_open_or_create_impl_device_id_t<xsi_shared_memory_file_wrapper>
-{
+{
typedef xsi_key type;
};
#endif //BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS
-
+
/// @endcond
namespace ipcdetail {
@@ -79,7 +79,7 @@ class managed_open_or_create_impl_device_holder<true, DeviceAbstraction>
const DeviceAbstraction &get_device() const
{ return dev; }
-
+
private:
DeviceAbstraction dev;
};
@@ -94,16 +94,16 @@ class managed_open_or_create_impl
typedef typename managed_open_or_create_impl_device_id_t<DeviceAbstraction>::type device_id_t;
typedef managed_open_or_create_impl_device_holder<StoreDevice, DeviceAbstraction> DevHolder;
enum
- {
- UninitializedSegment,
- InitializingSegment,
+ {
+ UninitializedSegment,
+ InitializingSegment,
InitializedSegment,
CorruptedSegment
};
public:
static const std::size_t
- ManagedOpenOrCreateUserOffset =
+ ManagedOpenOrCreateUserOffset =
ct_rounded_size
< sizeof(boost::uint32_t)
, MemAlignment ? (MemAlignment) :
@@ -113,7 +113,7 @@ class managed_open_or_create_impl
managed_open_or_create_impl()
{}
- managed_open_or_create_impl(create_only_t,
+ managed_open_or_create_impl(create_only_t,
const device_id_t & id,
std::size_t size,
mode_t mode,
@@ -130,7 +130,7 @@ class managed_open_or_create_impl
, null_mapped_region_function());
}
- managed_open_or_create_impl(open_only_t,
+ managed_open_or_create_impl(open_only_t,
const device_id_t & id,
mode_t mode,
const void *addr)
@@ -146,7 +146,7 @@ class managed_open_or_create_impl
}
- managed_open_or_create_impl(open_or_create_t,
+ managed_open_or_create_impl(open_or_create_t,
const device_id_t & id,
std::size_t size,
mode_t mode,
@@ -164,7 +164,7 @@ class managed_open_or_create_impl
}
template <class ConstructFunc>
- managed_open_or_create_impl(create_only_t,
+ managed_open_or_create_impl(create_only_t,
const device_id_t & id,
std::size_t size,
mode_t mode,
@@ -183,7 +183,7 @@ class managed_open_or_create_impl
}
template <class ConstructFunc>
- managed_open_or_create_impl(open_only_t,
+ managed_open_or_create_impl(open_only_t,
const device_id_t & id,
mode_t mode,
const void *addr,
@@ -200,7 +200,7 @@ class managed_open_or_create_impl
}
template <class ConstructFunc>
- managed_open_or_create_impl(open_or_create_t,
+ managed_open_or_create_impl(open_or_create_t,
const device_id_t & id,
std::size_t size,
mode_t mode,
@@ -222,10 +222,10 @@ class managed_open_or_create_impl
{ this->swap(moved); }
managed_open_or_create_impl &operator=(BOOST_RV_REF(managed_open_or_create_impl) moved)
- {
+ {
managed_open_or_create_impl tmp(boost::move(moved));
this->swap(tmp);
- return *this;
+ return *this;
}
~managed_open_or_create_impl()
@@ -298,10 +298,10 @@ class managed_open_or_create_impl
tmp.swap(dev);
}
- template <class ConstructFunc> inline
+ template <class ConstructFunc> inline
void priv_open_or_create
- (create_enum_t type,
- const device_id_t & id,
+ (create_enum_t type,
+ const device_id_t & id,
std::size_t size,
mode_t mode, const void *addr,
const permissions &perm,
@@ -396,7 +396,8 @@ class managed_open_or_create_impl
if(previous == UninitializedSegment){
try{
- construct_func(static_cast<char*>(region.get_address()) + ManagedOpenOrCreateUserOffset, size - ManagedOpenOrCreateUserOffset, true);
+ construct_func( static_cast<char*>(region.get_address()) + ManagedOpenOrCreateUserOffset
+ , size - ManagedOpenOrCreateUserOffset, true);
//All ok, just move resources to the external mapped region
m_mapped_region.swap(region);
}
diff --git a/boost/interprocess/detail/math_functions.hpp b/boost/interprocess/detail/math_functions.hpp
index 08274160db..2fc457c683 100644
--- a/boost/interprocess/detail/math_functions.hpp
+++ b/boost/interprocess/detail/math_functions.hpp
@@ -4,7 +4,7 @@
// (C) Copyright Ion Gaztanaga 2007-2011.
//
// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
+// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/interprocess for documentation.
@@ -93,7 +93,7 @@ inline std::size_t floor_log2 (std::size_t x)
std::size_t n = x;
std::size_t log2 = 0;
-
+
for(std::size_t shift = Bits >> 1; shift; shift >>= 1){
std::size_t tmp = n >> shift;
if (tmp)
diff --git a/boost/interprocess/detail/min_max.hpp b/boost/interprocess/detail/min_max.hpp
index 75aa00f87b..1f4ebdfc33 100644
--- a/boost/interprocess/detail/min_max.hpp
+++ b/boost/interprocess/detail/min_max.hpp
@@ -21,7 +21,7 @@
#include <boost/interprocess/detail/workaround.hpp>
namespace boost {
-namespace interprocess {
+namespace interprocess {
template<class T>
const T &max_value(const T &a, const T &b)
@@ -31,7 +31,7 @@ template<class T>
const T &min_value(const T &a, const T &b)
{ return a < b ? a : b; }
-} //namespace interprocess {
+} //namespace interprocess {
} //namespace boost {
#include <boost/interprocess/detail/config_end.hpp>
diff --git a/boost/interprocess/detail/mpl.hpp b/boost/interprocess/detail/mpl.hpp
index c5b6f90ef1..e2c7f52d24 100644
--- a/boost/interprocess/detail/mpl.hpp
+++ b/boost/interprocess/detail/mpl.hpp
@@ -20,7 +20,7 @@
#include <cstddef>
namespace boost {
-namespace interprocess {
+namespace interprocess {
namespace ipcdetail {
template <class T, T val>
@@ -105,24 +105,24 @@ struct if_
template <class Pair>
-struct select1st
-// : public std::unary_function<Pair, typename Pair::first_type>
+struct select1st
+// : public std::unary_function<Pair, typename Pair::first_type>
{
template<class OtherPair>
- const typename Pair::first_type& operator()(const OtherPair& x) const
+ const typename Pair::first_type& operator()(const OtherPair& x) const
{ return x.first; }
- const typename Pair::first_type& operator()(const typename Pair::first_type& x) const
+ const typename Pair::first_type& operator()(const typename Pair::first_type& x) const
{ return x; }
};
// identity is an extension: it is not part of the standard.
template <class T>
-struct identity
-// : public std::unary_function<T,T>
+struct identity
+// : public std::unary_function<T,T>
{
typedef T type;
- const T& operator()(const T& x) const
+ const T& operator()(const T& x) const
{ return x; }
};
@@ -144,8 +144,8 @@ struct ls_zeros<1>
static const std::size_t value = 0;
};
-} //namespace ipcdetail {
-} //namespace interprocess {
+} //namespace ipcdetail {
+} //namespace interprocess {
} //namespace boost {
#endif //#ifndef BOOST_INTERPROCESS_DETAIL_MPL_HPP
diff --git a/boost/interprocess/detail/multi_segment_services.hpp b/boost/interprocess/detail/multi_segment_services.hpp
index 4b6cafc742..d1451d3379 100644
--- a/boost/interprocess/detail/multi_segment_services.hpp
+++ b/boost/interprocess/detail/multi_segment_services.hpp
@@ -20,7 +20,7 @@
/*!\file
- Describes a named shared memory allocation user class.
+ Describes a named shared memory allocation user class.
*/
namespace boost {
diff --git a/boost/interprocess/detail/named_proxy.hpp b/boost/interprocess/detail/named_proxy.hpp
index 604d7881ea..c2aafed9ac 100644
--- a/boost/interprocess/detail/named_proxy.hpp
+++ b/boost/interprocess/detail/named_proxy.hpp
@@ -24,7 +24,7 @@
#include <boost/interprocess/detail/mpl.hpp>
#ifndef BOOST_INTERPROCESS_PERFECT_FORWARDING
-#include <boost/interprocess/detail/preprocessor.hpp>
+#include <boost/interprocess/detail/preprocessor.hpp>
#else
#include <boost/move/move.hpp>
#include <boost/interprocess/detail/variadic_templates_tools.hpp>
@@ -34,7 +34,7 @@
//!Describes a proxy class that implements named allocation syntax.
namespace boost {
-namespace interprocess {
+namespace interprocess {
namespace ipcdetail {
#ifdef BOOST_INTERPROCESS_PERFECT_FORWARDING
@@ -83,7 +83,7 @@ struct CtorNArg : public placement_destroy<T>
{
this->expansion_helper(++get<IdxPack>(args_)...);
}
-
+
template<class ...ExpansionArgs>
void expansion_helper(ExpansionArgs &&...)
{}
@@ -93,11 +93,11 @@ struct CtorNArg : public placement_destroy<T>
{}
tuple<Args&...> args_;
-};
+};
//!Describes a proxy class that implements named
//!allocation syntax.
-template
+template
< class SegmentManager //segment manager to construct the object
, class T //type of object to build
, bool is_iterator //passing parameters are normal object or iterators?
@@ -119,10 +119,10 @@ class named_proxy
template<class ...Args>
T *operator()(Args &&...args) const
- {
+ {
CtorNArg<T, is_iterator, Args...> &&ctor_obj = CtorNArg<T, is_iterator, Args...>
(boost::forward<Args>(args)...);
- return mp_mngr->template
+ return mp_mngr->template
generic_construct<T>(mp_name, m_num, m_find, m_dothrow, ctor_obj);
}
@@ -199,7 +199,7 @@ struct Ctor0Arg : public placement_destroy<T>
// private:
// void construct(void *mem, true_)
// { new((void*)mem)T(*m_p1, *m_p2); }
-//
+//
// void construct(void *mem, false_)
// { new((void*)mem)T(m_p1, m_p2); }
//
@@ -270,7 +270,7 @@ struct Ctor0Arg : public placement_destroy<T>
//!Describes a proxy class that implements named
//!allocation syntax.
-template
+template
< class SegmentManager //segment manager to construct the object
, class T //type of object to build
, bool is_iterator //passing parameters are normal object or iterators?
@@ -293,9 +293,9 @@ class named_proxy
//!makes a named allocation and calls the
//!default constructor
T *operator()() const
- {
+ {
Ctor0Arg<T> ctor_obj;
- return mp_mngr->template
+ return mp_mngr->template
generic_construct<T>(mp_name, m_num, m_find, m_dothrow, ctor_obj);
}
//!
@@ -322,7 +322,7 @@ class named_proxy
////////////////////////////////////////////////////////////////////////
//
// template <class P1, class P2>
- // T *operator()(P1 &p1, P2 &p2) const
+ // T *operator()(P1 &p1, P2 &p2) const
// {
// typedef Ctor2Arg
// <T, is_iterator, P1, P2>
diff --git a/boost/interprocess/detail/os_file_functions.hpp b/boost/interprocess/detail/os_file_functions.hpp
index b680c57132..08decd9bc4 100644
--- a/boost/interprocess/detail/os_file_functions.hpp
+++ b/boost/interprocess/detail/os_file_functions.hpp
@@ -32,7 +32,7 @@
# include <cstdio>
# include <dirent.h>
# if 0
-# include <sys/file.h>
+# include <sys/file.h>
# endif
# else
# error Unknown platform
@@ -58,7 +58,7 @@ typedef enum { read_only = winapi::generic_read
, read_write = winapi::generic_read | winapi::generic_write
, copy_on_write
, read_private
- , invalid_mode = 0xffff
+ , invalid_mode = 0xffff
} mode_t;
typedef enum { file_begin = winapi::file_begin
@@ -96,28 +96,28 @@ inline const char *get_temporary_path()
inline file_handle_t create_new_file
(const char *name, mode_t mode, const permissions & perm = permissions(), bool temporary = false)
-{
+{
unsigned long attr = temporary ? winapi::file_attribute_temporary : 0;
return winapi::create_file
( name, (unsigned int)mode, winapi::create_new, attr
- , (winapi::interprocess_security_attributes*)perm.get_permissions());
+ , (winapi::interprocess_security_attributes*)perm.get_permissions());
}
inline file_handle_t create_or_open_file
(const char *name, mode_t mode, const permissions & perm = permissions(), bool temporary = false)
-{
+{
unsigned long attr = temporary ? winapi::file_attribute_temporary : 0;
return winapi::create_file
( name, (unsigned int)mode, winapi::open_always, attr
- , (winapi::interprocess_security_attributes*)perm.get_permissions());
+ , (winapi::interprocess_security_attributes*)perm.get_permissions());
}
inline file_handle_t open_existing_file
(const char *name, mode_t mode, bool temporary = false)
-{
+{
unsigned long attr = temporary ? winapi::file_attribute_temporary : 0;
return winapi::create_file
- (name, (unsigned int)mode, winapi::open_existing, attr, 0);
+ (name, (unsigned int)mode, winapi::open_existing, attr, 0);
}
inline bool delete_file(const char *name)
@@ -140,7 +140,7 @@ inline bool truncate_file (file_handle_t hnd, std::size_t size)
if(offset_t(size) > filesize){
if(!winapi::set_file_pointer_ex(hnd, filesize, 0, winapi::file_begin)){
return false;
- }
+ }
//We will write zeros in the end of the file
//since set_end_of_file does not guarantee this
for(std::size_t remaining = size - filesize, write_size = 0
@@ -177,7 +177,7 @@ inline bool get_file_pointer(file_handle_t hnd, offset_t &off)
{ return winapi::set_file_pointer_ex(hnd, 0, &off, winapi::file_current); }
inline bool write_file(file_handle_t hnd, const void *data, std::size_t numdata)
-{
+{
unsigned long written;
return 0 != winapi::write_file(hnd, data, (unsigned long)numdata, &written, 0);
}
@@ -189,9 +189,9 @@ inline bool close_file(file_handle_t hnd)
{ return 0 != winapi::close_handle(hnd); }
inline bool acquire_file_lock(file_handle_t hnd)
-{
+{
static winapi::interprocess_overlapped overlapped;
- const unsigned long len = 0xffffffff;
+ const unsigned long len = ~((unsigned long)(0u));
// winapi::interprocess_overlapped overlapped;
// std::memset(&overlapped, 0, sizeof(overlapped));
return winapi::lock_file_ex
@@ -199,44 +199,44 @@ inline bool acquire_file_lock(file_handle_t hnd)
}
inline bool try_acquire_file_lock(file_handle_t hnd, bool &acquired)
-{
- const unsigned long len = 0xffffffff;
+{
+ const unsigned long len = ~((unsigned long)(0u));
winapi::interprocess_overlapped overlapped;
std::memset(&overlapped, 0, sizeof(overlapped));
if(!winapi::lock_file_ex
- (hnd, winapi::lockfile_exclusive_lock | winapi::lockfile_fail_immediately,
+ (hnd, winapi::lockfile_exclusive_lock | winapi::lockfile_fail_immediately,
0, len, len, &overlapped)){
- return winapi::get_last_error() == winapi::error_lock_violation ?
+ return winapi::get_last_error() == winapi::error_lock_violation ?
acquired = false, true : false;
-
+
}
return (acquired = true);
}
inline bool release_file_lock(file_handle_t hnd)
-{
- const unsigned long len = 0xffffffff;
+{
+ const unsigned long len = ~((unsigned long)(0u));
winapi::interprocess_overlapped overlapped;
std::memset(&overlapped, 0, sizeof(overlapped));
return winapi::unlock_file_ex(hnd, 0, len, len, &overlapped);
}
inline bool acquire_file_lock_sharable(file_handle_t hnd)
-{
- const unsigned long len = 0xffffffff;
+{
+ const unsigned long len = ~((unsigned long)(0u));
winapi::interprocess_overlapped overlapped;
std::memset(&overlapped, 0, sizeof(overlapped));
return winapi::lock_file_ex(hnd, 0, 0, len, len, &overlapped);
}
inline bool try_acquire_file_lock_sharable(file_handle_t hnd, bool &acquired)
-{
- const unsigned long len = 0xffffffff;
+{
+ const unsigned long len = ~((unsigned long)(0u));
winapi::interprocess_overlapped overlapped;
std::memset(&overlapped, 0, sizeof(overlapped));
if(!winapi::lock_file_ex
(hnd, winapi::lockfile_fail_immediately, 0, len, len, &overlapped)){
- return winapi::get_last_error() == winapi::error_lock_violation ?
+ return winapi::get_last_error() == winapi::error_lock_violation ?
acquired = false, true : false;
}
return (acquired = true);
@@ -367,7 +367,7 @@ typedef enum { read_only = O_RDONLY
, read_write = O_RDWR
, copy_on_write
, read_private
- , invalid_mode = 0xffff
+ , invalid_mode = 0xffff
} mode_t;
typedef enum { file_begin = SEEK_SET
@@ -406,7 +406,7 @@ inline const char *get_temporary_path()
inline file_handle_t create_new_file
(const char *name, mode_t mode, const permissions & perm = permissions(), bool temporary = false)
-{
+{
(void)temporary;
int ret = ::open(name, ((int)mode) | O_EXCL | O_CREAT, perm.get_permissions());
if(ret >= 0){
@@ -439,7 +439,7 @@ inline file_handle_t create_or_open_file
inline file_handle_t open_existing_file
(const char *name, mode_t mode, bool temporary = false)
-{
+{
(void)temporary;
return ::open(name, (int)mode);
}
@@ -459,7 +459,7 @@ inline bool truncate_file (file_handle_t hnd, std::size_t size)
}
inline bool get_file_size(file_handle_t hnd, offset_t &size)
-{
+{
struct stat data;
bool ret = 0 == ::fstat(hnd, &data);
if(ret){
@@ -472,7 +472,7 @@ inline bool set_file_pointer(file_handle_t hnd, offset_t off, file_pos_t pos)
{ return ((off_t)(-1)) != ::lseek(hnd, off, (int)pos); }
inline bool get_file_pointer(file_handle_t hnd, offset_t &off)
-{
+{
off = ::lseek(hnd, 0, SEEK_CUR);
return off != ((off_t)-1);
}
@@ -522,7 +522,7 @@ inline bool release_file_lock(file_handle_t hnd)
}
inline bool acquire_file_lock_sharable(file_handle_t hnd)
-{
+{
struct ::flock lock;
lock.l_type = F_RDLCK;
lock.l_whence = SEEK_SET;
@@ -532,7 +532,7 @@ inline bool acquire_file_lock_sharable(file_handle_t hnd)
}
inline bool try_acquire_file_lock_sharable(file_handle_t hnd, bool &acquired)
-{
+{
struct flock lock;
lock.l_type = F_RDLCK;
lock.l_whence = SEEK_SET;
@@ -540,7 +540,7 @@ inline bool try_acquire_file_lock_sharable(file_handle_t hnd, bool &acquired)
lock.l_len = 0;
int ret = ::fcntl(hnd, F_SETLK, &lock);
if(ret == -1){
- return (errno == EAGAIN || errno == EACCES) ?
+ return (errno == EAGAIN || errno == EACCES) ?
acquired = false, true : false;
}
return (acquired = true);
@@ -601,7 +601,7 @@ inline bool delete_subdirectories_recursive
|| (de->d_name[1] == '.' && de->d_name[2] == '\0' )) ){
continue;
}
- if(dont_delete_this && std::strcmp(dont_delete_this, de->d_name) == 0){
+ if(dont_delete_this && std::strcmp(dont_delete_this, de->d_name) == 0){
continue;
}
fn = refcstrRootDirectory;
diff --git a/boost/interprocess/detail/os_thread_functions.hpp b/boost/interprocess/detail/os_thread_functions.hpp
index e49e82c8e0..8d769fc4e9 100644
--- a/boost/interprocess/detail/os_thread_functions.hpp
+++ b/boost/interprocess/detail/os_thread_functions.hpp
@@ -104,7 +104,7 @@ typedef pthread_t OS_thread_id_t;
typedef pid_t OS_process_id_t;
struct OS_systemwide_thread_id_t
-{
+{
OS_systemwide_thread_id_t()
: pid(), tid()
{}
@@ -153,7 +153,7 @@ inline OS_thread_id_t get_current_thread_id()
{ return ::pthread_self(); }
inline OS_thread_id_t get_invalid_thread_id()
-{
+{
static pthread_t invalid_id;
return invalid_id;
}
diff --git a/boost/interprocess/detail/pointer_type.hpp b/boost/interprocess/detail/pointer_type.hpp
index 7c45be085e..549b23fa6c 100644
--- a/boost/interprocess/detail/pointer_type.hpp
+++ b/boost/interprocess/detail/pointer_type.hpp
@@ -61,11 +61,11 @@ template <class T, class D>
struct pointer_type
{
typedef typename pointer_type_imp::pointer_type<T,
- typename ipcdetail::remove_reference<D>::type>::type type;
+ typename remove_reference<D>::type>::type type;
};
} //namespace ipcdetail {
-} //namespace interprocess {
+} //namespace interprocess {
} //namespace boost {
#include <boost/interprocess/detail/config_end.hpp>
diff --git a/boost/interprocess/detail/portable_intermodule_singleton.hpp b/boost/interprocess/detail/portable_intermodule_singleton.hpp
new file mode 100644
index 0000000000..eb2a13e104
--- /dev/null
+++ b/boost/interprocess/detail/portable_intermodule_singleton.hpp
@@ -0,0 +1,356 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2009-2011. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/interprocess for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTERPROCESS_PORTABLE_INTERMODULE_SINGLETON_HPP
+#define BOOST_INTERPROCESS_PORTABLE_INTERMODULE_SINGLETON_HPP
+
+#if defined(_MSC_VER)&&(_MSC_VER>=1200)
+#pragma once
+#endif
+
+#include <boost/interprocess/detail/config_begin.hpp>
+#include <boost/interprocess/detail/workaround.hpp>
+
+#include <boost/interprocess/detail/managed_global_memory.hpp>
+#include <boost/interprocess/detail/intermodule_singleton_common.hpp>
+#include <boost/interprocess/shared_memory_object.hpp>
+#include <boost/interprocess/detail/atomic.hpp>
+#include <boost/interprocess/detail/os_thread_functions.hpp>
+#include <boost/interprocess/detail/tmp_dir_helpers.hpp>
+#include <boost/interprocess/detail/os_file_functions.hpp>
+#include <boost/interprocess/detail/file_locking_helpers.hpp>
+#include <boost/assert.hpp>
+#include <cstddef>
+#include <cstdio>
+#include <cstring>
+#include <string>
+
+namespace boost{
+namespace interprocess{
+namespace ipcdetail{
+
+typedef basic_managed_global_memory<shared_memory_object, true> managed_global_memory;
+
+namespace intermodule_singleton_helpers {
+
+static void create_tmp_subdir_and_get_pid_based_filepath
+ (const char *subdir_name, const char *file_prefix, OS_process_id_t pid, std::string &s, bool creation_time = false)
+{
+ //Let's create a lock file for each process gmem that will mark if
+ //the process is alive or not
+ create_tmp_and_clean_old(s);
+ s += "/";
+ s += subdir_name;
+ if(!open_or_create_directory(s.c_str())){
+ throw interprocess_exception(error_info(system_error_code()));
+ }
+ s += "/";
+ s += file_prefix;
+ if(creation_time){
+ std::string sstamp;
+ get_pid_creation_time_str(sstamp);
+ s += sstamp;
+ }
+ else{
+ pid_str_t pid_str;
+ get_pid_str(pid_str, pid);
+ s += pid_str;
+ }
+}
+
+static bool check_if_filename_complies_with_pid
+ (const char *filename, const char *prefix, OS_process_id_t pid, std::string &file_suffix, bool creation_time = false)
+{
+ //Check if filename complies with lock file name pattern
+ std::string fname(filename);
+ std::string fprefix(prefix);
+ if(fname.size() <= fprefix.size()){
+ return false;
+ }
+ fname.resize(fprefix.size());
+ if(fname != fprefix){
+ return false;
+ }
+
+ //If not our lock file, delete it if we can lock it
+ fname = filename;
+ fname.erase(0, fprefix.size());
+ pid_str_t pid_str;
+ get_pid_str(pid_str, pid);
+ file_suffix = pid_str;
+ if(creation_time){
+ std::size_t p = fname.find('_');
+ if (p == std::string::npos){
+ return false;
+ }
+ std::string save_suffix(fname);
+ fname.erase(p);
+ fname.swap(file_suffix);
+ bool ret = (file_suffix == fname);
+ file_suffix.swap(save_suffix);
+ return ret;
+ }
+ else{
+ fname.swap(file_suffix);
+ return (file_suffix == fname);
+ }
+}
+
+template<>
+struct thread_safe_global_map_dependant<managed_global_memory>
+{
+ private:
+ static const int GMemMarkToBeRemoved = -1;
+ static const int GMemNotPresent = -2;
+
+ static const char *get_lock_file_subdir_name()
+ { return "gmem"; }
+
+ static const char *get_lock_file_base_name()
+ { return "lck"; }
+
+ static void create_and_get_singleton_lock_file_path(std::string &s)
+ {
+ create_tmp_subdir_and_get_pid_based_filepath
+ (get_lock_file_subdir_name(), get_lock_file_base_name(), get_current_process_id(), s, true);
+ }
+
+ struct gmem_erase_func
+ {
+ gmem_erase_func(const char *shm_name, const char *singleton_lock_file_path, managed_global_memory & shm)
+ :shm_name_(shm_name), singleton_lock_file_path_(singleton_lock_file_path), shm_(shm)
+ {}
+
+ void operator()()
+ {
+ locking_file_serial_id *pserial_id = shm_.find<locking_file_serial_id>("lock_file_fd").first;
+ if(pserial_id){
+ pserial_id->fd = GMemMarkToBeRemoved;
+ }
+ delete_file(singleton_lock_file_path_);
+ shared_memory_object::remove(shm_name_);
+ }
+
+ const char * const shm_name_;
+ const char * const singleton_lock_file_path_;
+ managed_global_memory & shm_;
+ };
+
+ //This function applies shared memory erasure logic based on the passed lock file.
+ static void apply_gmem_erase_logic(const char *filepath, const char *filename)
+ {
+ int fd = GMemMarkToBeRemoved;
+ try{
+ std::string str;
+ //If the filename is current process lock file, then avoid it
+ if(check_if_filename_complies_with_pid
+ (filename, get_lock_file_base_name(), get_current_process_id(), str, true)){
+ return;
+ }
+ //Open and lock the other process' lock file
+ fd = try_open_and_lock_file(filepath);
+ if(fd < 0){
+ return;
+ }
+ //If done, then the process is dead so take global shared memory name
+ //(the name is based on the lock file name) and try to apply erasure logic
+ str.insert(0, get_map_base_name());
+ try{
+ managed_global_memory shm(open_only, str.c_str());
+ gmem_erase_func func(str.c_str(), filepath, shm);
+ shm.try_atomic_func(func);
+ }
+ catch(interprocess_exception &e){
+ //If shared memory is not found erase the lock file
+ if(e.get_error_code() == not_found_error){
+ delete_file(filepath);
+ }
+ }
+ }
+ catch(...){
+
+ }
+ if(fd >= 0){
+ close_lock_file(fd);
+ }
+ }
+
+ public:
+
+ static bool remove_old_gmem()
+ {
+ std::string refcstrRootDirectory;
+ tmp_folder(refcstrRootDirectory);
+ refcstrRootDirectory += "/";
+ refcstrRootDirectory += get_lock_file_subdir_name();
+ return for_each_file_in_dir(refcstrRootDirectory.c_str(), apply_gmem_erase_logic);
+ }
+
+ struct lock_file_logic
+ {
+ lock_file_logic(managed_global_memory &shm)
+ : mshm(shm)
+ { shm.atomic_func(*this); }
+
+ void operator()(void)
+ {
+ retry_with_new_map = false;
+
+ //First find the file locking descriptor id
+ locking_file_serial_id *pserial_id =
+ mshm.find<locking_file_serial_id>("lock_file_fd").first;
+
+ int fd;
+ //If not found schedule a creation
+ if(!pserial_id){
+ fd = GMemNotPresent;
+ }
+ //Else get it
+ else{
+ fd = pserial_id->fd;
+ }
+ //If we need to create a new one, do it
+ if(fd == GMemNotPresent){
+ std::string lck_str;
+ //Create a unique current pid based lock file path
+ create_and_get_singleton_lock_file_path(lck_str);
+ //Open or create and lock file
+ int fd = open_or_create_and_lock_file(lck_str.c_str());
+ //If failed, write a bad file descriptor to notify other modules that
+ //something was wrong and unlink shared memory. Mark the function object
+ //to tell caller to retry with another shared memory
+ if(fd < 0){
+ this->register_lock_file(GMemMarkToBeRemoved);
+ std::string s;
+ get_map_name(s);
+ shared_memory_object::remove(s.c_str());
+ retry_with_new_map = true;
+ }
+ //If successful, register the file descriptor
+ else{
+ this->register_lock_file(fd);
+ }
+ }
+ //If the fd was invalid (maybe a previous try failed) notify caller that
+ //should retry creation logic, since this shm might have been already
+ //unlinked since the shm was removed
+ else if (fd == GMemMarkToBeRemoved){
+ retry_with_new_map = true;
+ }
+ //If the stored fd is not valid (a open fd, a normal file with the
+ //expected size, or does not have the same file id number,
+ //then it's an old shm from an old process with the same pid.
+ //If that's the case, mark it as invalid
+ else if(!is_valid_fd(fd) ||
+ !is_normal_file(fd) ||
+ 0 != get_size(fd) ||
+ !compare_file_serial(fd, *pserial_id)){
+ pserial_id->fd = GMemMarkToBeRemoved;
+ std::string s;
+ get_map_name(s);
+ shared_memory_object::remove(s.c_str());
+ retry_with_new_map = true;
+ }
+ else{
+ //If the lock file is ok, increment reference count of
+ //attached modules to shared memory
+ atomic_inc32(&pserial_id->modules_attached_to_gmem_count);
+ }
+ }
+
+ bool retry() const { return retry_with_new_map; }
+
+ private:
+ locking_file_serial_id * register_lock_file(int fd)
+ {
+ locking_file_serial_id *pinfo = mshm.construct<locking_file_serial_id>("lock_file_fd")();
+ fill_file_serial_id(fd, *pinfo);
+ return pinfo;
+ }
+
+ managed_global_memory &mshm;
+ bool retry_with_new_map;
+ };
+
+ static void construct_map(void *addr)
+ {
+ std::string s;
+ intermodule_singleton_helpers::get_map_name(s);
+ const char *MapName = s.c_str();
+ const std::size_t MapSize = intermodule_singleton_helpers::get_map_size();;
+ ::new (addr)managed_global_memory(open_or_create, MapName, MapSize);
+ }
+
+ struct unlink_map_logic
+ {
+ unlink_map_logic(managed_global_memory &mshm)
+ : mshm_(mshm)
+ { mshm.atomic_func(*this); }
+
+ void operator()()
+ {
+ locking_file_serial_id *pserial_id =
+ mshm_.find<locking_file_serial_id>
+ ("lock_file_fd").first;
+ BOOST_ASSERT(0 != pserial_id);
+ if(1 == atomic_dec32(&pserial_id->modules_attached_to_gmem_count)){
+ int fd = pserial_id->fd;
+ if(fd > 0){
+ pserial_id->fd = GMemMarkToBeRemoved;
+ std::string s;
+ create_and_get_singleton_lock_file_path(s);
+ delete_file(s.c_str());
+ close_lock_file(fd);
+ intermodule_singleton_helpers::get_map_name(s);
+ shared_memory_object::remove(s.c_str());
+ }
+ }
+ }
+
+ private:
+ managed_global_memory &mshm_;
+ };
+
+ static ref_count_ptr *find(managed_global_memory &map, const char *name)
+ {
+ return map.find<ref_count_ptr>(name).first;
+ }
+
+ static ref_count_ptr *insert(managed_global_memory &map, const char *name, const ref_count_ptr &ref)
+ {
+ return map.construct<ref_count_ptr>(name)(ref);
+ }
+
+ static bool erase(managed_global_memory &map, const char *name)
+ {
+ return map.destroy<ref_count_ptr>(name);
+ }
+
+ template<class F>
+ static void atomic_func(managed_global_memory &map, F &f)
+ {
+ map.atomic_func(f);
+ }
+};
+
+} //namespace intermodule_singleton_helpers {
+
+template<typename C, bool LazyInit = true, bool Phoenix = true>
+class portable_intermodule_singleton
+ : public intermodule_singleton_impl<C, LazyInit, Phoenix, managed_global_memory>
+{};
+
+} //namespace ipcdetail{
+} //namespace interprocess{
+} //namespace boost{
+
+#include <boost/interprocess/detail/config_end.hpp>
+
+#endif //#ifndef BOOST_INTERPROCESS_PORTABLE_INTERMODULE_SINGLETON_HPP
diff --git a/boost/interprocess/detail/posix_time_types_wrk.hpp b/boost/interprocess/detail/posix_time_types_wrk.hpp
index c1276f0f26..e4df85a572 100644
--- a/boost/interprocess/detail/posix_time_types_wrk.hpp
+++ b/boost/interprocess/detail/posix_time_types_wrk.hpp
@@ -15,7 +15,7 @@
#ifdef _WIN32
#ifndef WIN32_LEAN_AND_MEAN
-#define WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN
#define BOOST_INTERPROCESS_WIN32_LEAN_AND_MEAN
#endif //#ifndef WIN32_LEAN_AND_MEAN
#endif //#ifdef _WIN32
diff --git a/boost/interprocess/detail/preprocessor.hpp b/boost/interprocess/detail/preprocessor.hpp
index 4af2686452..47b591c901 100644
--- a/boost/interprocess/detail/preprocessor.hpp
+++ b/boost/interprocess/detail/preprocessor.hpp
@@ -21,7 +21,7 @@
#error "This file is not needed when perfect forwarding is available"
#endif
-#include <boost/preprocessor/iteration/local.hpp>
+#include <boost/preprocessor/iteration/local.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/repetition/enum.hpp>
@@ -57,28 +57,30 @@
#ifndef BOOST_NO_RVALUE_REFERENCES
-#ifdef BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES
+ #if defined(BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG)
-#define BOOST_INTERPROCESS_PP_PARAM_INIT(z, n, data) \
- BOOST_PP_CAT(m_p, n) (BOOST_INTERPROCESS_MOVE_NAMESPACE::forward< BOOST_PP_CAT(P, n) >( BOOST_PP_CAT(p, n) )) \
-//!
+ #define BOOST_INTERPROCESS_PP_PARAM_INIT(z, n, data) \
+ BOOST_PP_CAT(m_p, n) (BOOST_PP_CAT(p, n)) \
+ //!
-#else
-#define BOOST_INTERPROCESS_PP_PARAM_INIT(z, n, data) \
- BOOST_PP_CAT(m_p, n) (BOOST_PP_CAT(p, n)) \
-//!
+ #else //#if defined(BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG)
-#endif
+ #define BOOST_INTERPROCESS_PP_PARAM_INIT(z, n, data) \
+ BOOST_PP_CAT(m_p, n) (::boost::forward< BOOST_PP_CAT(P, n) >( BOOST_PP_CAT(p, n) )) \
+ //!
-#else
-#define BOOST_INTERPROCESS_PP_PARAM_INIT(z, n, data) \
- BOOST_PP_CAT(m_p, n) (const_cast<BOOST_PP_CAT(P, n) &>(BOOST_PP_CAT(p, n))) \
-//!
+ #endif //#if defined(BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG)
+
+#else //#ifndef BOOST_NO_RVALUE_REFERENCES
+
+ #define BOOST_INTERPROCESS_PP_PARAM_INIT(z, n, data) \
+ BOOST_PP_CAT(m_p, n) (const_cast<BOOST_PP_CAT(P, n) &>(BOOST_PP_CAT(p, n))) \
+ //!
#endif
#define BOOST_INTERPROCESS_PP_PARAM_INC(z, n, data) \
- BOOST_PP_CAT(++m_p, n) \
+ BOOST_PP_CAT(++m_p, n) \
//!
#ifndef BOOST_NO_RVALUE_REFERENCES
diff --git a/boost/interprocess/detail/ptime_wrk.hpp b/boost/interprocess/detail/ptime_wrk.hpp
index 4a4709e3a8..8cda3a445d 100644
--- a/boost/interprocess/detail/ptime_wrk.hpp
+++ b/boost/interprocess/detail/ptime_wrk.hpp
@@ -15,7 +15,7 @@
#ifdef _WIN32
#ifndef WIN32_LEAN_AND_MEAN
-#define WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN
#define BOOST_INTERPROCESS_WIN32_LEAN_AND_MEAN
#endif //#ifndef WIN32_LEAN_AND_MEAN
#endif //#ifdef _WIN32
diff --git a/boost/interprocess/detail/robust_emulation.hpp b/boost/interprocess/detail/robust_emulation.hpp
index b2097d0ad7..1feb42dc35 100644
--- a/boost/interprocess/detail/robust_emulation.hpp
+++ b/boost/interprocess/detail/robust_emulation.hpp
@@ -68,7 +68,7 @@ inline void robust_lock_path(std::string &s)
inline void create_and_get_robust_lock_file_path(std::string &s, OS_process_id_t pid)
{
- file_locking_helpers::create_tmp_subdir_and_get_pid_based_filepath
+ intermodule_singleton_helpers::create_tmp_subdir_and_get_pid_based_filepath
(robust_lock_subdir_path(), robust_lock_prefix(), pid, s);
}
@@ -132,7 +132,7 @@ class robust_mutex_lock_file
throw interprocess_exception(other_error, "Robust emulation robust_mutex_lock_file constructor failed: create_file filed with unexpected error");
}
}
- }
+ }
~robust_mutex_lock_file()
{
@@ -154,7 +154,7 @@ class robust_mutex_lock_file
{
std::string pid_str;
//If the lock file is not our own lock file, then try to do the cleanup
- if(!file_locking_helpers::check_if_filename_complies_with_pid
+ if(!intermodule_singleton_helpers::check_if_filename_complies_with_pid
(filename, robust_lock_prefix(), get_current_process_id(), pid_str)){
remove_if_can_lock_file(filepath);
}
@@ -324,7 +324,7 @@ inline bool robust_spin_mutex<Mutex>::robust_check()
return false;
}
atomic_write32(&this->state, fixing_state);
- return true;
+ return true;
}
template<class Mutex>
@@ -424,7 +424,7 @@ template<class Mutex>
inline bool robust_spin_mutex<Mutex>::lock_own_unique_file()
{
//This function forces instantiation of the singleton
- robust_emulation_helpers::robust_mutex_lock_file* dummy =
+ robust_emulation_helpers::robust_mutex_lock_file* dummy =
&ipcdetail::intermodule_singleton
<robust_emulation_helpers::robust_mutex_lock_file>::get();
return dummy != 0;
diff --git a/boost/interprocess/detail/segment_manager_helper.hpp b/boost/interprocess/detail/segment_manager_helper.hpp
index ea820b3881..2b715d8f5e 100644
--- a/boost/interprocess/detail/segment_manager_helper.hpp
+++ b/boost/interprocess/detail/segment_manager_helper.hpp
@@ -91,7 +91,7 @@ struct block_header
, m_num_char((unsigned short)num_char)
, m_value_alignment((unsigned char)value_alignment)
, m_alloc_type_sizeof_char
- ( (alloc_type << 5u) |
+ ( (alloc_type << 5u) |
((unsigned char)sizeof_char & 0x1F) )
{};
@@ -130,7 +130,7 @@ struct block_header
template<class CharType>
CharType *name() const
- {
+ {
return const_cast<CharType*>(reinterpret_cast<const CharType*>
(reinterpret_cast<const char*>(this) + name_offset()));
}
@@ -139,7 +139,7 @@ struct block_header
{ return m_num_char; }
size_type name_offset() const
- {
+ {
return this->value_offset() + get_rounded_size(size_type(m_value_bytes), size_type(sizeof_char()));
}
@@ -157,7 +157,7 @@ struct block_header
bool less_comp(const block_header<size_type> &b) const
{
return m_num_char < b.m_num_char ||
- (m_num_char < b.m_num_char &&
+ (m_num_char < b.m_num_char &&
std::char_traits<CharType>::compare
(name<CharType>(), b.name<CharType>(), m_num_char) < 0);
}
@@ -175,10 +175,10 @@ struct block_header
{ return block_header_from_value(value, sizeof(T), ::boost::alignment_of<T>::value); }
static block_header<size_type> *block_header_from_value(const void *value, std::size_t sz, std::size_t algn)
- {
- block_header * hdr =
+ {
+ block_header * hdr =
const_cast<block_header*>
- (reinterpret_cast<const block_header*>(reinterpret_cast<const char*>(value) -
+ (reinterpret_cast<const block_header*>(reinterpret_cast<const char*>(value) -
get_rounded_size(sizeof(block_header), algn)));
(void)sz;
//Some sanity checks
@@ -189,9 +189,9 @@ struct block_header
template<class Header>
static block_header<size_type> *from_first_header(Header *header)
- {
- block_header<size_type> * hdr =
- reinterpret_cast<block_header<size_type>*>(reinterpret_cast<char*>(header) +
+ {
+ block_header<size_type> * hdr =
+ reinterpret_cast<block_header<size_type>*>(reinterpret_cast<char*>(header) +
get_rounded_size(size_type(sizeof(Header)), size_type(::boost::alignment_of<block_header<size_type> >::value)));
//Some sanity checks
return hdr;
@@ -199,9 +199,9 @@ struct block_header
template<class Header>
static Header *to_first_header(block_header<size_type> *bheader)
- {
- Header * hdr =
- reinterpret_cast<Header*>(reinterpret_cast<char*>(bheader) -
+ {
+ Header * hdr =
+ reinterpret_cast<Header*>(reinterpret_cast<char*>(bheader) -
get_rounded_size(size_type(sizeof(Header)), size_type(::boost::alignment_of<block_header<size_type> >::value)));
//Some sanity checks
return hdr;
@@ -311,15 +311,15 @@ template<class CharType>
class char_ptr_holder
{
public:
- char_ptr_holder(const CharType *name)
+ char_ptr_holder(const CharType *name)
: m_name(name)
{}
- char_ptr_holder(const anonymous_instance_t *)
+ char_ptr_holder(const anonymous_instance_t *)
: m_name(static_cast<CharType*>(0))
{}
- char_ptr_holder(const unique_instance_t *)
+ char_ptr_holder(const unique_instance_t *)
: m_name(reinterpret_cast<CharType*>(-1))
{}
@@ -330,7 +330,7 @@ class char_ptr_holder
const CharType *m_name;
};
-//!The key of the the named allocation information index. Stores an offset pointer
+//!The key of the the named allocation information index. Stores an offset pointer
//!to a null terminated string and the length of the string to speed up sorting
template<class CharT, class VoidPointer>
struct index_key
@@ -356,9 +356,9 @@ struct index_key
//!Less than function for index ordering
bool operator < (const index_key & right) const
{
- return (m_len < right.m_len) ||
- (m_len == right.m_len &&
- std::char_traits<char_type>::compare
+ return (m_len < right.m_len) ||
+ (m_len == right.m_len &&
+ std::char_traits<char_type>::compare
(to_raw_pointer(mp_str)
,to_raw_pointer(right.mp_str), m_len) < 0);
}
@@ -366,8 +366,8 @@ struct index_key
//!Equal to function for index ordering
bool operator == (const index_key & right) const
{
- return m_len == right.m_len &&
- std::char_traits<char_type>::compare
+ return m_len == right.m_len &&
+ std::char_traits<char_type>::compare
(to_raw_pointer(mp_str),
to_raw_pointer(right.mp_str), m_len) == 0;
}
@@ -478,14 +478,14 @@ struct segment_manager_iterator_transform
, segment_manager_iterator_value_adaptor<Iterator, intrusive> >
{
typedef segment_manager_iterator_value_adaptor<Iterator, intrusive> result_type;
-
+
result_type operator()(const typename Iterator::value_type &arg) const
{ return result_type(arg); }
};
} //namespace ipcdetail {
-//These pointers are the ones the user will use to
+//These pointers are the ones the user will use to
//indicate previous allocation types
static const ipcdetail::anonymous_instance_t * anonymous_instance = 0;
static const ipcdetail::unique_instance_t * unique_instance = 0;
diff --git a/boost/interprocess/detail/tmp_dir_helpers.hpp b/boost/interprocess/detail/tmp_dir_helpers.hpp
index 38aafb2beb..28e7341406 100644
--- a/boost/interprocess/detail/tmp_dir_helpers.hpp
+++ b/boost/interprocess/detail/tmp_dir_helpers.hpp
@@ -18,80 +18,87 @@
#include <boost/interprocess/exceptions.hpp>
#include <string>
-#if defined(BOOST_INTERPROCESS_WINDOWS)
- //#define BOOST_INTERPROCESS_HAS_WINDOWS_KERNEL_BOOTTIME
- //#define BOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME
- //#include <boost/interprocess/detail/win32_api.hpp>
-#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
- //#include <sys/sysctl.h>
- //#if defined(CTL_KERN) && defined (KERN_BOOTTIME)
- //#define BOOST_INTERPROCESS_HAS_BSD_KERNEL_BOOTTIME
- //#define BOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME
- //#endif
+#if defined(BOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME) && defined(BOOST_INTERPROCESS_WINDOWS)
+ #include <boost/interprocess/detail/windows_intermodule_singleton.hpp>
#endif
namespace boost {
namespace interprocess {
namespace ipcdetail {
-#if defined (BOOST_INTERPROCESS_HAS_WINDOWS_KERNEL_BOOTTIME)
-inline void get_bootstamp(std::string &s, bool add = false)
-{
- std::string bootstamp;
- winapi::get_last_bootup_time(bootstamp);
- if(add){
- s += bootstamp;
- }
- else{
- s.swap(bootstamp);
- }
-}
-#elif defined(BOOST_INTERPROCESS_HAS_BSD_KERNEL_BOOTTIME)
-inline void get_bootstamp(std::string &s, bool add = false)
-{
- // FreeBSD specific: sysctl "kern.boottime"
- int request[2] = { CTL_KERN, KERN_BOOTTIME };
- struct ::timeval result;
- std::size_t result_len = sizeof result;
-
- if (::sysctl (request, 2, &result, &result_len, NULL, 0) < 0)
- return;
-
- char bootstamp_str[256];
-
- const char Characters [] =
- { '0', '1', '2', '3', '4', '5', '6', '7'
- , '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
-
- std::size_t char_counter = 0;
- //32 bit values to allow 32 and 64 bit process IPC
- boost::uint32_t fields[2] = { boost::uint32_t(result.tv_sec), boost::uint32_t(result.tv_usec) };
- for(std::size_t field = 0; field != 2; ++field){
- for(std::size_t i = 0; i != sizeof(fields[0]); ++i){
- const char *ptr = (const char *)&fields[field];
- bootstamp_str[char_counter++] = Characters[(ptr[i]&0xF0)>>4];
- bootstamp_str[char_counter++] = Characters[(ptr[i]&0x0F)];
+#if defined(BOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME)
+ #if defined(BOOST_INTERPROCESS_WINDOWS)
+ //This type will initialize the stamp
+ struct windows_bootstamp
+ {
+ windows_bootstamp()
+ {
+ winapi::get_last_bootup_time(stamp);
+ }
+ //Use std::string. Even if this will be constructed in shared memory, all
+ //modules/dlls are from this process so internal raw pointers to heap are always valid
+ std::string stamp;
+ };
+
+ inline void get_bootstamp(std::string &s, bool add = false)
+ {
+ const windows_bootstamp &bootstamp = windows_intermodule_singleton<windows_bootstamp>::get();
+ if(add){
+ s += bootstamp.stamp;
+ }
+ else{
+ s = bootstamp.stamp;
+ }
}
- }
- bootstamp_str[char_counter] = 0;
- if(add){
- s += bootstamp_str;
- }
- else{
- s = bootstamp_str;
- }
-}
-#endif
+ #elif defined(BOOST_INTERPROCESS_HAS_BSD_KERNEL_BOOTTIME)
+ inline void get_bootstamp(std::string &s, bool add = false)
+ {
+ // FreeBSD specific: sysctl "kern.boottime"
+ int request[2] = { CTL_KERN, KERN_BOOTTIME };
+ struct ::timeval result;
+ std::size_t result_len = sizeof result;
+
+ if (::sysctl (request, 2, &result, &result_len, NULL, 0) < 0)
+ return;
+
+ char bootstamp_str[256];
+
+ const char Characters [] =
+ { '0', '1', '2', '3', '4', '5', '6', '7'
+ , '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
+
+ std::size_t char_counter = 0;
+ //32 bit values to allow 32 and 64 bit process IPC
+ boost::uint32_t fields[2] = { boost::uint32_t(result.tv_sec), boost::uint32_t(result.tv_usec) };
+ for(std::size_t field = 0; field != 2; ++field){
+ for(std::size_t i = 0; i != sizeof(fields[0]); ++i){
+ const char *ptr = (const char *)&fields[field];
+ bootstamp_str[char_counter++] = Characters[(ptr[i]&0xF0)>>4];
+ bootstamp_str[char_counter++] = Characters[(ptr[i]&0x0F)];
+ }
+ }
+ bootstamp_str[char_counter] = 0;
+ if(add){
+ s += bootstamp_str;
+ }
+ else{
+ s = bootstamp_str;
+ }
+ }
+ #else
+ #error "BOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME defined with no known implementation"
+ #endif
+#endif //#if defined(BOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME)
inline void get_tmp_base_dir(std::string &tmp_name)
{
#if defined (BOOST_INTERPROCESS_WINDOWS)
- winapi::get_shared_documents_folder(tmp_name);
- if(tmp_name.empty() || !winapi::is_directory(tmp_name.c_str())){
- tmp_name = get_temporary_path();
- }
+ winapi::get_shared_documents_folder(tmp_name);
+ if(tmp_name.empty() || !winapi::is_directory(tmp_name.c_str())){
+ tmp_name = get_temporary_path();
+ }
#else
- tmp_name = get_temporary_path();
+ tmp_name = get_temporary_path();
#endif
if(tmp_name.empty()){
error_info err = system_error_code();
@@ -104,9 +111,9 @@ inline void get_tmp_base_dir(std::string &tmp_name)
inline void tmp_folder(std::string &tmp_name)
{
get_tmp_base_dir(tmp_name);
- #ifdef BOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME
- tmp_name += "/";
- get_bootstamp(tmp_name, true);
+ #if defined(BOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME)
+ tmp_name += "/";
+ get_bootstamp(tmp_name, true);
#endif
}
@@ -131,22 +138,22 @@ inline void create_tmp_and_clean_old(std::string &tmp_name)
}
}
- #ifdef BOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME
- tmp_folder(tmp_name);
+ #if defined(BOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME)
+ tmp_folder(tmp_name);
- //If fails, check that it's because already exists
- if(!create_directory(tmp_name.c_str())){
- error_info info(system_error_code());
- if(info.get_error_code() != already_exists_error){
- throw interprocess_exception(info);
+ //If fails, check that it's because already exists
+ if(!create_directory(tmp_name.c_str())){
+ error_info info(system_error_code());
+ if(info.get_error_code() != already_exists_error){
+ throw interprocess_exception(info);
+ }
}
- }
- //Now erase all old directories created in the previous boot sessions
- std::string subdir = tmp_name;
- subdir.erase(0, root_tmp_name.size()+1);
- delete_subdirectories(root_tmp_name, subdir.c_str());
+ //Now erase all old directories created in the previous boot sessions
+ std::string subdir = tmp_name;
+ subdir.erase(0, root_tmp_name.size()+1);
+ delete_subdirectories(root_tmp_name, subdir.c_str());
#else
- tmp_name = root_tmp_name;
+ tmp_name = root_tmp_name;
#endif
}
diff --git a/boost/interprocess/detail/transform_iterator.hpp b/boost/interprocess/detail/transform_iterator.hpp
index ef646fbefe..922c875d6d 100644
--- a/boost/interprocess/detail/transform_iterator.hpp
+++ b/boost/interprocess/detail/transform_iterator.hpp
@@ -27,7 +27,7 @@
#include <boost/interprocess/detail/type_traits.hpp>
namespace boost {
-namespace interprocess {
+namespace interprocess {
template <class PseudoReference>
struct operator_arrow_proxy
@@ -77,7 +77,7 @@ class transform_iterator
{}
//Constructors
- transform_iterator& operator++()
+ transform_iterator& operator++()
{ increment(); return *this; }
transform_iterator operator++(int)
@@ -87,7 +87,7 @@ class transform_iterator
return result;
}
- transform_iterator& operator--()
+ transform_iterator& operator--()
{ decrement(); return *this; }
transform_iterator operator--(int)
@@ -186,7 +186,7 @@ make_transform_iterator(Iterator it, UnaryFunc fun)
return transform_iterator<Iterator, UnaryFunc>(it, fun);
}
-} //namespace interprocess {
+} //namespace interprocess {
} //namespace boost {
#include <boost/interprocess/detail/config_end.hpp>
diff --git a/boost/interprocess/detail/type_traits.hpp b/boost/interprocess/detail/type_traits.hpp
index 2cfa0be291..7a582fee5c 100644
--- a/boost/interprocess/detail/type_traits.hpp
+++ b/boost/interprocess/detail/type_traits.hpp
@@ -20,7 +20,7 @@
#include <boost/interprocess/detail/config_begin.hpp>
namespace boost {
-namespace interprocess {
+namespace interprocess {
namespace ipcdetail {
struct nat{};
@@ -137,7 +137,7 @@ struct is_same
};
} // namespace ipcdetail
-} //namespace interprocess {
+} //namespace interprocess {
} //namespace boost {
#include <boost/interprocess/detail/config_end.hpp>
diff --git a/boost/interprocess/detail/utilities.hpp b/boost/interprocess/detail/utilities.hpp
index 625a9159d3..fcb211fb09 100644
--- a/boost/interprocess/detail/utilities.hpp
+++ b/boost/interprocess/detail/utilities.hpp
@@ -35,7 +35,7 @@
#include <algorithm>
namespace boost {
-namespace interprocess {
+namespace interprocess {
namespace ipcdetail {
template <class T>
@@ -138,9 +138,9 @@ template<class Cont>
class value_eraser
{
public:
- value_eraser(Cont & cont, typename Cont::iterator it)
+ value_eraser(Cont & cont, typename Cont::iterator it)
: m_cont(cont), m_index_it(it), m_erase(true){}
- ~value_eraser()
+ ~value_eraser()
{ if(m_erase) m_cont.erase(m_index_it); }
void release() { m_erase = false; }
@@ -151,7 +151,7 @@ class value_eraser
bool m_erase;
};
-} //namespace interprocess {
+} //namespace interprocess {
} //namespace boost {
#include <boost/interprocess/detail/config_end.hpp>
diff --git a/boost/interprocess/detail/variadic_templates_tools.hpp b/boost/interprocess/detail/variadic_templates_tools.hpp
index 1e6c4216e3..482a0056a7 100644
--- a/boost/interprocess/detail/variadic_templates_tools.hpp
+++ b/boost/interprocess/detail/variadic_templates_tools.hpp
@@ -21,7 +21,7 @@
#include <cstddef> //std::size_t
namespace boost {
-namespace interprocess {
+namespace interprocess {
namespace ipcdetail {
template<typename... Values>
@@ -136,7 +136,7 @@ struct index_tuple{};
template<std::size_t Num, typename Tuple = index_tuple<> >
struct build_number_seq;
-template<std::size_t Num, int... Indexes>
+template<std::size_t Num, int... Indexes>
struct build_number_seq<Num, index_tuple<Indexes...> >
: build_number_seq<Num - 1, index_tuple<Indexes..., sizeof...(Indexes)> >
{};
diff --git a/boost/interprocess/detail/win32_api.hpp b/boost/interprocess/detail/win32_api.hpp
index b420c3d67b..c53725ca3b 100644
--- a/boost/interprocess/detail/win32_api.hpp
+++ b/boost/interprocess/detail/win32_api.hpp
@@ -46,6 +46,7 @@ namespace winapi {
//Some used constants
static const unsigned long infinite_time = 0xFFFFFFFF;
static const unsigned long error_already_exists = 183L;
+static const unsigned long error_invalid_handle = 6L;
static const unsigned long error_sharing_violation = 32L;
static const unsigned long error_file_not_found = 2u;
static const unsigned long error_no_more_files = 18u;
@@ -137,7 +138,14 @@ static const unsigned long lang_neutral = (unsigned long)0x00;
static const unsigned long sublang_default = (unsigned long)0x01;
static const unsigned long invalid_file_size = (unsigned long)0xFFFFFFFF;
static const unsigned long invalid_file_attributes = ((unsigned long)-1);
-static void * const invalid_handle_value = (void*)(long)(-1);
+static void * const invalid_handle_value = ((void*)(long)(-1));
+
+static const unsigned long file_type_char = 0x0002L;
+static const unsigned long file_type_disk = 0x0001L;
+static const unsigned long file_type_pipe = 0x0003L;
+static const unsigned long file_type_remote = 0x8000L;
+static const unsigned long file_type_unknown = 0x0000L;
+
static const unsigned long create_new = 1;
static const unsigned long create_always = 2;
static const unsigned long open_existing = 3;
@@ -159,7 +167,6 @@ static const long BootAndSystemstampLength = 16;
static const long BootstampLength = 8;
static const unsigned long MaxPath = 260;
-
//Keys
static void * const hkey_local_machine = (void*)(unsigned long*)(long)(0x80000002);
static unsigned long key_query_value = 0x0001;
@@ -179,6 +186,27 @@ const signed long WBEM_INFINITE_BIPC = 0xffffffffL;
const signed long RPC_E_TOO_LATE_BIPC = 0x80010119L;
const signed long S_OK_BIPC = 0L;
const signed long S_FALSE_BIPC = 1;
+const signed long RPC_E_CHANGED_MODE_BIPC = 0x80010106L;
+const unsigned long COINIT_APARTMENTTHREADED_BIPC = 0x2;
+const unsigned long COINIT_MULTITHREADED_BIPC = 0x0;
+const unsigned long COINIT_DISABLE_OLE1DDE_BIPC = 0x4;
+const unsigned long COINIT_SPEED_OVER_MEMORY_BIPC = 0x4;
+
+//If the user needs to change default COM initialization model,
+//it can define BOOST_INTERPROCESS_WINDOWS_COINIT_MODEL to one of these:
+//
+// COINIT_APARTMENTTHREADED_BIPC
+// COINIT_MULTITHREADED_BIPC
+// COINIT_DISABLE_OLE1DDE_BIPC
+// COINIT_SPEED_OVER_MEMORY_BIPC
+#if !defined(BOOST_INTERPROCESS_WINDOWS_COINIT_MODEL)
+ #define BOOST_INTERPROCESS_WINDOWS_COINIT_MODEL COINIT_APARTMENTTHREADED_BIPC
+#elif (BOOST_INTERPROCESS_WINDOWS_COINIT_MODEL != COINIT_APARTMENTTHREADED_BIPC) &&\
+ (BOOST_INTERPROCESS_WINDOWS_COINIT_MODEL != COINIT_MULTITHREADED_BIPC) &&\
+ (BOOST_INTERPROCESS_WINDOWS_COINIT_MODEL != COINIT_DISABLE_OLE1DDE_BIPC) &&\
+ (BOOST_INTERPROCESS_WINDOWS_COINIT_MODEL != COINIT_SPEED_OVER_MEMORY_BIPC)
+ #error "Wrong value for BOOST_INTERPROCESS_WINDOWS_COINIT_MODEL macro"
+#endif
} //namespace winapi {
} //namespace interprocess {
@@ -214,158 +242,158 @@ struct wchar_variant
struct IUnknown_BIPC
{
public:
- virtual long __stdcall QueryInterface(
+ virtual long __stdcall QueryInterface(
/* [in] */ const GUID_BIPC &riid,
/* [iid_is][out] */ void **ppvObject) = 0;
-
+
virtual unsigned long __stdcall AddRef( void) = 0;
-
+
virtual unsigned long __stdcall Release( void) = 0;
};
struct IWbemClassObject_BIPC : public IUnknown_BIPC
{
public:
- virtual long __stdcall GetQualifierSet(
+ virtual long __stdcall GetQualifierSet(
/* [out] */ void **ppQualSet) = 0;
-
- virtual long __stdcall Get(
+
+ virtual long __stdcall Get(
/* [string][in] */ const wchar_t * wszName,
/* [in] */ long lFlags,
/* [unique][in][out] */ wchar_variant *pVal,
/* [unique][in][out] */ long *pType,
/* [unique][in][out] */ long *plFlavor) = 0;
-
- virtual long __stdcall Put(
+
+ virtual long __stdcall Put(
/* [string][in] */ const wchar_t * wszName,
/* [in] */ long lFlags,
/* [in] */ wchar_variant *pVal,
/* [in] */ long Type) = 0;
-
- virtual long __stdcall Delete(
+
+ virtual long __stdcall Delete(
/* [string][in] */ const wchar_t * wszName) = 0;
-
- virtual long __stdcall GetNames(
+
+ virtual long __stdcall GetNames(
/* [string][in] */ const wchar_t * wszQualifierName,
/* [in] */ long lFlags,
/* [in] */ wchar_variant *pQualifierVal,
/* [out] */ void * *pNames) = 0;
-
- virtual long __stdcall BeginEnumeration(
+
+ virtual long __stdcall BeginEnumeration(
/* [in] */ long lEnumFlags) = 0;
-
- virtual long __stdcall Next(
+
+ virtual long __stdcall Next(
/* [in] */ long lFlags,
/* [unique][in][out] */ wchar_t * *strName,
/* [unique][in][out] */ wchar_variant *pVal,
/* [unique][in][out] */ long *pType,
/* [unique][in][out] */ long *plFlavor) = 0;
-
+
virtual long __stdcall EndEnumeration( void) = 0;
-
- virtual long __stdcall GetPropertyQualifierSet(
+
+ virtual long __stdcall GetPropertyQualifierSet(
/* [string][in] */ const wchar_t * wszProperty,
/* [out] */ void **ppQualSet) = 0;
-
- virtual long __stdcall Clone(
+
+ virtual long __stdcall Clone(
/* [out] */ IWbemClassObject_BIPC **ppCopy) = 0;
-
- virtual long __stdcall GetObjectText(
+
+ virtual long __stdcall GetObjectText(
/* [in] */ long lFlags,
/* [out] */ wchar_t * *pstrObjectText) = 0;
-
- virtual long __stdcall SpawnDerivedClass(
+
+ virtual long __stdcall SpawnDerivedClass(
/* [in] */ long lFlags,
/* [out] */ IWbemClassObject_BIPC **ppNewClass) = 0;
-
- virtual long __stdcall SpawnInstance(
+
+ virtual long __stdcall SpawnInstance(
/* [in] */ long lFlags,
/* [out] */ IWbemClassObject_BIPC **ppNewInstance) = 0;
-
- virtual long __stdcall CompareTo(
+
+ virtual long __stdcall CompareTo(
/* [in] */ long lFlags,
/* [in] */ IWbemClassObject_BIPC *pCompareTo) = 0;
-
- virtual long __stdcall GetPropertyOrigin(
+
+ virtual long __stdcall GetPropertyOrigin(
/* [string][in] */ const wchar_t * wszName,
/* [out] */ wchar_t * *pstrClassName) = 0;
-
- virtual long __stdcall InheritsFrom(
+
+ virtual long __stdcall InheritsFrom(
/* [in] */ const wchar_t * strAncestor) = 0;
-
- virtual long __stdcall GetMethod(
+
+ virtual long __stdcall GetMethod(
/* [string][in] */ const wchar_t * wszName,
/* [in] */ long lFlags,
/* [out] */ IWbemClassObject_BIPC **ppInSignature,
/* [out] */ IWbemClassObject_BIPC **ppOutSignature) = 0;
-
- virtual long __stdcall PutMethod(
+
+ virtual long __stdcall PutMethod(
/* [string][in] */ const wchar_t * wszName,
/* [in] */ long lFlags,
/* [in] */ IWbemClassObject_BIPC *pInSignature,
/* [in] */ IWbemClassObject_BIPC *pOutSignature) = 0;
-
- virtual long __stdcall DeleteMethod(
+
+ virtual long __stdcall DeleteMethod(
/* [string][in] */ const wchar_t * wszName) = 0;
-
- virtual long __stdcall BeginMethodEnumeration(
+
+ virtual long __stdcall BeginMethodEnumeration(
/* [in] */ long lEnumFlags) = 0;
-
- virtual long __stdcall NextMethod(
+
+ virtual long __stdcall NextMethod(
/* [in] */ long lFlags,
/* [unique][in][out] */ wchar_t * *pstrName,
/* [unique][in][out] */ IWbemClassObject_BIPC **ppInSignature,
/* [unique][in][out] */ IWbemClassObject_BIPC **ppOutSignature) = 0;
-
+
virtual long __stdcall EndMethodEnumeration( void) = 0;
-
- virtual long __stdcall GetMethodQualifierSet(
+
+ virtual long __stdcall GetMethodQualifierSet(
/* [string][in] */ const wchar_t * wszMethod,
/* [out] */ void **ppQualSet) = 0;
-
- virtual long __stdcall GetMethodOrigin(
+
+ virtual long __stdcall GetMethodOrigin(
/* [string][in] */ const wchar_t * wszMethodName,
/* [out] */ wchar_t * *pstrClassName) = 0;
-
+
};
struct IWbemContext_BIPC : public IUnknown_BIPC
{
public:
- virtual long __stdcall Clone(
+ virtual long __stdcall Clone(
/* [out] */ IWbemContext_BIPC **ppNewCopy) = 0;
-
- virtual long __stdcall GetNames(
+
+ virtual long __stdcall GetNames(
/* [in] */ long lFlags,
/* [out] */ void * *pNames) = 0;
-
- virtual long __stdcall BeginEnumeration(
+
+ virtual long __stdcall BeginEnumeration(
/* [in] */ long lFlags) = 0;
-
- virtual long __stdcall Next(
+
+ virtual long __stdcall Next(
/* [in] */ long lFlags,
/* [out] */ wchar_t * *pstrName,
/* [out] */ wchar_variant *pValue) = 0;
-
+
virtual long __stdcall EndEnumeration( void) = 0;
-
- virtual long __stdcall SetValue(
+
+ virtual long __stdcall SetValue(
/* [string][in] */ const wchar_t * wszName,
/* [in] */ long lFlags,
/* [in] */ wchar_variant *pValue) = 0;
-
- virtual long __stdcall GetValue(
+
+ virtual long __stdcall GetValue(
/* [string][in] */ const wchar_t * wszName,
/* [in] */ long lFlags,
/* [out] */ wchar_variant *pValue) = 0;
-
- virtual long __stdcall DeleteValue(
+
+ virtual long __stdcall DeleteValue(
/* [string][in] */ const wchar_t * wszName,
/* [in] */ long lFlags) = 0;
-
+
virtual long __stdcall DeleteAll( void) = 0;
-
+
};
@@ -373,157 +401,157 @@ struct IEnumWbemClassObject_BIPC : public IUnknown_BIPC
{
public:
virtual long __stdcall Reset( void) = 0;
-
- virtual long __stdcall Next(
+
+ virtual long __stdcall Next(
/* [in] */ long lTimeout,
/* [in] */ unsigned long uCount,
/* [length_is][size_is][out] */ IWbemClassObject_BIPC **apObjects,
/* [out] */ unsigned long *puReturned) = 0;
-
- virtual long __stdcall NextAsync(
+
+ virtual long __stdcall NextAsync(
/* [in] */ unsigned long uCount,
/* [in] */ void *pSink) = 0;
-
- virtual long __stdcall Clone(
+
+ virtual long __stdcall Clone(
/* [out] */ void **ppEnum) = 0;
-
- virtual long __stdcall Skip(
+
+ virtual long __stdcall Skip(
/* [in] */ long lTimeout,
/* [in] */ unsigned long nCount) = 0;
-
+
};
struct IWbemServices_BIPC : public IUnknown_BIPC
{
public:
- virtual long __stdcall OpenNamespace(
+ virtual long __stdcall OpenNamespace(
/* [in] */ const wchar_t * strNamespace,
/* [in] */ long lFlags,
/* [in] */ void *pCtx,
/* [unique][in][out] */ void **ppWorkingNamespace,
/* [unique][in][out] */ void **ppResult) = 0;
-
- virtual long __stdcall CancelAsyncCall(
+
+ virtual long __stdcall CancelAsyncCall(
/* [in] */ void *pSink) = 0;
-
- virtual long __stdcall QueryObjectSink(
+
+ virtual long __stdcall QueryObjectSink(
/* [in] */ long lFlags,
/* [out] */ void **ppResponseHandler) = 0;
-
- virtual long __stdcall GetObject(
+
+ virtual long __stdcall GetObject(
/* [in] */ const wchar_t * strObjectPath,
/* [in] */ long lFlags,
/* [in] */ void *pCtx,
/* [unique][in][out] */ void **ppObject,
/* [unique][in][out] */ void **ppCallResult) = 0;
-
- virtual long __stdcall GetObjectAsync(
+
+ virtual long __stdcall GetObjectAsync(
/* [in] */ const wchar_t * strObjectPath,
/* [in] */ long lFlags,
/* [in] */ void *pCtx,
/* [in] */ void *pResponseHandler) = 0;
-
- virtual long __stdcall PutClass(
+
+ virtual long __stdcall PutClass(
/* [in] */ IWbemClassObject_BIPC *pObject,
/* [in] */ long lFlags,
/* [in] */ void *pCtx,
/* [unique][in][out] */ void **ppCallResult) = 0;
-
- virtual long __stdcall PutClassAsync(
+
+ virtual long __stdcall PutClassAsync(
/* [in] */ IWbemClassObject_BIPC *pObject,
/* [in] */ long lFlags,
/* [in] */ void *pCtx,
/* [in] */ void *pResponseHandler) = 0;
-
- virtual long __stdcall DeleteClass(
+
+ virtual long __stdcall DeleteClass(
/* [in] */ const wchar_t * strClass,
/* [in] */ long lFlags,
/* [in] */ void *pCtx,
/* [unique][in][out] */ void **ppCallResult) = 0;
-
- virtual long __stdcall DeleteClassAsync(
+
+ virtual long __stdcall DeleteClassAsync(
/* [in] */ const wchar_t * strClass,
/* [in] */ long lFlags,
/* [in] */ void *pCtx,
/* [in] */ void *pResponseHandler) = 0;
-
- virtual long __stdcall CreateClassEnum(
+
+ virtual long __stdcall CreateClassEnum(
/* [in] */ const wchar_t * strSuperclass,
/* [in] */ long lFlags,
/* [in] */ void *pCtx,
/* [out] */ void **ppEnum) = 0;
-
- virtual long __stdcall CreateClassEnumAsync(
+
+ virtual long __stdcall CreateClassEnumAsync(
/* [in] */ const wchar_t * strSuperclass,
/* [in] */ long lFlags,
/* [in] */ void *pCtx,
/* [in] */ void *pResponseHandler) = 0;
-
- virtual long __stdcall PutInstance(
+
+ virtual long __stdcall PutInstance(
/* [in] */ void *pInst,
/* [in] */ long lFlags,
/* [in] */ void *pCtx,
/* [unique][in][out] */ void **ppCallResult) = 0;
-
- virtual long __stdcall PutInstanceAsync(
+
+ virtual long __stdcall PutInstanceAsync(
/* [in] */ void *pInst,
/* [in] */ long lFlags,
/* [in] */ void *pCtx,
/* [in] */ void *pResponseHandler) = 0;
-
- virtual long __stdcall DeleteInstance(
+
+ virtual long __stdcall DeleteInstance(
/* [in] */ const wchar_t * strObjectPath,
/* [in] */ long lFlags,
/* [in] */ void *pCtx,
/* [unique][in][out] */ void **ppCallResult) = 0;
-
- virtual long __stdcall DeleteInstanceAsync(
+
+ virtual long __stdcall DeleteInstanceAsync(
/* [in] */ const wchar_t * strObjectPath,
/* [in] */ long lFlags,
/* [in] */ void *pCtx,
/* [in] */ void *pResponseHandler) = 0;
-
- virtual long __stdcall CreateInstanceEnum(
+
+ virtual long __stdcall CreateInstanceEnum(
/* [in] */ const wchar_t * strFilter,
/* [in] */ long lFlags,
/* [in] */ void *pCtx,
/* [out] */ void **ppEnum) = 0;
-
- virtual long __stdcall CreateInstanceEnumAsync(
+
+ virtual long __stdcall CreateInstanceEnumAsync(
/* [in] */ const wchar_t * strFilter,
/* [in] */ long lFlags,
/* [in] */ void *pCtx,
/* [in] */ void *pResponseHandler) = 0;
-
- virtual long __stdcall ExecQuery(
+
+ virtual long __stdcall ExecQuery(
/* [in] */ const wchar_t * strQueryLanguage,
/* [in] */ const wchar_t * strQuery,
/* [in] */ long lFlags,
/* [in] */ IWbemContext_BIPC *pCtx,
/* [out] */ IEnumWbemClassObject_BIPC **ppEnum) = 0;
- virtual long __stdcall ExecQueryAsync(
+ virtual long __stdcall ExecQueryAsync(
/* [in] */ const wchar_t * strQueryLanguage,
/* [in] */ const wchar_t * strQuery,
/* [in] */ long lFlags,
/* [in] */ IWbemContext_BIPC *pCtx,
/* [in] */ void *pResponseHandler) = 0;
-
- virtual long __stdcall ExecNotificationQuery(
+
+ virtual long __stdcall ExecNotificationQuery(
/* [in] */ const wchar_t * strQueryLanguage,
/* [in] */ const wchar_t * strQuery,
/* [in] */ long lFlags,
/* [in] */ IWbemContext_BIPC *pCtx,
/* [out] */ void **ppEnum) = 0;
-
- virtual long __stdcall ExecNotificationQueryAsync(
+
+ virtual long __stdcall ExecNotificationQueryAsync(
/* [in] */ const wchar_t * strQueryLanguage,
/* [in] */ const wchar_t * strQuery,
/* [in] */ long lFlags,
/* [in] */ IWbemContext_BIPC *pCtx,
/* [in] */ void *pResponseHandler) = 0;
-
- virtual long __stdcall ExecMethod(
+
+ virtual long __stdcall ExecMethod(
/* [in] */ const wchar_t * strObjectPath,
/* [in] */ const wchar_t * strMethodName,
/* [in] */ long lFlags,
@@ -531,21 +559,21 @@ public:
/* [in] */ IWbemClassObject_BIPC *pInParams,
/* [unique][in][out] */ IWbemClassObject_BIPC **ppOutParams,
/* [unique][in][out] */ void **ppCallResult) = 0;
-
- virtual long __stdcall ExecMethodAsync(
+
+ virtual long __stdcall ExecMethodAsync(
/* [in] */ const wchar_t * strObjectPath,
/* [in] */ const wchar_t * strMethodName,
/* [in] */ long lFlags,
/* [in] */ IWbemContext_BIPC *pCtx,
/* [in] */ IWbemClassObject_BIPC *pInParams,
/* [in] */ void *pResponseHandler) = 0;
-
+
};
struct IWbemLocator_BIPC : public IUnknown_BIPC
{
public:
- virtual long __stdcall ConnectServer(
+ virtual long __stdcall ConnectServer(
/* [in] */ const wchar_t * strNetworkResource,
/* [in] */ const wchar_t * strUser,
/* [in] */ const wchar_t * strPassword,
@@ -554,12 +582,12 @@ public:
/* [in] */ const wchar_t * strAuthority,
/* [in] */ void *pCtx,
/* [out] */ IWbemServices_BIPC **ppNamespace) = 0;
-
+
};
-
-struct interprocess_overlapped
+
+struct interprocess_overlapped
{
unsigned long *internal;
unsigned long *internal_high;
@@ -574,9 +602,22 @@ struct interprocess_overlapped
void *h_event;
};
+struct interprocess_semaphore_basic_information
+{
+ unsigned int count; // current semaphore count
+ unsigned int limit; // max semaphore count
+};
+
+struct interprocess_section_basic_information
+{
+ void * base_address;
+ unsigned long section_attributes;
+ __int64 section_size;
+};
+
struct interprocess_filetime
-{
- unsigned long dwLowDateTime;
+{
+ unsigned long dwLowDateTime;
unsigned long dwHighDateTime;
};
@@ -620,16 +661,16 @@ struct system_info {
unsigned short wProcessorRevision;
};
-struct interprocess_memory_basic_information
+typedef struct _interprocess_memory_basic_information
{
- void * BaseAddress;
+ void * BaseAddress;
void * AllocationBase;
unsigned long AllocationProtect;
unsigned long RegionSize;
unsigned long State;
unsigned long Protect;
unsigned long Type;
-};
+} interprocess_memory_basic_information;
typedef struct _interprocess_acl
{
@@ -695,6 +736,10 @@ enum file_information_class_t {
file_maximum_information
};
+enum semaphore_information_class {
+ semaphore_basic_information = 0
+};
+
struct file_name_information_t {
unsigned long FileNameLength;
wchar_t FileName[1];
@@ -779,6 +824,12 @@ enum object_information_class
object_data_information
};
+enum section_information_class
+{
+ section_basic_information,
+ section_image_information
+};
+
struct object_name_information_t
{
unicode_string_t Name;
@@ -803,6 +854,7 @@ extern "C" __declspec(dllimport) int __stdcall DuplicateHandle
, void *hTargetProcessHandle, void **lpTargetHandle
, unsigned long dwDesiredAccess, int bInheritHandle
, unsigned long dwOptions);
+extern "C" __declspec(dllimport) long __stdcall GetFileType(void *hFile);
extern "C" __declspec(dllimport) void *__stdcall FindFirstFileA(const char *lpFileName, win32_find_data_t *lpFindFileData);
extern "C" __declspec(dllimport) int __stdcall FindNextFileA(void *hFindFile, win32_find_data_t *lpFindFileData);
extern "C" __declspec(dllimport) int __stdcall FindClose(void *hFindFile);
@@ -827,8 +879,8 @@ extern "C" __declspec(dllimport) int __stdcall FlushViewOfFile (void *, std::siz
extern "C" __declspec(dllimport) int __stdcall FlushFileBuffers (void *);
extern "C" __declspec(dllimport) int __stdcall GetFileSizeEx (void *, __int64 *size);
extern "C" __declspec(dllimport) unsigned long __stdcall FormatMessageA
- (unsigned long dwFlags, const void *lpSource, unsigned long dwMessageId,
- unsigned long dwLanguageId, char *lpBuffer, unsigned long nSize,
+ (unsigned long dwFlags, const void *lpSource, unsigned long dwMessageId,
+ unsigned long dwLanguageId, char *lpBuffer, unsigned long nSize,
std::va_list *Arguments);
extern "C" __declspec(dllimport) void *__stdcall LocalFree (void *);
extern "C" __declspec(dllimport) unsigned long __stdcall GetFileAttributesA(const char *);
@@ -844,6 +896,7 @@ extern "C" __declspec(dllimport) int __stdcall UnlockFile(void *hnd, unsigned lo
extern "C" __declspec(dllimport) int __stdcall LockFileEx(void *hnd, unsigned long flags, unsigned long reserved, unsigned long size_low, unsigned long size_high, interprocess_overlapped* overlapped);
extern "C" __declspec(dllimport) int __stdcall UnlockFileEx(void *hnd, unsigned long reserved, unsigned long size_low, unsigned long size_high, interprocess_overlapped* overlapped);
extern "C" __declspec(dllimport) int __stdcall WriteFile(void *hnd, const void *buffer, unsigned long bytes_to_write, unsigned long *bytes_written, interprocess_overlapped* overlapped);
+extern "C" __declspec(dllimport) int __stdcall ReadFile(void *hnd, void *buffer, unsigned long bytes_to_read, unsigned long *bytes_read, interprocess_overlapped* overlapped);
extern "C" __declspec(dllimport) int __stdcall InitializeSecurityDescriptor(interprocess_security_descriptor *pSecurityDescriptor, unsigned long dwRevision);
extern "C" __declspec(dllimport) int __stdcall SetSecurityDescriptorDacl(interprocess_security_descriptor *pSecurityDescriptor, int bDaclPresent, interprocess_acl *pDacl, int bDaclDefaulted);
extern "C" __declspec(dllimport) void *__stdcall LoadLibraryA(const char *);
@@ -858,17 +911,17 @@ extern "C" __declspec(dllimport) long __stdcall RegCloseKey(void *);
extern "C" __declspec(dllimport) int __stdcall QueryPerformanceCounter(__int64 *lpPerformanceCount);
//COM API
-extern "C" __declspec(dllimport) long __stdcall CoInitialize(void *pvReserved);
+extern "C" __declspec(dllimport) long __stdcall CoInitializeEx(void *pvReserved, unsigned long dwCoInit);
extern "C" __declspec(dllimport) long __stdcall CoInitializeSecurity(
- void* pSecDesc,
- long cAuthSvc,
- void *asAuthSvc,
- void *pReserved1,
- unsigned long dwAuthnLevel,
- unsigned long dwImpLevel,
- void *pAuthList,
- unsigned long dwCapabilities,
- void *pReserved3 );
+ void* pSecDesc,
+ long cAuthSvc,
+ void * asAuthSvc,
+ void *pReserved1,
+ unsigned long dwAuthnLevel,
+ unsigned long dwImpLevel,
+ void *pAuthList,
+ unsigned long dwCapabilities,
+ void *pReserved3 );
extern "C" __declspec(dllimport) long __stdcall CoSetProxyBlanket(
IUnknown_BIPC *pProxy,
@@ -889,10 +942,12 @@ extern "C" __declspec(dllimport) void __stdcall CoUninitialize(void);
//API function typedefs
//Pointer to functions
-typedef long (__stdcall *NtDeleteFile_t)(object_attributes_t *ObjectAttributes);
-typedef long (__stdcall *NtSetInformationFile_t)(void *FileHandle, io_status_block_t *IoStatusBlock, void *FileInformation, unsigned long Length, int FileInformationClass );
-typedef long (__stdcall * NtQuerySystemInformation_t)(int, void*, unsigned long, unsigned long *);
-typedef long (__stdcall * NtQueryObject_t)(void*, object_information_class, void *, unsigned long, unsigned long *);
+typedef long (__stdcall *NtDeleteFile_t)(object_attributes_t *ObjectAttributes);
+typedef long (__stdcall *NtSetInformationFile_t)(void *FileHandle, io_status_block_t *IoStatusBlock, void *FileInformation, unsigned long Length, int FileInformationClass );
+typedef long (__stdcall *NtQuerySystemInformation_t)(int, void*, unsigned long, unsigned long *);
+typedef long (__stdcall *NtQueryObject_t)(void*, object_information_class, void *, unsigned long, unsigned long *);
+typedef long (__stdcall *NtQuerySemaphore_t)(void*, unsigned int info_class, interprocess_semaphore_basic_information *pinfo, unsigned int info_size, unsigned int *ret_len);
+typedef long (__stdcall *NtQuerySection_t)(void*, section_information_class, interprocess_section_basic_information *pinfo, unsigned long info_size, unsigned long *ret_len);
typedef long (__stdcall *NtQueryInformationFile_t)(void *,io_status_block_t *,void *, long, int);
typedef long (__stdcall *NtOpenFile_t)(void*,unsigned long ,object_attributes_t*,io_status_block_t*,unsigned long,unsigned long);
typedef long (__stdcall *NtClose_t) (void*);
@@ -977,6 +1032,12 @@ inline bool duplicate_current_process_handle
, lpTargetHandle, 0, 0
, duplicate_same_access);
}
+
+inline long get_file_type(void *hFile)
+{
+ return GetFileType(hFile);
+}
+
/*
inline void get_system_time_as_file_time(interprocess_filetime *filetime)
{ GetSystemTimeAsFileTime(filetime); }
@@ -1000,13 +1061,16 @@ inline int unmap_view_of_file(void *address)
inline void *open_or_create_semaphore(const char *name, long initial_count, long maximum_count, interprocess_security_attributes *attr)
{ return CreateSemaphoreA(attr, initial_count, maximum_count, name); }
+inline void *open_semaphore(const char *name)
+{ return OpenSemaphoreA(semaphore_all_access, 0, name); }
+
inline int release_semaphore(void *handle, long release_count, long *prev_count)
{ return ReleaseSemaphore(handle, release_count, prev_count); }
class interprocess_all_access_security
{
interprocess_security_attributes sa;
- interprocess_security_descriptor sd;
+ interprocess_security_descriptor sd;
bool initialized;
public:
@@ -1027,16 +1091,21 @@ class interprocess_all_access_security
{ return &sa; }
};
-inline void * create_file_mapping (void * handle, unsigned long access, unsigned long high_size, unsigned long low_size, const char * name, interprocess_security_attributes *psec)
+inline void * create_file_mapping (void * handle, unsigned long access, unsigned __int64 file_offset, const char * name, interprocess_security_attributes *psec)
{
- return CreateFileMappingA (handle, psec, access, high_size, low_size, name);
+ const unsigned long high_size(file_offset >> 32), low_size((boost::uint32_t)file_offset);
+ return CreateFileMappingA (handle, psec, access, high_size, low_size, name);
}
inline void * open_file_mapping (unsigned long access, const char *name)
{ return OpenFileMappingA (access, 0, name); }
-inline void *map_view_of_file_ex(void *handle, unsigned long file_access, unsigned long highoffset, unsigned long lowoffset, std::size_t numbytes, void *base_addr)
-{ return MapViewOfFileEx(handle, file_access, highoffset, lowoffset, numbytes, base_addr); }
+inline void *map_view_of_file_ex(void *handle, unsigned long file_access, unsigned __int64 offset, std::size_t numbytes, void *base_addr)
+{
+ const unsigned long offset_low = (unsigned long)(offset & ((unsigned __int64)0xFFFFFFFF));
+ const unsigned long offset_high = offset >> 32;
+ return MapViewOfFileEx(handle, file_access, offset_high, offset_low, numbytes, base_addr);
+}
inline void *create_file(const char *name, unsigned long access, unsigned long creation_flags, unsigned long attributes, interprocess_security_attributes *psec)
{
@@ -1051,7 +1120,7 @@ inline void *create_file(const char *name, unsigned long access, unsigned long c
if (error_sharing_violation != get_last_error()){
return handle;
}
- Sleep(error_sharing_violation_sleep_ms);
+ sleep(error_sharing_violation_sleep_ms);
}
return invalid_handle_value;
}
@@ -1075,9 +1144,9 @@ inline bool get_file_size(void *handle, __int64 &size)
{ return 0 != GetFileSizeEx(handle, &size); }
inline bool create_directory(const char *name)
-{
+{
interprocess_all_access_security sec;
- return 0 != CreateDirectoryA(name, sec.get_attributes());
+ return 0 != CreateDirectoryA(name, sec.get_attributes());
}
inline bool remove_directory(const char *lpPathName)
@@ -1101,6 +1170,9 @@ inline bool unlock_file_ex(void *hnd, unsigned long reserved, unsigned long size
inline bool write_file(void *hnd, const void *buffer, unsigned long bytes_to_write, unsigned long *bytes_written, interprocess_overlapped* overlapped)
{ return 0 != WriteFile(hnd, buffer, bytes_to_write, bytes_written, overlapped); }
+inline bool read_file(void *hnd, void *buffer, unsigned long bytes_to_read, unsigned long *bytes_read, interprocess_overlapped* overlapped)
+{ return 0 != ReadFile(hnd, buffer, bytes_to_read, bytes_read, overlapped); }
+
inline bool get_file_information_by_handle(void *hnd, interprocess_by_handle_file_information *info)
{ return 0 != GetFileInformationByHandle(hnd, info); }
@@ -1176,7 +1248,7 @@ inline void rtl_init_empty_unicode_string(unicode_string_t *ucStr, wchar_t *buf,
template<int Dummy>
struct function_address_holder
{
- enum { NtSetInformationFile, NtQuerySystemInformation, NtQueryObject, NumFunction };
+ enum { NtSetInformationFile, NtQuerySystemInformation, NtQueryObject, NtQuerySemaphore, NtQuerySection, NumFunction };
enum { NtDll_dll, NumModule };
private:
@@ -1213,7 +1285,7 @@ struct function_address_holder
static void *get_address_from_dll(const unsigned int id)
{
assert(id < (unsigned int)NumFunction);
- const char *function[] = { "NtSetInformationFile", "NtQuerySystemInformation", "NtQueryObject" };
+ const char *function[] = { "NtSetInformationFile", "NtQuerySystemInformation", "NtQueryObject", "NtQuerySemaphore", "NtQuerySection" };
bool compile_check[sizeof(function)/sizeof(function[0]) == NumFunction];
(void)compile_check;
return get_proc_address(get_module(NtDll_dll), function[id]);
@@ -1264,7 +1336,7 @@ struct library_unloader
//pszFilename must have room for at least MaxPath+1 characters
inline bool get_file_name_from_handle_function
- (void * hFile, wchar_t *pszFilename, std::size_t length, std::size_t &out_length)
+ (void * hFile, wchar_t *pszFilename, std::size_t length, std::size_t &out_length)
{
if(length <= MaxPath){
return false;
@@ -1285,17 +1357,17 @@ inline bool get_file_name_from_handle_function
bool bSuccess = false;
// Create a file mapping object.
- void * hFileMap = create_file_mapping(hFile, page_readonly, 0, 1, 0, 0);
+ void * hFileMap = create_file_mapping(hFile, page_readonly, 1, 0, 0);
if(hFileMap){
// Create a file mapping to get the file name.
- void* pMem = map_view_of_file_ex(hFileMap, file_map_read, 0, 0, 1, 0);
+ void* pMem = map_view_of_file_ex(hFileMap, file_map_read, 0, 1, 0);
if (pMem){
//out_length = pfGMFN(get_current_process(), pMem, pszFilename, MaxPath);
out_length = get_mapped_file_name(get_current_process(), pMem, pszFilename, MaxPath);
if(out_length){
bSuccess = true;
- }
+ }
unmap_view_of_file(pMem);
}
close_handle(hFileMap);
@@ -1307,7 +1379,6 @@ inline bool get_file_name_from_handle_function
inline bool get_system_time_of_day_information(system_timeofday_information &info)
{
NtQuerySystemInformation_t pNtQuerySystemInformation = (NtQuerySystemInformation_t)
- //get_proc_address(get_module_handle("ntdll.dll"), "NtQuerySystemInformation");
dll_func::get(dll_func::NtQuerySystemInformation);
unsigned long res;
long status = pNtQuerySystemInformation(system_time_of_day_information, &info, sizeof(info), &res);
@@ -1384,9 +1455,12 @@ inline bool get_boot_and_system_time_wstr(wchar_t *bootsystemstamp, std::size_t
class handle_closer
{
void *handle_;
+ handle_closer(const handle_closer &);
+ handle_closer& operator=(const handle_closer &);
public:
- handle_closer(void *handle) : handle_(handle){}
- ~handle_closer(){ close_handle(handle_); }
+ explicit handle_closer(void *handle) : handle_(handle){}
+ ~handle_closer()
+ { close_handle(handle_); }
};
union ntquery_mem_t
@@ -1401,81 +1475,92 @@ union ntquery_mem_t
inline bool unlink_file(const char *filename)
{
- if(!delete_file(filename)){
- try{
- NtSetInformationFile_t pNtSetInformationFile =
- //(NtSetInformationFile_t)get_proc_address(get_module_handle("ntdll.dll"), "NtSetInformationFile");
- (NtSetInformationFile_t)dll_func::get(dll_func::NtSetInformationFile);
- if(!pNtSetInformationFile){
- return false;
- }
+ //Don't try to optimize doing a DeleteFile first
+ //as there are interactions with permissions and
+ //in-use files.
+ //
+ //if(!delete_file(filename)){
+ // (...)
+ //
+
+ //This functions tries to emulate UNIX unlink semantics in windows.
+ //
+ //- Open the file and mark the handle as delete-on-close
+ //- Rename the file to an arbitrary name based on a random number
+ //- Close the handle. If there are no file users, it will be deleted.
+ // Otherwise it will be used by already connected handles but the
+ // file name can't be used to open this file again
+ try{
+ NtSetInformationFile_t pNtSetInformationFile =
+ (NtSetInformationFile_t)dll_func::get(dll_func::NtSetInformationFile);
+ if(!pNtSetInformationFile){
+ return false;
+ }
- NtQueryObject_t pNtQueryObject =
- //(NtQueryObject_t)get_proc_address(get_module_handle("ntdll.dll"), "NtQueryObject");
- (NtQueryObject_t)dll_func::get(dll_func::NtQueryObject);
+ NtQueryObject_t pNtQueryObject =
+ (NtQueryObject_t)dll_func::get(dll_func::NtQueryObject);
- //First step: Obtain a handle to the file using Win32 rules. This resolves relative paths
- void *fh = create_file(filename, generic_read | delete_access, open_existing,
- file_flag_backup_semantics | file_flag_delete_on_close, 0);
- if(fh == invalid_handle_value){
- return false;
- }
+ //First step: Obtain a handle to the file using Win32 rules. This resolves relative paths
+ void *fh = create_file(filename, generic_read | delete_access, open_existing,
+ file_flag_backup_semantics | file_flag_delete_on_close, 0);
+ if(fh == invalid_handle_value){
+ return false;
+ }
- handle_closer h_closer(fh);
+ handle_closer h_closer(fh);
- std::auto_ptr<ntquery_mem_t> pmem(new ntquery_mem_t);
- file_rename_information_t *pfri = &pmem->ren.info;
- const std::size_t RenMaxNumChars =
- ((char*)pmem.get() - (char*)&pmem->ren.info.FileName[0])/sizeof(wchar_t);
+ std::auto_ptr<ntquery_mem_t> pmem(new ntquery_mem_t);
+ file_rename_information_t *pfri = &pmem->ren.info;
+ const std::size_t RenMaxNumChars =
+ ((char*)pmem.get() - (char*)&pmem->ren.info.FileName[0])/sizeof(wchar_t);
- //Obtain file name
- unsigned long size;
- if(pNtQueryObject(fh, object_name_information, pmem.get(), sizeof(ntquery_mem_t), &size)){
- return false;
- }
+ //Obtain file name
+ unsigned long size;
+ if(pNtQueryObject(fh, object_name_information, pmem.get(), sizeof(ntquery_mem_t), &size)){
+ return false;
+ }
- //Copy filename to the rename member
- std::memmove(pmem->ren.info.FileName, pmem->name.Name.Buffer, pmem->name.Name.Length);
- std::size_t filename_string_length = pmem->name.Name.Length/sizeof(wchar_t);
+ //Copy filename to the rename member
+ std::memmove(pmem->ren.info.FileName, pmem->name.Name.Buffer, pmem->name.Name.Length);
+ std::size_t filename_string_length = pmem->name.Name.Length/sizeof(wchar_t);
- //Second step: obtain the complete native-nt filename
- //if(!get_file_name_from_handle_function(fh, pfri->FileName, RenMaxNumChars, filename_string_length)){
- //return 0;
- //}
+ //Second step: obtain the complete native-nt filename
+ //if(!get_file_name_from_handle_function(fh, pfri->FileName, RenMaxNumChars, filename_string_length)){
+ //return 0;
+ //}
- //Add trailing mark
- if((RenMaxNumChars-filename_string_length) < (SystemTimeOfDayInfoLength*2)){
- return false;
- }
+ //Add trailing mark
+ if((RenMaxNumChars-filename_string_length) < (SystemTimeOfDayInfoLength*2)){
+ return false;
+ }
- //Search '\\' character to replace it
- for(std::size_t i = filename_string_length; i != 0; --filename_string_length){
- if(pmem->ren.info.FileName[--i] == L'\\')
- break;
- }
+ //Search '\\' character to replace it
+ for(std::size_t i = filename_string_length; i != 0; --filename_string_length){
+ if(pmem->ren.info.FileName[--i] == L'\\')
+ break;
+ }
- //Add random number
- std::size_t s = RenMaxNumChars - filename_string_length;
- if(!get_boot_and_system_time_wstr(&pfri->FileName[filename_string_length], s)){
- return false;
- }
- filename_string_length += s;
+ //Add random number
+ std::size_t s = RenMaxNumChars - filename_string_length;
+ if(!get_boot_and_system_time_wstr(&pfri->FileName[filename_string_length], s)){
+ return false;
+ }
+ filename_string_length += s;
- //Fill rename information (FileNameLength is in bytes)
- pfri->FileNameLength = static_cast<unsigned long>(sizeof(wchar_t)*(filename_string_length));
- pfri->Replace = 1;
- pfri->RootDir = 0;
+ //Fill rename information (FileNameLength is in bytes)
+ pfri->FileNameLength = static_cast<unsigned long>(sizeof(wchar_t)*(filename_string_length));
+ pfri->Replace = 1;
+ pfri->RootDir = 0;
- //Final step: change the name of the in-use file:
- io_status_block_t io;
- if(0 != pNtSetInformationFile(fh, &io, pfri, sizeof(ntquery_mem_t::ren_t), file_rename_information)){
- return false;
- }
- return true;
- }
- catch(...){
+ //Final step: change the name of the in-use file:
+ io_status_block_t io;
+ if(0 != pNtSetInformationFile(fh, &io, pfri, sizeof(ntquery_mem_t::ren_t), file_rename_information)){
return false;
}
+ return true;
+ }
+ catch(...){
+ return false;
}
return true;
}
@@ -1493,116 +1578,77 @@ struct reg_closer
inline void get_shared_documents_folder(std::string &s)
{
s.clear();
- //void *hAdvapi = load_library("Advapi32.dll");
- //if (hAdvapi){
- //library_unloader unloader(hAdvapi);
- // Pointer to function RegOpenKeyA
- //RegOpenKeyEx_t pRegOpenKey =
- //(RegOpenKeyEx_t)get_proc_address(hAdvapi, "RegOpenKeyExA");
- //if (pRegOpenKey){
- // Pointer to function RegCloseKey
- //RegCloseKey_t pRegCloseKey =
- //(RegCloseKey_t)get_proc_address(hAdvapi, "RegCloseKey");
- //if (pRegCloseKey){
- // Pointer to function RegQueryValueA
- //RegQueryValueEx_t pRegQueryValue =
- //(RegQueryValueEx_t)get_proc_address(hAdvapi, "RegQueryValueExA");
- //if (pRegQueryValue){
- //Open the key
- void *key;
- //if ((*pRegOpenKey)( hkey_local_machine
- //, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"
- //, 0
- //, key_query_value
- //, &key) == 0){
- //reg_closer key_closer(pRegCloseKey, key);
- if (reg_open_key_ex( hkey_local_machine
- , "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"
- , 0
- , key_query_value
- , &key) == 0){
- reg_closer key_closer(key);
-
- //Obtain the value
- unsigned long size;
- unsigned long type;
- const char *const reg_value = "Common AppData";
- //long err = (*pRegQueryValue)( key, reg_value, 0, &type, 0, &size);
- long err = reg_query_value_ex( key, reg_value, 0, &type, 0, &size);
- if(!err){
- //Size includes terminating NULL
- s.resize(size);
- //err = (*pRegQueryValue)( key, reg_value, 0, &type, (unsigned char*)(&s[0]), &size);
- err = reg_query_value_ex( key, reg_value, 0, &type, (unsigned char*)(&s[0]), &size);
- if(!err)
- s.erase(s.end()-1);
- (void)err;
- }
- }
- //}
- //}
- //}
- //}
+ void *key;
+ if (reg_open_key_ex( hkey_local_machine
+ , "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"
+ , 0
+ , key_query_value
+ , &key) == 0){
+ reg_closer key_closer(key);
+
+ //Obtain the value
+ unsigned long size;
+ unsigned long type;
+ const char *const reg_value = "Common AppData";
+ //long err = (*pRegQueryValue)( key, reg_value, 0, &type, 0, &size);
+ long err = reg_query_value_ex( key, reg_value, 0, &type, 0, &size);
+ if(!err){
+ //Size includes terminating NULL
+ s.resize(size);
+ //err = (*pRegQueryValue)( key, reg_value, 0, &type, (unsigned char*)(&s[0]), &size);
+ err = reg_query_value_ex( key, reg_value, 0, &type, (unsigned char*)(&s[0]), &size);
+ if(!err)
+ s.erase(s.end()-1);
+ (void)err;
+ }
+ }
}
-
inline void get_registry_value(const char *folder, const char *value_key, std::vector<unsigned char> &s)
{
s.clear();
- //void *hAdvapi = load_library("Advapi32.dll");
- //if (hAdvapi){
- //library_unloader unloader(hAdvapi);
- // Pointer to function RegOpenKeyA
- //RegOpenKeyEx_t pRegOpenKey =
- //(RegOpenKeyEx_t)get_proc_address(hAdvapi, "RegOpenKeyExA");
- //if (pRegOpenKey){
- // Pointer to function RegCloseKey
- //RegCloseKey_t pRegCloseKey =
- //(RegCloseKey_t)get_proc_address(hAdvapi, "RegCloseKey");
- //if (pRegCloseKey){
- // Pointer to function RegQueryValueA
- //RegQueryValueEx_t pRegQueryValue =
- //(RegQueryValueEx_t)get_proc_address(hAdvapi, "RegQueryValueExA");
- //if (pRegQueryValue){
- //Open the key
- void *key;
- //if ((*pRegOpenKey)( hkey_local_machine
- //, folder
- //, 0
- //, key_query_value
- //, &key) == 0){
- //reg_closer key_closer(pRegCloseKey, key);
- if (reg_open_key_ex( hkey_local_machine
- , folder
- , 0
- , key_query_value
- , &key) == 0){
- reg_closer key_closer(key);
-
- //Obtain the value
- unsigned long size;
- unsigned long type;
- const char *const reg_value = value_key;
- //long err = (*pRegQueryValue)( key, reg_value, 0, &type, 0, &size);
- long err = reg_query_value_ex( key, reg_value, 0, &type, 0, &size);
- if(!err){
- //Size includes terminating NULL
- s.resize(size);
- //err = (*pRegQueryValue)( key, reg_value, 0, &type, (unsigned char*)(&s[0]), &size);
- err = reg_query_value_ex( key, reg_value, 0, &type, (unsigned char*)(&s[0]), &size);
- if(!err)
- s.erase(s.end()-1);
- (void)err;
- }
- }
- //}
- //}
- //}
- //}
+ void *key;
+ if (reg_open_key_ex( hkey_local_machine
+ , folder
+ , 0
+ , key_query_value
+ , &key) == 0){
+ reg_closer key_closer(key);
+
+ //Obtain the value
+ unsigned long size;
+ unsigned long type;
+ const char *const reg_value = value_key;
+ //long err = (*pRegQueryValue)( key, reg_value, 0, &type, 0, &size);
+ long err = reg_query_value_ex( key, reg_value, 0, &type, 0, &size);
+ if(!err){
+ //Size includes terminating NULL
+ s.resize(size);
+ //err = (*pRegQueryValue)( key, reg_value, 0, &type, (unsigned char*)(&s[0]), &size);
+ err = reg_query_value_ex( key, reg_value, 0, &type, (unsigned char*)(&s[0]), &size);
+ if(!err)
+ s.erase(s.end()-1);
+ (void)err;
+ }
+ }
}
struct co_uninitializer
-{ ~co_uninitializer() { CoUninitialize(); } };
+{
+ co_uninitializer(bool b_uninitialize)
+ : m_b_uninitialize(b_uninitialize)
+ {}
+
+ ~co_uninitializer()
+ {
+ if(m_b_uninitialize){
+ CoUninitialize();
+ }
+ }
+
+ private:
+ const bool m_b_uninitialize;
+};
template<class Object>
struct com_releaser
@@ -1615,29 +1661,32 @@ struct com_releaser
inline bool get_wmi_class_attribute( std::wstring& strValue, const wchar_t *wmi_class, const wchar_t *wmi_class_var)
{
//See example http://msdn.microsoft.com/en-us/library/aa390423%28v=VS.85%29.aspx
- long co_init_ret = CoInitialize(0);
- if(co_init_ret != S_OK_BIPC && co_init_ret != S_FALSE_BIPC)
+ //
+ //See BOOST_INTERPROCESS_WINDOWS_COINIT_MODEL definition if you need to change the
+ //default value of this macro in your application
+ long co_init_ret = CoInitializeEx(0, BOOST_INTERPROCESS_WINDOWS_COINIT_MODEL);
+ if(co_init_ret != S_OK_BIPC && co_init_ret != S_FALSE_BIPC && co_init_ret != RPC_E_CHANGED_MODE_BIPC)
return false;
- co_uninitializer co_initialize_end;
+ co_uninitializer co_initialize_end(co_init_ret != RPC_E_CHANGED_MODE_BIPC);
(void)co_initialize_end;
bool bRet = false;
long sec_init_ret = CoInitializeSecurity
- ( 0 //pVoid
- ,-1 //cAuthSvc
- , 0 //asAuthSvc
- , 0 //pReserved1
- , RPC_C_AUTHN_LEVEL_PKT_BIPC //dwAuthnLevel
- , RPC_C_IMP_LEVEL_IMPERSONATE_BIPC //dwImpLevel
- , 0 //pAuthList
- , EOAC_NONE_BIPC //dwCapabilities
- , 0 //pReserved3
+ ( 0 //pVoid
+ ,-1 //cAuthSvc
+ , 0 //asAuthSvc
+ , 0 //pReserved1
+ , RPC_C_AUTHN_LEVEL_PKT_BIPC //dwAuthnLevel
+ , RPC_C_IMP_LEVEL_IMPERSONATE_BIPC //dwImpLevel
+ , 0 //pAuthList
+ , EOAC_NONE_BIPC //dwCapabilities
+ , 0 //pReserved3
);
if( 0 == sec_init_ret || RPC_E_TOO_LATE_BIPC == sec_init_ret)
{
IWbemLocator_BIPC * pIWbemLocator = 0;
const wchar_t * bstrNamespace = L"root\\cimv2";
-
+
if( 0 != CoCreateInstance(
CLSID_WbemAdministrativeLocator,
0,
@@ -1645,7 +1694,7 @@ inline bool get_wmi_class_attribute( std::wstring& strValue, const wchar_t *wmi_
IID_IUnknown, (void **)&pIWbemLocator)){
return false;
}
-
+
com_releaser<IWbemLocator_BIPC> IWbemLocator_releaser(pIWbemLocator);
IWbemServices_BIPC *pWbemServices = 0;
@@ -1677,7 +1726,7 @@ inline bool get_wmi_class_attribute( std::wstring& strValue, const wchar_t *wmi_
){
return false;
}
-
+
com_releaser<IWbemServices_BIPC> IWbemServices_releaser(pWbemServices);
strValue.clear();
@@ -1757,9 +1806,40 @@ inline bool is_directory(const char *path)
(attrib & file_attribute_directory));
}
-} //namespace winapi
+inline bool get_file_mapping_size(void *file_mapping_hnd, __int64 &size)
+{
+ NtQuerySection_t pNtQuerySection =
+ (NtQuerySection_t)dll_func::get(dll_func::NtQuerySection);
+ //Obtain file name
+ interprocess_section_basic_information info;
+ unsigned long ntstatus =
+ pNtQuerySection(file_mapping_hnd, section_basic_information, &info, sizeof(info), 0);
+ if(ntstatus){
+ return false;
+ }
+ size = info.section_size;
+ return true;
+}
+
+inline bool get_semaphore_info(void *handle, long &count, long &limit)
+{
+ winapi::interprocess_semaphore_basic_information info;
+ winapi::NtQuerySemaphore_t pNtQuerySemaphore =
+ (winapi::NtQuerySemaphore_t)dll_func::get(winapi::dll_func::NtQuerySemaphore);
+ unsigned int ret_len;
+ long status = pNtQuerySemaphore(handle, winapi::semaphore_basic_information, &info, sizeof(info), &ret_len);
+ if(status){
+ return false;
+ }
+ count = info.count;
+ limit = info.limit;
+ return true;
+}
+
+
+} //namespace winapi
} //namespace interprocess
-} //namespace boost
+} //namespace boost
#include <boost/interprocess/detail/config_end.hpp>
diff --git a/boost/interprocess/detail/windows_intermodule_singleton.hpp b/boost/interprocess/detail/windows_intermodule_singleton.hpp
new file mode 100644
index 0000000000..a716e270a7
--- /dev/null
+++ b/boost/interprocess/detail/windows_intermodule_singleton.hpp
@@ -0,0 +1,306 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2009-2011. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/interprocess for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTERPROCESS_WINDOWS_INTERMODULE_SINGLETON_HPP
+#define BOOST_INTERPROCESS_WINDOWS_INTERMODULE_SINGLETON_HPP
+
+#if defined(_MSC_VER)&&(_MSC_VER>=1200)
+#pragma once
+#endif
+
+#include <boost/interprocess/detail/config_begin.hpp>
+#include <boost/interprocess/detail/workaround.hpp>
+
+#if !defined(BOOST_INTERPROCESS_WINDOWS)
+ #error "This header can't be included from non-windows operating systems"
+#endif
+
+#include <boost/assert.hpp>
+#include <boost/interprocess/detail/intermodule_singleton_common.hpp>
+#include <boost/interprocess/sync/windows/winapi_semaphore_wrapper.hpp>
+#include <boost/interprocess/sync/windows/winapi_mutex_wrapper.hpp>
+#include <boost/interprocess/sync/scoped_lock.hpp>
+#include <boost/cstdint.hpp>
+#include <string>
+#include <map>
+
+namespace boost{
+namespace interprocess{
+namespace ipcdetail{
+
+namespace intermodule_singleton_helpers {
+
+//This global map will be implemented using 3 sync primitives:
+//
+//1) A named mutex that will implement global mutual exclusion between
+// threads from different modules/dlls
+//
+//2) A semaphore that will act as a global counter for modules attached to the global map
+// so that the global map can be destroyed when the last module is detached.
+//
+//3) A semaphore that will be hacked to hold the address of a heap-allocated map in the
+// max and current semaphore count.
+class windows_semaphore_based_map
+{
+ typedef std::map<std::string, ref_count_ptr> map_type;
+
+ public:
+ windows_semaphore_based_map()
+ {
+ map_type *m = new map_type;
+ boost::uint32_t initial_count = 0;
+ boost::uint32_t max_count = 0;
+
+ //Windows user address space sizes:
+ //32 bit windows: [32 bit processes] 2GB or 3GB (31/32 bits)
+ //64 bit windows: [32 bit processes] 2GB or 4GB (31/32 bits)
+ // [64 bit processes] 2GB or 8TB (31/43 bits)
+ //
+ //Windows semaphores use 'long' parameters (32 bits in LLP64 data model) and
+ //those values can't be negative, so we have 31 bits to store something
+ //in max_count and initial count parameters.
+ //Also, max count must be bigger than 0 and bigger or equal than initial count.
+ if(sizeof(void*) == sizeof(boost::uint32_t)){
+ //This means that for 32 bit processes, a semaphore count (31 usable bits) is
+ //enough to store 4 byte aligned memory (4GB -> 32 bits - 2 bits = 30 bits).
+ //The max count will hold the pointer value and current semaphore count
+ //will be zero.
+ //
+ //Relying in UB with a cast through union, but all known windows compilers
+ //accept this (C11 also accepts this).
+ union caster_union
+ {
+ void *addr;
+ boost::uint32_t addr_uint32;
+ } caster;
+ caster.addr = m;
+ //memory is at least 4 byte aligned in windows
+ BOOST_ASSERT((caster.addr_uint32 & boost::uint32_t(3)) == 0);
+ max_count = caster.addr_uint32 >> 2;
+ }
+ else if(sizeof(void*) == sizeof(boost::uint64_t)){
+ //Relying in UB with a cast through union, but all known windows compilers
+ //accept this (C11 accepts this).
+ union caster_union
+ {
+ void *addr;
+ boost::uint64_t addr_uint64;
+ } caster;
+ caster.addr = m;
+ //We'll encode the address using 30 bits in each 32 bit high and low parts.
+ //High part will be the sem max count, low part will be the sem initial count.
+ //(restrictions: max count > 0, initial count >= 0 and max count >= initial count):
+ //
+ // - Low part will be shifted two times (4 byte alignment) so that top
+ // two bits are cleared (the top one for sign, the next one to
+ // assure low part value is always less than the high part value.
+ // - The top bit of the high part will be cleared and the next bit will be 1
+ // (so high part is always bigger than low part due to the quasi-top bit).
+ //
+ // This means that the addresses we can store must be 4 byte aligned
+ // and less than 1 ExbiBytes ( 2^60 bytes, ~1 ExaByte). User-level address space in Windows 64
+ // is much less than this (8TB, 2^43 bytes): "1 EByte (or it was 640K?) ought to be enough for anybody" ;-).
+ caster.addr = m;
+ BOOST_ASSERT((caster.addr_uint64 & boost::uint64_t(3)) == 0);
+ max_count = boost::uint32_t(caster.addr_uint64 >> 32);
+ initial_count = boost::uint32_t(caster.addr_uint64);
+ initial_count = initial_count/4;
+ //Make sure top two bits are zero
+ BOOST_ASSERT((max_count & boost::uint32_t(0xC0000000)) == 0);
+ //Set quasi-top bit
+ max_count |= boost::uint32_t(0x40000000);
+ }
+ bool created = false;
+ const permissions & perm = permissions();
+ std::string pid_creation_time, name;
+ get_pid_creation_time_str(pid_creation_time);
+ name = "bipc_gmap_sem_lock_";
+ name += pid_creation_time;
+ bool success = m_mtx_lock.open_or_create(name.c_str(), perm);
+ name = "bipc_gmap_sem_count_";
+ name += pid_creation_time;
+ scoped_lock<winapi_mutex_wrapper> lck(m_mtx_lock);
+ {
+ success = success && m_sem_count.open_or_create
+ ( name.c_str(), static_cast<long>(0), winapi_semaphore_wrapper::MaxCount, perm, created);
+ name = "bipc_gmap_sem_map_";
+ name += pid_creation_time;
+ success = success && m_sem_map.open_or_create
+ (name.c_str(), initial_count, max_count, perm, created);
+ if(!success){
+ //winapi_xxx wrappers do the cleanup...
+ throw int(0);
+ }
+ if(!created){
+ delete m;
+ }
+ else{
+ BOOST_ASSERT(&get_map_unlocked() == m);
+ }
+ m_sem_count.post();
+ }
+ }
+
+ map_type &get_map_unlocked()
+ {
+ if(sizeof(void*) == sizeof(boost::uint32_t)){
+ union caster_union
+ {
+ void *addr;
+ boost::uint32_t addr_uint32;
+ } caster;
+ caster.addr = 0;
+ caster.addr_uint32 = m_sem_map.limit();
+ caster.addr_uint32 = caster.addr_uint32 << 2;
+ return *static_cast<map_type*>(caster.addr);
+ }
+ else{
+ union caster_union
+ {
+ void *addr;
+ boost::uint64_t addr_uint64;
+ } caster;
+ boost::uint32_t max_count(m_sem_map.limit()), initial_count(m_sem_map.value());
+ //Clear quasi-top bit
+ max_count &= boost::uint32_t(0xBFFFFFFF);
+ caster.addr_uint64 = max_count;
+ caster.addr_uint64 = caster.addr_uint64 << 32;
+ caster.addr_uint64 |= boost::uint64_t(initial_count) << 2;
+ return *static_cast<map_type*>(caster.addr);
+ }
+ }
+
+ ref_count_ptr *find(const char *name)
+ {
+ scoped_lock<winapi_mutex_wrapper> lck(m_mtx_lock);
+ map_type &map = this->get_map_unlocked();
+ map_type::iterator it = map.find(std::string(name));
+ if(it != map.end()){
+ return &it->second;
+ }
+ else{
+ return 0;
+ }
+ }
+
+ ref_count_ptr * insert(const char *name, const ref_count_ptr &ref)
+ {
+ scoped_lock<winapi_mutex_wrapper> lck(m_mtx_lock);
+ map_type &map = this->get_map_unlocked();
+ map_type::iterator it = map.insert(map_type::value_type(std::string(name), ref)).first;
+ return &it->second;
+ }
+
+ bool erase(const char *name)
+ {
+ scoped_lock<winapi_mutex_wrapper> lck(m_mtx_lock);
+ map_type &map = this->get_map_unlocked();
+ return map.erase(std::string(name)) != 0;
+ }
+
+ template<class F>
+ void atomic_func(F &f)
+ {
+ scoped_lock<winapi_mutex_wrapper> lck(m_mtx_lock);
+ f();
+ }
+
+ ~windows_semaphore_based_map()
+ {
+ scoped_lock<winapi_mutex_wrapper> lck(m_mtx_lock);
+ m_sem_count.wait();
+ if(0 == m_sem_count.value()){
+ delete &this->get_map_unlocked();
+ }
+ //First close sems to protect this with the external mutex
+ m_sem_map.close();
+ m_sem_count.close();
+ //Once scoped_lock unlocks the mutex, the destructor will close the handle...
+ }
+
+ private:
+ winapi_mutex_wrapper m_mtx_lock;
+ winapi_semaphore_wrapper m_sem_map;
+ winapi_semaphore_wrapper m_sem_count;
+};
+
+template<>
+struct thread_safe_global_map_dependant<windows_semaphore_based_map>
+{
+ static void apply_gmem_erase_logic(const char *, const char *){}
+
+ static bool remove_old_gmem()
+ { return true; }
+
+ struct lock_file_logic
+ {
+ lock_file_logic(windows_semaphore_based_map &)
+ : retry_with_new_map(false)
+ {}
+
+ void operator()(void){}
+ bool retry() const { return retry_with_new_map; }
+ private:
+ const bool retry_with_new_map;
+ };
+
+ static void construct_map(void *addr)
+ {
+ ::new (addr)windows_semaphore_based_map;
+ }
+
+ struct unlink_map_logic
+ {
+ unlink_map_logic(windows_semaphore_based_map &)
+ {}
+ void operator()(){}
+ };
+
+ static ref_count_ptr *find(windows_semaphore_based_map &map, const char *name)
+ {
+ return map.find(name);
+ }
+
+ static ref_count_ptr * insert(windows_semaphore_based_map &map, const char *name, const ref_count_ptr &ref)
+ {
+ return map.insert(name, ref);
+ }
+
+ static bool erase(windows_semaphore_based_map &map, const char *name)
+ {
+ return map.erase(name);
+ }
+
+ template<class F>
+ static void atomic_func(windows_semaphore_based_map &map, F &f)
+ {
+ map.atomic_func(f);
+ }
+};
+
+} //namespace intermodule_singleton_helpers {
+
+template<typename C, bool LazyInit = true, bool Phoenix = true>
+class windows_intermodule_singleton
+ : public intermodule_singleton_impl
+ < C
+ , LazyInit
+ , Phoenix
+ , intermodule_singleton_helpers::windows_semaphore_based_map
+ >
+{};
+
+} //namespace ipcdetail{
+} //namespace interprocess{
+} //namespace boost{
+
+#include <boost/interprocess/detail/config_end.hpp>
+
+#endif //#ifndef BOOST_INTERPROCESS_WINDOWS_INTERMODULE_SINGLETON_HPP
diff --git a/boost/interprocess/detail/workaround.hpp b/boost/interprocess/detail/workaround.hpp
index 896a2208a2..884b8680a6 100644
--- a/boost/interprocess/detail/workaround.hpp
+++ b/boost/interprocess/detail/workaround.hpp
@@ -13,43 +13,34 @@
#include <boost/interprocess/detail/config_begin.hpp>
-#if (defined(_WIN32) || defined(__WIN32__) || defined(WIN32))
-
-#define BOOST_INTERPROCESS_WINDOWS
-
-/*
-#if !defined(_MSC_EXTENSIONS)
-#error "Turn on Microsoft language extensions (_MSC_EXTENSIONS) to be able to call Windows API functions"
-#endif
-*/
-
-#endif
-
-#if !defined(BOOST_INTERPROCESS_WINDOWS)
-
+#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
+ #define BOOST_INTERPROCESS_WINDOWS
+ #define BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION
+ #define BOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME
+#else
#include <unistd.h>
- #if ((_POSIX_THREAD_PROCESS_SHARED - 0) > 0)
- //Cygwin defines _POSIX_THREAD_PROCESS_SHARED but does not implement it.
- //Mac Os X >= Leopard defines _POSIX_THREAD_PROCESS_SHARED but does not seems to work.
- # if !defined(__CYGWIN__) && !defined(__APPLE__)
- # define BOOST_INTERPROCESS_POSIX_PROCESS_SHARED
- # endif
+ #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED - 0) > 0)
+ //Cygwin defines _POSIX_THREAD_PROCESS_SHARED but does not implement it.
+ //Mac Os X >= Leopard defines _POSIX_THREAD_PROCESS_SHARED but does not seems to work.
+ #if !defined(__CYGWIN__) && !defined(__APPLE__)
+ #define BOOST_INTERPROCESS_POSIX_PROCESS_SHARED
+ #endif
+ #endif
+
+ #if defined(_POSIX_BARRIERS) && ((_POSIX_BARRIERS - 0) > 0)
+ #define BOOST_INTERPROCESS_POSIX_BARRIERS
#endif
-
- #if ((_POSIX_BARRIERS - 0) > 0)
- # define BOOST_INTERPROCESS_POSIX_BARRIERS
- # endif
-
- #if ((_POSIX_SEMAPHORES - 0) > 0)
- # define BOOST_INTERPROCESS_POSIX_NAMED_SEMAPHORES
- # if defined(__CYGWIN__)
- #define BOOST_INTERPROCESS_POSIX_SEMAPHORES_NO_UNLINK
- # endif
+
+ #if defined(_POSIX_SEMAPHORES) && ((_POSIX_SEMAPHORES - 0) > 0)
+ #define BOOST_INTERPROCESS_POSIX_NAMED_SEMAPHORES
+ #if defined(__CYGWIN__)
+ #define BOOST_INTERPROCESS_POSIX_SEMAPHORES_NO_UNLINK
+ #endif
//Some platforms have a limited (name length) named semaphore support
#elif (defined(__FreeBSD__) && (__FreeBSD__ >= 4)) || defined(__APPLE__)
- # define BOOST_INTERPROCESS_POSIX_NAMED_SEMAPHORES
- #endif
+ #define BOOST_INTERPROCESS_POSIX_NAMED_SEMAPHORES
+ #endif
#if ((defined _V6_ILP32_OFFBIG) &&(_V6_ILP32_OFFBIG - 0 > 0)) ||\
((defined _V6_LP64_OFF64) &&(_V6_LP64_OFF64 - 0 > 0)) ||\
@@ -60,87 +51,83 @@
((defined _FILE_OFFSET_BITS) &&(_FILE_OFFSET_BITS - 0 >= 64))||\
((defined _FILE_OFFSET_BITS) &&(_FILE_OFFSET_BITS - 0 >= 64))
#define BOOST_INTERPROCESS_UNIX_64_BIT_OR_BIGGER_OFF_T
- #else
#endif
//Check for XSI shared memory objects. They are available in nearly all UNIX platforms
#if !defined(__QNXNTO__)
- # define BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS
+ #define BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS
#endif
- #if ((_POSIX_SHARED_MEMORY_OBJECTS - 0) > 0)
- # define BOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS
+ #if defined(_POSIX_SHARED_MEMORY_OBJECTS) && ((_POSIX_SHARED_MEMORY_OBJECTS - 0) > 0)
+ #define BOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS
#else
- //VMS and MACOS don't define it but the have shm_open/close interface
- # if defined(__vms)
- # if __CRTL_VER >= 70200000
- # define BOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS
- # endif
- //Mac OS has some non-conformant features like names limited to SHM_NAME_MAX
- # elif defined (__APPLE__)
-// # define BOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS
-// # define BOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS_NO_GROW
- # endif
+ //VMS and MACOS don't define it but they have shm_open/close interface
+ #if defined(__vms)
+ #if __CRTL_VER >= 70200000
+ #define BOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS
+ #endif
+ //Mac OS has some non-conformant features like names limited to SHM_NAME_MAX
+ #elif defined (__APPLE__)
+ //#define BOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS
+ //#define BOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS_NO_GROW
+ #endif
#endif
//Now check if we have only XSI shared memory
#if defined(BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS) &&\
!defined(BOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS)
- //# define BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS_ONLY
+ //#define BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS_ONLY
#endif
- #if ((_POSIX_TIMEOUTS - 0) > 0)
- # define BOOST_INTERPROCESS_POSIX_TIMEOUTS
- #endif
-
+ #if defined(_POSIX_TIMEOUTS) && ((_POSIX_TIMEOUTS - 0) > 0)
+ #define BOOST_INTERPROCESS_POSIX_TIMEOUTS
+ #endif
#ifdef BOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS
//Some systems have filesystem-based resources, so the
//portable "/shmname" format does not work due to permission issues
//For those systems we need to form a path to a temporary directory:
// hp-ux tru64 vms freebsd
- #if defined(__hpux) || defined(__osf__) || defined(__vms) || (defined(__FreeBSD__) && (__FreeBSD__ < 7))
- #define BOOST_INTERPROCESS_FILESYSTEM_BASED_POSIX_SHARED_MEMORY
+ #if defined(__hpux) || defined(__osf__) || defined(__vms) || (defined(__FreeBSD__) && (__FreeBSD__ < 7))
+ #define BOOST_INTERPROCESS_FILESYSTEM_BASED_POSIX_SHARED_MEMORY
#elif defined(__FreeBSD__)
- #define BOOST_INTERPROCESS_RUNTIME_FILESYSTEM_BASED_POSIX_SHARED_MEMORY
+ #define BOOST_INTERPROCESS_RUNTIME_FILESYSTEM_BASED_POSIX_SHARED_MEMORY
#endif
#endif
#ifdef BOOST_INTERPROCESS_POSIX_NAMED_SEMAPHORES
#if defined(__osf__) || defined(__vms)
- #define BOOST_INTERPROCESS_FILESYSTEM_BASED_POSIX_SEMAPHORES
+ #define BOOST_INTERPROCESS_FILESYSTEM_BASED_POSIX_SEMAPHORES
#endif
#endif
- #if ((_POSIX_VERSION + 0)>= 200112L || (_XOPEN_VERSION + 0)>= 500)
- #define BOOST_INTERPROCESS_POSIX_RECURSIVE_MUTEXES
+ #if defined(_POSIX_VERSION) && defined(_XOPEN_VERSION) && \
+ (((_POSIX_VERSION + 0)>= 200112L || (_XOPEN_VERSION + 0)>= 500))
+ #define BOOST_INTERPROCESS_POSIX_RECURSIVE_MUTEXES
#endif
-#endif
+ #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
+ #define BOOST_INTERPROCESS_BSD_DERIVATIVE
+ #include <sys/sysctl.h>
+ #if defined(CTL_KERN) && defined (KERN_BOOTTIME)
+ //#define BOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME
+ #endif
+ #endif
+#endif //!defined(BOOST_INTERPROCESS_WINDOWS)
-#if !defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_NO_VARIADIC_TEMPLATES)\
- && !defined(BOOST_INTERPROCESS_DISABLE_VARIADIC_TMPL)
-#define BOOST_INTERPROCESS_PERFECT_FORWARDING
+#if !defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_NO_VARIADIC_TEMPLATES)
+ #define BOOST_INTERPROCESS_PERFECT_FORWARDING
#endif
//Now declare some Boost.Interprocess features depending on the implementation
-
#if defined(BOOST_INTERPROCESS_POSIX_NAMED_SEMAPHORES) && !defined(BOOST_INTERPROCESS_POSIX_SEMAPHORES_NO_UNLINK)
-
-#define BOOST_INTERPROCESS_NAMED_MUTEX_USES_POSIX_SEMAPHORES
-
-#endif
-
-#if defined(BOOST_INTERPROCESS_POSIX_NAMED_SEMAPHORES) && !defined(BOOST_INTERPROCESS_POSIX_SEMAPHORES_NO_UNLINK)
-
-#define BOOST_INTERPROCESS_NAMED_MUTEX_USES_POSIX_SEMAPHORES
-#define BOOST_INTERPROCESS_NAMED_SEMAPHORE_USES_POSIX_SEMAPHORES
-
+ #define BOOST_INTERPROCESS_NAMED_MUTEX_USES_POSIX_SEMAPHORES
+ #define BOOST_INTERPROCESS_NAMED_SEMAPHORE_USES_POSIX_SEMAPHORES
#endif
// Timeout duration use if BOOST_INTERPROCESS_ENABLE_TIMEOUT_WHEN_LOCKING is set
#ifndef BOOST_INTERPROCESS_TIMEOUT_WHEN_LOCKING_DURATION_MS
-#define BOOST_INTERPROCESS_TIMEOUT_WHEN_LOCKING_DURATION_MS 10000
+ #define BOOST_INTERPROCESS_TIMEOUT_WHEN_LOCKING_DURATION_MS 10000
#endif
#include <boost/interprocess/detail/config_end.hpp>
diff --git a/boost/interprocess/detail/xsi_shared_memory_device.hpp b/boost/interprocess/detail/xsi_shared_memory_device.hpp
index d2e2bf2ce6..ef4b009bc1 100644
--- a/boost/interprocess/detail/xsi_shared_memory_device.hpp
+++ b/boost/interprocess/detail/xsi_shared_memory_device.hpp
@@ -46,7 +46,7 @@ class xsi_shared_memory_device
{
/// @cond
BOOST_MOVABLE_BUT_NOT_COPYABLE(xsi_shared_memory_file_wrapper)
- /// @endcond
+ /// @endcond
public:
@@ -74,10 +74,10 @@ class xsi_shared_memory_device
{ this->swap(moved); }
xsi_shared_memory_device &operator=(BOOST_RV_REF(xsi_shared_memory_device) moved)
- {
+ {
xsi_shared_memory_device tmp(boost::move(moved));
this->swap(tmp);
- return *this;
+ return *this;
}
//!Swaps two xsi_shared_memory_device. Does not throw
@@ -168,7 +168,7 @@ inline xsi_shared_memory_device::xsi_shared_memory_device()
: m_shm(), m_mode(invalid_mode), m_name()
{}
-inline xsi_shared_memory_device::~xsi_shared_memory_device()
+inline xsi_shared_memory_device::~xsi_shared_memory_device()
{}
inline const char *xsi_shared_memory_device::get_name() const
@@ -178,7 +178,7 @@ inline void xsi_shared_memory_device::swap(xsi_shared_memory_device &other)
{
m_shm.swap(other.m_shm);
std::swap(m_mode, other.m_mode);
- m_name.swap(other.m_name);
+ m_name.swap(other.m_name);
}
inline mapping_handle_t xsi_shared_memory_device::get_mapping_handle() const
diff --git a/boost/interprocess/detail/xsi_shared_memory_file_wrapper.hpp b/boost/interprocess/detail/xsi_shared_memory_file_wrapper.hpp
index d74d9664a5..14811e7e62 100644
--- a/boost/interprocess/detail/xsi_shared_memory_file_wrapper.hpp
+++ b/boost/interprocess/detail/xsi_shared_memory_file_wrapper.hpp
@@ -40,7 +40,7 @@ class xsi_shared_memory_file_wrapper
{
/// @cond
BOOST_MOVABLE_BUT_NOT_COPYABLE(xsi_shared_memory_file_wrapper)
- /// @endcond
+ /// @endcond
public:
xsi_shared_memory_file_wrapper() : xsi_shared_memory() {}
@@ -61,10 +61,10 @@ class xsi_shared_memory_file_wrapper
{ this->swap(moved); }
xsi_shared_memory_file_wrapper &operator=(BOOST_RV_REF(xsi_shared_memory_file_wrapper) moved)
- {
+ {
xsi_shared_memory_file_wrapper tmp(boost::move(moved));
this->swap(tmp);
- return *this;
+ return *this;
}
//!Swaps two xsi_shared_memory_file_wrapper. Does not throw
diff --git a/boost/interprocess/errors.hpp b/boost/interprocess/errors.hpp
index e36b8e4e66..9eed55a29b 100644
--- a/boost/interprocess/errors.hpp
+++ b/boost/interprocess/errors.hpp
@@ -11,7 +11,7 @@
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 Beman Dawes
-// Copyright (C) 2001 Dietmar Kuehl
+// Copyright (C) 2001 Dietmar Kuehl
// Use, modification, and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy
// at http://www.boost.org/LICENSE_1_0.txt)
@@ -64,16 +64,16 @@ inline int system_error_code() // artifact of POSIX and WINDOWS error reporting
inline void fill_system_message(int sys_err_code, std::string &str)
{
void *lpMsgBuf;
- winapi::format_message(
- winapi::format_message_allocate_buffer |
- winapi::format_message_from_system |
+ winapi::format_message(
+ winapi::format_message_allocate_buffer |
+ winapi::format_message_from_system |
winapi::format_message_ignore_inserts,
0,
sys_err_code,
winapi::make_lang_id(winapi::lang_neutral, winapi::sublang_default), // Default language
reinterpret_cast<char *>(&lpMsgBuf),
0,
- 0
+ 0
);
str += static_cast<const char*>(lpMsgBuf);
winapi::local_free( lpMsgBuf ); // free the buffer
@@ -123,7 +123,7 @@ typedef int native_error_t;
struct ec_xlate
{
native_error_t sys_ec;
- error_code_t ec;
+ error_code_t ec;
};
static const ec_xlate ec_table[] =
@@ -183,9 +183,9 @@ static const ec_xlate ec_table[] =
};
inline error_code_t lookup_error(native_error_t err)
-{
+{
const ec_xlate *cur = &ec_table[0],
- *end = cur + sizeof(ec_table)/sizeof(ec_xlate);
+ *end = cur + sizeof(ec_table)/sizeof(ec_xlate);
for (;cur != end; ++cur ){
if ( err == cur->sys_ec ) return cur->ec;
}
diff --git a/boost/interprocess/file_mapping.hpp b/boost/interprocess/file_mapping.hpp
index 3bad98fca1..2a4e4cca00 100644
--- a/boost/interprocess/file_mapping.hpp
+++ b/boost/interprocess/file_mapping.hpp
@@ -41,27 +41,27 @@ class file_mapping
//!Does not throw
file_mapping();
- //!Opens a file mapping of file "filename", starting in offset
- //!"file_offset", and the mapping's size will be "size". The mapping
+ //!Opens a file mapping of file "filename", starting in offset
+ //!"file_offset", and the mapping's size will be "size". The mapping
//!can be opened for read-only "read_only" or read-write "read_write"
//!modes. Throws interprocess_exception on error.
file_mapping(const char *filename, mode_t mode);
- //!Moves the ownership of "moved"'s file mapping object to *this.
- //!After the call, "moved" does not represent any file mapping object.
+ //!Moves the ownership of "moved"'s file mapping object to *this.
+ //!After the call, "moved" does not represent any file mapping object.
//!Does not throw
file_mapping(BOOST_RV_REF(file_mapping) moved)
: m_handle(file_handle_t(ipcdetail::invalid_file()))
{ this->swap(moved); }
//!Moves the ownership of "moved"'s file mapping to *this.
- //!After the call, "moved" does not represent any file mapping.
+ //!After the call, "moved" does not represent any file mapping.
//!Does not throw
file_mapping &operator=(BOOST_RV_REF(file_mapping) moved)
{
file_mapping tmp(boost::move(moved));
this->swap(tmp);
- return *this;
+ return *this;
}
//!Swaps to file_mappings.
@@ -100,21 +100,21 @@ class file_mapping
/// @endcond
};
-inline file_mapping::file_mapping()
+inline file_mapping::file_mapping()
: m_handle(file_handle_t(ipcdetail::invalid_file()))
{}
-inline file_mapping::~file_mapping()
+inline file_mapping::~file_mapping()
{ this->priv_close(); }
inline const char *file_mapping::get_name() const
{ return m_filename.c_str(); }
inline void file_mapping::swap(file_mapping &other)
-{
+{
std::swap(m_handle, other.m_handle);
std::swap(m_mode, other.m_mode);
- m_filename.swap(other.m_filename);
+ m_filename.swap(other.m_filename);
}
inline mapping_handle_t file_mapping::get_mapping_handle() const
diff --git a/boost/interprocess/indexes/iset_index.hpp b/boost/interprocess/indexes/iset_index.hpp
index 966239290a..8fc91466f3 100644
--- a/boost/interprocess/indexes/iset_index.hpp
+++ b/boost/interprocess/indexes/iset_index.hpp
@@ -34,17 +34,17 @@ namespace interprocess {
template <class MapConfig>
struct iset_index_aux
{
- typedef typename
+ typedef typename
MapConfig::segment_manager_base segment_manager_base;
- typedef typename
+ typedef typename
segment_manager_base::void_pointer void_pointer;
typedef typename bi::make_set_base_hook
< bi::void_pointer<void_pointer>
, bi::optimize_size<true>
>::type derivation_hook;
- typedef typename MapConfig::template
+ typedef typename MapConfig::template
intrusive_value_type<derivation_hook>::type value_type;
typedef std::less<value_type> value_compare;
typedef typename bi::make_set
@@ -82,20 +82,20 @@ class iset_index
struct intrusive_key_value_less
{
bool operator()(const intrusive_compare_key_type &i, const value_type &b) const
- {
+ {
std::size_t blen = b.name_length();
- return (i.m_len < blen) ||
- (i.m_len == blen &&
- std::char_traits<char_type>::compare
+ return (i.m_len < blen) ||
+ (i.m_len == blen &&
+ std::char_traits<char_type>::compare
(i.mp_str, b.name(), i.m_len) < 0);
}
bool operator()(const value_type &b, const intrusive_compare_key_type &i) const
- {
+ {
std::size_t blen = b.name_length();
- return (blen < i.m_len) ||
+ return (blen < i.m_len) ||
(blen == i.m_len &&
- std::char_traits<char_type>::compare
+ std::char_traits<char_type>::compare
(b.name(), i.mp_str, i.m_len) < 0);
}
};
@@ -143,7 +143,7 @@ struct is_intrusive_index
/// @endcond
} //namespace interprocess {
-} //namespace boost
+} //namespace boost
#include <boost/interprocess/detail/config_end.hpp>
diff --git a/boost/interprocess/indexes/iunordered_set_index.hpp b/boost/interprocess/indexes/iunordered_set_index.hpp
index ef1ae79d3b..3c5f85526c 100644
--- a/boost/interprocess/indexes/iunordered_set_index.hpp
+++ b/boost/interprocess/indexes/iunordered_set_index.hpp
@@ -35,17 +35,17 @@ namespace boost { namespace interprocess {
template <class MapConfig>
struct iunordered_set_index_aux
{
- typedef typename
+ typedef typename
MapConfig::segment_manager_base segment_manager_base;
- typedef typename
+ typedef typename
segment_manager_base::void_pointer void_pointer;
typedef typename bi::make_unordered_set_base_hook
< bi::void_pointer<void_pointer>
>::type derivation_hook;
- typedef typename MapConfig::template
+ typedef typename MapConfig::template
intrusive_value_type<derivation_hook>::type value_type;
typedef typename MapConfig::
@@ -58,23 +58,23 @@ struct iunordered_set_index_aux
struct equal_function
{
bool operator()(const intrusive_compare_key_type &i, const value_type &b) const
- {
+ {
return (i.m_len == b.name_length()) &&
- (std::char_traits<char_type>::compare
+ (std::char_traits<char_type>::compare
(i.mp_str, b.name(), i.m_len) == 0);
}
bool operator()(const value_type &b, const intrusive_compare_key_type &i) const
- {
+ {
return (i.m_len == b.name_length()) &&
- (std::char_traits<char_type>::compare
+ (std::char_traits<char_type>::compare
(i.mp_str, b.name(), i.m_len) == 0);
}
bool operator()(const value_type &b1, const value_type &b2) const
- {
+ {
return (b1.name_length() == b2.name_length()) &&
- (std::char_traits<char_type>::compare
+ (std::char_traits<char_type>::compare
(b1.name(), b2.name(), b1.name_length()) == 0);
}
};
@@ -119,7 +119,7 @@ struct iunordered_set_index_aux
/// @endcond
//!Index type based in boost::intrusive::set.
-//!Just derives from boost::intrusive::set
+//!Just derives from boost::intrusive::set
//!and defines the interface needed by managed memory segments
template <class MapConfig>
class iunordered_set_index
@@ -135,9 +135,9 @@ class iunordered_set_index
typedef typename index_aux::equal_function equal_function;
typedef typename index_aux::hash_function hash_function;
typedef typename MapConfig::char_type char_type;
- typedef typename
+ typedef typename
iunordered_set_index_aux<MapConfig>::allocator_type allocator_type;
- typedef typename
+ typedef typename
iunordered_set_index_aux<MapConfig>::allocator_holder allocator_holder;
/// @endcond
@@ -290,7 +290,7 @@ class iunordered_set_index
size_type cur_size = this->size();
size_type cur_count = this->bucket_count();
bucket_ptr old_p = this->bucket_pointer();
-
+
if(!this->size() && old_p != bucket_ptr(&this->init_bucket)){
this->rehash(bucket_traits(bucket_ptr(&this->init_bucket), 1));
destroy_buckets(this->alloc, old_p, cur_count);
@@ -337,7 +337,7 @@ class iunordered_set_index
//Strong guarantee: if something goes wrong
//we should remove the insertion.
//
- //We can use the iterator because the hash function
+ //We can use the iterator because the hash function
//can't throw and this means that "reserve" will
//throw only because of the memory allocation:
//the iterator has not been invalidated.
diff --git a/boost/interprocess/indexes/map_index.hpp b/boost/interprocess/indexes/map_index.hpp
index ffea73e8d9..1bfc7ce310 100644
--- a/boost/interprocess/indexes/map_index.hpp
+++ b/boost/interprocess/indexes/map_index.hpp
@@ -48,7 +48,7 @@ struct map_index_aux
} //namespace ipcdetail {
-//!Index type based in boost::interprocess::map. Just derives from boost::interprocess::map
+//!Index type based in boost::interprocess::map. Just derives from boost::interprocess::map
//!and defines the interface needed by managed memory segments
template <class MapConfig>
class map_index
diff --git a/boost/interprocess/indexes/null_index.hpp b/boost/interprocess/indexes/null_index.hpp
index 81c88be79b..a0353b101c 100644
--- a/boost/interprocess/indexes/null_index.hpp
+++ b/boost/interprocess/indexes/null_index.hpp
@@ -16,7 +16,7 @@
#include <boost/interprocess/offset_ptr.hpp>
//!\file
-//!Describes a null index adaptor, so that if we don't want to construct
+//!Describes a null index adaptor, so that if we don't want to construct
//!named objects, we can use this null index type to save resources.
namespace boost {
diff --git a/boost/interprocess/indexes/unordered_map_index.hpp b/boost/interprocess/indexes/unordered_map_index.hpp
index a14fa1d4a7..7cf4b85e65 100644
--- a/boost/interprocess/indexes/unordered_map_index.hpp
+++ b/boost/interprocess/indexes/unordered_map_index.hpp
@@ -69,7 +69,7 @@ class unordered_map_index
/// @cond
typedef unordered_map_index_aux<MapConfig> index_aux;
typedef typename index_aux::index_t base_type;
- typedef typename
+ typedef typename
MapConfig::segment_manager_base segment_manager_base;
/// @endcond
diff --git a/boost/interprocess/interprocess_fwd.hpp b/boost/interprocess/interprocess_fwd.hpp
index 2b3e3eba07..68fd89fb91 100644
--- a/boost/interprocess/interprocess_fwd.hpp
+++ b/boost/interprocess/interprocess_fwd.hpp
@@ -214,7 +214,7 @@ template <class CharType
,template<class IndexConfig> class IndexType>
class basic_managed_shared_memory;
-typedef basic_managed_shared_memory
+typedef basic_managed_shared_memory
<char
,rbtree_best_fit<mutex_family>
,iset_index>
@@ -238,7 +238,7 @@ template <class CharType
,template<class IndexConfig> class IndexType>
class basic_managed_windows_shared_memory;
-typedef basic_managed_windows_shared_memory
+typedef basic_managed_windows_shared_memory
<char
,rbtree_best_fit<mutex_family>
,iset_index>
@@ -259,7 +259,7 @@ template <class CharType
,template<class IndexConfig> class IndexType>
class basic_managed_xsi_shared_memory;
-typedef basic_managed_xsi_shared_memory
+typedef basic_managed_xsi_shared_memory
<char
,rbtree_best_fit<mutex_family>
,iset_index>
diff --git a/boost/interprocess/ipc/message_queue.hpp b/boost/interprocess/ipc/message_queue.hpp
index d3846afb7c..67dd574f61 100644
--- a/boost/interprocess/ipc/message_queue.hpp
+++ b/boost/interprocess/ipc/message_queue.hpp
@@ -66,24 +66,24 @@ class message_queue_t
//!the maximum number of messages will be "max_num_msg" and the maximum message size
//!will be "max_msg_size". Throws on error and if the queue was previously created.
message_queue_t(create_only_t create_only,
- const char *name,
- size_type max_num_msg,
+ const char *name,
+ size_type max_num_msg,
size_type max_msg_size,
const permissions &perm = permissions());
- //!Opens or creates a process shared message queue with name "name".
- //!If the queue is created, the maximum number of messages will be "max_num_msg"
- //!and the maximum message size will be "max_msg_size". If queue was previously
+ //!Opens or creates a process shared message queue with name "name".
+ //!If the queue is created, the maximum number of messages will be "max_num_msg"
+ //!and the maximum message size will be "max_msg_size". If queue was previously
//!created the queue will be opened and "max_num_msg" and "max_msg_size" parameters
//!are ignored. Throws on error.
message_queue_t(open_or_create_t open_or_create,
- const char *name,
- size_type max_num_msg,
+ const char *name,
+ size_type max_num_msg,
size_type max_msg_size,
const permissions &perm = permissions());
- //!Opens a previously created process shared message queue with name "name".
- //!If the queue was not previously created or there are no free resources,
+ //!Opens a previously created process shared message queue with name "name".
+ //!If the queue was not previously created or there are no free resources,
//!throws an error.
message_queue_t(open_only_t open_only,
const char *name);
@@ -95,65 +95,65 @@ class message_queue_t
//!this resource. The resource can still be opened again calling
//!the open constructor overload. To erase the message queue from the system
//!use remove().
- ~message_queue_t();
+ ~message_queue_t();
- //!Sends a message stored in buffer "buffer" with size "buffer_size" in the
+ //!Sends a message stored in buffer "buffer" with size "buffer_size" in the
//!message queue with priority "priority". If the message queue is full
//!the sender is blocked. Throws interprocess_error on error.*/
- void send (const void *buffer, size_type buffer_size,
+ void send (const void *buffer, size_type buffer_size,
unsigned int priority);
- //!Sends a message stored in buffer "buffer" with size "buffer_size" through the
+ //!Sends a message stored in buffer "buffer" with size "buffer_size" through the
//!message queue with priority "priority". If the message queue is full
//!the sender is not blocked and returns false, otherwise returns true.
//!Throws interprocess_error on error.
- bool try_send (const void *buffer, size_type buffer_size,
+ bool try_send (const void *buffer, size_type buffer_size,
unsigned int priority);
- //!Sends a message stored in buffer "buffer" with size "buffer_size" in the
+ //!Sends a message stored in buffer "buffer" with size "buffer_size" in the
//!message queue with priority "priority". If the message queue is full
//!the sender retries until time "abs_time" is reached. Returns true if
//!the message has been successfully sent. Returns false if timeout is reached.
//!Throws interprocess_error on error.
- bool timed_send (const void *buffer, size_type buffer_size,
+ bool timed_send (const void *buffer, size_type buffer_size,
unsigned int priority, const boost::posix_time::ptime& abs_time);
- //!Receives a message from the message queue. The message is stored in buffer
- //!"buffer", which has size "buffer_size". The received message has size
+ //!Receives a message from the message queue. The message is stored in buffer
+ //!"buffer", which has size "buffer_size". The received message has size
//!"recvd_size" and priority "priority". If the message queue is empty
//!the receiver is blocked. Throws interprocess_error on error.
- void receive (void *buffer, size_type buffer_size,
+ void receive (void *buffer, size_type buffer_size,
size_type &recvd_size,unsigned int &priority);
- //!Receives a message from the message queue. The message is stored in buffer
- //!"buffer", which has size "buffer_size". The received message has size
+ //!Receives a message from the message queue. The message is stored in buffer
+ //!"buffer", which has size "buffer_size". The received message has size
//!"recvd_size" and priority "priority". If the message queue is empty
//!the receiver is not blocked and returns false, otherwise returns true.
//!Throws interprocess_error on error.
- bool try_receive (void *buffer, size_type buffer_size,
+ bool try_receive (void *buffer, size_type buffer_size,
size_type &recvd_size,unsigned int &priority);
- //!Receives a message from the message queue. The message is stored in buffer
- //!"buffer", which has size "buffer_size". The received message has size
+ //!Receives a message from the message queue. The message is stored in buffer
+ //!"buffer", which has size "buffer_size". The received message has size
//!"recvd_size" and priority "priority". If the message queue is empty
//!the receiver retries until time "abs_time" is reached. Returns true if
//!the message has been successfully sent. Returns false if timeout is reached.
//!Throws interprocess_error on error.
- bool timed_receive (void *buffer, size_type buffer_size,
+ bool timed_receive (void *buffer, size_type buffer_size,
size_type &recvd_size,unsigned int &priority,
const boost::posix_time::ptime &abs_time);
//!Returns the maximum number of messages allowed by the queue. The message
- //!queue must be opened or created previously. Otherwise, returns 0.
+ //!queue must be opened or created previously. Otherwise, returns 0.
//!Never throws
size_type get_max_msg() const;
//!Returns the maximum size of message allowed by the queue. The message
- //!queue must be opened or created previously. Otherwise, returns 0.
+ //!queue must be opened or created previously. Otherwise, returns 0.
//!Never throws
size_type get_max_msg_size() const;
- //!Returns the number of messages currently stored.
+ //!Returns the number of messages currently stored.
//!Never throws
size_type get_num_msg();
@@ -161,16 +161,16 @@ class message_queue_t
//!Returns false on error. Never throws
static bool remove(const char *name);
- /// @cond
+ /// @cond
private:
typedef boost::posix_time::ptime ptime;
bool do_receive(block_t block,
- void *buffer, size_type buffer_size,
+ void *buffer, size_type buffer_size,
size_type &recvd_size, unsigned int &priority,
const ptime &abs_time);
bool do_send(block_t block,
- const void *buffer, size_type buffer_size,
+ const void *buffer, size_type buffer_size,
unsigned int priority, const ptime &abs_time);
//!Returns the needed memory size for the shared message queue.
@@ -187,7 +187,7 @@ namespace ipcdetail {
//!This header is the prefix of each message in the queue
template<class VoidPointer>
-class msg_hdr_t
+class msg_hdr_t
{
typedef VoidPointer void_pointer;
typedef typename boost::intrusive::
@@ -212,36 +212,36 @@ class priority_functor
rebind_pointer<msg_hdr_t<VoidPointer> >::type msg_hdr_ptr_t;
public:
- bool operator()(const msg_hdr_ptr_t &msg1,
+ bool operator()(const msg_hdr_ptr_t &msg1,
const msg_hdr_ptr_t &msg2) const
{ return msg1->priority < msg2->priority; }
};
-//!This header is placed in the beginning of the shared memory and contains
-//!the data to control the queue. This class initializes the shared memory
+//!This header is placed in the beginning of the shared memory and contains
+//!the data to control the queue. This class initializes the shared memory
//!in the following way: in ascending memory address with proper alignment
//!fillings:
//!
-//!-> mq_hdr_t:
+//!-> mq_hdr_t:
//! Main control block that controls the rest of the elements
//!
//!-> offset_ptr<msg_hdr_t> index [max_num_msg]
-//! An array of pointers with size "max_num_msg" called index. Each pointer
-//! points to a preallocated message. The elements of this array are
+//! An array of pointers with size "max_num_msg" called index. Each pointer
+//! points to a preallocated message. The elements of this array are
//! reordered in runtime in the following way:
//!
-//! When the current number of messages is "cur_num_msg", the first
+//! When the current number of messages is "cur_num_msg", the first
//! "cur_num_msg" pointers point to inserted messages and the rest
//! point to free messages. The first "cur_num_msg" pointers are
-//! ordered by the priority of the pointed message and by insertion order
-//! if two messages have the same priority. So the next message to be
+//! ordered by the priority of the pointed message and by insertion order
+//! if two messages have the same priority. So the next message to be
//! used in a "receive" is pointed by index [cur_num_msg-1] and the first free
//! message ready to be used in a "send" operation is index [cur_num_msg].
//! This transforms index in a fixed size priority queue with an embedded free
//! message queue.
//!
//!-> struct message_t
-//! {
+//! {
//! msg_hdr_t header;
//! char[max_msg_size] data;
//! } messages [max_num_msg];
@@ -252,7 +252,7 @@ class priority_functor
template<class VoidPointer>
class mq_hdr_t
: public ipcdetail::priority_functor<VoidPointer>
-{
+{
typedef VoidPointer void_pointer;
typedef msg_hdr_t<void_pointer> msg_header;
typedef typename boost::intrusive::
@@ -266,12 +266,12 @@ class mq_hdr_t
rebind_pointer<msg_hdr_ptr_t>::type msg_hdr_ptr_ptr_t;
public:
- //!Constructor. This object must be constructed in the beginning of the
+ //!Constructor. This object must be constructed in the beginning of the
//!shared memory of the size returned by the function "get_mem_size".
//!This constructor initializes the needed resources and creates
//!the internal structures like the priority index. This can throw.*/
mq_hdr_t(size_type max_num_msg, size_type max_msg_size)
- : m_max_num_msg(max_num_msg),
+ : m_max_num_msg(max_num_msg),
m_max_msg_size(max_msg_size),
m_cur_num_msg(0)
{ this->initialize_memory(); }
@@ -298,7 +298,7 @@ class mq_hdr_t
//!Inserts the first free message in the priority queue
void queue_free_msg()
- {
+ {
//Get free msg
msg_hdr_ptr_t free = mp_index[m_cur_num_msg];
//Get priority queue's range
@@ -312,19 +312,19 @@ class mq_hdr_t
++m_cur_num_msg;
}
- //!Returns the number of bytes needed to construct a message queue with
- //!"max_num_size" maximum number of messages and "max_msg_size" maximum
+ //!Returns the number of bytes needed to construct a message queue with
+ //!"max_num_size" maximum number of messages and "max_msg_size" maximum
//!message size. Never throws.
static size_type get_mem_size
(size_type max_msg_size, size_type max_num_msg)
{
- const size_type
+ const size_type
msg_hdr_align = ::boost::alignment_of<msg_header>::value,
index_align = ::boost::alignment_of<msg_hdr_ptr_t>::value,
r_hdr_size = ipcdetail::ct_rounded_size<sizeof(mq_hdr_t), index_align>::value,
r_index_size = ipcdetail::get_rounded_size(sizeof(msg_hdr_ptr_t)*max_num_msg, msg_hdr_align),
r_max_msg_size = ipcdetail::get_rounded_size(max_msg_size, msg_hdr_align) + sizeof(msg_header);
- return r_hdr_size + r_index_size + (max_num_msg*r_max_msg_size) +
+ return r_hdr_size + r_index_size + (max_num_msg*r_max_msg_size) +
ipcdetail::managed_open_or_create_impl<shared_memory_object>::ManagedOpenOrCreateUserOffset;
}
@@ -332,7 +332,7 @@ class mq_hdr_t
//!message index. Never throws.
void initialize_memory()
{
- const size_type
+ const size_type
msg_hdr_align = ::boost::alignment_of<msg_header>::value,
index_align = ::boost::alignment_of<msg_hdr_ptr_t>::value,
r_hdr_size = ipcdetail::ct_rounded_size<sizeof(mq_hdr_t), index_align>::value,
@@ -345,7 +345,7 @@ class mq_hdr_t
//Pointer to the first message header
msg_header *msg_hdr = reinterpret_cast<msg_header*>
- (reinterpret_cast<char*>(this)+r_hdr_size+r_index_size);
+ (reinterpret_cast<char*>(this)+r_hdr_size+r_index_size);
//Initialize the pointer to the index
mp_index = index;
@@ -376,7 +376,7 @@ class mq_hdr_t
};
-//!This is the atomic functor to be executed when creating or opening
+//!This is the atomic functor to be executed when creating or opening
//!shared memory. Never throws
template<class VoidPointer>
class initialization_func_t
@@ -388,7 +388,7 @@ class initialization_func_t
typedef typename boost::intrusive::pointer_traits<char_ptr>::difference_type difference_type;
typedef typename boost::make_unsigned<difference_type>::type size_type;
- initialization_func_t(size_type maxmsg = 0,
+ initialization_func_t(size_type maxmsg = 0,
size_type maxmsgsize = 0)
: m_maxmsg (maxmsg), m_maxmsgsize(maxmsgsize) {}
@@ -403,7 +403,7 @@ class initialization_func_t
new (mptr) mq_hdr_t<VoidPointer>(m_maxmsg, m_maxmsgsize);
}
BOOST_CATCH(...){
- return false;
+ return false;
}
BOOST_CATCH_END
}
@@ -426,13 +426,13 @@ inline typename message_queue_t<VoidPointer>::size_type message_queue_t<VoidPoin
template<class VoidPointer>
inline message_queue_t<VoidPointer>::message_queue_t(create_only_t create_only,
- const char *name,
- size_type max_num_msg,
+ const char *name,
+ size_type max_num_msg,
size_type max_msg_size,
const permissions &perm)
//Create shared memory and execute functor atomically
- : m_shmem(create_only,
- name,
+ : m_shmem(create_only,
+ name,
get_mem_size(max_msg_size, max_num_msg),
read_write,
static_cast<void*>(0),
@@ -443,13 +443,13 @@ inline message_queue_t<VoidPointer>::message_queue_t(create_only_t create_only,
template<class VoidPointer>
inline message_queue_t<VoidPointer>::message_queue_t(open_or_create_t open_or_create,
- const char *name,
- size_type max_num_msg,
+ const char *name,
+ size_type max_num_msg,
size_type max_msg_size,
const permissions &perm)
//Create shared memory and execute functor atomically
- : m_shmem(open_or_create,
- name,
+ : m_shmem(open_or_create,
+ name,
get_mem_size(max_msg_size, max_num_msg),
read_write,
static_cast<void*>(0),
@@ -462,7 +462,7 @@ template<class VoidPointer>
inline message_queue_t<VoidPointer>::message_queue_t(open_only_t open_only,
const char *name)
//Create shared memory and execute functor atomically
- : m_shmem(open_only,
+ : m_shmem(open_only,
name,
read_write,
static_cast<void*>(0),
@@ -494,7 +494,7 @@ inline bool message_queue_t<VoidPointer>::timed_send
template<class VoidPointer>
inline bool message_queue_t<VoidPointer>::do_send(block_t block,
- const void *buffer, size_type buffer_size,
+ const void *buffer, size_type buffer_size,
unsigned int priority, const boost::posix_time::ptime &abs_time)
{
ipcdetail::mq_hdr_t<VoidPointer> *p_hdr = static_cast<ipcdetail::mq_hdr_t<VoidPointer>*>(m_shmem.get_user_address());
@@ -536,7 +536,7 @@ inline bool message_queue_t<VoidPointer>::do_send(block_t block,
break;
}
}
-
+
//Get the first free message from free message queue
ipcdetail::msg_hdr_t<VoidPointer> *free_msg = p_hdr->free_msg();
if (free_msg == 0) {
@@ -553,7 +553,7 @@ inline bool message_queue_t<VoidPointer>::do_send(block_t block,
// bool was_empty = p_hdr->is_empty();
//Insert the first free message in the priority queue
p_hdr->queue_free_msg();
-
+
//If this message changes the queue empty state, notify it to receivers
// if (was_empty){
p_hdr->m_cond_recv.notify_one();
@@ -564,19 +564,19 @@ inline bool message_queue_t<VoidPointer>::do_send(block_t block,
}
template<class VoidPointer>
-inline void message_queue_t<VoidPointer>::receive(void *buffer, size_type buffer_size,
+inline void message_queue_t<VoidPointer>::receive(void *buffer, size_type buffer_size,
size_type &recvd_size, unsigned int &priority)
{ this->do_receive(blocking, buffer, buffer_size, recvd_size, priority, ptime()); }
template<class VoidPointer>
inline bool
- message_queue_t<VoidPointer>::try_receive(void *buffer, size_type buffer_size,
+ message_queue_t<VoidPointer>::try_receive(void *buffer, size_type buffer_size,
size_type &recvd_size, unsigned int &priority)
{ return this->do_receive(non_blocking, buffer, buffer_size, recvd_size, priority, ptime()); }
template<class VoidPointer>
inline bool
- message_queue_t<VoidPointer>::timed_receive(void *buffer, size_type buffer_size,
+ message_queue_t<VoidPointer>::timed_receive(void *buffer, size_type buffer_size,
size_type &recvd_size, unsigned int &priority,
const boost::posix_time::ptime &abs_time)
{
@@ -590,7 +590,7 @@ inline bool
template<class VoidPointer>
inline bool
message_queue_t<VoidPointer>::do_receive(block_t block,
- void *buffer, size_type buffer_size,
+ void *buffer, size_type buffer_size,
size_type &recvd_size, unsigned int &priority,
const boost::posix_time::ptime &abs_time)
{
@@ -666,20 +666,20 @@ inline bool
template<class VoidPointer>
inline typename message_queue_t<VoidPointer>::size_type message_queue_t<VoidPointer>::get_max_msg() const
-{
+{
ipcdetail::mq_hdr_t<VoidPointer> *p_hdr = static_cast<ipcdetail::mq_hdr_t<VoidPointer>*>(m_shmem.get_user_address());
return p_hdr ? p_hdr->m_max_num_msg : 0; }
template<class VoidPointer>
inline typename message_queue_t<VoidPointer>::size_type message_queue_t<VoidPointer>::get_max_msg_size() const
-{
+{
ipcdetail::mq_hdr_t<VoidPointer> *p_hdr = static_cast<ipcdetail::mq_hdr_t<VoidPointer>*>(m_shmem.get_user_address());
- return p_hdr ? p_hdr->m_max_msg_size : 0;
+ return p_hdr ? p_hdr->m_max_msg_size : 0;
}
template<class VoidPointer>
inline typename message_queue_t<VoidPointer>::size_type message_queue_t<VoidPointer>::get_num_msg()
-{
+{
ipcdetail::mq_hdr_t<VoidPointer> *p_hdr = static_cast<ipcdetail::mq_hdr_t<VoidPointer>*>(m_shmem.get_user_address());
if(p_hdr){
//---------------------------------------------
@@ -688,7 +688,7 @@ inline typename message_queue_t<VoidPointer>::size_type message_queue_t<VoidPoin
return p_hdr->m_cur_num_msg;
}
- return 0;
+ return 0;
}
template<class VoidPointer>
diff --git a/boost/interprocess/managed_external_buffer.hpp b/boost/interprocess/managed_external_buffer.hpp
index a2cf47f4e6..e268e57601 100644
--- a/boost/interprocess/managed_external_buffer.hpp
+++ b/boost/interprocess/managed_external_buffer.hpp
@@ -23,34 +23,34 @@
#include <boost/assert.hpp>
//These includes needed to fulfill default template parameters of
//predeclarations in interprocess_fwd.hpp
-#include <boost/interprocess/mem_algo/rbtree_best_fit.hpp>
+#include <boost/interprocess/mem_algo/rbtree_best_fit.hpp>
#include <boost/interprocess/sync/mutex_family.hpp>
#include <boost/interprocess/indexes/iset_index.hpp>
//!\file
-//!Describes a named user memory allocation user class.
+//!Describes a named user memory allocation user class.
namespace boost {
namespace interprocess {
-//!A basic user memory named object creation class. Inherits all
-//!basic functionality from
+//!A basic user memory named object creation class. Inherits all
+//!basic functionality from
//!basic_managed_memory_impl<CharType, AllocationAlgorithm, IndexType>*/
template
<
- class CharType,
- class AllocationAlgorithm,
+ class CharType,
+ class AllocationAlgorithm,
template<class IndexConfig> class IndexType
>
-class basic_managed_external_buffer
+class basic_managed_external_buffer
: public ipcdetail::basic_managed_memory_impl <CharType, AllocationAlgorithm, IndexType>
{
/// @cond
- typedef ipcdetail::basic_managed_memory_impl
+ typedef ipcdetail::basic_managed_memory_impl
<CharType, AllocationAlgorithm, IndexType> base_t;
BOOST_MOVABLE_BUT_NOT_COPYABLE(basic_managed_external_buffer)
/// @endcond
-
+
public:
typedef typename base_t::size_type size_type;
diff --git a/boost/interprocess/managed_heap_memory.hpp b/boost/interprocess/managed_heap_memory.hpp
index 74869bb1f5..87107855f2 100644
--- a/boost/interprocess/managed_heap_memory.hpp
+++ b/boost/interprocess/managed_heap_memory.hpp
@@ -24,32 +24,32 @@
#include <boost/detail/no_exceptions_support.hpp>
//These includes needed to fulfill default template parameters of
//predeclarations in interprocess_fwd.hpp
-#include <boost/interprocess/mem_algo/rbtree_best_fit.hpp>
+#include <boost/interprocess/mem_algo/rbtree_best_fit.hpp>
#include <boost/interprocess/sync/mutex_family.hpp>
#include <boost/interprocess/indexes/iset_index.hpp>
//!\file
-//!Describes a named heap memory allocation user class.
+//!Describes a named heap memory allocation user class.
namespace boost {
namespace interprocess {
-//!A basic heap memory named object creation class. Initializes the
-//!heap memory segment. Inherits all basic functionality from
+//!A basic heap memory named object creation class. Initializes the
+//!heap memory segment. Inherits all basic functionality from
//!basic_managed_memory_impl<CharType, AllocationAlgorithm, IndexType>*/
template
<
- class CharType,
- class AllocationAlgorithm,
+ class CharType,
+ class AllocationAlgorithm,
template<class IndexConfig> class IndexType
>
-class basic_managed_heap_memory
+class basic_managed_heap_memory
: public ipcdetail::basic_managed_memory_impl <CharType, AllocationAlgorithm, IndexType>
{
/// @cond
private:
- typedef ipcdetail::basic_managed_memory_impl
+ typedef ipcdetail::basic_managed_memory_impl
<CharType, AllocationAlgorithm, IndexType> base_t;
BOOST_MOVABLE_BUT_NOT_COPYABLE(basic_managed_heap_memory)
/// @endcond
@@ -90,16 +90,16 @@ class basic_managed_heap_memory
}
//!Tries to resize internal heap memory so that
- //!we have room for more objects.
- //!WARNING: If memory is reallocated, all the objects will
+ //!we have room for more objects.
+ //!WARNING: If memory is reallocated, all the objects will
//!be binary-copied to the new buffer. To be able to use
//!this function, all pointers constructed in this buffer
//!must be offset pointers. Otherwise, the result is undefined.
//!Returns true if the growth has been successful, so you will
- //!have some extra bytes to allocate new objects. If returns
+ //!have some extra bytes to allocate new objects. If returns
//!false, the heap allocation has failed.
bool grow(size_type extra_bytes)
- {
+ {
//If memory is reallocated, data will
//be automatically copied
BOOST_TRY{
@@ -129,7 +129,7 @@ class basic_managed_heap_memory
private:
//!Frees resources. Never throws.
void priv_close()
- {
+ {
base_t::destroy_impl();
std::vector<char>().swap(m_heapmem);
}
diff --git a/boost/interprocess/managed_mapped_file.hpp b/boost/interprocess/managed_mapped_file.hpp
index 218fa9783c..5a351adfa5 100644
--- a/boost/interprocess/managed_mapped_file.hpp
+++ b/boost/interprocess/managed_mapped_file.hpp
@@ -26,23 +26,23 @@
#include <boost/interprocess/permissions.hpp>
//These includes needed to fulfill default template parameters of
//predeclarations in interprocess_fwd.hpp
-#include <boost/interprocess/mem_algo/rbtree_best_fit.hpp>
+#include <boost/interprocess/mem_algo/rbtree_best_fit.hpp>
#include <boost/interprocess/sync/mutex_family.hpp>
#include <boost/interprocess/indexes/iset_index.hpp>
namespace boost {
namespace interprocess {
-//!A basic mapped file named object creation class. Initializes the
-//!mapped file. Inherits all basic functionality from
+//!A basic mapped file named object creation class. Initializes the
+//!mapped file. Inherits all basic functionality from
//!basic_managed_memory_impl<CharType, AllocationAlgorithm, IndexType>
template
<
- class CharType,
- class AllocationAlgorithm,
+ class CharType,
+ class AllocationAlgorithm,
template<class IndexConfig> class IndexType
>
-class basic_managed_mapped_file
+class basic_managed_mapped_file
: public ipcdetail::basic_managed_memory_impl
<CharType, AllocationAlgorithm, IndexType
,ipcdetail::managed_open_or_create_impl< ipcdetail::file_wrapper
@@ -51,7 +51,7 @@ class basic_managed_mapped_file
{
/// @cond
public:
- typedef ipcdetail::basic_managed_memory_impl
+ typedef ipcdetail::basic_managed_memory_impl
<CharType, AllocationAlgorithm, IndexType,
ipcdetail::managed_open_or_create_impl
<ipcdetail::file_wrapper, AllocationAlgorithm::Alignment>::ManagedOpenOrCreateUserOffset
@@ -61,7 +61,7 @@ class basic_managed_mapped_file
private:
- typedef ipcdetail::create_open_func<base_t> create_open_func_t;
+ typedef ipcdetail::create_open_func<base_t> create_open_func_t;
typedef ipcdetail::managed_open_or_create_impl< ipcdetail::file_wrapper
, AllocationAlgorithm::Alignment> managed_open_or_create_type;
@@ -75,16 +75,16 @@ class basic_managed_mapped_file
public: //functions
- //!Creates mapped file and creates and places the segment manager.
+ //!Creates mapped file and creates and places the segment manager.
//!This can throw.
basic_managed_mapped_file()
{}
- //!Creates mapped file and creates and places the segment manager.
+ //!Creates mapped file and creates and places the segment manager.
//!This can throw.
basic_managed_mapped_file(create_only_t create_only, const char *name,
size_type size, const void *addr = 0, const permissions &perm = permissions())
- : m_mfile(create_only, name, size, read_write, addr,
+ : m_mfile(create_only, name, size, read_write, addr,
create_open_func_t(get_this_pointer(), ipcdetail::DoCreate), perm)
{}
@@ -93,39 +93,39 @@ class basic_managed_mapped_file
//!segment.
//!This can throw.
basic_managed_mapped_file (open_or_create_t open_or_create,
- const char *name, size_type size,
+ const char *name, size_type size,
const void *addr = 0, const permissions &perm = permissions())
: m_mfile(open_or_create, name, size, read_write, addr,
- create_open_func_t(get_this_pointer(),
+ create_open_func_t(get_this_pointer(),
ipcdetail::DoOpenOrCreate), perm)
{}
//!Connects to a created mapped file and its segment manager.
//!This can throw.
- basic_managed_mapped_file (open_only_t open_only, const char* name,
+ basic_managed_mapped_file (open_only_t open_only, const char* name,
const void *addr = 0)
: m_mfile(open_only, name, read_write, addr,
- create_open_func_t(get_this_pointer(),
+ create_open_func_t(get_this_pointer(),
ipcdetail::DoOpen))
{}
//!Connects to a created mapped file and its segment manager
//!in copy_on_write mode.
//!This can throw.
- basic_managed_mapped_file (open_copy_on_write_t, const char* name,
+ basic_managed_mapped_file (open_copy_on_write_t, const char* name,
const void *addr = 0)
- : m_mfile(open_only, name, copy_on_write, addr,
- create_open_func_t(get_this_pointer(),
+ : m_mfile(open_only, name, copy_on_write, addr,
+ create_open_func_t(get_this_pointer(),
ipcdetail::DoOpen))
{}
//!Connects to a created mapped file and its segment manager
//!in read-only mode.
//!This can throw.
- basic_managed_mapped_file (open_read_only_t, const char* name,
+ basic_managed_mapped_file (open_read_only_t, const char* name,
const void *addr = 0)
- : m_mfile(open_only, name, read_only, addr,
- create_open_func_t(get_this_pointer(),
+ : m_mfile(open_only, name, read_only, addr,
+ create_open_func_t(get_this_pointer(),
ipcdetail::DoOpen))
{}
@@ -167,8 +167,8 @@ class basic_managed_mapped_file
bool flush()
{ return m_mfile.flush(); }
- //!Tries to resize mapped file so that we have room for
- //!more objects.
+ //!Tries to resize mapped file so that we have room for
+ //!more objects.
//!
//!This function is not synchronized so no other thread or process should
//!be reading or writing the file
diff --git a/boost/interprocess/managed_shared_memory.hpp b/boost/interprocess/managed_shared_memory.hpp
index cec9591be4..0f74c1a0b9 100644
--- a/boost/interprocess/managed_shared_memory.hpp
+++ b/boost/interprocess/managed_shared_memory.hpp
@@ -25,23 +25,23 @@
#include <boost/interprocess/permissions.hpp>
//These includes needed to fulfill default template parameters of
//predeclarations in interprocess_fwd.hpp
-#include <boost/interprocess/mem_algo/rbtree_best_fit.hpp>
+#include <boost/interprocess/mem_algo/rbtree_best_fit.hpp>
#include <boost/interprocess/sync/mutex_family.hpp>
namespace boost {
namespace interprocess {
-//!A basic shared memory named object creation class. Initializes the
-//!shared memory segment. Inherits all basic functionality from
+//!A basic shared memory named object creation class. Initializes the
+//!shared memory segment. Inherits all basic functionality from
//!basic_managed_memory_impl<CharType, AllocationAlgorithm, IndexType>*/
template
<
- class CharType,
- class AllocationAlgorithm,
+ class CharType,
+ class AllocationAlgorithm,
template<class IndexConfig> class IndexType
>
-class basic_managed_shared_memory
+class basic_managed_shared_memory
: public ipcdetail::basic_managed_memory_impl
<CharType, AllocationAlgorithm, IndexType
,ipcdetail::managed_open_or_create_impl<shared_memory_object
@@ -50,7 +50,7 @@ class basic_managed_shared_memory
, AllocationAlgorithm::Alignment>
{
/// @cond
- typedef ipcdetail::basic_managed_memory_impl
+ typedef ipcdetail::basic_managed_memory_impl
<CharType, AllocationAlgorithm, IndexType,
ipcdetail::managed_open_or_create_impl
< shared_memory_object, AllocationAlgorithm::Alignment>::ManagedOpenOrCreateUserOffset> base_t;
@@ -87,12 +87,12 @@ class basic_managed_shared_memory
basic_managed_shared_memory()
{}
- //!Creates shared memory and creates and places the segment manager.
+ //!Creates shared memory and creates and places the segment manager.
//!This can throw.
basic_managed_shared_memory(create_only_t create_only, const char *name,
size_type size, const void *addr = 0, const permissions& perm = permissions())
: base_t()
- , base2_t(create_only, name, size, read_write, addr,
+ , base2_t(create_only, name, size, read_write, addr,
create_open_func_t(get_this_pointer(), ipcdetail::DoCreate), perm)
{}
@@ -101,43 +101,43 @@ class basic_managed_shared_memory
//!segment.
//!This can throw.
basic_managed_shared_memory (open_or_create_t open_or_create,
- const char *name, size_type size,
+ const char *name, size_type size,
const void *addr = 0, const permissions& perm = permissions())
: base_t()
- , base2_t(open_or_create, name, size, read_write, addr,
- create_open_func_t(get_this_pointer(),
+ , base2_t(open_or_create, name, size, read_write, addr,
+ create_open_func_t(get_this_pointer(),
ipcdetail::DoOpenOrCreate), perm)
{}
//!Connects to a created shared memory and its segment manager.
//!in copy_on_write mode.
//!This can throw.
- basic_managed_shared_memory (open_copy_on_write_t, const char* name,
+ basic_managed_shared_memory (open_copy_on_write_t, const char* name,
const void *addr = 0)
: base_t()
- , base2_t(open_only, name, copy_on_write, addr,
- create_open_func_t(get_this_pointer(),
+ , base2_t(open_only, name, copy_on_write, addr,
+ create_open_func_t(get_this_pointer(),
ipcdetail::DoOpen))
{}
//!Connects to a created shared memory and its segment manager.
//!in read-only mode.
//!This can throw.
- basic_managed_shared_memory (open_read_only_t, const char* name,
+ basic_managed_shared_memory (open_read_only_t, const char* name,
const void *addr = 0)
: base_t()
- , base2_t(open_only, name, read_only, addr,
- create_open_func_t(get_this_pointer(),
+ , base2_t(open_only, name, read_only, addr,
+ create_open_func_t(get_this_pointer(),
ipcdetail::DoOpen))
{}
//!Connects to a created shared memory and its segment manager.
//!This can throw.
- basic_managed_shared_memory (open_only_t open_only, const char* name,
+ basic_managed_shared_memory (open_only_t open_only, const char* name,
const void *addr = 0)
: base_t()
- , base2_t(open_only, name, read_write, addr,
- create_open_func_t(get_this_pointer(),
+ , base2_t(open_only, name, read_write, addr,
+ create_open_func_t(get_this_pointer(),
ipcdetail::DoOpen))
{}
@@ -168,7 +168,7 @@ class basic_managed_shared_memory
}
//!Tries to resize the managed shared memory object so that we have
- //!room for more objects.
+ //!room for more objects.
//!
//!This function is not synchronized so no other thread or process should
//!be reading or writing the file
@@ -187,12 +187,6 @@ class basic_managed_shared_memory
return base_t::template shrink_to_fit
<basic_managed_shared_memory>(shmname);
}
-
- bool flush()
- {
- return this->base2_t::flush();
- }
-
/// @cond
//!Tries to find a previous named allocation address. Returns a memory
diff --git a/boost/interprocess/managed_windows_shared_memory.hpp b/boost/interprocess/managed_windows_shared_memory.hpp
index 959194cc19..414007a614 100644
--- a/boost/interprocess/managed_windows_shared_memory.hpp
+++ b/boost/interprocess/managed_windows_shared_memory.hpp
@@ -25,15 +25,15 @@
#include <boost/move/move.hpp>
//These includes needed to fulfill default template parameters of
//predeclarations in interprocess_fwd.hpp
-#include <boost/interprocess/mem_algo/rbtree_best_fit.hpp>
+#include <boost/interprocess/mem_algo/rbtree_best_fit.hpp>
#include <boost/interprocess/sync/mutex_family.hpp>
#include <boost/interprocess/indexes/iset_index.hpp>
namespace boost {
namespace interprocess {
-//!A basic managed windows shared memory creation class. Initializes the
-//!shared memory segment. Inherits all basic functionality from
+//!A basic managed windows shared memory creation class. Initializes the
+//!shared memory segment. Inherits all basic functionality from
//!basic_managed_memory_impl<CharType, AllocationAlgorithm, IndexType>
//!Unlike basic_managed_shared_memory, it has
//!no kernel persistence and the shared memory is destroyed
@@ -45,11 +45,11 @@ namespace interprocess {
//!basic_managed_shared_memory can't communicate between them.
template
<
- class CharType,
- class AllocationAlgorithm,
+ class CharType,
+ class AllocationAlgorithm,
template<class IndexConfig> class IndexType
>
-class basic_managed_windows_shared_memory
+class basic_managed_windows_shared_memory
: public ipcdetail::basic_managed_memory_impl
< CharType, AllocationAlgorithm, IndexType
, ipcdetail::managed_open_or_create_impl
@@ -60,7 +60,7 @@ class basic_managed_windows_shared_memory
{
/// @cond
private:
- typedef ipcdetail::basic_managed_memory_impl
+ typedef ipcdetail::basic_managed_memory_impl
<CharType, AllocationAlgorithm, IndexType,
ipcdetail::managed_open_or_create_impl
<windows_shared_memory, AllocationAlgorithm::Alignment, false>::ManagedOpenOrCreateUserOffset> base_t;
@@ -82,12 +82,12 @@ class basic_managed_windows_shared_memory
basic_managed_windows_shared_memory()
{}
- //!Creates shared memory and creates and places the segment manager.
+ //!Creates shared memory and creates and places the segment manager.
//!This can throw.
basic_managed_windows_shared_memory
(create_only_t create_only, const char *name,
size_type size, const void *addr = 0, const permissions &perm = permissions())
- : m_wshm(create_only, name, size, read_write, addr,
+ : m_wshm(create_only, name, size, read_write, addr,
create_open_func_t(get_this_pointer(), ipcdetail::DoCreate), perm)
{}
@@ -97,11 +97,11 @@ class basic_managed_windows_shared_memory
//!This can throw.
basic_managed_windows_shared_memory
(open_or_create_t open_or_create,
- const char *name, size_type size,
+ const char *name, size_type size,
const void *addr = 0,
const permissions &perm = permissions())
- : m_wshm(open_or_create, name, size, read_write, addr,
- create_open_func_t(get_this_pointer(),
+ : m_wshm(open_or_create, name, size, read_write, addr,
+ create_open_func_t(get_this_pointer(),
ipcdetail::DoOpenOrCreate), perm)
{}
@@ -109,8 +109,8 @@ class basic_managed_windows_shared_memory
//!This can throw.
basic_managed_windows_shared_memory
(open_only_t open_only, const char* name, const void *addr = 0)
- : m_wshm(open_only, name, read_write, addr,
- create_open_func_t(get_this_pointer(),
+ : m_wshm(open_only, name, read_write, addr,
+ create_open_func_t(get_this_pointer(),
ipcdetail::DoOpen))
{}
@@ -119,7 +119,7 @@ class basic_managed_windows_shared_memory
//!This can throw.
basic_managed_windows_shared_memory
(open_copy_on_write_t, const char* name, const void *addr = 0)
- : m_wshm(open_only, name, copy_on_write, addr,
+ : m_wshm(open_only, name, copy_on_write, addr,
create_open_func_t(get_this_pointer(), ipcdetail::DoOpen))
{}
@@ -129,7 +129,7 @@ class basic_managed_windows_shared_memory
basic_managed_windows_shared_memory
(open_read_only_t, const char* name, const void *addr = 0)
: base_t()
- , m_wshm(open_only, name, read_only, addr,
+ , m_wshm(open_only, name, read_only, addr,
create_open_func_t(get_this_pointer(), ipcdetail::DoOpen))
{}
diff --git a/boost/interprocess/managed_xsi_shared_memory.hpp b/boost/interprocess/managed_xsi_shared_memory.hpp
index 9601920254..dc909f6824 100644
--- a/boost/interprocess/managed_xsi_shared_memory.hpp
+++ b/boost/interprocess/managed_xsi_shared_memory.hpp
@@ -28,7 +28,7 @@
#include <boost/interprocess/creation_tags.hpp>
//These includes needed to fulfill default template parameters of
//predeclarations in interprocess_fwd.hpp
-#include <boost/interprocess/mem_algo/rbtree_best_fit.hpp>
+#include <boost/interprocess/mem_algo/rbtree_best_fit.hpp>
#include <boost/interprocess/sync/mutex_family.hpp>
#include <boost/interprocess/indexes/iset_index.hpp>
@@ -36,16 +36,16 @@ namespace boost {
namespace interprocess {
-//!A basic X/Open System Interface (XSI) shared memory named object creation class. Initializes the
-//!shared memory segment. Inherits all basic functionality from
+//!A basic X/Open System Interface (XSI) shared memory named object creation class. Initializes the
+//!shared memory segment. Inherits all basic functionality from
//!basic_managed_memory_impl<CharType, AllocationAlgorithm, IndexType>*/
template
<
- class CharType,
- class AllocationAlgorithm,
+ class CharType,
+ class AllocationAlgorithm,
template<class IndexConfig> class IndexType
>
-class basic_managed_xsi_shared_memory
+class basic_managed_xsi_shared_memory
: public ipcdetail::basic_managed_memory_impl
<CharType, AllocationAlgorithm, IndexType
,ipcdetail::managed_open_or_create_impl
@@ -61,7 +61,7 @@ class basic_managed_xsi_shared_memory
public:
typedef ipcdetail::managed_open_or_create_impl
<xsi_shared_memory_file_wrapper, AllocationAlgorithm::Alignment, false, true> base2_t;
- typedef ipcdetail::basic_managed_memory_impl
+ typedef ipcdetail::basic_managed_memory_impl
<CharType, AllocationAlgorithm, IndexType,
base2_t::ManagedOpenOrCreateUserOffset> base_t;
@@ -92,12 +92,12 @@ class basic_managed_xsi_shared_memory
basic_managed_xsi_shared_memory()
{}
- //!Creates shared memory and creates and places the segment manager.
+ //!Creates shared memory and creates and places the segment manager.
//!This can throw.
basic_managed_xsi_shared_memory(create_only_t create_only, const xsi_key &key,
std::size_t size, const void *addr = 0, const permissions& perm = permissions())
: base_t()
- , base2_t(create_only, key, size, read_write, addr,
+ , base2_t(create_only, key, size, read_write, addr,
create_open_func_t(get_this_pointer(), ipcdetail::DoCreate), perm)
{}
@@ -106,32 +106,32 @@ class basic_managed_xsi_shared_memory
//!segment.
//!This can throw.
basic_managed_xsi_shared_memory (open_or_create_t open_or_create,
- const xsi_key &key, std::size_t size,
+ const xsi_key &key, std::size_t size,
const void *addr = 0, const permissions& perm = permissions())
: base_t()
- , base2_t(open_or_create, key, size, read_write, addr,
- create_open_func_t(get_this_pointer(),
+ , base2_t(open_or_create, key, size, read_write, addr,
+ create_open_func_t(get_this_pointer(),
ipcdetail::DoOpenOrCreate), perm)
{}
//!Connects to a created shared memory and its segment manager.
//!in read-only mode.
//!This can throw.
- basic_managed_xsi_shared_memory (open_read_only_t, const xsi_key &key,
+ basic_managed_xsi_shared_memory (open_read_only_t, const xsi_key &key,
const void *addr = 0)
: base_t()
- , base2_t(open_only, key, read_only, addr,
- create_open_func_t(get_this_pointer(),
+ , base2_t(open_only, key, read_only, addr,
+ create_open_func_t(get_this_pointer(),
ipcdetail::DoOpen))
{}
//!Connects to a created shared memory and its segment manager.
//!This can throw.
- basic_managed_xsi_shared_memory (open_only_t open_only, const xsi_key &key,
+ basic_managed_xsi_shared_memory (open_only_t open_only, const xsi_key &key,
const void *addr = 0)
: base_t()
- , base2_t(open_only, key, read_write, addr,
- create_open_func_t(get_this_pointer(),
+ , base2_t(open_only, key, read_write, addr,
+ create_open_func_t(get_this_pointer(),
ipcdetail::DoOpen))
{}
diff --git a/boost/interprocess/mapped_region.hpp b/boost/interprocess/mapped_region.hpp
index eae3f36220..522c1e403a 100644
--- a/boost/interprocess/mapped_region.hpp
+++ b/boost/interprocess/mapped_region.hpp
@@ -20,10 +20,11 @@
#include <boost/interprocess/detail/utilities.hpp>
#include <boost/interprocess/detail/os_file_functions.hpp>
#include <string>
-#include <limits>
+#include <boost/cstdint.hpp>
-#if (defined BOOST_INTERPROCESS_WINDOWS)
+#if defined (BOOST_INTERPROCESS_WINDOWS)
# include <boost/interprocess/detail/win32_api.hpp>
+# include <boost/interprocess/sync/windows/sync_utils.hpp>
#else
# ifdef BOOST_HAS_UNISTD_H
# include <fcntl.h>
@@ -55,6 +56,10 @@ namespace ipcdetail{ class raw_mapped_region_creator; }
//!The mapped_region class represents a portion or region created from a
//!memory_mappable object.
+//!
+//!The OS can map a region bigger than the requested one, as region must
+//!be multiple of the page size, but mapped_region will always refer to
+//!the region specified by the user.
class mapped_region
{
/// @cond
@@ -65,9 +70,15 @@ class mapped_region
public:
//!Creates a mapping region of the mapped memory "mapping", starting in
- //!offset "offset", and the mapping's size will be "size". The mapping
- //!can be opened for read-only "read_only" or read-write
- //!"read_write.
+ //!offset "offset", and the mapping's size will be "size". The mapping
+ //!can be opened for read only, read-write or copy-on-write.
+ //!
+ //!If an address is specified, both the offset and the address must be
+ //!multiples of the page size.
+ //!
+ //!The OS could allocate more pages than size/page_size(), but get_address()
+ //!will always return the address passed in this function (if not null) and
+ //!get_size() will return the specified size.
template<class MemoryMappable>
mapped_region(const MemoryMappable& mapping
,mode_t mode
@@ -75,8 +86,8 @@ class mapped_region
,std::size_t size = 0
,const void *address = 0);
- //!Default constructor. Default constructor. Address will be 0 (nullptr).
- //!Size and offset will be 0.
+ //!Default constructor. Address will be 0 (nullptr).
+ //!Size will be 0.
//!Does not throw
mapped_region();
@@ -84,12 +95,12 @@ class mapped_region
//!region and "other" will be left in default constructor state.
mapped_region(BOOST_RV_REF(mapped_region) other)
#if defined (BOOST_INTERPROCESS_WINDOWS)
- : m_base(0), m_size(0), m_offset(0)
- , m_extra_offset(0)
+ : m_base(0), m_size(0)
+ , m_page_offset(0)
, m_mode(read_only)
- , m_file_mapping_hnd(ipcdetail::invalid_file())
+ , m_file_or_mapping_hnd(ipcdetail::invalid_file())
#else
- : m_base(0), m_size(0), m_offset(0), m_extra_offset(0), m_mode(read_only), m_is_xsi(false)
+ : m_base(0), m_size(0), m_page_offset(0), m_mode(read_only), m_is_xsi(false)
#endif
{ this->swap(other); }
@@ -106,33 +117,31 @@ class mapped_region
return *this;
}
- //!Returns the size of the mapping. Note for windows users: If
- //!windows_shared_memory is mapped using 0 as the size, it returns 0
- //!because the size is unknown. Never throws.
+ //!Returns the size of the mapping. Never throws.
std::size_t get_size() const;
//!Returns the base address of the mapping.
//!Never throws.
void* get_address() const;
- //!Returns the offset of the mapping from the beginning of the
- //!mapped memory. Never throws.
- offset_t get_offset() const;
-
- //!Returns the mode of the mapping used to construct the mapped file.
+ //!Returns the mode of the mapping used to construct the mapped region.
//!Never throws.
mode_t get_mode() const;
- //!Flushes to the disk a byte range within the mapped memory.
- //!Never throws
- bool flush(std::size_t mapping_offset = 0, std::size_t numbytes = 0);
+ //!Flushes to the disk a byte range within the mapped memory.
+ //!If 'async' is true, the function will return before flushing operation is completed
+ //!If 'async' is false, function will return once data has been written into the underlying
+ //!device (i.e., in mapped files OS cached information is written to disk).
+ //!Never throws. Returns false if operation could not be performed.
+ bool flush(std::size_t mapping_offset = 0, std::size_t numbytes = 0, bool async = true);
//!Swaps the mapped_region with another
//!mapped region
void swap(mapped_region &other);
//!Returns the size of the page. This size is the minimum memory that
- //!will be used by the system when mapping a memory mappable source.
+ //!will be used by the system when mapping a memory mappable source and
+ //!will restrict the address and the offset to map.
static std::size_t get_page_size();
/// @cond
@@ -140,6 +149,13 @@ class mapped_region
//!Closes a previously opened memory mapping. Never throws
void priv_close();
+ void* priv_map_address() const;
+ std::size_t priv_map_size() const;
+ bool priv_flush_param_check(std::size_t mapping_offset, void *&addr, std::size_t &numbytes) const;
+ static void priv_size_from_mapping_size
+ (offset_t mapping_size, offset_t offset, offset_t page_offset, std::size_t &size);
+ static offset_t priv_page_offset_addr_fixup(offset_t page_offset, const void *&addr);
+
template<int dummy>
struct page_size_holder
{
@@ -149,11 +165,10 @@ class mapped_region
void* m_base;
std::size_t m_size;
- offset_t m_offset;
- offset_t m_extra_offset;
+ std::size_t m_page_offset;
mode_t m_mode;
- #if (defined BOOST_INTERPROCESS_WINDOWS)
- file_handle_t m_file_mapping_hnd;
+ #if defined(BOOST_INTERPROCESS_WINDOWS)
+ file_handle_t m_file_or_mapping_hnd;
#else
bool m_is_xsi;
#endif
@@ -161,6 +176,10 @@ class mapped_region
friend class ipcdetail::interprocess_tester;
friend class ipcdetail::raw_mapped_region_creator;
void dont_close_on_destruction();
+ #if defined(BOOST_INTERPROCESS_WINDOWS) && !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION)
+ template<int Dummy>
+ static void destroy_syncs_in_range(const void *addr, std::size_t size);
+ #endif
/// @endcond
};
@@ -175,20 +194,74 @@ inline mapped_region::~mapped_region()
inline std::size_t mapped_region::get_size() const
{ return m_size; }
-inline offset_t mapped_region::get_offset() const
-{ return m_offset; }
-
inline mode_t mapped_region::get_mode() const
{ return m_mode; }
inline void* mapped_region::get_address() const
{ return m_base; }
+inline void* mapped_region::priv_map_address() const
+{ return static_cast<char*>(m_base) - m_page_offset; }
+
+inline std::size_t mapped_region::priv_map_size() const
+{ return m_size + m_page_offset; }
+
+inline bool mapped_region::priv_flush_param_check
+ (std::size_t mapping_offset, void *&addr, std::size_t &numbytes) const
+{
+ //Check some errors
+ if(m_base == 0)
+ return false;
+
+ if(mapping_offset >= m_size || (mapping_offset + numbytes) > m_size){
+ return false;
+ }
+
+ //Update flush size if the user does not provide it
+ if(numbytes == 0){
+ numbytes = m_size - mapping_offset;
+ }
+ addr = (char*)this->priv_map_address() + mapping_offset;
+ numbytes += m_page_offset;
+ return true;
+}
+
+inline void mapped_region::priv_size_from_mapping_size
+ (offset_t mapping_size, offset_t offset, offset_t page_offset, std::size_t &size)
+{
+ //Check if mapping size fits in the user address space
+ //as offset_t is the maximum file size and its signed.
+ if(mapping_size < offset ||
+ boost::uintmax_t(mapping_size - (offset - page_offset)) >
+ boost::uintmax_t(std::size_t(-1))){
+ error_info err(size_error);
+ throw interprocess_exception(err);
+ }
+ size = static_cast<std::size_t>(mapping_size - (offset - page_offset));
+}
+
+inline offset_t mapped_region::priv_page_offset_addr_fixup(offset_t offset, const void *&address)
+{
+ //We can't map any offset so we have to obtain system's
+ //memory granularity
+ const std::size_t page_size = mapped_region::get_page_size();
+
+ //We calculate the difference between demanded and valid offset
+ //(always less than a page in std::size_t, thus, representable by std::size_t)
+ const std::size_t page_offset =
+ static_cast<std::size_t>(offset - (offset / page_size) * page_size);
+ //Update the mapping address
+ if(address){
+ address = static_cast<const char*>(address) - page_offset;
+ }
+ return page_offset;
+}
+
#if defined (BOOST_INTERPROCESS_WINDOWS)
inline mapped_region::mapped_region()
- : m_base(0), m_size(0), m_offset(0), m_extra_offset(0), m_mode(read_only)
- , m_file_mapping_hnd(ipcdetail::invalid_file())
+ : m_base(0), m_size(0), m_page_offset(0), m_mode(read_only)
+ , m_file_or_mapping_hnd(ipcdetail::invalid_file())
{}
template<int dummy>
@@ -206,169 +279,146 @@ inline mapped_region::mapped_region
,offset_t offset
,std::size_t size
,const void *address)
- : m_base(0), m_size(0), m_offset(0), m_extra_offset(0), m_mode(mode)
- , m_file_mapping_hnd(ipcdetail::invalid_file())
+ : m_base(0), m_size(0), m_page_offset(0), m_mode(mode)
+ , m_file_or_mapping_hnd(ipcdetail::invalid_file())
{
mapping_handle_t mhandle = mapping.get_mapping_handle();
- file_handle_t native_mapping_handle = 0;
-
- //Set accesses
- unsigned long file_map_access = 0;
- unsigned long map_access = 0;
-
- switch(mode)
{
- case read_only:
- case read_private:
- file_map_access |= winapi::page_readonly;
- map_access |= winapi::file_map_read;
- break;
- case read_write:
- file_map_access |= winapi::page_readwrite;
- map_access |= winapi::file_map_write;
- break;
- case copy_on_write:
- file_map_access |= winapi::page_writecopy;
- map_access |= winapi::file_map_copy;
- break;
- default:
- {
- error_info err(mode_error);
- throw interprocess_exception(err);
- }
- break;
- }
-
- if(!mhandle.is_shm){
- //Update mapping size if the user does not specify it
- if(size == 0){
- __int64 total_size;
- if(!winapi::get_file_size
- (ipcdetail::file_handle_from_mapping_handle
- (mapping.get_mapping_handle()), total_size)){
- error_info err(winapi::get_last_error());
- throw interprocess_exception(err);
- }
+ file_handle_t native_mapping_handle = 0;
+
+ //Set accesses
+ //For "create_file_mapping"
+ unsigned long protection = 0;
+ //For "mapviewoffile"
+ unsigned long map_access = 0;
+
+ switch(mode)
+ {
+ case read_only:
+ case read_private:
+ protection |= winapi::page_readonly;
+ map_access |= winapi::file_map_read;
+ break;
+ case read_write:
+ protection |= winapi::page_readwrite;
+ map_access |= winapi::file_map_write;
+ break;
+ case copy_on_write:
+ protection |= winapi::page_writecopy;
+ map_access |= winapi::file_map_copy;
+ break;
+ default:
+ {
+ error_info err(mode_error);
+ throw interprocess_exception(err);
+ }
+ break;
+ }
- if(static_cast<unsigned __int64>(total_size) >
- (std::numeric_limits<std::size_t>::max)()){
- error_info err(size_error);
+ //For file mapping (including emulated shared memory through temporary files),
+ //the device is a file handle so we need to obtain file's size and call create_file_mapping
+ //to obtain the mapping handle.
+ //For files we don't need the file mapping after mapping the memory, as the file is there
+ //so we'll program the handle close
+ void * handle_to_close = winapi::invalid_handle_value;
+ if(!mhandle.is_shm){
+ //Create mapping handle
+ native_mapping_handle = winapi::create_file_mapping
+ ( ipcdetail::file_handle_from_mapping_handle(mapping.get_mapping_handle())
+ , protection, 0, 0, 0);
+
+ //Check if all is correct
+ if(!native_mapping_handle){
+ error_info err = winapi::get_last_error();
throw interprocess_exception(err);
}
- size = static_cast<std::size_t>(total_size - offset);
+ handle_to_close = native_mapping_handle;
}
-
- //Create file mapping
- native_mapping_handle =
- winapi::create_file_mapping
- (ipcdetail::file_handle_from_mapping_handle(mapping.get_mapping_handle()), file_map_access, 0, 0, 0, 0);
-
- //Check if all is correct
- if(!native_mapping_handle){
- error_info err = winapi::get_last_error();
- this->priv_close();
- throw interprocess_exception(err);
+ else{
+ //For windows_shared_memory the device handle is already a mapping handle
+ //and we need to maintain it
+ native_mapping_handle = mhandle.handle;
}
- }
+ //RAII handle close on scope exit
+ const winapi::handle_closer close_handle(handle_to_close);
+ (void)close_handle;
- //We can't map any offset so we have to obtain system's
- //memory granularity
- unsigned long granularity = 0;
- unsigned long foffset_low;
- unsigned long foffset_high;
+ const offset_t page_offset = priv_page_offset_addr_fixup(offset, address);
- winapi::system_info info;
- get_system_info(&info);
- granularity = info.dwAllocationGranularity;
-
- //Now we calculate valid offsets
- foffset_low = (unsigned long)(offset / granularity) * granularity;
- foffset_high = (unsigned long)(((offset / granularity) * granularity) >> 32);
-
- //We calculate the difference between demanded and valid offset
- m_extra_offset = (offset - (offset / granularity) * granularity);
-
- //Store user values in memory
- m_offset = offset;
- m_size = size;
+ //Obtain mapping size if user provides 0 size
+ if(size == 0){
+ offset_t mapping_size;
+ if(!winapi::get_file_mapping_size(native_mapping_handle, mapping_size)){
+ error_info err = winapi::get_last_error();
+ throw interprocess_exception(err);
+ }
+ //This can throw
+ priv_size_from_mapping_size(mapping_size, offset, page_offset, size);
+ }
- //Update the mapping address
- if(address){
- address = static_cast<const char*>(address) - m_extra_offset;
- }
- if(mhandle.is_shm){
- //Windows shared memory needs the duplication of the handle if we want to
- //make mapped_region independent from the mappable device
- if(!winapi::duplicate_current_process_handle(mhandle.handle, &m_file_mapping_hnd)){
+ //Map with new offsets and size
+ void *base = winapi::map_view_of_file_ex
+ (native_mapping_handle,
+ map_access,
+ offset - page_offset,
+ static_cast<std::size_t>(page_offset + size),
+ const_cast<void*>(address));
+ //Check error
+ if(!base){
error_info err = winapi::get_last_error();
- this->priv_close();
throw interprocess_exception(err);
}
- native_mapping_handle = m_file_mapping_hnd;
- }
- //Map with new offsets and size
- m_base = winapi::map_view_of_file_ex
- (native_mapping_handle,
- map_access,
- foffset_high,
- foffset_low,
- m_size ? static_cast<std::size_t>(m_extra_offset + m_size) : 0,
- const_cast<void*>(address));
-
- if(!mhandle.is_shm){
- //For files we don't need the file mapping anymore
- winapi::close_handle(native_mapping_handle);
+ //Calculate new base for the user
+ m_base = static_cast<char*>(base) + page_offset;
+ m_page_offset = page_offset;
+ m_size = size;
}
-
- //Check error
- if(!m_base){
+ //Windows shared memory needs the duplication of the handle if we want to
+ //make mapped_region independent from the mappable device
+ //
+ //For mapped files, we duplicate the file handle to be able to FlushFileBuffers
+ if(!winapi::duplicate_current_process_handle(mhandle.handle, &m_file_or_mapping_hnd)){
error_info err = winapi::get_last_error();
this->priv_close();
throw interprocess_exception(err);
}
-
- //Calculate new base for the user
- m_base = static_cast<char*>(m_base) + m_extra_offset;
}
-inline bool mapped_region::flush(std::size_t mapping_offset, std::size_t numbytes)
+inline bool mapped_region::flush(std::size_t mapping_offset, std::size_t numbytes, bool async)
{
- //Check some errors
- if(m_base == 0)
+ void *addr;
+ if(!this->priv_flush_param_check(mapping_offset, addr, numbytes)){
return false;
-
- if(mapping_offset >= m_size || (mapping_offset + numbytes) > m_size){
+ }
+ //Flush it all
+ if(!winapi::flush_view_of_file(addr, numbytes)){
return false;
}
-
- //Update flush size if the user does not provide it
- if(m_size == 0){
- numbytes = 0;
+ //m_file_or_mapping_hnd can be a file handle or a mapping handle.
+ //so flushing file buffers has only sense for files...
+ else if(async && m_file_or_mapping_hnd != winapi::invalid_handle_value &&
+ winapi::get_file_type(m_file_or_mapping_hnd) == winapi::file_type_disk){
+ return winapi::flush_file_buffers(m_file_or_mapping_hnd);
}
- else if(numbytes == 0){
- numbytes = m_size - mapping_offset;
- }
-
- //Flush it all
- return winapi::flush_view_of_file
- (static_cast<char*>(m_base)+mapping_offset,
- static_cast<std::size_t>(numbytes));
+ return true;
}
inline void mapped_region::priv_close()
{
if(m_base){
- winapi::unmap_view_of_file(static_cast<char*>(m_base) - m_extra_offset);
+ void *addr = this->priv_map_address();
+ #if !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION)
+ mapped_region::destroy_syncs_in_range<0>(addr, m_size);
+ #endif
+ winapi::unmap_view_of_file(addr);
m_base = 0;
}
- #if (defined BOOST_INTERPROCESS_WINDOWS)
- if(m_file_mapping_hnd != ipcdetail::invalid_file()){
- winapi::close_handle(m_file_mapping_hnd);
- m_file_mapping_hnd = ipcdetail::invalid_file();
- }
- #endif
+ if(m_file_or_mapping_hnd != ipcdetail::invalid_file()){
+ winapi::close_handle(m_file_or_mapping_hnd);
+ m_file_or_mapping_hnd = ipcdetail::invalid_file();
+ }
}
inline void mapped_region::dont_close_on_destruction()
@@ -377,7 +427,7 @@ inline void mapped_region::dont_close_on_destruction()
#else //#if (defined BOOST_INTERPROCESS_WINDOWS)
inline mapped_region::mapped_region()
- : m_base(0), m_size(0), m_offset(0), m_extra_offset(0), m_mode(read_only), m_is_xsi(false)
+ : m_base(0), m_size(0), m_page_offset(0), m_mode(read_only), m_is_xsi(false)
{}
template<int dummy>
@@ -391,7 +441,7 @@ inline mapped_region::mapped_region
, offset_t offset
, std::size_t size
, const void *address)
- : m_base(0), m_size(0), m_offset(0), m_extra_offset(0), m_mode(mode), m_is_xsi(false)
+ : m_base(0), m_size(0), m_page_offset(0), m_mode(mode), m_is_xsi(false)
{
mapping_handle_t map_hnd = mapping.get_mapping_handle();
@@ -430,28 +480,25 @@ inline mapped_region::mapped_region
}
//Update members
m_base = base;
- m_offset = offset;
m_size = size;
m_mode = mode;
- m_extra_offset = 0;
+ m_page_offset = 0;
m_is_xsi = true;
return;
}
#endif //ifdef BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS
+
+ //We calculate the difference between demanded and valid offset
+ const offset_t page_offset = priv_page_offset_addr_fixup(offset, address);
+
if(size == 0){
struct ::stat buf;
if(0 != fstat(map_hnd.handle, &buf)){
error_info err(system_error_code());
throw interprocess_exception(err);
}
- std::size_t filesize = (std::size_t)buf.st_size;
- if((std::size_t)offset >= filesize){
- error_info err(size_error);
- throw interprocess_exception(err);
- }
-
- filesize -= offset;
- size = filesize;
+ //This can throw
+ priv_size_from_mapping_size(buf.st_size, offset, page_offset, size);
}
//Create new mapping
@@ -488,35 +535,23 @@ inline mapped_region::mapped_region
break;
}
- //We calculate the difference between demanded and valid offset
- const std::size_t page_size = this->get_page_size();
- const offset_t extra_offset = offset - (offset / page_size) * page_size;
-
-
- //Update the mapping address
- if(address){
- address = static_cast<const char*>(address) - extra_offset;
- }
-
//Map it to the address space
void* base = mmap ( const_cast<void*>(address)
- , static_cast<std::size_t>(extra_offset + size)
+ , static_cast<std::size_t>(page_offset + size)
, prot
, flags
, mapping.get_mapping_handle().handle
- , offset - extra_offset);
+ , offset - page_offset);
//Check if mapping was successful
if(base == MAP_FAILED){
error_info err = system_error_code();
- this->priv_close();
throw interprocess_exception(err);
}
//Calculate new base for the user
- m_base = static_cast<char*>(base) + extra_offset;
- m_extra_offset = extra_offset;
- m_offset = offset;
+ m_base = static_cast<char*>(base) + page_offset;
+ m_page_offset = page_offset;
m_size = size;
//Check for fixed mapping error
@@ -527,17 +562,14 @@ inline mapped_region::mapped_region
}
}
-inline bool mapped_region::flush(std::size_t mapping_offset, std::size_t numbytes)
+inline bool mapped_region::flush(std::size_t mapping_offset, std::size_t numbytes, bool async)
{
- if(mapping_offset >= m_size || (mapping_offset+numbytes)> m_size){
+ void *addr;
+ if(!this->priv_flush_param_check(mapping_offset, addr, numbytes)){
return false;
}
-
- if(numbytes == 0){
- numbytes = m_size - mapping_offset;
- }
//Flush it all
- return msync(static_cast<char*>(m_base)+mapping_offset, numbytes, MS_ASYNC) == 0;
+ return msync( addr, numbytes, async ? MS_ASYNC : MS_SYNC) == 0;
}
inline void mapped_region::priv_close()
@@ -551,7 +583,7 @@ inline void mapped_region::priv_close()
return;
}
#endif //#ifdef BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS
- munmap(static_cast<char*>(m_base) - m_extra_offset, m_size + m_extra_offset);
+ munmap(this->priv_map_address(), this->priv_map_size());
m_base = 0;
}
}
@@ -577,11 +609,10 @@ inline void mapped_region::swap(mapped_region &other)
{
ipcdetail::do_swap(this->m_base, other.m_base);
ipcdetail::do_swap(this->m_size, other.m_size);
- ipcdetail::do_swap(this->m_offset, other.m_offset);
- ipcdetail::do_swap(this->m_extra_offset, other.m_extra_offset);
+ ipcdetail::do_swap(this->m_page_offset, other.m_page_offset);
ipcdetail::do_swap(this->m_mode, other.m_mode);
#if (defined BOOST_INTERPROCESS_WINDOWS)
- ipcdetail::do_swap(this->m_file_mapping_hnd, other.m_file_mapping_hnd);
+ ipcdetail::do_swap(this->m_file_or_mapping_hnd, other.m_file_or_mapping_hnd);
#else
ipcdetail::do_swap(this->m_is_xsi, other.m_is_xsi);
#endif
@@ -603,3 +634,32 @@ struct null_mapped_region_function
#endif //BOOST_INTERPROCESS_MAPPED_REGION_HPP
+#if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
+
+#ifndef BOOST_INTERPROCESS_MAPPED_REGION_EXT_HPP
+#define BOOST_INTERPROCESS_MAPPED_REGION_EXT_HPP
+
+#if defined(BOOST_INTERPROCESS_WINDOWS) && !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION)
+# include <boost/interprocess/sync/windows/sync_utils.hpp>
+# include <boost/interprocess/detail/windows_intermodule_singleton.hpp>
+
+namespace boost {
+namespace interprocess {
+
+template<int Dummy>
+inline void mapped_region::destroy_syncs_in_range(const void *addr, std::size_t size)
+{
+ ipcdetail::sync_handles &handles =
+ ipcdetail::windows_intermodule_singleton<ipcdetail::sync_handles>::get();
+ handles.destroy_syncs_in_range(addr, size);
+}
+
+} //namespace interprocess {
+} //namespace boost {
+
+#endif //defined(BOOST_INTERPROCESS_WINDOWS) && !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION)
+
+#endif //#ifdef BOOST_INTERPROCESS_MAPPED_REGION_EXT_HPP
+
+#endif //#if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
+
diff --git a/boost/interprocess/mem_algo/detail/mem_algo_common.hpp b/boost/interprocess/mem_algo/detail/mem_algo_common.hpp
index d609f46aee..91d798145b 100644
--- a/boost/interprocess/mem_algo/detail/mem_algo_common.hpp
+++ b/boost/interprocess/mem_algo/detail/mem_algo_common.hpp
@@ -117,7 +117,7 @@ class memory_algorithm_common
lcm_val = max;
//If we want to use minbytes data to get a buffer between maxbytes
- //and minbytes if maxbytes can't be achieved, calculate the
+ //and minbytes if maxbytes can't be achieved, calculate the
//biggest of all possibilities
current_forward = get_truncated_size_po2(received_size, backwards_multiple);
needs_backwards = size_to_achieve - current_forward;
@@ -176,7 +176,7 @@ class memory_algorithm_common
lcm_val = lcm(max, min);
}
//If we want to use minbytes data to get a buffer between maxbytes
- //and minbytes if maxbytes can't be achieved, calculate the
+ //and minbytes if maxbytes can't be achieved, calculate the
//biggest of all possibilities
current_forward = get_truncated_size(received_size, backwards_multiple);
needs_backwards = size_to_achieve - current_forward;
@@ -199,7 +199,7 @@ class memory_algorithm_common
static void* allocate_aligned
(MemoryAlgorithm *memory_algo, size_type nbytes, size_type alignment)
{
-
+
//Ensure power of 2
if ((alignment & (alignment - size_type(1u))) != 0){
//Alignment is not power of two
@@ -215,7 +215,7 @@ class memory_algorithm_common
if(nbytes > UsableByPreviousChunk)
nbytes -= UsableByPreviousChunk;
-
+
//We can find a aligned portion if we allocate a block that has alignment
//nbytes + alignment bytes or more.
size_type minimum_allocation = max_value
@@ -223,13 +223,13 @@ class memory_algorithm_common
//Since we will split that block, we must request a bit more memory
//if the alignment is near the beginning of the buffer, because otherwise,
//there is no space for a new block before the alignment.
- //
+ //
// ____ Aligned here
// |
// -----------------------------------------------------
- // | MBU |
+ // | MBU |
// -----------------------------------------------------
- size_type request =
+ size_type request =
minimum_allocation + (2*MinBlockUnits*Alignment - AllocatedCtrlBytes
//prevsize - UsableByPreviousChunk
);
@@ -263,7 +263,7 @@ class memory_algorithm_common
}
//Buffer not aligned, find the aligned part.
- //
+ //
// ____ Aligned here
// |
// -----------------------------------------------------
@@ -324,7 +324,7 @@ class memory_algorithm_common
return memory_algo->priv_get_user_buffer(second);
}
- static bool try_shrink
+ static bool try_shrink
(MemoryAlgorithm *memory_algo, void *ptr
,const size_type max_size, const size_type preferred_size
,size_type &received_size)
@@ -361,8 +361,8 @@ class memory_algorithm_common
if(old_user_units == preferred_user_units)
return true;
- size_type shrunk_user_units =
- ((BlockCtrlUnits - AllocatedCtrlUnits) > preferred_user_units)
+ size_type shrunk_user_units =
+ ((BlockCtrlUnits - AllocatedCtrlUnits) >= preferred_user_units)
? (BlockCtrlUnits - AllocatedCtrlUnits)
: preferred_user_units;
@@ -380,7 +380,7 @@ class memory_algorithm_common
return true;
}
- static bool shrink
+ static bool shrink
(MemoryAlgorithm *memory_algo, void *ptr
,const size_type max_size, const size_type preferred_size
,size_type &received_size)
@@ -389,7 +389,7 @@ class memory_algorithm_common
block_ctrl *block = memory_algo->priv_get_block(ptr);
size_type old_block_units = (size_type)block->m_size;
- if(!try_shrink
+ if(!try_shrink
(memory_algo, ptr, max_size, preferred_size, received_size)){
return false;
}
@@ -479,7 +479,7 @@ class memory_algorithm_common
//The last block should take all the remaining space
if((low_idx + 1) == n_elements ||
- (total_used_units + elem_units +
+ (total_used_units + elem_units +
((!sizeof_element)
? elem_units
: std::max(memory_algo->priv_get_total_units(elem_sizes[low_idx+1]*sizeof_element), ptr_size_units))
@@ -528,7 +528,7 @@ class memory_algorithm_common
//Sanity check
BOOST_ASSERT(total_used_units == received_units);
}
-
+
if(low_idx != n_elements){
priv_deallocate_many(memory_algo, boost::move(chain));
}
diff --git a/boost/interprocess/mem_algo/detail/simple_seq_fit_impl.hpp b/boost/interprocess/mem_algo/detail/simple_seq_fit_impl.hpp
index 378cd82fd5..c36916b72f 100644
--- a/boost/interprocess/mem_algo/detail/simple_seq_fit_impl.hpp
+++ b/boost/interprocess/mem_algo/detail/simple_seq_fit_impl.hpp
@@ -60,7 +60,7 @@ class simple_seq_fit_impl
simple_seq_fit_impl();
simple_seq_fit_impl(const simple_seq_fit_impl &);
simple_seq_fit_impl &operator=(const simple_seq_fit_impl &);
-
+
typedef typename boost::intrusive::
pointer_traits<VoidPointer>::template
rebind_pointer<char>::type char_ptr;
@@ -93,10 +93,10 @@ class simple_seq_fit_impl
public:
//!Offset pointer to the next block.
block_ctrl_ptr m_next;
- //!This block's memory size (including block_ctrl
+ //!This block's memory size (including block_ctrl
//!header) in BasicSize units
size_type m_size;
-
+
size_type get_user_bytes() const
{ return this->m_size*Alignment - BlockCtrlBytes; }
@@ -126,7 +126,7 @@ class simple_seq_fit_impl
typedef ipcdetail::memory_algorithm_common<simple_seq_fit_impl> algo_impl_t;
public:
- //!Constructor. "size" is the total size of the managed memory segment,
+ //!Constructor. "size" is the total size of the managed memory segment,
//!"extra_hdr_bytes" indicates the extra bytes beginning in the sizeof(simple_seq_fit_impl)
//!offset that the allocator should not use at all.
simple_seq_fit_impl (size_type size, size_type extra_hdr_bytes);
@@ -197,12 +197,12 @@ class simple_seq_fit_impl
template<class T>
std::pair<T *, bool>
allocation_command (boost::interprocess::allocation_type command, size_type limit_size,
- size_type preferred_size,size_type &received_size,
+ size_type preferred_size,size_type &received_size,
T *reuse_ptr = 0);
std::pair<void *, bool>
raw_allocation_command (boost::interprocess::allocation_type command, size_type limit_size,
- size_type preferred_size,size_type &received_size,
+ size_type preferred_size,size_type &received_size,
void *reuse_ptr = 0, size_type sizeof_object = 1);
//!Returns the size of the buffer previously allocated pointed by ptr
@@ -306,7 +306,7 @@ simple_seq_fit_impl<MutexFamily, VoidPointer>
size_type uint_this = (std::size_t)this_ptr;
size_type uint_aligned_this = uint_this/Alignment*Alignment;
size_type this_disalignment = (uint_this - uint_aligned_this);
- size_type block1_off =
+ size_type block1_off =
ipcdetail::get_rounded_size(sizeof(simple_seq_fit_impl) + extra_hdr_bytes + this_disalignment, Alignment)
- this_disalignment;
algo_impl_t::assert_alignment(this_disalignment + block1_off);
@@ -322,7 +322,7 @@ simple_seq_fit_impl<MutexFamily, VoidPointer>
size_type uint_this = (std::size_t)this;
size_type uint_aligned_this = uint_this/Alignment*Alignment;
size_type this_disalignment = (uint_this - uint_aligned_this);
- size_type old_end =
+ size_type old_end =
ipcdetail::get_truncated_size(m_header.m_size + this_disalignment, Alignment)
- this_disalignment;
algo_impl_t::assert_alignment(old_end + this_disalignment);
@@ -426,7 +426,7 @@ void simple_seq_fit_impl<MutexFamily, VoidPointer>::shrink_to_fit()
(void)addr;
BOOST_ASSERT(addr);
BOOST_ASSERT(received_size == last_units*Alignment - AllocatedCtrlBytes);
-
+
//Shrink it
m_header.m_size /= Alignment;
m_header.m_size -= last->m_size;
@@ -463,7 +463,7 @@ void *simple_seq_fit_impl<MutexFamily, VoidPointer>::
template<class MutexFamily, class VoidPointer>
inline void simple_seq_fit_impl<MutexFamily, VoidPointer>::priv_add_segment(void *addr, size_type size)
-{
+{
algo_impl_t::assert_alignment(addr);
//Check size
BOOST_ASSERT(!(size < MinBlockSize));
@@ -474,7 +474,7 @@ inline void simple_seq_fit_impl<MutexFamily, VoidPointer>::priv_add_segment(void
new_block->m_size = size/Alignment;
new_block->m_next = 0;
//Simulate this block was previously allocated
- m_header.m_allocated += new_block->m_size*Alignment;
+ m_header.m_allocated += new_block->m_size*Alignment;
//Return block and insert it in the free block list
this->priv_deallocate(priv_get_user_buffer(new_block));
}
@@ -488,7 +488,7 @@ template<class MutexFamily, class VoidPointer>
inline typename simple_seq_fit_impl<MutexFamily, VoidPointer>::size_type
simple_seq_fit_impl<MutexFamily, VoidPointer>::get_free_memory() const
{
- return m_header.m_size - m_header.m_allocated -
+ return m_header.m_size - m_header.m_allocated -
algo_impl_t::multiple_of_units(sizeof(*this) + m_header.m_extra_hdr_bytes);
}
@@ -523,7 +523,7 @@ inline void simple_seq_fit_impl<MutexFamily, VoidPointer>::zero_free_memory()
//Iterate through all free portions
do{
- //Just clear user the memory part reserved for the user
+ //Just clear user the memory part reserved for the user
std::memset( priv_get_user_buffer(block)
, 0
, block->get_user_bytes());
@@ -583,19 +583,19 @@ inline void* simple_seq_fit_impl<MutexFamily, VoidPointer>::
template<class MutexFamily, class VoidPointer>
inline void* simple_seq_fit_impl<MutexFamily, VoidPointer>::
allocate_aligned(size_type nbytes, size_type alignment)
-{
+{
//-----------------------
boost::interprocess::scoped_lock<interprocess_mutex> guard(m_header);
//-----------------------
return algo_impl_t::
- allocate_aligned(this, nbytes, alignment);
+ allocate_aligned(this, nbytes, alignment);
}
template<class MutexFamily, class VoidPointer>
template<class T>
inline std::pair<T*, bool> simple_seq_fit_impl<MutexFamily, VoidPointer>::
allocation_command (boost::interprocess::allocation_type command, size_type limit_size,
- size_type preferred_size,size_type &received_size,
+ size_type preferred_size,size_type &received_size,
T *reuse_ptr)
{
std::pair<void*, bool> ret = priv_allocation_command
@@ -608,7 +608,7 @@ inline std::pair<T*, bool> simple_seq_fit_impl<MutexFamily, VoidPointer>::
template<class MutexFamily, class VoidPointer>
inline std::pair<void*, bool> simple_seq_fit_impl<MutexFamily, VoidPointer>::
raw_allocation_command (boost::interprocess::allocation_type command, size_type limit_objects,
- size_type preferred_objects,size_type &received_objects,
+ size_type preferred_objects,size_type &received_objects,
void *reuse_ptr, size_type sizeof_object)
{
if(!sizeof_object)
@@ -627,7 +627,7 @@ inline std::pair<void*, bool> simple_seq_fit_impl<MutexFamily, VoidPointer>::
template<class MutexFamily, class VoidPointer>
inline std::pair<void*, bool> simple_seq_fit_impl<MutexFamily, VoidPointer>::
priv_allocation_command (boost::interprocess::allocation_type command, size_type limit_size,
- size_type preferred_size, size_type &received_size,
+ size_type preferred_size, size_type &received_size,
void *reuse_ptr, size_type sizeof_object)
{
command &= ~boost::interprocess::expand_bwd;
@@ -696,9 +696,9 @@ void* simple_seq_fit_impl<MutexFamily, VoidPointer>::
return 0;
}
- size_type needs_backwards =
+ size_type needs_backwards =
ipcdetail::get_rounded_size(preferred_size - extra_forward, Alignment);
-
+
if(!only_preferred_backwards){
max_value(ipcdetail::get_rounded_size(min_size - extra_forward, Alignment)
,min_value(prev->get_user_bytes(), needs_backwards));
@@ -710,16 +710,16 @@ void* simple_seq_fit_impl<MutexFamily, VoidPointer>::
if(!priv_expand(reuse_ptr, received_size, received_size, received_size)){
BOOST_ASSERT(0);
}
-
+
//We need a minimum size to split the previous one
if((prev->get_user_bytes() - needs_backwards) > 2*BlockCtrlBytes){
block_ctrl *new_block = reinterpret_cast<block_ctrl*>
(reinterpret_cast<char*>(reuse) - needs_backwards - BlockCtrlBytes);
new_block->m_next = 0;
- new_block->m_size =
+ new_block->m_size =
BlockCtrlUnits + (needs_backwards + extra_forward)/Alignment;
- prev->m_size =
+ prev->m_size =
(prev->get_total_bytes() - needs_backwards)/Alignment - BlockCtrlUnits;
received_size = needs_backwards + extra_forward;
m_header.m_allocated += needs_backwards + BlockCtrlBytes;
@@ -775,7 +775,7 @@ std::pair<void *, bool> simple_seq_fit_impl<MutexFamily, VoidPointer>::
,void *reuse_ptr)
{
if(command & boost::interprocess::shrink_in_place){
- bool success =
+ bool success =
algo_impl_t::shrink(this, reuse_ptr, limit_size, preferred_size, received_size);
return std::pair<void *, bool> ((success ? reuse_ptr : 0), true);
}
@@ -885,7 +885,7 @@ inline typename simple_seq_fit_impl<MutexFamily, VoidPointer>::block_ctrl *
}
template<class MutexFamily, class VoidPointer>
-inline
+inline
std::pair<typename simple_seq_fit_impl<MutexFamily, VoidPointer>::block_ctrl *
,typename simple_seq_fit_impl<MutexFamily, VoidPointer>::block_ctrl *>
simple_seq_fit_impl<MutexFamily, VoidPointer>::
@@ -969,7 +969,7 @@ inline bool simple_seq_fit_impl<MutexFamily, VoidPointer>::
//We can fill expand. Merge both blocks,
block->m_next = next_block->m_next;
block->m_size = merged_size;
-
+
//Find the previous free block of next_block
block_ctrl *prev = &m_header.m_root;
while(ipcdetail::to_raw_pointer(prev->m_next) != next_block){
@@ -978,7 +978,7 @@ inline bool simple_seq_fit_impl<MutexFamily, VoidPointer>::
//Now insert merged block in the free list
//This allows reusing allocation logic in this function
- m_header.m_allocated -= old_block_size*Alignment;
+ m_header.m_allocated -= old_block_size*Alignment;
prev->m_next = block;
//Now use check and allocate to do the allocation logic
@@ -992,7 +992,7 @@ inline bool simple_seq_fit_impl<MutexFamily, VoidPointer>::
BOOST_ASSERT(0);
return false;
}
- return true;
+ return true;
}
template<class MutexFamily, class VoidPointer> inline
@@ -1006,7 +1006,7 @@ void* simple_seq_fit_impl<MutexFamily, VoidPointer>::priv_check_and_allocate
bool found = false;
if (block->m_size > upper_nunits){
- //This block is bigger than needed, split it in
+ //This block is bigger than needed, split it in
//two blocks, the first's size will be "units"
//the second's size will be "block->m_size-units"
size_type total_size = block->m_size;
@@ -1057,7 +1057,7 @@ void simple_seq_fit_impl<MutexFamily, VoidPointer>::priv_deallocate(void* addr)
//Let's get free block list. List is always sorted
//by memory address to allow block merging.
- //Pointer next always points to the first
+ //Pointer next always points to the first
//(lower address) block
block_ctrl * prev = &m_header.m_root;
block_ctrl * pos = ipcdetail::to_raw_pointer(m_header.m_root.m_next);
@@ -1071,9 +1071,9 @@ void simple_seq_fit_impl<MutexFamily, VoidPointer>::priv_deallocate(void* addr)
size_type total_size = Alignment*block->m_size;
BOOST_ASSERT(m_header.m_allocated >= total_size);
-
+
//Update used memory count
- m_header.m_allocated -= total_size;
+ m_header.m_allocated -= total_size;
//Let's find the previous and the next block of the block to deallocate
//This ordering comparison must be done with original pointers
@@ -1087,7 +1087,7 @@ void simple_seq_fit_impl<MutexFamily, VoidPointer>::priv_deallocate(void* addr)
//Try to combine with upper block
char *block_char_ptr = reinterpret_cast<char*>(ipcdetail::to_raw_pointer(block));
- if ((block_char_ptr + Alignment*block->m_size) ==
+ if ((block_char_ptr + Alignment*block->m_size) ==
reinterpret_cast<char*>(ipcdetail::to_raw_pointer(pos))){
block->m_size += pos->m_size;
block->m_next = pos->m_next;
@@ -1098,7 +1098,7 @@ void simple_seq_fit_impl<MutexFamily, VoidPointer>::priv_deallocate(void* addr)
//Try to combine with lower block
if ((reinterpret_cast<char*>(ipcdetail::to_raw_pointer(prev))
- + Alignment*prev->m_size) ==
+ + Alignment*prev->m_size) ==
block_char_ptr){
diff --git a/boost/interprocess/mem_algo/rbtree_best_fit.hpp b/boost/interprocess/mem_algo/rbtree_best_fit.hpp
index f6f0c03a17..7ccc642e29 100644
--- a/boost/interprocess/mem_algo/rbtree_best_fit.hpp
+++ b/boost/interprocess/mem_algo/rbtree_best_fit.hpp
@@ -105,7 +105,7 @@ class rbtree_best_fit
struct SizeHolder
{
- //!This block's memory size (including block_ctrl
+ //!This block's memory size (including block_ctrl
//!header) in Alignment units
size_type m_prev_size : sizeof(size_type)*CHAR_BIT;
size_type m_size : sizeof(size_type)*CHAR_BIT - 2;
@@ -132,7 +132,7 @@ class rbtree_best_fit
{ return size < block.m_size; }
bool operator()(const block_ctrl &block, size_type size) const
- { return block.m_size < size; }
+ { return block.m_size < size; }
};
//!Shared mutex to protect memory allocate/deallocate
@@ -157,13 +157,13 @@ class rbtree_best_fit
} m_header;
friend class ipcdetail::memory_algorithm_common<rbtree_best_fit>;
-
+
typedef ipcdetail::memory_algorithm_common<rbtree_best_fit> algo_impl_t;
public:
/// @endcond
- //!Constructor. "size" is the total size of the managed memory segment,
+ //!Constructor. "size" is the total size of the managed memory segment,
//!"extra_hdr_bytes" indicates the extra bytes beginning in the sizeof(rbtree_best_fit)
//!offset that the allocator should not use at all.
rbtree_best_fit (size_type size, size_type extra_hdr_bytes);
@@ -238,12 +238,12 @@ class rbtree_best_fit
template<class T>
std::pair<T *, bool>
allocation_command (boost::interprocess::allocation_type command, size_type limit_size,
- size_type preferred_size,size_type &received_size,
+ size_type preferred_size,size_type &received_size,
T *reuse_ptr = 0);
std::pair<void *, bool>
raw_allocation_command (boost::interprocess::allocation_type command, size_type limit_object,
- size_type preferred_object,size_type &received_object,
+ size_type preferred_object,size_type &received_object,
void *reuse_ptr = 0, size_type sizeof_object = 1);
//!Returns the size of the buffer previously allocated pointed by ptr
@@ -263,7 +263,7 @@ class rbtree_best_fit
std::pair<void*, bool>
priv_allocation_command(boost::interprocess::allocation_type command, size_type limit_size,
- size_type preferred_size,size_type &received_size,
+ size_type preferred_size,size_type &received_size,
void *reuse_ptr, size_type sizeof_object);
@@ -339,7 +339,7 @@ class rbtree_best_fit
void priv_add_segment(void *addr, size_type size);
public:
-
+
static const size_type Alignment = !MemAlignment
? size_type(::boost::alignment_of< ::boost::detail::max_align>::value)
: size_type(MemAlignment)
@@ -370,7 +370,7 @@ class rbtree_best_fit
/// @cond
template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
-inline typename rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::size_type
+inline typename rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::size_type
rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>
::priv_first_block_offset_from_this(const void *this_ptr, size_type extra_hdr_bytes)
{
@@ -386,7 +386,7 @@ inline typename rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::size_ty
template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
void rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
priv_add_segment(void *addr, size_type size)
-{
+{
//Check alignment
algo_impl_t::check_alignment(addr);
//Check size
@@ -398,16 +398,16 @@ void rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
BOOST_ASSERT(first_big_block->m_size >= BlockCtrlUnits);
//The "end" node is just a node of size 0 with the "end" bit set
- block_ctrl *end_block = static_cast<block_ctrl*>
+ block_ctrl *end_block = static_cast<block_ctrl*>
(new (reinterpret_cast<char*>(addr) + first_big_block->m_size*Alignment)SizeHolder);
//This will overwrite the prev part of the "end" node
priv_mark_as_free_block (first_big_block);
#ifdef BOOST_INTERPROCESS_RBTREE_BEST_FIT_ABI_V1_HPP
- first_big_block->m_prev_size = end_block->m_size =
+ first_big_block->m_prev_size = end_block->m_size =
(reinterpret_cast<char*>(first_big_block) - reinterpret_cast<char*>(end_block))/Alignment;
#else
- first_big_block->m_prev_size = end_block->m_size =
+ first_big_block->m_prev_size = end_block->m_size =
(reinterpret_cast<char*>(end_block) - reinterpret_cast<char*>(first_big_block))/Alignment;
#endif
end_block->m_allocated = 1;
@@ -444,7 +444,7 @@ inline typename rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::block_c
{
size_type block1_off = priv_first_block_offset_from_this(this, m_header.m_extra_hdr_bytes);
const size_type original_first_block_size = m_header.m_size/Alignment*Alignment - block1_off/Alignment*Alignment - EndCtrlBlockBytes;
- block_ctrl *end_block = reinterpret_cast<block_ctrl*>
+ block_ctrl *end_block = reinterpret_cast<block_ctrl*>
(reinterpret_cast<char*>(this) + block1_off + original_first_block_size);
return end_block;
}
@@ -479,7 +479,7 @@ void rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::grow(size_type ext
//Get the address of the first block
block_ctrl *first_block = priv_first_block();
block_ctrl *old_end_block = priv_end_block();
- size_type old_border_offset = (size_type)(reinterpret_cast<char*>(old_end_block) -
+ size_type old_border_offset = (size_type)(reinterpret_cast<char*>(old_end_block) -
reinterpret_cast<char*>(this)) + EndCtrlBlockBytes;
//Update managed buffer's size
@@ -500,10 +500,10 @@ void rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::grow(size_type ext
//between them
new_end_block->m_allocated = 1;
#ifdef BOOST_INTERPROCESS_RBTREE_BEST_FIT_ABI_V1_HPP
- new_end_block->m_size = (reinterpret_cast<char*>(first_block) -
+ new_end_block->m_size = (reinterpret_cast<char*>(first_block) -
reinterpret_cast<char*>(new_end_block))/Alignment;
#else
- new_end_block->m_size = (reinterpret_cast<char*>(new_end_block) -
+ new_end_block->m_size = (reinterpret_cast<char*>(new_end_block) -
reinterpret_cast<char*>(first_block))/Alignment;
#endif
first_block->m_prev_size = new_end_block->m_size;
@@ -512,7 +512,7 @@ void rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::grow(size_type ext
//The old end block is the new block
block_ctrl *new_block = old_end_block;
- new_block->m_size = (reinterpret_cast<char*>(new_end_block) -
+ new_block->m_size = (reinterpret_cast<char*>(new_end_block) -
reinterpret_cast<char*>(new_block))/Alignment;
BOOST_ASSERT(new_block->m_size >= BlockCtrlUnits);
priv_mark_as_allocated_block(new_block);
@@ -568,18 +568,18 @@ void rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::shrink_to_fit()
//Erase block from the free tree, since we will erase it
m_header.m_imultiset.erase(Imultiset::s_iterator_to(*last_block));
- size_type shrunk_border_offset = (size_type)(reinterpret_cast<char*>(last_block) -
+ size_type shrunk_border_offset = (size_type)(reinterpret_cast<char*>(last_block) -
reinterpret_cast<char*>(this)) + EndCtrlBlockBytes;
-
+
block_ctrl *new_end_block = last_block;
algo_impl_t::assert_alignment(new_end_block);
//Write new end block attributes
#ifdef BOOST_INTERPROCESS_RBTREE_BEST_FIT_ABI_V1_HPP
- new_end_block->m_size = first_block->m_prev_size =
+ new_end_block->m_size = first_block->m_prev_size =
(reinterpret_cast<char*>(first_block) - reinterpret_cast<char*>(new_end_block))/Alignment;
#else
- new_end_block->m_size = first_block->m_prev_size =
+ new_end_block->m_size = first_block->m_prev_size =
(reinterpret_cast<char*>(new_end_block) - reinterpret_cast<char*>(first_block))/Alignment;
#endif
@@ -604,7 +604,7 @@ template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
typename rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::size_type
rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::get_free_memory() const
{
- return m_header.m_size - m_header.m_allocated -
+ return m_header.m_size - m_header.m_allocated -
priv_first_block_offset_from_this(this, m_header.m_extra_hdr_bytes);
}
@@ -614,7 +614,7 @@ rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
get_min_size (size_type extra_hdr_bytes)
{
return (algo_impl_t::ceil_units(sizeof(rbtree_best_fit)) +
- algo_impl_t::ceil_units(extra_hdr_bytes) +
+ algo_impl_t::ceil_units(extra_hdr_bytes) +
MinBlockUnits + EndCtrlBlockUnits)*Alignment;
}
@@ -625,13 +625,13 @@ inline bool rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
//-----------------------
boost::interprocess::scoped_lock<mutex_type> guard(m_header);
//-----------------------
- size_type block1_off =
+ size_type block1_off =
priv_first_block_offset_from_this(this, m_header.m_extra_hdr_bytes);
- return m_header.m_allocated == 0 &&
+ return m_header.m_allocated == 0 &&
m_header.m_imultiset.begin() != m_header.m_imultiset.end() &&
(++m_header.m_imultiset.begin()) == m_header.m_imultiset.end()
- && m_header.m_imultiset.begin()->m_size ==
+ && m_header.m_imultiset.begin()->m_size ==
(m_header.m_size - block1_off - EndCtrlBlockBytes)/Alignment;
}
@@ -659,7 +659,7 @@ bool rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
return false;
}
- size_type block1_off =
+ size_type block1_off =
priv_first_block_offset_from_this(this, m_header.m_extra_hdr_bytes);
//Check free bytes are less than size
@@ -672,7 +672,7 @@ bool rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
inline void* rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
allocate(size_type nbytes)
-{
+{
//-----------------------
boost::interprocess::scoped_lock<mutex_type> guard(m_header);
//-----------------------
@@ -684,18 +684,18 @@ inline void* rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
inline void* rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
allocate_aligned(size_type nbytes, size_type alignment)
-{
+{
//-----------------------
boost::interprocess::scoped_lock<mutex_type> guard(m_header);
//-----------------------
- return algo_impl_t::allocate_aligned(this, nbytes, alignment);
+ return algo_impl_t::allocate_aligned(this, nbytes, alignment);
}
template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
template<class T>
inline std::pair<T*, bool> rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
allocation_command (boost::interprocess::allocation_type command, size_type limit_size,
- size_type preferred_size,size_type &received_size,
+ size_type preferred_size,size_type &received_size,
T *reuse_ptr)
{
std::pair<void*, bool> ret = priv_allocation_command
@@ -708,7 +708,7 @@ inline std::pair<T*, bool> rbtree_best_fit<MutexFamily, VoidPointer, MemAlignmen
template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
inline std::pair<void*, bool> rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
raw_allocation_command (boost::interprocess::allocation_type command, size_type limit_objects,
- size_type preferred_objects,size_type &received_objects,
+ size_type preferred_objects,size_type &received_objects,
void *reuse_ptr, size_type sizeof_object)
{
if(!sizeof_object)
@@ -728,7 +728,7 @@ inline std::pair<void*, bool> rbtree_best_fit<MutexFamily, VoidPointer, MemAlign
template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
inline std::pair<void*, bool> rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
priv_allocation_command (boost::interprocess::allocation_type command, size_type limit_size,
- size_type preferred_size,size_type &received_size,
+ size_type preferred_size,size_type &received_size,
void *reuse_ptr, size_type sizeof_object)
{
std::pair<void*, bool> ret;
@@ -815,7 +815,7 @@ void* rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
//Obtain the real size of the block
block_ctrl *reuse = priv_get_block(reuse_ptr);
- //Sanity check
+ //Sanity check
//BOOST_ASSERT(reuse->m_size == priv_tail_size(reuse));
algo_impl_t::assert_alignment(reuse);
@@ -859,12 +859,12 @@ void* rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
(reinterpret_cast<char*>(reuse) - needs_backwards_aligned);
//Free old previous buffer
- new_block->m_size =
+ new_block->m_size =
AllocatedCtrlUnits + (needs_backwards_aligned + (received_size - UsableByPreviousChunk))/Alignment;
BOOST_ASSERT(new_block->m_size >= BlockCtrlUnits);
priv_mark_as_allocated_block(new_block);
- prev_block->m_size = (reinterpret_cast<char*>(new_block) -
+ prev_block->m_size = (reinterpret_cast<char*>(new_block) -
reinterpret_cast<char*>(prev_block))/Alignment;
BOOST_ASSERT(prev_block->m_size >= BlockCtrlUnits);
priv_mark_as_free_block(prev_block);
@@ -875,7 +875,7 @@ void* rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
{
imultiset_iterator prev_block_it(Imultiset::s_iterator_to(*prev_block));
imultiset_iterator was_smaller_it(prev_block_it);
- if(prev_block_it != m_header.m_imultiset.begin() &&
+ if(prev_block_it != m_header.m_imultiset.begin() &&
(--(was_smaller_it = prev_block_it))->m_size > prev_block->m_size){
m_header.m_imultiset.erase(prev_block_it);
m_header.m_imultiset.insert(m_header.m_imultiset.begin(), *prev_block);
@@ -884,7 +884,7 @@ void* rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
received_size = needs_backwards_aligned + received_size;
m_header.m_allocated += needs_backwards_aligned;
-
+
//Check alignment
algo_impl_t::assert_alignment(new_block);
@@ -951,7 +951,7 @@ std::pair<void *, bool> rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>:
//command &= (~boost::interprocess::expand_bwd);
if(command & boost::interprocess::shrink_in_place){
- bool success =
+ bool success =
algo_impl_t::shrink(this, reuse_ptr, limit_size, preferred_size, received_size);
return std::pair<void *, bool> ((success ? reuse_ptr : 0), true);
}
@@ -1044,7 +1044,7 @@ bool rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
//The block must be marked as allocated and the sizes must be equal
BOOST_ASSERT(priv_is_allocated_block(block));
//BOOST_ASSERT(old_block_units == priv_tail_size(block));
-
+
//Put this to a safe value
received_size = (old_block_units - AllocatedCtrlUnits)*Alignment + UsableByPreviousChunk;
if(received_size >= preferred_size || received_size >= min_size)
@@ -1084,7 +1084,7 @@ bool rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
//Check if we can split the next one in two parts
if((merged_units - intended_units) >= BlockCtrlUnits){
- //This block is bigger than needed, split it in
+ //This block is bigger than needed, split it in
//two blocks, the first one will be merged and
//the second's size will be the remaining space
BOOST_ASSERT(next_block->m_size == priv_next_block(next_block)->m_prev_size);
@@ -1098,9 +1098,9 @@ bool rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
//overwrite the tree hook of the old next block. So we first erase the
//old if needed and we'll insert the new one after creating the new next
imultiset_iterator old_next_block_it(Imultiset::s_iterator_to(*next_block));
- const bool size_invariants_broken =
+ const bool size_invariants_broken =
(next_block->m_size - rem_units ) < BlockCtrlUnits ||
- (old_next_block_it != m_header.m_imultiset.begin() &&
+ (old_next_block_it != m_header.m_imultiset.begin() &&
(--imultiset_iterator(old_next_block_it))->m_size > rem_units);
if(size_invariants_broken){
m_header.m_imultiset.erase(old_next_block_it);
@@ -1267,7 +1267,7 @@ void* rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::priv_check_and_al
algo_impl_t::assert_alignment(block);
if (block->m_size >= upper_nunits){
- //This block is bigger than needed, split it in
+ //This block is bigger than needed, split it in
//two blocks, the first's size will be "units" and
//the second's size "block->m_size-units"
size_type block_old_size = block->m_size;
@@ -1298,7 +1298,7 @@ void* rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::priv_check_and_al
m_header.m_imultiset.erase(it_old);
m_header.m_imultiset.insert(m_header.m_imultiset.begin(), *rem_block);
}
-
+
}
else if (block->m_size >= nunits){
m_header.m_imultiset.erase(it_old);
@@ -1318,9 +1318,9 @@ void* rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::priv_check_and_al
//Clear the memory occupied by the tree hook, since this won't be
//cleared with zero_free_memory
TreeHook *t = static_cast<TreeHook*>(block);
- //Just clear the memory part reserved for the user
+ //Just clear the memory part reserved for the user
std::size_t tree_hook_offset_in_block = (char*)t - (char*)block;
- //volatile char *ptr =
+ //volatile char *ptr =
char *ptr = reinterpret_cast<char*>(block)+tree_hook_offset_in_block;
const std::size_t s = BlockCtrlBytes - tree_hook_offset_in_block;
std::memset(ptr, 0, s);
@@ -1344,7 +1344,7 @@ void rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::priv_deallocate(vo
if(!addr) return;
block_ctrl *block = priv_get_block(addr);
-
+
//The blocks must be marked as allocated and the sizes must be equal
BOOST_ASSERT(priv_is_allocated_block(block));
// BOOST_ASSERT(block->m_size == priv_tail_size(block));
diff --git a/boost/interprocess/mem_algo/simple_seq_fit.hpp b/boost/interprocess/mem_algo/simple_seq_fit.hpp
index 5cc92c1103..1085ca00ac 100644
--- a/boost/interprocess/mem_algo/simple_seq_fit.hpp
+++ b/boost/interprocess/mem_algo/simple_seq_fit.hpp
@@ -31,7 +31,7 @@ namespace interprocess {
//!This class implements the simple sequential fit algorithm with a simply
//!linked list of free buffers.
template<class MutexFamily, class VoidPointer>
-class simple_seq_fit
+class simple_seq_fit
: public ipcdetail::simple_seq_fit_impl<MutexFamily, VoidPointer>
{
/// @cond
@@ -41,7 +41,7 @@ class simple_seq_fit
public:
typedef typename base_t::size_type size_type;
- //!Constructor. "size" is the total size of the managed memory segment,
+ //!Constructor. "size" is the total size of the managed memory segment,
//!"extra_hdr_bytes" indicates the extra bytes beginning in the sizeof(simple_seq_fit)
//!offset that the allocator should not use at all.*/
simple_seq_fit (size_type size, size_type extra_hdr_bytes)
diff --git a/boost/interprocess/offset_ptr.hpp b/boost/interprocess/offset_ptr.hpp
index 4187543d57..ac8da2c292 100644
--- a/boost/interprocess/offset_ptr.hpp
+++ b/boost/interprocess/offset_ptr.hpp
@@ -82,19 +82,19 @@ class offset_ptr
//!Never throws.
template <class T>
offset_ptr( T *ptr
- , typename ipcdetail::enable_if< ipcdetail::is_convertible<T*, PointedType*> >::type * = 0)
+ , typename ipcdetail::enable_if< ipcdetail::is_convertible<T*, PointedType*> >::type * = 0)
{ this->set_offset(static_cast<PointedType*>(ptr)); }
//!Constructor from other offset_ptr
//!Never throws.
- offset_ptr(const offset_ptr& ptr)
+ offset_ptr(const offset_ptr& ptr)
{ this->set_offset(ptr.get()); }
- //!Constructor from other offset_ptr. If pointers of pointee types are
+ //!Constructor from other offset_ptr. If pointers of pointee types are
//!convertible, offset_ptrs will be convertibles. Never throws.
template<class T2, class P2, class O2, std::size_t A2>
offset_ptr( const offset_ptr<T2, P2, O2, A2> &ptr
- , typename ipcdetail::enable_if< ipcdetail::is_convertible<T2*, PointedType*> >::type * = 0)
+ , typename ipcdetail::enable_if< ipcdetail::is_convertible<T2*, PointedType*> >::type * = 0)
{ this->set_offset(static_cast<PointedType*>(ptr.get())); }
//!Emulates static_cast operator.
@@ -131,12 +131,12 @@ class offset_ptr
//!Pointer-like -> operator. It can return 0 pointer.
//!Never throws.
- pointer operator->() const
+ pointer operator->() const
{ return this->get(); }
- //!Dereferencing operator, if it is a null offset_ptr behavior
+ //!Dereferencing operator, if it is a null offset_ptr behavior
//! is undefined. Never throws.
- reference operator* () const
+ reference operator* () const
{
pointer p = this->get();
reference r = *p;
@@ -146,7 +146,7 @@ class offset_ptr
//!Indexing operator.
//!Never throws.
template<class T>
- reference operator[](T idx) const
+ reference operator[](T idx) const
{ return this->get()[idx]; }
//!Assignment from pointer (saves extra conversion).
@@ -159,13 +159,13 @@ class offset_ptr
offset_ptr& operator= (const offset_ptr & pt)
{ pointer p(pt.get()); (void)p; this->set_offset(p); return *this; }
- //!Assignment from related offset_ptr. If pointers of pointee types
+ //!Assignment from related offset_ptr. If pointers of pointee types
//! are assignable, offset_ptrs will be assignable. Never throws.
template<class T2, class P2, class O2, std::size_t A2>
typename ipcdetail::enable_if<ipcdetail::is_convertible<T2*, PointedType*>, offset_ptr&>::type
operator= (const offset_ptr<T2, P2, O2, A2> & ptr)
{ this->set_offset(static_cast<PointedType*>(ptr.get())); return *this; }
-
+
//!offset_ptr += difference_type.
//!Never throws.
offset_ptr &operator+= (difference_type offset)
@@ -179,7 +179,7 @@ class offset_ptr
//!++offset_ptr.
//!Never throws.
- offset_ptr& operator++ (void)
+ offset_ptr& operator++ (void)
{ this->inc_offset(sizeof (PointedType)); return *this; }
//!offset_ptr++.
@@ -189,7 +189,7 @@ class offset_ptr
//!--offset_ptr.
//!Never throws.
- offset_ptr& operator-- (void)
+ offset_ptr& operator-- (void)
{ this->dec_offset(sizeof (PointedType)); return *this; }
//!offset_ptr--.
@@ -199,10 +199,10 @@ class offset_ptr
//!safe bool conversion operator.
//!Never throws.
- operator unspecified_bool_type() const
+ operator unspecified_bool_type() const
{ return this->get()? &self_t::unspecified_bool_type_func : 0; }
- //!Not operator. Not needed in theory, but improves portability.
+ //!Not operator. Not needed in theory, but improves portability.
//!Never throws
bool operator! () const
{ return this->get() == 0; }
@@ -345,8 +345,8 @@ class offset_ptr
#endif
return static_cast<PointedType *>(
static_cast<void*>(
- (internal.m_offset == 1) ?
- 0 :
+ (internal.m_offset == 1) ?
+ 0 :
(const_cast<char*>(reinterpret_cast<const char*>(this)) + internal.m_offset)
)
);
@@ -371,52 +371,52 @@ class offset_ptr
//!operator<<
//!for offset ptr
-template<class E, class T, class W, class X, class Y, std::size_t Z>
-inline std::basic_ostream<E, T> & operator<<
+template<class E, class T, class W, class X, class Y, std::size_t Z>
+inline std::basic_ostream<E, T> & operator<<
(std::basic_ostream<E, T> & os, offset_ptr<W, X, Y, Z> const & p)
{ return os << p.get_offset(); }
-//!operator>>
+//!operator>>
//!for offset ptr
-template<class E, class T, class W, class X, class Y, std::size_t Z>
-inline std::basic_istream<E, T> & operator>>
+template<class E, class T, class W, class X, class Y, std::size_t Z>
+inline std::basic_istream<E, T> & operator>>
(std::basic_istream<E, T> & is, offset_ptr<W, X, Y, Z> & p)
{ return is >> p.get_offset(); }
//!Simulation of static_cast between pointers. Never throws.
template<class T1, class P1, class O1, std::size_t A1, class T2, class P2, class O2, std::size_t A2>
-inline boost::interprocess::offset_ptr<T1, P1, O1, A1>
+inline boost::interprocess::offset_ptr<T1, P1, O1, A1>
static_pointer_cast(const boost::interprocess::offset_ptr<T2, P2, O2, A2> & r)
-{
+{
return boost::interprocess::offset_ptr<T1, P1, O1, A1>
- (r, boost::interprocess::ipcdetail::static_cast_tag());
+ (r, boost::interprocess::ipcdetail::static_cast_tag());
}
//!Simulation of const_cast between pointers. Never throws.
template<class T1, class P1, class O1, std::size_t A1, class T2, class P2, class O2, std::size_t A2>
inline boost::interprocess::offset_ptr<T1, P1, O1, A1>
const_pointer_cast(const boost::interprocess::offset_ptr<T2, P2, O2, A2> & r)
-{
+{
return boost::interprocess::offset_ptr<T1, P1, O1, A1>
- (r, boost::interprocess::ipcdetail::const_cast_tag());
+ (r, boost::interprocess::ipcdetail::const_cast_tag());
}
//!Simulation of dynamic_cast between pointers. Never throws.
template<class T1, class P1, class O1, std::size_t A1, class T2, class P2, class O2, std::size_t A2>
-inline boost::interprocess::offset_ptr<T1, P1, O1, A1>
+inline boost::interprocess::offset_ptr<T1, P1, O1, A1>
dynamic_pointer_cast(const boost::interprocess::offset_ptr<T2, P2, O2, A2> & r)
-{
+{
return boost::interprocess::offset_ptr<T1, P1, O1, A1>
- (r, boost::interprocess::ipcdetail::dynamic_cast_tag());
+ (r, boost::interprocess::ipcdetail::dynamic_cast_tag());
}
//!Simulation of reinterpret_cast between pointers. Never throws.
template<class T1, class P1, class O1, std::size_t A1, class T2, class P2, class O2, std::size_t A2>
inline boost::interprocess::offset_ptr<T1, P1, O1, A1>
reinterpret_pointer_cast(const boost::interprocess::offset_ptr<T2, P2, O2, A2> & r)
-{
+{
return boost::interprocess::offset_ptr<T1, P1, O1, A1>
- (r, boost::interprocess::ipcdetail::reinterpret_cast_tag());
+ (r, boost::interprocess::ipcdetail::reinterpret_cast_tag());
}
} //namespace interprocess {
@@ -425,14 +425,14 @@ inline boost::interprocess::offset_ptr<T1, P1, O1, A1>
//!has_trivial_constructor<> == true_type specialization for optimizations
template <class T, class P, class O, std::size_t A>
-struct has_trivial_constructor< boost::interprocess::offset_ptr<T, P, O, A> >
+struct has_trivial_constructor< boost::interprocess::offset_ptr<T, P, O, A> >
{
static const bool value = true;
};
///has_trivial_destructor<> == true_type specialization for optimizations
template <class T, class P, class O, std::size_t A>
-struct has_trivial_destructor< boost::interprocess::offset_ptr<T, P, O, A> >
+struct has_trivial_destructor< boost::interprocess::offset_ptr<T, P, O, A> >
{
static const bool value = true;
};
@@ -440,7 +440,7 @@ struct has_trivial_destructor< boost::interprocess::offset_ptr<T, P, O, A> >
//#if !defined(_MSC_VER) || (_MSC_VER >= 1400)
namespace interprocess {
//#endif
-//!to_raw_pointer() enables boost::mem_fn to recognize offset_ptr.
+//!to_raw_pointer() enables boost::mem_fn to recognize offset_ptr.
//!Never throws.
template <class T, class P, class O, std::size_t A>
inline T * to_raw_pointer(boost::interprocess::offset_ptr<T, P, O, A> const & p)
@@ -482,7 +482,7 @@ struct pointer_plus_bits<boost::interprocess::offset_ptr<T, P, O, A>, NumBits>
typedef boost::interprocess::offset_ptr<T, P, O, A> pointer;
//Bits are stored in the lower bits of the pointer except the LSB,
//because this bit is used to represent the null pointer.
- static const std::size_t Mask = ((std::size_t(1) << NumBits)-1)<<1u;
+ static const std::size_t Mask = ((std::size_t(1) << NumBits)-1)<<1u;
static pointer get_pointer(const pointer &n)
{ return reinterpret_cast<T*>(std::size_t(n.get()) & ~std::size_t(Mask)); }
diff --git a/boost/interprocess/segment_manager.hpp b/boost/interprocess/segment_manager.hpp
index 4424695992..8680a953e2 100644
--- a/boost/interprocess/segment_manager.hpp
+++ b/boost/interprocess/segment_manager.hpp
@@ -69,9 +69,9 @@ class segment_manager_base
typedef typename MemoryAlgorithm::void_pointer void_pointer;
typedef typename MemoryAlgorithm::mutex_family mutex_family;
typedef MemoryAlgorithm memory_algorithm;
-
+
/// @cond
-
+
//Experimental. Don't use
typedef typename MemoryAlgorithm::multiallocation_chain multiallocation_chain;
typedef typename MemoryAlgorithm::difference_type difference_type;
@@ -88,7 +88,7 @@ class segment_manager_base
//!"size" is the size of the memory segment where
//!the basic segment manager is being constructed.
//!
- //!"reserved_bytes" is the number of bytes
+ //!"reserved_bytes" is the number of bytes
//!after the end of the memory algorithm object itself
//!that the memory algorithm will exclude from
//!dynamic allocation
@@ -115,7 +115,7 @@ class segment_manager_base
static size_type get_min_size (size_type size)
{ return MemoryAlgorithm::get_min_size(size); }
- //!Allocates nbytes bytes. This function is only used in
+ //!Allocates nbytes bytes. This function is only used in
//!single-segment management. Never throws
void * allocate (size_type nbytes, std::nothrow_t)
{ return MemoryAlgorithm::allocate(nbytes); }
@@ -165,22 +165,22 @@ class segment_manager_base
//!Allocates nbytes bytes. Throws boost::interprocess::bad_alloc
//!on failure
void * allocate(size_type nbytes)
- {
+ {
void * ret = MemoryAlgorithm::allocate(nbytes);
if(!ret)
throw bad_alloc();
return ret;
}
- //!Allocates nbytes bytes. This function is only used in
+ //!Allocates nbytes bytes. This function is only used in
//!single-segment management. Never throws
void * allocate_aligned (size_type nbytes, size_type alignment, std::nothrow_t)
{ return MemoryAlgorithm::allocate_aligned(nbytes, alignment); }
- //!Allocates nbytes bytes. This function is only used in
+ //!Allocates nbytes bytes. This function is only used in
//!single-segment management. Throws bad_alloc when fails
void * allocate_aligned(size_type nbytes, size_type alignment)
- {
+ {
void * ret = MemoryAlgorithm::allocate_aligned(nbytes, alignment);
if(!ret)
throw bad_alloc();
@@ -269,7 +269,7 @@ class segment_manager_base
throw bad_alloc();
}
else{
- return 0;
+ return 0;
}
}
@@ -293,7 +293,7 @@ class segment_manager_base
void prot_anonymous_destroy(const void *object, ipcdetail::in_place_interface &table)
{
- //Get control data from associated with this object
+ //Get control data from associated with this object
typedef ipcdetail::block_header<size_type> block_header_t;
block_header_t *ctrl_data = block_header_t::block_header_from_value(object, table.size, table.alignment);
@@ -318,9 +318,9 @@ class segment_manager_base
//!This object is placed in the beginning of memory segment and
//!implements the allocation (named or anonymous) of portions
//!of the segment. This object contains two indexes that
-//!maintain an association between a name and a portion of the segment.
+//!maintain an association between a name and a portion of the segment.
//!
-//!The first index contains the mappings for normal named objects using the
+//!The first index contains the mappings for normal named objects using the
//!char type specified in the template parameter.
//!
//!The second index contains the association for unique instances. The key will
@@ -336,7 +336,7 @@ template<class CharType
,template<class IndexConfig> class IndexType>
class segment_manager
: public segment_manager_base<MemoryAlgorithm>
-{
+{
/// @cond
//Non-copyable
segment_manager();
@@ -446,7 +446,7 @@ class segment_manager
//!Returns throwing "construct" proxy
//!object
template <class T>
- typename construct_proxy<T>::type
+ typename construct_proxy<T>::type
construct(char_ptr_holder_t name)
{ return typename construct_proxy<T>::type (this, name, false, true); }
@@ -466,39 +466,39 @@ class segment_manager
//!Returns no throwing "search or construct"
//!proxy object
template <class T>
- typename construct_proxy<T>::type
+ typename construct_proxy<T>::type
find_or_construct(char_ptr_holder_t name, std::nothrow_t)
{ return typename construct_proxy<T>::type (this, name, true, false); }
//!Returns throwing "construct from iterators" proxy object
template <class T>
- typename construct_iter_proxy<T>::type
+ typename construct_iter_proxy<T>::type
construct_it(char_ptr_holder_t name)
{ return typename construct_iter_proxy<T>::type (this, name, false, true); }
//!Returns throwing "search or construct from iterators"
//!proxy object
template <class T>
- typename construct_iter_proxy<T>::type
+ typename construct_iter_proxy<T>::type
find_or_construct_it(char_ptr_holder_t name)
{ return typename construct_iter_proxy<T>::type (this, name, true, true); }
//!Returns no throwing "construct from iterators"
//!proxy object
template <class T>
- typename construct_iter_proxy<T>::type
+ typename construct_iter_proxy<T>::type
construct_it(char_ptr_holder_t name, std::nothrow_t)
{ return typename construct_iter_proxy<T>::type (this, name, false, false); }
//!Returns no throwing "search or construct from iterators"
//!proxy object
template <class T>
- typename construct_iter_proxy<T>::type
+ typename construct_iter_proxy<T>::type
find_or_construct_it(char_ptr_holder_t name, std::nothrow_t)
{ return typename construct_iter_proxy<T>::type (this, name, true, false); }
- //!Calls object function blocking recursive interprocess_mutex and guarantees that
- //!no new named_alloc or destroy will be executed by any process while
+ //!Calls object function blocking recursive interprocess_mutex and guarantees that
+ //!no new named_alloc or destroy will be executed by any process while
//!executing the object function call*/
template <class Func>
void atomic_func(Func &f)
@@ -571,22 +571,22 @@ class segment_manager
static instance_type get_instance_type(const T *ptr)
{ return priv_get_instance_type(block_header_t::block_header_from_value(ptr)); }
- //!Preallocates needed index resources to optimize the
+ //!Preallocates needed index resources to optimize the
//!creation of "num" named objects in the managed memory segment.
//!Can throw boost::interprocess::bad_alloc if there is no enough memory.
void reserve_named_objects(size_type num)
- {
+ {
//-------------------------------
scoped_lock<rmutex> guard(m_header);
//-------------------------------
- m_header.m_named_index.reserve(num);
+ m_header.m_named_index.reserve(num);
}
- //!Preallocates needed index resources to optimize the
+ //!Preallocates needed index resources to optimize the
//!creation of "num" unique objects in the managed memory segment.
//!Can throw boost::interprocess::bad_alloc if there is no enough memory.
void reserve_unique_objects(size_type num)
- {
+ {
//-------------------------------
scoped_lock<rmutex> guard(m_header);
//-------------------------------
@@ -596,32 +596,32 @@ class segment_manager
//!Calls shrink_to_fit in both named and unique object indexes
//!to try to free unused memory from those indexes.
void shrink_to_fit_indexes()
- {
+ {
//-------------------------------
scoped_lock<rmutex> guard(m_header);
//-------------------------------
- m_header.m_named_index.shrink_to_fit();
- m_header.m_unique_index.shrink_to_fit();
+ m_header.m_named_index.shrink_to_fit();
+ m_header.m_unique_index.shrink_to_fit();
}
//!Returns the number of named objects stored in
//!the segment.
size_type get_num_named_objects()
- {
+ {
//-------------------------------
scoped_lock<rmutex> guard(m_header);
//-------------------------------
- return m_header.m_named_index.size();
+ return m_header.m_named_index.size();
}
//!Returns the number of unique objects stored in
//!the segment.
size_type get_num_unique_objects()
- {
+ {
//-------------------------------
scoped_lock<rmutex> guard(m_header);
//-------------------------------
- return m_header.m_unique_index.size();
+ return m_header.m_unique_index.size();
}
//!Obtains the minimum size needed by the
@@ -693,13 +693,13 @@ class segment_manager
/// @cond
- //!Generic named/anonymous new function. Offers all the possibilities,
- //!such as throwing, search before creating, and the constructor is
+ //!Generic named/anonymous new function. Offers all the possibilities,
+ //!such as throwing, search before creating, and the constructor is
//!encapsulated in an object function.
template<class T>
- T *generic_construct(const CharType *name,
- size_type num,
- bool try2find,
+ T *generic_construct(const CharType *name,
+ size_type num,
+ bool try2find,
bool dothrow,
ipcdetail::in_place_interface &table)
{
@@ -713,7 +713,7 @@ class segment_manager
//!returned pair is 0.
template <class T>
std::pair<T*, size_type> priv_find_impl (const CharType* name, bool lock)
- {
+ {
//The name can't be null, no anonymous object can be found by name
BOOST_ASSERT(name != 0);
ipcdetail::placement_destroy<T> table;
@@ -737,13 +737,13 @@ class segment_manager
{
ipcdetail::placement_destroy<T> table;
size_type size;
- void *ret = priv_generic_find<char>(name, m_header.m_unique_index, table, size, is_intrusive_t(), lock);
+ void *ret = priv_generic_find<char>(name, m_header.m_unique_index, table, size, is_intrusive_t(), lock);
return std::pair<T*, size_type>(static_cast<T*>(ret), size);
}
- void *priv_generic_construct(const CharType *name,
- size_type num,
- bool try2find,
+ void *priv_generic_construct(const CharType *name,
+ size_type num,
+ bool try2find,
bool dothrow,
ipcdetail::in_place_interface &table)
{
@@ -805,7 +805,7 @@ class segment_manager
return 0;
}
CharType *name = static_cast<CharType*>(ctrl_data->template name<CharType>());
-
+
//Sanity checks
BOOST_ASSERT(ctrl_data->sizeof_char() == sizeof(CharType));
BOOST_ASSERT(ctrl_data->m_num_char == std::char_traits<CharType>::length(name));
@@ -837,7 +837,7 @@ class segment_manager
template <class CharT>
void *priv_generic_find
- (const CharT* name,
+ (const CharT* name,
IndexType<ipcdetail::index_config<CharT, MemoryAlgorithm> > &index,
ipcdetail::in_place_interface &table,
size_type &length,
@@ -877,7 +877,7 @@ class segment_manager
template <class CharT>
void *priv_generic_find
- (const CharT* name,
+ (const CharT* name,
IndexType<ipcdetail::index_config<CharT, MemoryAlgorithm> > &index,
ipcdetail::in_place_interface &table,
size_type &length,
@@ -941,7 +941,7 @@ class segment_manager
}
template <class CharT>
- bool priv_generic_named_destroy(const CharT *name,
+ bool priv_generic_named_destroy(const CharT *name,
IndexType<ipcdetail::index_config<CharT, MemoryAlgorithm> > &index,
ipcdetail::in_place_interface &table,
ipcdetail::true_ is_intrusive_index)
@@ -951,7 +951,7 @@ class segment_manager
typedef ipcdetail::index_key<CharT, void_pointer> index_key_t;
typedef typename index_type::iterator index_it;
typedef typename index_type::value_type intrusive_value_type;
-
+
//-------------------------------
scoped_lock<rmutex> guard(m_header);
//-------------------------------
@@ -972,7 +972,7 @@ class segment_manager
void *memory = iv;
void *values = ctrl_data->value();
std::size_t num = ctrl_data->m_value_bytes/table.size;
-
+
//Sanity check
BOOST_ASSERT((ctrl_data->m_value_bytes % table.size) == 0);
BOOST_ASSERT(sizeof(CharT) == ctrl_data->sizeof_char());
@@ -992,7 +992,7 @@ class segment_manager
}
template <class CharT>
- bool priv_generic_named_destroy(const CharT *name,
+ bool priv_generic_named_destroy(const CharT *name,
IndexType<ipcdetail::index_config<CharT, MemoryAlgorithm> > &index,
ipcdetail::in_place_interface &table,
ipcdetail::false_ is_intrusive_index)
@@ -1006,7 +1006,7 @@ class segment_manager
scoped_lock<rmutex> guard(m_header);
//-------------------------------
//Try to find the name in the index
- index_it it = index.find(key_type (name,
+ index_it it = index.find(key_type (name,
std::char_traits<CharT>::length(name)));
//If not found, return false
@@ -1033,7 +1033,7 @@ class segment_manager
char *stored_name = static_cast<char*>(static_cast<void*>(const_cast<CharT*>(it->first.name())));
(void)stored_name;
- //Check if the distance between the name pointer and the memory pointer
+ //Check if the distance between the name pointer and the memory pointer
//is correct (this can detect incorrect type in destruction)
std::size_t num = ctrl_data->m_value_bytes/table.size;
void *values = ctrl_data->value();
@@ -1070,8 +1070,8 @@ class segment_manager
template<class CharT>
void * priv_generic_named_construct(unsigned char type,
const CharT *name,
- size_type num,
- bool try2find,
+ size_type num,
+ bool try2find,
bool dothrow,
ipcdetail::in_place_interface &table,
IndexType<ipcdetail::index_config<CharT, MemoryAlgorithm> > &index,
@@ -1095,12 +1095,12 @@ class segment_manager
//-------------------------------
//Insert the node. This can throw.
//First, we want to know if the key is already present before
- //we allocate any memory, and if the key is not present, we
+ //we allocate any memory, and if the key is not present, we
//want to allocate all memory in a single buffer that will
//contain the name and the user buffer.
//
//Since equal_range(key) + insert(hint, value) approach is
- //quite inefficient in container implementations
+ //quite inefficient in container implementations
//(they re-test if the position is correct), I've chosen
//to insert the node, do an ugly un-const cast and modify
//the key (which is a smart pointer) to an equivalent one
@@ -1138,7 +1138,7 @@ class segment_manager
}
//Allocates buffer for name + data, this can throw (it hurts)
- void *buffer_ptr;
+ void *buffer_ptr;
//Check if there is enough memory
if(dothrow){
@@ -1149,7 +1149,7 @@ class segment_manager
buffer_ptr = this->allocate
(block_info.template total_size_with_header<intrusive_value_type>(), std::nothrow_t());
if(!buffer_ptr)
- return 0;
+ return 0;
}
//Now construct the intrusive hook plus the header
@@ -1184,7 +1184,7 @@ class segment_manager
//the memory allocation as the intrusive value is built in that
//memory
value_eraser<index_type> v_eraser(index, it);
-
+
//Construct array, this can throw
ipcdetail::array_construct(ptr, num, table);
@@ -1197,10 +1197,10 @@ class segment_manager
//!Generic named new function for
//!named functions
template<class CharT>
- void * priv_generic_named_construct(unsigned char type,
+ void * priv_generic_named_construct(unsigned char type,
const CharT *name,
- size_type num,
- bool try2find,
+ size_type num,
+ bool try2find,
bool dothrow,
ipcdetail::in_place_interface &table,
IndexType<ipcdetail::index_config<CharT, MemoryAlgorithm> > &index,
@@ -1227,12 +1227,12 @@ class segment_manager
//-------------------------------
//Insert the node. This can throw.
//First, we want to know if the key is already present before
- //we allocate any memory, and if the key is not present, we
+ //we allocate any memory, and if the key is not present, we
//want to allocate all memory in a single buffer that will
//contain the name and the user buffer.
//
//Since equal_range(key) + insert(hint, value) approach is
- //quite inefficient in container implementations
+ //quite inefficient in container implementations
//(they re-test if the position is correct), I've chosen
//to insert the node, do an ugly un-const cast and modify
//the key (which is a smart pointer) to an equivalent one
@@ -1265,7 +1265,7 @@ class segment_manager
value_eraser<index_type> v_eraser(index, it);
//Allocates buffer for name + data, this can throw (it hurts)
- void *buffer_ptr;
+ void *buffer_ptr;
block_header_t * hdr;
//Allocate and construct the headers
@@ -1277,7 +1277,7 @@ class segment_manager
else{
buffer_ptr = this->allocate(total_size, std::nothrow_t());
if(!buffer_ptr)
- return 0;
+ return 0;
}
index_it *idr = new(buffer_ptr) index_it(it);
hdr = block_header_t::template from_first_header<index_it>(idr);
@@ -1289,7 +1289,7 @@ class segment_manager
else{
buffer_ptr = this->allocate(block_info.total_size(), std::nothrow_t());
if(!buffer_ptr)
- return 0;
+ return 0;
}
hdr = static_cast<block_header_t*>(buffer_ptr);
}
@@ -1303,7 +1303,7 @@ class segment_manager
std::char_traits<CharT>::copy(name_ptr, name, namelen+1);
//Do the ugly cast, please mama, forgive me!
- //This new key points to an identical string, so it must have the
+ //This new key points to an identical string, so it must have the
//same position than the overwritten key according to the predicate
const_cast<key_type &>(it->first).name(name_ptr);
it->second.m_ptr = hdr;
@@ -1346,7 +1346,7 @@ class segment_manager
{
named_index_t m_named_index;
unique_index_t m_unique_index;
-
+
header_t(Base *restricted_segment_mngr)
: m_named_index (restricted_segment_mngr)
, m_unique_index(restricted_segment_mngr)
diff --git a/boost/interprocess/shared_memory_object.hpp b/boost/interprocess/shared_memory_object.hpp
index 7c8fcf61bd..f3bc7ba173 100644
--- a/boost/interprocess/shared_memory_object.hpp
+++ b/boost/interprocess/shared_memory_object.hpp
@@ -28,7 +28,7 @@
#if defined(BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS_ONLY)
# include <sys/shm.h> //System V shared memory...
#elif defined(BOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS)
-# include <fcntl.h> //O_CREAT, O_*...
+# include <fcntl.h> //O_CREAT, O_*...
# include <sys/mman.h> //shm_xxx
# include <unistd.h> //ftruncate, close
# include <sys/stat.h> //mode_t, S_IRWXG, S_IRWXO, S_IRWXU,
@@ -71,26 +71,26 @@ class shared_memory_object
shared_memory_object(open_or_create_t, const char *name, mode_t mode, const permissions &perm = permissions())
{ this->priv_open_or_create(ipcdetail::DoOpenOrCreate, name, mode, perm); }
- //!Tries to open a shared memory object with name "name", with the access mode "mode".
+ //!Tries to open a shared memory object with name "name", with the access mode "mode".
//!If the file does not previously exist, it throws an error.
shared_memory_object(open_only_t, const char *name, mode_t mode)
{ this->priv_open_or_create(ipcdetail::DoOpen, name, mode, permissions()); }
- //!Moves the ownership of "moved"'s shared memory object to *this.
- //!After the call, "moved" does not represent any shared memory object.
+ //!Moves the ownership of "moved"'s shared memory object to *this.
+ //!After the call, "moved" does not represent any shared memory object.
//!Does not throw
shared_memory_object(BOOST_RV_REF(shared_memory_object) moved)
: m_handle(file_handle_t(ipcdetail::invalid_file()))
{ this->swap(moved); }
//!Moves the ownership of "moved"'s shared memory to *this.
- //!After the call, "moved" does not represent any shared memory.
+ //!After the call, "moved" does not represent any shared memory.
//!Does not throw
shared_memory_object &operator=(BOOST_RV_REF(shared_memory_object) moved)
- {
+ {
shared_memory_object tmp(boost::move(moved));
this->swap(tmp);
- return *this;
+ return *this;
}
//!Swaps the shared_memory_objects. Does not throw
@@ -99,7 +99,7 @@ class shared_memory_object
//!Erases a shared memory object from the system.
//!Returns false on error. Never throws
static bool remove(const char *name);
-
+
//!Sets the size of the shared memory mapping
void truncate(offset_t length);
@@ -142,11 +142,11 @@ class shared_memory_object
/// @cond
-inline shared_memory_object::shared_memory_object()
+inline shared_memory_object::shared_memory_object()
: m_handle(file_handle_t(ipcdetail::invalid_file()))
{}
-inline shared_memory_object::~shared_memory_object()
+inline shared_memory_object::~shared_memory_object()
{ this->priv_close(); }
@@ -157,10 +157,10 @@ inline bool shared_memory_object::get_size(offset_t &size) const
{ return ipcdetail::get_file_size((file_handle_t)m_handle, size); }
inline void shared_memory_object::swap(shared_memory_object &other)
-{
+{
std::swap(m_handle, other.m_handle);
std::swap(m_mode, other.m_mode);
- m_filename.swap(other.m_filename);
+ m_filename.swap(other.m_filename);
}
inline mapping_handle_t shared_memory_object::get_mapping_handle() const
@@ -268,7 +268,7 @@ inline bool use_filesystem_based_posix()
} //shared_memory_object_detail
inline bool shared_memory_object::priv_open_or_create
- (ipcdetail::create_enum_t type,
+ (ipcdetail::create_enum_t type,
const char *filename,
mode_t mode, const permissions &perm)
{
diff --git a/boost/interprocess/smart_ptr/deleter.hpp b/boost/interprocess/smart_ptr/deleter.hpp
index 4aba772975..3a07ccd8f4 100644
--- a/boost/interprocess/smart_ptr/deleter.hpp
+++ b/boost/interprocess/smart_ptr/deleter.hpp
@@ -26,9 +26,9 @@
//!Describes the functor to delete objects from the segment.
namespace boost {
-namespace interprocess {
+namespace interprocess {
-//!A deleter that uses the segment manager's destroy_ptr
+//!A deleter that uses the segment manager's destroy_ptr
//!function to destroy the passed pointer resource.
//!
//!This deleter is used
@@ -56,7 +56,7 @@ class deleter
{ mp_mngr->destroy_ptr(ipcdetail::to_raw_pointer(p)); }
};
-} //namespace interprocess {
+} //namespace interprocess {
} //namespace boost {
#include <boost/interprocess/detail/config_end.hpp>
diff --git a/boost/interprocess/smart_ptr/detail/shared_count.hpp b/boost/interprocess/smart_ptr/detail/shared_count.hpp
index 0150ef6c00..7daaee6ea4 100644
--- a/boost/interprocess/smart_ptr/detail/shared_count.hpp
+++ b/boost/interprocess/smart_ptr/detail/shared_count.hpp
@@ -28,7 +28,7 @@
#include <boost/interprocess/smart_ptr/detail/bad_weak_ptr.hpp>
#include <boost/interprocess/smart_ptr/detail/sp_counted_impl.hpp>
#include <boost/interprocess/detail/utilities.hpp>
-#include <boost/container/allocator/allocator_traits.hpp>
+#include <boost/container/allocator_traits.hpp>
#include <boost/detail/no_exceptions_support.hpp>
#include <functional> // std::less
@@ -99,7 +99,7 @@ class shared_count
counted_impl_allocator alloc(a);
m_pi = alloc.allocate(1);
//Anti-exception deallocator
- scoped_ptr<counted_impl,
+ scoped_ptr<counted_impl,
scoped_ptr_dealloc_functor<counted_impl_allocator> >
deallocator(m_pi, alloc);
//It's more correct to use VoidAllocator::construct but
@@ -116,7 +116,7 @@ class shared_count
}
~shared_count() // nothrow
- {
+ {
if(m_pi)
m_pi->release();
}
diff --git a/boost/interprocess/smart_ptr/detail/sp_counted_impl.hpp b/boost/interprocess/smart_ptr/detail/sp_counted_impl.hpp
index 4e2e664c86..6a46bb75e6 100644
--- a/boost/interprocess/smart_ptr/detail/sp_counted_impl.hpp
+++ b/boost/interprocess/smart_ptr/detail/sp_counted_impl.hpp
@@ -26,7 +26,7 @@
#include <boost/interprocess/smart_ptr/detail/sp_counted_base.hpp>
#include <boost/interprocess/smart_ptr/scoped_ptr.hpp>
#include <boost/interprocess/detail/utilities.hpp>
-#include <boost/container/allocator/allocator_traits.hpp>
+#include <boost/container/allocator_traits.hpp>
#include <boost/intrusive/pointer_traits.hpp>
namespace boost {
@@ -63,10 +63,10 @@ struct scoped_ptr_dealloc_functor
{ if (ptr) priv_deallocate(ptr, alloc_version()); }
};
-
+
template<class A, class D>
-class sp_counted_impl_pd
+class sp_counted_impl_pd
: public sp_counted_base
, boost::container::allocator_traits<A>::template
portable_rebind_alloc< sp_counted_impl_pd<A, D> >::type
diff --git a/boost/interprocess/smart_ptr/intrusive_ptr.hpp b/boost/interprocess/smart_ptr/intrusive_ptr.hpp
index 3f086f5360..f6d5c8b77c 100644
--- a/boost/interprocess/smart_ptr/intrusive_ptr.hpp
+++ b/boost/interprocess/smart_ptr/intrusive_ptr.hpp
@@ -33,12 +33,12 @@ namespace interprocess {
//!The intrusive_ptr class template stores a pointer to an object
//!with an embedded reference count. intrusive_ptr is parameterized on
-//!T (the type of the object pointed to) and VoidPointer(a void pointer type
+//!T (the type of the object pointed to) and VoidPointer(a void pointer type
//!that defines the type of pointer that intrusive_ptr will store).
//!intrusive_ptr<T, void *> defines a class with a T* member whereas
//!intrusive_ptr<T, offset_ptr<void> > defines a class with a offset_ptr<T> member.
//!Relies on unqualified calls to:
-//!
+//!
//! void intrusive_ptr_add_ref(T * p);
//! void intrusive_ptr_release(T * p);
//!
@@ -69,7 +69,7 @@ class intrusive_ptr
intrusive_ptr(): m_ptr(0)
{}
- //!Constructor. Copies pointer and if "p" is not zero and
+ //!Constructor. Copies pointer and if "p" is not zero and
//!"add_ref" is true calls intrusive_ptr_add_ref(to_raw_pointer(p)).
//!Does not throw
intrusive_ptr(const pointer &p, bool add_ref = true): m_ptr(p)
@@ -101,7 +101,7 @@ class intrusive_ptr
if(m_ptr != 0) intrusive_ptr_release(ipcdetail::to_raw_pointer(m_ptr));
}
- //!Assignment operator. Equivalent to intrusive_ptr(r).swap(*this).
+ //!Assignment operator. Equivalent to intrusive_ptr(r).swap(*this).
//!Does not throw
intrusive_ptr & operator=(intrusive_ptr const & rhs)
{
@@ -109,7 +109,7 @@ class intrusive_ptr
return *this;
}
- //!Assignment from related. Equivalent to intrusive_ptr(r).swap(*this).
+ //!Assignment from related. Equivalent to intrusive_ptr(r).swap(*this).
//!Does not throw
template<class U> intrusive_ptr & operator=
(intrusive_ptr<U, VP> const & rhs)
@@ -118,14 +118,14 @@ class intrusive_ptr
return *this;
}
- //!Assignment from pointer. Equivalent to intrusive_ptr(r).swap(*this).
+ //!Assignment from pointer. Equivalent to intrusive_ptr(r).swap(*this).
//!Does not throw
intrusive_ptr & operator=(pointer rhs)
{
this_type(rhs).swap(*this);
return *this;
}
-
+
//!Returns a reference to the internal pointer.
//!Does not throw
pointer &get()
@@ -175,7 +175,7 @@ class intrusive_ptr
//!Returns a.get() == b.get().
//!Does not throw
template<class T, class U, class VP> inline
-bool operator==(intrusive_ptr<T, VP> const & a,
+bool operator==(intrusive_ptr<T, VP> const & a,
intrusive_ptr<U, VP> const & b)
{ return a.get() == b.get(); }
@@ -217,11 +217,11 @@ bool operator!=(const typename intrusive_ptr<T, VP>::pointer &a,
//!Returns a.get() < b.get().
//!Does not throw
template<class T, class VP> inline
-bool operator<(intrusive_ptr<T, VP> const & a,
+bool operator<(intrusive_ptr<T, VP> const & a,
intrusive_ptr<T, VP> const & b)
-{
+{
return std::less<typename intrusive_ptr<T, VP>::pointer>()
- (a.get(), b.get());
+ (a.get(), b.get());
}
//!Exchanges the contents of the two intrusive_ptrs.
@@ -233,7 +233,7 @@ void swap(intrusive_ptr<T, VP> & lhs,
// operator<<
template<class E, class T, class Y, class VP>
-inline std::basic_ostream<E, T> & operator<<
+inline std::basic_ostream<E, T> & operator<<
(std::basic_ostream<E, T> & os, intrusive_ptr<Y, VP> const & p)
{ os << p.get(); return os; }
diff --git a/boost/interprocess/smart_ptr/scoped_ptr.hpp b/boost/interprocess/smart_ptr/scoped_ptr.hpp
index 1885838ffe..a3755d3592 100644
--- a/boost/interprocess/smart_ptr/scoped_ptr.hpp
+++ b/boost/interprocess/smart_ptr/scoped_ptr.hpp
@@ -27,14 +27,14 @@
namespace boost {
namespace interprocess {
-//!scoped_ptr stores a pointer to a dynamically allocated object.
+//!scoped_ptr stores a pointer to a dynamically allocated object.
//!The object pointed to is guaranteed to be deleted, either on destruction
//!of the scoped_ptr, or via an explicit reset. The user can avoid this
//!deletion using release().
-//!scoped_ptr is parameterized on T (the type of the object pointed to) and
+//!scoped_ptr is parameterized on T (the type of the object pointed to) and
//!Deleter (the functor to be executed to delete the internal pointer).
-//!The internal pointer will be of the same pointer type as typename
-//!Deleter::pointer type (that is, if typename Deleter::pointer is
+//!The internal pointer will be of the same pointer type as typename
+//!Deleter::pointer type (that is, if typename Deleter::pointer is
//!offset_ptr<void>, the internal pointer will be offset_ptr<T>).
template<class T, class Deleter>
class scoped_ptr
@@ -60,10 +60,10 @@ class scoped_ptr
: Deleter(d), m_ptr(p) // throws if pointer/Deleter copy ctor throws
{}
- //!If the stored pointer is not 0, destroys the object pointed to by the stored pointer.
+ //!If the stored pointer is not 0, destroys the object pointed to by the stored pointer.
//!calling the operator() of the stored deleter. Never throws
~scoped_ptr()
- {
+ {
if(m_ptr){
Deleter &del = static_cast<Deleter&>(*this);
del(m_ptr);
diff --git a/boost/interprocess/smart_ptr/shared_ptr.hpp b/boost/interprocess/smart_ptr/shared_ptr.hpp
index 61829078e8..5ede547a3f 100644
--- a/boost/interprocess/smart_ptr/shared_ptr.hpp
+++ b/boost/interprocess/smart_ptr/shared_ptr.hpp
@@ -52,7 +52,7 @@ inline void sp_enable_shared_from_this
(shared_count<T, VoidAllocator, Deleter> const & pn
,enable_shared_from_this<T, VoidAllocator, Deleter> *pe
,T *ptr)
-
+
{
(void)ptr;
if(pe != 0){
@@ -66,17 +66,17 @@ inline void sp_enable_shared_from_this(shared_count<T, VoidAllocator, Deleter> c
} // namespace ipcdetail
-//!shared_ptr stores a pointer to a dynamically allocated object.
-//!The object pointed to is guaranteed to be deleted when the last shared_ptr pointing to
+//!shared_ptr stores a pointer to a dynamically allocated object.
+//!The object pointed to is guaranteed to be deleted when the last shared_ptr pointing to
//!it is destroyed or reset.
//!
-//!shared_ptr is parameterized on
+//!shared_ptr is parameterized on
//!T (the type of the object pointed to), VoidAllocator (the void allocator to be used
-//!to allocate the auxiliary data) and Deleter (the deleter whose
+//!to allocate the auxiliary data) and Deleter (the deleter whose
//!operator() will be used to delete the object.
//!
-//!The internal pointer will be of the same pointer type as typename
-//!VoidAllocator::pointer type (that is, if typename VoidAllocator::pointer is
+//!The internal pointer will be of the same pointer type as typename
+//!VoidAllocator::pointer type (that is, if typename VoidAllocator::pointer is
//!offset_ptr<void>, the internal pointer will be offset_ptr<T>).
//!
//!Because the implementation uses reference counting, cycles of shared_ptr
@@ -125,7 +125,7 @@ class shared_ptr
//!Requirements: Deleter and A's copy constructor must not throw.
explicit shared_ptr(const pointer&p, const VoidAllocator &a = VoidAllocator(), const Deleter &d = Deleter())
: m_pn(p, a, d)
- {
+ {
//Check that the pointer passed is of the same type that
//the pointer the allocator defines or it's a raw pointer
typedef typename boost::intrusive::
@@ -134,25 +134,30 @@ class shared_ptr
BOOST_STATIC_ASSERT((ipcdetail::is_same<pointer, ParameterPointer>::value) ||
(ipcdetail::is_pointer<pointer>::value));
- ipcdetail::sp_enable_shared_from_this<T, VoidAllocator, Deleter>( m_pn, ipcdetail::to_raw_pointer(p), ipcdetail::to_raw_pointer(p) );
+ ipcdetail::sp_enable_shared_from_this<T, VoidAllocator, Deleter>( m_pn, ipcdetail::to_raw_pointer(p), ipcdetail::to_raw_pointer(p) );
}
+ //!Copy constructs a shared_ptr. If r is empty, constructs an empty shared_ptr. Otherwise, constructs
+ //!a shared_ptr that shares ownership with r. Never throws.
+ shared_ptr(const shared_ptr &r)
+ : m_pn(r.m_pn) // never throws
+ {}
- //!Constructs a shared_ptr that shares ownership with r and stores p.
+ //!Constructs a shared_ptr that shares ownership with other and stores p.
//!Postconditions: get() == p && use_count() == r.use_count().
//!Throws: nothing.
shared_ptr(const shared_ptr &other, const pointer &p)
: m_pn(other.m_pn, p)
{}
- //!If r is empty, constructs an empty shared_ptr. Otherwise, constructs
+ //!If r is empty, constructs an empty shared_ptr. Otherwise, constructs
//!a shared_ptr that shares ownership with r. Never throws.
template<class Y>
shared_ptr(shared_ptr<Y, VoidAllocator, Deleter> const & r)
: m_pn(r.m_pn) // never throws
{}
- //!Constructs a shared_ptr that shares ownership with r and stores
+ //!Constructs a shared_ptr that shares ownership with r and stores
//!a copy of the pointer stored in r.
template<class Y>
explicit shared_ptr(weak_ptr<Y, VoidAllocator, Deleter> const & r)
@@ -170,19 +175,19 @@ class shared_ptr
template<class Y>
shared_ptr(shared_ptr<Y, VoidAllocator, Deleter> const & r, ipcdetail::static_cast_tag)
: m_pn( pointer(static_cast<T*>(ipcdetail::to_raw_pointer(r.m_pn.to_raw_pointer())))
- , r.m_pn)
+ , r.m_pn)
{}
template<class Y>
shared_ptr(shared_ptr<Y, VoidAllocator, Deleter> const & r, ipcdetail::const_cast_tag)
: m_pn( pointer(const_cast<T*>(ipcdetail::to_raw_pointer(r.m_pn.to_raw_pointer())))
- , r.m_pn)
+ , r.m_pn)
{}
template<class Y>
shared_ptr(shared_ptr<Y, VoidAllocator, Deleter> const & r, ipcdetail::dynamic_cast_tag)
: m_pn( pointer(dynamic_cast<T*>(ipcdetail::to_raw_pointer(r.m_pn.to_raw_pointer())))
- , r.m_pn)
+ , r.m_pn)
{
if(!m_pn.to_raw_pointer()){ // need to allocate new counter -- the cast failed
m_pn = ipcdetail::shared_count<T, VoidAllocator, Deleter>();
@@ -218,15 +223,15 @@ class shared_ptr
//!This is equivalent to:
//!this_type().swap(*this);
void reset()
- {
- this_type().swap(*this);
+ {
+ this_type().swap(*this);
}
//!This is equivalent to:
//!this_type(p, a, d).swap(*this);
template<class Pointer>
void reset(const Pointer &p, const VoidAllocator &a = VoidAllocator(), const Deleter &d = Deleter())
- {
+ {
//Check that the pointer passed is of the same type that
//the pointer the allocator defines or it's a raw pointer
typedef typename boost::intrusive::
@@ -234,7 +239,7 @@ class shared_ptr
rebind_pointer<T>::type ParameterPointer;
BOOST_STATIC_ASSERT((ipcdetail::is_same<pointer, ParameterPointer>::value) ||
(ipcdetail::is_pointer<Pointer>::value));
- this_type(p, a, d).swap(*this);
+ this_type(p, a, d).swap(*this);
}
template<class Y>
@@ -248,12 +253,12 @@ class shared_ptr
reference operator* () const // never throws
{ BOOST_ASSERT(m_pn.to_raw_pointer() != 0); return *m_pn.to_raw_pointer(); }
- //!Returns the pointer pointing
+ //!Returns the pointer pointing
//!to the owned object
pointer operator-> () const // never throws
{ BOOST_ASSERT(m_pn.to_raw_pointer() != 0); return m_pn.to_raw_pointer(); }
- //!Returns the pointer pointing
+ //!Returns the pointer pointing
//!to the owned object
pointer get() const // never throws
{ return m_pn.to_raw_pointer(); }
@@ -292,7 +297,7 @@ class shared_ptr
/// @cond
- template<class T2, class A2, class Deleter2>
+ template<class T2, class A2, class Deleter2>
bool _internal_less(shared_ptr<T2, A2, Deleter2> const & rhs) const
{ return m_pn < rhs.m_pn; }
@@ -311,19 +316,19 @@ class shared_ptr
/// @endcond
}; // shared_ptr
-template<class T, class VoidAllocator, class Deleter, class U, class VoidAllocator2, class Deleter2> inline
+template<class T, class VoidAllocator, class Deleter, class U, class VoidAllocator2, class Deleter2> inline
bool operator==(shared_ptr<T, VoidAllocator, Deleter> const & a, shared_ptr<U, VoidAllocator2, Deleter2> const & b)
{ return a.get() == b.get(); }
-template<class T, class VoidAllocator, class Deleter, class U, class VoidAllocator2, class Deleter2> inline
+template<class T, class VoidAllocator, class Deleter, class U, class VoidAllocator2, class Deleter2> inline
bool operator!=(shared_ptr<T, VoidAllocator, Deleter> const & a, shared_ptr<U, VoidAllocator2, Deleter2> const & b)
{ return a.get() != b.get(); }
-template<class T, class VoidAllocator, class Deleter, class U, class VoidAllocator2, class Deleter2> inline
+template<class T, class VoidAllocator, class Deleter, class U, class VoidAllocator2, class Deleter2> inline
bool operator<(shared_ptr<T, VoidAllocator, Deleter> const & a, shared_ptr<U, VoidAllocator2, Deleter2> const & b)
{ return a._internal_less(b); }
-template<class T, class VoidAllocator, class Deleter> inline
+template<class T, class VoidAllocator, class Deleter> inline
void swap(shared_ptr<T, VoidAllocator, Deleter> & a, shared_ptr<T, VoidAllocator, Deleter> & b)
{ a.swap(b); }
@@ -331,11 +336,11 @@ template<class T, class VoidAllocator, class Deleter, class U> inline
shared_ptr<T, VoidAllocator, Deleter> static_pointer_cast(shared_ptr<U, VoidAllocator, Deleter> const & r)
{ return shared_ptr<T, VoidAllocator, Deleter>(r, ipcdetail::static_cast_tag()); }
-template<class T, class VoidAllocator, class Deleter, class U> inline
+template<class T, class VoidAllocator, class Deleter, class U> inline
shared_ptr<T, VoidAllocator, Deleter> const_pointer_cast(shared_ptr<U, VoidAllocator, Deleter> const & r)
{ return shared_ptr<T, VoidAllocator, Deleter>(r, ipcdetail::const_cast_tag()); }
-template<class T, class VoidAllocator, class Deleter, class U> inline
+template<class T, class VoidAllocator, class Deleter, class U> inline
shared_ptr<T, VoidAllocator, Deleter> dynamic_pointer_cast(shared_ptr<U, VoidAllocator, Deleter> const & r)
{ return shared_ptr<T, VoidAllocator, Deleter>(r, ipcdetail::dynamic_cast_tag()); }
@@ -346,7 +351,7 @@ T * to_raw_pointer(shared_ptr<T, VoidAllocator, Deleter> const & p)
// operator<<
template<class E, class T, class Y, class VoidAllocator, class Deleter> inline
-std::basic_ostream<E, T> & operator<<
+std::basic_ostream<E, T> & operator<<
(std::basic_ostream<E, T> & os, shared_ptr<Y, VoidAllocator, Deleter> const & p)
{ os << p.get(); return os; }
diff --git a/boost/interprocess/smart_ptr/unique_ptr.hpp b/boost/interprocess/smart_ptr/unique_ptr.hpp
index 547038b69b..89cdb1e6e2 100644
--- a/boost/interprocess/smart_ptr/unique_ptr.hpp
+++ b/boost/interprocess/smart_ptr/unique_ptr.hpp
@@ -272,20 +272,20 @@ class unique_ptr
//!Returns: A reference to the stored deleter.
//!
//!Throws: nothing.
- deleter_reference get_deleter()
+ deleter_reference get_deleter()
{ return ptr_.second(); }
//!Returns: A const reference to the stored deleter.
//!
//!Throws: nothing.
- deleter_const_reference get_deleter() const
+ deleter_const_reference get_deleter() const
{ return ptr_.second(); }
//!Returns: An unspecified value that, when used in boolean
//!contexts, is equivalent to get() != 0.
//!
//!Throws: nothing.
- operator int nat::*() const
+ operator int nat::*() const
{ return ptr_.first() ? &nat::for_bool_ : 0; }
//!Postcondition: get() == 0.
@@ -328,7 +328,7 @@ class unique_ptr
BOOST_MOVABLE_BUT_NOT_COPYABLE(unique_ptr)
template <class U, class E> unique_ptr(unique_ptr<U, E>&);
template <class U> unique_ptr(U&, typename ipcdetail::unique_ptr_error<U>::type = 0);
-
+
template <class U, class E> unique_ptr& operator=(unique_ptr<U, E>&);
template <class U> typename ipcdetail::unique_ptr_error<U>::type operator=(U&);
/// @endcond
@@ -539,7 +539,7 @@ template<class T, class ManagedMemory>
inline typename managed_unique_ptr<T, ManagedMemory>::type
make_managed_unique_ptr(T *constructed_object, ManagedMemory &managed_memory)
{
- return typename managed_unique_ptr<T, ManagedMemory>::type
+ return typename managed_unique_ptr<T, ManagedMemory>::type
(constructed_object, managed_memory.template get_deleter<T>());
}
diff --git a/boost/interprocess/smart_ptr/weak_ptr.hpp b/boost/interprocess/smart_ptr/weak_ptr.hpp
index 7126d055aa..5202ede91c 100644
--- a/boost/interprocess/smart_ptr/weak_ptr.hpp
+++ b/boost/interprocess/smart_ptr/weak_ptr.hpp
@@ -31,7 +31,7 @@ namespace boost{
namespace interprocess{
//!The weak_ptr class template stores a "weak reference" to an object
-//!that's already managed by a shared_ptr. To access the object, a weak_ptr
+//!that's already managed by a shared_ptr. To access the object, a weak_ptr
//!can be converted to a shared_ptr using the shared_ptr constructor or the
//!member function lock. When the last shared_ptr to the object goes away
//!and the object is deleted, the attempt to obtain a shared_ptr from the
@@ -99,11 +99,11 @@ class weak_ptr
template<class Y>
weak_ptr(weak_ptr<Y, A, D> const & r)
: m_pn(r.m_pn) // never throws
- {
+ {
//Construct a temporary shared_ptr so that nobody
//can destroy the value while constructing this
const shared_ptr<T, A, D> &ref = r.lock();
- m_pn.set_pointer(ref.get());
+ m_pn.set_pointer(ref.get());
}
//!Effects: If r is empty, constructs an empty weak_ptr; otherwise,
@@ -126,7 +126,7 @@ class weak_ptr
//!implied guarantees) via different means, without creating a temporary.
template<class Y>
weak_ptr & operator=(weak_ptr<Y, A, D> const & r) // never throws
- {
+ {
//Construct a temporary shared_ptr so that nobody
//can destroy the value while constructing this
const shared_ptr<T, A, D> &ref = r.lock();
@@ -174,7 +174,7 @@ class weak_ptr
//!testing purposes, not for production code.
long use_count() const // never throws
{ return m_pn.use_count(); }
-
+
//!Returns: Returns: use_count() == 0.
//!
//!Throws: nothing.
@@ -196,10 +196,10 @@ class weak_ptr
{ ipcdetail::do_swap(m_pn, other.m_pn); }
/// @cond
- template<class T2, class A2, class D2>
+ template<class T2, class A2, class D2>
bool _internal_less(weak_ptr<T2, A2, D2> const & rhs) const
{ return m_pn < rhs.m_pn; }
-
+
template<class Y>
void _internal_assign(const ipcdetail::shared_count<Y, A, D> & pn2)
{
@@ -216,7 +216,7 @@ class weak_ptr
/// @endcond
}; // weak_ptr
-template<class T, class A, class D, class U, class A2, class D2> inline
+template<class T, class A, class D, class U, class A2, class D2> inline
bool operator<(weak_ptr<T, A, D> const & a, weak_ptr<U, A2, D2> const & b)
{ return a._internal_less(b); }
diff --git a/boost/interprocess/streams/bufferstream.hpp b/boost/interprocess/streams/bufferstream.hpp
index 834b3d1e01..3ae9f5e2dc 100644
--- a/boost/interprocess/streams/bufferstream.hpp
+++ b/boost/interprocess/streams/bufferstream.hpp
@@ -42,7 +42,7 @@
#include <ios>
#include <istream>
#include <ostream>
-#include <string> // char traits
+#include <string> // char traits
#include <cstddef> // ptrdiff_t
#include <boost/assert.hpp>
#include <boost/interprocess/interprocess_fwd.hpp>
@@ -53,7 +53,7 @@ namespace boost { namespace interprocess {
//!a basic_xbufferstream. The elements are transmitted from a to a fixed
//!size buffer
template <class CharT, class CharTraits>
-class basic_bufferbuf
+class basic_bufferbuf
: public std::basic_streambuf<CharT, CharTraits>
{
public:
@@ -74,7 +74,7 @@ class basic_bufferbuf
//!Constructor. Assigns formatting buffer.
//!Does not throw.
- explicit basic_bufferbuf(CharT *buffer, std::size_t length,
+ explicit basic_bufferbuf(CharT *buffer, std::size_t length,
std::ios_base::openmode mode
= std::ios_base::in | std::ios_base::out)
: base_t(), m_mode(mode), m_buffer(buffer), m_length(length)
@@ -83,7 +83,7 @@ class basic_bufferbuf
virtual ~basic_bufferbuf(){}
public:
- //!Returns the pointer and size of the internal buffer.
+ //!Returns the pointer and size of the internal buffer.
//!Does not throw.
std::pair<CharT *, std::size_t> buffer() const
{ return std::pair<CharT *, std::size_t>(m_buffer, m_length); }
@@ -172,13 +172,13 @@ class basic_bufferbuf
}
virtual pos_type seekoff(off_type off, std::ios_base::seekdir dir,
- std::ios_base::openmode mode
+ std::ios_base::openmode mode
= std::ios_base::in | std::ios_base::out)
{
bool in = false;
bool out = false;
-
- const std::ios_base::openmode inout =
+
+ const std::ios_base::openmode inout =
std::ios_base::in | std::ios_base::out;
if((mode & inout) == inout) {
@@ -205,7 +205,7 @@ class basic_bufferbuf
newoff = static_cast<std::streamoff>(m_length);
break;
case std::ios_base::cur:
- newoff = in ? static_cast<std::streamoff>(this->gptr() - this->eback())
+ newoff = in ? static_cast<std::streamoff>(this->gptr() - this->eback())
: static_cast<std::streamoff>(this->pptr() - this->pbase());
break;
default:
@@ -237,7 +237,7 @@ class basic_bufferbuf
return pos_type(off);
}
- virtual pos_type seekpos(pos_type pos, std::ios_base::openmode mode
+ virtual pos_type seekpos(pos_type pos, std::ios_base::openmode mode
= std::ios_base::in | std::ios_base::out)
{ return seekoff(pos - pos_type(off_type(0)), std::ios_base::beg, mode); }
@@ -277,7 +277,7 @@ class basic_ibufferstream
//!Does not throw.
basic_ibufferstream(const CharT *buffer, std::size_t length,
std::ios_base::openmode mode = std::ios_base::in)
- : basic_ios_t(), base_t(0),
+ : basic_ios_t(), base_t(0),
m_buf(const_cast<CharT*>(buffer), length, mode | std::ios_base::in)
{ basic_ios_t::init(&m_buf); }
@@ -289,12 +289,12 @@ class basic_ibufferstream
basic_bufferbuf<CharT, CharTraits>* rdbuf() const
{ return const_cast<basic_bufferbuf<CharT, CharTraits>*>(&m_buf); }
- //!Returns the pointer and size of the internal buffer.
+ //!Returns the pointer and size of the internal buffer.
//!Does not throw.
std::pair<const CharT *, std::size_t> buffer() const
{ return m_buf.buffer(); }
- //!Sets the underlying buffer to a new value. Resets
+ //!Sets the underlying buffer to a new value. Resets
//!stream position. Does not throw.
void buffer(const CharT *buffer, std::size_t length)
{ m_buf.buffer(const_cast<CharT*>(buffer), length); }
@@ -335,7 +335,7 @@ class basic_obufferstream
//!Does not throw.
basic_obufferstream(CharT *buffer, std::size_t length,
std::ios_base::openmode mode = std::ios_base::out)
- : basic_ios_t(), base_t(0),
+ : basic_ios_t(), base_t(0),
m_buf(buffer, length, mode | std::ios_base::out)
{ basic_ios_t::init(&m_buf); }
@@ -347,12 +347,12 @@ class basic_obufferstream
basic_bufferbuf<CharT, CharTraits>* rdbuf() const
{ return const_cast<basic_bufferbuf<CharT, CharTraits>*>(&m_buf); }
- //!Returns the pointer and size of the internal buffer.
+ //!Returns the pointer and size of the internal buffer.
//!Does not throw.
std::pair<CharT *, std::size_t> buffer() const
{ return m_buf.buffer(); }
- //!Sets the underlying buffer to a new value. Resets
+ //!Sets the underlying buffer to a new value. Resets
//!stream position. Does not throw.
void buffer(CharT *buffer, std::size_t length)
{ m_buf.buffer(buffer, length); }
@@ -367,7 +367,7 @@ class basic_obufferstream
//!A basic_iostream class that uses a fixed size character buffer
//!as its formatting buffer.
template <class CharT, class CharTraits>
-class basic_bufferstream
+class basic_bufferstream
: public std::basic_iostream<CharT, CharTraits>
{
@@ -388,7 +388,7 @@ class basic_bufferstream
public:
//!Constructor.
//!Does not throw.
- basic_bufferstream(std::ios_base::openmode mode
+ basic_bufferstream(std::ios_base::openmode mode
= std::ios_base::in | std::ios_base::out)
: basic_ios_t(), base_t(0), m_buf(mode)
{ basic_ios_t::init(&m_buf); }
@@ -409,12 +409,12 @@ class basic_bufferstream
basic_bufferbuf<CharT, CharTraits>* rdbuf() const
{ return const_cast<basic_bufferbuf<CharT, CharTraits>*>(&m_buf); }
- //!Returns the pointer and size of the internal buffer.
+ //!Returns the pointer and size of the internal buffer.
//!Does not throw.
std::pair<CharT *, std::size_t> buffer() const
{ return m_buf.buffer(); }
- //!Sets the underlying buffer to a new value. Resets
+ //!Sets the underlying buffer to a new value. Resets
//!stream position. Does not throw.
void buffer(CharT *buffer, std::size_t length)
{ m_buf.buffer(buffer, length); }
diff --git a/boost/interprocess/streams/vectorstream.hpp b/boost/interprocess/streams/vectorstream.hpp
index 83041f2b2e..3cee7200ab 100644
--- a/boost/interprocess/streams/vectorstream.hpp
+++ b/boost/interprocess/streams/vectorstream.hpp
@@ -30,7 +30,7 @@
//!This file defines basic_vectorbuf, basic_ivectorstream,
//!basic_ovectorstream, and basic_vectorstreamclasses. These classes
//!represent streamsbufs and streams whose sources or destinations are
-//!STL-like vectors that can be swapped with external vectors to avoid
+//!STL-like vectors that can be swapped with external vectors to avoid
//!unnecessary allocations/copies.
#ifndef BOOST_INTERPROCESS_VECTORSTREAM_HPP
@@ -43,7 +43,7 @@
#include <ios>
#include <istream>
#include <ostream>
-#include <string> // char traits
+#include <string> // char traits
#include <cstddef> // ptrdiff_t
#include <boost/interprocess/interprocess_fwd.hpp>
#include <boost/assert.hpp>
@@ -51,9 +51,9 @@
namespace boost { namespace interprocess {
//!A streambuf class that controls the transmission of elements to and from
-//!a basic_ivectorstream, basic_ovectorstream or basic_vectorstream.
+//!a basic_ivectorstream, basic_ovectorstream or basic_vectorstream.
//!It holds a character vector specified by CharVector template parameter
-//!as its formatting buffer. The vector must have contiguous storage, like
+//!as its formatting buffer. The vector must have contiguous storage, like
//!std::vector, boost::interprocess::vector or boost::interprocess::basic_string
template <class CharVector, class CharTraits>
class basic_vectorbuf
@@ -96,11 +96,11 @@ class basic_vectorbuf
public:
- //!Swaps the underlying vector with the passed vector.
+ //!Swaps the underlying vector with the passed vector.
//!This function resets the read/write position in the stream.
//!Does not throw.
void swap_vector(vector_type &vect)
- {
+ {
if (this->m_mode & std::ios_base::out){
//Update high water if necessary
//And resize vector to remove extra size
@@ -118,8 +118,8 @@ class basic_vectorbuf
//!Returns a const reference to the internal vector.
//!Does not throw.
- const vector_type &vector() const
- {
+ const vector_type &vector() const
+ {
if (this->m_mode & std::ios_base::out){
if (mp_high_water < base_t::pptr()){
//Restore the vector's size if necessary
@@ -137,13 +137,13 @@ class basic_vectorbuf
const_cast<basic_vectorbuf*>(this)->base_t::pbump(old_pos);
}
}
- return m_vect;
+ return m_vect;
}
//!Preallocates memory from the internal vector.
//!Resets the stream to the first position.
//!Throws if the internals vector's memory allocation throws.
- void reserve(typename vector_type::size_type size)
+ void reserve(typename vector_type::size_type size)
{
if (this->m_mode & std::ios_base::out && size > m_vect.size()){
typename vector_type::difference_type write_pos = base_t::pptr() - base_t::pbase();
@@ -282,7 +282,7 @@ class basic_vectorbuf
}
virtual pos_type seekoff(off_type off, std::ios_base::seekdir dir,
- std::ios_base::openmode mode
+ std::ios_base::openmode mode
= std::ios_base::in | std::ios_base::out)
{
//Get seek mode
@@ -325,7 +325,7 @@ class basic_vectorbuf
newoff = limit;
break;
case std::ios_base::cur:
- newoff = in ? static_cast<std::streamoff>(this->gptr() - this->eback())
+ newoff = in ? static_cast<std::streamoff>(this->gptr() - this->eback())
: static_cast<std::streamoff>(this->pptr() - this->pbase());
break;
default:
@@ -350,7 +350,7 @@ class basic_vectorbuf
return pos_type(newoff);
}
- virtual pos_type seekpos(pos_type pos, std::ios_base::openmode mode
+ virtual pos_type seekpos(pos_type pos, std::ios_base::openmode mode
= std::ios_base::in | std::ios_base::out)
{ return seekoff(pos - pos_type(off_type(0)), std::ios_base::beg, mode); }
@@ -413,7 +413,7 @@ class basic_ivectorstream
basic_vectorbuf<CharVector, CharTraits>* rdbuf() const
{ return const_cast<basic_vectorbuf<CharVector, CharTraits>*>(&m_buf()); }
- //!Swaps the underlying vector with the passed vector.
+ //!Swaps the underlying vector with the passed vector.
//!This function resets the read position in the stream.
//!Does not throw.
void swap_vector(vector_type &vect)
@@ -421,18 +421,18 @@ class basic_ivectorstream
//!Returns a const reference to the internal vector.
//!Does not throw.
- const vector_type &vector() const
+ const vector_type &vector() const
{ return m_buf().vector(); }
//!Calls reserve() method of the internal vector.
//!Resets the stream to the first position.
//!Throws if the internals vector's reserve throws.
- void reserve(typename vector_type::size_type size)
+ void reserve(typename vector_type::size_type size)
{ m_buf().reserve(size); }
//!Calls clear() method of the internal vector.
//!Resets the stream to the first position.
- void clear()
+ void clear()
{ m_buf().clear(); }
};
@@ -488,7 +488,7 @@ class basic_ovectorstream
basic_vectorbuf<CharVector, CharTraits>* rdbuf() const
{ return const_cast<basic_vectorbuf<CharVector, CharTraits>*>(&m_buf()); }
- //!Swaps the underlying vector with the passed vector.
+ //!Swaps the underlying vector with the passed vector.
//!This function resets the write position in the stream.
//!Does not throw.
void swap_vector(vector_type &vect)
@@ -496,13 +496,13 @@ class basic_ovectorstream
//!Returns a const reference to the internal vector.
//!Does not throw.
- const vector_type &vector() const
+ const vector_type &vector() const
{ return m_buf().vector(); }
//!Calls reserve() method of the internal vector.
//!Resets the stream to the first position.
//!Throws if the internals vector's reserve throws.
- void reserve(typename vector_type::size_type size)
+ void reserve(typename vector_type::size_type size)
{ m_buf().reserve(size); }
};
@@ -534,7 +534,7 @@ class basic_vectorstream
public:
//!Constructor. Throws if vector_type default
//!constructor throws.
- basic_vectorstream(std::ios_base::openmode mode
+ basic_vectorstream(std::ios_base::openmode mode
= std::ios_base::in | std::ios_base::out)
: basic_ios_t(), base_t(0), m_buf(mode)
{ basic_ios_t::init(&m_buf); }
@@ -554,7 +554,7 @@ class basic_vectorstream
basic_vectorbuf<CharVector, CharTraits>* rdbuf() const
{ return const_cast<basic_vectorbuf<CharVector, CharTraits>*>(&m_buf); }
- //!Swaps the underlying vector with the passed vector.
+ //!Swaps the underlying vector with the passed vector.
//!This function resets the read/write position in the stream.
//!Does not throw.
void swap_vector(vector_type &vect)
@@ -562,18 +562,18 @@ class basic_vectorstream
//!Returns a const reference to the internal vector.
//!Does not throw.
- const vector_type &vector() const
+ const vector_type &vector() const
{ return m_buf.vector(); }
//!Calls reserve() method of the internal vector.
//!Resets the stream to the first position.
//!Throws if the internals vector's reserve throws.
- void reserve(typename vector_type::size_type size)
+ void reserve(typename vector_type::size_type size)
{ m_buf.reserve(size); }
//!Calls clear() method of the internal vector.
//!Resets the stream to the first position.
- void clear()
+ void clear()
{ m_buf.clear(); }
/// @cond
diff --git a/boost/interprocess/sync/detail/condition_algorithm_8a.hpp b/boost/interprocess/sync/detail/condition_algorithm_8a.hpp
new file mode 100644
index 0000000000..eaad671cdf
--- /dev/null
+++ b/boost/interprocess/sync/detail/condition_algorithm_8a.hpp
@@ -0,0 +1,316 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2005-2011. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/interprocess for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTERPROCESS_DETAIL_CONDITION_ALGORITHM_8A_HPP
+#define BOOST_INTERPROCESS_DETAIL_CONDITION_ALGORITHM_8A_HPP
+
+#include <boost/interprocess/detail/config_begin.hpp>
+#include <boost/interprocess/detail/workaround.hpp>
+#include <boost/interprocess/sync/scoped_lock.hpp>
+#include <limits>
+
+namespace boost {
+namespace interprocess {
+namespace ipcdetail {
+
+////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////
+//
+// Condition variable algorithm taken from pthreads-win32 discussion.
+//
+// The algorithm was developed by Alexander Terekhov in colaboration with
+// Louis Thomas.
+//
+// Algorithm 8a / IMPL_SEM,UNBLOCK_STRATEGY == UNBLOCK_ALL
+//
+// semBlockLock - bin.semaphore
+// semBlockQueue - semaphore
+// mtxExternal - mutex or CS
+// mtxUnblockLock - mutex or CS
+// nWaitersGone - int
+// nWaitersBlocked - int
+// nWaitersToUnblock - int
+//
+// wait( timeout ) {
+//
+// [auto: register int result ] // error checking omitted
+// [auto: register int nSignalsWasLeft ]
+// [auto: register int nWaitersWasGone ]
+//
+// sem_wait( semBlockLock );
+// nWaitersBlocked++;
+// sem_post( semBlockLock );
+//
+// unlock( mtxExternal );
+// bTimedOut = sem_wait( semBlockQueue,timeout );
+//
+// lock( mtxUnblockLock );
+// if ( 0 != (nSignalsWasLeft = nWaitersToUnblock) ) {
+// if ( bTimedOut ) { // timeout (or canceled)
+// if ( 0 != nWaitersBlocked ) {
+// nWaitersBlocked--;
+// }
+// else {
+// nWaitersGone++; // count spurious wakeups.
+// }
+// }
+// if ( 0 == --nWaitersToUnblock ) {
+// if ( 0 != nWaitersBlocked ) {
+// sem_post( semBlockLock ); // open the gate.
+// nSignalsWasLeft = 0; // do not open the gate
+// // below again.
+// }
+// else if ( 0 != (nWaitersWasGone = nWaitersGone) ) {
+// nWaitersGone = 0;
+// }
+// }
+// }
+// else if ( INT_MAX/2 == ++nWaitersGone ) { // timeout/canceled or
+// // spurious semaphore :-)
+// sem_wait( semBlockLock );
+// nWaitersBlocked -= nWaitersGone; // something is going on here
+// // - test of timeouts? :-)
+// sem_post( semBlockLock );
+// nWaitersGone = 0;
+// }
+// unlock( mtxUnblockLock );
+//
+// if ( 1 == nSignalsWasLeft ) {
+// if ( 0 != nWaitersWasGone ) {
+// // sem_adjust( semBlockQueue,-nWaitersWasGone );
+// while ( nWaitersWasGone-- ) {
+// sem_wait( semBlockQueue ); // better now than spurious later
+// }
+// } sem_post( semBlockLock ); // open the gate
+// }
+//
+// lock( mtxExternal );
+//
+// return ( bTimedOut ) ? ETIMEOUT : 0;
+// }
+//
+// signal(bAll) {
+//
+// [auto: register int result ]
+// [auto: register int nSignalsToIssue]
+//
+// lock( mtxUnblockLock );
+//
+// if ( 0 != nWaitersToUnblock ) { // the gate is closed!!!
+// if ( 0 == nWaitersBlocked ) { // NO-OP
+// return unlock( mtxUnblockLock );
+// }
+// if (bAll) {
+// nWaitersToUnblock += nSignalsToIssue=nWaitersBlocked;
+// nWaitersBlocked = 0;
+// }
+// else {
+// nSignalsToIssue = 1;
+// nWaitersToUnblock++;
+// nWaitersBlocked--;
+// }
+// }
+// else if ( nWaitersBlocked > nWaitersGone ) { // HARMLESS RACE CONDITION!
+// sem_wait( semBlockLock ); // close the gate
+// if ( 0 != nWaitersGone ) {
+// nWaitersBlocked -= nWaitersGone;
+// nWaitersGone = 0;
+// }
+// if (bAll) {
+// nSignalsToIssue = nWaitersToUnblock = nWaitersBlocked;
+// nWaitersBlocked = 0;
+// }
+// else {
+// nSignalsToIssue = nWaitersToUnblock = 1;
+// nWaitersBlocked--;
+// }
+// }
+// else { // NO-OP
+// return unlock( mtxUnblockLock );
+// }
+//
+// unlock( mtxUnblockLock );
+// sem_post( semBlockQueue,nSignalsToIssue );
+// return result;
+// }
+////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////
+
+
+// Required interface for ConditionMembers
+// class ConditionMembers
+// {
+// typedef implementation_defined semaphore_type;
+// typedef implementation_defined mutex_type;
+// typedef implementation_defined integer_type;
+//
+// integer_type &get_nwaiters_blocked()
+// integer_type &get_nwaiters_gone()
+// integer_type &get_nwaiters_to_unblock()
+// semaphore_type &get_sem_block_queue()
+// semaphore_type &get_sem_block_lock()
+// mutex_type &get_mtx_unblock_lock()
+// };
+//
+template<class ConditionMembers>
+class condition_algorithm_8a
+{
+ private:
+ condition_algorithm_8a();
+ ~condition_algorithm_8a();
+ condition_algorithm_8a(const condition_algorithm_8a &);
+ condition_algorithm_8a &operator=(const condition_algorithm_8a &);
+
+ typedef typename ConditionMembers::semaphore_type semaphore_type;
+ typedef typename ConditionMembers::mutex_type mutex_type;
+ typedef typename ConditionMembers::integer_type integer_type;
+
+ // nwaiters_blocked == 0
+ // nwaiters_gone() == 0
+ // nwaiters_to_unblock == 0
+ // sem_block_queue() == initial count 0
+ // sem_block_lock() == initial count 1
+ // mtx_unblock_lock (unlocked)
+
+ public:
+ template<class InterprocessMutex>
+ static bool wait (ConditionMembers &data, bool timeout_enabled, const boost::posix_time::ptime &abs_time, InterprocessMutex &mut);
+ static void signal(ConditionMembers &data, bool broadcast);
+};
+
+template<class ConditionMembers>
+inline void condition_algorithm_8a<ConditionMembers>::signal(ConditionMembers &data, bool broadcast)
+{
+ integer_type nsignals_to_issue;
+
+ {
+ scoped_lock<mutex_type> locker(data.get_mtx_unblock_lock());
+
+ if ( 0 != data.get_nwaiters_to_unblock() ) { // the gate is closed!!!
+ if ( 0 == data.get_nwaiters_blocked() ) { // NO-OP
+ //locker's destructor triggers data.get_mtx_unblock_lock().unlock()
+ return;
+ }
+ if (broadcast) {
+ data.get_nwaiters_to_unblock() += nsignals_to_issue = data.get_nwaiters_blocked();
+ data.get_nwaiters_blocked() = 0;
+ }
+ else {
+ nsignals_to_issue = 1;
+ data.get_nwaiters_to_unblock()++;
+ data.get_nwaiters_blocked()--;
+ }
+ }
+ else if ( data.get_nwaiters_blocked() > data.get_nwaiters_gone() ) { // HARMLESS RACE CONDITION!
+ data.get_sem_block_lock().wait(); // close the gate
+ if ( 0 != data.get_nwaiters_gone() ) {
+ data.get_nwaiters_blocked() -= data.get_nwaiters_gone();
+ data.get_nwaiters_gone() = 0;
+ }
+ if (broadcast) {
+ nsignals_to_issue = data.get_nwaiters_to_unblock() = data.get_nwaiters_blocked();
+ data.get_nwaiters_blocked() = 0;
+ }
+ else {
+ nsignals_to_issue = data.get_nwaiters_to_unblock() = 1;
+ data.get_nwaiters_blocked()--;
+ }
+ }
+ else { // NO-OP
+ //locker's destructor triggers data.get_mtx_unblock_lock().unlock()
+ return;
+ }
+ //locker's destructor triggers data.get_mtx_unblock_lock().unlock()
+ }
+ data.get_sem_block_queue().post(nsignals_to_issue);
+}
+
+template<class ConditionMembers>
+template<class InterprocessMutex>
+inline bool condition_algorithm_8a<ConditionMembers>::wait
+ (ConditionMembers &data, bool tout_enabled, const boost::posix_time::ptime &abs_time, InterprocessMutex &mtxExternal)
+{
+ //Initialize to avoid warnings
+ integer_type nsignals_was_left = 0;
+ integer_type nwaiters_was_gone = 0;
+
+ data.get_sem_block_lock().wait();
+ ++data.get_nwaiters_blocked();
+ data.get_sem_block_lock().post();
+
+ struct scoped_unlock
+ {
+ InterprocessMutex & mut;
+ scoped_unlock(InterprocessMutex & m)
+ : mut(m)
+ { m.unlock(); }
+
+ ~scoped_unlock()
+ { mut.lock(); }
+ } unlocker(mtxExternal);
+
+
+ bool bTimedOut = tout_enabled ? !data.get_sem_block_queue().timed_wait(abs_time) : (data.get_sem_block_queue().wait(), false);
+
+ {
+ scoped_lock<mutex_type> locker(data.get_mtx_unblock_lock());
+ if ( 0 != (nsignals_was_left = data.get_nwaiters_to_unblock()) ) {
+ if ( bTimedOut ) { // timeout (or canceled)
+ if ( 0 != data.get_nwaiters_blocked() ) {
+ data.get_nwaiters_blocked()--;
+ }
+ else {
+ data.get_nwaiters_gone()++; // count spurious wakeups.
+ }
+ }
+ if ( 0 == --data.get_nwaiters_to_unblock() ) {
+ if ( 0 != data.get_nwaiters_blocked() ) {
+ data.get_sem_block_lock().post(); // open the gate.
+ nsignals_was_left = 0; // do not open the gate below again.
+ }
+ else if ( 0 != (nwaiters_was_gone = data.get_nwaiters_gone()) ) {
+ data.get_nwaiters_gone() = 0;
+ }
+ }
+ }
+ else if ( (std::numeric_limits<integer_type>::max)()/2
+ == ++data.get_nwaiters_gone() ) { // timeout/canceled or spurious semaphore :-)
+ data.get_sem_block_lock().wait();
+ data.get_nwaiters_blocked() -= data.get_nwaiters_gone(); // something is going on here - test of timeouts? :-)
+ data.get_sem_block_lock().post();
+ data.get_nwaiters_gone() = 0;
+ }
+ //locker's destructor triggers data.get_mtx_unblock_lock().unlock()
+ }
+
+ if ( 1 == nsignals_was_left ) {
+ if ( 0 != nwaiters_was_gone ) {
+ // sem_adjust( data.get_sem_block_queue(),-nwaiters_was_gone );
+ while ( nwaiters_was_gone-- ) {
+ data.get_sem_block_queue().wait(); // better now than spurious later
+ }
+ }
+ data.get_sem_block_lock().post(); // open the gate
+ }
+
+ //mtxExternal.lock(); called from unlocker
+
+ return ( bTimedOut ) ? false : true;
+}
+
+} //namespace ipcdetail
+} //namespace interprocess
+} //namespace boost
+
+#include <boost/interprocess/detail/config_end.hpp>
+
+#endif //BOOST_INTERPROCESS_DETAIL_CONDITION_ALGORITHM_8A_HPP
diff --git a/boost/interprocess/sync/file_lock.hpp b/boost/interprocess/sync/file_lock.hpp
index a60b814a4f..e0f75465fb 100644
--- a/boost/interprocess/sync/file_lock.hpp
+++ b/boost/interprocess/sync/file_lock.hpp
@@ -53,21 +53,21 @@ class file_lock
//!exist or there are no operating system resources.
file_lock(const char *name);
- //!Moves the ownership of "moved"'s file mapping object to *this.
- //!After the call, "moved" does not represent any file mapping object.
+ //!Moves the ownership of "moved"'s file mapping object to *this.
+ //!After the call, "moved" does not represent any file mapping object.
//!Does not throw
file_lock(BOOST_RV_REF(file_lock) moved)
: m_file_hnd(file_handle_t(ipcdetail::invalid_file()))
{ this->swap(moved); }
//!Moves the ownership of "moved"'s file mapping to *this.
- //!After the call, "moved" does not represent any file mapping.
+ //!After the call, "moved" does not represent any file mapping.
//!Does not throw
file_lock &operator=(BOOST_RV_REF(file_lock) moved)
- {
+ {
file_lock tmp(boost::move(moved));
this->swap(tmp);
- return *this;
+ return *this;
}
//!Closes a file lock. Does not throw.
@@ -81,7 +81,7 @@ class file_lock
m_file_hnd = other.m_file_hnd;
other.m_file_hnd = tmp;
}
-
+
//Exclusive locking
//!Effects: The calling thread tries to obtain exclusive ownership of the mutex,
@@ -101,12 +101,12 @@ class file_lock
//!Effects: The calling thread tries to acquire exclusive ownership of the mutex
//! waiting if necessary until no other thread has exclusive, or sharable
//! ownership of the mutex or abs_time is reached.
- //!Returns: If acquires exclusive ownership, returns true. Otherwise returns false.
+ //!Returns: If acquires exclusive ownership, returns true. Otherwise returns false.
//!Throws: interprocess_exception on error.
bool timed_lock(const boost::posix_time::ptime &abs_time);
- //!Precondition: The thread must have exclusive ownership of the mutex.
- //!Effects: The calling thread releases the exclusive ownership of the mutex.
+ //!Precondition: The thread must have exclusive ownership of the mutex.
+ //!Effects: The calling thread releases the exclusive ownership of the mutex.
//!Throws: An exception derived from interprocess_exception on error.
void unlock();
@@ -120,21 +120,21 @@ class file_lock
//!Effects: The calling thread tries to acquire sharable ownership of the mutex
//! without waiting. If no other thread has exclusive ownership of the
- //! mutex this succeeds.
+ //! mutex this succeeds.
//!Returns: If it can acquire sharable ownership immediately returns true. If it
- //! has to wait, returns false.
+ //! has to wait, returns false.
//!Throws: interprocess_exception on error.
bool try_lock_sharable();
//!Effects: The calling thread tries to acquire sharable ownership of the mutex
//! waiting if necessary until no other thread has exclusive ownership of
- //! the mutex or abs_time is reached.
- //!Returns: If acquires sharable ownership, returns true. Otherwise returns false.
+ //! the mutex or abs_time is reached.
+ //!Returns: If acquires sharable ownership, returns true. Otherwise returns false.
//!Throws: interprocess_exception on error.
bool timed_lock_sharable(const boost::posix_time::ptime &abs_time);
- //!Precondition: The thread must have sharable ownership of the mutex.
- //!Effects: The calling thread releases the sharable ownership of the mutex.
+ //!Precondition: The thread must have sharable ownership of the mutex.
+ //!Effects: The calling thread releases the sharable ownership of the mutex.
//!Throws: An exception derived from interprocess_exception on error.
void unlock_sharable();
/// @cond
@@ -171,7 +171,7 @@ class file_lock
bool timed_acquire_file_lock_sharable
(file_handle_t hnd, bool &acquired, const boost::posix_time::ptime &abs_time)
- {
+ {
//Obtain current count and target time
boost::posix_time::ptime now = microsec_clock::universal_time();
using namespace boost::detail;
diff --git a/boost/interprocess/sync/interprocess_condition.hpp b/boost/interprocess/sync/interprocess_condition.hpp
index b0e74fc342..9d0bea640e 100644
--- a/boost/interprocess/sync/interprocess_condition.hpp
+++ b/boost/interprocess/sync/interprocess_condition.hpp
@@ -30,9 +30,9 @@
#include <boost/interprocess/sync/posix/condition.hpp>
#define BOOST_INTERPROCESS_USE_POSIX
//Experimental...
-//#elif !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && defined (BOOST_INTERPROCESS_WINDOWS)
-// #include <boost/interprocess/sync/windows/condition.hpp>
-// #define BOOST_INTERPROCESS_USE_WINDOWS
+#elif !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && defined (BOOST_INTERPROCESS_WINDOWS)
+ #include <boost/interprocess/sync/windows/condition.hpp>
+ #define BOOST_INTERPROCESS_USE_WINDOWS
#elif !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
#include <boost/interprocess/sync/spin/condition.hpp>
#define BOOST_INTERPROCESS_USE_GENERIC_EMULATION
@@ -70,7 +70,7 @@ class interprocess_condition
//!liberating system resources.
~interprocess_condition(){}
- //!If there is a thread waiting on *this, change that
+ //!If there is a thread waiting on *this, change that
//!thread's state to ready. Otherwise there is no effect.
void notify_one()
{ m_condition.notify_one(); }
@@ -80,8 +80,8 @@ class interprocess_condition
void notify_all()
{ m_condition.notify_all(); }
- //!Releases the lock on the interprocess_mutex object associated with lock, blocks
- //!the current thread of execution until readied by a call to
+ //!Releases the lock on the interprocess_mutex object associated with lock, blocks
+ //!the current thread of execution until readied by a call to
//!this->notify_one() or this->notify_all(), and then reacquires the lock.
template <typename L>
void wait(L& lock)
@@ -103,9 +103,9 @@ class interprocess_condition
this->do_wait(*lock.mutex());
}
- //!Releases the lock on the interprocess_mutex object associated with lock, blocks
- //!the current thread of execution until readied by a call to
- //!this->notify_one() or this->notify_all(), or until time abs_time is reached,
+ //!Releases the lock on the interprocess_mutex object associated with lock, blocks
+ //!the current thread of execution until readied by a call to
+ //!this->notify_one() or this->notify_all(), or until time abs_time is reached,
//!and then reacquires the lock.
//!Returns: false if time abs_time is reached, otherwise true.
template <typename L>
@@ -120,8 +120,8 @@ class interprocess_condition
return this->do_timed_wait(abs_time, *lock.mutex());
}
- //!The same as: while (!pred()) {
- //! if (!timed_wait(lock, abs_time)) return pred();
+ //!The same as: while (!pred()) {
+ //! if (!timed_wait(lock, abs_time)) return pred();
//! } return true;
template <typename L, typename Pr>
bool timed_wait(L& lock, const boost::posix_time::ptime &abs_time, Pr pred)
diff --git a/boost/interprocess/sync/interprocess_mutex.hpp b/boost/interprocess/sync/interprocess_mutex.hpp
index 478cf78cc3..8110c8472b 100644
--- a/boost/interprocess/sync/interprocess_mutex.hpp
+++ b/boost/interprocess/sync/interprocess_mutex.hpp
@@ -31,9 +31,9 @@
#include <boost/interprocess/sync/posix/mutex.hpp>
#define BOOST_INTERPROCESS_USE_POSIX
//Experimental...
-//#elif !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && defined (BOOST_INTERPROCESS_WINDOWS)
-// #include <boost/interprocess/sync/windows/mutex.hpp>
-// #define BOOST_INTERPROCESS_USE_WINDOWS
+#elif !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && defined (BOOST_INTERPROCESS_WINDOWS)
+ #include <boost/interprocess/sync/windows/mutex.hpp>
+ #define BOOST_INTERPROCESS_USE_WINDOWS
#elif !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
#include <boost/interprocess/sync/spin/mutex.hpp>
#define BOOST_INTERPROCESS_USE_GENERIC_EMULATION
@@ -61,7 +61,7 @@ namespace interprocess {
class interprocess_condition;
-//!Wraps a interprocess_mutex that can be placed in shared memory and can be
+//!Wraps a interprocess_mutex that can be placed in shared memory and can be
//!shared between processes. Allows timed lock tries
class interprocess_mutex
{
@@ -98,9 +98,9 @@ class interprocess_mutex
//!Effects: The calling thread will try to obtain exclusive ownership of the
//! mutex if it can do so in until the specified time is reached. If the
//! mutex supports recursive locking, the mutex must be unlocked the same
- //! number of times it is locked.
+ //! number of times it is locked.
//!Returns: If the thread acquires ownership of the mutex, returns true, if
- //! the timeout expires returns false.
+ //! the timeout expires returns false.
//!Throws: interprocess_exception on error.
bool timed_lock(const boost::posix_time::ptime &abs_time);
diff --git a/boost/interprocess/sync/interprocess_recursive_mutex.hpp b/boost/interprocess/sync/interprocess_recursive_mutex.hpp
index 308819ff27..3079108645 100644
--- a/boost/interprocess/sync/interprocess_recursive_mutex.hpp
+++ b/boost/interprocess/sync/interprocess_recursive_mutex.hpp
@@ -43,9 +43,9 @@
#include <boost/interprocess/sync/posix/recursive_mutex.hpp>
#define BOOST_INTERPROCESS_USE_POSIX
//Experimental...
-//#elif !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && defined (BOOST_INTERPROCESS_WINDOWS)
-// #include <boost/interprocess/sync/windows/recursive_mutex.hpp>
-// #define BOOST_INTERPROCESS_USE_WINDOWS
+#elif !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && defined (BOOST_INTERPROCESS_WINDOWS)
+ #include <boost/interprocess/sync/windows/recursive_mutex.hpp>
+ #define BOOST_INTERPROCESS_USE_WINDOWS
#elif !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
#include <boost/interprocess/sync/spin/recursive_mutex.hpp>
#define BOOST_INTERPROCESS_USE_GENERIC_EMULATION
@@ -72,8 +72,8 @@ class mutex_traits;
namespace boost {
namespace interprocess {
-//!Wraps a interprocess_mutex that can be placed in shared memory and can be
-//!shared between processes. Allows several locking calls by the same
+//!Wraps a interprocess_mutex that can be placed in shared memory and can be
+//!shared between processes. Allows several locking calls by the same
//!process. Allows timed lock tries
class interprocess_recursive_mutex
{
@@ -99,7 +99,7 @@ class interprocess_recursive_mutex
//!Throws: interprocess_exception on error.
void lock();
- //!Tries to lock the interprocess_mutex, returns false when interprocess_mutex
+ //!Tries to lock the interprocess_mutex, returns false when interprocess_mutex
//!is already locked, returns true when success. The mutex must be unlocked
//!the same number of times it is locked.
//!Throws: interprocess_exception if a severe error is found
diff --git a/boost/interprocess/sync/interprocess_semaphore.hpp b/boost/interprocess/sync/interprocess_semaphore.hpp
index 4ffcdcf691..2a2f34fdcf 100644
--- a/boost/interprocess/sync/interprocess_semaphore.hpp
+++ b/boost/interprocess/sync/interprocess_semaphore.hpp
@@ -29,9 +29,9 @@
#include <boost/interprocess/sync/posix/semaphore.hpp>
#define BOOST_INTERPROCESS_USE_POSIX
//Experimental...
-//#elif !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && defined (BOOST_INTERPROCESS_WINDOWS)
-// #include <boost/interprocess/sync/windows/semaphore.hpp>
-// #define BOOST_INTERPROCESS_USE_WINDOWS
+#elif !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && defined (BOOST_INTERPROCESS_WINDOWS)
+ #include <boost/interprocess/sync/windows/semaphore.hpp>
+ #define BOOST_INTERPROCESS_USE_WINDOWS
#elif !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
#include <boost/interprocess/sync/spin/semaphore.hpp>
#define BOOST_INTERPROCESS_USE_GENERIC_EMULATION
@@ -45,7 +45,7 @@
namespace boost {
namespace interprocess {
-//!Wraps a interprocess_semaphore that can be placed in shared memory and can be
+//!Wraps a interprocess_semaphore that can be placed in shared memory and can be
//!shared between processes. Allows timed lock tries
class interprocess_semaphore
{
@@ -55,7 +55,7 @@ class interprocess_semaphore
interprocess_semaphore &operator=(const interprocess_semaphore &);
/// @endcond
public:
- //!Creates a interprocess_semaphore with the given initial count.
+ //!Creates a interprocess_semaphore with the given initial count.
//!interprocess_exception if there is an error.*/
interprocess_semaphore(unsigned int initialCount);
@@ -69,7 +69,7 @@ class interprocess_semaphore
void post();
//!Decrements the interprocess_semaphore. If the interprocess_semaphore value is not greater than zero,
- //!then the calling process/thread blocks until it can decrement the counter.
+ //!then the calling process/thread blocks until it can decrement the counter.
//!If there is an error an interprocess_exception exception is thrown.
void wait();
@@ -95,7 +95,7 @@ class interprocess_semaphore
#elif defined(BOOST_INTERPROCESS_USE_WINDOWS)
#undef BOOST_INTERPROCESS_USE_WINDOWS
ipcdetail::windows_semaphore m_sem;
- #else
+ #else
#undef BOOST_INTERPROCESS_USE_POSIX
ipcdetail::posix_semaphore m_sem;
#endif //#if defined(BOOST_INTERPROCESS_USE_GENERIC_EMULATION)
diff --git a/boost/interprocess/sync/interprocess_upgradable_mutex.hpp b/boost/interprocess/sync/interprocess_upgradable_mutex.hpp
index 048407f4b3..8d5a452626 100644
--- a/boost/interprocess/sync/interprocess_upgradable_mutex.hpp
+++ b/boost/interprocess/sync/interprocess_upgradable_mutex.hpp
@@ -30,7 +30,7 @@
namespace boost {
namespace interprocess {
-//!Wraps a interprocess_upgradable_mutex that can be placed in shared memory and can be
+//!Wraps a interprocess_upgradable_mutex that can be placed in shared memory and can be
//!shared between processes. Allows timed lock tries
class interprocess_upgradable_mutex
{
@@ -67,13 +67,13 @@ class interprocess_upgradable_mutex
//!Effects: The calling thread tries to acquire exclusive ownership of the mutex
//! waiting if necessary until no other thread has exclusive, sharable or
- //! upgradable ownership of the mutex or abs_time is reached.
- //!Returns: If acquires exclusive ownership, returns true. Otherwise returns false.
+ //! upgradable ownership of the mutex or abs_time is reached.
+ //!Returns: If acquires exclusive ownership, returns true. Otherwise returns false.
//!Throws: interprocess_exception on error.
bool timed_lock(const boost::posix_time::ptime &abs_time);
- //!Precondition: The thread must have exclusive ownership of the mutex.
- //!Effects: The calling thread releases the exclusive ownership of the mutex.
+ //!Precondition: The thread must have exclusive ownership of the mutex.
+ //!Effects: The calling thread releases the exclusive ownership of the mutex.
//!Throws: An exception derived from interprocess_exception on error.
void unlock();
@@ -87,21 +87,21 @@ class interprocess_upgradable_mutex
//!Effects: The calling thread tries to acquire sharable ownership of the mutex
//! without waiting. If no other thread has exclusive ownership
- //! of the mutex this succeeds.
+ //! of the mutex this succeeds.
//!Returns: If it can acquire sharable ownership immediately returns true. If it
- //! has to wait, returns false.
+ //! has to wait, returns false.
//!Throws: interprocess_exception on error.
bool try_lock_sharable();
//!Effects: The calling thread tries to acquire sharable ownership of the mutex
//! waiting if necessary until no other thread has exclusive
- //! ownership of the mutex or abs_time is reached.
- //!Returns: If acquires sharable ownership, returns true. Otherwise returns false.
+ //! ownership of the mutex or abs_time is reached.
+ //!Returns: If acquires sharable ownership, returns true. Otherwise returns false.
//!Throws: interprocess_exception on error.
bool timed_lock_sharable(const boost::posix_time::ptime &abs_time);
- //!Precondition: The thread must have sharable ownership of the mutex.
- //!Effects: The calling thread releases the sharable ownership of the mutex.
+ //!Precondition: The thread must have sharable ownership of the mutex.
+ //!Effects: The calling thread releases the sharable ownership of the mutex.
//!Throws: An exception derived from interprocess_exception on error.
void unlock_sharable();
@@ -115,7 +115,7 @@ class interprocess_upgradable_mutex
//!Effects: The calling thread tries to acquire upgradable ownership of the mutex
//! without waiting. If no other thread has exclusive or upgradable ownership
- //! of the mutex this succeeds.
+ //! of the mutex this succeeds.
//!Returns: If it can acquire upgradable ownership immediately returns true.
//! If it has to wait, returns false.
//!Throws: interprocess_exception on error.
@@ -124,74 +124,74 @@ class interprocess_upgradable_mutex
//!Effects: The calling thread tries to acquire upgradable ownership of the mutex
//! waiting if necessary until no other thread has exclusive or upgradable
//! ownership of the mutex or abs_time is reached.
- //!Returns: If acquires upgradable ownership, returns true. Otherwise returns false.
+ //!Returns: If acquires upgradable ownership, returns true. Otherwise returns false.
//!Throws: interprocess_exception on error.
bool timed_lock_upgradable(const boost::posix_time::ptime &abs_time);
- //!Precondition: The thread must have upgradable ownership of the mutex.
- //!Effects: The calling thread releases the upgradable ownership of the mutex.
+ //!Precondition: The thread must have upgradable ownership of the mutex.
+ //!Effects: The calling thread releases the upgradable ownership of the mutex.
//!Throws: An exception derived from interprocess_exception on error.
void unlock_upgradable();
//Demotions
- //!Precondition: The thread must have exclusive ownership of the mutex.
+ //!Precondition: The thread must have exclusive ownership of the mutex.
//!Effects: The thread atomically releases exclusive ownership and acquires
- //! upgradable ownership. This operation is non-blocking.
+ //! upgradable ownership. This operation is non-blocking.
//!Throws: An exception derived from interprocess_exception on error.
void unlock_and_lock_upgradable();
- //!Precondition: The thread must have exclusive ownership of the mutex.
+ //!Precondition: The thread must have exclusive ownership of the mutex.
//!Effects: The thread atomically releases exclusive ownership and acquires
- //! sharable ownership. This operation is non-blocking.
+ //! sharable ownership. This operation is non-blocking.
//!Throws: An exception derived from interprocess_exception on error.
void unlock_and_lock_sharable();
- //!Precondition: The thread must have upgradable ownership of the mutex.
+ //!Precondition: The thread must have upgradable ownership of the mutex.
//!Effects: The thread atomically releases upgradable ownership and acquires
- //! sharable ownership. This operation is non-blocking.
+ //! sharable ownership. This operation is non-blocking.
//!Throws: An exception derived from interprocess_exception on error.
void unlock_upgradable_and_lock_sharable();
//Promotions
- //!Precondition: The thread must have upgradable ownership of the mutex.
+ //!Precondition: The thread must have upgradable ownership of the mutex.
//!Effects: The thread atomically releases upgradable ownership and acquires
//! exclusive ownership. This operation will block until all threads with
- //! sharable ownership release their sharable lock.
+ //! sharable ownership release their sharable lock.
//!Throws: An exception derived from interprocess_exception on error.
void unlock_upgradable_and_lock();
- //!Precondition: The thread must have upgradable ownership of the mutex.
+ //!Precondition: The thread must have upgradable ownership of the mutex.
//!Effects: The thread atomically releases upgradable ownership and tries to
//! acquire exclusive ownership. This operation will fail if there are threads
- //! with sharable ownership, but it will maintain upgradable ownership.
+ //! with sharable ownership, but it will maintain upgradable ownership.
//!Returns: If acquires exclusive ownership, returns true. Otherwise returns false.
//!Throws: An exception derived from interprocess_exception on error.
bool try_unlock_upgradable_and_lock();
- //!Precondition: The thread must have upgradable ownership of the mutex.
+ //!Precondition: The thread must have upgradable ownership of the mutex.
//!Effects: The thread atomically releases upgradable ownership and tries to acquire
//! exclusive ownership, waiting if necessary until abs_time. This operation will
//! fail if there are threads with sharable ownership or timeout reaches, but it
- //! will maintain upgradable ownership.
- //!Returns: If acquires exclusive ownership, returns true. Otherwise returns false.
+ //! will maintain upgradable ownership.
+ //!Returns: If acquires exclusive ownership, returns true. Otherwise returns false.
//!Throws: An exception derived from interprocess_exception on error. */
bool timed_unlock_upgradable_and_lock(const boost::posix_time::ptime &abs_time);
- //!Precondition: The thread must have sharable ownership of the mutex.
+ //!Precondition: The thread must have sharable ownership of the mutex.
//!Effects: The thread atomically releases sharable ownership and tries to acquire
//! exclusive ownership. This operation will fail if there are threads with sharable
//! or upgradable ownership, but it will maintain sharable ownership.
- //!Returns: If acquires exclusive ownership, returns true. Otherwise returns false.
+ //!Returns: If acquires exclusive ownership, returns true. Otherwise returns false.
//!Throws: An exception derived from interprocess_exception on error.
bool try_unlock_sharable_and_lock();
- //!Precondition: The thread must have sharable ownership of the mutex.
+ //!Precondition: The thread must have sharable ownership of the mutex.
//!Effects: The thread atomically releases sharable ownership and tries to acquire
//! upgradable ownership. This operation will fail if there are threads with sharable
- //! or upgradable ownership, but it will maintain sharable ownership.
- //!Returns: If acquires upgradable ownership, returns true. Otherwise returns false.
+ //! or upgradable ownership, but it will maintain sharable ownership.
+ //!Returns: If acquires upgradable ownership, returns true. Otherwise returns false.
//!Throws: An exception derived from interprocess_exception on error.
bool try_unlock_sharable_and_lock_upgradable();
@@ -249,7 +249,7 @@ class interprocess_upgradable_mutex
if(mp_ctrl){
//Recover upgradable lock
mp_ctrl->upgradable_in = 1;
- ++mp_ctrl->num_upr_shar;
+ ++mp_ctrl->num_upr_shar;
//Execute the second half of exclusive locking
mp_ctrl->exclusive_in = 0;
}
@@ -260,7 +260,7 @@ class interprocess_upgradable_mutex
template<int Dummy>
struct base_constants_t
{
- static const unsigned max_readers
+ static const unsigned max_readers
= ~(unsigned(3) << (sizeof(unsigned)*CHAR_BIT-2));
};
typedef base_constants_t<0> constants;
@@ -309,10 +309,10 @@ inline bool interprocess_upgradable_mutex::try_lock()
{
scoped_lock_t lock(m_mut, try_to_lock);
- //If we can't lock or any has there is any exclusive, upgradable
+ //If we can't lock or any has there is any exclusive, upgradable
//or sharable mark return false;
- if(!lock.owns()
- || this->m_ctrl.exclusive_in
+ if(!lock.owns()
+ || this->m_ctrl.exclusive_in
|| this->m_ctrl.num_upr_shar){
return false;
}
@@ -387,9 +387,9 @@ inline bool interprocess_upgradable_mutex::try_lock_upgradable()
//The upgradable lock must fail
//if an exclusive or upgradable lock has been acquired
//or there are too many sharable locks
- if(!lock.owns()
- || this->m_ctrl.exclusive_in
- || this->m_ctrl.upgradable_in
+ if(!lock.owns()
+ || this->m_ctrl.exclusive_in
+ || this->m_ctrl.upgradable_in
|| this->m_ctrl.num_upr_shar == constants::max_readers){
return false;
}
@@ -414,11 +414,11 @@ inline bool interprocess_upgradable_mutex::timed_lock_upgradable
//The upgradable lock must block in the first gate
//if an exclusive or upgradable lock has been acquired
//or there are too many sharable locks
- while(this->m_ctrl.exclusive_in
+ while(this->m_ctrl.exclusive_in
|| this->m_ctrl.upgradable_in
|| this->m_ctrl.num_upr_shar == constants::max_readers){
if(!this->m_first_gate.timed_wait(lock, abs_time)){
- return!(this->m_ctrl.exclusive_in
+ return!(this->m_ctrl.exclusive_in
|| this->m_ctrl.upgradable_in
|| this->m_ctrl.num_upr_shar == constants::max_readers);
}
@@ -561,7 +561,7 @@ inline void interprocess_upgradable_mutex::unlock_upgradable_and_lock()
//Simulate unlock_upgradable() without
//notifying sharables.
this->m_ctrl.upgradable_in = 0;
- --this->m_ctrl.num_upr_shar;
+ --this->m_ctrl.num_upr_shar;
//Execute the second half of exclusive locking
this->m_ctrl.exclusive_in = 1;
@@ -584,7 +584,7 @@ inline bool interprocess_upgradable_mutex::try_unlock_upgradable_and_lock()
}
//Now unlock upgradable and mark exclusive
this->m_ctrl.upgradable_in = 0;
- --this->m_ctrl.num_upr_shar;
+ --this->m_ctrl.num_upr_shar;
this->m_ctrl.exclusive_in = 1;
return true;
}
@@ -598,7 +598,7 @@ inline bool interprocess_upgradable_mutex::timed_unlock_upgradable_and_lock
//Simulate unlock_upgradable() without
//notifying sharables.
this->m_ctrl.upgradable_in = 0;
- --this->m_ctrl.num_upr_shar;
+ --this->m_ctrl.num_upr_shar;
//Execute the second half of exclusive locking
this->m_ctrl.exclusive_in = 1;
@@ -618,10 +618,10 @@ inline bool interprocess_upgradable_mutex::try_unlock_sharable_and_lock()
{
scoped_lock_t lock(m_mut, try_to_lock);
- //If we can't lock or any has there is any exclusive, upgradable
+ //If we can't lock or any has there is any exclusive, upgradable
//or sharable mark return false;
- if(!lock.owns()
- || this->m_ctrl.exclusive_in
+ if(!lock.owns()
+ || this->m_ctrl.exclusive_in
|| this->m_ctrl.upgradable_in
|| this->m_ctrl.num_upr_shar != 1){
return false;
@@ -638,7 +638,7 @@ inline bool interprocess_upgradable_mutex::try_unlock_sharable_and_lock_upgradab
//The upgradable lock must fail
//if an exclusive or upgradable lock has been acquired
if(!lock.owns()
- || this->m_ctrl.exclusive_in
+ || this->m_ctrl.exclusive_in
|| this->m_ctrl.upgradable_in){
return false;
}
diff --git a/boost/interprocess/sync/mutex_family.hpp b/boost/interprocess/sync/mutex_family.hpp
index a9215e24fe..b153ffea3e 100644
--- a/boost/interprocess/sync/mutex_family.hpp
+++ b/boost/interprocess/sync/mutex_family.hpp
@@ -29,7 +29,7 @@ namespace boost {
namespace interprocess {
-//!Describes interprocess_mutex family to use with Interprocess framework
+//!Describes interprocess_mutex family to use with Interprocess framework
//!based on boost::interprocess synchronization objects.
struct mutex_family
{
@@ -37,7 +37,7 @@ struct mutex_family
typedef boost::interprocess::interprocess_recursive_mutex recursive_mutex_type;
};
-//!Describes interprocess_mutex family to use with Interprocess frameworks
+//!Describes interprocess_mutex family to use with Interprocess frameworks
//!based on null operation synchronization objects.
struct null_mutex_family
{
diff --git a/boost/interprocess/sync/named_condition.hpp b/boost/interprocess/sync/named_condition.hpp
index c5529eda6c..ca0205ad73 100644
--- a/boost/interprocess/sync/named_condition.hpp
+++ b/boost/interprocess/sync/named_condition.hpp
@@ -22,7 +22,12 @@
#include <boost/interprocess/detail/interprocess_tester.hpp>
#include <boost/interprocess/permissions.hpp>
#include <boost/interprocess/detail/posix_time_types_wrk.hpp>
-#include <boost/interprocess/sync/shm/named_condition.hpp>
+#if !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && defined (BOOST_INTERPROCESS_WINDOWS)
+ #include <boost/interprocess/sync/windows/named_condition.hpp>
+ #define BOOST_INTERPROCESS_USE_WINDOWS
+#else
+ #include <boost/interprocess/sync/shm/named_condition.hpp>
+#endif
//!\file
//!Describes a named condition class for inter-process synchronization
@@ -50,7 +55,7 @@ class named_condition
//!If the condition can't be created throws interprocess_exception
named_condition(create_only_t create_only, const char *name, const permissions &perm = permissions());
- //!Opens or creates a global condition with a name.
+ //!Opens or creates a global condition with a name.
//!If the condition is created, this call is equivalent to
//!named_condition(create_only_t, ... )
//!If the condition is already created, this call is equivalent
@@ -71,7 +76,7 @@ class named_condition
//!use remove().
~named_condition();
- //!If there is a thread waiting on *this, change that
+ //!If there is a thread waiting on *this, change that
//!thread's state to ready. Otherwise there is no effect.*/
void notify_one();
@@ -79,8 +84,8 @@ class named_condition
//!If there are no waiting threads, notify_all() has no effect.
void notify_all();
- //!Releases the lock on the named_mutex object associated with lock, blocks
- //!the current thread of execution until readied by a call to
+ //!Releases the lock on the named_mutex object associated with lock, blocks
+ //!the current thread of execution until readied by a call to
//!this->notify_one() or this->notify_all(), and then reacquires the lock.
template <typename L>
void wait(L& lock);
@@ -90,16 +95,16 @@ class named_condition
template <typename L, typename Pr>
void wait(L& lock, Pr pred);
- //!Releases the lock on the named_mutex object associated with lock, blocks
- //!the current thread of execution until readied by a call to
- //!this->notify_one() or this->notify_all(), or until time abs_time is reached,
+ //!Releases the lock on the named_mutex object associated with lock, blocks
+ //!the current thread of execution until readied by a call to
+ //!this->notify_one() or this->notify_all(), or until time abs_time is reached,
//!and then reacquires the lock.
//!Returns: false if time abs_time is reached, otherwise true.
template <typename L>
bool timed_wait(L& lock, const boost::posix_time::ptime &abs_time);
- //!The same as: while (!pred()) {
- //! if (!timed_wait(lock, abs_time)) return pred();
+ //!The same as: while (!pred()) {
+ //! if (!timed_wait(lock, abs_time)) return pred();
//! } return true;
template <typename L, typename Pr>
bool timed_wait(L& lock, const boost::posix_time::ptime &abs_time, Pr pred);
@@ -110,7 +115,12 @@ class named_condition
/// @cond
private:
- ipcdetail::shm_named_condition m_cond;
+ #if defined(BOOST_INTERPROCESS_USE_WINDOWS)
+ typedef ipcdetail::windows_named_condition condition_type;
+ #else
+ typedef ipcdetail::shm_named_condition condition_type;
+ #endif
+ condition_type m_cond;
friend class ipcdetail::interprocess_tester;
void dont_close_on_destruction()
@@ -160,7 +170,7 @@ inline bool named_condition::timed_wait
{ return m_cond.timed_wait(lock, abs_time, pred); }
inline bool named_condition::remove(const char *name)
-{ return ipcdetail::shm_named_condition::remove(name); }
+{ return condition_type::remove(name); }
/// @endcond
diff --git a/boost/interprocess/sync/named_mutex.hpp b/boost/interprocess/sync/named_mutex.hpp
index 3e56b81794..c34193c697 100644
--- a/boost/interprocess/sync/named_mutex.hpp
+++ b/boost/interprocess/sync/named_mutex.hpp
@@ -24,7 +24,11 @@
#include <boost/interprocess/permissions.hpp>
#if defined(BOOST_INTERPROCESS_NAMED_MUTEX_USES_POSIX_SEMAPHORES)
-#include <boost/interprocess/sync/posix/named_mutex.hpp>
+ #include <boost/interprocess/sync/posix/named_mutex.hpp>
+ #define BOOST_INTERPROCESS_USE_POSIX_SEMAPHORES
+#elif !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && defined (BOOST_INTERPROCESS_WINDOWS)
+ #include <boost/interprocess/sync/windows/named_mutex.hpp>
+ #define BOOST_INTERPROCESS_USE_WINDOWS
#else
#include <boost/interprocess/sync/shm/named_mutex.hpp>
#endif
@@ -37,7 +41,7 @@ namespace interprocess {
class named_condition;
-//!A mutex with a global name, so it can be found from different
+//!A mutex with a global name, so it can be found from different
//!processes. This mutex can't be placed in shared memory, and
//!each process should have it's own named_mutex.
class named_mutex
@@ -56,7 +60,7 @@ class named_mutex
//!Throws interprocess_exception on error.
named_mutex(create_only_t create_only, const char *name, const permissions &perm = permissions());
- //!Opens or creates a global mutex with a name.
+ //!Opens or creates a global mutex with a name.
//!If the mutex is created, this call is equivalent to
//!named_mutex(create_only_t, ... )
//!If the mutex is already created, this call is equivalent
@@ -85,7 +89,7 @@ class named_mutex
//!Throws interprocess_exception if a severe error is found
void lock();
- //!Tries to lock the interprocess_mutex, returns false when interprocess_mutex
+ //!Tries to lock the interprocess_mutex, returns false when interprocess_mutex
//!is already locked, returns true when success.
//!Throws interprocess_exception if a severe error is found
bool try_lock();
@@ -104,15 +108,20 @@ class named_mutex
friend class ipcdetail::interprocess_tester;
void dont_close_on_destruction();
- #if defined(BOOST_INTERPROCESS_NAMED_MUTEX_USES_POSIX_SEMAPHORES)
- typedef ipcdetail::posix_named_mutex impl_t;
- impl_t m_mut;
+ #if defined(BOOST_INTERPROCESS_USE_POSIX_SEMAPHORES)
+ typedef ipcdetail::posix_named_mutex impl_t;
+ impl_t m_mut;
+ #undef BOOST_INTERPROCESS_USE_POSIX_SEMAPHORES
+ #elif defined(BOOST_INTERPROCESS_USE_WINDOWS)
+ typedef ipcdetail::windows_named_mutex impl_t;
+ impl_t m_mut;
+ #undef BOOST_INTERPROCESS_USE_WINDOWS
#else
- typedef ipcdetail::shm_named_mutex impl_t;
- impl_t m_mut;
- public:
- interprocess_mutex *mutex() const
- { return m_mut.mutex(); }
+ typedef ipcdetail::shm_named_mutex impl_t;
+ impl_t m_mut;
+ public:
+ interprocess_mutex *mutex() const
+ { return m_mut.mutex(); }
#endif
/// @endcond
diff --git a/boost/interprocess/sync/named_recursive_mutex.hpp b/boost/interprocess/sync/named_recursive_mutex.hpp
index 28768cea6f..2d4b9b2416 100644
--- a/boost/interprocess/sync/named_recursive_mutex.hpp
+++ b/boost/interprocess/sync/named_recursive_mutex.hpp
@@ -20,7 +20,12 @@
#include <boost/interprocess/creation_tags.hpp>
#include <boost/interprocess/detail/posix_time_types_wrk.hpp>
#include <boost/interprocess/permissions.hpp>
-#include <boost/interprocess/sync/shm/named_recursive_mutex.hpp>
+#if !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && defined (BOOST_INTERPROCESS_WINDOWS)
+ #include <boost/interprocess/sync/windows/named_recursive_mutex.hpp>
+ #define BOOST_INTERPROCESS_USE_WINDOWS
+#else
+ #include <boost/interprocess/sync/shm/named_recursive_mutex.hpp>
+#endif
//!\file
//!Describes a named named_recursive_mutex class for inter-process synchronization
@@ -32,7 +37,7 @@ namespace interprocess {
namespace ipcdetail{ class interprocess_tester; }
/// @endcond
-//!A recursive mutex with a global name, so it can be found from different
+//!A recursive mutex with a global name, so it can be found from different
//!processes. This mutex can't be placed in shared memory, and
//!each process should have it's own named_recursive_mutex.
class named_recursive_mutex
@@ -49,7 +54,7 @@ class named_recursive_mutex
//!If the recursive_mutex can't be created throws interprocess_exception
named_recursive_mutex(create_only_t create_only, const char *name, const permissions &perm = permissions());
- //!Opens or creates a global recursive_mutex with a name.
+ //!Opens or creates a global recursive_mutex with a name.
//!If the recursive_mutex is created, this call is equivalent to
//!named_recursive_mutex(create_only_t, ... )
//!If the recursive_mutex is already created, this call is equivalent
@@ -78,7 +83,7 @@ class named_recursive_mutex
//!Throws interprocess_exception if a severe error is found.
void lock();
- //!Tries to lock the named_recursive_mutex, returns false when named_recursive_mutex
+ //!Tries to lock the named_recursive_mutex, returns false when named_recursive_mutex
//!is already locked, returns true when success.
//!Throws interprocess_exception if a severe error is found.
bool try_lock();
@@ -97,7 +102,12 @@ class named_recursive_mutex
friend class ipcdetail::interprocess_tester;
void dont_close_on_destruction();
- typedef ipcdetail::shm_named_recursive_mutex impl_t;
+ #if defined(BOOST_INTERPROCESS_USE_WINDOWS)
+ typedef ipcdetail::windows_named_recursive_mutex impl_t;
+ #undef BOOST_INTERPROCESS_USE_WINDOWS
+ #else
+ typedef ipcdetail::shm_named_recursive_mutex impl_t;
+ #endif
impl_t m_mut;
/// @endcond
diff --git a/boost/interprocess/sync/named_semaphore.hpp b/boost/interprocess/sync/named_semaphore.hpp
index 33e06964f9..39c9096fb6 100644
--- a/boost/interprocess/sync/named_semaphore.hpp
+++ b/boost/interprocess/sync/named_semaphore.hpp
@@ -25,6 +25,10 @@
#if defined(BOOST_INTERPROCESS_NAMED_SEMAPHORE_USES_POSIX_SEMAPHORES)
#include <boost/interprocess/sync/posix/named_semaphore.hpp>
+//Experimental...
+#elif !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && defined (BOOST_INTERPROCESS_WINDOWS)
+ #include <boost/interprocess/sync/windows/named_semaphore.hpp>
+ #define BOOST_INTERPROCESS_USE_WINDOWS
#else
#include <boost/interprocess/sync/shm/named_semaphore.hpp>
#endif
@@ -35,8 +39,8 @@
namespace boost {
namespace interprocess {
-//!A semaphore with a global name, so it can be found from different
-//!processes. Allows several resource sharing patterns and efficient
+//!A semaphore with a global name, so it can be found from different
+//!processes. Allows several resource sharing patterns and efficient
//!acknowledgment mechanisms.
class named_semaphore
{
@@ -49,11 +53,11 @@ class named_semaphore
/// @endcond
public:
- //!Creates a global semaphore with a name, and an initial count.
+ //!Creates a global semaphore with a name, and an initial count.
//!If the semaphore can't be created throws interprocess_exception
named_semaphore(create_only_t, const char *name, unsigned int initialCount, const permissions &perm = permissions());
- //!Opens or creates a global semaphore with a name, and an initial count.
+ //!Opens or creates a global semaphore with a name, and an initial count.
//!If the semaphore is created, this call is equivalent to
//!named_semaphore(create_only_t, ...)
//!If the semaphore is already created, this call is equivalent to
@@ -80,7 +84,7 @@ class named_semaphore
void post();
//!Decrements the semaphore. If the semaphore value is not greater than zero,
- //!then the calling process/thread blocks until it can decrement the counter.
+ //!then the calling process/thread blocks until it can decrement the counter.
//!If there is an error an interprocess_exception exception is thrown.
void wait();
@@ -106,9 +110,12 @@ class named_semaphore
void dont_close_on_destruction();
#if defined(BOOST_INTERPROCESS_NAMED_SEMAPHORE_USES_POSIX_SEMAPHORES)
- typedef ipcdetail::posix_named_semaphore impl_t;
+ typedef ipcdetail::posix_named_semaphore impl_t;
+ #elif defined(BOOST_INTERPROCESS_USE_WINDOWS)
+ #undef BOOST_INTERPROCESS_USE_WINDOWS
+ typedef ipcdetail::windows_named_semaphore impl_t;
#else
- typedef ipcdetail::shm_named_semaphore impl_t;
+ typedef ipcdetail::shm_named_semaphore impl_t;
#endif
impl_t m_sem;
/// @endcond
diff --git a/boost/interprocess/sync/named_upgradable_mutex.hpp b/boost/interprocess/sync/named_upgradable_mutex.hpp
index 61c6bb4086..c45fd08270 100644
--- a/boost/interprocess/sync/named_upgradable_mutex.hpp
+++ b/boost/interprocess/sync/named_upgradable_mutex.hpp
@@ -38,7 +38,7 @@ namespace ipcdetail{ class interprocess_tester; }
class named_condition;
-//!A upgradable mutex with a global name, so it can be found from different
+//!A upgradable mutex with a global name, so it can be found from different
//!processes. This mutex can't be placed in shared memory, and
//!each process should have it's own named upgradable mutex.
class named_upgradable_mutex
@@ -52,11 +52,11 @@ class named_upgradable_mutex
/// @endcond
public:
- //!Creates a global upgradable mutex with a name.
+ //!Creates a global upgradable mutex with a name.
//!If the upgradable mutex can't be created throws interprocess_exception
named_upgradable_mutex(create_only_t create_only, const char *name, const permissions &perm = permissions());
- //!Opens or creates a global upgradable mutex with a name, and an initial count.
+ //!Opens or creates a global upgradable mutex with a name, and an initial count.
//!If the upgradable mutex is created, this call is equivalent to
//!named_upgradable_mutex(create_only_t, ...)
//!If the upgradable mutex is already created, this call is equivalent to
@@ -95,13 +95,13 @@ class named_upgradable_mutex
//!Effects: The calling thread tries to acquire exclusive ownership of the mutex
//! waiting if necessary until no other thread has exclusive, sharable or
- //! upgradable ownership of the mutex or abs_time is reached.
- //!Returns: If acquires exclusive ownership, returns true. Otherwise returns false.
+ //! upgradable ownership of the mutex or abs_time is reached.
+ //!Returns: If acquires exclusive ownership, returns true. Otherwise returns false.
//!Throws: interprocess_exception on error.
bool timed_lock(const boost::posix_time::ptime &abs_time);
- //!Precondition: The thread must have exclusive ownership of the mutex.
- //!Effects: The calling thread releases the exclusive ownership of the mutex.
+ //!Precondition: The thread must have exclusive ownership of the mutex.
+ //!Effects: The calling thread releases the exclusive ownership of the mutex.
//!Throws: An exception derived from interprocess_exception on error.
void unlock();
@@ -115,21 +115,21 @@ class named_upgradable_mutex
//!Effects: The calling thread tries to acquire sharable ownership of the mutex
//! without waiting. If no other thread has exclusive ownership
- //! of the mutex this succeeds.
+ //! of the mutex this succeeds.
//!Returns: If it can acquire sharable ownership immediately returns true. If it
- //! has to wait, returns false.
+ //! has to wait, returns false.
//!Throws: interprocess_exception on error.
bool try_lock_sharable();
//!Effects: The calling thread tries to acquire sharable ownership of the mutex
//! waiting if necessary until no other thread has exclusive
- //! ownership of the mutex or abs_time is reached.
- //!Returns: If acquires sharable ownership, returns true. Otherwise returns false.
+ //! ownership of the mutex or abs_time is reached.
+ //!Returns: If acquires sharable ownership, returns true. Otherwise returns false.
//!Throws: interprocess_exception on error.
bool timed_lock_sharable(const boost::posix_time::ptime &abs_time);
- //!Precondition: The thread must have sharable ownership of the mutex.
- //!Effects: The calling thread releases the sharable ownership of the mutex.
+ //!Precondition: The thread must have sharable ownership of the mutex.
+ //!Effects: The calling thread releases the sharable ownership of the mutex.
//!Throws: An exception derived from interprocess_exception on error.
void unlock_sharable();
@@ -143,7 +143,7 @@ class named_upgradable_mutex
//!Effects: The calling thread tries to acquire upgradable ownership of the mutex
//! without waiting. If no other thread has exclusive or upgradable ownership
- //! of the mutex this succeeds.
+ //! of the mutex this succeeds.
//!Returns: If it can acquire upgradable ownership immediately returns true.
//! If it has to wait, returns false.
//!Throws: interprocess_exception on error.
@@ -152,66 +152,66 @@ class named_upgradable_mutex
//!Effects: The calling thread tries to acquire upgradable ownership of the mutex
//! waiting if necessary until no other thread has exclusive or upgradable
//! ownership of the mutex or abs_time is reached.
- //!Returns: If acquires upgradable ownership, returns true. Otherwise returns false.
+ //!Returns: If acquires upgradable ownership, returns true. Otherwise returns false.
//!Throws: interprocess_exception on error.
bool timed_lock_upgradable(const boost::posix_time::ptime &abs_time);
- //!Precondition: The thread must have upgradable ownership of the mutex.
- //!Effects: The calling thread releases the upgradable ownership of the mutex.
+ //!Precondition: The thread must have upgradable ownership of the mutex.
+ //!Effects: The calling thread releases the upgradable ownership of the mutex.
//!Throws: An exception derived from interprocess_exception on error.
void unlock_upgradable();
//Demotions
- //!Precondition: The thread must have exclusive ownership of the mutex.
+ //!Precondition: The thread must have exclusive ownership of the mutex.
//!Effects: The thread atomically releases exclusive ownership and acquires
- //! upgradable ownership. This operation is non-blocking.
+ //! upgradable ownership. This operation is non-blocking.
//!Throws: An exception derived from interprocess_exception on error.
void unlock_and_lock_upgradable();
- //!Precondition: The thread must have exclusive ownership of the mutex.
+ //!Precondition: The thread must have exclusive ownership of the mutex.
//!Effects: The thread atomically releases exclusive ownership and acquires
- //! sharable ownership. This operation is non-blocking.
+ //! sharable ownership. This operation is non-blocking.
//!Throws: An exception derived from interprocess_exception on error.
void unlock_and_lock_sharable();
- //!Precondition: The thread must have upgradable ownership of the mutex.
+ //!Precondition: The thread must have upgradable ownership of the mutex.
//!Effects: The thread atomically releases upgradable ownership and acquires
- //! sharable ownership. This operation is non-blocking.
+ //! sharable ownership. This operation is non-blocking.
//!Throws: An exception derived from interprocess_exception on error.
void unlock_upgradable_and_lock_sharable();
//Promotions
- //!Precondition: The thread must have upgradable ownership of the mutex.
+ //!Precondition: The thread must have upgradable ownership of the mutex.
//!Effects: The thread atomically releases upgradable ownership and acquires
//! exclusive ownership. This operation will block until all threads with
- //! sharable ownership release it.
+ //! sharable ownership release it.
//!Throws: An exception derived from interprocess_exception on error.
void unlock_upgradable_and_lock();
- //!Precondition: The thread must have upgradable ownership of the mutex.
+ //!Precondition: The thread must have upgradable ownership of the mutex.
//!Effects: The thread atomically releases upgradable ownership and tries to
//! acquire exclusive ownership. This operation will fail if there are threads
- //! with sharable ownership, but it will maintain upgradable ownership.
+ //! with sharable ownership, but it will maintain upgradable ownership.
//!Returns: If acquires exclusive ownership, returns true. Otherwise returns false.
//!Throws: An exception derived from interprocess_exception on error.
bool try_unlock_upgradable_and_lock();
- //!Precondition: The thread must have upgradable ownership of the mutex.
+ //!Precondition: The thread must have upgradable ownership of the mutex.
//!Effects: The thread atomically releases upgradable ownership and tries to acquire
//! exclusive ownership, waiting if necessary until abs_time. This operation will
//! fail if there are threads with sharable ownership or timeout reaches, but it
- //! will maintain upgradable ownership.
- //!Returns: If acquires exclusive ownership, returns true. Otherwise returns false.
+ //! will maintain upgradable ownership.
+ //!Returns: If acquires exclusive ownership, returns true. Otherwise returns false.
//!Throws: An exception derived from interprocess_exception on error.
bool timed_unlock_upgradable_and_lock(const boost::posix_time::ptime &abs_time);
- //!Precondition: The thread must have sharable ownership of the mutex.
+ //!Precondition: The thread must have sharable ownership of the mutex.
//!Effects: The thread atomically releases sharable ownership and tries to acquire
//! exclusive ownership. This operation will fail if there are threads with sharable
//! or upgradable ownership, but it will maintain sharable ownership.
- //!Returns: If acquires exclusive ownership, returns true. Otherwise returns false.
+ //!Returns: If acquires exclusive ownership, returns true. Otherwise returns false.
//!Throws: An exception derived from interprocess_exception on error.
bool try_unlock_sharable_and_lock();
diff --git a/boost/interprocess/sync/posix/condition.hpp b/boost/interprocess/sync/posix/condition.hpp
index 213e4ce8b5..48be099f60 100644
--- a/boost/interprocess/sync/posix/condition.hpp
+++ b/boost/interprocess/sync/posix/condition.hpp
@@ -19,7 +19,7 @@
#include <boost/interprocess/detail/workaround.hpp>
#include <pthread.h>
-#include <errno.h>
+#include <errno.h>
#include <boost/interprocess/sync/posix/pthread_helpers.hpp>
#include <boost/interprocess/sync/posix/ptime_to_timespec.hpp>
#include <boost/interprocess/detail/posix_time_types_wrk.hpp>
@@ -44,7 +44,7 @@ class posix_condition
//!liberating system resources.
~posix_condition();
- //!If there is a thread waiting on *this, change that
+ //!If there is a thread waiting on *this, change that
//!thread's state to ready. Otherwise there is no effect.
void notify_one();
@@ -52,8 +52,8 @@ class posix_condition
//!If there are no waiting threads, notify_all() has no effect.
void notify_all();
- //!Releases the lock on the posix_mutex object associated with lock, blocks
- //!the current thread of execution until readied by a call to
+ //!Releases the lock on the posix_mutex object associated with lock, blocks
+ //!the current thread of execution until readied by a call to
//!this->notify_one() or this->notify_all(), and then reacquires the lock.
template <typename L>
void wait(L& lock)
@@ -75,9 +75,9 @@ class posix_condition
this->do_wait(*lock.mutex());
}
- //!Releases the lock on the posix_mutex object associated with lock, blocks
- //!the current thread of execution until readied by a call to
- //!this->notify_one() or this->notify_all(), or until time abs_time is reached,
+ //!Releases the lock on the posix_mutex object associated with lock, blocks
+ //!the current thread of execution until readied by a call to
+ //!this->notify_one() or this->notify_all(), or until time abs_time is reached,
//!and then reacquires the lock.
//!Returns: false if time abs_time is reached, otherwise true.
template <typename L>
@@ -92,8 +92,8 @@ class posix_condition
return this->do_timed_wait(abs_time, *lock.mutex());
}
- //!The same as: while (!pred()) {
- //! if (!timed_wait(lock, abs_time)) return pred();
+ //!The same as: while (!pred()) {
+ //! if (!timed_wait(lock, abs_time)) return pred();
//! } return true;
template <typename L, typename Pr>
bool timed_wait(L& lock, const boost::posix_time::ptime &abs_time, Pr pred)
diff --git a/boost/interprocess/sync/posix/mutex.hpp b/boost/interprocess/sync/posix/mutex.hpp
index 22e2ec04b9..393807c97a 100644
--- a/boost/interprocess/sync/posix/mutex.hpp
+++ b/boost/interprocess/sync/posix/mutex.hpp
@@ -35,7 +35,7 @@
#include <boost/interprocess/detail/workaround.hpp>
#include <pthread.h>
-#include <errno.h>
+#include <errno.h>
#include <boost/interprocess/exceptions.hpp>
#include <boost/interprocess/sync/posix/ptime_to_timespec.hpp>
#include <boost/interprocess/detail/posix_time_types_wrk.hpp>
@@ -80,7 +80,7 @@ inline posix_mutex::posix_mutex()
mut.release();
}
-inline posix_mutex::~posix_mutex()
+inline posix_mutex::~posix_mutex()
{
int res = pthread_mutex_destroy(&m_mut);
BOOST_ASSERT(res == 0);(void)res;
@@ -88,7 +88,7 @@ inline posix_mutex::~posix_mutex()
inline void posix_mutex::lock()
{
- if (pthread_mutex_lock(&m_mut) != 0)
+ if (pthread_mutex_lock(&m_mut) != 0)
throw lock_exception();
}
diff --git a/boost/interprocess/sync/posix/pthread_helpers.hpp b/boost/interprocess/sync/posix/pthread_helpers.hpp
index c09ce200cf..bcbc44be33 100644
--- a/boost/interprocess/sync/posix/pthread_helpers.hpp
+++ b/boost/interprocess/sync/posix/pthread_helpers.hpp
@@ -19,8 +19,8 @@
#include <boost/interprocess/detail/workaround.hpp>
#include <pthread.h>
-#include <errno.h>
-#include <boost/interprocess/exceptions.hpp>
+#include <errno.h>
+#include <boost/interprocess/exceptions.hpp>
namespace boost {
namespace interprocess {
@@ -29,7 +29,7 @@ namespace ipcdetail{
#if defined BOOST_INTERPROCESS_POSIX_PROCESS_SHARED
//!Makes pthread_mutexattr_t cleanup easy when using exceptions
- struct mutexattr_wrapper
+ struct mutexattr_wrapper
{
//!Constructor
mutexattr_wrapper(bool recursive = false)
@@ -51,7 +51,7 @@ namespace ipcdetail{
};
//!Makes pthread_condattr_t cleanup easy when using exceptions
- struct condattr_wrapper
+ struct condattr_wrapper
{
//!Constructor
condattr_wrapper()
@@ -86,7 +86,7 @@ namespace ipcdetail{
void release() {mp_mut = 0; }
- private:
+ private:
pthread_mutex_t *mp_mut;
};
@@ -94,7 +94,7 @@ namespace ipcdetail{
class condition_initializer
{
public:
- condition_initializer(pthread_cond_t &cond, pthread_condattr_t &cond_attr)
+ condition_initializer(pthread_cond_t &cond, pthread_condattr_t &cond_attr)
: mp_cond(&cond)
{
if(pthread_cond_init(mp_cond, &cond_attr)!= 0)
@@ -105,7 +105,7 @@ namespace ipcdetail{
void release() { mp_cond = 0; }
- private:
+ private:
pthread_cond_t *mp_cond;
};
@@ -114,7 +114,7 @@ namespace ipcdetail{
#if defined(BOOST_INTERPROCESS_POSIX_BARRIERS) && defined(BOOST_INTERPROCESS_POSIX_PROCESS_SHARED)
//!Makes pthread_barrierattr_t cleanup easy when using exceptions
- struct barrierattr_wrapper
+ struct barrierattr_wrapper
{
//!Constructor
barrierattr_wrapper()
@@ -138,8 +138,8 @@ namespace ipcdetail{
{
public:
//!Constructor. Takes barrier attributes to initialize the barrier
- barrier_initializer(pthread_barrier_t &mut,
- pthread_barrierattr_t &mut_attr,
+ barrier_initializer(pthread_barrier_t &mut,
+ pthread_barrierattr_t &mut_attr,
int count)
: mp_barrier(&mut)
{
@@ -151,7 +151,7 @@ namespace ipcdetail{
void release() {mp_barrier = 0; }
- private:
+ private:
pthread_barrier_t *mp_barrier;
};
diff --git a/boost/interprocess/sync/posix/recursive_mutex.hpp b/boost/interprocess/sync/posix/recursive_mutex.hpp
index baa670fa9a..456c9a4874 100644
--- a/boost/interprocess/sync/posix/recursive_mutex.hpp
+++ b/boost/interprocess/sync/posix/recursive_mutex.hpp
@@ -31,7 +31,7 @@
#include <boost/interprocess/detail/workaround.hpp>
#include <pthread.h>
-#include <errno.h>
+#include <errno.h>
#include <boost/interprocess/sync/posix/pthread_helpers.hpp>
#include <boost/interprocess/sync/posix/ptime_to_timespec.hpp>
#include <boost/interprocess/detail/posix_time_types_wrk.hpp>
@@ -78,7 +78,7 @@ inline posix_recursive_mutex::~posix_recursive_mutex()
inline void posix_recursive_mutex::lock()
{
- if (pthread_mutex_lock(&m_mut) != 0)
+ if (pthread_mutex_lock(&m_mut) != 0)
throw lock_exception();
}
diff --git a/boost/interprocess/sync/posix/semaphore_wrapper.hpp b/boost/interprocess/sync/posix/semaphore_wrapper.hpp
index 1aeef47662..22184cda9d 100644
--- a/boost/interprocess/sync/posix/semaphore_wrapper.hpp
+++ b/boost/interprocess/sync/posix/semaphore_wrapper.hpp
@@ -18,7 +18,7 @@
#include <boost/interprocess/detail/tmp_dir_helpers.hpp>
#include <boost/interprocess/permissions.hpp>
-#include <fcntl.h> //O_CREAT, O_*...
+#include <fcntl.h> //O_CREAT, O_*...
#include <unistd.h> //close
#include <string> //std::string
#include <semaphore.h> //sem_* family, SEM_VALUE_MAX
@@ -42,7 +42,7 @@ namespace interprocess {
namespace ipcdetail {
inline bool semaphore_open
- (sem_t *&handle, create_enum_t type, const char *origname,
+ (sem_t *&handle, create_enum_t type, const char *origname,
unsigned int count = 0, const permissions &perm = permissions())
{
std::string name;
@@ -103,7 +103,7 @@ inline bool semaphore_open
inline void semaphore_close(sem_t *handle)
{
int ret = sem_close(handle);
- if(ret != 0){
+ if(ret != 0){
BOOST_ASSERT(0);
}
}
@@ -138,7 +138,7 @@ inline void semaphore_init(sem_t *handle, unsigned int initialCount)
inline void semaphore_destroy(sem_t *handle)
{
int ret = sem_destroy(handle);
- if(ret != 0){
+ if(ret != 0){
BOOST_ASSERT(0);
}
}
diff --git a/boost/interprocess/sync/scoped_lock.hpp b/boost/interprocess/sync/scoped_lock.hpp
index bfef63a30a..61fe93e5b3 100644
--- a/boost/interprocess/sync/scoped_lock.hpp
+++ b/boost/interprocess/sync/scoped_lock.hpp
@@ -89,7 +89,7 @@ class scoped_lock
: mp_mutex(&m), m_locked(true)
{}
- //!Effects: m.try_lock().
+ //!Effects: m.try_lock().
//!Postconditions: mutex() == &m. owns() == the return value of the
//! m.try_lock() executed within the constructor.
//!Notes: The constructor will take ownership of the mutex if it can do
@@ -101,7 +101,7 @@ class scoped_lock
: mp_mutex(&m), m_locked(mp_mutex->try_lock())
{}
- //!Effects: m.timed_lock(abs_time).
+ //!Effects: m.timed_lock(abs_time).
//!Postconditions: mutex() == &m. owns() == the return value of the
//! m.timed_lock(abs_time) executed within the constructor.
//!Notes: The constructor will take ownership of the mutex if it can do
@@ -128,7 +128,7 @@ class scoped_lock
{ mp_mutex = scop.release(); }
//!Effects: If upgr.owns() then calls unlock_upgradable_and_lock() on the
- //! referenced mutex. upgr.release() is called.
+ //! referenced mutex. upgr.release() is called.
//!Postconditions: mutex() == the value upgr.mutex() had before the construction.
//! upgr.mutex() == 0. owns() == upgr.owns() before the construction.
//! upgr.owns() == false after the construction.
@@ -155,12 +155,12 @@ class scoped_lock
//!Effects: If upgr.owns() then calls try_unlock_upgradable_and_lock() on the
//!referenced mutex:
//! a)if try_unlock_upgradable_and_lock() returns true then mutex() obtains
- //! the value from upgr.release() and owns() is set to true.
+ //! the value from upgr.release() and owns() is set to true.
//! b)if try_unlock_upgradable_and_lock() returns false then upgr is
- //! unaffected and this scoped_lock construction as the same effects as
- //! a default construction.
+ //! unaffected and this scoped_lock construction as the same effects as
+ //! a default construction.
//! c)Else upgr.owns() is false. mutex() obtains the value from upgr.release()
- //! and owns() is set to false
+ //! and owns() is set to false
//!Notes: This construction will not block. It will try to obtain mutex
//! ownership from upgr immediately, while changing the lock type from a
//! "read lock" to a "write lock". If the "read lock" isn't held in the
@@ -186,12 +186,12 @@ class scoped_lock
//!Effects: If upgr.owns() then calls timed_unlock_upgradable_and_lock(abs_time)
//! on the referenced mutex:
//! a)if timed_unlock_upgradable_and_lock(abs_time) returns true then mutex()
- //! obtains the value from upgr.release() and owns() is set to true.
+ //! obtains the value from upgr.release() and owns() is set to true.
//! b)if timed_unlock_upgradable_and_lock(abs_time) returns false then upgr
//! is unaffected and this scoped_lock construction as the same effects
//! as a default construction.
//! c)Else upgr.owns() is false. mutex() obtains the value from upgr.release()
- //! and owns() is set to false
+ //! and owns() is set to false
//!Notes: This construction will not block. It will try to obtain mutex ownership
//! from upgr immediately, while changing the lock type from a "read lock" to a
//! "write lock". If the "read lock" isn't held in the first place, the mutex
@@ -214,14 +214,14 @@ class scoped_lock
}
//!Effects: If shar.owns() then calls try_unlock_sharable_and_lock() on the
- //!referenced mutex.
+ //!referenced mutex.
//! a)if try_unlock_sharable_and_lock() returns true then mutex() obtains
- //! the value from shar.release() and owns() is set to true.
+ //! the value from shar.release() and owns() is set to true.
//! b)if try_unlock_sharable_and_lock() returns false then shar is
//! unaffected and this scoped_lock construction has the same
- //! effects as a default construction.
+ //! effects as a default construction.
//! c)Else shar.owns() is false. mutex() obtains the value from
- //! shar.release() and owns() is set to false
+ //! shar.release() and owns() is set to false
//!Notes: This construction will not block. It will try to obtain mutex
//! ownership from shar immediately, while changing the lock type from a
//! "read lock" to a "write lock". If the "read lock" isn't held in the
@@ -253,13 +253,13 @@ class scoped_lock
}
//!Effects: If owns() before the call, then unlock() is called on mutex().
- //! *this gets the state of scop and scop gets set to a default constructed state.
+ //! *this gets the state of scop and scop gets set to a default constructed state.
//!Notes: With a recursive mutex it is possible that both this and scop own
//! the same mutex before the assignment. In this case, this will own the
//! mutex after the assignment (and scop will not), but the mutex's lock
//! count will be decremented by one.
scoped_lock &operator=(BOOST_RV_REF(scoped_lock) scop)
- {
+ {
if(this->owns())
this->unlock();
m_locked = scop.owns();
@@ -281,7 +281,7 @@ class scoped_lock
}
//!Effects: If mutex() == 0 or if already locked, throws a lock_exception()
- //! exception. Calls try_lock() on the referenced mutex.
+ //! exception. Calls try_lock() on the referenced mutex.
//!Postconditions: owns() == the value returned from mutex()->try_lock().
//!Notes: The scoped_lock changes from a state of not owning the mutex, to
//! owning the mutex, but only if blocking was not required. If the
@@ -348,8 +348,8 @@ class scoped_lock
m_locked = false;
return mut;
}
-
- //!Effects: Swaps state with moved lock.
+
+ //!Effects: Swaps state with moved lock.
//!Throws: Nothing.
void swap( scoped_lock<mutex_type> &other)
{
@@ -359,7 +359,7 @@ class scoped_lock
/// @cond
private:
- mutex_type *mp_mutex;
+ mutex_type *mp_mutex;
bool m_locked;
/// @endcond
};
diff --git a/boost/interprocess/sync/sharable_lock.hpp b/boost/interprocess/sync/sharable_lock.hpp
index c8b7c1d26e..9342e45a46 100644
--- a/boost/interprocess/sync/sharable_lock.hpp
+++ b/boost/interprocess/sync/sharable_lock.hpp
@@ -67,7 +67,7 @@ class sharable_lock
{}
//!Effects: m.lock_sharable().
- //!Postconditions: owns() == true and mutex() == &m.
+ //!Postconditions: owns() == true and mutex() == &m.
//!Notes: The constructor will take sharable-ownership of the mutex. If
//! another thread already owns the mutex with exclusive ownership
//! (scoped_lock), this thread will block until the mutex is released.
@@ -104,7 +104,7 @@ class sharable_lock
: mp_mutex(&m), m_locked(false)
{ m_locked = mp_mutex->try_lock_sharable(); }
- //!Effects: m.timed_lock_sharable(abs_time)
+ //!Effects: m.timed_lock_sharable(abs_time)
//!Postconditions: mutex() == &m. owns() == the return value of the
//! m.timed_lock_sharable() executed within the constructor.
//!Notes: The constructor will take sharable-ownership of the mutex if it
@@ -132,7 +132,7 @@ class sharable_lock
//! referenced mutex.
//!Postconditions: mutex() == the value upgr.mutex() had before the construction.
//! upgr.mutex() == 0 owns() == the value of upgr.owns() before construction.
- //! upgr.owns() == false after the construction.
+ //! upgr.owns() == false after the construction.
//!Notes: If upgr is locked, this constructor will lock this sharable_lock while
//! unlocking upgr. Only a moved sharable_lock's will match this
//! signature. An non-moved upgradable_lock can be moved with the expression:
@@ -156,7 +156,7 @@ class sharable_lock
//! scop.mutex() == 0 owns() == scop.owns() before the constructor. After the
//! construction, scop.owns() == false.
//!Notes: If scop is locked, this constructor will transfer the exclusive ownership
- //! to a sharable-ownership of this sharable_lock.
+ //! to a sharable-ownership of this sharable_lock.
//! Only a moved scoped_lock's will match this
//! signature. An non-moved scoped_lock can be moved with the expression:
//! "boost::move(lock);".
@@ -184,12 +184,12 @@ class sharable_lock
}
//!Effects: If owns() before the call, then unlock_sharable() is called on mutex().
- //! *this gets the state of upgr and upgr gets set to a default constructed state.
+ //! *this gets the state of upgr and upgr gets set to a default constructed state.
//!Notes: With a recursive mutex it is possible that both this and upgr own the mutex
//! before the assignment. In this case, this will own the mutex after the assignment
//! (and upgr will not), but the mutex's lock count will be decremented by one.
sharable_lock &operator=(BOOST_RV_REF(sharable_lock<mutex_type>) upgr)
- {
+ {
if(this->owns())
this->unlock();
m_locked = upgr.owns();
@@ -203,7 +203,7 @@ class sharable_lock
//!Notes: The sharable_lock changes from a state of not owning the
//! mutex, to owning the mutex, blocking if necessary.
void lock()
- {
+ {
if(!mp_mutex || m_locked)
throw lock_exception();
mp_mutex->lock_sharable();
@@ -219,7 +219,7 @@ class sharable_lock
//! mutex_type does not support try_lock_sharable(), this function will
//! fail at compile time if instantiated, but otherwise have no effect.
bool try_lock()
- {
+ {
if(!mp_mutex || m_locked)
throw lock_exception();
m_locked = mp_mutex->try_lock_sharable();
@@ -236,7 +236,7 @@ class sharable_lock
//! timed_lock_sharable(), this function will fail at compile time if
//! instantiated, but otherwise have no effect.
bool timed_lock(const boost::posix_time::ptime& abs_time)
- {
+ {
if(!mp_mutex || m_locked)
throw lock_exception();
m_locked = mp_mutex->timed_lock_sharable(abs_time);
@@ -282,7 +282,7 @@ class sharable_lock
return mut;
}
- //!Effects: Swaps state with moved lock.
+ //!Effects: Swaps state with moved lock.
//!Throws: Nothing.
void swap(sharable_lock<mutex_type> &other)
{
diff --git a/boost/interprocess/sync/shm/named_condition.hpp b/boost/interprocess/sync/shm/named_condition.hpp
index 0d67c25757..9d7cd77e11 100644
--- a/boost/interprocess/sync/shm/named_condition.hpp
+++ b/boost/interprocess/sync/shm/named_condition.hpp
@@ -28,7 +28,7 @@
#include <boost/interprocess/sync/shm/named_creation_functor.hpp>
#include <boost/interprocess/sync/named_mutex.hpp>
#include <boost/interprocess/permissions.hpp>
-#if defined BOOST_INTERPROCESS_NAMED_MUTEX_USES_POSIX_SEMAPHORES
+#if defined (BOOST_INTERPROCESS_NAMED_MUTEX_USES_POSIX_SEMAPHORES)
#include <boost/interprocess/sync/interprocess_mutex.hpp>
#include <boost/interprocess/sync/scoped_lock.hpp>
#endif
@@ -42,7 +42,7 @@ namespace interprocess {
namespace ipcdetail {
/// @cond
-namespace ipcdetail{ class interprocess_tester; }
+class interprocess_tester;
/// @endcond
//! A global condition variable that can be created by name.
@@ -61,7 +61,7 @@ class shm_named_condition
//!If the condition can't be created throws interprocess_exception
shm_named_condition(create_only_t create_only, const char *name, const permissions &perm = permissions());
- //!Opens or creates a global condition with a name.
+ //!Opens or creates a global condition with a name.
//!If the condition is created, this call is equivalent to
//!shm_named_condition(create_only_t, ... )
//!If the condition is already created, this call is equivalent
@@ -82,7 +82,7 @@ class shm_named_condition
//!use remove().
~shm_named_condition();
- //!If there is a thread waiting on *this, change that
+ //!If there is a thread waiting on *this, change that
//!thread's state to ready. Otherwise there is no effect.*/
void notify_one();
@@ -90,8 +90,8 @@ class shm_named_condition
//!If there are no waiting threads, notify_all() has no effect.
void notify_all();
- //!Releases the lock on the named_mutex object associated with lock, blocks
- //!the current thread of execution until readied by a call to
+ //!Releases the lock on the named_mutex object associated with lock, blocks
+ //!the current thread of execution until readied by a call to
//!this->notify_one() or this->notify_all(), and then reacquires the lock.
template <typename L>
void wait(L& lock);
@@ -101,16 +101,16 @@ class shm_named_condition
template <typename L, typename Pr>
void wait(L& lock, Pr pred);
- //!Releases the lock on the named_mutex object associated with lock, blocks
- //!the current thread of execution until readied by a call to
- //!this->notify_one() or this->notify_all(), or until time abs_time is reached,
+ //!Releases the lock on the named_mutex object associated with lock, blocks
+ //!the current thread of execution until readied by a call to
+ //!this->notify_one() or this->notify_all(), or until time abs_time is reached,
//!and then reacquires the lock.
//!Returns: false if time abs_time is reached, otherwise true.
template <typename L>
bool timed_wait(L& lock, const boost::posix_time::ptime &abs_time);
- //!The same as: while (!pred()) {
- //! if (!timed_wait(lock, abs_time)) return pred();
+ //!The same as: while (!pred()) {
+ //! if (!timed_wait(lock, abs_time)) return pred();
//! } return true;
template <typename L, typename Pr>
bool timed_wait(L& lock, const boost::posix_time::ptime &abs_time, Pr pred);
@@ -147,6 +147,9 @@ class shm_named_condition
void unlock() { l_.lock(); }
};
+ //If named mutex uses POSIX semaphores, then the shm based condition variable
+ //must use it's internal lock to wait, as sem_t does not store a pthread_mutex_t
+ //instance needed by pthread_mutex_cond_t
#if defined (BOOST_INTERPROCESS_NAMED_MUTEX_USES_POSIX_SEMAPHORES)
interprocess_mutex *mutex() const
{ return &static_cast<condition_holder*>(m_shmem.get_user_address())->mutex_; }
@@ -156,7 +159,7 @@ class shm_named_condition
{
//shm_named_condition only works with named_mutex
BOOST_STATIC_ASSERT((is_convertible<typename Lock::mutex_type&, named_mutex&>::value == true));
-
+
//lock internal before unlocking external to avoid race with a notifier
scoped_lock<interprocess_mutex> internal_lock(*this->mutex());
lock_inverter<Lock> inverted_lock(lock);
@@ -173,18 +176,18 @@ class shm_named_condition
{
//shm_named_condition only works with named_mutex
BOOST_STATIC_ASSERT((is_convertible<typename Lock::mutex_type&, named_mutex&>::value == true));
- //lock internal before unlocking external to avoid race with a notifier
- scoped_lock<interprocess_mutex> internal_lock(*this->mutex(), abs_time);
+ //lock internal before unlocking external to avoid race with a notifier
+ scoped_lock<interprocess_mutex> internal_lock(*this->mutex(), abs_time);
if(!internal_lock) return false;
- lock_inverter<Lock> inverted_lock(lock);
- scoped_lock<lock_inverter<Lock> > external_unlock(inverted_lock);
+ lock_inverter<Lock> inverted_lock(lock);
+ scoped_lock<lock_inverter<Lock> > external_unlock(inverted_lock);
- //unlock internal first to avoid deadlock with near simultaneous waits
- scoped_lock<interprocess_mutex> internal_unlock;
- internal_lock.swap(internal_unlock);
- return this->condition()->timed_wait(internal_unlock, abs_time);
+ //unlock internal first to avoid deadlock with near simultaneous waits
+ scoped_lock<interprocess_mutex> internal_unlock;
+ internal_lock.swap(internal_unlock);
+ return this->condition()->timed_wait(internal_unlock, abs_time);
}
- #else
+ #else //defined (BOOST_INTERPROCESS_NAMED_MUTEX_USES_POSIX_SEMAPHORES)
template<class Lock>
class lock_wrapper
{
@@ -210,7 +213,7 @@ class shm_named_condition
private:
Lock &l_;
};
- #endif
+ #endif //defined (BOOST_INTERPROCESS_NAMED_MUTEX_USES_POSIX_SEMAPHORES)
friend class boost::interprocess::ipcdetail::interprocess_tester;
void dont_close_on_destruction();
diff --git a/boost/interprocess/sync/shm/named_creation_functor.hpp b/boost/interprocess/sync/shm/named_creation_functor.hpp
index 11a1db1d6f..9d752c837a 100644
--- a/boost/interprocess/sync/shm/named_creation_functor.hpp
+++ b/boost/interprocess/sync/shm/named_creation_functor.hpp
@@ -38,7 +38,7 @@ class named_creation_functor
{ new(address)T(m_arg); }
bool operator()(void *address, std::size_t, bool created) const
- {
+ {
switch(m_creation_type){
case DoOpen:
return true;
diff --git a/boost/interprocess/sync/shm/named_mutex.hpp b/boost/interprocess/sync/shm/named_mutex.hpp
index a71eb4fe68..f32fa70044 100644
--- a/boost/interprocess/sync/shm/named_mutex.hpp
+++ b/boost/interprocess/sync/shm/named_mutex.hpp
@@ -37,7 +37,7 @@ namespace ipcdetail {
class named_condition;
-//!A mutex with a global name, so it can be found from different
+//!A mutex with a global name, so it can be found from different
//!processes. This mutex can't be placed in shared memory, and
//!each process should have it's own named mutex.
class shm_named_mutex
@@ -56,7 +56,7 @@ class shm_named_mutex
//!Throws interprocess_exception on error.
shm_named_mutex(create_only_t create_only, const char *name, const permissions &perm = permissions());
- //!Opens or creates a global mutex with a name.
+ //!Opens or creates a global mutex with a name.
//!If the mutex is created, this call is equivalent to
//!shm_named_mutex(create_only_t, ... )
//!If the mutex is already created, this call is equivalent
@@ -85,7 +85,7 @@ class shm_named_mutex
//!Throws interprocess_exception if a severe error is found
void lock();
- //!Tries to lock the interprocess_mutex, returns false when interprocess_mutex
+ //!Tries to lock the interprocess_mutex, returns false when interprocess_mutex
//!is already locked, returns true when success.
//!Throws interprocess_exception if a severe error is found
bool try_lock();
diff --git a/boost/interprocess/sync/shm/named_recursive_mutex.hpp b/boost/interprocess/sync/shm/named_recursive_mutex.hpp
index 461c97eb32..7235571254 100644
--- a/boost/interprocess/sync/shm/named_recursive_mutex.hpp
+++ b/boost/interprocess/sync/shm/named_recursive_mutex.hpp
@@ -51,7 +51,7 @@ class shm_named_recursive_mutex
//!If the recursive_mutex can't be created throws interprocess_exception
shm_named_recursive_mutex(create_only_t create_only, const char *name, const permissions &perm = permissions());
- //!Opens or creates a global recursive_mutex with a name.
+ //!Opens or creates a global recursive_mutex with a name.
//!If the recursive_mutex is created, this call is equivalent to
//!shm_named_recursive_mutex(create_only_t, ... )
//!If the recursive_mutex is already created, this call is equivalent
@@ -80,7 +80,7 @@ class shm_named_recursive_mutex
//!Throws interprocess_exception if a severe error is found.
void lock();
- //!Tries to lock the shm_named_recursive_mutex, returns false when shm_named_recursive_mutex
+ //!Tries to lock the shm_named_recursive_mutex, returns false when shm_named_recursive_mutex
//!is already locked, returns true when success.
//!Throws interprocess_exception if a severe error is found.
bool try_lock();
diff --git a/boost/interprocess/sync/shm/named_upgradable_mutex.hpp b/boost/interprocess/sync/shm/named_upgradable_mutex.hpp
index 338fa98f7d..0975a6ed2b 100644
--- a/boost/interprocess/sync/shm/named_upgradable_mutex.hpp
+++ b/boost/interprocess/sync/shm/named_upgradable_mutex.hpp
@@ -38,7 +38,7 @@ namespace ipcdetail{ class interprocess_tester; }
class named_condition;
-//!A upgradable mutex with a global name, so it can be found from different
+//!A upgradable mutex with a global name, so it can be found from different
//!processes. This mutex can't be placed in shared memory, and
//!each process should have it's own named upgradable mutex.
class named_upgradable_mutex
@@ -52,11 +52,11 @@ class named_upgradable_mutex
/// @endcond
public:
- //!Creates a global upgradable mutex with a name.
+ //!Creates a global upgradable mutex with a name.
//!If the upgradable mutex can't be created throws interprocess_exception
named_upgradable_mutex(create_only_t create_only, const char *name, const permissions &perm = permissions());
- //!Opens or creates a global upgradable mutex with a name, and an initial count.
+ //!Opens or creates a global upgradable mutex with a name, and an initial count.
//!If the upgradable mutex is created, this call is equivalent to
//!named_upgradable_mutex(create_only_t, ...)
//!If the upgradable mutex is already created, this call is equivalent to
@@ -95,13 +95,13 @@ class named_upgradable_mutex
//!Effects: The calling thread tries to acquire exclusive ownership of the mutex
//! waiting if necessary until no other thread has exclusive, sharable or
- //! upgradable ownership of the mutex or abs_time is reached.
- //!Returns: If acquires exclusive ownership, returns true. Otherwise returns false.
+ //! upgradable ownership of the mutex or abs_time is reached.
+ //!Returns: If acquires exclusive ownership, returns true. Otherwise returns false.
//!Throws: interprocess_exception on error.
bool timed_lock(const boost::posix_time::ptime &abs_time);
- //!Precondition: The thread must have exclusive ownership of the mutex.
- //!Effects: The calling thread releases the exclusive ownership of the mutex.
+ //!Precondition: The thread must have exclusive ownership of the mutex.
+ //!Effects: The calling thread releases the exclusive ownership of the mutex.
//!Throws: An exception derived from interprocess_exception on error.
void unlock();
@@ -115,21 +115,21 @@ class named_upgradable_mutex
//!Effects: The calling thread tries to acquire sharable ownership of the mutex
//! without waiting. If no other thread has exclusive ownership
- //! of the mutex this succeeds.
+ //! of the mutex this succeeds.
//!Returns: If it can acquire sharable ownership immediately returns true. If it
- //! has to wait, returns false.
+ //! has to wait, returns false.
//!Throws: interprocess_exception on error.
bool try_lock_sharable();
//!Effects: The calling thread tries to acquire sharable ownership of the mutex
//! waiting if necessary until no other thread has exclusive
- //! ownership of the mutex or abs_time is reached.
- //!Returns: If acquires sharable ownership, returns true. Otherwise returns false.
+ //! ownership of the mutex or abs_time is reached.
+ //!Returns: If acquires sharable ownership, returns true. Otherwise returns false.
//!Throws: interprocess_exception on error.
bool timed_lock_sharable(const boost::posix_time::ptime &abs_time);
- //!Precondition: The thread must have sharable ownership of the mutex.
- //!Effects: The calling thread releases the sharable ownership of the mutex.
+ //!Precondition: The thread must have sharable ownership of the mutex.
+ //!Effects: The calling thread releases the sharable ownership of the mutex.
//!Throws: An exception derived from interprocess_exception on error.
void unlock_sharable();
@@ -143,7 +143,7 @@ class named_upgradable_mutex
//!Effects: The calling thread tries to acquire upgradable ownership of the mutex
//! without waiting. If no other thread has exclusive or upgradable ownership
- //! of the mutex this succeeds.
+ //! of the mutex this succeeds.
//!Returns: If it can acquire upgradable ownership immediately returns true.
//! If it has to wait, returns false.
//!Throws: interprocess_exception on error.
@@ -152,66 +152,66 @@ class named_upgradable_mutex
//!Effects: The calling thread tries to acquire upgradable ownership of the mutex
//! waiting if necessary until no other thread has exclusive or upgradable
//! ownership of the mutex or abs_time is reached.
- //!Returns: If acquires upgradable ownership, returns true. Otherwise returns false.
+ //!Returns: If acquires upgradable ownership, returns true. Otherwise returns false.
//!Throws: interprocess_exception on error.
bool timed_lock_upgradable(const boost::posix_time::ptime &abs_time);
- //!Precondition: The thread must have upgradable ownership of the mutex.
- //!Effects: The calling thread releases the upgradable ownership of the mutex.
+ //!Precondition: The thread must have upgradable ownership of the mutex.
+ //!Effects: The calling thread releases the upgradable ownership of the mutex.
//!Throws: An exception derived from interprocess_exception on error.
void unlock_upgradable();
//Demotions
- //!Precondition: The thread must have exclusive ownership of the mutex.
+ //!Precondition: The thread must have exclusive ownership of the mutex.
//!Effects: The thread atomically releases exclusive ownership and acquires
- //! upgradable ownership. This operation is non-blocking.
+ //! upgradable ownership. This operation is non-blocking.
//!Throws: An exception derived from interprocess_exception on error.
void unlock_and_lock_upgradable();
- //!Precondition: The thread must have exclusive ownership of the mutex.
+ //!Precondition: The thread must have exclusive ownership of the mutex.
//!Effects: The thread atomically releases exclusive ownership and acquires
- //! sharable ownership. This operation is non-blocking.
+ //! sharable ownership. This operation is non-blocking.
//!Throws: An exception derived from interprocess_exception on error.
void unlock_and_lock_sharable();
- //!Precondition: The thread must have upgradable ownership of the mutex.
+ //!Precondition: The thread must have upgradable ownership of the mutex.
//!Effects: The thread atomically releases upgradable ownership and acquires
- //! sharable ownership. This operation is non-blocking.
+ //! sharable ownership. This operation is non-blocking.
//!Throws: An exception derived from interprocess_exception on error.
void unlock_upgradable_and_lock_sharable();
//Promotions
- //!Precondition: The thread must have upgradable ownership of the mutex.
+ //!Precondition: The thread must have upgradable ownership of the mutex.
//!Effects: The thread atomically releases upgradable ownership and acquires
//! exclusive ownership. This operation will block until all threads with
- //! sharable ownership release it.
+ //! sharable ownership release it.
//!Throws: An exception derived from interprocess_exception on error.
void unlock_upgradable_and_lock();
- //!Precondition: The thread must have upgradable ownership of the mutex.
+ //!Precondition: The thread must have upgradable ownership of the mutex.
//!Effects: The thread atomically releases upgradable ownership and tries to
//! acquire exclusive ownership. This operation will fail if there are threads
- //! with sharable ownership, but it will maintain upgradable ownership.
+ //! with sharable ownership, but it will maintain upgradable ownership.
//!Returns: If acquires exclusive ownership, returns true. Otherwise returns false.
//!Throws: An exception derived from interprocess_exception on error.
bool try_unlock_upgradable_and_lock();
- //!Precondition: The thread must have upgradable ownership of the mutex.
+ //!Precondition: The thread must have upgradable ownership of the mutex.
//!Effects: The thread atomically releases upgradable ownership and tries to acquire
//! exclusive ownership, waiting if necessary until abs_time. This operation will
//! fail if there are threads with sharable ownership or timeout reaches, but it
- //! will maintain upgradable ownership.
- //!Returns: If acquires exclusive ownership, returns true. Otherwise returns false.
+ //! will maintain upgradable ownership.
+ //!Returns: If acquires exclusive ownership, returns true. Otherwise returns false.
//!Throws: An exception derived from interprocess_exception on error.
bool timed_unlock_upgradable_and_lock(const boost::posix_time::ptime &abs_time);
- //!Precondition: The thread must have sharable ownership of the mutex.
+ //!Precondition: The thread must have sharable ownership of the mutex.
//!Effects: The thread atomically releases sharable ownership and tries to acquire
//! exclusive ownership. This operation will fail if there are threads with sharable
//! or upgradable ownership, but it will maintain sharable ownership.
- //!Returns: If acquires exclusive ownership, returns true. Otherwise returns false.
+ //!Returns: If acquires exclusive ownership, returns true. Otherwise returns false.
//!Throws: An exception derived from interprocess_exception on error.
bool try_unlock_sharable_and_lock();
diff --git a/boost/interprocess/sync/spin/condition.hpp b/boost/interprocess/sync/spin/condition.hpp
index 5a37d9be2d..55dd79b406 100644
--- a/boost/interprocess/sync/spin/condition.hpp
+++ b/boost/interprocess/sync/spin/condition.hpp
@@ -110,7 +110,7 @@ inline spin_condition::spin_condition()
}
inline spin_condition::~spin_condition()
-{
+{
//Trivial destructor
}
@@ -126,15 +126,15 @@ inline void spin_condition::notify_all()
inline void spin_condition::notify(boost::uint32_t command)
{
- //This mutex guarantees that no other thread can enter to the
+ //This mutex guarantees that no other thread can enter to the
//do_timed_wait method logic, so that thread count will be
//constant until the function writes a NOTIFY_ALL command.
- //It also guarantees that no other notification can be signaled
+ //It also guarantees that no other notification can be signaled
//on this spin_condition before this one ends
m_enter_mut.lock();
//Return if there are no waiters
- if(!atomic_read32(&m_num_waiters)) {
+ if(!atomic_read32(&m_num_waiters)) {
m_enter_mut.unlock();
return;
}
@@ -167,18 +167,18 @@ inline bool spin_condition::do_timed_wait
template<class InterprocessMutex>
inline bool spin_condition::do_timed_wait(bool tout_enabled,
- const boost::posix_time::ptime &abs_time,
+ const boost::posix_time::ptime &abs_time,
InterprocessMutex &mut)
{
boost::posix_time::ptime now = microsec_clock::universal_time();
-
+
if(tout_enabled){
if(now >= abs_time) return false;
}
typedef boost::interprocess::scoped_lock<spin_mutex> InternalLock;
- //The enter mutex guarantees that while executing a notification,
- //no other thread can execute the do_timed_wait method.
+ //The enter mutex guarantees that while executing a notification,
+ //no other thread can execute the do_timed_wait method.
{
//---------------------------------------------------------------
InternalLock lock;
@@ -205,8 +205,8 @@ inline bool spin_condition::do_timed_wait(bool tout_enabled,
//By default, we suppose that no timeout has happened
bool timed_out = false, unlock_enter_mut= false;
-
- //Loop until a notification indicates that the thread should
+
+ //Loop until a notification indicates that the thread should
//exit or timeout occurs
while(1){
//The thread sleeps/spins until a spin_condition commands a notification
@@ -229,8 +229,8 @@ inline bool spin_condition::do_timed_wait(bool tout_enabled,
//There is an ongoing notification, we will try again later
continue;
}
- //No notification in execution, since enter mutex is locked.
- //We will execute time-out logic, so we will decrement count,
+ //No notification in execution, since enter mutex is locked.
+ //We will execute time-out logic, so we will decrement count,
//release the enter mutex and return false.
break;
}
@@ -253,7 +253,7 @@ inline bool spin_condition::do_timed_wait(bool tout_enabled,
continue;
}
else if(result == NOTIFY_ONE){
- //If it was a NOTIFY_ONE command, only this thread should
+ //If it was a NOTIFY_ONE command, only this thread should
//exit. This thread has atomically marked command as sleep before
//so no other thread will exit.
//Decrement wait count.
@@ -262,8 +262,8 @@ inline bool spin_condition::do_timed_wait(bool tout_enabled,
break;
}
else{
- //If it is a NOTIFY_ALL command, all threads should return
- //from do_timed_wait function. Decrement wait count.
+ //If it is a NOTIFY_ALL command, all threads should return
+ //from do_timed_wait function. Decrement wait count.
unlock_enter_mut = 1 == atomic_dec32(const_cast<boost::uint32_t*>(&m_num_waiters));
//Check if this is the last thread of notify_all waiters
//Only the last thread will release the mutex
@@ -275,7 +275,7 @@ inline bool spin_condition::do_timed_wait(bool tout_enabled,
}
}
- //Unlock the enter mutex if it is a single notification, if this is
+ //Unlock the enter mutex if it is a single notification, if this is
//the last notified thread in a notify_all or a timeout has occurred
if(unlock_enter_mut){
m_enter_mut.unlock();
diff --git a/boost/interprocess/sync/spin/mutex.hpp b/boost/interprocess/sync/spin/mutex.hpp
index ef0b47d95a..926f7237c0 100644
--- a/boost/interprocess/sync/spin/mutex.hpp
+++ b/boost/interprocess/sync/spin/mutex.hpp
@@ -45,15 +45,15 @@ class spin_mutex
volatile boost::uint32_t m_s;
};
-inline spin_mutex::spin_mutex()
- : m_s(0)
+inline spin_mutex::spin_mutex()
+ : m_s(0)
{
//Note that this class is initialized to zero.
//So zeroed memory can be interpreted as an
//initialized mutex
}
-inline spin_mutex::~spin_mutex()
+inline spin_mutex::~spin_mutex()
{
//Trivial destructor
}
@@ -73,7 +73,7 @@ inline void spin_mutex::lock(void)
inline bool spin_mutex::try_lock(void)
{
- boost::uint32_t prev_s = ipcdetail::atomic_cas32(const_cast<boost::uint32_t*>(&m_s), 1, 0);
+ boost::uint32_t prev_s = ipcdetail::atomic_cas32(const_cast<boost::uint32_t*>(&m_s), 1, 0);
return m_s == 1 && prev_s == 0;
}
diff --git a/boost/interprocess/sync/spin/recursive_mutex.hpp b/boost/interprocess/sync/spin/recursive_mutex.hpp
index 05ad65eac0..a763f9c72d 100644
--- a/boost/interprocess/sync/spin/recursive_mutex.hpp
+++ b/boost/interprocess/sync/spin/recursive_mutex.hpp
@@ -68,7 +68,7 @@ class spin_recursive_mutex
volatile boost::uint32_t m_s;
};
-inline spin_recursive_mutex::spin_recursive_mutex()
+inline spin_recursive_mutex::spin_recursive_mutex()
: m_nLockCount(0), m_nOwner(ipcdetail::get_invalid_systemwide_thread_id()){}
inline spin_recursive_mutex::~spin_recursive_mutex(){}
@@ -83,7 +83,7 @@ inline void spin_recursive_mutex::lock()
if((unsigned int)(m_nLockCount+1) == 0){
//Overflow, throw an exception
throw interprocess_exception("boost::interprocess::spin_recursive_mutex recursive lock overflow");
- }
+ }
++m_nLockCount;
}
else{
@@ -103,7 +103,7 @@ inline bool spin_recursive_mutex::try_lock()
if((unsigned int)(m_nLockCount+1) == 0){
//Overflow, throw an exception
throw interprocess_exception("boost::interprocess::spin_recursive_mutex recursive lock overflow");
- }
+ }
++m_nLockCount;
return true;
}
@@ -129,7 +129,7 @@ inline bool spin_recursive_mutex::timed_lock(const boost::posix_time::ptime &abs
if((unsigned int)(m_nLockCount+1) == 0){
//Overflow, throw an exception
throw interprocess_exception("boost::interprocess::spin_recursive_mutex recursive lock overflow");
- }
+ }
++m_nLockCount;
return true;
}
diff --git a/boost/interprocess/sync/upgradable_lock.hpp b/boost/interprocess/sync/upgradable_lock.hpp
index 93c2ed6bc4..fb86374ca1 100644
--- a/boost/interprocess/sync/upgradable_lock.hpp
+++ b/boost/interprocess/sync/upgradable_lock.hpp
@@ -85,7 +85,7 @@ class upgradable_lock
: mp_mutex(&m), m_locked(true)
{}
- //!Effects: m.try_lock_upgradable().
+ //!Effects: m.try_lock_upgradable().
//!Postconditions: mutex() == &m. owns() == the return value of the
//! m.try_lock_upgradable() executed within the constructor.
//!Notes: The constructor will take upgradable-ownership of the mutex
@@ -97,7 +97,7 @@ class upgradable_lock
: mp_mutex(&m), m_locked(false)
{ m_locked = mp_mutex->try_lock_upgradable(); }
- //!Effects: m.timed_lock_upgradable(abs_time)
+ //!Effects: m.timed_lock_upgradable(abs_time)
//!Postconditions: mutex() == &m. owns() == the return value of the
//! m.timed_lock_upgradable() executed within the constructor.
//!Notes: The constructor will take upgradable-ownership of the mutex if it
@@ -123,7 +123,7 @@ class upgradable_lock
: mp_mutex(0), m_locked(upgr.owns())
{ mp_mutex = upgr.release(); }
- //!Effects: If scop.owns(), m_.unlock_and_lock_upgradable().
+ //!Effects: If scop.owns(), m_.unlock_and_lock_upgradable().
//!Postconditions: mutex() == the value scop.mutex() had before the construction.
//! scop.mutex() == 0. owns() == scop.owns() before the constructor. After the
//! construction, scop.owns() == false.
@@ -146,12 +146,12 @@ class upgradable_lock
}
//!Effects: If shar.owns() then calls try_unlock_sharable_and_lock_upgradable()
- //! on the referenced mutex.
+ //! on the referenced mutex.
//! a)if try_unlock_sharable_and_lock_upgradable() returns true then mutex()
- //! obtains the value from shar.release() and owns() is set to true.
+ //! obtains the value from shar.release() and owns() is set to true.
//! b)if try_unlock_sharable_and_lock_upgradable() returns false then shar is
//! unaffected and this upgradable_lock construction has the same
- //! effects as a default construction.
+ //! effects as a default construction.
//! c)Else shar.owns() is false. mutex() obtains the value from shar.release()
//! and owns() is set to false.
//!Notes: This construction will not block. It will try to obtain mutex
@@ -207,7 +207,7 @@ class upgradable_lock
//!Notes: The sharable_lock changes from a state of not owning the mutex,
//! to owning the mutex, blocking if necessary.
void lock()
- {
+ {
if(!mp_mutex || m_locked)
throw lock_exception();
mp_mutex->lock_upgradable();
@@ -223,7 +223,7 @@ class upgradable_lock
//! mutex_type does not support try_lock_upgradable(), this function will
//! fail at compile time if instantiated, but otherwise have no effect.
bool try_lock()
- {
+ {
if(!mp_mutex || m_locked)
throw lock_exception();
m_locked = mp_mutex->try_lock_upgradable();
@@ -240,7 +240,7 @@ class upgradable_lock
//! timed_lock_upgradable(abs_time), this function will fail at compile
//! time if instantiated, but otherwise have no effect.
bool timed_lock(const boost::posix_time::ptime& abs_time)
- {
+ {
if(!mp_mutex || m_locked)
throw lock_exception();
m_locked = mp_mutex->timed_lock_upgradable(abs_time);
@@ -286,7 +286,7 @@ class upgradable_lock
return mut;
}
- //!Effects: Swaps state with moved lock.
+ //!Effects: Swaps state with moved lock.
//!Throws: Nothing.
void swap(upgradable_lock<mutex_type> &other)
{
diff --git a/boost/interprocess/sync/windows/condition.hpp b/boost/interprocess/sync/windows/condition.hpp
index 167b8730c3..9695c21044 100644
--- a/boost/interprocess/sync/windows/condition.hpp
+++ b/boost/interprocess/sync/windows/condition.hpp
@@ -20,133 +20,8 @@
#include <boost/interprocess/exceptions.hpp>
#include <boost/interprocess/sync/windows/semaphore.hpp>
#include <boost/interprocess/sync/windows/mutex.hpp>
-#include <boost/cstdint.hpp>
-#include <limits>
-
-////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////
-//
-// Condition variable algorithm taken from pthreads-win32 discussion.
-//
-// The algorithm was developed by Alexander Terekhov in colaboration with
-// Louis Thomas.
-//
-// Algorithm 8a / IMPL_SEM,UNBLOCK_STRATEGY == UNBLOCK_ALL
-//
-// semBlockLock - bin.semaphore
-// semBlockQueue - semaphore
-// mtxExternal - mutex or CS
-// mtxUnblockLock - mutex or CS
-// nWaitersGone - int
-// nWaitersBlocked - int
-// nWaitersToUnblock - int
-//
-// wait( timeout ) {
-//
-// [auto: register int result ] // error checking omitted
-// [auto: register int nSignalsWasLeft ]
-// [auto: register int nWaitersWasGone ]
-//
-// sem_wait( semBlockLock );
-// nWaitersBlocked++;
-// sem_post( semBlockLock );
-//
-// unlock( mtxExternal );
-// bTimedOut = sem_wait( semBlockQueue,timeout );
-//
-// lock( mtxUnblockLock );
-// if ( 0 != (nSignalsWasLeft = nWaitersToUnblock) ) {
-// if ( bTimedOut ) { // timeout (or canceled)
-// if ( 0 != nWaitersBlocked ) {
-// nWaitersBlocked--;
-// }
-// else {
-// nWaitersGone++; // count spurious wakeups.
-// }
-// }
-// if ( 0 == --nWaitersToUnblock ) {
-// if ( 0 != nWaitersBlocked ) {
-// sem_post( semBlockLock ); // open the gate.
-// nSignalsWasLeft = 0; // do not open the gate
-// // below again.
-// }
-// else if ( 0 != (nWaitersWasGone = nWaitersGone) ) {
-// nWaitersGone = 0;
-// }
-// }
-// }
-// else if ( INT_MAX/2 == ++nWaitersGone ) { // timeout/canceled or
-// // spurious semaphore :-)
-// sem_wait( semBlockLock );
-// nWaitersBlocked -= nWaitersGone; // something is going on here
-// // - test of timeouts? :-)
-// sem_post( semBlockLock );
-// nWaitersGone = 0;
-// }
-// unlock( mtxUnblockLock );
-//
-// if ( 1 == nSignalsWasLeft ) {
-// if ( 0 != nWaitersWasGone ) {
-// // sem_adjust( semBlockQueue,-nWaitersWasGone );
-// while ( nWaitersWasGone-- ) {
-// sem_wait( semBlockQueue ); // better now than spurious later
-// }
-// } sem_post( semBlockLock ); // open the gate
-// }
-//
-// lock( mtxExternal );
-//
-// return ( bTimedOut ) ? ETIMEOUT : 0;
-// }
-//
-// signal(bAll) {
-//
-// [auto: register int result ]
-// [auto: register int nSignalsToIssue]
-//
-// lock( mtxUnblockLock );
-//
-// if ( 0 != nWaitersToUnblock ) { // the gate is closed!!!
-// if ( 0 == nWaitersBlocked ) { // NO-OP
-// return unlock( mtxUnblockLock );
-// }
-// if (bAll) {
-// nWaitersToUnblock += nSignalsToIssue=nWaitersBlocked;
-// nWaitersBlocked = 0;
-// }
-// else {
-// nSignalsToIssue = 1;
-// nWaitersToUnblock++;
-// nWaitersBlocked--;
-// }
-// }
-// else if ( nWaitersBlocked > nWaitersGone ) { // HARMLESS RACE CONDITION!
-// sem_wait( semBlockLock ); // close the gate
-// if ( 0 != nWaitersGone ) {
-// nWaitersBlocked -= nWaitersGone;
-// nWaitersGone = 0;
-// }
-// if (bAll) {
-// nSignalsToIssue = nWaitersToUnblock = nWaitersBlocked;
-// nWaitersBlocked = 0;
-// }
-// else {
-// nSignalsToIssue = nWaitersToUnblock = 1;
-// nWaitersBlocked--;
-// }
-// }
-// else { // NO-OP
-// return unlock( mtxUnblockLock );
-// }
-//
-// unlock( mtxUnblockLock );
-// sem_post( semBlockQueue,nSignalsToIssue );
-// return result;
-// }
-////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////
+#include <boost/interprocess/sync/detail/condition_algorithm_8a.hpp>
+
namespace boost {
namespace interprocess {
@@ -156,6 +31,7 @@ class windows_condition
{
windows_condition(const windows_condition &);
windows_condition &operator=(const windows_condition &);
+
public:
windows_condition();
~windows_condition();
@@ -217,162 +93,71 @@ class windows_condition
private:
- template<class InterprocessMutex>
- bool do_timed_wait(bool timeout_enabled, const boost::posix_time::ptime &abs_time, InterprocessMutex &mut);
- void do_signal (bool broadcast);
-
- boost::int32_t m_nwaiters_blocked;
- boost::int32_t m_nwaiters_gone;
- boost::int32_t m_nwaiters_to_unblock;
- windows_semaphore m_sem_block_queue;
- windows_semaphore m_sem_block_lock;
- windows_mutex m_mtx_unblock_lock;
+ struct condition_data
+ {
+ typedef boost::int32_t integer_type;
+ typedef windows_semaphore semaphore_type;
+ typedef windows_mutex mutex_type;
+
+ condition_data()
+ : m_nwaiters_blocked(0)
+ , m_nwaiters_gone(0)
+ , m_nwaiters_to_unblock(0)
+ , m_sem_block_queue(0)
+ , m_sem_block_lock(1)
+ , m_mtx_unblock_lock()
+ {}
+
+ integer_type &get_nwaiters_blocked()
+ { return m_nwaiters_blocked; }
+
+ integer_type &get_nwaiters_gone()
+ { return m_nwaiters_gone; }
+
+ integer_type &get_nwaiters_to_unblock()
+ { return m_nwaiters_to_unblock; }
+
+ semaphore_type &get_sem_block_queue()
+ { return m_sem_block_queue; }
+
+ semaphore_type &get_sem_block_lock()
+ { return m_sem_block_lock; }
+
+ mutex_type &get_mtx_unblock_lock()
+ { return m_mtx_unblock_lock; }
+
+ boost::int32_t m_nwaiters_blocked;
+ boost::int32_t m_nwaiters_gone;
+ boost::int32_t m_nwaiters_to_unblock;
+ windows_semaphore m_sem_block_queue;
+ windows_semaphore m_sem_block_lock;
+ windows_mutex m_mtx_unblock_lock;
+ } m_condition_data;
+
+ typedef condition_algorithm_8a<condition_data> algorithm_type;
};
inline windows_condition::windows_condition()
- : m_nwaiters_blocked(0)
- , m_nwaiters_gone(0)
- , m_nwaiters_to_unblock(0)
- , m_sem_block_queue(0)
- , m_sem_block_lock(1)
- , m_mtx_unblock_lock()
+ : m_condition_data()
{}
inline windows_condition::~windows_condition()
{}
inline void windows_condition::notify_one()
-{ this->do_signal(false); }
+{ algorithm_type::signal(m_condition_data, false); }
inline void windows_condition::notify_all()
-{ this->do_signal(true); }
-
-inline void windows_condition::do_signal(bool broadcast)
-{
- boost::int32_t nsignals_to_issue;
-
- {
- scoped_lock<windows_mutex> locker(m_mtx_unblock_lock);
-
- if ( 0 != m_nwaiters_to_unblock ) { // the gate is closed!!!
- if ( 0 == m_nwaiters_blocked ) { // NO-OP
- //locker's destructor triggers m_mtx_unblock_lock.unlock()
- return;
- }
- if (broadcast) {
- m_nwaiters_to_unblock += nsignals_to_issue = m_nwaiters_blocked;
- m_nwaiters_blocked = 0;
- }
- else {
- nsignals_to_issue = 1;
- m_nwaiters_to_unblock++;
- m_nwaiters_blocked--;
- }
- }
- else if ( m_nwaiters_blocked > m_nwaiters_gone ) { // HARMLESS RACE CONDITION!
- m_sem_block_lock.wait(); // close the gate
- if ( 0 != m_nwaiters_gone ) {
- m_nwaiters_blocked -= m_nwaiters_gone;
- m_nwaiters_gone = 0;
- }
- if (broadcast) {
- nsignals_to_issue = m_nwaiters_to_unblock = m_nwaiters_blocked;
- m_nwaiters_blocked = 0;
- }
- else {
- nsignals_to_issue = m_nwaiters_to_unblock = 1;
- m_nwaiters_blocked--;
- }
- }
- else { // NO-OP
- //locker's destructor triggers m_mtx_unblock_lock.unlock()
- return;
- }
- //locker's destructor triggers m_mtx_unblock_lock.unlock()
- }
- m_sem_block_queue.post(nsignals_to_issue);
-}
+{ algorithm_type::signal(m_condition_data, true); }
template<class InterprocessMutex>
inline void windows_condition::do_wait(InterprocessMutex &mut)
-{ this->do_timed_wait(false, boost::posix_time::ptime(), mut); }
+{ algorithm_type::wait(m_condition_data, false, boost::posix_time::ptime(), mut); }
template<class InterprocessMutex>
inline bool windows_condition::do_timed_wait
(const boost::posix_time::ptime &abs_time, InterprocessMutex &mut)
-{ return this->do_timed_wait(true, abs_time, mut); }
-
-template<class InterprocessMutex>
-inline bool windows_condition::do_timed_wait
- (bool tout_enabled, const boost::posix_time::ptime &abs_time, InterprocessMutex &mtxExternal)
-{
- //Initialize to avoid warnings
- boost::int32_t nsignals_was_left = 0;
- boost::int32_t nwaiters_was_gone = 0;
-
- m_sem_block_lock.wait();
- ++m_nwaiters_blocked;
- m_sem_block_lock.post();
-
- struct scoped_unlock
- {
- InterprocessMutex & mut;
- scoped_unlock(InterprocessMutex & m)
- : mut(m)
- { m.unlock(); }
-
- ~scoped_unlock()
- { mut.lock(); }
- } unlocker(mtxExternal);
-
-
- bool bTimedOut = tout_enabled ? !m_sem_block_queue.timed_wait(abs_time) : (m_sem_block_queue.wait(), false);
-
- {
- scoped_lock<windows_mutex> locker(m_mtx_unblock_lock);
- if ( 0 != (nsignals_was_left = m_nwaiters_to_unblock) ) {
- if ( bTimedOut ) { // timeout (or canceled)
- if ( 0 != m_nwaiters_blocked ) {
- m_nwaiters_blocked--;
- }
- else {
- m_nwaiters_gone++; // count spurious wakeups.
- }
- }
- if ( 0 == --m_nwaiters_to_unblock ) {
- if ( 0 != m_nwaiters_blocked ) {
- m_sem_block_lock.post(); // open the gate.
- nsignals_was_left = 0; // do not open the gate below again.
- }
- else if ( 0 != (nwaiters_was_gone = m_nwaiters_gone) ) {
- m_nwaiters_gone = 0;
- }
- }
- }
- else if ( (std::numeric_limits<boost::int32_t>::max)()/2
- == ++m_nwaiters_gone ) { // timeout/canceled or spurious semaphore :-)
- m_sem_block_lock.wait();
- m_nwaiters_blocked -= m_nwaiters_gone; // something is going on here - test of timeouts? :-)
- m_sem_block_lock.post();
- m_nwaiters_gone = 0;
- }
- //locker's destructor triggers m_mtx_unblock_lock.unlock()
- }
-
- if ( 1 == nsignals_was_left ) {
- if ( 0 != nwaiters_was_gone ) {
- // sem_adjust( m_sem_block_queue,-nwaiters_was_gone );
- while ( nwaiters_was_gone-- ) {
- m_sem_block_queue.wait(); // better now than spurious later
- }
- }
- m_sem_block_lock.post(); // open the gate
- }
-
- //mtxExternal.lock(); called from unlocker
-
- return ( bTimedOut ) ? false : true;
-}
+{ return algorithm_type::wait(m_condition_data, true, abs_time, mut); }
} //namespace ipcdetail
} //namespace interprocess
diff --git a/boost/interprocess/sync/windows/mutex.hpp b/boost/interprocess/sync/windows/mutex.hpp
index 5eca522339..477acd396a 100644
--- a/boost/interprocess/sync/windows/mutex.hpp
+++ b/boost/interprocess/sync/windows/mutex.hpp
@@ -19,8 +19,9 @@
#include <boost/interprocess/detail/workaround.hpp>
#include <boost/interprocess/detail/posix_time_types_wrk.hpp>
#include <boost/interprocess/detail/win32_api.hpp>
-#include <boost/interprocess/detail/intermodule_singleton.hpp>
+#include <boost/interprocess/detail/windows_intermodule_singleton.hpp>
#include <boost/interprocess/sync/windows/sync_utils.hpp>
+#include <boost/interprocess/sync/windows/winapi_mutex_wrapper.hpp>
#include <boost/interprocess/exceptions.hpp>
@@ -47,85 +48,61 @@ class windows_mutex
const sync_id id_;
};
-inline windows_mutex::windows_mutex()
- : id_()
+inline windows_mutex::windows_mutex()
+ : id_(this)
{
sync_handles &handles =
- intermodule_singleton<sync_handles>::get();
+ windows_intermodule_singleton<sync_handles>::get();
//Create mutex with the initial count
bool open_or_created;
- handles.obtain_mutex(this->id_, &open_or_created);
+ (void)handles.obtain_mutex(this->id_, &open_or_created);
//The mutex must be created, never opened
assert(open_or_created);
assert(open_or_created && winapi::get_last_error() != winapi::error_already_exists);
(void)open_or_created;
}
-inline windows_mutex::~windows_mutex()
+inline windows_mutex::~windows_mutex()
{
sync_handles &handles =
- intermodule_singleton<sync_handles>::get();
+ windows_intermodule_singleton<sync_handles>::get();
handles.destroy_handle(this->id_);
}
inline void windows_mutex::lock(void)
{
sync_handles &handles =
- intermodule_singleton<sync_handles>::get();
+ windows_intermodule_singleton<sync_handles>::get();
//This can throw
- void *hnd = handles.obtain_mutex(this->id_);
- unsigned long ret = winapi::wait_for_single_object(hnd, winapi::infinite_time);
- if(ret == winapi::wait_failed){
- error_info err(winapi::get_last_error());
- throw interprocess_exception(err);
- }
+ winapi_mutex_functions mut(handles.obtain_mutex(this->id_));
+ mut.lock();
}
inline bool windows_mutex::try_lock(void)
{
sync_handles &handles =
- intermodule_singleton<sync_handles>::get();
+ windows_intermodule_singleton<sync_handles>::get();
//This can throw
- void *hnd = handles.obtain_mutex(this->id_);
- unsigned long ret = winapi::wait_for_single_object(hnd, 0);
- if(ret == winapi::wait_failed){
- error_info err(winapi::get_last_error());
- throw interprocess_exception(err);
- }
- return ret != winapi::wait_timeout;
+ winapi_mutex_functions mut(handles.obtain_mutex(this->id_));
+ return mut.try_lock();
}
inline bool windows_mutex::timed_lock(const boost::posix_time::ptime &abs_time)
{
- if(abs_time == boost::posix_time::pos_infin){
- this->lock();
- return true;
- }
- boost::posix_time::ptime now
- = boost::posix_time::microsec_clock::universal_time();
-
- unsigned long ms = (unsigned long)(abs_time-now).total_milliseconds();
sync_handles &handles =
- intermodule_singleton<sync_handles>::get();
+ windows_intermodule_singleton<sync_handles>::get();
//This can throw
- void *hnd = handles.obtain_mutex(this->id_);
- unsigned long ret = winapi::wait_for_single_object(hnd, ms);
- if(ret == winapi::wait_failed){
- error_info err(winapi::get_last_error());
- throw interprocess_exception(err);
- }
- return ret != winapi::wait_timeout;
+ winapi_mutex_functions mut(handles.obtain_mutex(this->id_));
+ return mut.timed_lock(abs_time);
}
inline void windows_mutex::unlock(void)
{
sync_handles &handles =
- intermodule_singleton<sync_handles>::get();
+ windows_intermodule_singleton<sync_handles>::get();
//This can throw
- void *hnd = handles.obtain_mutex(this->id_);
- int ret = winapi::release_mutex(hnd);
- (void)ret;
- assert(ret);
+ winapi_mutex_functions mut(handles.obtain_mutex(this->id_));
+ return mut.unlock();
}
} //namespace ipcdetail {
diff --git a/boost/interprocess/sync/windows/named_condition.hpp b/boost/interprocess/sync/windows/named_condition.hpp
new file mode 100644
index 0000000000..403e826178
--- /dev/null
+++ b/boost/interprocess/sync/windows/named_condition.hpp
@@ -0,0 +1,334 @@
+ //////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2011-2012. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/interprocess for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTERPROCESS_WINDOWS_NAMED_CONDITION_HPP
+#define BOOST_INTERPROCESS_WINDOWS_NAMED_CONDITION_HPP
+
+#if (defined _MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <boost/interprocess/detail/config_begin.hpp>
+#include <boost/interprocess/detail/workaround.hpp>
+#include <boost/interprocess/creation_tags.hpp>
+#include <boost/interprocess/permissions.hpp>
+#include <boost/interprocess/detail/interprocess_tester.hpp>
+#include <boost/interprocess/detail/posix_time_types_wrk.hpp>
+#include <boost/interprocess/sync/windows/named_sync.hpp>
+#include <boost/interprocess/sync/windows/winapi_semaphore_wrapper.hpp>
+#include <boost/interprocess/sync/detail/condition_algorithm_8a.hpp>
+
+namespace boost {
+namespace interprocess {
+namespace ipcdetail {
+
+class windows_named_condition
+{
+ /// @cond
+
+ //Non-copyable
+ windows_named_condition();
+ windows_named_condition(const windows_named_condition &);
+ windows_named_condition &operator=(const windows_named_condition &);
+ /// @endcond
+
+ public:
+ windows_named_condition(create_only_t, const char *name, const permissions &perm = permissions());
+
+ windows_named_condition(open_or_create_t, const char *name, const permissions &perm = permissions());
+
+ windows_named_condition(open_only_t, const char *name);
+
+ ~windows_named_condition();
+
+ //!If there is a thread waiting on *this, change that
+ //!thread's state to ready. Otherwise there is no effect.*/
+ void notify_one();
+
+ //!Change the state of all threads waiting on *this to ready.
+ //!If there are no waiting threads, notify_all() has no effect.
+ void notify_all();
+
+ //!Releases the lock on the named_mutex object associated with lock, blocks
+ //!the current thread of execution until readied by a call to
+ //!this->notify_one() or this->notify_all(), and then reacquires the lock.
+ template <typename L>
+ void wait(L& lock);
+
+ //!The same as:
+ //!while (!pred()) wait(lock)
+ template <typename L, typename Pr>
+ void wait(L& lock, Pr pred);
+
+ //!Releases the lock on the named_mutex object associated with lock, blocks
+ //!the current thread of execution until readied by a call to
+ //!this->notify_one() or this->notify_all(), or until time abs_time is reached,
+ //!and then reacquires the lock.
+ //!Returns: false if time abs_time is reached, otherwise true.
+ template <typename L>
+ bool timed_wait(L& lock, const boost::posix_time::ptime &abs_time);
+
+ //!The same as: while (!pred()) {
+ //! if (!timed_wait(lock, abs_time)) return pred();
+ //! } return true;
+ template <typename L, typename Pr>
+ bool timed_wait(L& lock, const boost::posix_time::ptime &abs_time, Pr pred);
+
+ static bool remove(const char *name);
+
+ /// @cond
+ private:
+ friend class interprocess_tester;
+ void dont_close_on_destruction();
+
+ template <class InterprocessMutex>
+ void do_wait(InterprocessMutex& lock);
+
+ template <class InterprocessMutex>
+ bool do_timed_wait(const boost::posix_time::ptime &abs_time, InterprocessMutex& lock);
+
+ struct condition_data
+ {
+ typedef boost::int32_t integer_type;
+ typedef winapi_semaphore_wrapper semaphore_type;
+ typedef winapi_mutex_wrapper mutex_type;
+
+ integer_type &get_nwaiters_blocked()
+ { return m_nwaiters_blocked; }
+
+ integer_type &get_nwaiters_gone()
+ { return m_nwaiters_gone; }
+
+ integer_type &get_nwaiters_to_unblock()
+ { return m_nwaiters_to_unblock; }
+
+ semaphore_type &get_sem_block_queue()
+ { return m_sem_block_queue; }
+
+ semaphore_type &get_sem_block_lock()
+ { return m_sem_block_lock; }
+
+ mutex_type &get_mtx_unblock_lock()
+ { return m_mtx_unblock_lock; }
+
+ integer_type m_nwaiters_blocked;
+ integer_type m_nwaiters_gone;
+ integer_type m_nwaiters_to_unblock;
+ winapi_semaphore_wrapper m_sem_block_queue;
+ winapi_semaphore_wrapper m_sem_block_lock;
+ winapi_mutex_wrapper m_mtx_unblock_lock;
+ } m_condition_data;
+
+ typedef condition_algorithm_8a<condition_data> algorithm_type;
+
+ class named_cond_callbacks : public windows_named_sync_interface
+ {
+ typedef __int64 sem_count_t;
+ mutable sem_count_t sem_counts [2];
+
+ public:
+ named_cond_callbacks(condition_data &cond_data)
+ : m_condition_data(cond_data)
+ {}
+
+ virtual std::size_t get_data_size() const
+ { return sizeof(sem_counts); }
+
+ virtual const void *buffer_with_final_data_to_file()
+ {
+ sem_counts[0] = m_condition_data.m_sem_block_queue.value();
+ sem_counts[1] = m_condition_data.m_sem_block_lock.value();
+ return &sem_counts;
+ }
+
+ virtual const void *buffer_with_init_data_to_file()
+ {
+ sem_counts[0] = 0;
+ sem_counts[1] = 1;
+ return &sem_counts;
+ }
+
+ virtual void *buffer_to_store_init_data_from_file()
+ { return &sem_counts; }
+
+ virtual bool open(create_enum_t, const char *id_name)
+ {
+ m_condition_data.m_nwaiters_blocked = 0;
+ m_condition_data.m_nwaiters_gone = 0;
+ m_condition_data.m_nwaiters_to_unblock = 0;
+
+ //Now open semaphores and mutex.
+ //Use local variables + swap to guarantee consistent
+ //initialization and cleanup in case any opening fails
+ permissions perm;
+ perm.set_unrestricted();
+ std::string aux_str = "Global\\bipc.cond.";
+ aux_str += id_name;
+ std::size_t pos = aux_str.size();
+
+ //sem_block_queue
+ aux_str += "_bq";
+ winapi_semaphore_wrapper sem_block_queue;
+ bool created;
+ if(!sem_block_queue.open_or_create
+ (aux_str.c_str(), sem_counts[0], winapi_semaphore_wrapper::MaxCount, perm, created))
+ return false;
+ aux_str.erase(pos);
+
+ //sem_block_lock
+ aux_str += "_bl";
+ winapi_semaphore_wrapper sem_block_lock;
+ if(!sem_block_lock.open_or_create
+ (aux_str.c_str(), sem_counts[1], winapi_semaphore_wrapper::MaxCount, perm, created))
+ return false;
+ aux_str.erase(pos);
+
+ //mtx_unblock_lock
+ aux_str += "_ul";
+ winapi_mutex_wrapper mtx_unblock_lock;
+ if(!mtx_unblock_lock.open_or_create(aux_str.c_str(), perm))
+ return false;
+
+ //All ok, commit data
+ m_condition_data.m_sem_block_queue.swap(sem_block_queue);
+ m_condition_data.m_sem_block_lock.swap(sem_block_lock);
+ m_condition_data.m_mtx_unblock_lock.swap(mtx_unblock_lock);
+ return true;
+ }
+
+ virtual void close()
+ {
+ m_condition_data.m_sem_block_queue.close();
+ m_condition_data.m_sem_block_lock.close();
+ m_condition_data.m_mtx_unblock_lock.close();
+ m_condition_data.m_nwaiters_blocked = 0;
+ m_condition_data.m_nwaiters_gone = 0;
+ m_condition_data.m_nwaiters_to_unblock = 0;
+ }
+
+ virtual ~named_cond_callbacks()
+ {}
+
+ private:
+ condition_data &m_condition_data;
+ };
+
+ windows_named_sync m_named_sync;
+ /// @endcond
+};
+
+inline windows_named_condition::~windows_named_condition()
+{
+ named_cond_callbacks callbacks(m_condition_data);
+ m_named_sync.close(callbacks);
+}
+
+inline void windows_named_condition::dont_close_on_destruction()
+{}
+
+inline windows_named_condition::windows_named_condition
+ (create_only_t, const char *name, const permissions &perm)
+ : m_condition_data()
+{
+ named_cond_callbacks callbacks(m_condition_data);
+ m_named_sync.open_or_create(DoCreate, name, perm, callbacks);
+}
+
+inline windows_named_condition::windows_named_condition
+ (open_or_create_t, const char *name, const permissions &perm)
+ : m_condition_data()
+{
+ named_cond_callbacks callbacks(m_condition_data);
+ m_named_sync.open_or_create(DoOpenOrCreate, name, perm, callbacks);
+}
+
+inline windows_named_condition::windows_named_condition(open_only_t, const char *name)
+ : m_condition_data()
+{
+ named_cond_callbacks callbacks(m_condition_data);
+ m_named_sync.open_or_create(DoOpen, name, permissions(), callbacks);
+}
+
+inline void windows_named_condition::notify_one()
+{ algorithm_type::signal(m_condition_data, false); }
+
+inline void windows_named_condition::notify_all()
+{ algorithm_type::signal(m_condition_data, true); }
+
+template<class InterprocessMutex>
+inline void windows_named_condition::do_wait(InterprocessMutex &mut)
+{ algorithm_type::wait(m_condition_data, false, boost::posix_time::ptime(), mut); }
+
+template<class InterprocessMutex>
+inline bool windows_named_condition::do_timed_wait
+ (const boost::posix_time::ptime &abs_time, InterprocessMutex &mut)
+{ return algorithm_type::wait(m_condition_data, true, abs_time, mut); }
+
+template <typename L>
+inline void windows_named_condition::wait(L& lock)
+{
+ if (!lock)
+ throw lock_exception();
+ this->do_wait(*lock.mutex());
+}
+
+template <typename L, typename Pr>
+inline void windows_named_condition::wait(L& lock, Pr pred)
+{
+ if (!lock)
+ throw lock_exception();
+ while (!pred())
+ this->do_wait(*lock.mutex());
+}
+
+template <typename L>
+inline bool windows_named_condition::timed_wait
+ (L& lock, const boost::posix_time::ptime &abs_time)
+{
+ if(abs_time == boost::posix_time::pos_infin){
+ this->wait(lock);
+ return true;
+ }
+ if (!lock)
+ throw lock_exception();
+ return this->do_timed_wait(abs_time, *lock.mutex());
+}
+
+template <typename L, typename Pr>
+inline bool windows_named_condition::timed_wait
+ (L& lock, const boost::posix_time::ptime &abs_time, Pr pred)
+{
+ if(abs_time == boost::posix_time::pos_infin){
+ this->wait(lock, pred);
+ return true;
+ }
+ if (!lock)
+ throw lock_exception();
+
+ while (!pred()){
+ if(!this->do_timed_wait(abs_time, *lock.mutex())){
+ return pred();
+ }
+ }
+ return true;
+}
+
+inline bool windows_named_condition::remove(const char *name)
+{
+ return windows_named_sync::remove(name);
+}
+
+} //namespace ipcdetail {
+} //namespace interprocess {
+} //namespace boost {
+
+#include <boost/interprocess/detail/config_end.hpp>
+
+#endif //BOOST_INTERPROCESS_WINDOWS_NAMED_CONDITION_HPP
diff --git a/boost/interprocess/sync/windows/named_mutex.hpp b/boost/interprocess/sync/windows/named_mutex.hpp
new file mode 100644
index 0000000000..8ea6b3e1e4
--- /dev/null
+++ b/boost/interprocess/sync/windows/named_mutex.hpp
@@ -0,0 +1,175 @@
+ //////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2011-2012. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/interprocess for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+#ifndef BOOST_INTERPROCESS_WINDOWS_NAMED_MUTEX_HPP
+#define BOOST_INTERPROCESS_WINDOWS_NAMED_MUTEX_HPP
+
+#if (defined _MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <boost/interprocess/detail/config_begin.hpp>
+#include <boost/interprocess/detail/workaround.hpp>
+#include <boost/interprocess/creation_tags.hpp>
+#include <boost/interprocess/permissions.hpp>
+#include <boost/interprocess/detail/interprocess_tester.hpp>
+#include <boost/interprocess/detail/posix_time_types_wrk.hpp>
+#include <boost/interprocess/sync/windows/sync_utils.hpp>
+#include <boost/interprocess/sync/windows/named_sync.hpp>
+#include <boost/interprocess/sync/windows/winapi_mutex_wrapper.hpp>
+#include <boost/interprocess/errors.hpp>
+#include <boost/interprocess/exceptions.hpp>
+#include <limits>
+
+namespace boost {
+namespace interprocess {
+namespace ipcdetail {
+
+
+
+class windows_named_mutex
+{
+ /// @cond
+
+ //Non-copyable
+ windows_named_mutex();
+ windows_named_mutex(const windows_named_mutex &);
+ windows_named_mutex &operator=(const windows_named_mutex &);
+ /// @endcond
+
+ public:
+ windows_named_mutex(create_only_t, const char *name, const permissions &perm = permissions());
+
+ windows_named_mutex(open_or_create_t, const char *name, const permissions &perm = permissions());
+
+ windows_named_mutex(open_only_t, const char *name);
+
+ ~windows_named_mutex();
+
+ void unlock();
+ void lock();
+ bool try_lock();
+ bool timed_lock(const boost::posix_time::ptime &abs_time);
+
+ static bool remove(const char *name);
+
+ /// @cond
+ private:
+ friend class interprocess_tester;
+ void dont_close_on_destruction();
+ winapi_mutex_wrapper m_mtx_wrapper;
+ windows_named_sync m_named_sync;
+
+ class named_mut_callbacks : public windows_named_sync_interface
+ {
+ public:
+ named_mut_callbacks(winapi_mutex_wrapper &mtx_wrapper)
+ : m_mtx_wrapper(mtx_wrapper)
+ {}
+
+ virtual std::size_t get_data_size() const
+ { return 0u; }
+
+ virtual const void *buffer_with_init_data_to_file()
+ { return 0; }
+
+ virtual const void *buffer_with_final_data_to_file()
+ { return 0; }
+
+ virtual void *buffer_to_store_init_data_from_file()
+ { return 0; }
+
+ virtual bool open(create_enum_t, const char *id_name)
+ {
+ std::string aux_str = "Global\\bipc.mut.";
+ aux_str += id_name;
+ //
+ permissions mut_perm;
+ mut_perm.set_unrestricted();
+ return m_mtx_wrapper.open_or_create(aux_str.c_str(), mut_perm);
+ }
+
+ virtual void close()
+ {
+ m_mtx_wrapper.close();
+ }
+
+ virtual ~named_mut_callbacks()
+ {}
+
+ private:
+ winapi_mutex_wrapper& m_mtx_wrapper;
+ };
+ /// @endcond
+};
+
+inline windows_named_mutex::~windows_named_mutex()
+{
+ named_mut_callbacks callbacks(m_mtx_wrapper);
+ m_named_sync.close(callbacks);
+}
+
+inline void windows_named_mutex::dont_close_on_destruction()
+{}
+
+inline windows_named_mutex::windows_named_mutex
+ (create_only_t, const char *name, const permissions &perm)
+ : m_mtx_wrapper()
+{
+ named_mut_callbacks callbacks(m_mtx_wrapper);
+ m_named_sync.open_or_create(DoCreate, name, perm, callbacks);
+}
+
+inline windows_named_mutex::windows_named_mutex
+ (open_or_create_t, const char *name, const permissions &perm)
+ : m_mtx_wrapper()
+{
+ named_mut_callbacks callbacks(m_mtx_wrapper);
+ m_named_sync.open_or_create(DoOpenOrCreate, name, perm, callbacks);
+}
+
+inline windows_named_mutex::windows_named_mutex(open_only_t, const char *name)
+ : m_mtx_wrapper()
+{
+ named_mut_callbacks callbacks(m_mtx_wrapper);
+ m_named_sync.open_or_create(DoOpen, name, permissions(), callbacks);
+}
+
+inline void windows_named_mutex::unlock()
+{
+ m_mtx_wrapper.unlock();
+}
+
+inline void windows_named_mutex::lock()
+{
+ m_mtx_wrapper.lock();
+}
+
+inline bool windows_named_mutex::try_lock()
+{
+ return m_mtx_wrapper.try_lock();
+}
+
+inline bool windows_named_mutex::timed_lock(const boost::posix_time::ptime &abs_time)
+{
+ return m_mtx_wrapper.timed_lock(abs_time);
+}
+
+inline bool windows_named_mutex::remove(const char *name)
+{
+ return windows_named_sync::remove(name);
+}
+
+} //namespace ipcdetail {
+} //namespace interprocess {
+} //namespace boost {
+
+#include <boost/interprocess/detail/config_end.hpp>
+
+#endif //BOOST_INTERPROCESS_WINDOWS_NAMED_MUTEX_HPP \ No newline at end of file
diff --git a/boost/interprocess/sync/windows/named_recursive_mutex.hpp b/boost/interprocess/sync/windows/named_recursive_mutex.hpp
new file mode 100644
index 0000000000..cb2ef79ac1
--- /dev/null
+++ b/boost/interprocess/sync/windows/named_recursive_mutex.hpp
@@ -0,0 +1,58 @@
+ //////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2011-2012. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/interprocess for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+#ifndef BOOST_INTERPROCESS_WINDOWS_RECURSIVE_NAMED_MUTEX_HPP
+#define BOOST_INTERPROCESS_WINDOWS_RECURSIVE_NAMED_MUTEX_HPP
+
+#if (defined _MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <boost/interprocess/detail/config_begin.hpp>
+#include <boost/interprocess/detail/workaround.hpp>
+#include <boost/interprocess/sync/windows/named_mutex.hpp>
+
+namespace boost {
+namespace interprocess {
+namespace ipcdetail {
+
+
+class windows_named_recursive_mutex
+ //Windows mutexes based on CreateMutex are already recursive...
+ : public windows_named_mutex
+{
+ /// @cond
+
+ //Non-copyable
+ windows_named_recursive_mutex();
+ windows_named_recursive_mutex(const windows_named_mutex &);
+ windows_named_recursive_mutex &operator=(const windows_named_mutex &);
+ /// @endcond
+
+ public:
+ windows_named_recursive_mutex(create_only_t, const char *name, const permissions &perm = permissions())
+ : windows_named_mutex(create_only_t(), name, perm)
+ {}
+
+ windows_named_recursive_mutex(open_or_create_t, const char *name, const permissions &perm = permissions())
+ : windows_named_mutex(open_or_create_t(), name, perm)
+ {}
+
+ windows_named_recursive_mutex(open_only_t, const char *name)
+ : windows_named_mutex(open_only_t(), name)
+ {}
+};
+
+} //namespace ipcdetail {
+} //namespace interprocess {
+} //namespace boost {
+
+#include <boost/interprocess/detail/config_end.hpp>
+
+#endif //BOOST_INTERPROCESS_WINDOWS_RECURSIVE_NAMED_MUTEX_HPP
diff --git a/boost/interprocess/sync/windows/named_semaphore.hpp b/boost/interprocess/sync/windows/named_semaphore.hpp
new file mode 100644
index 0000000000..8f48d4df96
--- /dev/null
+++ b/boost/interprocess/sync/windows/named_semaphore.hpp
@@ -0,0 +1,178 @@
+ //////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2011-2012. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/interprocess for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTERPROCESS_WINDOWS_NAMED_SEMAPHORE_HPP
+#define BOOST_INTERPROCESS_WINDOWS_NAMED_SEMAPHORE_HPP
+
+#if (defined _MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <boost/interprocess/detail/config_begin.hpp>
+#include <boost/interprocess/detail/workaround.hpp>
+#include <boost/interprocess/creation_tags.hpp>
+#include <boost/interprocess/permissions.hpp>
+#include <boost/interprocess/detail/interprocess_tester.hpp>
+#include <boost/interprocess/detail/posix_time_types_wrk.hpp>
+#include <boost/interprocess/sync/windows/named_sync.hpp>
+#include <boost/interprocess/sync/windows/winapi_semaphore_wrapper.hpp>
+
+namespace boost {
+namespace interprocess {
+namespace ipcdetail {
+
+
+
+class windows_named_semaphore
+{
+ /// @cond
+
+ //Non-copyable
+ windows_named_semaphore();
+ windows_named_semaphore(const windows_named_semaphore &);
+ windows_named_semaphore &operator=(const windows_named_semaphore &);
+ /// @endcond
+
+ public:
+ windows_named_semaphore(create_only_t, const char *name, unsigned int initialCount, const permissions &perm = permissions());
+
+ windows_named_semaphore(open_or_create_t, const char *name, unsigned int initialCount, const permissions &perm = permissions());
+
+ windows_named_semaphore(open_only_t, const char *name);
+
+ ~windows_named_semaphore();
+
+ void post();
+ void wait();
+ bool try_wait();
+ bool timed_wait(const boost::posix_time::ptime &abs_time);
+
+ static bool remove(const char *name);
+
+ /// @cond
+ private:
+ friend class interprocess_tester;
+ void dont_close_on_destruction();
+ winapi_semaphore_wrapper m_sem_wrapper;
+ windows_named_sync m_named_sync;
+
+ class named_sem_callbacks : public windows_named_sync_interface
+ {
+ public:
+ typedef __int64 sem_count_t;
+ named_sem_callbacks(winapi_semaphore_wrapper &sem_wrapper, sem_count_t sem_cnt)
+ : m_sem_wrapper(sem_wrapper), m_sem_count(sem_cnt)
+ {}
+
+ virtual std::size_t get_data_size() const
+ { return sizeof(sem_count_t); }
+
+ virtual const void *buffer_with_final_data_to_file()
+ { return &m_sem_count; }
+
+ virtual const void *buffer_with_init_data_to_file()
+ { return &m_sem_count; }
+
+ virtual void *buffer_to_store_init_data_from_file()
+ { return &m_sem_count; }
+
+ virtual bool open(create_enum_t, const char *id_name)
+ {
+ std::string aux_str = "Global\\bipc.sem.";
+ aux_str += id_name;
+ //
+ permissions sem_perm;
+ sem_perm.set_unrestricted();
+ bool created;
+ return m_sem_wrapper.open_or_create
+ ( aux_str.c_str(), static_cast<long>(m_sem_count)
+ , winapi_semaphore_wrapper::MaxCount, sem_perm, created);
+ }
+
+ virtual void close()
+ {
+ m_sem_wrapper.close();
+ }
+
+ virtual ~named_sem_callbacks()
+ {}
+
+ private:
+ sem_count_t m_sem_count;
+ winapi_semaphore_wrapper& m_sem_wrapper;
+ };
+
+ /// @endcond
+};
+
+inline windows_named_semaphore::~windows_named_semaphore()
+{
+ named_sem_callbacks callbacks(m_sem_wrapper, m_sem_wrapper.value());
+ m_named_sync.close(callbacks);
+}
+
+inline void windows_named_semaphore::dont_close_on_destruction()
+{}
+
+inline windows_named_semaphore::windows_named_semaphore
+ (create_only_t, const char *name, unsigned int initial_count, const permissions &perm)
+ : m_sem_wrapper()
+{
+ named_sem_callbacks callbacks(m_sem_wrapper, initial_count);
+ m_named_sync.open_or_create(DoCreate, name, perm, callbacks);
+}
+
+inline windows_named_semaphore::windows_named_semaphore
+ (open_or_create_t, const char *name, unsigned int initial_count, const permissions &perm)
+ : m_sem_wrapper()
+{
+ named_sem_callbacks callbacks(m_sem_wrapper, initial_count);
+ m_named_sync.open_or_create(DoOpenOrCreate, name, perm, callbacks);
+}
+
+inline windows_named_semaphore::windows_named_semaphore(open_only_t, const char *name)
+ : m_sem_wrapper()
+{
+ named_sem_callbacks callbacks(m_sem_wrapper, 0);
+ m_named_sync.open_or_create(DoOpen, name, permissions(), callbacks);
+}
+
+inline void windows_named_semaphore::post()
+{
+ m_sem_wrapper.post();
+}
+
+inline void windows_named_semaphore::wait()
+{
+ m_sem_wrapper.wait();
+}
+
+inline bool windows_named_semaphore::try_wait()
+{
+ return m_sem_wrapper.try_wait();
+}
+
+inline bool windows_named_semaphore::timed_wait(const boost::posix_time::ptime &abs_time)
+{
+ return m_sem_wrapper.timed_wait(abs_time);
+}
+
+inline bool windows_named_semaphore::remove(const char *name)
+{
+ return windows_named_sync::remove(name);
+}
+
+} //namespace ipcdetail {
+} //namespace interprocess {
+} //namespace boost {
+
+#include <boost/interprocess/detail/config_end.hpp>
+
+#endif //BOOST_INTERPROCESS_WINDOWS_NAMED_SEMAPHORE_HPP
diff --git a/boost/interprocess/sync/windows/named_sync.hpp b/boost/interprocess/sync/windows/named_sync.hpp
new file mode 100644
index 0000000000..41f299f8eb
--- /dev/null
+++ b/boost/interprocess/sync/windows/named_sync.hpp
@@ -0,0 +1,215 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2011-2012. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/interprocess for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTERPROCESS_WINDOWS_NAMED_SYNC_HPP
+#define BOOST_INTERPROCESS_WINDOWS_NAMED_SYNC_HPP
+
+#if (defined _MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <boost/interprocess/detail/config_begin.hpp>
+#include <boost/interprocess/detail/workaround.hpp>
+#include <boost/interprocess/creation_tags.hpp>
+#include <boost/interprocess/permissions.hpp>
+#include <boost/interprocess/detail/tmp_dir_helpers.hpp>
+#include <boost/interprocess/sync/windows/sync_utils.hpp>
+#include <boost/interprocess/errors.hpp>
+#include <boost/interprocess/exceptions.hpp>
+#include <string>
+#include <cassert>
+
+namespace boost {
+namespace interprocess {
+namespace ipcdetail {
+
+class windows_named_sync_interface
+{
+ public:
+ virtual std::size_t get_data_size() const = 0;
+ virtual const void *buffer_with_final_data_to_file() = 0;
+ virtual const void *buffer_with_init_data_to_file() = 0;
+ virtual void *buffer_to_store_init_data_from_file() = 0;
+ virtual bool open(create_enum_t creation_type, const char *id_name) = 0;
+ virtual void close() = 0;
+ virtual ~windows_named_sync_interface() = 0;
+};
+
+inline windows_named_sync_interface::~windows_named_sync_interface()
+{}
+
+class windows_named_sync
+{
+ /// @cond
+
+ //Non-copyable
+ windows_named_sync(const windows_named_sync &);
+ windows_named_sync &operator=(const windows_named_sync &);
+ /// @endcond
+
+ public:
+ windows_named_sync();
+ void open_or_create(create_enum_t creation_type, const char *name, const permissions &perm, windows_named_sync_interface &sync_interface);
+ void close(windows_named_sync_interface &sync_interface);
+
+ static bool remove(const char *name);
+
+ /// @cond
+ private:
+ void *m_file_hnd;
+
+ /// @endcond
+};
+
+inline windows_named_sync::windows_named_sync()
+ : m_file_hnd(winapi::invalid_handle_value)
+{}
+
+inline void windows_named_sync::close(windows_named_sync_interface &sync_interface)
+{
+ const std::size_t buflen = sync_interface.get_data_size();
+ const std::size_t sizeof_file_info = sizeof(sync_id::internal_type) + buflen;
+ winapi::interprocess_overlapped overlapped;
+ if(winapi::lock_file_ex
+ (m_file_hnd, winapi::lockfile_exclusive_lock, 0, sizeof_file_info, 0, &overlapped)){
+ if(winapi::set_file_pointer_ex(m_file_hnd, sizeof(sync_id::internal_type), 0, winapi::file_begin)){
+ const void *buf = sync_interface.buffer_with_final_data_to_file();
+
+ unsigned long written_or_read = 0;
+ if(winapi::write_file(m_file_hnd, buf, buflen, &written_or_read, 0)){
+ //...
+ }
+ }
+ }
+ sync_interface.close();
+ if(m_file_hnd != winapi::invalid_handle_value){
+ winapi::close_handle(m_file_hnd);
+ m_file_hnd = winapi::invalid_handle_value;
+ }
+}
+
+inline void windows_named_sync::open_or_create
+ ( create_enum_t creation_type
+ , const char *name
+ , const permissions &perm
+ , windows_named_sync_interface &sync_interface)
+{
+ std::string aux_str(name);
+ m_file_hnd = winapi::invalid_handle_value;
+ //Use a file to emulate POSIX lifetime semantics. After this logic
+ //we'll obtain the ID of the native handle to open in aux_str
+ {
+ create_tmp_and_clean_old_and_get_filename(name, aux_str);
+ //Create a file with required permissions.
+ m_file_hnd = winapi::create_file
+ ( aux_str.c_str()
+ , winapi::generic_read | winapi::generic_write
+ , creation_type == DoOpen ? winapi::open_existing :
+ (creation_type == DoCreate ? winapi::create_new : winapi::open_always)
+ , 0
+ , (winapi::interprocess_security_attributes*)perm.get_permissions());
+
+ //Obtain OS error in case something has failed
+ error_info err;
+ bool success = false;
+ if(m_file_hnd != winapi::invalid_handle_value){
+ //Now lock the file
+ const std::size_t buflen = sync_interface.get_data_size();
+ typedef __int64 unique_id_type;
+ const std::size_t sizeof_file_info = sizeof(unique_id_type) + buflen;
+ winapi::interprocess_overlapped overlapped;
+ if(winapi::lock_file_ex
+ (m_file_hnd, winapi::lockfile_exclusive_lock, 0, sizeof_file_info, 0, &overlapped)){
+ __int64 filesize = 0;
+ //Obtain the unique id to open the native semaphore.
+ //If file size was created
+ if(winapi::get_file_size(m_file_hnd, filesize)){
+ unsigned long written_or_read = 0;
+ unique_id_type unique_id_val;
+ if(static_cast<std::size_t>(filesize) != sizeof_file_info){
+ winapi::set_end_of_file(m_file_hnd);
+ winapi::query_performance_counter(&unique_id_val);
+ const void *buf = sync_interface.buffer_with_init_data_to_file();
+ //Write unique ID in file. This ID will be used to calculate the semaphore name
+ if(winapi::write_file(m_file_hnd, &unique_id_val, sizeof(unique_id_val), &written_or_read, 0) &&
+ written_or_read == sizeof(unique_id_val) &&
+ winapi::write_file(m_file_hnd, buf, buflen, &written_or_read, 0) &&
+ written_or_read == buflen ){
+ success = true;
+ }
+ winapi::get_file_size(m_file_hnd, filesize);
+ assert(std::size_t(filesize) == sizeof_file_info);
+ }
+ else{
+ void *buf = sync_interface.buffer_to_store_init_data_from_file();
+ if(winapi::read_file(m_file_hnd, &unique_id_val, sizeof(unique_id_val), &written_or_read, 0) &&
+ written_or_read == sizeof(unique_id_val) &&
+ winapi::read_file(m_file_hnd, buf, buflen, &written_or_read, 0) &&
+ written_or_read == buflen ){
+ success = true;
+ }
+ }
+ if(success){
+ //Now create a global semaphore name based on the unique id
+ char unique_id_name[sizeof(unique_id_val)*2+1];
+ std::size_t name_suffix_length = sizeof(unique_id_name);
+ bytes_to_str(&unique_id_val, sizeof(unique_id_val), &unique_id_name[0], name_suffix_length);
+ success = sync_interface.open(creation_type, unique_id_name);
+ }
+ }
+
+ //Obtain OS error in case something has failed
+ err = system_error_code();
+
+ //If this fails we have no possible rollback so don't check the return
+ if(!winapi::unlock_file_ex(m_file_hnd, 0, sizeof_file_info, 0, &overlapped)){
+ err = system_error_code();
+ }
+ }
+ else{
+ //Obtain OS error in case something has failed
+ err = system_error_code();
+ }
+ }
+ else{
+ err = system_error_code();
+ }
+
+ if(!success){
+ if(m_file_hnd != winapi::invalid_handle_value){
+ winapi::close_handle(m_file_hnd);
+ m_file_hnd = winapi::invalid_handle_value;
+ }
+ //Throw as something went wrong
+ throw interprocess_exception(err);
+ }
+ }
+}
+
+inline bool windows_named_sync::remove(const char *name)
+{
+ try{
+ //Make sure a temporary path is created for shared memory
+ std::string semfile;
+ ipcdetail::tmp_filename(name, semfile);
+ return winapi::unlink_file(semfile.c_str());
+ }
+ catch(...){
+ return false;
+ }
+}
+
+} //namespace ipcdetail {
+} //namespace interprocess {
+} //namespace boost {
+
+#include <boost/interprocess/detail/config_end.hpp>
+
+#endif //BOOST_INTERPROCESS_WINDOWS_NAMED_SYNC_HPP
diff --git a/boost/interprocess/sync/windows/semaphore.hpp b/boost/interprocess/sync/windows/semaphore.hpp
index d5835ceec7..af336df48a 100644
--- a/boost/interprocess/sync/windows/semaphore.hpp
+++ b/boost/interprocess/sync/windows/semaphore.hpp
@@ -19,8 +19,9 @@
#include <boost/interprocess/detail/workaround.hpp>
#include <boost/interprocess/detail/posix_time_types_wrk.hpp>
#include <boost/interprocess/detail/win32_api.hpp>
-#include <boost/interprocess/detail/intermodule_singleton.hpp>
+#include <boost/interprocess/detail/windows_intermodule_singleton.hpp>
#include <boost/interprocess/sync/windows/sync_utils.hpp>
+#include <boost/interprocess/sync/windows/winapi_semaphore_wrapper.hpp>
#include <boost/interprocess/exceptions.hpp>
@@ -46,11 +47,11 @@ class windows_semaphore
const sync_id id_;
};
-inline windows_semaphore::windows_semaphore(unsigned int initialCount)
- : id_()
+inline windows_semaphore::windows_semaphore(unsigned int initialCount)
+ : id_(this)
{
sync_handles &handles =
- intermodule_singleton<sync_handles>::get();
+ windows_intermodule_singleton<sync_handles>::get();
//Force smeaphore creation with the initial count
bool open_or_created;
handles.obtain_semaphore(this->id_, initialCount, &open_or_created);
@@ -60,72 +61,46 @@ inline windows_semaphore::windows_semaphore(unsigned int initialCount)
(void)open_or_created;
}
-inline windows_semaphore::~windows_semaphore()
+inline windows_semaphore::~windows_semaphore()
{
sync_handles &handles =
- intermodule_singleton<sync_handles>::get();
+ windows_intermodule_singleton<sync_handles>::get();
handles.destroy_handle(this->id_);
}
inline void windows_semaphore::wait(void)
{
sync_handles &handles =
- intermodule_singleton<sync_handles>::get();
+ windows_intermodule_singleton<sync_handles>::get();
//This can throw
- void *hnd = handles.obtain_semaphore(this->id_, 0);
- unsigned long ret = winapi::wait_for_single_object(hnd, winapi::infinite_time);
- if(ret == winapi::wait_failed){
- error_info err(winapi::get_last_error());
- throw interprocess_exception(err);
- }
+ winapi_semaphore_functions sem(handles.obtain_semaphore(this->id_, 0));
+ sem.wait();
}
inline bool windows_semaphore::try_wait(void)
{
sync_handles &handles =
- intermodule_singleton<sync_handles>::get();
+ windows_intermodule_singleton<sync_handles>::get();
//This can throw
- void *hnd = handles.obtain_semaphore(this->id_, 0);
- unsigned long ret = winapi::wait_for_single_object(hnd, 0);
- if(ret == winapi::wait_failed){
- error_info err(winapi::get_last_error());
- throw interprocess_exception(err);
- }
- return ret != winapi::wait_timeout;
+ winapi_semaphore_functions sem(handles.obtain_semaphore(this->id_, 0));
+ return sem.try_wait();
}
inline bool windows_semaphore::timed_wait(const boost::posix_time::ptime &abs_time)
{
- if(abs_time == boost::posix_time::pos_infin){
- this->wait();
- return true;
- }
- boost::posix_time::ptime now
- = boost::posix_time::microsec_clock::universal_time();
-
- unsigned long ms = (unsigned long)(abs_time-now).total_milliseconds();
sync_handles &handles =
- intermodule_singleton<sync_handles>::get();
+ windows_intermodule_singleton<sync_handles>::get();
//This can throw
- void *hnd = handles.obtain_semaphore(this->id_, 0);
- unsigned long ret = winapi::wait_for_single_object(hnd, ms);
- if(ret == winapi::wait_failed){
- error_info err(winapi::get_last_error());
- throw interprocess_exception(err);
- }
- return ret != winapi::wait_timeout;
+ winapi_semaphore_functions sem(handles.obtain_semaphore(this->id_, 0));
+ return sem.timed_wait(abs_time);
}
inline void windows_semaphore::post(long release_count)
{
sync_handles &handles =
- intermodule_singleton<sync_handles>::get();
- //This can throw
- void *hnd = handles.obtain_semaphore(this->id_, 0);
- long prev_count;
- int ret = winapi::release_semaphore(hnd, release_count, &prev_count);
- (void)ret;
- assert(ret);
+ windows_intermodule_singleton<sync_handles>::get();
+ winapi_semaphore_functions sem(handles.obtain_semaphore(this->id_, 0));
+ sem.post(release_count);
}
} //namespace ipcdetail {
diff --git a/boost/interprocess/sync/windows/sync_utils.hpp b/boost/interprocess/sync/windows/sync_utils.hpp
index 89c4aeda0b..0281da1266 100644
--- a/boost/interprocess/sync/windows/sync_utils.hpp
+++ b/boost/interprocess/sync/windows/sync_utils.hpp
@@ -21,7 +21,10 @@
#include <boost/interprocess/sync/spin/mutex.hpp>
#include <boost/interprocess/exceptions.hpp>
#include <boost/interprocess/sync/scoped_lock.hpp>
+#include <boost/interprocess/sync/windows/winapi_semaphore_wrapper.hpp>
+#include <boost/interprocess/sync/windows/winapi_mutex_wrapper.hpp>
#include <boost/unordered/unordered_map.hpp>
+#include <boost/container/map.hpp>
#include <cstddef>
namespace boost {
@@ -32,6 +35,7 @@ inline bool bytes_to_str(const void *mem, const std::size_t mem_length, char *ou
{
const std::size_t need_mem = mem_length*2+1;
if(out_length < need_mem){
+ out_length = need_mem;
return false;
}
@@ -49,40 +53,57 @@ inline bool bytes_to_str(const void *mem, const std::size_t mem_length, char *ou
return true;
}
-struct sync_id
+class sync_id
{
- sync_id()
- { winapi::query_performance_counter(&rand); }
+ public:
+ typedef __int64 internal_type;
+ sync_id(const void *map_addr)
+ : map_addr_(map_addr)
+ { winapi::query_performance_counter(&rand_); }
+
+ explicit sync_id(internal_type val, const void *map_addr)
+ : map_addr_(map_addr)
+ { rand_ = val; }
+
+ const internal_type &internal_pod() const
+ { return rand_; }
- __int64 rand;
+ internal_type &internal_pod()
+ { return rand_; }
+
+ const void *map_addr() const
+ { return map_addr_; }
friend std::size_t hash_value(const sync_id &m)
- { return boost::hash_value(m.rand); }
+ { return boost::hash_value(m.rand_); }
friend bool operator==(const sync_id &l, const sync_id &r)
- { return l.rand == r.rand; }
-};
-/*
-#define BOOST_NO_LONG_LONG ss
+ { return l.rand_ == r.rand_ && l.map_addr_ == r.map_addr_; }
-#if defined(BOOST_NO_LONG_LONG)
+ private:
+ internal_type rand_;
+ const void * const map_addr_;
+};
-#error "defined(BOOST_NO_LONG_LONG)"
-#else
-#error "NOT defined(BOOST_NO_LONG_LONG)"
-#endif
-*/
class sync_handles
{
public:
enum type { MUTEX, SEMAPHORE };
private:
- typedef boost::unordered_map<sync_id, void*> map_type;
+ struct address_less
+ {
+ bool operator()(sync_id const * const l, sync_id const * const r) const
+ { return l->map_addr() < r->map_addr(); }
+ };
+
+ typedef boost::unordered_map<sync_id, void*> umap_type;
+ typedef boost::container::map<const sync_id*, umap_type::iterator, address_less> map_type;
static const std::size_t LengthOfGlobal = sizeof("Global\\boost.ipc")-1;
static const std::size_t StrSize = LengthOfGlobal + (sizeof(sync_id)*2+1);
typedef char NameBuf[StrSize];
+
void fill_name(NameBuf &name, const sync_id &id)
{
const char *n = "Global\\boost.ipc";
@@ -92,13 +113,12 @@ class sync_handles
++i;
} while(n[i]);
std::size_t len = sizeof(NameBuf) - LengthOfGlobal;
- bytes_to_str(&id.rand, sizeof(id.rand), &name[LengthOfGlobal], len);
+ bytes_to_str(&id.internal_pod(), sizeof(id.internal_pod()), &name[LengthOfGlobal], len);
}
- void erase_and_throw_if_error(void *hnd_val, const sync_id &id)
+ void throw_if_error(void *hnd_val)
{
if(!hnd_val){
- map_.erase(id);
error_info err(winapi::get_last_error());
throw interprocess_exception(err);
}
@@ -108,27 +128,36 @@ class sync_handles
{
NameBuf name;
fill_name(name, id);
- void *hnd_val = winapi::open_or_create_semaphore
- (name, (long)initial_count, (long)(((unsigned long)(-1))>>1), unrestricted_security.get_attributes());
- erase_and_throw_if_error(hnd_val, id);
- return hnd_val;
+ permissions unrestricted_security;
+ unrestricted_security.set_unrestricted();
+ winapi_semaphore_wrapper sem_wrapper;
+ bool created;
+ sem_wrapper.open_or_create
+ (name, (long)initial_count, winapi_semaphore_wrapper::MaxCount, unrestricted_security, created);
+ throw_if_error(sem_wrapper.handle());
+ return sem_wrapper.release();
}
void* open_or_create_mutex(const sync_id &id)
{
NameBuf name;
fill_name(name, id);
- void *hnd_val = winapi::open_or_create_mutex
- (name, false, unrestricted_security.get_attributes());
- erase_and_throw_if_error(hnd_val, id);
- return hnd_val;
+ permissions unrestricted_security;
+ unrestricted_security.set_unrestricted();
+ winapi_mutex_wrapper mtx_wrapper;
+ mtx_wrapper.open_or_create(name, unrestricted_security);
+ throw_if_error(mtx_wrapper.handle());
+ return mtx_wrapper.release();
}
public:
void *obtain_mutex(const sync_id &id, bool *popen_created = 0)
{
+ umap_type::value_type v(id, (void*)0);
scoped_lock<spin_mutex> lock(mtx_);
- void *&hnd_val = map_[id];
+ umap_type::iterator it = umap_.insert(v).first;
+ map_[&it->first] = it;
+ void *&hnd_val = it->second;
if(!hnd_val){
hnd_val = open_or_create_mutex(id);
if(popen_created) *popen_created = true;
@@ -138,8 +167,11 @@ class sync_handles
void *obtain_semaphore(const sync_id &id, unsigned int initial_count, bool *popen_created = 0)
{
+ umap_type::value_type v(id, (void*)0);
scoped_lock<spin_mutex> lock(mtx_);
- void *&hnd_val = map_[id];
+ umap_type::iterator it = umap_.insert(v).first;
+ map_[&it->first] = it;
+ void *&hnd_val = it->second;
if(!hnd_val){
hnd_val = open_or_create_semaphore(id, initial_count);
if(popen_created) *popen_created = true;
@@ -150,16 +182,35 @@ class sync_handles
void destroy_handle(const sync_id &id)
{
scoped_lock<spin_mutex> lock(mtx_);
- map_type::iterator it = map_.find(id);
- if(it != map_.end()){
+ umap_type::iterator it = umap_.find(id);
+ umap_type::iterator itend = umap_.end();
+
+ if(it != itend){
winapi::close_handle(it->second);
- map_.erase(it);
+ const map_type::key_type &k = &it->first;
+ map_.erase(k);
+ umap_.erase(it);
+ }
+ }
+
+ void destroy_syncs_in_range(const void *addr, std::size_t size)
+ {
+ sync_id low_id(addr);
+ sync_id hig_id(static_cast<const char*>(addr)+size);
+ scoped_lock<spin_mutex> lock(mtx_);
+ map_type::iterator itlow(map_.lower_bound(&low_id)),
+ ithig(map_.lower_bound(&hig_id));
+ while(itlow != ithig){
+ void *hnd = umap_[*itlow->first];
+ winapi::close_handle(hnd);
+ umap_.erase(*itlow->first);
+ itlow = map_.erase(itlow);
}
}
private:
- winapi::interprocess_all_access_security unrestricted_security;
spin_mutex mtx_;
+ umap_type umap_;
map_type map_;
};
diff --git a/boost/interprocess/sync/windows/winapi_mutex_wrapper.hpp b/boost/interprocess/sync/windows/winapi_mutex_wrapper.hpp
new file mode 100644
index 0000000000..0be96011cf
--- /dev/null
+++ b/boost/interprocess/sync/windows/winapi_mutex_wrapper.hpp
@@ -0,0 +1,163 @@
+ //////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2011-2012. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/interprocess for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTERPROCESS_DETAIL_WINAPI_MUTEX_WRAPPER_HPP
+#define BOOST_INTERPROCESS_DETAIL_WINAPI_MUTEX_WRAPPER_HPP
+
+#if (defined _MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <boost/interprocess/detail/config_begin.hpp>
+#include <boost/interprocess/detail/workaround.hpp>
+#include <boost/interprocess/creation_tags.hpp>
+#include <boost/interprocess/permissions.hpp>
+#include <boost/interprocess/detail/win32_api.hpp>
+#include <boost/interprocess/detail/posix_time_types_wrk.hpp>
+#include <boost/interprocess/errors.hpp>
+#include <boost/interprocess/exceptions.hpp>
+#include <limits>
+
+namespace boost {
+namespace interprocess {
+namespace ipcdetail {
+
+class winapi_mutex_functions
+{
+ /// @cond
+
+ //Non-copyable
+ winapi_mutex_functions(const winapi_mutex_functions &);
+ winapi_mutex_functions &operator=(const winapi_mutex_functions &);
+ /// @endcond
+
+ public:
+ winapi_mutex_functions(void *mtx_hnd)
+ : m_mtx_hnd(mtx_hnd)
+ {}
+
+ void unlock()
+ {
+ winapi::release_mutex(m_mtx_hnd);
+ }
+
+ void lock()
+ {
+ if(winapi::wait_for_single_object(m_mtx_hnd, winapi::infinite_time) != winapi::wait_object_0){
+ error_info err = system_error_code();
+ throw interprocess_exception(err);
+ }
+ }
+
+ bool try_lock()
+ {
+ unsigned long ret = winapi::wait_for_single_object(m_mtx_hnd, 0);
+ if(ret == winapi::wait_object_0){
+ return true;
+ }
+ else if(ret == winapi::wait_timeout){
+ return false;
+ }
+ else{
+ error_info err = system_error_code();
+ throw interprocess_exception(err);
+ }
+ }
+
+ bool timed_lock(const boost::posix_time::ptime &abs_time)
+ {
+ if(abs_time == boost::posix_time::pos_infin){
+ this->lock();
+ return true;
+ }
+
+ unsigned long ret = winapi::wait_for_single_object
+ (m_mtx_hnd, (abs_time - microsec_clock::universal_time()).total_milliseconds());
+ if(ret == winapi::wait_object_0){
+ return true;
+ }
+ else if(ret == winapi::wait_timeout){
+ return false;
+ }
+ else{
+ error_info err = system_error_code();
+ throw interprocess_exception(err);
+ }
+ }
+
+ /// @cond
+ protected:
+ void *m_mtx_hnd;
+ /// @endcond
+};
+
+//Swappable mutex wrapper
+class winapi_mutex_wrapper
+ : public winapi_mutex_functions
+{
+ /// @cond
+
+ //Non-copyable
+ winapi_mutex_wrapper(const winapi_mutex_wrapper &);
+ winapi_mutex_wrapper &operator=(const winapi_mutex_wrapper &);
+ /// @endcond
+
+ public:
+ winapi_mutex_wrapper(void *mtx_hnd = winapi::invalid_handle_value)
+ : winapi_mutex_functions(mtx_hnd)
+ {}
+
+ ~winapi_mutex_wrapper()
+ { this->close(); }
+
+ void *release()
+ {
+ void *hnd = m_mtx_hnd;
+ m_mtx_hnd = winapi::invalid_handle_value;
+ return hnd;
+ }
+
+ void *handle() const
+ { return m_mtx_hnd; }
+
+ bool open_or_create(const char *name, const permissions &perm)
+ {
+ if(m_mtx_hnd == winapi::invalid_handle_value){
+ m_mtx_hnd = winapi::open_or_create_mutex
+ ( name
+ , false
+ , (winapi::interprocess_security_attributes*)perm.get_permissions()
+ );
+ return m_mtx_hnd != winapi::invalid_handle_value;
+ }
+ else{
+ return false;
+ }
+ }
+
+ void close()
+ {
+ if(m_mtx_hnd != winapi::invalid_handle_value){
+ winapi::close_handle(m_mtx_hnd);
+ m_mtx_hnd = winapi::invalid_handle_value;
+ }
+ }
+
+ void swap(winapi_mutex_wrapper &other)
+ { void *tmp = m_mtx_hnd; m_mtx_hnd = other.m_mtx_hnd; other.m_mtx_hnd = tmp; }
+};
+
+} //namespace ipcdetail {
+} //namespace interprocess {
+} //namespace boost {
+
+#include <boost/interprocess/detail/config_end.hpp>
+
+#endif //BOOST_INTERPROCESS_DETAIL_WINAPI_MUTEX_WRAPPER_HPP
diff --git a/boost/interprocess/sync/windows/winapi_semaphore_wrapper.hpp b/boost/interprocess/sync/windows/winapi_semaphore_wrapper.hpp
new file mode 100644
index 0000000000..2dd7845627
--- /dev/null
+++ b/boost/interprocess/sync/windows/winapi_semaphore_wrapper.hpp
@@ -0,0 +1,198 @@
+ //////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2011-2012. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/interprocess for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTERPROCESS_DETAIL_WINAPI_SEMAPHORE_WRAPPER_HPP
+#define BOOST_INTERPROCESS_DETAIL_WINAPI_SEMAPHORE_WRAPPER_HPP
+
+#if (defined _MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <boost/interprocess/detail/config_begin.hpp>
+#include <boost/interprocess/detail/workaround.hpp>
+#include <boost/interprocess/creation_tags.hpp>
+#include <boost/interprocess/permissions.hpp>
+#include <boost/interprocess/detail/win32_api.hpp>
+#include <boost/interprocess/detail/posix_time_types_wrk.hpp>
+#include <boost/interprocess/errors.hpp>
+#include <boost/interprocess/exceptions.hpp>
+#include <limits>
+
+namespace boost {
+namespace interprocess {
+namespace ipcdetail {
+
+class winapi_semaphore_functions
+{
+ /// @cond
+
+ //Non-copyable
+ winapi_semaphore_functions(const winapi_semaphore_functions &);
+ winapi_semaphore_functions &operator=(const winapi_semaphore_functions &);
+ /// @endcond
+
+ public:
+ winapi_semaphore_functions(void *hnd)
+ : m_sem_hnd(hnd)
+ {}
+
+ void post(long count = 1)
+ {
+ long prev_count;
+ winapi::release_semaphore(m_sem_hnd, count, &prev_count);
+ }
+
+ void wait()
+ {
+ if(winapi::wait_for_single_object(m_sem_hnd, winapi::infinite_time) != winapi::wait_object_0){
+ error_info err = system_error_code();
+ throw interprocess_exception(err);
+ }
+ }
+
+ bool try_wait()
+ {
+ unsigned long ret = winapi::wait_for_single_object(m_sem_hnd, 0);
+ if(ret == winapi::wait_object_0){
+ return true;
+ }
+ else if(ret == winapi::wait_timeout){
+ return false;
+ }
+ else{
+ error_info err = system_error_code();
+ throw interprocess_exception(err);
+ }
+ }
+
+ bool timed_wait(const boost::posix_time::ptime &abs_time)
+ {
+ if(abs_time == boost::posix_time::pos_infin){
+ this->wait();
+ return true;
+ }
+
+ unsigned long ret = winapi::wait_for_single_object
+ (m_sem_hnd, (abs_time - microsec_clock::universal_time()).total_milliseconds());
+ if(ret == winapi::wait_object_0){
+ return true;
+ }
+ else if(ret == winapi::wait_timeout){
+ return false;
+ }
+ else{
+ error_info err = system_error_code();
+ throw interprocess_exception(err);
+ }
+ }
+
+ long value() const
+ {
+ long count, limit;
+ if(!winapi::get_semaphore_info(m_sem_hnd, count, limit))
+ return 0;
+ return count;
+ }
+
+ long limit() const
+ {
+ long count, limit;
+ if(!winapi::get_semaphore_info(m_sem_hnd, count, limit))
+ return 0;
+ return limit;
+ }
+
+ /// @cond
+ protected:
+ void *m_sem_hnd;
+ /// @endcond
+};
+
+
+//Swappable semaphore wrapper
+class winapi_semaphore_wrapper
+ : public winapi_semaphore_functions
+{
+ winapi_semaphore_wrapper(const winapi_semaphore_wrapper &);
+ winapi_semaphore_wrapper &operator=(const winapi_semaphore_wrapper &);
+
+ public:
+
+ //Long is 32 bits in windows
+ static const long MaxCount = long(0x7FFFFFFF);
+
+ winapi_semaphore_wrapper(void *hnd = winapi::invalid_handle_value)
+ : winapi_semaphore_functions(hnd)
+ {}
+
+ ~winapi_semaphore_wrapper()
+ { this->close(); }
+
+ void *release()
+ {
+ void *hnd = m_sem_hnd;
+ m_sem_hnd = winapi::invalid_handle_value;
+ return hnd;
+ }
+
+ void *handle() const
+ { return m_sem_hnd; }
+
+ bool open_or_create( const char *name
+ , long sem_count
+ , long max_count
+ , const permissions &perm
+ , bool &created)
+ {
+ if(m_sem_hnd == winapi::invalid_handle_value){
+ m_sem_hnd = winapi::open_or_create_semaphore
+ ( name
+ , sem_count
+ , max_count
+ , (winapi::interprocess_security_attributes*)perm.get_permissions()
+ );
+ created = winapi::get_last_error() != winapi::error_already_exists;
+ return m_sem_hnd != winapi::invalid_handle_value;
+ }
+ else{
+ return false;
+ }
+ }
+
+ bool open_semaphore(const char *name)
+ {
+ if(m_sem_hnd == winapi::invalid_handle_value){
+ m_sem_hnd = winapi::open_semaphore(name);
+ return m_sem_hnd != winapi::invalid_handle_value;
+ }
+ else{
+ return false;
+ }
+ }
+
+ void close()
+ {
+ if(m_sem_hnd != winapi::invalid_handle_value){
+ winapi::close_handle(m_sem_hnd);
+ m_sem_hnd = winapi::invalid_handle_value;
+ }
+ }
+
+ void swap(winapi_semaphore_wrapper &other)
+ { void *tmp = m_sem_hnd; m_sem_hnd = other.m_sem_hnd; other.m_sem_hnd = tmp; }
+};
+
+} //namespace ipcdetail {
+} //namespace interprocess {
+} //namespace boost {
+
+#include <boost/interprocess/detail/config_end.hpp>
+
+#endif //BOOST_INTERPROCESS_DETAIL_WINAPI_SEMAPHORE_WRAPPER_HPP
diff --git a/boost/interprocess/sync/xsi/xsi_named_mutex.hpp b/boost/interprocess/sync/xsi/xsi_named_mutex.hpp
index 3dffdcc2ed..485b1ac101 100644
--- a/boost/interprocess/sync/xsi/xsi_named_mutex.hpp
+++ b/boost/interprocess/sync/xsi/xsi_named_mutex.hpp
@@ -62,20 +62,20 @@ class xsi_named_mutex
xsi_named_mutex(open_or_create_t, const char *path, boost::uint8_t id, int perm = 0666)
{ this->priv_open_or_create(ipcdetail::DoOpenOrCreate, path, id, perm); }
- //!Moves the ownership of "moved"'s named mutex to *this.
- //!After the call, "moved" does not represent any named mutex
+ //!Moves the ownership of "moved"'s named mutex to *this.
+ //!After the call, "moved" does not represent any named mutex
//!Does not throw
xsi_named_mutex(BOOST_RV_REF(xsi_named_mutex) moved)
{ this->swap(moved); }
//!Moves the ownership of "moved"'s named mutex to *this.
- //!After the call, "moved" does not represent any named mutex.
+ //!After the call, "moved" does not represent any named mutex.
//!Does not throw
xsi_named_mutex &operator=(BOOST_RV_REF(xsi_named_mutex) moved)
- {
+ {
xsi_named_mutex tmp(boost::move(moved));
this->swap(tmp);
- return *this;
+ return *this;
}
//!Swaps two xsi_named_mutex. Does not throw
@@ -126,11 +126,11 @@ class xsi_named_mutex
/// @cond
-inline xsi_named_mutex::xsi_named_mutex()
+inline xsi_named_mutex::xsi_named_mutex()
: m_semid(-1), m_key(-1), m_id(0), m_perm(0), m_path()
{}
-inline xsi_named_mutex::~xsi_named_mutex()
+inline xsi_named_mutex::~xsi_named_mutex()
{ this->priv_close(); }
inline const char *xsi_named_mutex::get_path() const
@@ -142,7 +142,7 @@ inline void xsi_named_mutex::swap(xsi_named_mutex &other)
std::swap(m_id, other.m_id);
std::swap(m_semid, other.m_semid);
std::swap(m_perm, other.m_perm);
- m_path.swap(other.m_path);
+ m_path.swap(other.m_path);
}
inline mapping_handle_t xsi_named_mutex::get_mapping_handle() const
diff --git a/boost/interprocess/windows_shared_memory.hpp b/boost/interprocess/windows_shared_memory.hpp
index 9a8b3f47dd..76601bb363 100644
--- a/boost/interprocess/windows_shared_memory.hpp
+++ b/boost/interprocess/windows_shared_memory.hpp
@@ -72,26 +72,26 @@ class windows_shared_memory
windows_shared_memory(open_or_create_t, const char *name, mode_t mode, std::size_t size, const permissions& perm = permissions())
{ this->priv_open_or_create(ipcdetail::DoOpenOrCreate, name, mode, size, perm); }
- //!Tries to open a shared memory object with name "name", with the access mode "mode".
+ //!Tries to open a shared memory object with name "name", with the access mode "mode".
//!If the file does not previously exist, it throws an error.
windows_shared_memory(open_only_t, const char *name, mode_t mode)
{ this->priv_open_or_create(ipcdetail::DoOpen, name, mode, 0, permissions()); }
- //!Moves the ownership of "moved"'s shared memory object to *this.
- //!After the call, "moved" does not represent any shared memory object.
+ //!Moves the ownership of "moved"'s shared memory object to *this.
+ //!After the call, "moved" does not represent any shared memory object.
//!Does not throw
windows_shared_memory(BOOST_RV_REF(windows_shared_memory) moved)
: m_handle(0)
{ this->swap(moved); }
//!Moves the ownership of "moved"'s shared memory to *this.
- //!After the call, "moved" does not represent any shared memory.
+ //!After the call, "moved" does not represent any shared memory.
//!Does not throw
windows_shared_memory &operator=(BOOST_RV_REF(windows_shared_memory) moved)
- {
+ {
windows_shared_memory tmp(boost::move(moved));
this->swap(tmp);
- return *this;
+ return *this;
}
//!Swaps to shared_memory_objects. Does not throw
@@ -129,21 +129,21 @@ class windows_shared_memory
/// @cond
-inline windows_shared_memory::windows_shared_memory()
+inline windows_shared_memory::windows_shared_memory()
: m_handle(0)
{}
-inline windows_shared_memory::~windows_shared_memory()
+inline windows_shared_memory::~windows_shared_memory()
{ this->priv_close(); }
inline const char *windows_shared_memory::get_name() const
{ return m_name.c_str(); }
inline void windows_shared_memory::swap(windows_shared_memory &other)
-{
+{
std::swap(m_handle, other.m_handle);
std::swap(m_mode, other.m_mode);
- m_name.swap(other.m_name);
+ m_name.swap(other.m_name);
}
inline mapping_handle_t windows_shared_memory::get_mapping_handle() const
@@ -157,22 +157,26 @@ inline bool windows_shared_memory::priv_open_or_create
{
m_name = filename ? filename : "";
- unsigned long file_map_access = 0;
+ unsigned long protection = 0;
unsigned long map_access = 0;
switch(mode)
{
+ //"protection" is for "create_file_mapping"
+ //"map_access" is for "open_file_mapping"
+ //Add section query (strange that read or access does not grant it...)
+ //to obtain the size of the mapping. copy_on_write is equal to section_query.
case read_only:
- file_map_access |= winapi::page_readonly;
- map_access |= winapi::file_map_read;
+ protection |= winapi::page_readonly;
+ map_access |= winapi::file_map_read | winapi::section_query;
break;
case read_write:
- file_map_access |= winapi::page_readwrite;
- map_access |= winapi::file_map_write;
+ protection |= winapi::page_readwrite;
+ map_access |= winapi::file_map_write | winapi::section_query;
break;
case copy_on_write:
- file_map_access |= winapi::page_writecopy;
- map_access |= winapi::file_map_copy;
+ protection |= winapi::page_writecopy;
+ map_access |= winapi::file_map_copy;
break;
default:
{
@@ -184,16 +188,13 @@ inline bool windows_shared_memory::priv_open_or_create
switch(type){
case ipcdetail::DoOpen:
- m_handle = winapi::open_file_mapping
- (map_access, filename);
+ m_handle = winapi::open_file_mapping(map_access, filename);
break;
case ipcdetail::DoCreate:
case ipcdetail::DoOpenOrCreate:
{
- __int64 s = size;
- unsigned long high_size(s >> 32), low_size((boost::uint32_t)s);
m_handle = winapi::create_file_mapping
- ( winapi::invalid_handle_value, file_map_access, high_size, low_size, filename
+ ( winapi::invalid_handle_value, protection, size, filename
, (winapi::interprocess_security_attributes*)perm.get_permissions());
}
break;
diff --git a/boost/interprocess/xsi_shared_memory.hpp b/boost/interprocess/xsi_shared_memory.hpp
index 3d09c77399..e84d9b1c54 100644
--- a/boost/interprocess/xsi_shared_memory.hpp
+++ b/boost/interprocess/xsi_shared_memory.hpp
@@ -78,21 +78,21 @@ class xsi_shared_memory
xsi_shared_memory(open_only_t, const xsi_key &key)
{ this->priv_open_or_create(ipcdetail::DoOpen, key, permissions(), 0); }
- //!Moves the ownership of "moved"'s shared memory object to *this.
- //!After the call, "moved" does not represent any shared memory object.
+ //!Moves the ownership of "moved"'s shared memory object to *this.
+ //!After the call, "moved" does not represent any shared memory object.
//!Does not throw
xsi_shared_memory(BOOST_RV_REF(xsi_shared_memory) moved)
: m_shmid(-1)
{ this->swap(moved); }
//!Moves the ownership of "moved"'s shared memory to *this.
- //!After the call, "moved" does not represent any shared memory.
+ //!After the call, "moved" does not represent any shared memory.
//!Does not throw
xsi_shared_memory &operator=(BOOST_RV_REF(xsi_shared_memory) moved)
- {
+ {
xsi_shared_memory tmp(boost::move(moved));
this->swap(tmp);
- return *this;
+ return *this;
}
//!Swaps two xsi_shared_memorys. Does not throw
@@ -129,11 +129,11 @@ class xsi_shared_memory
/// @cond
-inline xsi_shared_memory::xsi_shared_memory()
+inline xsi_shared_memory::xsi_shared_memory()
: m_shmid(-1)
{}
-inline xsi_shared_memory::~xsi_shared_memory()
+inline xsi_shared_memory::~xsi_shared_memory()
{}
inline int xsi_shared_memory::get_shmid() const
diff --git a/boost/intrusive/any_hook.hpp b/boost/intrusive/any_hook.hpp
index cccc820e7d..7d60de001a 100644
--- a/boost/intrusive/any_hook.hpp
+++ b/boost/intrusive/any_hook.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -50,7 +50,7 @@ struct make_any_base_hook
Options...
#endif
>::type packed_options;
-
+
typedef detail::generic_hook
< get_any_node_algo<typename packed_options::void_pointer>
, typename packed_options::tag
@@ -63,13 +63,13 @@ struct make_any_base_hook
//! Derive a class from this hook in order to store objects of that class
//! in an intrusive container.
-//!
+//!
//! The hook admits the following options: \c tag<>, \c void_pointer<> and
//! \c link_mode<>.
//!
-//! \c tag<> defines a tag to identify the node.
-//! The same tag value can be used in different classes, but if a class is
-//! derived from more than one \c any_base_hook, then each \c any_base_hook needs its
+//! \c tag<> defines a tag to identify the node.
+//! The same tag value can be used in different classes, but if a class is
+//! derived from more than one \c any_base_hook, then each \c any_base_hook needs its
//! unique tag.
//!
//! \c link_mode<> will specify the linking mode of the hook (\c normal_link, \c safe_link).
@@ -94,27 +94,27 @@ class any_base_hook
public:
//! <b>Effects</b>: If link_mode is or \c safe_link
//! initializes the node to an unlinked state.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
any_base_hook();
//! <b>Effects</b>: If link_mode is or \c safe_link
//! initializes the node to an unlinked state. The argument is ignored.
- //!
- //! <b>Throws</b>: Nothing.
- //!
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
//! <b>Rationale</b>: Providing a copy-constructor
- //! makes classes using the hook STL-compliant without forcing the
+ //! makes classes using the hook STL-compliant without forcing the
//! user to do some additional work. \c swap can be used to emulate
//! move-semantics.
any_base_hook(const any_base_hook& );
//! <b>Effects</b>: Empty function. The argument is ignored.
- //!
- //! <b>Throws</b>: Nothing.
- //!
- //! <b>Rationale</b>: Providing an assignment operator
- //! makes classes using the hook STL-compliant without forcing the
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing an assignment operator
+ //! makes classes using the hook STL-compliant without forcing the
//! user to do some additional work. \c swap can be used to emulate
//! move-semantics.
any_base_hook& operator=(const any_base_hook& );
@@ -122,17 +122,17 @@ class any_base_hook
//! <b>Effects</b>: If link_mode is \c normal_link, the destructor does
//! nothing (ie. no code is generated). If link_mode is \c safe_link and the
//! object is stored in a container an assertion is raised.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
~any_base_hook();
//! <b>Precondition</b>: link_mode must be \c safe_link.
//!
//! <b>Returns</b>: true, if the node belongs to a container, false
- //! otherwise. This function can be used to test whether \c container::iterator_to
- //! will return a valid iterator.
+ //! otherwise. This function can be used to test whether \c container::iterator_to
+ //! will return a valid iterator.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Constant
bool is_linked() const;
#endif
};
@@ -148,7 +148,7 @@ struct make_any_member_hook
{
/// @cond
typedef typename pack_options
- < hook_defaults,
+ < hook_defaults,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3
#else
@@ -168,10 +168,10 @@ struct make_any_member_hook
//! Store this hook in a class to be inserted
//! in an intrusive container.
-//!
+//!
//! The hook admits the following options: \c void_pointer<> and
//! \c link_mode<>.
-//!
+//!
//! \c link_mode<> will specify the linking mode of the hook (\c normal_link or \c safe_link).
//!
//! \c void_pointer<> is the pointer type that will be used internally in the hook
@@ -194,27 +194,27 @@ class any_member_hook
public:
//! <b>Effects</b>: If link_mode is or \c safe_link
//! initializes the node to an unlinked state.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
any_member_hook();
//! <b>Effects</b>: If link_mode is or \c safe_link
//! initializes the node to an unlinked state. The argument is ignored.
- //!
- //! <b>Throws</b>: Nothing.
- //!
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
//! <b>Rationale</b>: Providing a copy-constructor
- //! makes classes using the hook STL-compliant without forcing the
+ //! makes classes using the hook STL-compliant without forcing the
//! user to do some additional work. \c swap can be used to emulate
//! move-semantics.
any_member_hook(const any_member_hook& );
//! <b>Effects</b>: Empty function. The argument is ignored.
- //!
- //! <b>Throws</b>: Nothing.
- //!
- //! <b>Rationale</b>: Providing an assignment operator
- //! makes classes using the hook STL-compliant without forcing the
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing an assignment operator
+ //! makes classes using the hook STL-compliant without forcing the
//! user to do some additional work. \c swap can be used to emulate
//! move-semantics.
any_member_hook& operator=(const any_member_hook& );
@@ -222,17 +222,17 @@ class any_member_hook
//! <b>Effects</b>: If link_mode is \c normal_link, the destructor does
//! nothing (ie. no code is generated). If link_mode is \c safe_link and the
//! object is stored in a container an assertion is raised.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
~any_member_hook();
//! <b>Precondition</b>: link_mode must be \c safe_link.
//!
//! <b>Returns</b>: true, if the node belongs to a container, false
- //! otherwise. This function can be used to test whether \c container::iterator_to
- //! will return a valid iterator.
+ //! otherwise. This function can be used to test whether \c container::iterator_to
+ //! will return a valid iterator.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Constant
bool is_linked() const;
#endif
};
@@ -336,8 +336,8 @@ struct any_to_unordered_set_hook
{};
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/avl_set.hpp b/boost/intrusive/avl_set.hpp
index 92baf473ce..91e2dbbdf0 100644
--- a/boost/intrusive/avl_set.hpp
+++ b/boost/intrusive/avl_set.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2007-2009
+// (C) Copyright Ion Gaztanaga 2007-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -22,9 +22,9 @@
namespace boost {
namespace intrusive {
-//! The class template avl_set is an intrusive container, that mimics most of
+//! The class template avl_set is an intrusive container, that mimics most of
//! the interface of std::set as described in the C++ standard.
-//!
+//!
//! The template parameter \c T is the type to be managed by the container.
//! The user can specify additional options and if no options are provided
//! default options are used.
@@ -79,30 +79,30 @@ class avl_set_impl
/// @endcond
public:
- //! <b>Effects</b>: Constructs an empty avl_set.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //! <b>Effects</b>: Constructs an empty avl_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
- //! or the copy constructor of the value_compare object throws.
+ //! or the copy constructor of the value_compare object throws.
avl_set_impl( const value_compare &cmp = value_compare()
- , const value_traits &v_traits = value_traits())
+ , const value_traits &v_traits = value_traits())
: tree_(cmp, v_traits)
{}
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
//! cmp must be a comparison function that induces a strict weak ordering.
- //!
- //! <b>Effects</b>: Constructs an empty avl_set and inserts elements from
+ //!
+ //! <b>Effects</b>: Constructs an empty avl_set and inserts elements from
//! [b, e).
- //!
- //! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
+ //!
+ //! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
//! comp and otherwise N * log N, where N is std::distance(last, first).
- //!
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
- //! or the copy constructor/operator() of the value_compare object throws.
+ //! or the copy constructor/operator() of the value_compare object throws.
template<class Iterator>
avl_set_impl( Iterator b, Iterator e
, const value_compare &cmp = value_compare()
@@ -111,135 +111,135 @@ class avl_set_impl
{}
//! <b>Effects</b>: to-do
- //!
- avl_set_impl(BOOST_RV_REF(avl_set_impl) x)
+ //!
+ avl_set_impl(BOOST_RV_REF(avl_set_impl) x)
: tree_(::boost::move(x.tree_))
{}
//! <b>Effects</b>: to-do
- //!
- avl_set_impl& operator=(BOOST_RV_REF(avl_set_impl) x)
+ //!
+ avl_set_impl& operator=(BOOST_RV_REF(avl_set_impl) x)
{ tree_ = ::boost::move(x.tree_); return *this; }
- //! <b>Effects</b>: Detaches all elements from this. The objects in the avl_set
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the avl_set
//! are not deleted (i.e. no destructors are called).
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- ~avl_set_impl()
+ ~avl_set_impl()
{}
//! <b>Effects</b>: Returns an iterator pointing to the beginning of the avl_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator begin()
{ return tree_.begin(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the avl_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator begin() const
{ return tree_.begin(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the avl_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cbegin() const
{ return tree_.cbegin(); }
//! <b>Effects</b>: Returns an iterator pointing to the end of the avl_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator end()
{ return tree_.end(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the avl_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator end() const
{ return tree_.end(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the avl_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cend() const
{ return tree_.cend(); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning of the
//! reversed avl_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rbegin()
{ return tree_.rbegin(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed avl_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rbegin() const
{ return tree_.rbegin(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed avl_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crbegin() const
{ return tree_.crbegin(); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the end
//! of the reversed avl_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rend()
{ return tree_.rend(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed avl_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rend() const
{ return tree_.rend(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed avl_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crend() const
{ return tree_.crend(); }
//! <b>Precondition</b>: end_iterator must be a valid end iterator
//! of avl_set.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the avl_set associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static avl_set_impl &container_from_end_iterator(iterator end_iterator)
{
@@ -250,11 +250,11 @@ class avl_set_impl
//! <b>Precondition</b>: end_iterator must be a valid end const_iterator
//! of avl_set.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the set associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static const avl_set_impl &container_from_end_iterator(const_iterator end_iterator)
{
@@ -264,11 +264,11 @@ class avl_set_impl
}
//! <b>Precondition</b>: it must be a valid iterator of set.
- //!
+ //!
//! <b>Effects</b>: Returns a reference to the set associated to the iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
static avl_set_impl &container_from_iterator(iterator it)
{
@@ -278,11 +278,11 @@ class avl_set_impl
}
//! <b>Precondition</b>: it must be a valid const_iterator of set.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the set associated to the iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
static const avl_set_impl &container_from_iterator(const_iterator it)
{
@@ -292,42 +292,42 @@ class avl_set_impl
}
//! <b>Effects</b>: Returns the key_compare object used by the avl_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If key_compare copy-constructor throws.
key_compare key_comp() const
{ return tree_.value_comp(); }
//! <b>Effects</b>: Returns the value_compare object used by the avl_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If value_compare copy-constructor throws.
value_compare value_comp() const
{ return tree_.value_comp(); }
//! <b>Effects</b>: Returns true is the container is empty.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
bool empty() const
{ return tree_.empty(); }
//! <b>Effects</b>: Returns the number of elements stored in the avl_set.
- //!
+ //!
//! <b>Complexity</b>: Linear to elements contained in *this if,
//! constant-time size option is enabled. Constant-time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
size_type size() const
{ return tree_.size(); }
//! <b>Effects</b>: Swaps the contents of two sets.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If the swap() call for the comparison functor
//! found using ADL throws. Strong guarantee.
void swap(avl_set_impl& other)
@@ -337,22 +337,22 @@ class avl_set_impl
//! Cloner should yield to nodes equivalent to the original nodes.
//!
//! <b>Effects</b>: Erases all the elements from *this
- //! calling Disposer::operator()(pointer), clones all the
+ //! calling Disposer::operator()(pointer), clones all the
//! elements from src calling Cloner::operator()(const_reference )
//! and inserts them on *this. Copies the predicate from the source container.
//!
//! If cloner throws, all cloned elements are unlinked and disposed
//! calling Disposer::operator()(pointer).
- //!
+ //!
//! <b>Complexity</b>: Linear to erased plus inserted elements.
- //!
+ //!
//! <b>Throws</b>: If cloner throws or predicate copy assignment throws. Basic guarantee.
template <class Cloner, class Disposer>
void clone_from(const avl_set_impl &src, Cloner cloner, Disposer disposer)
{ tree_.clone_from(src.tree_, cloner, disposer); }
//! <b>Requires</b>: value must be an lvalue
- //!
+ //!
//! <b>Effects</b>: Treaps to inserts value into the avl_set.
//!
//! <b>Returns</b>: If the value
@@ -360,39 +360,39 @@ class avl_set_impl
//! iterator to the new value and true. If there is an equivalent value
//! returns a pair containing an iterator to the already present value
//! and false.
- //!
+ //!
//! <b>Complexity</b>: Average complexity for insert element is at
//! most logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
std::pair<iterator, bool> insert(reference value)
{ return tree_.insert_unique(value); }
//! <b>Requires</b>: value must be an lvalue
- //!
- //! <b>Effects</b>: Treaps to to insert x into the avl_set, using "hint"
+ //!
+ //! <b>Effects</b>: Treaps to to insert x into the avl_set, using "hint"
//! as a hint to where it will be inserted.
//!
- //! <b>Returns</b>: An iterator that points to the position where the
+ //! <b>Returns</b>: An iterator that points to the position where the
//! new element was inserted into the avl_set.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic in general, but it's amortized
//! constant time if t is inserted immediately before hint.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
iterator insert(const_iterator hint, reference value)
{ return tree_.insert_unique(hint, value); }
- //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
//! the same strict weak ordering as value_compare. The difference is that
//! key_value_comp compares an arbitrary key with the contained values.
- //!
+ //!
//! <b>Effects</b>: Checks if a value can be inserted in the avl_set, using
//! a user provided key instead of the value itself.
//!
@@ -401,16 +401,16 @@ class avl_set_impl
//! and false. If the value can be inserted returns true in the returned
//! pair boolean and fills "commit_data" that is meant to be used with
//! the "insert_commit" function.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is at most logarithmic.
//!
//! <b>Throws</b>: If the key_value_comp ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Notes</b>: This function is used to improve performance when constructing
//! a value_type is expensive: if there is an equivalent value
//! the constructed object must be discarded. Many times, the part of the
//! node that is used to impose the order is much cheaper to construct
- //! than the value_type and this function offers the possibility to use that
+ //! than the value_type and this function offers the possibility to use that
//! part to check if the insertion will be successful.
//!
//! If the check is successful, the user can construct the value_type and use
@@ -424,12 +424,12 @@ class avl_set_impl
(const KeyType &key, KeyValueCompare key_value_comp, insert_commit_data &commit_data)
{ return tree_.insert_unique_check(key, key_value_comp, commit_data); }
- //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
//! the same strict weak ordering as value_compare. The difference is that
//! key_value_comp compares an arbitrary key with the contained values.
- //!
+ //!
//! <b>Effects</b>: Checks if a value can be inserted in the avl_set, using
- //! a user provided key instead of the value itself, using "hint"
+ //! a user provided key instead of the value itself, using "hint"
//! as a hint to where it will be inserted.
//!
//! <b>Returns</b>: If there is an equivalent value
@@ -437,23 +437,23 @@ class avl_set_impl
//! and false. If the value can be inserted returns true in the returned
//! pair boolean and fills "commit_data" that is meant to be used with
//! the "insert_commit" function.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic in general, but it's amortized
//! constant time if t is inserted immediately before hint.
//!
//! <b>Throws</b>: If the key_value_comp ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Notes</b>: This function is used to improve performance when constructing
//! a value_type is expensive: if there is an equivalent value
//! the constructed object must be discarded. Many times, the part of the
//! constructing that is used to impose the order is much cheaper to construct
- //! than the value_type and this function offers the possibility to use that key
+ //! than the value_type and this function offers the possibility to use that key
//! to check if the insertion will be successful.
//!
//! If the check is successful, the user can construct the value_type and use
//! "insert_commit" to insert the object in constant-time. This can give a total
//! constant-time complexity to the insertion: check(O(1)) + commit(O(1)).
- //!
+ //!
//! "commit_data" remains valid for a subsequent "insert_commit" only if no more
//! objects are inserted or erased from the avl_set.
template<class KeyType, class KeyValueCompare>
@@ -466,33 +466,33 @@ class avl_set_impl
//! must have been obtained from a previous call to "insert_check".
//! No objects should have been inserted or erased from the avl_set between
//! the "insert_check" that filled "commit_data" and the call to "insert_commit".
- //!
+ //!
//! <b>Effects</b>: Inserts the value in the avl_set using the information obtained
//! from the "commit_data" that a previous "insert_check" filled.
//!
//! <b>Returns</b>: An iterator to the newly inserted object.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function has only sense if a "insert_check" has been
//! previously executed to fill "commit_data". No value should be inserted or
//! erased between the "insert_check" and "insert_commit" calls.
iterator insert_commit(reference value, const insert_commit_data &commit_data)
{ return tree_.insert_unique_commit(value, commit_data); }
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
//! of type value_type.
- //!
+ //!
//! <b>Effects</b>: Inserts a range into the avl_set.
- //!
+ //!
//! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
//! size of the range. However, it is linear in N if the range is already sorted
//! by value_comp().
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
template<class Iterator>
@@ -505,11 +505,11 @@ class avl_set_impl
//! inserted key according to the predicate.
//!
//! <b>Effects</b>: Inserts x into the tree before "pos".
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if "pos" is not
//! the successor of "value" or "value" is not unique tree ordering and uniqueness
//! invariants will be broken respectively.
@@ -522,11 +522,11 @@ class avl_set_impl
//! any inserted key according to the predicate.
//!
//! <b>Effects</b>: Inserts x into the tree in the last position.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if value is
//! less than or equal to the greatest inserted key tree ordering invariant will be broken.
//! This function is slightly more efficient than using "insert_before".
@@ -539,11 +539,11 @@ class avl_set_impl
//! than any inserted key according to the predicate.
//!
//! <b>Effects</b>: Inserts x into the tree in the first position.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if value is
//! greater than or equal to the the mimum inserted key tree ordering or uniqueness
//! invariants will be broken.
@@ -553,41 +553,41 @@ class avl_set_impl
void push_front(reference value)
{ tree_.push_front(value); }
- //! <b>Effects</b>: Erases the element pointed to by pos.
- //!
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //!
//! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //!
//! <b>Returns</b>: An iterator to the element after the erased element.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
iterator erase(const_iterator i)
{ return tree_.erase(i); }
- //! <b>Effects</b>: Erases the range pointed to by b end e.
- //!
- //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
//! O(log(size() + N)), where N is the number of elements in the range.
- //!
+ //!
//! <b>Returns</b>: An iterator to the element after the erased elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
iterator erase(const_iterator b, const_iterator e)
{ return tree_.erase(b, e); }
//! <b>Effects</b>: Erases all the elements with the given value.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size()) + this->count(value)).
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
size_type erase(const_reference value)
@@ -595,13 +595,13 @@ class avl_set_impl
//! <b>Effects</b>: Erases all the elements that compare equal with
//! the given key and the given comparison functor.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + this->count(key, comp)).
- //!
+ //!
//! <b>Throws</b>: If the comp ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class KeyType, class KeyValueCompare>
@@ -614,16 +614,16 @@ class avl_set_impl
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//!
- //! <b>Effects</b>: Erases the element pointed to by pos.
+ //! <b>Effects</b>: Erases the element pointed to by pos.
//! Disposer::operator()(pointer) is called for the removed element.
- //!
- //! <b>Complexity</b>: Average complexity for erase element is constant time.
- //!
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
//! <b>Returns</b>: An iterator to the element after the erased element.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
- //! <b>Note</b>: Invalidates the iterators
+ //!
+ //! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
iterator erase_and_dispose(const_iterator i, Disposer disposer)
@@ -639,14 +639,14 @@ class avl_set_impl
//!
//! <b>Effects</b>: Erases the range pointed to by b end e.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
- //! <b>Complexity</b>: Average complexity for erase range is at most
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
//! O(log(size() + N)), where N is the number of elements in the range.
- //!
+ //!
//! <b>Returns</b>: An iterator to the element after the erased elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
@@ -657,13 +657,13 @@ class avl_set_impl
//!
//! <b>Effects</b>: Erases all the elements with the given value.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + this->count(value)). Basic guarantee.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class Disposer>
@@ -677,11 +677,11 @@ class avl_set_impl
//! Disposer::operator()(pointer) is called for the removed elements.
//!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + this->count(key, comp)).
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class KeyType, class KeyValueCompare, class Disposer>
@@ -693,26 +693,26 @@ class avl_set_impl
{ return tree_.erase_and_dispose(key, comp, disposer); }
//! <b>Effects</b>: Erases all the elements of the container.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
void clear()
{ return tree_.clear(); }
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
- //!
+ //!
//! <b>Effects</b>: Erases all the elements of the container.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class Disposer>
@@ -720,20 +720,20 @@ class avl_set_impl
{ return tree_.clear_and_dispose(disposer); }
//! <b>Effects</b>: Returns the number of contained elements with the given key
- //!
+ //!
//! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
//! to number of objects with the given key.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
size_type count(const_reference value) const
{ return tree_.find(value) != end(); }
//! <b>Effects</b>: Returns the number of contained elements with the same key
//! compared with the given comparison functor.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
//! to number of objects with the given key.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
template<class KeyType, class KeyValueCompare>
size_type count(const KeyType& key, KeyValueCompare comp) const
@@ -741,9 +741,9 @@ class avl_set_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
iterator lower_bound(const_reference value)
{ return tree_.lower_bound(value); }
@@ -753,13 +753,13 @@ class avl_set_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns an iterator to the first element whose
- //! key according to the comparison functor is not less than k or
+ //! key according to the comparison functor is not less than k or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
- //!
+ //!
//! <b>Note</b>: This function is used when constructing a value_type
//! is expensive and the value_type can be compared with a cheaper
//! key type. Usually this key is part of the value_type.
@@ -769,9 +769,9 @@ class avl_set_impl
//! <b>Effects</b>: Returns a const iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
const_iterator lower_bound(const_reference value) const
{ return tree_.lower_bound(value); }
@@ -781,13 +781,13 @@ class avl_set_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns a const_iterator to the first element whose
- //! key according to the comparison functor is not less than k or
+ //! key according to the comparison functor is not less than k or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
- //!
+ //!
//! <b>Note</b>: This function is used when constructing a value_type
//! is expensive and the value_type can be compared with a cheaper
//! key type. Usually this key is part of the value_type.
@@ -797,9 +797,9 @@ class avl_set_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is greater than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
iterator upper_bound(const_reference value)
{ return tree_.upper_bound(value); }
@@ -809,11 +809,11 @@ class avl_set_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns an iterator to the first element whose
- //! key according to the comparison functor is greater than key or
+ //! key according to the comparison functor is greater than key or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -825,9 +825,9 @@ class avl_set_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is greater than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
const_iterator upper_bound(const_reference value) const
{ return tree_.upper_bound(value); }
@@ -837,11 +837,11 @@ class avl_set_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns a const_iterator to the first element whose
- //! key according to the comparison functor is greater than key or
+ //! key according to the comparison functor is greater than key or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -851,11 +851,11 @@ class avl_set_impl
const_iterator upper_bound(const KeyType& key, KeyValueCompare comp) const
{ return tree_.upper_bound(key, comp); }
- //! <b>Effects</b>: Finds an iterator to the first element whose value is
+ //! <b>Effects</b>: Finds an iterator to the first element whose value is
//! "value" or end() if that element does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
iterator find(const_reference value)
{ return tree_.find(value); }
@@ -864,12 +864,12 @@ class avl_set_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds an iterator to the first element whose key is
- //! "key" according to the comparison functor or end() if that element
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
//! does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -879,11 +879,11 @@ class avl_set_impl
iterator find(const KeyType& key, KeyValueCompare comp)
{ return tree_.find(key, comp); }
- //! <b>Effects</b>: Finds a const_iterator to the first element whose value is
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose value is
//! "value" or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
const_iterator find(const_reference value) const
{ return tree_.find(value); }
@@ -892,12 +892,12 @@ class avl_set_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
- //! "key" according to the comparison functor or end() if that element
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
//! does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -910,9 +910,9 @@ class avl_set_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
std::pair<iterator,iterator> equal_range(const_reference value)
{ return tree_.equal_range(value); }
@@ -921,13 +921,13 @@ class avl_set_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds a range containing all elements whose key is k
- //! according to the comparison functor or an empty range
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
//! that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -940,9 +940,9 @@ class avl_set_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
std::pair<const_iterator, const_iterator>
equal_range(const_reference value) const
@@ -952,13 +952,13 @@ class avl_set_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds a range containing all elements whose key is k
- //! according to the comparison functor or an empty range
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
//! that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -969,16 +969,101 @@ class avl_set_impl
equal_range(const KeyType& key, KeyValueCompare comp) const
{ return tree_.equal_range(key, comp); }
+ //! <b>Requires</b>: 'lower_value' must not be greater than 'upper_value'. If
+ //! 'lower_value' == 'upper_value', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_value and upper_value.
+ std::pair<iterator,iterator> bounded_range
+ (const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed)
+ { return tree_.bounded_range(lower_value, upper_value, left_closed, right_closed); }
+
+ //! <b>Requires</b>: KeyValueCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise
+ //!
+ //! second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator,iterator> bounded_range
+ (const KeyType& lower_key, const KeyType& upper_key, KeyValueCompare comp, bool left_closed, bool right_closed)
+ { return tree_.bounded_range(lower_key, upper_key, comp, left_closed, right_closed); }
+
+ //! <b>Requires</b>: 'lower_value' must not be greater than 'upper_value'. If
+ //! 'lower_value' == 'upper_value', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_value and upper_value.
+ std::pair<const_iterator, const_iterator>
+ bounded_range(const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed) const
+ { return tree_.bounded_range(lower_value, upper_value, left_closed, right_closed); }
+
+ //! <b>Requires</b>: KeyValueCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise
+ //!
+ //! second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<const_iterator, const_iterator>
+ bounded_range
+ (const KeyType& lower_key, const KeyType& upper_key, KeyValueCompare comp, bool left_closed, bool right_closed) const
+ { return tree_.bounded_range(lower_key, upper_key, comp, left_closed, right_closed); }
+
//! <b>Requires</b>: value must be an lvalue and shall be in a avl_set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator i belonging to the avl_set
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
static iterator s_iterator_to(reference value)
@@ -986,14 +1071,14 @@ class avl_set_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a avl_set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
//! avl_set that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
static const_iterator s_iterator_to(const_reference value)
@@ -1001,48 +1086,48 @@ class avl_set_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a avl_set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator i belonging to the avl_set
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator iterator_to(reference value)
{ return tree_.iterator_to(value); }
//! <b>Requires</b>: value must be an lvalue and shall be in a avl_set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
//! avl_set that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator iterator_to(const_reference value) const
{ return tree_.iterator_to(value); }
//! <b>Requires</b>: value shall not be in a avl_set/avl_multiset.
- //!
+ //!
//! <b>Effects</b>: init_node puts the hook of a value in a well-known default
//! state.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Note</b>: This function puts the hook in the well-known default state
//! used by auto_unlink and safe hooks.
static void init_node(reference value)
{ tree_type::init_node(value); }
//! <b>Effects</b>: Unlinks the leftmost node from the tree.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function breaks the tree and the tree can
//! only be used for more unlink_leftmost_without_rebalance calls.
//! This function is normally used to achieve a step by step
@@ -1052,14 +1137,14 @@ class avl_set_impl
//! <b>Requires</b>: replace_this must be a valid iterator of *this
//! and with_this must not be inserted in any tree.
- //!
+ //!
//! <b>Effects</b>: Replaces replace_this in its position in the
//! tree with with_this. The tree does not need to be rebalanced.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! with_this is not equivalent to *replace_this according to the
//! ordering rules. This function is faster than erasing and inserting
@@ -1233,9 +1318,9 @@ class avl_set
#endif
-//! The class template avl_multiset is an intrusive container, that mimics most of
+//! The class template avl_multiset is an intrusive container, that mimics most of
//! the interface of std::avl_multiset as described in the C++ standard.
-//!
+//!
//! The template parameter \c T is the type to be managed by the container.
//! The user can specify additional options and if no options are provided
//! default options are used.
@@ -1289,30 +1374,30 @@ class avl_multiset_impl
/// @endcond
public:
- //! <b>Effects</b>: Constructs an empty avl_multiset.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //! <b>Effects</b>: Constructs an empty avl_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
- //! or the copy constructor/operator() of the value_compare object throws.
+ //! or the copy constructor/operator() of the value_compare object throws.
avl_multiset_impl( const value_compare &cmp = value_compare()
- , const value_traits &v_traits = value_traits())
+ , const value_traits &v_traits = value_traits())
: tree_(cmp, v_traits)
{}
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
//! cmp must be a comparison function that induces a strict weak ordering.
- //!
- //! <b>Effects</b>: Constructs an empty avl_multiset and inserts elements from
+ //!
+ //! <b>Effects</b>: Constructs an empty avl_multiset and inserts elements from
//! [b, e).
- //!
+ //!
//! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
//! comp and otherwise N * log N, where N is the distance between first and last
- //!
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
- //! or the copy constructor/operator() of the value_compare object throws.
+ //! or the copy constructor/operator() of the value_compare object throws.
template<class Iterator>
avl_multiset_impl( Iterator b, Iterator e
, const value_compare &cmp = value_compare()
@@ -1321,135 +1406,135 @@ class avl_multiset_impl
{}
//! <b>Effects</b>: to-do
- //!
- avl_multiset_impl(BOOST_RV_REF(avl_multiset_impl) x)
+ //!
+ avl_multiset_impl(BOOST_RV_REF(avl_multiset_impl) x)
: tree_(::boost::move(x.tree_))
{}
//! <b>Effects</b>: to-do
- //!
- avl_multiset_impl& operator=(BOOST_RV_REF(avl_multiset_impl) x)
+ //!
+ avl_multiset_impl& operator=(BOOST_RV_REF(avl_multiset_impl) x)
{ tree_ = ::boost::move(x.tree_); return *this; }
- //! <b>Effects</b>: Detaches all elements from this. The objects in the avl_multiset
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the avl_multiset
//! are not deleted (i.e. no destructors are called).
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- ~avl_multiset_impl()
+ ~avl_multiset_impl()
{}
//! <b>Effects</b>: Returns an iterator pointing to the beginning of the avl_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator begin()
{ return tree_.begin(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the avl_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator begin() const
{ return tree_.begin(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the avl_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cbegin() const
{ return tree_.cbegin(); }
//! <b>Effects</b>: Returns an iterator pointing to the end of the avl_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator end()
{ return tree_.end(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the avl_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator end() const
{ return tree_.end(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the avl_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cend() const
{ return tree_.cend(); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning of the
//! reversed avl_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rbegin()
{ return tree_.rbegin(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed avl_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rbegin() const
{ return tree_.rbegin(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed avl_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crbegin() const
{ return tree_.crbegin(); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the end
//! of the reversed avl_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rend()
{ return tree_.rend(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed avl_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rend() const
{ return tree_.rend(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed avl_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crend() const
{ return tree_.crend(); }
//! <b>Precondition</b>: end_iterator must be a valid end iterator
//! of avl_multiset.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the avl_multiset associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static avl_multiset_impl &container_from_end_iterator(iterator end_iterator)
{
@@ -1460,11 +1545,11 @@ class avl_multiset_impl
//! <b>Precondition</b>: end_iterator must be a valid end const_iterator
//! of avl_multiset.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the avl_multiset associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static const avl_multiset_impl &container_from_end_iterator(const_iterator end_iterator)
{
@@ -1474,11 +1559,11 @@ class avl_multiset_impl
}
//! <b>Precondition</b>: it must be a valid iterator of multiset.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the multiset associated to the iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
static avl_multiset_impl &container_from_iterator(iterator it)
{
@@ -1488,11 +1573,11 @@ class avl_multiset_impl
}
//! <b>Precondition</b>: it must be a valid const_iterator of multiset.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the multiset associated to the iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
static const avl_multiset_impl &container_from_iterator(const_iterator it)
{
@@ -1502,42 +1587,42 @@ class avl_multiset_impl
}
//! <b>Effects</b>: Returns the key_compare object used by the avl_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If key_compare copy-constructor throws.
key_compare key_comp() const
{ return tree_.value_comp(); }
//! <b>Effects</b>: Returns the value_compare object used by the avl_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If value_compare copy-constructor throws.
value_compare value_comp() const
{ return tree_.value_comp(); }
//! <b>Effects</b>: Returns true is the container is empty.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
bool empty() const
{ return tree_.empty(); }
//! <b>Effects</b>: Returns the number of elements stored in the avl_multiset.
- //!
+ //!
//! <b>Complexity</b>: Linear to elements contained in *this if,
//! constant-time size option is enabled. Constant-time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
size_type size() const
{ return tree_.size(); }
//! <b>Effects</b>: Swaps the contents of two avl_multisets.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If the swap() call for the comparison functor
//! found using ADL throws. Strong guarantee.
void swap(avl_multiset_impl& other)
@@ -1547,69 +1632,69 @@ class avl_multiset_impl
//! Cloner should yield to nodes equivalent to the original nodes.
//!
//! <b>Effects</b>: Erases all the elements from *this
- //! calling Disposer::operator()(pointer), clones all the
+ //! calling Disposer::operator()(pointer), clones all the
//! elements from src calling Cloner::operator()(const_reference )
//! and inserts them on *this. Copies the predicate from the source container.
//!
//! If cloner throws, all cloned elements are unlinked and disposed
//! calling Disposer::operator()(pointer).
- //!
+ //!
//! <b>Complexity</b>: Linear to erased plus inserted elements.
- //!
+ //!
//! <b>Throws</b>: If cloner throws or predicate copy assignment throws. Basic guarantee.
template <class Cloner, class Disposer>
void clone_from(const avl_multiset_impl &src, Cloner cloner, Disposer disposer)
{ tree_.clone_from(src.tree_, cloner, disposer); }
//! <b>Requires</b>: value must be an lvalue
- //!
+ //!
//! <b>Effects</b>: Inserts value into the avl_multiset.
- //!
+ //!
//! <b>Returns</b>: An iterator that points to the position where the new
//! element was inserted.
- //!
+ //!
//! <b>Complexity</b>: Average complexity for insert element is at
//! most logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
iterator insert(reference value)
{ return tree_.insert_equal(value); }
//! <b>Requires</b>: value must be an lvalue
- //!
+ //!
//! <b>Effects</b>: Inserts x into the avl_multiset, using pos as a hint to
//! where it will be inserted.
- //!
+ //!
//! <b>Returns</b>: An iterator that points to the position where the new
//! element was inserted.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic in general, but it is amortized
//! constant time if t is inserted immediately before hint.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
iterator insert(const_iterator hint, reference value)
{ return tree_.insert_equal(hint, value); }
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
//! of type value_type.
- //!
+ //!
//! <b>Effects</b>: Inserts a range into the avl_multiset.
- //!
+ //!
//! <b>Returns</b>: An iterator that points to the position where the new
//! element was inserted.
- //!
+ //!
//! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
//! size of the range. However, it is linear in N if the range is already sorted
//! by value_comp().
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
template<class Iterator>
@@ -1622,11 +1707,11 @@ class avl_multiset_impl
//! inserted key according to the predicate.
//!
//! <b>Effects</b>: Inserts x into the tree before "pos".
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if "pos" is not
//! the successor of "value" or "value" is not unique tree ordering and uniqueness
//! invariants will be broken respectively.
@@ -1639,11 +1724,11 @@ class avl_multiset_impl
//! any inserted key according to the predicate.
//!
//! <b>Effects</b>: Inserts x into the tree in the last position.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if value is
//! less than or equal to the greatest inserted key tree ordering invariant will be broken.
//! This function is slightly more efficient than using "insert_before".
@@ -1656,11 +1741,11 @@ class avl_multiset_impl
//! than any inserted key according to the predicate.
//!
//! <b>Effects</b>: Inserts x into the tree in the first position.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if value is
//! greater than or equal to the the mimum inserted key tree ordering or uniqueness
//! invariants will be broken.
@@ -1670,41 +1755,41 @@ class avl_multiset_impl
void push_front(reference value)
{ tree_.push_front(value); }
- //! <b>Effects</b>: Erases the element pointed to by pos.
- //!
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //!
//! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //!
//! <b>Returns</b>: An iterator to the element after the erased element.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
iterator erase(const_iterator i)
{ return tree_.erase(i); }
- //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
//!
//! <b>Returns</b>: An iterator to the element after the erased elements.
- //!
- //! <b>Complexity</b>: Average complexity for erase range is at most
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
//! O(log(size() + N)), where N is the number of elements in the range.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
iterator erase(const_iterator b, const_iterator e)
{ return tree_.erase(b, e); }
//! <b>Effects</b>: Erases all the elements with the given value.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + this->count(value)).
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
size_type erase(const_reference value)
@@ -1712,13 +1797,13 @@ class avl_multiset_impl
//! <b>Effects</b>: Erases all the elements that compare equal with
//! the given key and the given comparison functor.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + this->count(key, comp)).
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class KeyType, class KeyValueCompare>
@@ -1733,14 +1818,14 @@ class avl_multiset_impl
//!
//! <b>Returns</b>: An iterator to the element after the erased element.
//!
- //! <b>Effects</b>: Erases the element pointed to by pos.
+ //! <b>Effects</b>: Erases the element pointed to by pos.
//! Disposer::operator()(pointer) is called for the removed element.
- //!
- //! <b>Complexity</b>: Average complexity for erase element is constant time.
- //!
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
//! <b>Throws</b>: Nothing.
- //!
- //! <b>Note</b>: Invalidates the iterators
+ //!
+ //! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
iterator erase_and_dispose(const_iterator i, Disposer disposer)
@@ -1758,12 +1843,12 @@ class avl_multiset_impl
//!
//! <b>Effects</b>: Erases the range pointed to by b end e.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
- //! <b>Complexity</b>: Average complexity for erase range is at most
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
//! O(log(size() + N)), where N is the number of elements in the range.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
@@ -1774,13 +1859,13 @@ class avl_multiset_impl
//!
//! <b>Effects</b>: Erases all the elements with the given value.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + this->count(value)).
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class Disposer>
@@ -1794,11 +1879,11 @@ class avl_multiset_impl
//! Disposer::operator()(pointer) is called for the removed elements.
//!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + this->count(key, comp)).
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class KeyType, class KeyValueCompare, class Disposer>
@@ -1810,26 +1895,26 @@ class avl_multiset_impl
{ return tree_.erase_and_dispose(key, comp, disposer); }
//! <b>Effects</b>: Erases all the elements of the container.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
void clear()
{ return tree_.clear(); }
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
- //!
+ //!
//! <b>Effects</b>: Erases all the elements of the container.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class Disposer>
@@ -1837,20 +1922,20 @@ class avl_multiset_impl
{ return tree_.clear_and_dispose(disposer); }
//! <b>Effects</b>: Returns the number of contained elements with the given key
- //!
+ //!
//! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
//! to number of objects with the given key.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
size_type count(const_reference value) const
{ return tree_.count(value); }
//! <b>Effects</b>: Returns the number of contained elements with the same key
//! compared with the given comparison functor.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
//! to number of objects with the given key.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
template<class KeyType, class KeyValueCompare>
size_type count(const KeyType& key, KeyValueCompare comp) const
@@ -1858,9 +1943,9 @@ class avl_multiset_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
iterator lower_bound(const_reference value)
{ return tree_.lower_bound(value); }
@@ -1870,13 +1955,13 @@ class avl_multiset_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns an iterator to the first element whose
- //! key according to the comparison functor is not less than k or
+ //! key according to the comparison functor is not less than k or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
- //!
+ //!
//! <b>Note</b>: This function is used when constructing a value_type
//! is expensive and the value_type can be compared with a cheaper
//! key type. Usually this key is part of the value_type.
@@ -1886,9 +1971,9 @@ class avl_multiset_impl
//! <b>Effects</b>: Returns a const iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
const_iterator lower_bound(const_reference value) const
{ return tree_.lower_bound(value); }
@@ -1898,13 +1983,13 @@ class avl_multiset_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns a const_iterator to the first element whose
- //! key according to the comparison functor is not less than k or
+ //! key according to the comparison functor is not less than k or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
- //!
+ //!
//! <b>Note</b>: This function is used when constructing a value_type
//! is expensive and the value_type can be compared with a cheaper
//! key type. Usually this key is part of the value_type.
@@ -1914,9 +1999,9 @@ class avl_multiset_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is greater than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
iterator upper_bound(const_reference value)
{ return tree_.upper_bound(value); }
@@ -1926,11 +2011,11 @@ class avl_multiset_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns an iterator to the first element whose
- //! key according to the comparison functor is greater than key or
+ //! key according to the comparison functor is greater than key or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -1942,9 +2027,9 @@ class avl_multiset_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is greater than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
const_iterator upper_bound(const_reference value) const
{ return tree_.upper_bound(value); }
@@ -1954,11 +2039,11 @@ class avl_multiset_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns a const_iterator to the first element whose
- //! key according to the comparison functor is greater than key or
+ //! key according to the comparison functor is greater than key or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -1968,11 +2053,11 @@ class avl_multiset_impl
const_iterator upper_bound(const KeyType& key, KeyValueCompare comp) const
{ return tree_.upper_bound(key, comp); }
- //! <b>Effects</b>: Finds an iterator to the first element whose value is
+ //! <b>Effects</b>: Finds an iterator to the first element whose value is
//! "value" or end() if that element does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
iterator find(const_reference value)
{ return tree_.find(value); }
@@ -1981,12 +2066,12 @@ class avl_multiset_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds an iterator to the first element whose key is
- //! "key" according to the comparison functor or end() if that element
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
//! does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -1996,11 +2081,11 @@ class avl_multiset_impl
iterator find(const KeyType& key, KeyValueCompare comp)
{ return tree_.find(key, comp); }
- //! <b>Effects</b>: Finds a const_iterator to the first element whose value is
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose value is
//! "value" or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
const_iterator find(const_reference value) const
{ return tree_.find(value); }
@@ -2009,12 +2094,12 @@ class avl_multiset_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
- //! "key" according to the comparison functor or end() if that element
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
//! does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -2027,9 +2112,9 @@ class avl_multiset_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
std::pair<iterator,iterator> equal_range(const_reference value)
{ return tree_.equal_range(value); }
@@ -2038,13 +2123,13 @@ class avl_multiset_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds a range containing all elements whose key is k
- //! according to the comparison functor or an empty range
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
//! that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -2057,9 +2142,9 @@ class avl_multiset_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
std::pair<const_iterator, const_iterator>
equal_range(const_reference value) const
@@ -2069,13 +2154,13 @@ class avl_multiset_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds a range containing all elements whose key is k
- //! according to the comparison functor or an empty range
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
//! that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -2086,16 +2171,101 @@ class avl_multiset_impl
equal_range(const KeyType& key, KeyValueCompare comp) const
{ return tree_.equal_range(key, comp); }
+ //! <b>Requires</b>: 'lower_value' must not be greater than 'upper_value'. If
+ //! 'lower_value' == 'upper_value', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_value and upper_value.
+ std::pair<iterator,iterator> bounded_range
+ (const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed)
+ { return tree_.bounded_range(lower_value, upper_value, left_closed, right_closed); }
+
+ //! <b>Requires</b>: KeyValueCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise
+ //!
+ //! second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator,iterator> bounded_range
+ (const KeyType& lower_key, const KeyType& upper_key, KeyValueCompare comp, bool left_closed, bool right_closed)
+ { return tree_.bounded_range(lower_key, upper_key, comp, left_closed, right_closed); }
+
+ //! <b>Requires</b>: 'lower_value' must not be greater than 'upper_value'. If
+ //! 'lower_value' == 'upper_value', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_value and upper_value.
+ std::pair<const_iterator, const_iterator>
+ bounded_range(const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed) const
+ { return tree_.bounded_range(lower_value, upper_value, left_closed, right_closed); }
+
+ //! <b>Requires</b>: KeyValueCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise
+ //!
+ //! second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<const_iterator, const_iterator>
+ bounded_range
+ (const KeyType& lower_key, const KeyType& upper_key, KeyValueCompare comp, bool left_closed, bool right_closed) const
+ { return tree_.bounded_range(lower_key, upper_key, comp, left_closed, right_closed); }
+
//! <b>Requires</b>: value must be an lvalue and shall be in a avl_multiset of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator i belonging to the avl_multiset
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
static iterator s_iterator_to(reference value)
@@ -2103,14 +2273,14 @@ class avl_multiset_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a avl_multiset of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
//! avl_multiset that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
static const_iterator s_iterator_to(const_reference value)
@@ -2118,48 +2288,48 @@ class avl_multiset_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a avl_multiset of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator i belonging to the avl_multiset
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator iterator_to(reference value)
{ return tree_.iterator_to(value); }
//! <b>Requires</b>: value must be an lvalue and shall be in a avl_multiset of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
//! avl_multiset that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator iterator_to(const_reference value) const
{ return tree_.iterator_to(value); }
//! <b>Requires</b>: value shall not be in a avl_multiset/avl_multiset.
- //!
+ //!
//! <b>Effects</b>: init_node puts the hook of a value in a well-known default
//! state.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Note</b>: This function puts the hook in the well-known default state
//! used by auto_unlink and safe hooks.
static void init_node(reference value)
{ tree_type::init_node(value); }
//! <b>Effects</b>: Unlinks the leftmost node from the tree.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function breaks the tree and the tree can
//! only be used for more unlink_leftmost_without_rebalance calls.
//! This function is normally used to achieve a step by step
@@ -2169,14 +2339,14 @@ class avl_multiset_impl
//! <b>Requires</b>: replace_this must be a valid iterator of *this
//! and with_this must not be inserted in any tree.
- //!
+ //!
//! <b>Effects</b>: Replaces replace_this in its position in the
//! tree with with_this. The tree does not need to be rebalanced.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! with_this is not equivalent to *replace_this according to the
//! ordering rules. This function is faster than erasing and inserting
@@ -2290,7 +2460,7 @@ template<class T, class O1, class O2, class O3, class O4>
template<class T, class ...Options>
#endif
class avl_multiset
- : public make_avl_multiset<T,
+ : public make_avl_multiset<T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -2350,8 +2520,8 @@ class avl_multiset
#endif
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/avl_set_hook.hpp b/boost/intrusive/avl_set_hook.hpp
index 23b1f0bd8f..825921f509 100644
--- a/boost/intrusive/avl_set_hook.hpp
+++ b/boost/intrusive/avl_set_hook.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2007-2009
+// (C) Copyright Ion Gaztanaga 2007-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -61,16 +61,16 @@ struct make_avl_set_base_hook
typedef implementation_defined type;
};
-//! Derive a class from avl_set_base_hook in order to store objects in
-//! in an avl_set/avl_multiset. avl_set_base_hook holds the data necessary to maintain
+//! Derive a class from avl_set_base_hook in order to store objects in
+//! in an avl_set/avl_multiset. avl_set_base_hook holds the data necessary to maintain
//! the avl_set/avl_multiset and provides an appropriate value_traits class for avl_set/avl_multiset.
-//!
+//!
//! The hook admits the following options: \c tag<>, \c void_pointer<>,
//! \c link_mode<> and \c optimize_size<>.
//!
-//! \c tag<> defines a tag to identify the node.
-//! The same tag value can be used in different classes, but if a class is
-//! derived from more than one \c list_base_hook, then each \c list_base_hook needs its
+//! \c tag<> defines a tag to identify the node.
+//! The same tag value can be used in different classes, but if a class is
+//! derived from more than one \c list_base_hook, then each \c list_base_hook needs its
//! unique tag.
//!
//! \c void_pointer<> is the pointer type that will be used internally in the hook
@@ -99,27 +99,27 @@ class avl_set_base_hook
public:
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
avl_set_base_hook();
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state. The argument is ignored.
- //!
- //! <b>Throws</b>: Nothing.
- //!
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
//! <b>Rationale</b>: Providing a copy-constructor
- //! makes classes using the hook STL-compliant without forcing the
+ //! makes classes using the hook STL-compliant without forcing the
//! user to do some additional work. \c swap can be used to emulate
//! move-semantics.
avl_set_base_hook(const avl_set_base_hook& );
//! <b>Effects</b>: Empty function. The argument is ignored.
- //!
- //! <b>Throws</b>: Nothing.
- //!
- //! <b>Rationale</b>: Providing an assignment operator
- //! makes classes using the hook STL-compliant without forcing the
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing an assignment operator
+ //! makes classes using the hook STL-compliant without forcing the
//! user to do some additional work. \c swap can be used to emulate
//! move-semantics.
avl_set_base_hook& operator=(const avl_set_base_hook& );
@@ -128,37 +128,37 @@ class avl_set_base_hook
//! nothing (ie. no code is generated). If link_mode is \c safe_link and the
//! object is stored in a set an assertion is raised. If link_mode is
//! \c auto_unlink and \c is_linked() is true, the node is unlinked.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
~avl_set_base_hook();
- //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
- //! related to those nodes in one or two containers. That is, if the node
- //! this is part of the element e1, the node x is part of the element e2
- //! and both elements are included in the containers s1 and s2, then after
- //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
- //! at the position of e1. If one element is not in a container, then
- //! after the swap-operation the other element is not in a container.
- //! Iterators to e1 and e2 related to those nodes are invalidated.
+ //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
+ //! related to those nodes in one or two containers. That is, if the node
+ //! this is part of the element e1, the node x is part of the element e2
+ //! and both elements are included in the containers s1 and s2, then after
+ //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
+ //! at the position of e1. If one element is not in a container, then
+ //! after the swap-operation the other element is not in a container.
+ //! Iterators to e1 and e2 related to those nodes are invalidated.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Constant
//!
- //! <b>Throws</b>: Nothing.
+ //! <b>Throws</b>: Nothing.
void swap_nodes(avl_set_base_hook &other);
//! <b>Precondition</b>: link_mode must be \c safe_link or \c auto_unlink.
//!
//! <b>Returns</b>: true, if the node belongs to a container, false
- //! otherwise. This function can be used to test whether \c set::iterator_to
- //! will return a valid iterator.
+ //! otherwise. This function can be used to test whether \c set::iterator_to
+ //! will return a valid iterator.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Constant
bool is_linked() const;
//! <b>Effects</b>: Removes the node if it's inserted in a container.
//! This function is only allowed if link_mode is \c auto_unlink.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
void unlink();
#endif
};
@@ -195,7 +195,7 @@ struct make_avl_set_member_hook
//! Put a public data member avl_set_member_hook in order to store objects of this class in
//! an avl_set/avl_multiset. avl_set_member_hook holds the data necessary for maintaining the
//! avl_set/avl_multiset and provides an appropriate value_traits class for avl_set/avl_multiset.
-//!
+//!
//! The hook admits the following options: \c void_pointer<>,
//! \c link_mode<> and \c optimize_size<>.
//!
@@ -225,27 +225,27 @@ class avl_set_member_hook
public:
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
avl_set_member_hook();
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state. The argument is ignored.
- //!
- //! <b>Throws</b>: Nothing.
- //!
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
//! <b>Rationale</b>: Providing a copy-constructor
- //! makes classes using the hook STL-compliant without forcing the
+ //! makes classes using the hook STL-compliant without forcing the
//! user to do some additional work. \c swap can be used to emulate
//! move-semantics.
avl_set_member_hook(const avl_set_member_hook& );
//! <b>Effects</b>: Empty function. The argument is ignored.
- //!
- //! <b>Throws</b>: Nothing.
- //!
- //! <b>Rationale</b>: Providing an assignment operator
- //! makes classes using the hook STL-compliant without forcing the
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing an assignment operator
+ //! makes classes using the hook STL-compliant without forcing the
//! user to do some additional work. \c swap can be used to emulate
//! move-semantics.
avl_set_member_hook& operator=(const avl_set_member_hook& );
@@ -254,43 +254,43 @@ class avl_set_member_hook
//! nothing (ie. no code is generated). If link_mode is \c safe_link and the
//! object is stored in a set an assertion is raised. If link_mode is
//! \c auto_unlink and \c is_linked() is true, the node is unlinked.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
~avl_set_member_hook();
- //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
- //! related to those nodes in one or two containers. That is, if the node
- //! this is part of the element e1, the node x is part of the element e2
- //! and both elements are included in the containers s1 and s2, then after
- //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
- //! at the position of e1. If one element is not in a container, then
- //! after the swap-operation the other element is not in a container.
- //! Iterators to e1 and e2 related to those nodes are invalidated.
+ //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
+ //! related to those nodes in one or two containers. That is, if the node
+ //! this is part of the element e1, the node x is part of the element e2
+ //! and both elements are included in the containers s1 and s2, then after
+ //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
+ //! at the position of e1. If one element is not in a container, then
+ //! after the swap-operation the other element is not in a container.
+ //! Iterators to e1 and e2 related to those nodes are invalidated.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Constant
//!
- //! <b>Throws</b>: Nothing.
+ //! <b>Throws</b>: Nothing.
void swap_nodes(avl_set_member_hook &other);
//! <b>Precondition</b>: link_mode must be \c safe_link or \c auto_unlink.
//!
//! <b>Returns</b>: true, if the node belongs to a container, false
- //! otherwise. This function can be used to test whether \c set::iterator_to
- //! will return a valid iterator.
+ //! otherwise. This function can be used to test whether \c set::iterator_to
+ //! will return a valid iterator.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Constant
bool is_linked() const;
//! <b>Effects</b>: Removes the node if it's inserted in a container.
//! This function is only allowed if link_mode is \c auto_unlink.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
void unlink();
#endif
};
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/avltree.hpp b/boost/intrusive/avltree.hpp
index 20903ddef7..84376a87c7 100644
--- a/boost/intrusive/avltree.hpp
+++ b/boost/intrusive/avltree.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2007-2009
+// (C) Copyright Ion Gaztanaga 2007-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -65,7 +65,7 @@ struct avl_set_defaults
//! The class template avltree is an intrusive AVL tree container, that
//! is used to construct intrusive avl_set and avl_multiset containers.
-//! The no-throw guarantee holds only, if the value_compare object
+//! The no-throw guarantee holds only, if the value_compare object
//! doesn't throw.
//!
//! The template parameter \c T is the type to be managed by the container.
@@ -134,7 +134,7 @@ class avltree_impl
//noncopyable, movable
BOOST_MOVABLE_BUT_NOT_COPYABLE(avltree_impl)
- enum { safemode_or_autounlink =
+ enum { safemode_or_autounlink =
(int)real_value_traits::link_mode == (int)auto_unlink ||
(int)real_value_traits::link_mode == (int)safe_link };
@@ -160,7 +160,7 @@ class avltree_impl
{}
node_plus_pred_t node_plus_pred_;
} data_;
-
+
const value_compare &priv_comp() const
{ return data_.node_plus_pred_.get(); }
@@ -212,18 +212,18 @@ class avltree_impl
typedef typename node_algorithms::insert_commit_data insert_commit_data;
- //! <b>Effects</b>: Constructs an empty tree.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //! <b>Effects</b>: Constructs an empty tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
//! or the copy constructor of the value_compare object throws. Basic guarantee.
avltree_impl( const value_compare &cmp = value_compare()
- , const value_traits &v_traits = value_traits())
+ , const value_traits &v_traits = value_traits())
: data_(cmp, v_traits)
- {
- node_algorithms::init_header(this->priv_header_ptr());
+ {
+ node_algorithms::init_header(this->priv_header_ptr());
this->priv_size_traits().set_size(size_type(0));
}
@@ -235,7 +235,7 @@ class avltree_impl
//!
//! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
//! comp and otherwise N * log N, where N is the distance between first and last.
- //!
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
//! or the copy constructor/operator() of the value_compare object throws. Basic guarantee.
@@ -254,58 +254,58 @@ class avltree_impl
}
//! <b>Effects</b>: to-do
- //!
+ //!
avltree_impl(BOOST_RV_REF(avltree_impl) x)
: data_(::boost::move(x.priv_comp()), ::boost::move(x.priv_value_traits()))
{
- node_algorithms::init_header(this->priv_header_ptr());
+ node_algorithms::init_header(this->priv_header_ptr());
this->priv_size_traits().set_size(size_type(0));
this->swap(x);
}
//! <b>Effects</b>: to-do
- //!
- avltree_impl& operator=(BOOST_RV_REF(avltree_impl) x)
+ //!
+ avltree_impl& operator=(BOOST_RV_REF(avltree_impl) x)
{ this->swap(x); return *this; }
- //! <b>Effects</b>: Detaches all elements from this. The objects in the set
- //! are not deleted (i.e. no destructors are called), but the nodes according to
- //! the value_traits template parameter are reinitialized and thus can be reused.
- //!
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the set
+ //! are not deleted (i.e. no destructors are called), but the nodes according to
+ //! the value_traits template parameter are reinitialized and thus can be reused.
+ //!
//! <b>Complexity</b>: Linear to elements contained in *this.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- ~avltree_impl()
+ ~avltree_impl()
{}
//! <b>Effects</b>: Returns an iterator pointing to the beginning of the tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator begin()
{ return iterator (node_traits::get_left(this->priv_header_ptr()), this); }
//! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator begin() const
{ return cbegin(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cbegin() const
{ return const_iterator (node_traits::get_left(this->priv_header_ptr()), this); }
//! <b>Effects</b>: Returns an iterator pointing to the end of the tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator end()
{ return iterator (this->priv_header_ptr(), this); }
@@ -313,138 +313,138 @@ class avltree_impl
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the tree.
//!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator end() const
{ return cend(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cend() const
{ return const_iterator (uncast(this->priv_header_ptr()), this); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning of the
//! reversed tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rbegin()
{ return reverse_iterator(end()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rbegin() const
{ return const_reverse_iterator(end()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crbegin() const
{ return const_reverse_iterator(end()); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the end
//! of the reversed tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rend()
{ return reverse_iterator(begin()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rend() const
{ return const_reverse_iterator(begin()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crend() const
{ return const_reverse_iterator(begin()); }
//! <b>Precondition</b>: end_iterator must be a valid end iterator
//! of avltree.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the avltree associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static avltree_impl &container_from_end_iterator(iterator end_iterator)
{ return priv_container_from_end_iterator(end_iterator); }
//! <b>Precondition</b>: end_iterator must be a valid end const_iterator
//! of avltree.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the avltree associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static const avltree_impl &container_from_end_iterator(const_iterator end_iterator)
{ return priv_container_from_end_iterator(end_iterator); }
//! <b>Precondition</b>: it must be a valid iterator
//! of rbtree.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the tree associated to the iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
static avltree_impl &container_from_iterator(iterator it)
{ return priv_container_from_iterator(it); }
//! <b>Precondition</b>: it must be a valid end const_iterator
//! of rbtree.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the tree associated to the iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
static const avltree_impl &container_from_iterator(const_iterator it)
{ return priv_container_from_iterator(it); }
//! <b>Effects</b>: Returns the value_compare object used by the tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If value_compare copy-constructor throws.
value_compare value_comp() const
{ return priv_comp(); }
//! <b>Effects</b>: Returns true if the container is empty.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
bool empty() const
{ return node_algorithms::unique(this->priv_header_ptr()); }
//! <b>Effects</b>: Returns the number of elements stored in the tree.
- //!
+ //!
//! <b>Complexity</b>: Linear to elements contained in *this
//! if constant-time size option is disabled. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
size_type size() const
{
@@ -456,9 +456,9 @@ class avltree_impl
}
//! <b>Effects</b>: Swaps the contents of two avltrees.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If the comparison functor's swap call throws.
void swap(avltree_impl& other)
{
@@ -475,14 +475,14 @@ class avltree_impl
}
//! <b>Requires</b>: value must be an lvalue
- //!
+ //!
//! <b>Effects</b>: Inserts value into the tree before the upper bound.
- //!
+ //!
//! <b>Complexity</b>: Average complexity for insert element is at
//! most logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
iterator insert_equal(reference value)
@@ -500,16 +500,16 @@ class avltree_impl
//! <b>Requires</b>: value must be an lvalue, and "hint" must be
//! a valid iterator.
- //!
+ //!
//! <b>Effects</b>: Inserts x into the tree, using "hint" as a hint to
//! where it will be inserted. If "hint" is the upper_bound
//! the insertion takes constant time (two comparisons in the worst case)
- //!
+ //!
//! <b>Complexity</b>: Logarithmic in general, but it is amortized
//! constant time if t is inserted immediately before hint.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
iterator insert_equal(const_iterator hint, reference value)
@@ -525,18 +525,18 @@ class avltree_impl
return ret;
}
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
//! of type value_type.
- //!
+ //!
//! <b>Effects</b>: Inserts a each element of a range into the tree
//! before the upper bound of the key of each element.
- //!
+ //!
//! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
//! size of the range. However, it is linear in N if the range is already sorted
//! by value_comp().
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
template<class Iterator>
@@ -548,15 +548,15 @@ class avltree_impl
}
//! <b>Requires</b>: value must be an lvalue
- //!
+ //!
//! <b>Effects</b>: Inserts value into the tree if the value
//! is not already present.
- //!
+ //!
//! <b>Complexity</b>: Average complexity for insert element is at
//! most logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
std::pair<iterator, bool> insert_unique(reference value)
@@ -570,16 +570,16 @@ class avltree_impl
//! <b>Requires</b>: value must be an lvalue, and "hint" must be
//! a valid iterator
- //!
+ //!
//! <b>Effects</b>: Tries to insert x into the tree, using "hint" as a hint
//! to where it will be inserted.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic in general, but it is amortized
//! constant time (two comparisons in the worst case)
//! if t is inserted immediately before hint.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
iterator insert_unique(const_iterator hint, reference value)
@@ -591,17 +591,17 @@ class avltree_impl
return insert_unique_commit(value, commit_data);
}
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
//! of type value_type.
- //!
+ //!
//! <b>Effects</b>: Tries to insert each element of a range into the tree.
- //!
- //! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
- //! size of the range. However, it is linear in N if the range is already sorted
+ //!
+ //! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
+ //! size of the range. However, it is linear in N if the range is already sorted
//! by value_comp().
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
template<class Iterator>
@@ -618,10 +618,10 @@ class avltree_impl
}
}
- //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
//! the same strict weak ordering as value_compare. The difference is that
//! key_value_comp compares an arbitrary key with the contained values.
- //!
+ //!
//! <b>Effects</b>: Checks if a value can be inserted in the container, using
//! a user provided key instead of the value itself.
//!
@@ -630,16 +630,16 @@ class avltree_impl
//! and false. If the value can be inserted returns true in the returned
//! pair boolean and fills "commit_data" that is meant to be used with
//! the "insert_commit" function.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is at most logarithmic.
//!
//! <b>Throws</b>: If the key_value_comp ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Notes</b>: This function is used to improve performance when constructing
//! a value_type is expensive: if there is an equivalent value
//! the constructed object must be discarded. Many times, the part of the
//! node that is used to impose the order is much cheaper to construct
- //! than the value_type and this function offers the possibility to use that
+ //! than the value_type and this function offers the possibility to use that
//! part to check if the insertion will be successful.
//!
//! If the check is successful, the user can construct the value_type and use
@@ -654,18 +654,18 @@ class avltree_impl
{
detail::key_nodeptr_comp<KeyValueCompare, avltree_impl>
comp(key_value_comp, this);
- std::pair<node_ptr, bool> ret =
+ std::pair<node_ptr, bool> ret =
(node_algorithms::insert_unique_check
(this->priv_header_ptr(), key, comp, commit_data));
return std::pair<iterator, bool>(iterator(ret.first, this), ret.second);
}
- //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
//! the same strict weak ordering as value_compare. The difference is that
//! key_value_comp compares an arbitrary key with the contained values.
- //!
+ //!
//! <b>Effects</b>: Checks if a value can be inserted in the container, using
- //! a user provided key instead of the value itself, using "hint"
+ //! a user provided key instead of the value itself, using "hint"
//! as a hint to where it will be inserted.
//!
//! <b>Returns</b>: If there is an equivalent value
@@ -673,23 +673,23 @@ class avltree_impl
//! and false. If the value can be inserted returns true in the returned
//! pair boolean and fills "commit_data" that is meant to be used with
//! the "insert_commit" function.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic in general, but it's amortized
//! constant time if t is inserted immediately before hint.
//!
//! <b>Throws</b>: If the key_value_comp ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Notes</b>: This function is used to improve performance when constructing
//! a value_type is expensive: if there is an equivalent value
//! the constructed object must be discarded. Many times, the part of the
//! constructing that is used to impose the order is much cheaper to construct
- //! than the value_type and this function offers the possibility to use that key
+ //! than the value_type and this function offers the possibility to use that key
//! to check if the insertion will be successful.
//!
//! If the check is successful, the user can construct the value_type and use
//! "insert_commit" to insert the object in constant-time. This can give a total
//! constant-time complexity to the insertion: check(O(1)) + commit(O(1)).
- //!
+ //!
//! "commit_data" remains valid for a subsequent "insert_commit" only if no more
//! objects are inserted or erased from the container.
template<class KeyType, class KeyValueCompare>
@@ -699,7 +699,7 @@ class avltree_impl
{
detail::key_nodeptr_comp<KeyValueCompare, avltree_impl>
comp(key_value_comp, this);
- std::pair<node_ptr, bool> ret =
+ std::pair<node_ptr, bool> ret =
(node_algorithms::insert_unique_check
(this->priv_header_ptr(), hint.pointed_node(), key, comp, commit_data));
return std::pair<iterator, bool>(iterator(ret.first, this), ret.second);
@@ -709,16 +709,16 @@ class avltree_impl
//! must have been obtained from a previous call to "insert_check".
//! No objects should have been inserted or erased from the container between
//! the "insert_check" that filled "commit_data" and the call to "insert_commit".
- //!
+ //!
//! <b>Effects</b>: Inserts the value in the avl_set using the information obtained
//! from the "commit_data" that a previous "insert_check" filled.
//!
//! <b>Returns</b>: An iterator to the newly inserted object.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function has only sense if a "insert_check" has been
//! previously executed to fill "commit_data". No value should be inserted or
//! erased between the "insert_check" and "insert_commit" calls.
@@ -738,11 +738,11 @@ class avltree_impl
//! once inserted according to the predicate
//!
//! <b>Effects</b>: Inserts x into the tree before "pos".
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if "pos" is not
//! the successor of "value" tree ordering invariant will be broken.
//! This is a low-level function to be used only for performance reasons
@@ -762,11 +762,11 @@ class avltree_impl
//! than the greatest inserted key
//!
//! <b>Effects</b>: Inserts x into the tree in the last position.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if value is
//! less than the greatest inserted key tree ordering invariant will be broken.
//! This function is slightly more efficient than using "insert_before".
@@ -785,11 +785,11 @@ class avltree_impl
//! than the minimum inserted key
//!
//! <b>Effects</b>: Inserts x into the tree in the first position.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if value is
//! greater than the minimum inserted key tree ordering invariant will be broken.
//! This function is slightly more efficient than using "insert_before".
@@ -804,12 +804,12 @@ class avltree_impl
this->priv_size_traits().increment();
}
- //! <b>Effects</b>: Erases the element pointed to by pos.
- //!
- //! <b>Complexity</b>: Average complexity for erase element is constant time.
- //!
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
iterator erase(const_iterator i)
@@ -826,26 +826,26 @@ class avltree_impl
return ret.unconst();
}
- //! <b>Effects</b>: Erases the range pointed to by b end e.
- //!
- //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
//! O(log(size() + N)), where N is the number of elements in the range.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
iterator erase(const_iterator b, const_iterator e)
{ size_type n; return private_erase(b, e, n); }
//! <b>Effects</b>: Erases all the elements with the given value.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + N).
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
size_type erase(const_reference value)
@@ -855,11 +855,11 @@ class avltree_impl
//! according to the comparison functor "comp".
//!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + N).
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class KeyType, class KeyValueCompare>
@@ -877,14 +877,14 @@ class avltree_impl
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//!
- //! <b>Effects</b>: Erases the element pointed to by pos.
+ //! <b>Effects</b>: Erases the element pointed to by pos.
//! Disposer::operator()(pointer) is called for the removed element.
- //!
- //! <b>Complexity</b>: Average complexity for erase element is constant time.
- //!
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
//! <b>Throws</b>: Nothing.
- //!
- //! <b>Note</b>: Invalidates the iterators
+ //!
+ //! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
iterator erase_and_dispose(const_iterator i, Disposer disposer)
@@ -905,12 +905,12 @@ class avltree_impl
//!
//! <b>Effects</b>: Erases the range pointed to by b end e.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
- //! <b>Complexity</b>: Average complexity for erase range is at most
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
//! O(log(size() + N)), where N is the number of elements in the range.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
@@ -921,13 +921,13 @@ class avltree_impl
//!
//! <b>Effects</b>: Erases all the elements with the given value.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + N).
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class Disposer>
@@ -946,11 +946,11 @@ class avltree_impl
//! Disposer::operator()(pointer) is called for the removed elements.
//!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + N).
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class KeyType, class KeyValueCompare, class Disposer>
@@ -966,13 +966,13 @@ class avltree_impl
return n;
}
- //! <b>Effects</b>: Erases all of the elements.
- //!
+ //! <b>Effects</b>: Erases all of the elements.
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
void clear()
@@ -990,9 +990,9 @@ class avltree_impl
//! each node to be erased.
//! <b>Complexity</b>: Average complexity for is at most O(log(size() + N)),
//! where N is the number of elements in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. Calls N times to disposer functor.
template<class Disposer>
@@ -1005,19 +1005,19 @@ class avltree_impl
}
//! <b>Effects</b>: Returns the number of contained elements with the given value
- //!
+ //!
//! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
//! to number of objects with the given value.
- //!
+ //!
//! <b>Throws</b>: Nothing.
size_type count(const_reference value) const
{ return this->count(value, priv_comp()); }
//! <b>Effects</b>: Returns the number of contained elements with the given key
- //!
+ //!
//! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
//! to number of objects with the given key.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
size_type count(const KeyType &key, KeyValueCompare comp) const
@@ -1028,27 +1028,27 @@ class avltree_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator lower_bound(const_reference value)
{ return this->lower_bound(value, priv_comp()); }
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator lower_bound(const_reference value) const
{ return this->lower_bound(value, priv_comp()); }
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
iterator lower_bound(const KeyType &key, KeyValueCompare comp)
@@ -1061,9 +1061,9 @@ class avltree_impl
//! <b>Effects</b>: Returns a const iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
const_iterator lower_bound(const KeyType &key, KeyValueCompare comp) const
@@ -1076,9 +1076,9 @@ class avltree_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is greater than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator upper_bound(const_reference value)
{ return this->upper_bound(value, priv_comp()); }
@@ -1088,7 +1088,7 @@ class avltree_impl
//! does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
iterator upper_bound(const KeyType &key, KeyValueCompare comp)
@@ -1101,9 +1101,9 @@ class avltree_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is greater than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator upper_bound(const_reference value) const
{ return this->upper_bound(value, priv_comp()); }
@@ -1113,7 +1113,7 @@ class avltree_impl
//! does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
const_iterator upper_bound(const KeyType &key, KeyValueCompare comp) const
@@ -1124,20 +1124,20 @@ class avltree_impl
(this->priv_header_ptr(), key, key_node_comp), this);
}
- //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
//! k or end() if that element does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator find(const_reference value)
{ return this->find(value, priv_comp()); }
- //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
//! k or end() if that element does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
iterator find(const KeyType &key, KeyValueCompare comp)
@@ -1148,20 +1148,20 @@ class avltree_impl
(node_algorithms::find(this->priv_header_ptr(), key, key_node_comp), this);
}
- //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
//! k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator find(const_reference value) const
{ return this->find(value, priv_comp()); }
- //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
//! k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
const_iterator find(const KeyType &key, KeyValueCompare comp) const
@@ -1175,9 +1175,9 @@ class avltree_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
std::pair<iterator,iterator> equal_range(const_reference value)
{ return this->equal_range(value, priv_comp()); }
@@ -1185,9 +1185,9 @@ class avltree_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
std::pair<iterator,iterator> equal_range(const KeyType &key, KeyValueCompare comp)
@@ -1202,9 +1202,9 @@ class avltree_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
std::pair<const_iterator, const_iterator>
equal_range(const_reference value) const
@@ -1213,9 +1213,9 @@ class avltree_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
std::pair<const_iterator, const_iterator>
@@ -1228,19 +1228,117 @@ class avltree_impl
return std::pair<const_iterator, const_iterator>(const_iterator(ret.first, this), const_iterator(ret.second, this));
}
+ //! <b>Requires</b>: 'lower_value' must not be greater than 'upper_value'. If
+ //! 'lower_value' == 'upper_value', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_value and upper_value.
+ std::pair<iterator,iterator> bounded_range
+ (const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed)
+ { return this->bounded_range(lower_value, upper_value, priv_comp(), left_closed, right_closed); }
+
+ //! <b>Requires</b>: KeyValueCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise
+ //!
+ //! second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator,iterator> bounded_range
+ (const KeyType &lower_key, const KeyType &upper_key, KeyValueCompare comp, bool left_closed, bool right_closed)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, avltree_impl>
+ key_node_comp(comp, this);
+ std::pair<node_ptr, node_ptr> ret
+ (node_algorithms::bounded_range
+ (this->priv_header_ptr(), lower_key, upper_key, key_node_comp, left_closed, right_closed));
+ return std::pair<iterator, iterator>(iterator(ret.first, this), iterator(ret.second, this));
+ }
+
+ //! <b>Requires</b>: 'lower_value' must not be greater than 'upper_value'. If
+ //! 'lower_value' == 'upper_value', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_value and upper_value.
+ std::pair<const_iterator,const_iterator> bounded_range
+ (const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed) const
+ { return this->bounded_range(lower_value, upper_value, priv_comp(), left_closed, right_closed); }
+
+ //! <b>Requires</b>: KeyValueCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise
+ //!
+ //! second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<const_iterator,const_iterator> bounded_range
+ (const KeyType &lower_key, const KeyType &upper_key, KeyValueCompare comp, bool left_closed, bool right_closed) const
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, avltree_impl>
+ key_node_comp(comp, this);
+ std::pair<node_ptr, node_ptr> ret
+ (node_algorithms::bounded_range
+ (this->priv_header_ptr(), lower_key, upper_key, key_node_comp, left_closed, right_closed));
+ return std::pair<const_iterator, const_iterator>(const_iterator(ret.first, this), const_iterator(ret.second, this));
+ }
+
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//! Cloner should yield to nodes equivalent to the original nodes.
//!
//! <b>Effects</b>: Erases all the elements from *this
- //! calling Disposer::operator()(pointer), clones all the
+ //! calling Disposer::operator()(pointer), clones all the
//! elements from src calling Cloner::operator()(const_reference )
//! and inserts them on *this. Copies the predicate from the source container.
//!
//! If cloner throws, all cloned elements are unlinked and disposed
//! calling Disposer::operator()(pointer).
- //!
+ //!
//! <b>Complexity</b>: Linear to erased plus inserted elements.
- //!
+ //!
//! <b>Throws</b>: If cloner throws or predicate copy assignment throws. Basic guarantee.
template <class Cloner, class Disposer>
void clone_from(const avltree_impl &src, Cloner cloner, Disposer disposer)
@@ -1261,11 +1359,11 @@ class avltree_impl
}
//! <b>Effects</b>: Unlinks the leftmost node from the tree.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function breaks the tree and the tree can
//! only be used for more unlink_leftmost_without_rebalance calls.
//! This function is normally used to achieve a step by step
@@ -1284,14 +1382,14 @@ class avltree_impl
//! <b>Requires</b>: replace_this must be a valid iterator of *this
//! and with_this must not be inserted in any tree.
- //!
+ //!
//! <b>Effects</b>: Replaces replace_this in its position in the
//! tree with with_this. The tree does not need to be rebalanced.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! with_this is not equivalent to *replace_this according to the
//! ordering rules. This function is faster than erasing and inserting
@@ -1307,14 +1405,14 @@ class avltree_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator i belonging to the set
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
static iterator s_iterator_to(reference value)
@@ -1325,17 +1423,17 @@ class avltree_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
//! set that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
- static const_iterator s_iterator_to(const_reference value)
+ static const_iterator s_iterator_to(const_reference value)
{
BOOST_STATIC_ASSERT((!stateful_value_traits));
return const_iterator (value_traits::to_node_ptr(const_cast<reference> (value)), 0);
@@ -1343,37 +1441,37 @@ class avltree_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator i belonging to the set
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator iterator_to(reference value)
{ return iterator (value_traits::to_node_ptr(value), this); }
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
//! set that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator iterator_to(const_reference value) const
{ return const_iterator (value_traits::to_node_ptr(const_cast<reference> (value)), this); }
//! <b>Requires</b>: value shall not be in a tree.
- //!
+ //!
//! <b>Effects</b>: init_node puts the hook of a value in a well-known default
//! state.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Note</b>: This function puts the hook in the well-known default state
//! used by auto_unlink and safe hooks.
static void init_node(reference value)
@@ -1381,12 +1479,12 @@ class avltree_impl
/*
//! <b>Effects</b>: removes x from a tree of the appropriate type. It has no effect,
- //! if x is not in such a tree.
- //!
+ //! if x is not in such a tree.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Note</b>: This static function is only usable with the "safe mode"
//! hook and non-constant time size lists. Otherwise, the user must use
//! the non-static "erase(reference )" member. If the user calls
@@ -1396,7 +1494,7 @@ class avltree_impl
static void remove_node(T& value)
{
//This function is only usable for safe mode hooks and non-constant
- //time lists.
+ //time lists.
//BOOST_STATIC_ASSERT((!(safemode_or_autounlink && constant_time_size)));
BOOST_STATIC_ASSERT((!constant_time_size));
BOOST_STATIC_ASSERT((boost::is_convertible<T, value_type>::value));
@@ -1680,8 +1778,8 @@ class avltree
#endif
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/avltree_algorithms.hpp b/boost/intrusive/avltree_algorithms.hpp
index 9b917c767d..11463c71fb 100644
--- a/boost/intrusive/avltree_algorithms.hpp
+++ b/boost/intrusive/avltree_algorithms.hpp
@@ -1,7 +1,7 @@
/////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Daniel K. O. 2005.
-// (C) Copyright Ion Gaztanaga 2007.
+// (C) Copyright Ion Gaztanaga 2007-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -45,25 +45,25 @@ namespace intrusive {
//! <b>Static functions</b>:
//!
//! <tt>static node_ptr get_parent(const_node_ptr n);</tt>
-//!
+//!
//! <tt>static void set_parent(node_ptr n, node_ptr parent);</tt>
//!
//! <tt>static node_ptr get_left(const_node_ptr n);</tt>
-//!
+//!
//! <tt>static void set_left(node_ptr n, node_ptr left);</tt>
//!
//! <tt>static node_ptr get_right(const_node_ptr n);</tt>
-//!
+//!
//! <tt>static void set_right(node_ptr n, node_ptr right);</tt>
-//!
+//!
//! <tt>static balance get_balance(const_node_ptr n);</tt>
-//!
+//!
//! <tt>static void set_balance(node_ptr n, balance b);</tt>
-//!
+//!
//! <tt>static balance negative();</tt>
-//!
+//!
//! <tt>static balance zero();</tt>
-//!
+//!
//! <tt>static balance positive();</tt>
template<class NodeTraits>
class avltree_algorithms
@@ -88,7 +88,7 @@ class avltree_algorithms
avltree_node_cloner(F f)
: base_t(f)
{}
-
+
node_ptr operator()(const node_ptr &p)
{
node_ptr n = base_t::get()(p);
@@ -120,27 +120,27 @@ class avltree_algorithms
//! <b>Requires</b>: header1 and header2 must be the header nodes
//! of two trees.
- //!
- //! <b>Effects</b>: Swaps two trees. After the function header1 will contain
+ //!
+ //! <b>Effects</b>: Swaps two trees. After the function header1 will contain
//! links to the second tree and header2 will have links to the first tree.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
static void swap_tree(const node_ptr & header1, const node_ptr & header2)
{ return tree_algorithms::swap_tree(header1, header2); }
//! <b>Requires</b>: node1 and node2 can't be header nodes
//! of two trees.
- //!
+ //!
//! <b>Effects</b>: Swaps two nodes. After the function node1 will be inserted
//! in the position node2 before the function. node2 will be inserted in the
//! position node1 had before the function.
- //!
- //! <b>Complexity</b>: Logarithmic.
- //!
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! node1 and node2 are not equivalent according to the ordering rules.
//!
@@ -149,22 +149,22 @@ class avltree_algorithms
{
if(node1 == node2)
return;
-
+
node_ptr header1(tree_algorithms::get_header(node1)), header2(tree_algorithms::get_header(node2));
swap_nodes(node1, header1, node2, header2);
}
//! <b>Requires</b>: node1 and node2 can't be header nodes
//! of two trees with header header1 and header2.
- //!
+ //!
//! <b>Effects</b>: Swaps two nodes. After the function node1 will be inserted
//! in the position node2 before the function. node2 will be inserted in the
//! position node1 had before the function.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! node1 and node2 are not equivalent according to the ordering rules.
//!
@@ -176,20 +176,20 @@ class avltree_algorithms
tree_algorithms::swap_nodes(node1, header1, node2, header2);
//Swap balance
balance c = NodeTraits::get_balance(node1);
- NodeTraits::set_balance(node1, NodeTraits::get_balance(node2));
- NodeTraits::set_balance(node2, c);
+ NodeTraits::set_balance(node1, NodeTraits::get_balance(node2));
+ NodeTraits::set_balance(node2, c);
}
//! <b>Requires</b>: node_to_be_replaced must be inserted in a tree
//! and new_node must not be inserted in a tree.
- //!
+ //!
//! <b>Effects</b>: Replaces node_to_be_replaced in its position in the
//! tree with new_node. The tree does not need to be rebalanced
- //!
- //! <b>Complexity</b>: Logarithmic.
- //!
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! new_node is not equivalent to node_to_be_replaced according to the
//! ordering rules. This function is faster than erasing and inserting
@@ -205,14 +205,14 @@ class avltree_algorithms
//! <b>Requires</b>: node_to_be_replaced must be inserted in a tree
//! with header "header" and new_node must not be inserted in a tree.
- //!
+ //!
//! <b>Effects</b>: Replaces node_to_be_replaced in its position in the
//! tree with new_node. The tree does not need to be rebalanced
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! new_node is not equivalent to node_to_be_replaced according to the
//! ordering rules. This function is faster than erasing and inserting
@@ -222,15 +222,15 @@ class avltree_algorithms
static void replace_node(const node_ptr & node_to_be_replaced, const node_ptr & header, const node_ptr & new_node)
{
tree_algorithms::replace_node(node_to_be_replaced, header, new_node);
- NodeTraits::set_balance(new_node, NodeTraits::get_balance(node_to_be_replaced));
+ NodeTraits::set_balance(new_node, NodeTraits::get_balance(node_to_be_replaced));
}
//! <b>Requires</b>: node is a tree node but not the header.
- //!
+ //!
//! <b>Effects</b>: Unlinks the node and rebalances the tree.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static void unlink(const node_ptr & node)
{
@@ -243,14 +243,14 @@ class avltree_algorithms
}
//! <b>Requires</b>: header is the header of a tree.
- //!
+ //!
//! <b>Effects</b>: Unlinks the leftmost node from the tree, and
//! updates the header link to the new leftmost node.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function breaks the tree and the tree can
//! only be used for more unlink_leftmost_without_rebalance calls.
//! This function is normally used to achieve a step by step
@@ -260,51 +260,51 @@ class avltree_algorithms
//! <b>Requires</b>: node is a node of the tree or an node initialized
//! by init(...).
- //!
+ //!
//! <b>Effects</b>: Returns true if the node is initialized by init().
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static bool unique(const const_node_ptr & node)
{ return tree_algorithms::unique(node); }
//! <b>Requires</b>: node is a node of the tree but it's not the header.
- //!
+ //!
//! <b>Effects</b>: Returns the number of nodes of the subtree.
- //!
+ //!
//! <b>Complexity</b>: Linear time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static std::size_t count(const const_node_ptr & node)
{ return tree_algorithms::count(node); }
//! <b>Requires</b>: header is the header node of the tree.
- //!
+ //!
//! <b>Effects</b>: Returns the number of nodes above the header.
- //!
+ //!
//! <b>Complexity</b>: Linear time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static std::size_t size(const const_node_ptr & header)
{ return tree_algorithms::size(header); }
//! <b>Requires</b>: p is a node from the tree except the header.
- //!
+ //!
//! <b>Effects</b>: Returns the next node of the tree.
- //!
+ //!
//! <b>Complexity</b>: Average constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static node_ptr next_node(const node_ptr & p)
{ return tree_algorithms::next_node(p); }
//! <b>Requires</b>: p is a node from the tree except the leftmost node.
- //!
+ //!
//! <b>Effects</b>: Returns the previous node of the tree.
- //!
+ //!
//! <b>Complexity</b>: Average constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static node_ptr prev_node(const node_ptr & p)
{ return tree_algorithms::prev_node(p); }
@@ -312,9 +312,9 @@ class avltree_algorithms
//! <b>Requires</b>: node must not be part of any tree.
//!
//! <b>Effects</b>: After the function unique(node) == true.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
//!
//! <b>Nodes</b>: If node is inserted in a tree, this function corrupts the tree.
@@ -325,25 +325,25 @@ class avltree_algorithms
//!
//! <b>Effects</b>: Initializes the header to represent an empty tree.
//! unique(header) == true.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
//!
//! <b>Nodes</b>: If node is inserted in a tree, this function corrupts the tree.
static void init_header(const node_ptr & header)
{
tree_algorithms::init_header(header);
- NodeTraits::set_balance(header, NodeTraits::zero());
+ NodeTraits::set_balance(header, NodeTraits::zero());
}
//! <b>Requires</b>: header must be the header of a tree, z a node
//! of that tree and z != header.
//!
//! <b>Effects</b>: Erases node "z" from the tree with header "header".
- //!
+ //!
//! <b>Complexity</b>: Amortized constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static node_ptr erase(const node_ptr & header, const node_ptr & z)
{
@@ -361,18 +361,18 @@ class avltree_algorithms
//! object taking a node_ptr and returning a new cloned node of it. "disposer" must
//! take a node_ptr and shouldn't throw.
//!
- //! <b>Effects</b>: First empties target tree calling
+ //! <b>Effects</b>: First empties target tree calling
//! <tt>void disposer::operator()(const node_ptr &)</tt> for every node of the tree
//! except the header.
- //!
+ //!
//! Then, duplicates the entire tree pointed by "source_header" cloning each
- //! source node with <tt>node_ptr Cloner::operator()(const node_ptr &)</tt> to obtain
+ //! source node with <tt>node_ptr Cloner::operator()(const node_ptr &)</tt> to obtain
//! the nodes of the target tree. If "cloner" throws, the cloned target nodes
//! are disposed using <tt>void disposer(const node_ptr &)</tt>.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of element of the source tree plus the.
//! number of elements of tree target tree when calling this function.
- //!
+ //!
//! <b>Throws</b>: If cloner functor throws. If this happens target nodes are disposed.
template <class Cloner, class Disposer>
static void clone
@@ -385,13 +385,13 @@ class avltree_algorithms
//! <b>Requires</b>: "disposer" must be an object function
//! taking a node_ptr parameter and shouldn't throw.
//!
- //! <b>Effects</b>: Empties the target tree calling
+ //! <b>Effects</b>: Empties the target tree calling
//! <tt>void disposer::operator()(const node_ptr &)</tt> for every node of the tree
//! except the header.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of element of the source tree plus the.
//! number of elements of tree target tree when calling this function.
- //!
+ //!
//! <b>Throws</b>: If cloner functor throws. If this happens target nodes are disposed.
template<class Disposer>
static void clear_and_dispose(const node_ptr & header, Disposer disposer)
@@ -407,7 +407,7 @@ class avltree_algorithms
//! not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class KeyType, class KeyNodePtrCompare>
static node_ptr lower_bound
@@ -423,7 +423,7 @@ class avltree_algorithms
//! than "key" according to "comp" or "header" if that element does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class KeyType, class KeyNodePtrCompare>
static node_ptr upper_bound
@@ -439,7 +439,7 @@ class avltree_algorithms
//! "key" according to "comp" or "header" if that element does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class KeyType, class KeyNodePtrCompare>
static node_ptr find
@@ -457,13 +457,38 @@ class avltree_algorithms
//! if they there are no equivalent elements.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class KeyType, class KeyNodePtrCompare>
static std::pair<node_ptr, node_ptr> equal_range
(const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp)
{ return tree_algorithms::equal_range(header, key, comp); }
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyNodePtrCompare>
+ static std::pair<node_ptr, node_ptr> bounded_range
+ (const const_node_ptr & header, const KeyType &lower_key, const KeyType &upper_key, KeyNodePtrCompare comp
+ , bool left_closed, bool right_closed)
+ { return tree_algorithms::bounded_range(header, lower_key, upper_key, comp, left_closed, right_closed); }
+
//! <b>Requires</b>: "h" must be the header node of a tree.
//! NodePtrCompare is a function object that induces a strict weak
//! ordering compatible with the strict weak ordering used to create the
@@ -471,10 +496,10 @@ class avltree_algorithms
//!
//! <b>Effects</b>: Inserts new_node into the tree before the upper bound
//! according to "comp".
- //!
+ //!
//! <b>Complexity</b>: Average complexity for insert element is at
//! most logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class NodePtrCompare>
static node_ptr insert_equal_upper_bound
@@ -492,10 +517,10 @@ class avltree_algorithms
//!
//! <b>Effects</b>: Inserts new_node into the tree before the lower bound
//! according to "comp".
- //!
+ //!
//! <b>Complexity</b>: Average complexity for insert element is at
//! most logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class NodePtrCompare>
static node_ptr insert_equal_lower_bound
@@ -511,14 +536,14 @@ class avltree_algorithms
//! ordering compatible with the strict weak ordering used to create the
//! the tree. NodePtrCompare compares two node_ptrs. "hint" is node from
//! the "header"'s tree.
- //!
+ //!
//! <b>Effects</b>: Inserts new_node into the tree, using "hint" as a hint to
//! where it will be inserted. If "hint" is the upper_bound
//! the insertion takes constant time (two comparisons in the worst case).
//!
//! <b>Complexity</b>: Logarithmic in general, but it is amortized
//! constant time if new_node is inserted immediately before "hint".
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class NodePtrCompare>
static node_ptr insert_equal
@@ -534,13 +559,13 @@ class avltree_algorithms
//! "pos" must be an iterator pointing to the successor to "new_node"
//! once inserted according to the order of already inserted nodes. This function does not
//! check "pos" and this precondition must be guaranteed by the caller.
- //!
+ //!
//! <b>Effects</b>: Inserts new_node into the tree before "pos".
//!
//! <b>Complexity</b>: Constant-time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: If "pos" is not the successor of the newly inserted "new_node"
//! tree invariants might be broken.
static node_ptr insert_before
@@ -554,13 +579,13 @@ class avltree_algorithms
//! <b>Requires</b>: "header" must be the header node of a tree.
//! "new_node" must be, according to the used ordering no less than the
//! greatest inserted key.
- //!
+ //!
//! <b>Effects</b>: Inserts new_node into the tree before "pos".
//!
//! <b>Complexity</b>: Constant-time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: If "new_node" is less than the greatest inserted key
//! tree invariants are broken. This function is slightly faster than
//! using "insert_before".
@@ -573,13 +598,13 @@ class avltree_algorithms
//! <b>Requires</b>: "header" must be the header node of a tree.
//! "new_node" must be, according to the used ordering, no greater than the
//! lowest inserted key.
- //!
+ //!
//! <b>Effects</b>: Inserts new_node into the tree before "pos".
//!
//! <b>Complexity</b>: Constant-time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: If "new_node" is greater than the lowest inserted key
//! tree invariants are broken. This function is slightly faster than
//! using "insert_before".
@@ -593,7 +618,7 @@ class avltree_algorithms
//! KeyNodePtrCompare is a function object that induces a strict weak
//! ordering compatible with the strict weak ordering used to create the
//! the tree. NodePtrCompare compares KeyType with a node_ptr.
- //!
+ //!
//! <b>Effects</b>: Checks if there is an equivalent node to "key" in the
//! tree according to "comp" and obtains the needed information to realize
//! a constant-time node insertion if there is no equivalent node.
@@ -604,11 +629,11 @@ class avltree_algorithms
//! in the returned pair's boolean and fills "commit_data" that is meant to
//! be used with the "insert_commit" function to achieve a constant-time
//! insertion function.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is at most logarithmic.
//!
//! <b>Throws</b>: If "comp" throws.
- //!
+ //!
//! <b>Notes</b>: This function is used to improve performance when constructing
//! a node is expensive and the user does not want to have two equivalent nodes
//! in the tree: if there is an equivalent value
@@ -634,12 +659,12 @@ class avltree_algorithms
//! ordering compatible with the strict weak ordering used to create the
//! the tree. NodePtrCompare compares KeyType with a node_ptr.
//! "hint" is node from the "header"'s tree.
- //!
+ //!
//! <b>Effects</b>: Checks if there is an equivalent node to "key" in the
//! tree according to "comp" using "hint" as a hint to where it should be
//! inserted and obtains the needed information to realize
- //! a constant-time node insertion if there is no equivalent node.
- //! If "hint" is the upper_bound the function has constant time
+ //! a constant-time node insertion if there is no equivalent node.
+ //! If "hint" is the upper_bound the function has constant time
//! complexity (two comparisons in the worst case).
//!
//! <b>Returns</b>: If there is an equivalent value
@@ -648,12 +673,12 @@ class avltree_algorithms
//! in the returned pair's boolean and fills "commit_data" that is meant to
//! be used with the "insert_commit" function to achieve a constant-time
//! insertion function.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is at most logarithmic, but it is
//! amortized constant time if new_node should be inserted immediately before "hint".
//!
//! <b>Throws</b>: If "comp" throws.
- //!
+ //!
//! <b>Notes</b>: This function is used to improve performance when constructing
//! a node is expensive and the user does not want to have two equivalent nodes
//! in the tree: if there is an equivalent value
@@ -678,16 +703,16 @@ class avltree_algorithms
//! "commit_data" must have been obtained from a previous call to
//! "insert_unique_check". No objects should have been inserted or erased
//! from the set between the "insert_unique_check" that filled "commit_data"
- //! and the call to "insert_commit".
- //!
- //!
+ //! and the call to "insert_commit".
+ //!
+ //!
//! <b>Effects</b>: Inserts new_node in the set using the information obtained
//! from the "commit_data" that a previous "insert_check" filled.
//!
//! <b>Complexity</b>: Constant time.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function has only sense if a "insert_unique_check" has been
//! previously executed to fill "commit_data". No value should be inserted or
//! erased between the "insert_check" and "insert_commit" calls.
@@ -703,7 +728,7 @@ class avltree_algorithms
//! <b>Effects</b>: Returns a pointer to the header node of the tree.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static node_ptr get_header(const node_ptr & n)
{ return tree_algorithms::get_header(n); }
@@ -712,11 +737,11 @@ class avltree_algorithms
private:
//! <b>Requires</b>: p is a node of a tree.
- //!
+ //!
//! <b>Effects</b>: Returns true if p is the header of the tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static bool is_header(const const_node_ptr & p)
{ return NodeTraits::get_balance(p) == NodeTraits::zero() && tree_algorithms::is_header(p); }
@@ -727,7 +752,7 @@ class avltree_algorithms
for (node_ptr root = NodeTraits::get_parent(header); x != root; root = NodeTraits::get_parent(header)) {
const balance x_parent_balance = NodeTraits::get_balance(x_parent);
if(x_parent_balance == NodeTraits::zero()){
- NodeTraits::set_balance(x_parent,
+ NodeTraits::set_balance(x_parent,
(x == NodeTraits::get_right(x_parent) ? NodeTraits::negative() : NodeTraits::positive()));
break; // the height didn't change, let's stop here
}
@@ -935,8 +960,8 @@ class avltree_algorithms
/// @endcond
};
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/bs_set_hook.hpp b/boost/intrusive/bs_set_hook.hpp
index bf8e2de09a..682426a960 100644
--- a/boost/intrusive/bs_set_hook.hpp
+++ b/boost/intrusive/bs_set_hook.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2007-2009
+// (C) Copyright Ion Gaztanaga 2007-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -63,16 +63,16 @@ struct make_bs_set_base_hook
typedef implementation_defined type;
};
-//! Derive a class from bs_set_base_hook in order to store objects in
-//! in a bs_set/bs_multiset. bs_set_base_hook holds the data necessary to maintain
+//! Derive a class from bs_set_base_hook in order to store objects in
+//! in a bs_set/bs_multiset. bs_set_base_hook holds the data necessary to maintain
//! the bs_set/bs_multiset and provides an appropriate value_traits class for bs_set/bs_multiset.
-//!
+//!
//! The hook admits the following options: \c tag<>, \c void_pointer<>,
//! \c link_mode<>.
//!
-//! \c tag<> defines a tag to identify the node.
-//! The same tag value can be used in different classes, but if a class is
-//! derived from more than one \c list_base_hook, then each \c list_base_hook needs its
+//! \c tag<> defines a tag to identify the node.
+//! The same tag value can be used in different classes, but if a class is
+//! derived from more than one \c list_base_hook, then each \c list_base_hook needs its
//! unique tag.
//!
//! \c void_pointer<> is the pointer type that will be used internally in the hook
@@ -99,27 +99,27 @@ class bs_set_base_hook
public:
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
bs_set_base_hook();
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state. The argument is ignored.
- //!
- //! <b>Throws</b>: Nothing.
- //!
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
//! <b>Rationale</b>: Providing a copy-constructor
- //! makes classes using the hook STL-compliant without forcing the
+ //! makes classes using the hook STL-compliant without forcing the
//! user to do some additional work. \c swap can be used to emulate
//! move-semantics.
bs_set_base_hook(const bs_set_base_hook& );
//! <b>Effects</b>: Empty function. The argument is ignored.
- //!
- //! <b>Throws</b>: Nothing.
- //!
- //! <b>Rationale</b>: Providing an assignment operator
- //! makes classes using the hook STL-compliant without forcing the
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing an assignment operator
+ //! makes classes using the hook STL-compliant without forcing the
//! user to do some additional work. \c swap can be used to emulate
//! move-semantics.
bs_set_base_hook& operator=(const bs_set_base_hook& );
@@ -128,37 +128,37 @@ class bs_set_base_hook
//! nothing (ie. no code is generated). If link_mode is \c safe_link and the
//! object is stored in a set an assertion is raised. If link_mode is
//! \c auto_unlink and \c is_linked() is true, the node is unlinked.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
~bs_set_base_hook();
- //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
- //! related to those nodes in one or two containers. That is, if the node
- //! this is part of the element e1, the node x is part of the element e2
- //! and both elements are included in the containers s1 and s2, then after
- //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
- //! at the position of e1. If one element is not in a container, then
- //! after the swap-operation the other element is not in a container.
- //! Iterators to e1 and e2 related to those nodes are invalidated.
+ //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
+ //! related to those nodes in one or two containers. That is, if the node
+ //! this is part of the element e1, the node x is part of the element e2
+ //! and both elements are included in the containers s1 and s2, then after
+ //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
+ //! at the position of e1. If one element is not in a container, then
+ //! after the swap-operation the other element is not in a container.
+ //! Iterators to e1 and e2 related to those nodes are invalidated.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Constant
//!
- //! <b>Throws</b>: Nothing.
+ //! <b>Throws</b>: Nothing.
void swap_nodes(bs_set_base_hook &other);
//! <b>Precondition</b>: link_mode must be \c safe_link or \c auto_unlink.
//!
//! <b>Returns</b>: true, if the node belongs to a container, false
- //! otherwise. This function can be used to test whether \c set::iterator_to
- //! will return a valid iterator.
+ //! otherwise. This function can be used to test whether \c set::iterator_to
+ //! will return a valid iterator.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Constant
bool is_linked() const;
//! <b>Effects</b>: Removes the node if it's inserted in a container.
//! This function is only allowed if link_mode is \c auto_unlink.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
void unlink();
#endif
};
@@ -198,7 +198,7 @@ struct make_bs_set_member_hook
//! Put a public data member bs_set_member_hook in order to store objects of this class in
//! a bs_set/bs_multiset. bs_set_member_hook holds the data necessary for maintaining the
//! bs_set/bs_multiset and provides an appropriate value_traits class for bs_set/bs_multiset.
-//!
+//!
//! The hook admits the following options: \c void_pointer<>, \c link_mode<>.
//!
//! \c void_pointer<> is the pointer type that will be used internally in the hook
@@ -224,27 +224,27 @@ class bs_set_member_hook
public:
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
bs_set_member_hook();
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state. The argument is ignored.
- //!
- //! <b>Throws</b>: Nothing.
- //!
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
//! <b>Rationale</b>: Providing a copy-constructor
- //! makes classes using the hook STL-compliant without forcing the
+ //! makes classes using the hook STL-compliant without forcing the
//! user to do some additional work. \c swap can be used to emulate
//! move-semantics.
bs_set_member_hook(const bs_set_member_hook& );
//! <b>Effects</b>: Empty function. The argument is ignored.
- //!
- //! <b>Throws</b>: Nothing.
- //!
- //! <b>Rationale</b>: Providing an assignment operator
- //! makes classes using the hook STL-compliant without forcing the
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing an assignment operator
+ //! makes classes using the hook STL-compliant without forcing the
//! user to do some additional work. \c swap can be used to emulate
//! move-semantics.
bs_set_member_hook& operator=(const bs_set_member_hook& );
@@ -253,43 +253,43 @@ class bs_set_member_hook
//! nothing (ie. no code is generated). If link_mode is \c safe_link and the
//! object is stored in a set an assertion is raised. If link_mode is
//! \c auto_unlink and \c is_linked() is true, the node is unlinked.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
~bs_set_member_hook();
- //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
- //! related to those nodes in one or two containers. That is, if the node
- //! this is part of the element e1, the node x is part of the element e2
- //! and both elements are included in the containers s1 and s2, then after
- //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
- //! at the position of e1. If one element is not in a container, then
- //! after the swap-operation the other element is not in a container.
- //! Iterators to e1 and e2 related to those nodes are invalidated.
+ //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
+ //! related to those nodes in one or two containers. That is, if the node
+ //! this is part of the element e1, the node x is part of the element e2
+ //! and both elements are included in the containers s1 and s2, then after
+ //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
+ //! at the position of e1. If one element is not in a container, then
+ //! after the swap-operation the other element is not in a container.
+ //! Iterators to e1 and e2 related to those nodes are invalidated.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Constant
//!
- //! <b>Throws</b>: Nothing.
+ //! <b>Throws</b>: Nothing.
void swap_nodes(bs_set_member_hook &other);
//! <b>Precondition</b>: link_mode must be \c safe_link or \c auto_unlink.
//!
//! <b>Returns</b>: true, if the node belongs to a container, false
- //! otherwise. This function can be used to test whether \c set::iterator_to
- //! will return a valid iterator.
+ //! otherwise. This function can be used to test whether \c set::iterator_to
+ //! will return a valid iterator.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Constant
bool is_linked() const;
//! <b>Effects</b>: Removes the node if it's inserted in a container.
//! This function is only allowed if link_mode is \c auto_unlink.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
void unlink();
#endif
};
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/circular_list_algorithms.hpp b/boost/intrusive/circular_list_algorithms.hpp
index c5de423b62..282f4741a1 100644
--- a/boost/intrusive/circular_list_algorithms.hpp
+++ b/boost/intrusive/circular_list_algorithms.hpp
@@ -1,7 +1,7 @@
/////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -40,11 +40,11 @@ namespace intrusive {
//! <b>Static functions</b>:
//!
//! <tt>static node_ptr get_previous(const_node_ptr n);</tt>
-//!
+//!
//! <tt>static void set_previous(node_ptr n, node_ptr prev);</tt>
-//!
+//!
//! <tt>static node_ptr get_next(const_node_ptr n);</tt>
-//!
+//!
//! <tt>static void set_next(node_ptr n, node_ptr next);</tt>
template<class NodeTraits>
class circular_list_algorithms
@@ -57,9 +57,9 @@ class circular_list_algorithms
//! <b>Effects</b>: Constructs an non-used list element, so that
//! inited(this_node) == true
- //!
- //! <b>Complexity</b>: Constant
- //!
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
//! <b>Throws</b>: Nothing.
static void init(const node_ptr &this_node)
{
@@ -69,20 +69,20 @@ class circular_list_algorithms
//! <b>Effects</b>: Returns true is "this_node" is in a non-used state
//! as if it was initialized by the "init" function.
- //!
- //! <b>Complexity</b>: Constant
- //!
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
//! <b>Throws</b>: Nothing.
- static bool inited(const const_node_ptr &this_node)
+ static bool inited(const const_node_ptr &this_node)
{ return !NodeTraits::get_next(this_node); }
//! <b>Effects</b>: Constructs an empty list, making this_node the only
//! node of the circular list:
//! <tt>NodeTraits::get_next(this_node) == NodeTraits::get_previous(this_node)
//! == this_node</tt>.
- //!
- //! <b>Complexity</b>: Constant
- //!
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
//! <b>Throws</b>: Nothing.
static void init_header(const node_ptr &this_node)
{
@@ -92,12 +92,12 @@ class circular_list_algorithms
//! <b>Requires</b>: this_node must be in a circular list or be an empty circular list.
- //!
+ //!
//! <b>Effects</b>: Returns true is "this_node" is the only node of a circular list:
//! <tt>return NodeTraits::get_next(this_node) == this_node</tt>
- //!
- //! <b>Complexity</b>: Constant
- //!
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
//! <b>Throws</b>: Nothing.
static bool unique(const const_node_ptr &this_node)
{
@@ -106,14 +106,14 @@ class circular_list_algorithms
}
//! <b>Requires</b>: this_node must be in a circular list or be an empty circular list.
- //!
+ //!
//! <b>Effects</b>: Returns the number of nodes in a circular list. If the circular list
//! is empty, returns 1.
- //!
- //! <b>Complexity</b>: Linear
- //!
+ //!
+ //! <b>Complexity</b>: Linear
+ //!
//! <b>Throws</b>: Nothing.
- static std::size_t count(const const_node_ptr &this_node)
+ static std::size_t count(const const_node_ptr &this_node)
{
std::size_t result = 0;
const_node_ptr p = this_node;
@@ -125,11 +125,11 @@ class circular_list_algorithms
}
//! <b>Requires</b>: this_node must be in a circular list or be an empty circular list.
- //!
+ //!
//! <b>Effects</b>: Unlinks the node from the circular list.
- //!
- //! <b>Complexity</b>: Constant
- //!
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
//! <b>Throws</b>: Nothing.
static node_ptr unlink(const node_ptr &this_node)
{
@@ -146,11 +146,11 @@ class circular_list_algorithms
}
//! <b>Requires</b>: b and e must be nodes of the same circular list or an empty range.
- //!
+ //!
//! <b>Effects</b>: Unlinks the node [b, e) from the circular list.
- //!
- //! <b>Complexity</b>: Constant
- //!
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
//! <b>Throws</b>: Nothing.
static void unlink(const node_ptr &b, const node_ptr &e)
{
@@ -162,11 +162,11 @@ class circular_list_algorithms
}
//! <b>Requires</b>: nxt_node must be a node of a circular list.
- //!
+ //!
//! <b>Effects</b>: Links this_node before nxt_node in the circular list.
- //!
- //! <b>Complexity</b>: Constant
- //!
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
//! <b>Throws</b>: Nothing.
static void link_before(const node_ptr &nxt_node, const node_ptr &this_node)
{
@@ -181,11 +181,11 @@ class circular_list_algorithms
}
//! <b>Requires</b>: prev_node must be a node of a circular list.
- //!
+ //!
//! <b>Effects</b>: Links this_node after prev_node in the circular list.
- //!
- //! <b>Complexity</b>: Constant
- //!
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
//! <b>Throws</b>: Nothing.
static void link_after(const node_ptr &prev_node, const node_ptr &this_node)
{
@@ -201,13 +201,13 @@ class circular_list_algorithms
//! <b>Requires</b>: this_node and other_node must be nodes inserted
//! in circular lists or be empty circular lists.
- //!
+ //!
//! <b>Effects</b>: Swaps the position of the nodes: this_node is inserted in
//! other_nodes position in the second circular list and the other_node is inserted
//! in this_node's position in the first circular list.
- //!
- //! <b>Complexity</b>: Constant
- //!
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
//! <b>Throws</b>: Nothing.
/*
static void swap_nodes(const node_ptr &this_node, const node_ptr &other_node)
@@ -248,22 +248,22 @@ class circular_list_algorithms
*/
//Watanabe version
- private:
- static void swap_prev(const node_ptr &this_node, const node_ptr &other_node)
- {
- node_ptr temp(NodeTraits::get_previous(this_node));
- NodeTraits::set_previous(this_node, NodeTraits::get_previous(other_node));
- NodeTraits::set_previous(other_node, temp);
- }
- static void swap_next(const node_ptr &this_node, const node_ptr &other_node)
- {
- node_ptr temp(NodeTraits::get_next(this_node));
- NodeTraits::set_next(this_node, NodeTraits::get_next(other_node));
- NodeTraits::set_next(other_node, temp);
- }
-
- public:
- static void swap_nodes(const node_ptr &this_node, const node_ptr &other_node)
+ private:
+ static void swap_prev(const node_ptr &this_node, const node_ptr &other_node)
+ {
+ node_ptr temp(NodeTraits::get_previous(this_node));
+ NodeTraits::set_previous(this_node, NodeTraits::get_previous(other_node));
+ NodeTraits::set_previous(other_node, temp);
+ }
+ static void swap_next(const node_ptr &this_node, const node_ptr &other_node)
+ {
+ node_ptr temp(NodeTraits::get_next(this_node));
+ NodeTraits::set_next(this_node, NodeTraits::get_next(other_node));
+ NodeTraits::set_next(other_node, temp);
+ }
+
+ public:
+ static void swap_nodes(const node_ptr &this_node, const node_ptr &other_node)
{
if (other_node == this_node)
return;
@@ -276,15 +276,15 @@ class circular_list_algorithms
init_header(other_node);
}
- node_ptr next_this(NodeTraits::get_next(this_node));
- node_ptr prev_this(NodeTraits::get_previous(this_node));
- node_ptr next_other(NodeTraits::get_next(other_node));
- node_ptr prev_other(NodeTraits::get_previous(other_node));
- //these first two swaps must happen before the other two
- swap_prev(next_this, next_other);
- swap_next(prev_this, prev_other);
- swap_next(this_node, other_node);
- swap_prev(this_node, other_node);
+ node_ptr next_this(NodeTraits::get_next(this_node));
+ node_ptr prev_this(NodeTraits::get_previous(this_node));
+ node_ptr next_other(NodeTraits::get_next(other_node));
+ node_ptr prev_other(NodeTraits::get_previous(other_node));
+ //these first two swaps must happen before the other two
+ swap_prev(next_this, next_other);
+ swap_next(prev_this, prev_other);
+ swap_next(this_node, other_node);
+ swap_prev(this_node, other_node);
if(this_inited){
init(other_node);
@@ -295,14 +295,14 @@ class circular_list_algorithms
}
//! <b>Requires</b>: b and e must be nodes of the same circular list or an empty range.
- //! and p must be a node of a different circular list or may not be an iterator in
+ //! and p must be a node of a different circular list or may not be an iterator in
// [b, e).
- //!
+ //!
//! <b>Effects</b>: Removes the nodes from [b, e) range from their circular list and inserts
//! them before p in p's circular list.
- //!
- //! <b>Complexity</b>: Constant
- //!
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
//! <b>Throws</b>: Nothing.
static void transfer(const node_ptr &p, const node_ptr &b, const node_ptr &e)
{
@@ -321,13 +321,13 @@ class circular_list_algorithms
//! <b>Requires</b>: i must a node of a circular list
//! and p must be a node of a different circular list.
- //!
+ //!
//! <b>Effects</b>: Removes the node i from its circular list and inserts
- //! it before p in p's circular list.
+ //! it before p in p's circular list.
//! If p == i or p == NodeTraits::get_next(i), this function is a null operation.
- //!
- //! <b>Complexity</b>: Constant
- //!
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
//! <b>Throws</b>: Nothing.
static void transfer(const node_ptr &p, const node_ptr &i)
{
@@ -345,16 +345,16 @@ class circular_list_algorithms
}
}
- //! <b>Effects</b>: Reverses the order of elements in the list.
- //!
+ //! <b>Effects</b>: Reverses the order of elements in the list.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: This function is linear time.
static void reverse(const node_ptr &p)
{
node_ptr f(NodeTraits::get_next(p));
node_ptr i(NodeTraits::get_next(f)), e(p);
-
+
while(i != e) {
node_ptr n = i;
i = NodeTraits::get_next(i);
@@ -364,9 +364,9 @@ class circular_list_algorithms
}
//! <b>Effects</b>: Moves the node p n positions towards the end of the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of moved positions.
static void move_backwards(const node_ptr &p, std::size_t n)
{
@@ -384,9 +384,9 @@ class circular_list_algorithms
}
//! <b>Effects</b>: Moves the node p n positions towards the beginning of the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of moved positions.
static void move_forward(const node_ptr &p, std::size_t n)
{
@@ -405,8 +405,8 @@ class circular_list_algorithms
}
};
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/circular_slist_algorithms.hpp b/boost/intrusive/circular_slist_algorithms.hpp
index b843590c15..c39b3d0c5a 100644
--- a/boost/intrusive/circular_slist_algorithms.hpp
+++ b/boost/intrusive/circular_slist_algorithms.hpp
@@ -1,7 +1,7 @@
/////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -42,7 +42,7 @@ namespace intrusive {
//! <b>Static functions</b>:
//!
//! <tt>static node_ptr get_next(const_node_ptr n);</tt>
-//!
+//!
//! <tt>static void set_next(node_ptr n, node_ptr next);</tt>
template<class NodeTraits>
class circular_slist_algorithms
@@ -64,37 +64,37 @@ class circular_slist_algorithms
//! <b>Effects</b>: Constructs an non-used list element, putting the next
//! pointer to null:
//! <tt>NodeTraits::get_next(this_node) == node_ptr()</tt>
- //!
- //! <b>Complexity</b>: Constant
- //!
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
//! <b>Throws</b>: Nothing.
static void init(node_ptr this_node);
//! <b>Requires</b>: this_node must be in a circular list or be an empty circular list.
- //!
+ //!
//! <b>Effects</b>: Returns true is "this_node" is the only node of a circular list:
//! or it's a not inserted node:
//! <tt>return node_ptr() == NodeTraits::get_next(this_node) || NodeTraits::get_next(this_node) == this_node</tt>
- //!
+ //!
//! <b>Complexity</b>: Constant
- //!
+ //!
//! <b>Throws</b>: Nothing.
static bool unique(const_node_ptr this_node);
//! <b>Effects</b>: Returns true is "this_node" has the same state as
//! if it was inited using "init(node_ptr)"
- //!
- //! <b>Complexity</b>: Constant
- //!
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
//! <b>Throws</b>: Nothing.
static bool inited(const_node_ptr this_node);
//! <b>Requires</b>: prev_node must be in a circular list or be an empty circular list.
- //!
+ //!
//! <b>Effects</b>: Unlinks the next node of prev_node from the circular list.
- //!
- //! <b>Complexity</b>: Constant
- //!
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
//! <b>Throws</b>: Nothing.
static void unlink_after(node_ptr prev_node);
@@ -103,28 +103,28 @@ class circular_slist_algorithms
//!
//! <b>Effects</b>: Unlinks the range (prev_node, last_node) from the circular list.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Constant
//!
//! <b>Throws</b>: Nothing.
static void unlink_after(node_ptr prev_node, node_ptr last_node);
//! <b>Requires</b>: prev_node must be a node of a circular list.
- //!
+ //!
//! <b>Effects</b>: Links this_node after prev_node in the circular list.
- //!
- //! <b>Complexity</b>: Constant
- //!
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
//! <b>Throws</b>: Nothing.
static void link_after(node_ptr prev_node, node_ptr this_node);
//! <b>Requires</b>: b and e must be nodes of the same circular list or an empty range.
//! and p must be a node of a different circular list.
- //!
+ //!
//! <b>Effects</b>: Removes the nodes from (b, e] range from their circular list and inserts
//! them after p in p's circular list.
- //!
- //! <b>Complexity</b>: Constant
- //!
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
//! <b>Throws</b>: Nothing.
static void transfer_after(node_ptr p, node_ptr b, node_ptr e);
@@ -133,53 +133,53 @@ class circular_slist_algorithms
//! <b>Effects</b>: Constructs an empty list, making this_node the only
//! node of the circular list:
//! <tt>NodeTraits::get_next(this_node) == this_node</tt>.
- //!
- //! <b>Complexity</b>: Constant
- //!
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
//! <b>Throws</b>: Nothing.
static void init_header(const node_ptr &this_node)
- { NodeTraits::set_next(this_node, this_node); }
+ { NodeTraits::set_next(this_node, this_node); }
//! <b>Requires</b>: this_node and prev_init_node must be in the same circular list.
- //!
+ //!
//! <b>Effects</b>: Returns the previous node of this_node in the circular list starting.
//! the search from prev_init_node. The first node checked for equality
//! is NodeTraits::get_next(prev_init_node).
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements between prev_init_node and this_node.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static node_ptr get_previous_node(const node_ptr &prev_init_node, const node_ptr &this_node)
{ return base_t::get_previous_node(prev_init_node, this_node); }
//! <b>Requires</b>: this_node must be in a circular list or be an empty circular list.
- //!
+ //!
//! <b>Effects</b>: Returns the previous node of this_node in the circular list.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements in the circular list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static node_ptr get_previous_node(const node_ptr & this_node)
{ return base_t::get_previous_node(this_node, this_node); }
//! <b>Requires</b>: this_node must be in a circular list or be an empty circular list.
- //!
+ //!
//! <b>Effects</b>: Returns the previous node of the previous node of this_node in the circular list.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements in the circular list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static node_ptr get_previous_previous_node(const node_ptr & this_node)
{ return get_previous_previous_node(this_node, this_node); }
//! <b>Requires</b>: this_node and prev_prev_init_node must be in the same circular list.
- //!
+ //!
//! <b>Effects</b>: Returns the previous node of the previous node of this_node in the
//! circular list starting. the search from prev_init_node. The first node checked
//! for equality is NodeTraits::get_next((NodeTraits::get_next(prev_prev_init_node)).
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements in the circular list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static node_ptr get_previous_previous_node(const node_ptr & prev_prev_init_node, const node_ptr & this_node)
{
@@ -195,14 +195,14 @@ class circular_slist_algorithms
}
//! <b>Requires</b>: this_node must be in a circular list or be an empty circular list.
- //!
+ //!
//! <b>Effects</b>: Returns the number of nodes in a circular list. If the circular list
//! is empty, returns 1.
- //!
- //! <b>Complexity</b>: Linear
- //!
+ //!
+ //! <b>Complexity</b>: Linear
+ //!
//! <b>Throws</b>: Nothing.
- static std::size_t count(const const_node_ptr & this_node)
+ static std::size_t count(const const_node_ptr & this_node)
{
std::size_t result = 0;
const_node_ptr p = this_node;
@@ -214,11 +214,11 @@ class circular_slist_algorithms
}
//! <b>Requires</b>: this_node must be in a circular list, be an empty circular list or be inited.
- //!
+ //!
//! <b>Effects</b>: Unlinks the node from the circular list.
- //!
- //! <b>Complexity</b>: Linear to the number of elements in the circular list
- //!
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements in the circular list
+ //!
//! <b>Throws</b>: Nothing.
static void unlink(const node_ptr & this_node)
{
@@ -227,24 +227,24 @@ class circular_slist_algorithms
}
//! <b>Requires</b>: nxt_node must be a node of a circular list.
- //!
+ //!
//! <b>Effects</b>: Links this_node before nxt_node in the circular list.
- //!
- //! <b>Complexity</b>: Linear to the number of elements in the circular list.
- //!
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements in the circular list.
+ //!
//! <b>Throws</b>: Nothing.
static void link_before (const node_ptr & nxt_node, const node_ptr & this_node)
{ base_t::link_after(get_previous_node(nxt_node), this_node); }
//! <b>Requires</b>: this_node and other_node must be nodes inserted
//! in circular lists or be empty circular lists.
- //!
+ //!
//! <b>Effects</b>: Swaps the position of the nodes: this_node is inserted in
//! other_nodes position in the second circular list and the other_node is inserted
//! in this_node's position in the first circular list.
- //!
- //! <b>Complexity</b>: Linear to number of elements of both lists
- //!
+ //!
+ //! <b>Complexity</b>: Linear to number of elements of both lists
+ //!
//! <b>Throws</b>: Nothing.
static void swap_nodes(const node_ptr & this_node, const node_ptr & other_node)
{
@@ -279,14 +279,14 @@ class circular_slist_algorithms
}
}
- //! <b>Effects</b>: Reverses the order of elements in the list.
- //!
+ //! <b>Effects</b>: Reverses the order of elements in the list.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: This function is linear to the contained elements.
static void reverse(const node_ptr & p)
{
- node_ptr i = NodeTraits::get_next(p), e(p);
+ node_ptr i = NodeTraits::get_next(p), e(p);
for (;;) {
node_ptr nxt(NodeTraits::get_next(i));
if (nxt == e)
@@ -301,7 +301,7 @@ class circular_slist_algorithms
//! Null if n leads to no movement.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements plus the number moved positions.
static node_ptr move_backwards(const node_ptr & p, std::size_t n)
{
@@ -348,12 +348,12 @@ class circular_slist_algorithms
}
//! <b>Effects</b>: Moves the node p n positions towards the beginning of the list.
- //!
+ //!
//! <b>Returns</b>: The previous node of p after the function if there has been any movement,
//! Null if n leads equals to no movement.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements plus the number moved positions.
static node_ptr move_forward(const node_ptr & p, std::size_t n)
{
@@ -382,7 +382,7 @@ class circular_slist_algorithms
std::size_t new_before_last_pos = (distance - (n % distance))% distance;
//If the shift is a multiple of the size there is nothing to do
if(!new_before_last_pos) return node_ptr();
-
+
for( new_last = p
; new_before_last_pos--
; new_last = node_traits::get_next(new_last)){
@@ -397,8 +397,8 @@ class circular_slist_algorithms
}
};
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/derivation_value_traits.hpp b/boost/intrusive/derivation_value_traits.hpp
index 38c5aa57cf..0aae01b619 100644
--- a/boost/intrusive/derivation_value_traits.hpp
+++ b/boost/intrusive/derivation_value_traits.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -47,7 +47,7 @@ struct derivation_value_traits
static const_node_ptr to_node_ptr(const_reference value)
{ return node_ptr(&value); }
- static pointer to_value_ptr(const node_ptr &n)
+ static pointer to_value_ptr(const node_ptr &n)
{
// This still fails in gcc < 4.4 so forget about it
// using ::boost::static_pointer_cast;
@@ -64,7 +64,7 @@ struct derivation_value_traits
}
};
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#endif //BOOST_INTRUSIVE_DERIVATION_VALUE_TRAITS_HPP
diff --git a/boost/intrusive/detail/any_node_and_algorithms.hpp b/boost/intrusive/detail/any_node_and_algorithms.hpp
index bda9ad3c45..b274135a90 100644
--- a/boost/intrusive/detail/any_node_and_algorithms.hpp
+++ b/boost/intrusive/detail/any_node_and_algorithms.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -18,7 +18,7 @@
#include <boost/intrusive/detail/assert.hpp>
#include <boost/intrusive/pointer_traits.hpp>
#include <cstddef>
-#include <boost/intrusive/detail/mpl.hpp>
+#include <boost/intrusive/detail/mpl.hpp>
#include <boost/pointer_cast.hpp>
namespace boost {
@@ -100,10 +100,10 @@ struct any_unordered_node_traits
{ n->node_ptr_2 = prev; }
static std::size_t get_hash(const const_node_ptr & n)
- { return n->size_t_1; }
+ { return n->size_t_1; }
static void set_hash(const node_ptr & n, std::size_t h)
- { n->size_t_1 = h; }
+ { n->size_t_1 = h; }
};
@@ -255,9 +255,9 @@ class any_algorithms
//! <b>Requires</b>: node must not be part of any tree.
//!
//! <b>Effects</b>: After the function unique(node) == true.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
//!
//! <b>Nodes</b>: If node is inserted in a tree, this function corrupts the tree.
@@ -265,9 +265,9 @@ class any_algorithms
{ node->node_ptr_1 = 0; };
//! <b>Effects</b>: Returns true if node is in the same state as if called init(node)
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static bool inited(const const_node_ptr & node)
{ return !node->node_ptr_1; };
@@ -289,8 +289,8 @@ class any_algorithms
}
};
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/detail/assert.hpp b/boost/intrusive/detail/assert.hpp
index cfe392bfb0..33de97f701 100644
--- a/boost/intrusive/detail/assert.hpp
+++ b/boost/intrusive/detail/assert.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -11,7 +11,7 @@
/////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_INTRUSIVE_DETAIL_ASSERT_HPP
-#define BOOST_INTRUSIVE_DETAIL_ASSERT_HPP
+#define BOOST_INTRUSIVE_DETAIL_ASSERT_HPP
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
#pragma once
diff --git a/boost/intrusive/detail/avltree_node.hpp b/boost/intrusive/detail/avltree_node.hpp
index dc600e6695..aec0dabd4b 100644
--- a/boost/intrusive/detail/avltree_node.hpp
+++ b/boost/intrusive/detail/avltree_node.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2007.
+// (C) Copyright Ion Gaztanaga 2007-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -172,13 +172,13 @@ struct avltree_node_traits
, OptimizeSize &&
max_pointer_plus_bits
< VoidPointer
- , detail::alignment_of<compact_avltree_node<VoidPointer> >::value
+ , detail::alignment_of<compact_avltree_node<VoidPointer> >::value
>::value >= 2u
>
{};
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/detail/clear_on_destructor_base.hpp b/boost/intrusive/detail/clear_on_destructor_base.hpp
index 6765dfa05d..1b5c27fff4 100644
--- a/boost/intrusive/detail/clear_on_destructor_base.hpp
+++ b/boost/intrusive/detail/clear_on_destructor_base.hpp
@@ -1,6 +1,6 @@
//////} // ///////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2008-2009. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2008-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
diff --git a/boost/intrusive/detail/common_slist_algorithms.hpp b/boost/intrusive/detail/common_slist_algorithms.hpp
index 15d6b3ff29..942b35a3f4 100644
--- a/boost/intrusive/detail/common_slist_algorithms.hpp
+++ b/boost/intrusive/detail/common_slist_algorithms.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2007-2009
+// (C) Copyright Ion Gaztanaga 2007-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -44,11 +44,11 @@ class common_slist_algorithms
return p;
}
- static void init_header(const node_ptr & this_node)
- { NodeTraits::set_next(this_node, this_node); }
+ static void init_header(const node_ptr & this_node)
+ { NodeTraits::set_next(this_node, this_node); }
- static void init(const node_ptr & this_node)
- { NodeTraits::set_next(this_node, node_ptr()); }
+ static void init(const node_ptr & this_node)
+ { NodeTraits::set_next(this_node, node_ptr()); }
static bool unique(const const_node_ptr & this_node)
{
@@ -56,7 +56,7 @@ class common_slist_algorithms
return !next || next == this_node;
}
- static bool inited(const const_node_ptr & this_node)
+ static bool inited(const const_node_ptr & this_node)
{ return !NodeTraits::get_next(this_node); }
static void unlink_after(const node_ptr & prev_node)
@@ -80,7 +80,7 @@ class common_slist_algorithms
NodeTraits::set_next(bp, b);
NodeTraits::set_next(be, p);
}
-
+
static void transfer_after(const node_ptr & bp, const node_ptr & bb, const node_ptr & be)
{
if (bp != bb && bp != be && bb != be) {
@@ -95,8 +95,8 @@ class common_slist_algorithms
};
} //namespace detail
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/detail/config_begin.hpp b/boost/intrusive/detail/config_begin.hpp
index bb126fcdf0..7d153368a5 100644
--- a/boost/intrusive/detail/config_begin.hpp
+++ b/boost/intrusive/detail/config_begin.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -20,10 +20,10 @@
#pragma warning (push)
//
//'function' : resolved overload was found by argument-dependent lookup
- //A function found by argument-dependent lookup (Koenig lookup) was eventually
+ //A function found by argument-dependent lookup (Koenig lookup) was eventually
//chosen by overload resolution.
//
- //In Visual C++ .NET and earlier compilers, a different function would have
+ //In Visual C++ .NET and earlier compilers, a different function would have
//been called. To pick the original function, use an explicitly qualified name.
//
diff --git a/boost/intrusive/detail/config_end.hpp b/boost/intrusive/detail/config_end.hpp
index 4277cb576f..d653030daa 100644
--- a/boost/intrusive/detail/config_end.hpp
+++ b/boost/intrusive/detail/config_end.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
diff --git a/boost/intrusive/detail/ebo_functor_holder.hpp b/boost/intrusive/detail/ebo_functor_holder.hpp
index d4c2d1593b..850d074326 100644
--- a/boost/intrusive/detail/ebo_functor_holder.hpp
+++ b/boost/intrusive/detail/ebo_functor_holder.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Joaquin M Lopez Munoz 2006-2009
+// (C) Copyright Joaquin M Lopez Munoz 2006-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
diff --git a/boost/intrusive/detail/function_detector.hpp b/boost/intrusive/detail/function_detector.hpp
index e00a7efcf2..08cee2d561 100644
--- a/boost/intrusive/detail/function_detector.hpp
+++ b/boost/intrusive/detail/function_detector.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2009-2009.
+// (C) Copyright Ion Gaztanaga 2009-2012.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -15,7 +15,7 @@
///////////////////////////////////////////////////////////////////////////////
// Copyright 2007 Alexandre Courpron
//
-// Permission to use, copy, modify, redistribute and sell this software,
+// Permission to use, copy, modify, redistribute and sell this software,
// provided that this copyright notice appears on all copies of the software.
///////////////////////////////////////////////////////////////////////////////
@@ -74,7 +74,7 @@ namespace function_detector {
public : \
static const int check = NotFound + (sizeof(Test<T>(0, 0)) - sizeof(NotFoundType));\
};\
-}}} //namespace boost::intrusive::function_detector {
+}}} //namespace boost::intrusive::function_detector {
#define BOOST_INTRUSIVE_DETECT_FUNCTION(Class, InstantiationKey, ReturnType, Identifier, Params) \
::boost::intrusive::function_detector::DetectMember_##InstantiationKey_##Identifier< Class,\
diff --git a/boost/intrusive/detail/generic_hook.hpp b/boost/intrusive/detail/generic_hook.hpp
index fc35610b8d..5ddd52074e 100644
--- a/boost/intrusive/detail/generic_hook.hpp
+++ b/boost/intrusive/detail/generic_hook.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2007-2009
+// (C) Copyright Ion Gaztanaga 2007-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -143,7 +143,7 @@ class generic_hook
typedef Tag tag;
typedef typename GetNodeAlgorithms::type::node_traits node_traits;
static const bool is_base_hook = !detail::is_same<Tag, member_tag>::value;
- static const bool safemode_or_autounlink =
+ static const bool safemode_or_autounlink =
(int)link_mode == (int)auto_unlink || (int)link_mode == (int)safe_link;
};
@@ -163,14 +163,14 @@ class generic_hook
}
}
- generic_hook(const generic_hook& )
+ generic_hook(const generic_hook& )
{
if(boost_intrusive_tags::safemode_or_autounlink){
node_algorithms::init(this->this_ptr());
}
}
- generic_hook& operator=(const generic_hook& )
+ generic_hook& operator=(const generic_hook& )
{ return *this; }
~generic_hook()
@@ -179,13 +179,13 @@ class generic_hook
(*this, detail::link_dispatch<boost_intrusive_tags::link_mode>());
}
- void swap_nodes(generic_hook &other)
+ void swap_nodes(generic_hook &other)
{
node_algorithms::swap_nodes
(this->this_ptr(), other.this_ptr());
}
- bool is_linked() const
+ bool is_linked() const
{
//is_linked() can be only used in safe-mode or auto-unlink
BOOST_STATIC_ASSERT(( boost_intrusive_tags::safemode_or_autounlink ));
@@ -201,8 +201,8 @@ class generic_hook
};
} //namespace detail
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/detail/has_member_function_callable_with.hpp b/boost/intrusive/detail/has_member_function_callable_with.hpp
index 33811e3210..6516e28067 100644
--- a/boost/intrusive/detail/has_member_function_callable_with.hpp
+++ b/boost/intrusive/detail/has_member_function_callable_with.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2011-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2011-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -10,7 +10,7 @@
// sample.h
-#if !BOOST_PP_IS_ITERATING
+#if !defined(BOOST_PP_IS_ITERATING)
#ifndef BOOST_INTRUSIVE_DETAIL_HAS_MEMBER_FUNCTION_CALLABLE_WITH_DETAILS_INCLUDED
#define BOOST_INTRUSIVE_DETAIL_HAS_MEMBER_FUNCTION_CALLABLE_WITH_DETAILS_INCLUDED
@@ -21,7 +21,7 @@
#include <boost/static_assert.hpp>
#include <boost/move/move.hpp>
- //Mark that we don't support 0 arg calls due to compiler ICE in GCC 3.4/4.0/4.1 and
+ //Mark that we don't support 0 arg calls due to compiler ICE in GCC 3.4/4.0/4.1 and
//wrong SFINAE for GCC 4.2/4.3
#if defined(__GNUC__) && !defined(__clang__) && ((__GNUC__*100 + __GNUC_MINOR__*10) >= 340) && ((__GNUC__*100 + __GNUC_MINOR__*10) <= 430)
#define BOOST_INTRUSIVE_DETAIL_HAS_MEMBER_FUNCTION_CALLABLE_WITH_0_ARGS_UNSUPPORTED
@@ -113,7 +113,7 @@
};
//!
- #if !defined(_MSC_VER) || (_MSC_VER != 1600)
+ #if !defined(_MSC_VER) || (_MSC_VER < 1600)
#if defined(BOOST_INTRUSIVE_DETAIL_HAS_MEMBER_FUNCTION_CALLABLE_WITH_0_ARGS_UNSUPPORTED)
@@ -121,16 +121,16 @@
struct BOOST_PP_CAT(BOOST_PP_CAT(has_member_function_callable_with_, BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME),_impl)
<Fun, true BOOST_PP_ENUM_TRAILING(BOOST_PP_SUB(BOOST_PP_ITERATION_FINISH(), BOOST_PP_ITERATION()), BOOST_INTRUSIVE_PP_IDENTITY, void)>
{
- //Mark that we don't support 0 arg calls due to compiler ICE in GCC 3.4/4.0/4.1 and
+ //Mark that we don't support 0 arg calls due to compiler ICE in GCC 3.4/4.0/4.1 and
//wrong SFINAE for GCC 4.2/4.3
static const bool value = true;
};
- #else
+ #else //defined(BOOST_INTRUSIVE_DETAIL_HAS_MEMBER_FUNCTION_CALLABLE_WITH_0_ARGS_UNSUPPORTED)
//Special case for 0 args
template< class F
- , std::size_t N =
+ , std::size_t N =
sizeof((boost::move_detail::declval<F>().
BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME (), 0))>
struct BOOST_PP_CAT(zeroarg_checker_, BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME)
@@ -156,15 +156,15 @@
static BOOST_PP_CAT(zeroarg_checker_, BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME)<U>
Test(BOOST_PP_CAT(zeroarg_checker_, BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME)<U>*);
- template <class U>
+ template <class U>
static boost_intrusive_has_member_function_callable_with::no_type Test(...);
-
+
static const bool value = sizeof(Test< Fun >(0))
== sizeof(boost_intrusive_has_member_function_callable_with::yes_type);
};
- #endif
+ #endif //defined(BOOST_INTRUSIVE_DETAIL_HAS_MEMBER_FUNCTION_CALLABLE_WITH_0_ARGS_UNSUPPORTED)
- #else //#if !defined(_MSC_VER) || (_MSC_VER != 1600)
+ #else //#if !defined(_MSC_VER) || (_MSC_VER < 1600)
template<typename Fun>
struct BOOST_PP_CAT(BOOST_PP_CAT(has_member_function_callable_with_, BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME),_impl)
<Fun, true BOOST_PP_ENUM_TRAILING(BOOST_PP_SUB(BOOST_PP_ITERATION_FINISH(), BOOST_PP_ITERATION()), BOOST_INTRUSIVE_PP_IDENTITY, void)>
@@ -180,7 +180,7 @@
static const bool value = sizeof(Test<Fun>(0))
== sizeof(boost_intrusive_has_member_function_callable_with::yes_type);
};
- #endif //#if !defined(_MSC_VER) || (_MSC_VER != 1600)
+ #endif //#if !defined(_MSC_VER) || (_MSC_VER < 1600)
#else //#if !defined(BOOST_INTRUSIVE_PERFECT_FORWARDING)
@@ -196,7 +196,7 @@
//Special case for 0 args
template< class F
- , std::size_t N =
+ , std::size_t N =
sizeof((boost::move_detail::declval<F>().
BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME (), 0))>
struct BOOST_PP_CAT(zeroarg_checker_, BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME)
@@ -222,9 +222,9 @@
static BOOST_PP_CAT(zeroarg_checker_, BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME)
<U> Test(BOOST_PP_CAT(zeroarg_checker_, BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME)<U>*);
- template <class U>
+ template <class U>
static boost_intrusive_has_member_function_callable_with::no_type Test(...);
-
+
static const bool value = sizeof(Test< Fun >(0))
== sizeof(boost_intrusive_has_member_function_callable_with::yes_type);
};
diff --git a/boost/intrusive/detail/hashtable_node.hpp b/boost/intrusive/detail/hashtable_node.hpp
index ac6ab81948..86e607460c 100644
--- a/boost/intrusive/detail/hashtable_node.hpp
+++ b/boost/intrusive/detail/hashtable_node.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2007-2009
+// (C) Copyright Ion Gaztanaga 2007-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -40,7 +40,7 @@ struct prime_list_holder
template<int Dummy>
const std::size_t prime_list_holder<Dummy>::prime_list[] = {
- 3ul, 7ul, 11ul, 17ul, 29ul,
+ 3ul, 7ul, 11ul, 17ul, 29ul,
53ul, 97ul, 193ul, 389ul, 769ul,
1543ul, 3079ul, 6151ul, 12289ul, 24593ul,
49157ul, 98317ul, 196613ul, 393241ul, 786433ul,
@@ -180,9 +180,9 @@ class hashtable_iterator
{ return hashtable_iterator<Container, false>(this->slist_it(), this->get_container()); }
public:
- hashtable_iterator& operator++()
+ hashtable_iterator& operator++()
{ this->increment(); return *this; }
-
+
hashtable_iterator operator++(int)
{
hashtable_iterator result (*this);
@@ -219,7 +219,7 @@ class hashtable_iterator
size_type buckets_len = cont->bucket_count();
++slist_it_;
- if(buckets[0].cend().pointed_node() <= slist_it_.pointed_node() &&
+ if(buckets[0].cend().pointed_node() <= slist_it_.pointed_node() &&
slist_it_.pointed_node()<= buckets[buckets_len].cend().pointed_node() ){
//Now get the bucket_impl from the iterator
const bucket_type &b = static_cast<const bucket_type&>
diff --git a/boost/intrusive/detail/is_stateful_value_traits.hpp b/boost/intrusive/detail/is_stateful_value_traits.hpp
index e38f4de459..8677c666d4 100644
--- a/boost/intrusive/detail/is_stateful_value_traits.hpp
+++ b/boost/intrusive/detail/is_stateful_value_traits.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2009-2009.
+// (C) Copyright Ion Gaztanaga 2009-2012.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
diff --git a/boost/intrusive/detail/list_node.hpp b/boost/intrusive/detail/list_node.hpp
index df99912dd2..d406af60e4 100644
--- a/boost/intrusive/detail/list_node.hpp
+++ b/boost/intrusive/detail/list_node.hpp
@@ -1,7 +1,7 @@
/////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -57,7 +57,7 @@ struct list_node_traits
{ n->next_ = next; }
};
-// list_iterator provides some basic functions for a
+// list_iterator provides some basic functions for a
// node oriented bidirectional iterator:
template<class Container, bool IsConst>
class list_iterator
@@ -76,7 +76,7 @@ class list_iterator
typedef typename node_traits::node_ptr node_ptr;
typedef typename pointer_traits<node_ptr>::
template rebind_pointer<void>::type void_pointer;
- static const bool store_container_ptr =
+ static const bool store_container_ptr =
detail::store_cont_ptr_on_it<Container>::value;
public:
@@ -103,14 +103,14 @@ class list_iterator
{ members_.nodeptr_ = node; return static_cast<list_iterator&>(*this); }
public:
- list_iterator& operator++()
+ list_iterator& operator++()
{
node_ptr p = node_traits::get_next(members_.nodeptr_);
members_.nodeptr_ = p;
- //members_.nodeptr_ = node_traits::get_next(members_.nodeptr_);
- return static_cast<list_iterator&> (*this);
+ //members_.nodeptr_ = node_traits::get_next(members_.nodeptr_);
+ return static_cast<list_iterator&> (*this);
}
-
+
list_iterator operator++(int)
{
list_iterator result (*this);
@@ -118,12 +118,12 @@ class list_iterator
return result;
}
- list_iterator& operator--()
- {
- members_.nodeptr_ = node_traits::get_previous(members_.nodeptr_);
- return static_cast<list_iterator&> (*this);
+ list_iterator& operator--()
+ {
+ members_.nodeptr_ = node_traits::get_previous(members_.nodeptr_);
+ return static_cast<list_iterator&> (*this);
}
-
+
list_iterator operator--(int)
{
list_iterator result (*this);
@@ -182,8 +182,8 @@ class list_iterator
} members_;
};
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/detail/memory_util.hpp b/boost/intrusive/detail/memory_util.hpp
index ad026c6d61..1a6431b078 100644
--- a/boost/intrusive/detail/memory_util.hpp
+++ b/boost/intrusive/detail/memory_util.hpp
@@ -6,7 +6,7 @@
//
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2011-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2011-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -182,7 +182,11 @@ template <typename Ptr, typename T>
struct type_has_rebind
{
template <typename X>
+ #if !defined (__SUNPRO_CC)
static char test(int, typename X::template rebind<T>*);
+ #else
+ static char test(int, typename X::rebind<T>*);
+ #endif
template <typename X>
static int test(boost::intrusive::detail::LowPriorityConversion<int>, void*);
@@ -194,7 +198,11 @@ template <typename Ptr, typename T>
struct type_has_rebind_other
{
template <typename X>
+ #if !defined (__SUNPRO_CC)
static char test(int, typename X::template rebind<T>::other*);
+ #else
+ static char test(int, typename X::rebind<T>::other*);
+ #endif
template <typename X>
static int test(boost::intrusive::detail::LowPriorityConversion<int>, void*);
@@ -205,12 +213,6 @@ struct type_has_rebind_other
template <typename Ptr, typename T>
struct type_rebind_mode
{
- template <typename X>
- static char test(int, typename X::template rebind<T>::other*);
-
- template <typename X>
- static int test(boost::intrusive::detail::LowPriorityConversion<int>, void*);
-
static const unsigned int rebind = (unsigned int)type_has_rebind<Ptr, T>::value;
static const unsigned int rebind_other = (unsigned int)type_has_rebind_other<Ptr, T>::value;
static const unsigned int mode = rebind + rebind*rebind_other;
@@ -251,6 +253,13 @@ struct type_rebinder<Ptr<T, Tn...>, U, 0u >
typedef Ptr<U, Tn...> type;
};
+//Needed for non-conforming compilers like GCC 4.3
+template <template <class> class Ptr, typename T, class U>
+struct type_rebinder<Ptr<T>, U, 0u >
+{
+ typedef Ptr<U> type;
+};
+
#else //C++03 compilers
#define BOOST_PP_LOCAL_MACRO(n) \
diff --git a/boost/intrusive/detail/mpl.hpp b/boost/intrusive/detail/mpl.hpp
index 075381cae2..02b1361d2a 100644
--- a/boost/intrusive/detail/mpl.hpp
+++ b/boost/intrusive/detail/mpl.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -127,10 +127,10 @@ struct identity
#if defined(BOOST_MSVC) || defined(__BORLANDC_)
#define BOOST_INTRUSIVE_TT_DECL __cdecl
#else
-#define BOOST_INTRUSIVE_TT_DECL
+#define BOOST_INTRUSIVE_TT_DECL
#endif
-#if defined(_MSC_EXTENSIONS) && !defined(__BORLAND__) && !defined(_WIN64)
+#if defined(_MSC_EXTENSIONS) && !defined(__BORLAND__) && !defined(_WIN64) && !defined(UNDER_CE)
#define BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS
#endif
@@ -156,10 +156,14 @@ template <typename R>
struct is_unary_or_binary_function_impl<R (__stdcall*)()>
{ static const bool value = true; };
+#ifndef _MANAGED
+
template <typename R>
struct is_unary_or_binary_function_impl<R (__fastcall*)()>
{ static const bool value = true; };
+#endif
+
template <typename R>
struct is_unary_or_binary_function_impl<R (__cdecl*)()>
{ static const bool value = true; };
@@ -188,10 +192,14 @@ template <typename R, class T0>
struct is_unary_or_binary_function_impl<R (__stdcall*)(T0)>
{ static const bool value = true; };
+#ifndef _MANAGED
+
template <typename R, class T0>
struct is_unary_or_binary_function_impl<R (__fastcall*)(T0)>
{ static const bool value = true; };
+#endif
+
template <typename R, class T0>
struct is_unary_or_binary_function_impl<R (__cdecl*)(T0)>
{ static const bool value = true; };
@@ -220,10 +228,14 @@ template <typename R, class T0, class T1>
struct is_unary_or_binary_function_impl<R (__stdcall*)(T0, T1)>
{ static const bool value = true; };
+#ifndef _MANAGED
+
template <typename R, class T0, class T1>
struct is_unary_or_binary_function_impl<R (__fastcall*)(T0, T1)>
{ static const bool value = true; };
+#endif
+
template <typename R, class T0, class T1>
struct is_unary_or_binary_function_impl<R (__cdecl*)(T0, T1)>
{ static const bool value = true; };
@@ -346,9 +358,9 @@ struct ls_zeros<1>
static const std::size_t value = 0;
};
-} //namespace detail
-} //namespace intrusive
-} //namespace boost
+} //namespace detail
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/detail/parent_from_member.hpp b/boost/intrusive/detail/parent_from_member.hpp
index c06d932a70..2afffb47bc 100644
--- a/boost/intrusive/detail/parent_from_member.hpp
+++ b/boost/intrusive/detail/parent_from_member.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2007-2009
+// (C) Copyright Ion Gaztanaga 2007-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -31,29 +31,53 @@ inline std::ptrdiff_t offset_from_pointer_to_member(const Member Parent::* ptr_t
//The implementation of a pointer to member is compiler dependent.
#if defined(BOOST_INTRUSIVE_MSVC_COMPLIANT_PTR_TO_MEMBER)
//msvc compliant compilers use their the first 32 bits as offset (even in 64 bit mode)
- return *(const boost::int32_t*)(void*)&ptr_to_member;
+ union caster_union
+ {
+ const Member Parent::* ptr_to_member;
+ boost::int32_t offset;
+ } caster;
+ caster.ptr_to_member = ptr_to_member;
+ return std::ptrdiff_t(caster.offset);
//This works with gcc, msvc, ac++, ibmcpp
#elif defined(__GNUC__) || defined(__HP_aCC) || defined(BOOST_INTEL) || \
defined(__IBMCPP__) || defined(__DECCXX)
const Parent * const parent = 0;
- const char *const member = reinterpret_cast<const char*>(&(parent->*ptr_to_member));
- return std::ptrdiff_t(member - reinterpret_cast<const char*>(parent));
+ const char *const member = static_cast<const char*>(static_cast<const void*>(&(parent->*ptr_to_member)));
+ return std::ptrdiff_t(member - static_cast<const char*>(static_cast<const void*>(parent)));
#else
//This is the traditional C-front approach: __MWERKS__, __DMC__, __SUNPRO_CC
- return (*(const std::ptrdiff_t*)(void*)&ptr_to_member) - 1;
+ union caster_union
+ {
+ const Member Parent::* ptr_to_member;
+ std::ptrdiff_t offset;
+ } caster;
+ caster.ptr_to_member = ptr_to_member;
+ return caster.offset - 1;
#endif
}
template<class Parent, class Member>
inline Parent *parent_from_member(Member *member, const Member Parent::* ptr_to_member)
{
- return (Parent*)((char*)member - offset_from_pointer_to_member(ptr_to_member));
+ return static_cast<Parent*>
+ (
+ static_cast<void*>
+ (
+ static_cast<char*>(static_cast<void*>(member)) - offset_from_pointer_to_member(ptr_to_member)
+ )
+ );
}
template<class Parent, class Member>
inline const Parent *parent_from_member(const Member *member, const Member Parent::* ptr_to_member)
{
- return (const Parent*)((const char*)member - offset_from_pointer_to_member(ptr_to_member));
+ return static_cast<const Parent*>
+ (
+ static_cast<const void*>
+ (
+ static_cast<const char*>(static_cast<const void*>(member)) - offset_from_pointer_to_member(ptr_to_member)
+ )
+ );
}
} //namespace detail {
diff --git a/boost/intrusive/detail/preprocessor.hpp b/boost/intrusive/detail/preprocessor.hpp
index de662809e3..348b104bb0 100644
--- a/boost/intrusive/detail/preprocessor.hpp
+++ b/boost/intrusive/detail/preprocessor.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2008-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2008-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -18,7 +18,7 @@
#include <boost/intrusive/detail/config_begin.hpp>
#include <boost/intrusive/detail/workaround.hpp>
-#include <boost/preprocessor/iteration/local.hpp>
+#include <boost/preprocessor/iteration/local.hpp>
#include <boost/preprocessor/punctuation/paren_if.hpp>
#include <boost/preprocessor/punctuation/comma_if.hpp>
#include <boost/preprocessor/control/expr_if.hpp>
diff --git a/boost/intrusive/detail/rbtree_node.hpp b/boost/intrusive/detail/rbtree_node.hpp
index dbe0130024..b76582bb61 100644
--- a/boost/intrusive/detail/rbtree_node.hpp
+++ b/boost/intrusive/detail/rbtree_node.hpp
@@ -1,7 +1,7 @@
/////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztanaga 2006-2009.
+// (C) Copyright Ion Gaztanaga 2006-2012.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -164,13 +164,13 @@ struct rbtree_node_traits
, OptimizeSize &&
(max_pointer_plus_bits
< VoidPointer
- , detail::alignment_of<compact_rbtree_node<VoidPointer> >::value
+ , detail::alignment_of<compact_rbtree_node<VoidPointer> >::value
>::value >= 1)
>
{};
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/detail/slist_node.hpp b/boost/intrusive/detail/slist_node.hpp
index 5b96c09742..0eddbcd69a 100644
--- a/boost/intrusive/detail/slist_node.hpp
+++ b/boost/intrusive/detail/slist_node.hpp
@@ -1,7 +1,7 @@
/////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -43,13 +43,13 @@ struct slist_node_traits
<VoidPointer>::template rebind_pointer<const node>::type const_node_ptr;
static const node_ptr &get_next(const const_node_ptr & n)
- { return n->next_; }
+ { return n->next_; }
static void set_next(const node_ptr & n, const node_ptr & next)
- { n->next_ = next; }
+ { n->next_ = next; }
};
-// slist_iterator provides some basic functions for a
+// slist_iterator provides some basic functions for a
// node oriented bidirectional iterator:
template<class Container, bool IsConst>
class slist_iterator
@@ -68,7 +68,7 @@ class slist_iterator
typedef typename node_traits::node_ptr node_ptr;
typedef typename pointer_traits
<node_ptr>::template rebind_pointer <void>::type void_pointer;
- static const bool store_container_ptr =
+ static const bool store_container_ptr =
detail::store_cont_ptr_on_it<Container>::value;
public:
@@ -95,12 +95,12 @@ class slist_iterator
{ members_.nodeptr_ = node; return static_cast<slist_iterator&>(*this); }
public:
- slist_iterator& operator++()
- {
- members_.nodeptr_ = node_traits::get_next(members_.nodeptr_);
- return static_cast<slist_iterator&> (*this);
+ slist_iterator& operator++()
+ {
+ members_.nodeptr_ = node_traits::get_next(members_.nodeptr_);
+ return static_cast<slist_iterator&> (*this);
}
-
+
slist_iterator operator++(int)
{
slist_iterator result (*this);
@@ -155,8 +155,8 @@ class slist_iterator
} members_;
};
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/detail/transform_iterator.hpp b/boost/intrusive/detail/transform_iterator.hpp
index 15ef3ab2c9..488db9ade8 100644
--- a/boost/intrusive/detail/transform_iterator.hpp
+++ b/boost/intrusive/detail/transform_iterator.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2007-2009
+// (C) Copyright Ion Gaztanaga 2007-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -71,7 +71,7 @@ class transform_iterator
{ return members_.m_it; }
//Constructors
- transform_iterator& operator++()
+ transform_iterator& operator++()
{ increment(); return *this; }
transform_iterator operator++(int)
diff --git a/boost/intrusive/detail/tree_algorithms.hpp b/boost/intrusive/detail/tree_algorithms.hpp
index 8d31d9d710..c92d39b3b9 100644
--- a/boost/intrusive/detail/tree_algorithms.hpp
+++ b/boost/intrusive/detail/tree_algorithms.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2007.
+// (C) Copyright Ion Gaztanaga 2007-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -25,20 +25,20 @@ namespace intrusive {
namespace detail {
//! This is an implementation of a binary search tree.
-//! A node in the search tree has references to its children and its parent. This
-//! is to allow traversal of the whole tree from a given node making the
+//! A node in the search tree has references to its children and its parent. This
+//! is to allow traversal of the whole tree from a given node making the
//! implementation of iterator a pointer to a node.
-//! At the top of the tree a node is used specially. This node's parent pointer
-//! is pointing to the root of the tree. Its left pointer points to the
+//! At the top of the tree a node is used specially. This node's parent pointer
+//! is pointing to the root of the tree. Its left pointer points to the
//! leftmost node in the tree and the right pointer to the rightmost one.
//! This node is used to represent the end-iterator.
//!
-//! +---------+
-//! header------------------------------>| |
-//! | |
-//! +----------(left)--------| |--------(right)---------+
-//! | +---------+ |
-//! | | |
+//! +---------+
+//! header------------------------------>| |
+//! | |
+//! +----------(left)--------| |--------(right)---------+
+//! | +---------+ |
+//! | | |
//! | | (parent) |
//! | | |
//! | | |
@@ -61,10 +61,10 @@ namespace detail {
//! | | | | | |
//! | | | | | |
//! | +---+-----+ +-----+---+ +---+-----+ +-----+---+ |
-//! +-->| | | | | | | |<--+
-//! | A | | C | | E | | G |
-//! | | | | | | | |
-//! +---------+ +---------+ +---------+ +---------+
+//! +-->| | | | | | | |<--+
+//! | A | | C | | E | | G |
+//! | | | | | | | |
+//! +---------+ +---------+ +---------+ +---------+
//!
//! tree_algorithms is configured with a NodeTraits class, which encapsulates the
@@ -82,15 +82,15 @@ namespace detail {
//! <b>Static functions</b>:
//!
//! <tt>static node_ptr get_parent(const_node_ptr n);</tt>
-//!
+//!
//! <tt>static void set_parent(node_ptr n, node_ptr parent);</tt>
//!
//! <tt>static node_ptr get_left(const_node_ptr n);</tt>
-//!
+//!
//! <tt>static void set_left(node_ptr n, node_ptr left);</tt>
//!
//! <tt>static node_ptr get_right(const_node_ptr n);</tt>
-//!
+//!
//! <tt>static void set_right(node_ptr n, node_ptr right);</tt>
template<class NodeTraits>
class tree_algorithms
@@ -153,11 +153,11 @@ class tree_algorithms
//! <b>Requires</b>: 'node' is a node of the tree or an node initialized
//! by init(...) or init_node.
- //!
+ //!
//! <b>Effects</b>: Returns true if the node is initialized by init() or init_node().
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static bool unique(const const_node_ptr & node)
{ return !NodeTraits::get_parent(node); }
@@ -175,15 +175,15 @@ class tree_algorithms
//! <b>Requires</b>: node1 and node2 can't be header nodes
//! of two trees.
- //!
+ //!
//! <b>Effects</b>: Swaps two nodes. After the function node1 will be inserted
//! in the position node2 before the function. node2 will be inserted in the
//! position node1 had before the function.
- //!
- //! <b>Complexity</b>: Logarithmic.
- //!
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! node1 and node2 are not equivalent according to the ordering rules.
//!
@@ -192,22 +192,22 @@ class tree_algorithms
{
if(node1 == node2)
return;
-
+
node_ptr header1(get_header(node1)), header2(get_header(node2));
swap_nodes(node1, header1, node2, header2);
}
//! <b>Requires</b>: node1 and node2 can't be header nodes
//! of two trees with header header1 and header2.
- //!
+ //!
//! <b>Effects</b>: Swaps two nodes. After the function node1 will be inserted
//! in the position node2 before the function. node2 will be inserted in the
//! position node1 had before the function.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! node1 and node2 are not equivalent according to the ordering rules.
//!
@@ -216,8 +216,8 @@ class tree_algorithms
{
if(node1 == node2)
return;
-
- //node1 and node2 must not be header nodes
+
+ //node1 and node2 must not be header nodes
//BOOST_INTRUSIVE_INVARIANT_ASSERT((header1 != node1 && header2 != node2));
if(header1 != header2){
//Update header1 if necessary
@@ -347,14 +347,14 @@ class tree_algorithms
//! <b>Requires</b>: node_to_be_replaced must be inserted in a tree
//! and new_node must not be inserted in a tree.
- //!
+ //!
//! <b>Effects</b>: Replaces node_to_be_replaced in its position in the
//! tree with new_node. The tree does not need to be rebalanced
- //!
- //! <b>Complexity</b>: Logarithmic.
- //!
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! new_node is not equivalent to node_to_be_replaced according to the
//! ordering rules. This function is faster than erasing and inserting
@@ -370,14 +370,14 @@ class tree_algorithms
//! <b>Requires</b>: node_to_be_replaced must be inserted in a tree
//! with header "header" and new_node must not be inserted in a tree.
- //!
+ //!
//! <b>Effects</b>: Replaces node_to_be_replaced in its position in the
//! tree with new_node. The tree does not need to be rebalanced
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! new_node is not equivalent to node_to_be_replaced according to the
//! ordering rules. This function is faster than erasing and inserting
@@ -388,7 +388,7 @@ class tree_algorithms
{
if(node_to_be_replaced == new_node)
return;
-
+
//Update header if necessary
if(node_to_be_replaced == NodeTraits::get_left(header)){
NodeTraits::set_left(header, new_node);
@@ -428,11 +428,11 @@ class tree_algorithms
}
//! <b>Requires</b>: 'node' is a node from the tree except the header.
- //!
+ //!
//! <b>Effects</b>: Returns the next node of the tree.
- //!
+ //!
//! <b>Complexity</b>: Average constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static node_ptr next_node(const node_ptr & node)
{
@@ -452,11 +452,11 @@ class tree_algorithms
}
//! <b>Requires</b>: 'node' is a node from the tree except the leftmost node.
- //!
+ //!
//! <b>Effects</b>: Returns the previous node of the tree.
- //!
+ //!
//! <b>Complexity</b>: Average constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static node_ptr prev_node(const node_ptr & node)
{
@@ -479,11 +479,11 @@ class tree_algorithms
}
//! <b>Requires</b>: 'node' is a node of a tree but not the header.
- //!
+ //!
//! <b>Effects</b>: Returns the minimum node of the subtree starting at p.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic to the size of the subtree.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static node_ptr minimum (const node_ptr & node)
{
@@ -497,11 +497,11 @@ class tree_algorithms
}
//! <b>Requires</b>: 'node' is a node of a tree but not the header.
- //!
+ //!
//! <b>Effects</b>: Returns the maximum node of the subtree starting at p.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic to the size of the subtree.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static node_ptr maximum(const node_ptr & node)
{
@@ -517,9 +517,9 @@ class tree_algorithms
//! <b>Requires</b>: 'node' must not be part of any tree.
//!
//! <b>Effects</b>: After the function unique(node) == true.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
//!
//! <b>Nodes</b>: If node is inserted in a tree, this function corrupts the tree.
@@ -527,17 +527,17 @@ class tree_algorithms
{
NodeTraits::set_parent(node, node_ptr());
NodeTraits::set_left(node, node_ptr());
- NodeTraits::set_right(node, node_ptr());
+ NodeTraits::set_right(node, node_ptr());
};
//! <b>Effects</b>: Returns true if node is in the same state as if called init(node)
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static bool inited(const const_node_ptr & node)
{
- return !NodeTraits::get_parent(node) &&
+ return !NodeTraits::get_parent(node) &&
!NodeTraits::get_left(node) &&
!NodeTraits::get_right(node) ;
};
@@ -546,9 +546,9 @@ class tree_algorithms
//!
//! <b>Effects</b>: Initializes the header to represent an empty tree.
//! unique(header) == true.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
//!
//! <b>Nodes</b>: If node is inserted in a tree, this function corrupts the tree.
@@ -556,19 +556,19 @@ class tree_algorithms
{
NodeTraits::set_parent(header, node_ptr());
NodeTraits::set_left(header, header);
- NodeTraits::set_right(header, header);
+ NodeTraits::set_right(header, header);
}
//! <b>Requires</b>: "disposer" must be an object function
//! taking a node_ptr parameter and shouldn't throw.
//!
- //! <b>Effects</b>: Empties the target tree calling
+ //! <b>Effects</b>: Empties the target tree calling
//! <tt>void disposer::operator()(const node_ptr &)</tt> for every node of the tree
//! except the header.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of element of the source tree plus the.
//! number of elements of tree target tree when calling this function.
- //!
+ //!
//! <b>Throws</b>: If cloner functor throws. If this happens target nodes are disposed.
template<class Disposer>
static void clear_and_dispose(const node_ptr & header, Disposer disposer)
@@ -581,14 +581,14 @@ class tree_algorithms
}
//! <b>Requires</b>: header is the header of a tree.
- //!
+ //!
//! <b>Effects</b>: Unlinks the leftmost node from the tree, and
//! updates the header link to the new leftmost node.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function breaks the tree and the tree can
//! only be used for more unlink_leftmost_without_rebalance calls.
//! This function is normally used to achieve a step by step
@@ -624,11 +624,11 @@ class tree_algorithms
}
//! <b>Requires</b>: node is a node of the tree but it's not the header.
- //!
+ //!
//! <b>Effects</b>: Returns the number of nodes of the subtree.
- //!
+ //!
//! <b>Complexity</b>: Linear time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static std::size_t count(const const_node_ptr & subtree)
{
@@ -660,11 +660,11 @@ class tree_algorithms
}
//! <b>Requires</b>: node is a node of the tree but it's not the header.
- //!
+ //!
//! <b>Effects</b>: Returns the number of nodes of the subtree.
- //!
+ //!
//! <b>Complexity</b>: Linear time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static std::size_t size(const const_node_ptr & header)
{
@@ -677,18 +677,18 @@ class tree_algorithms
//! <b>Requires</b>: header1 and header2 must be the header nodes
//! of two trees.
- //!
- //! <b>Effects</b>: Swaps two trees. After the function header1 will contain
+ //!
+ //! <b>Effects</b>: Swaps two trees. After the function header1 will contain
//! links to the second tree and header2 will have links to the first tree.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
static void swap_tree(const node_ptr & header1, const node_ptr & header2)
{
if(header1 == header2)
return;
-
+
node_ptr tmp;
//Parent swap
@@ -734,7 +734,7 @@ class tree_algorithms
(NodeTraits::get_parent(p_left) != p ||
NodeTraits::get_parent(p_right) != p ))
//When tree size > 1 headers can't be leftmost's
- //and rightmost's parent
+ //and rightmost's parent
)){
return true;
}
@@ -750,7 +750,7 @@ class tree_algorithms
//! "key" according to "comp" or "header" if that element does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class KeyType, class KeyNodePtrCompare>
static node_ptr find
@@ -765,55 +765,73 @@ class tree_algorithms
//! KeyNodePtrCompare is a function object that induces a strict weak
//! ordering compatible with the strict weak ordering used to create the
//! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
//!
- //! <b>Effects</b>: Returns an a pair of node_ptr delimiting a range containing
- //! all elements that are equivalent to "key" according to "comp" or an
- //! empty range that indicates the position where those elements would be
- //! if they there are no equivalent elements.
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
- template<class KeyType, class KeyNodePtrCompare>
- static std::pair<node_ptr, node_ptr> equal_range
- (const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp)
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template< class KeyType, class KeyNodePtrCompare>
+ static std::pair<node_ptr, node_ptr> bounded_range
+ ( const const_node_ptr & header
+ , const KeyType &lower_key
+ , const KeyType &upper_key
+ , KeyNodePtrCompare comp
+ , bool left_closed
+ , bool right_closed)
{
node_ptr y = uncast(header);
node_ptr x = NodeTraits::get_parent(header);
while(x){
- if(comp(x, key)){
+ //If x is less than lower_key the target
+ //range is on the right part
+ if(comp(x, lower_key)){
+ //Check for invalid input range
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(comp(x, upper_key));
x = NodeTraits::get_right(x);
}
- else if(comp(key, x)){
+ //If the upper_key is less than x, the target
+ //range is on the left part
+ else if(comp(upper_key, x)){
+ //y > upper_key
y = x;
x = NodeTraits::get_left(x);
}
else{
- node_ptr xu(x), yu(y);
- y = x, x = NodeTraits::get_left(x);
- xu = NodeTraits::get_right(xu);
-
- while(x){
- if(comp(x, key)){
- x = NodeTraits::get_right(x);
- }
- else {
- y = x;
- x = NodeTraits::get_left(x);
- }
- }
-
- while(xu){
- if(comp(key, xu)){
- yu = xu;
- xu = NodeTraits::get_left(xu);
- }
- else {
- xu = NodeTraits::get_right(xu);
- }
- }
- return std::pair<node_ptr,node_ptr> (y, yu);
+ //x is inside the bounded range( x >= lower_key && x <= upper_key),
+ //so we must split lower and upper searches
+ //
+ //Sanity check: if lower_key and upper_key are equal, then both left_closed and right_closed can't be false
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(left_closed || right_closed || comp(lower_key, x) || comp(x, upper_key));
+ return std::pair<node_ptr,node_ptr>(
+ left_closed
+ //If left_closed, then comp(x, lower_key) is already the lower_bound
+ //condition so we save one comparison and go to the next level
+ //following traditional lower_bound algo
+ ? lower_bound_loop(NodeTraits::get_left(x), x, lower_key, comp)
+ //If left-open, comp(x, lower_key) is not the upper_bound algo
+ //condition so we must recheck current 'x' node with upper_bound algo
+ : upper_bound_loop(x, y, lower_key, comp)
+ ,
+ right_closed
+ //If right_closed, then comp(upper_key, x) is already the upper_bound
+ //condition so we can save one comparison and go to the next level
+ //following lower_bound algo
+ ? upper_bound_loop(NodeTraits::get_right(x), y, upper_key, comp)
+ //If right-open, comp(upper_key, x) is not the lower_bound algo
+ //condition so we must recheck current 'x' node with lower_bound algo
+ : lower_bound_loop(x, y, upper_key, comp)
+ );
}
}
return std::pair<node_ptr,node_ptr> (y, y);
@@ -824,29 +842,38 @@ class tree_algorithms
//! ordering compatible with the strict weak ordering used to create the
//! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
//!
+ //! <b>Effects</b>: Returns an a pair of node_ptr delimiting a range containing
+ //! all elements that are equivalent to "key" according to "comp" or an
+ //! empty range that indicates the position where those elements would be
+ //! if there are no equivalent elements.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class KeyType, class KeyNodePtrCompare>
+ static std::pair<node_ptr, node_ptr> equal_range
+ (const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp)
+ {
+ return bounded_range(header, key, key, comp, true, true);
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
+ //!
//! <b>Effects</b>: Returns an node_ptr to the first element that is
//! not less than "key" according to "comp" or "header" if that element does
//! not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class KeyType, class KeyNodePtrCompare>
static node_ptr lower_bound
(const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp)
{
- node_ptr y = uncast(header);
- node_ptr x = NodeTraits::get_parent(header);
- while(x){
- if(comp(x, key)){
- x = NodeTraits::get_right(x);
- }
- else {
- y = x;
- x = NodeTraits::get_left(x);
- }
- }
- return y;
+ return lower_bound_loop(NodeTraits::get_parent(header), uncast(header), key, comp);
}
//! <b>Requires</b>: "header" must be the header node of a tree.
@@ -858,40 +885,29 @@ class tree_algorithms
//! than "key" according to "comp" or "header" if that element does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class KeyType, class KeyNodePtrCompare>
static node_ptr upper_bound
(const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp)
{
- node_ptr y = uncast(header);
- node_ptr x = NodeTraits::get_parent(header);
- while(x){
- if(comp(key, x)){
- y = x;
- x = NodeTraits::get_left(x);
- }
- else {
- x = NodeTraits::get_right(x);
- }
- }
- return y;
+ return upper_bound_loop(NodeTraits::get_parent(header), uncast(header), key, comp);
}
//! <b>Requires</b>: "header" must be the header node of a tree.
//! "commit_data" must have been obtained from a previous call to
//! "insert_unique_check". No objects should have been inserted or erased
//! from the set between the "insert_unique_check" that filled "commit_data"
- //! and the call to "insert_commit".
- //!
- //!
+ //! and the call to "insert_commit".
+ //!
+ //!
//! <b>Effects</b>: Inserts new_node in the set using the information obtained
//! from the "commit_data" that a previous "insert_check" filled.
//!
//! <b>Complexity</b>: Constant time.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function has only sense if a "insert_unique_check" has been
//! previously executed to fill "commit_data". No value should be inserted or
//! erased between the "insert_check" and "insert_commit" calls.
@@ -929,7 +945,7 @@ class tree_algorithms
//! KeyNodePtrCompare is a function object that induces a strict weak
//! ordering compatible with the strict weak ordering used to create the
//! the tree. NodePtrCompare compares KeyType with a node_ptr.
- //!
+ //!
//! <b>Effects</b>: Checks if there is an equivalent node to "key" in the
//! tree according to "comp" and obtains the needed information to realize
//! a constant-time node insertion if there is no equivalent node.
@@ -940,11 +956,11 @@ class tree_algorithms
//! in the returned pair's boolean and fills "commit_data" that is meant to
//! be used with the "insert_commit" function to achieve a constant-time
//! insertion function.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is at most logarithmic.
//!
//! <b>Throws</b>: If "comp" throws.
- //!
+ //!
//! <b>Notes</b>: This function is used to improve performance when constructing
//! a node is expensive and the user does not want to have two equivalent nodes
//! in the tree: if there is an equivalent value
@@ -976,7 +992,7 @@ class tree_algorithms
while(x){
++depth;
y = x;
- x = (left_child = comp(key, x)) ?
+ x = (left_child = comp(key, x)) ?
NodeTraits::get_left(x) : (prev = y, NodeTraits::get_right(x));
}
@@ -1026,7 +1042,7 @@ class tree_algorithms
{
if(hint == header || !comp(hint, new_node)){
node_ptr prev(hint);
- if(hint == NodeTraits::get_left(header) ||
+ if(hint == NodeTraits::get_left(header) ||
!comp(new_node, (prev = prev_node(hint)))){
bool link_left = unique(header) || !NodeTraits::get_left(hint);
commit_data.link_left = link_left;
@@ -1147,13 +1163,13 @@ class tree_algorithms
}
//! <b>Requires</b>: 'node' can't be a header node.
- //!
+ //!
//! <b>Effects</b>: Calculates the depth of a node: the depth of a
//! node is the length (number of edges) of the path from the root
//! to that node. (The root node is at depth 0.)
- //!
- //! <b>Complexity</b>: Logarithmic to the number of nodes in the tree.
- //!
+ //!
+ //! <b>Complexity</b>: Logarithmic to the number of nodes in the tree.
+ //!
//! <b>Throws</b>: Nothing.
static std::size_t depth(const const_node_ptr & node)
{
@@ -1171,18 +1187,18 @@ class tree_algorithms
//! object taking a node_ptr and returning a new cloned node of it. "disposer" must
//! take a node_ptr and shouldn't throw.
//!
- //! <b>Effects</b>: First empties target tree calling
+ //! <b>Effects</b>: First empties target tree calling
//! <tt>void disposer::operator()(const node_ptr &)</tt> for every node of the tree
//! except the header.
- //!
+ //!
//! Then, duplicates the entire tree pointed by "source_header" cloning each
- //! source node with <tt>node_ptr Cloner::operator()(const node_ptr &)</tt> to obtain
+ //! source node with <tt>node_ptr Cloner::operator()(const node_ptr &)</tt> to obtain
//! the nodes of the target tree. If "cloner" throws, the cloned target nodes
//! are disposed using <tt>void disposer(const node_ptr &)</tt>.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of element of the source tree plus the.
//! number of elements of tree target tree when calling this function.
- //!
+ //!
//! <b>Throws</b>: If cloner functor throws. If this happens target nodes are disposed.
template <class Cloner, class Disposer>
static void clone
@@ -1247,7 +1263,7 @@ class tree_algorithms
leftmost = insertion_point;
}
//Then clone right nodes
- else if( NodeTraits::get_right(current) &&
+ else if( NodeTraits::get_right(current) &&
!NodeTraits::get_right(insertion_point)){
current = NodeTraits::get_right(current);
node_ptr temp = insertion_point;
@@ -1300,21 +1316,21 @@ class tree_algorithms
}
//! <b>Requires</b>: p is a node of a tree.
- //!
+ //!
//! <b>Effects</b>: Returns true if p is a left child.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static bool is_left_child(const node_ptr & p)
{ return NodeTraits::get_left(NodeTraits::get_parent(p)) == p; }
//! <b>Requires</b>: p is a node of a tree.
- //!
+ //!
//! <b>Effects</b>: Returns true if p is a right child.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static bool is_right_child(const node_ptr & p)
{ return NodeTraits::get_right(NodeTraits::get_parent(p)) == p; }
@@ -1449,7 +1465,7 @@ class tree_algorithms
if(!old_root) return node_ptr();
//To avoid irregularities in the algorithm (old_root can be a
- //left or right child or even the root of the tree) just put the
+ //left or right child or even the root of the tree) just put the
//root as the right child of its parent. Before doing this backup
//information to restore the original relationship after
//the algorithm is applied.
@@ -1521,7 +1537,7 @@ class tree_algorithms
if(!old_root) return old_root;
//To avoid irregularities in the algorithm (old_root can be
- //left or right child or even the root of the tree) just put the
+ //left or right child or even the root of the tree) just put the
//root as the right child of its parent. First obtain
//information to restore the original relationship after
//the algorithm is applied.
@@ -1536,7 +1552,7 @@ class tree_algorithms
//Put old_root as right child
NodeTraits::set_right(super_root, old_root);
- //Start the compression algorithm
+ //Start the compression algorithm
node_ptr even_parent = super_root;
node_ptr new_root = old_root;
@@ -1578,7 +1594,7 @@ class tree_algorithms
//! <b>Effects</b>: Returns a pointer to the header node of the tree.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static node_ptr get_root(const node_ptr & node)
{
@@ -1596,6 +1612,40 @@ class tree_algorithms
}
private:
+
+ template<class KeyType, class KeyNodePtrCompare>
+ static node_ptr lower_bound_loop
+ (node_ptr x, node_ptr y, const KeyType &key, KeyNodePtrCompare comp)
+ {
+ while(x){
+ if(comp(x, key)){
+ x = NodeTraits::get_right(x);
+ }
+ else{
+ y = x;
+ x = NodeTraits::get_left(x);
+ }
+ }
+ return y;
+ }
+
+ template<class KeyType, class KeyNodePtrCompare>
+ static node_ptr upper_bound_loop
+ (node_ptr x, node_ptr y, const KeyType &key, KeyNodePtrCompare comp)
+ {
+ while(x){
+ if(comp(key, x)){
+ y = x;
+ x = NodeTraits::get_left(x);
+ }
+ else{
+ x = NodeTraits::get_right(x);
+ }
+ }
+ return y;
+ }
+
+
template<class NodePtrCompare>
static void insert_equal_check_impl
(bool upper, const node_ptr & h, const node_ptr & new_node, NodePtrCompare comp, insert_commit_data & commit_data, std::size_t *pdepth = 0)
@@ -1609,7 +1659,7 @@ class tree_algorithms
while(x){
++depth;
y = x;
- x = comp(new_node, x) ?
+ x = comp(new_node, x) ?
NodeTraits::get_left(x) : NodeTraits::get_right(x);
}
link_left = (y == h) || comp(new_node, y);
@@ -1618,7 +1668,7 @@ class tree_algorithms
while(x){
++depth;
y = x;
- x = !comp(x, new_node) ?
+ x = !comp(x, new_node) ?
NodeTraits::get_left(x) : NodeTraits::get_right(x);
}
link_left = (y == h) || !comp(y, new_node);
@@ -1689,8 +1739,8 @@ class tree_algorithms
};
} //namespace detail {
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/detail/tree_node.hpp b/boost/intrusive/detail/tree_node.hpp
index ccbe70caf1..09fa7a4562 100644
--- a/boost/intrusive/detail/tree_node.hpp
+++ b/boost/intrusive/detail/tree_node.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2007.
+// (C) Copyright Ion Gaztanaga 2007-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -66,7 +66,7 @@ struct tree_node_traits
// //
/////////////////////////////////////////////////////////////////////////////
-// tree_iterator provides some basic functions for a
+// tree_iterator provides some basic functions for a
// node oriented bidirectional iterator:
template<class Container, bool IsConst>
class tree_iterator
@@ -86,7 +86,7 @@ class tree_iterator
typedef typename node_traits::node_ptr node_ptr;
typedef typename pointer_traits<node_ptr>::template
rebind_pointer<void>::type void_pointer;
- static const bool store_container_ptr =
+ static const bool store_container_ptr =
detail::store_cont_ptr_on_it<Container>::value;
public:
@@ -114,12 +114,12 @@ class tree_iterator
{ members_.nodeptr_ = nodeptr; return static_cast<tree_iterator&>(*this); }
public:
- tree_iterator& operator++()
- {
- members_.nodeptr_ = node_algorithms::next_node(members_.nodeptr_);
- return static_cast<tree_iterator&> (*this);
+ tree_iterator& operator++()
+ {
+ members_.nodeptr_ = node_algorithms::next_node(members_.nodeptr_);
+ return static_cast<tree_iterator&> (*this);
}
-
+
tree_iterator operator++(int)
{
tree_iterator result (*this);
@@ -127,12 +127,12 @@ class tree_iterator
return result;
}
- tree_iterator& operator--()
- {
- members_.nodeptr_ = node_algorithms::prev_node(members_.nodeptr_);
- return static_cast<tree_iterator&> (*this);
+ tree_iterator& operator--()
+ {
+ members_.nodeptr_ = node_algorithms::prev_node(members_.nodeptr_);
+ return static_cast<tree_iterator&> (*this);
}
-
+
tree_iterator operator--(int)
{
tree_iterator result (*this);
@@ -182,8 +182,8 @@ class tree_iterator
} members_;
};
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/detail/utilities.hpp b/boost/intrusive/detail/utilities.hpp
index c0416203ff..c6bc798994 100644
--- a/boost/intrusive/detail/utilities.hpp
+++ b/boost/intrusive/detail/utilities.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -200,7 +200,7 @@ struct key_nodeptr_comp
key_nodeptr_comp(KeyValueCompare kcomp, const Container *cont)
: base_t(kcomp), cont_(cont)
{}
-
+
template<class T>
struct is_node_ptr
{
@@ -236,7 +236,7 @@ struct node_cloner
typedef typename real_value_traits::node_ptr node_ptr;
typedef typename real_value_traits::const_node_ptr const_node_ptr;
typedef detail::ebo_functor_holder<F> base_t;
- enum { safemode_or_autounlink =
+ enum { safemode_or_autounlink =
(int)real_value_traits::link_mode == (int)auto_unlink ||
(int)real_value_traits::link_mode == (int)safe_link };
@@ -270,7 +270,7 @@ struct node_disposer
typedef typename real_value_traits::node_ptr node_ptr;
typedef detail::ebo_functor_holder<F> base_t;
typedef typename Container::node_algorithms node_algorithms;
- enum { safemode_or_autounlink =
+ enum { safemode_or_autounlink =
(int)real_value_traits::link_mode == (int)auto_unlink ||
(int)real_value_traits::link_mode == (int)safe_link };
@@ -378,7 +378,7 @@ struct base_hook_traits
static const link_mode_type link_mode = LinkMode;
- static pointer to_value_ptr(const node_ptr & n)
+ static pointer to_value_ptr(const node_ptr & n)
{
return pointer_traits<pointer>::pointer_to
(static_cast<reference>(static_cast<node_holder_reference>(*n)));
@@ -504,7 +504,7 @@ inline std::size_t floor_log2 (std::size_t x)
std::size_t n = x;
std::size_t log2 = 0;
-
+
for(std::size_t shift = Bits >> 1; shift; shift >>= 1){
std::size_t tmp = n >> shift;
if (tmp)
@@ -529,7 +529,7 @@ inline float fast_log2 (float val)
x += 127 << 23;
caster.x = x;
val = caster.val;
- val = ((-1.0f/3) * val + 2) * val - 2.0f/3;
+ val = ((-1.0f/3.f) * val + 2.f) * val - (2.0f/3.f);
return (val + log_2);
}
@@ -655,7 +655,7 @@ struct node_to_value
, detail::store_cont_ptr_on_it<Container>::value
>::type
{
- static const bool store_container_ptr =
+ static const bool store_container_ptr =
detail::store_cont_ptr_on_it<Container>::value;
typedef typename Container::real_value_traits real_value_traits;
@@ -871,8 +871,8 @@ class reverse_iterator
};
} //namespace detail
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/detail/workaround.hpp b/boost/intrusive/detail/workaround.hpp
index 5de529fb66..87cab4befc 100644
--- a/boost/intrusive/detail/workaround.hpp
+++ b/boost/intrusive/detail/workaround.hpp
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2009. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
diff --git a/boost/intrusive/hashtable.hpp b/boost/intrusive/hashtable.hpp
index bade5cb507..2435a083c3 100644
--- a/boost/intrusive/hashtable.hpp
+++ b/boost/intrusive/hashtable.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -57,7 +57,7 @@ struct hash_bool_flags
static const std::size_t incremental_pos = 32u;
};
-template
+template
< class ValueTraits
, class Hash
, class Equal
@@ -161,7 +161,7 @@ struct get_slist_impl_from_supposed_value_traits
template<class SupposedValueTraits>
struct unordered_bucket_impl
{
- typedef typename
+ typedef typename
get_slist_impl_from_supposed_value_traits
<SupposedValueTraits>::type slist_impl;
typedef detail::bucket_impl<slist_impl> implementation_defined;
@@ -490,7 +490,7 @@ struct group_functions
//itself, as group list does not link bucket
node_ptr prev_in_group(group_traits::get_next(elem));
bool first_in_group = node_traits::get_next(prev_in_group) != elem;
-
+
if(first_in_group){
node_ptr start_pos;
if(last_in_group){
@@ -810,7 +810,7 @@ class hashtable_impl
node_cast_adaptor(const ConvertibleToF &c2f, const hashtable_impl *cont)
: base_t(base_t(c2f, cont))
{}
-
+
typename base_t::node_ptr operator()(const typename slist_impl::node &to_clone)
{ return base_t::operator()(static_cast<const node &>(to_clone)); }
@@ -824,7 +824,7 @@ class hashtable_impl
//noncopyable, movable
BOOST_MOVABLE_BUT_NOT_COPYABLE(hashtable_impl)
- enum { safemode_or_autounlink =
+ enum { safemode_or_autounlink =
(int)real_value_traits::link_mode == (int)auto_unlink ||
(int)real_value_traits::link_mode == (int)safe_link };
@@ -879,19 +879,19 @@ class hashtable_impl
//!
//! <b>Effects</b>: Constructs an empty unordered_set, storing a reference
//! to the bucket array and copies of the key_hasher and equal_func functors.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
- //! or the copy constructor or invocation of hash_func or equal_func throws.
+ //! or the copy constructor or invocation of hash_func or equal_func throws.
//!
//! <b>Notes</b>: buckets array must be disposed only after
//! *this is disposed.
hashtable_impl ( const bucket_traits &b_traits
, const hasher & hash_func = hasher()
, const key_equal &equal_func = key_equal()
- , const value_traits &v_traits = value_traits())
+ , const value_traits &v_traits = value_traits())
: data_(b_traits, hash_func, equal_func, v_traits)
{
priv_initialize_buckets();
@@ -905,7 +905,7 @@ class hashtable_impl
}
//! <b>Effects</b>: to-do
- //!
+ //!
hashtable_impl(BOOST_RV_REF(hashtable_impl) x)
: data_( ::boost::move(x.priv_bucket_traits())
, ::boost::move(x.priv_hasher())
@@ -927,25 +927,25 @@ class hashtable_impl
}
//! <b>Effects</b>: to-do
- //!
- hashtable_impl& operator=(BOOST_RV_REF(hashtable_impl) x)
+ //!
+ hashtable_impl& operator=(BOOST_RV_REF(hashtable_impl) x)
{ this->swap(x); return *this; }
- //! <b>Effects</b>: Detaches all elements from this. The objects in the unordered_set
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the unordered_set
//! are not deleted (i.e. no destructors are called).
- //!
- //! <b>Complexity</b>: Linear to the number of elements in the unordered_set, if
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements in the unordered_set, if
//! it's a safe-mode or auto-unlink value. Otherwise constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- ~hashtable_impl()
+ ~hashtable_impl()
{}
//! <b>Effects</b>: Returns an iterator pointing to the beginning of the unordered_set.
- //!
+ //!
//! <b>Complexity</b>: Amortized constant time.
//! Worst case (empty unordered_set): O(this->bucket_count())
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator begin()
{ return iterator(this->priv_begin(), this); }
@@ -955,7 +955,7 @@ class hashtable_impl
//!
//! <b>Complexity</b>: Amortized constant time.
//! Worst case (empty unordered_set): O(this->bucket_count())
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator begin() const
{ return this->cbegin(); }
@@ -965,57 +965,57 @@ class hashtable_impl
//!
//! <b>Complexity</b>: Amortized constant time.
//! Worst case (empty unordered_set): O(this->bucket_count())
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cbegin() const
{ return const_iterator(this->priv_begin(), this); }
//! <b>Effects</b>: Returns an iterator pointing to the end of the unordered_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator end()
{ return iterator(priv_invalid_local_it(), 0); }
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the unordered_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator end() const
{ return this->cend(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the unordered_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cend() const
{ return const_iterator(priv_invalid_local_it(), 0); }
//! <b>Effects</b>: Returns the hasher object used by the unordered_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If hasher copy-constructor throws.
hasher hash_function() const
{ return this->priv_hasher(); }
//! <b>Effects</b>: Returns the key_equal object used by the unordered_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If key_equal copy-constructor throws.
key_equal key_eq() const
{ return this->priv_equal(); }
//! <b>Effects</b>: Returns true if the container is empty.
- //!
+ //!
//! <b>Complexity</b>: if constant-time size and cache_begin options are disabled,
//! average constant time (worst case, with empty() == true: O(this->bucket_count()).
//! Otherwise constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
bool empty() const
{
@@ -1038,10 +1038,10 @@ class hashtable_impl
}
//! <b>Effects</b>: Returns the number of elements stored in the unordered_set.
- //!
+ //!
//! <b>Complexity</b>: Linear to elements contained in *this if
//! constant_time_size is false. Constant-time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
size_type size() const
{
@@ -1060,10 +1060,10 @@ class hashtable_impl
//! <b>Requires</b>: the hasher and the equality function unqualified swap
//! call should not throw.
- //!
+ //!
//! <b>Effects</b>: Swaps the contents of two unordered_sets.
//! Swaps also the contained bucket array and equality and hasher functors.
- //!
+ //!
//! <b>Complexity</b>: Constant.
//!
//! <b>Throws</b>: If the swap() call for the comparison or hash functors
@@ -1095,7 +1095,7 @@ class hashtable_impl
//! hash than the original node.
//!
//! <b>Effects</b>: Erases all the elements from *this
- //! calling Disposer::operator()(pointer), clones all the
+ //! calling Disposer::operator()(pointer), clones all the
//! elements from src calling Cloner::operator()(const_reference )
//! and inserts them on *this. The hash function and the equality
//! predicate are copied from the source.
@@ -1106,7 +1106,7 @@ class hashtable_impl
//! calling Disposer::operator()(pointer).
//!
//! <b>Complexity</b>: Linear to erased plus inserted elements.
- //!
+ //!
//! <b>Throws</b>: If cloner or hasher throw or hash or equality predicate copying
//! throws. Basic guarantee.
template <class Cloner, class Disposer>
@@ -1131,7 +1131,7 @@ class hashtable_impl
typedef node_cast_adaptor<detail::node_disposer<Disposer, hashtable_impl> > NodeDisposer;
typedef node_cast_adaptor<detail::node_cloner<Cloner, hashtable_impl> > NodeCloner;
NodeDisposer node_disp(disposer, this);
-
+
detail::exception_array_disposer<bucket_type, NodeDisposer, size_type>
rollback(dst_buckets[0], node_disp, constructed);
for( constructed = 0
@@ -1191,15 +1191,15 @@ class hashtable_impl
}
//! <b>Requires</b>: value must be an lvalue
- //!
+ //!
//! <b>Effects</b>: Inserts the value into the unordered_set.
//!
//! <b>Returns</b>: An iterator to the inserted value.
- //!
+ //!
//! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
iterator insert_equal(reference value)
@@ -1212,16 +1212,16 @@ class hashtable_impl
return priv_insert_equal_find(value, bucket_num, hash_value, it);
}
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
//! of type value_type.
- //!
+ //!
//! <b>Effects</b>: Equivalent to this->insert_equal(t) for each element in [b, e).
- //!
+ //!
//! <b>Complexity</b>: Average case O(N), where N is std::distance(b, e).
//! Worst case O(N*this->size()).
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
template<class Iterator>
@@ -1232,7 +1232,7 @@ class hashtable_impl
}
//! <b>Requires</b>: value must be an lvalue
- //!
+ //!
//! <b>Effects</b>: Tries to inserts value into the unordered_set.
//!
//! <b>Returns</b>: If the value
@@ -1240,11 +1240,11 @@ class hashtable_impl
//! iterator to the new value and true. If there is an equivalent value
//! returns a pair containing an iterator to the already present value
//! and false.
- //!
+ //!
//! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
std::pair<iterator, bool> insert_unique(reference value)
@@ -1254,20 +1254,20 @@ class hashtable_impl
(value, this->priv_hasher(), this->priv_equal(), commit_data);
if(!ret.second)
return ret;
- return std::pair<iterator, bool>
+ return std::pair<iterator, bool>
(this->insert_unique_commit(value, commit_data), true);
}
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
//! of type value_type.
- //!
+ //!
//! <b>Effects</b>: Equivalent to this->insert_unique(t) for each element in [b, e).
- //!
+ //!
//! <b>Complexity</b>: Average case O(N), where N is std::distance(b, e).
//! Worst case O(N*this->size()).
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
template<class Iterator>
@@ -1277,14 +1277,14 @@ class hashtable_impl
this->insert_unique(*b);
}
- //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
//! the same hash values as the stored hasher. The difference is that
//! "hash_func" hashes the given key instead of the value_type.
//!
- //! "equal_func" must be a equality function that induces
+ //! "equal_func" must be a equality function that induces
//! the same equality as key_equal. The difference is that
//! "equal_func" compares an arbitrary key with the contained values.
- //!
+ //!
//! <b>Effects</b>: Checks if a value can be inserted in the unordered_set, using
//! a user provided key instead of the value itself.
//!
@@ -1293,11 +1293,11 @@ class hashtable_impl
//! and false. If the value can be inserted returns true in the returned
//! pair boolean and fills "commit_data" that is meant to be used with
//! the "insert_commit" function.
- //!
+ //!
//! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
//!
//! <b>Throws</b>: If hash_func or equal_func throw. Strong guarantee.
- //!
+ //!
//! <b>Notes</b>: This function is used to improve performance when constructing
//! a value_type is expensive: if there is an equivalent value
//! the constructed object must be discarded. Many times, the part of the
@@ -1334,16 +1334,16 @@ class hashtable_impl
//! must have been obtained from a previous call to "insert_check".
//! No objects should have been inserted or erased from the unordered_set between
//! the "insert_check" that filled "commit_data" and the call to "insert_commit".
- //!
+ //!
//! <b>Effects</b>: Inserts the value in the unordered_set using the information obtained
//! from the "commit_data" that a previous "insert_check" filled.
//!
//! <b>Returns</b>: An iterator to the newly inserted object.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function has only sense if a "insert_check" has been
//! previously executed to fill "commit_data". No value should be inserted or
//! erased between the "insert_check" and "insert_commit" calls.
@@ -1363,62 +1363,62 @@ class hashtable_impl
return iterator(b.insert_after(b.before_begin(), *n), this);
}
- //! <b>Effects</b>: Erases the element pointed to by i.
- //!
+ //! <b>Effects</b>: Erases the element pointed to by i.
+ //!
//! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased element. No destructors are called.
void erase(const_iterator i)
{ this->erase_and_dispose(i, detail::null_disposer()); }
- //! <b>Effects</b>: Erases the range pointed to by b end e.
- //!
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //!
//! <b>Complexity</b>: Average case O(std::distance(b, e)),
//! worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
void erase(const_iterator b, const_iterator e)
{ this->erase_and_dispose(b, e, detail::null_disposer()); }
//! <b>Effects</b>: Erases all the elements with the given value.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: Average case O(this->count(value)).
//! Worst case O(this->size()).
- //!
- //! <b>Throws</b>: If the internal hasher or the equality functor throws.
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws.
//! Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
size_type erase(const_reference value)
{ return this->erase(value, this->priv_hasher(), this->priv_equal()); }
- //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
//! the same hash values as the stored hasher. The difference is that
//! "hash_func" hashes the given key instead of the value_type.
//!
- //! "equal_func" must be a equality function that induces
+ //! "equal_func" must be a equality function that induces
//! the same equality as key_equal. The difference is that
//! "equal_func" compares an arbitrary key with the contained values.
//!
//! <b>Effects</b>: Erases all the elements that have the same hash and
//! compare equal with the given key.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: Average case O(this->count(value)).
//! Worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If hash_func or equal_func throw. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class KeyType, class KeyHasher, class KeyValueEqual>
@@ -1427,14 +1427,14 @@ class hashtable_impl
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//!
- //! <b>Effects</b>: Erases the element pointed to by i.
+ //! <b>Effects</b>: Erases the element pointed to by i.
//! Disposer::operator()(pointer) is called for the removed element.
- //!
+ //!
//! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
- //! <b>Note</b>: Invalidates the iterators
+ //!
+ //! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
void erase_and_dispose(const_iterator i, Disposer disposer
@@ -1452,12 +1452,12 @@ class hashtable_impl
//!
//! <b>Effects</b>: Erases the range pointed to by b end e.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Complexity</b>: Average case O(std::distance(b, e)),
//! worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
@@ -1492,15 +1492,15 @@ class hashtable_impl
//!
//! <b>Effects</b>: Erases all the elements with the given value.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: Average case O(this->count(value)).
//! Worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws.
//! Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class Disposer>
@@ -1514,12 +1514,12 @@ class hashtable_impl
//! Disposer::operator()(pointer) is called for the removed elements.
//!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: Average case O(this->count(value)).
//! Worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If hash_func or equal_func throw. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class KeyType, class KeyHasher, class KeyValueEqual, class Disposer>
@@ -1565,13 +1565,13 @@ class hashtable_impl
return count;
}
- //! <b>Effects</b>: Erases all of the elements.
- //!
+ //! <b>Effects</b>: Erases all of the elements.
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
void clear()
@@ -1581,14 +1581,14 @@ class hashtable_impl
}
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
- //!
- //! <b>Effects</b>: Erases all of the elements.
- //!
+ //!
+ //! <b>Effects</b>: Erases all of the elements.
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class Disposer>
@@ -1606,25 +1606,25 @@ class hashtable_impl
}
//! <b>Effects</b>: Returns the number of contained elements with the given value
- //!
+ //!
//! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws.
size_type count(const_reference value) const
{ return this->count(value, this->priv_hasher(), this->priv_equal()); }
- //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
//! the same hash values as the stored hasher. The difference is that
//! "hash_func" hashes the given key instead of the value_type.
//!
- //! "equal_func" must be a equality function that induces
+ //! "equal_func" must be a equality function that induces
//! the same equality as key_equal. The difference is that
//! "equal_func" compares an arbitrary key with the contained values.
//!
//! <b>Effects</b>: Returns the number of contained elements with the given key
//!
//! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If hash_func or equal throw.
template<class KeyType, class KeyHasher, class KeyValueEqual>
size_type count(const KeyType &key, const KeyHasher &hash_func, const KeyValueEqual &equal_func) const
@@ -1638,25 +1638,25 @@ class hashtable_impl
//! "value" or end() if that element does not exist.
//!
//! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws.
iterator find(const_reference value)
{ return this->find(value, this->priv_hasher(), this->priv_equal()); }
- //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
//! the same hash values as the stored hasher. The difference is that
//! "hash_func" hashes the given key instead of the value_type.
//!
- //! "equal_func" must be a equality function that induces
+ //! "equal_func" must be a equality function that induces
//! the same equality as key_equal. The difference is that
//! "equal_func" compares an arbitrary key with the contained values.
//!
- //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
//! "key" according to the given hash and equality functor or end() if
//! that element does not exist.
//!
//! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If hash_func or equal_func throw.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -1672,29 +1672,29 @@ class hashtable_impl
return iterator(local_it, this);
}
- //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
//! "key" or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws.
const_iterator find(const_reference value) const
{ return this->find(value, this->priv_hasher(), this->priv_equal()); }
- //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
//! the same hash values as the stored hasher. The difference is that
//! "hash_func" hashes the given key instead of the value_type.
//!
- //! "equal_func" must be a equality function that induces
+ //! "equal_func" must be a equality function that induces
//! the same equality as key_equal. The difference is that
//! "equal_func" compares an arbitrary key with the contained values.
//!
- //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
//! "key" according to the given hasher and equality functor or end() if
//! that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If hash_func or equal_func throw.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -1712,30 +1712,30 @@ class hashtable_impl
}
//! <b>Effects</b>: Returns a range containing all elements with values equivalent
- //! to value. Returns std::make_pair(this->end(), this->end()) if no such
+ //! to value. Returns std::make_pair(this->end(), this->end()) if no such
//! elements exist.
- //!
+ //!
//! <b>Complexity</b>: Average case O(this->count(value)). Worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws.
std::pair<iterator,iterator> equal_range(const_reference value)
{ return this->equal_range(value, this->priv_hasher(), this->priv_equal()); }
- //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
//! the same hash values as the stored hasher. The difference is that
//! "hash_func" hashes the given key instead of the value_type.
//!
- //! "equal_func" must be a equality function that induces
+ //! "equal_func" must be a equality function that induces
//! the same equality as key_equal. The difference is that
//! "equal_func" compares an arbitrary key with the contained values.
//!
//! <b>Effects</b>: Returns a range containing all elements with equivalent
- //! keys. Returns std::make_pair(this->end(), this->end()) if no such
+ //! keys. Returns std::make_pair(this->end(), this->end()) if no such
//! elements exist.
- //!
+ //!
//! <b>Complexity</b>: Average case O(this->count(key, hash_func, equal_func)).
//! Worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If hash_func or the equal_func throw.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -1753,31 +1753,31 @@ class hashtable_impl
}
//! <b>Effects</b>: Returns a range containing all elements with values equivalent
- //! to value. Returns std::make_pair(this->end(), this->end()) if no such
+ //! to value. Returns std::make_pair(this->end(), this->end()) if no such
//! elements exist.
- //!
+ //!
//! <b>Complexity</b>: Average case O(this->count(value)). Worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws.
std::pair<const_iterator, const_iterator>
equal_range(const_reference value) const
{ return this->equal_range(value, this->priv_hasher(), this->priv_equal()); }
- //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
//! the same hash values as the stored hasher. The difference is that
//! "hash_func" hashes the given key instead of the value_type.
//!
- //! "equal_func" must be a equality function that induces
+ //! "equal_func" must be a equality function that induces
//! the same equality as key_equal. The difference is that
//! "equal_func" compares an arbitrary key with the contained values.
//!
//! <b>Effects</b>: Returns a range containing all elements with equivalent
- //! keys. Returns std::make_pair(this->end(), this->end()) if no such
+ //! keys. Returns std::make_pair(this->end(), this->end()) if no such
//! elements exist.
- //!
+ //!
//! <b>Complexity</b>: Average case O(this->count(key, hash_func, equal_func)).
//! Worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If the hasher or equal_func throw.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -1796,12 +1796,12 @@ class hashtable_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator belonging to the unordered_set
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If the internal hash function throws.
iterator iterator_to(reference value)
{
@@ -1810,12 +1810,12 @@ class hashtable_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator belonging to the
//! unordered_set that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If the internal hash function throws.
const_iterator iterator_to(const_reference value) const
{
@@ -1825,78 +1825,78 @@ class hashtable_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid local_iterator belonging to the unordered_set
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
static local_iterator s_local_iterator_to(reference value)
{
BOOST_STATIC_ASSERT((!stateful_value_traits));
siterator sit = bucket_type::s_iterator_to(((hashtable_impl*)0)->priv_value_to_node(value));
- return local_iterator(sit, (hashtable_impl*)0);
+ return local_iterator(sit, (hashtable_impl*)0);
}
//! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_local_iterator belonging to
//! the unordered_set that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
static const_local_iterator s_local_iterator_to(const_reference value)
{
BOOST_STATIC_ASSERT((!stateful_value_traits));
siterator sit = bucket_type::s_iterator_to(((hashtable_impl*)0)->priv_value_to_node(const_cast<value_type&>(value)));
- return const_local_iterator(sit, (hashtable_impl*)0);
+ return const_local_iterator(sit, (hashtable_impl*)0);
}
//! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid local_iterator belonging to the unordered_set
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
local_iterator local_iterator_to(reference value)
{
siterator sit = bucket_type::s_iterator_to(this->priv_value_to_node(value));
- return local_iterator(sit, this);
+ return local_iterator(sit, this);
}
//! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_local_iterator belonging to
//! the unordered_set that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_local_iterator local_iterator_to(const_reference value) const
{
siterator sit = bucket_type::s_iterator_to
(const_cast<node &>(this->priv_value_to_node(value)));
- return const_local_iterator(sit, this);
+ return const_local_iterator(sit, this);
}
//! <b>Effects</b>: Returns the number of buckets passed in the constructor
//! or the last rehash function.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
size_type bucket_count() const
{ return this->priv_buckets_len(); }
@@ -1904,33 +1904,33 @@ class hashtable_impl
//! <b>Requires</b>: n is in the range [0, this->bucket_count()).
//!
//! <b>Effects</b>: Returns the number of elements in the nth bucket.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
size_type bucket_size(size_type n) const
{ return this->priv_buckets()[n].size(); }
//! <b>Effects</b>: Returns the index of the bucket in which elements
//! with keys equivalent to k would be found, if any such element existed.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If the hash functor throws.
//!
//! <b>Note</b>: the return value is in the range [0, this->bucket_count()).
size_type bucket(const key_type& k) const
{ return this->bucket(k, this->priv_hasher()); }
- //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
//! the same hash values as the stored hasher. The difference is that
//! "hash_func" hashes the given key instead of the value_type.
//!
//! <b>Effects</b>: Returns the index of the bucket in which elements
//! with keys equivalent to k would be found, if any such element existed.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If hash_func throws.
//!
//! <b>Note</b>: the return value is in the range [0, this->bucket_count()).
@@ -1940,9 +1940,9 @@ class hashtable_impl
//! <b>Effects</b>: Returns the bucket array pointer passed in the constructor
//! or the last rehash function.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
bucket_ptr bucket_pointer() const
{ return this->priv_buckets(); }
@@ -1951,13 +1951,13 @@ class hashtable_impl
//!
//! <b>Effects</b>: Returns a local_iterator pointing to the beginning
//! of the sequence stored in the bucket n.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
- //! containing all of the elements in the nth bucket.
+ //! containing all of the elements in the nth bucket.
local_iterator begin(size_type n)
{ return local_iterator(this->priv_buckets()[n].begin(), this); }
@@ -1965,13 +1965,13 @@ class hashtable_impl
//!
//! <b>Effects</b>: Returns a const_local_iterator pointing to the beginning
//! of the sequence stored in the bucket n.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
- //! containing all of the elements in the nth bucket.
+ //! containing all of the elements in the nth bucket.
const_local_iterator begin(size_type n) const
{ return this->cbegin(n); }
@@ -1979,13 +1979,13 @@ class hashtable_impl
//!
//! <b>Effects</b>: Returns a const_local_iterator pointing to the beginning
//! of the sequence stored in the bucket n.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
- //! containing all of the elements in the nth bucket.
+ //! containing all of the elements in the nth bucket.
const_local_iterator cbegin(size_type n) const
{
siterator sit = const_cast<bucket_type&>(this->priv_buckets()[n]).begin();
@@ -1996,13 +1996,13 @@ class hashtable_impl
//!
//! <b>Effects</b>: Returns a local_iterator pointing to the end
//! of the sequence stored in the bucket n.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
- //! containing all of the elements in the nth bucket.
+ //! containing all of the elements in the nth bucket.
local_iterator end(size_type n)
{ return local_iterator(this->priv_buckets()[n].end(), this); }
@@ -2010,11 +2010,11 @@ class hashtable_impl
//!
//! <b>Effects</b>: Returns a const_local_iterator pointing to the end
//! of the sequence stored in the bucket n.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
//! containing all of the elements in the nth bucket.
const_local_iterator end(size_type n) const
@@ -2024,13 +2024,13 @@ class hashtable_impl
//!
//! <b>Effects</b>: Returns a const_local_iterator pointing to the end
//! of the sequence stored in the bucket n.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
- //! containing all of the elements in the nth bucket.
+ //! containing all of the elements in the nth bucket.
const_local_iterator cend(size_type n) const
{ return const_local_iterator(const_cast<bucket_type&>(this->priv_buckets()[n]).end(), this); }
@@ -2044,12 +2044,12 @@ class hashtable_impl
//! the values from the old bucket and inserts then in the new one.
//! Bucket traits hold by *this is assigned from new_bucket_traits.
//! If the container is configured as incremental<>, the split bucket is set
- //! to the new bucket_len().
+ //! to the new bucket_len().
//!
//! If store_hash option is true, this method does not use the hash function.
- //!
+ //!
//! <b>Complexity</b>: Average case linear in this->size(), worst case quadratic.
- //!
+ //!
//! <b>Throws</b>: If the hasher functor throws. Basic guarantee.
void rehash(const bucket_traits &new_bucket_traits)
{
@@ -2058,7 +2058,7 @@ class hashtable_impl
bucket_ptr old_buckets = this->priv_buckets();
size_type old_buckets_len = this->priv_buckets_len();
- //Check power of two bucket array if the option is activated
+ //Check power of two bucket array if the option is activated
BOOST_INTRUSIVE_INVARIANT_ASSERT
(!power_2_buckets || (0 == (new_buckets_len & (new_buckets_len-1u))));
@@ -2066,7 +2066,7 @@ class hashtable_impl
const bool same_buffer = old_buckets == new_buckets;
//If the new bucket length is a common factor
//of the old one we can avoid hash calculations.
- const bool fast_shrink = (!incremental) && (old_buckets_len > new_buckets_len) &&
+ const bool fast_shrink = (!incremental) && (old_buckets_len > new_buckets_len) &&
(power_2_buckets ||(old_buckets_len % new_buckets_len) == 0);
//If we are shrinking the same bucket array and it's
//is a fast shrink, just rehash the last nodes
@@ -2147,11 +2147,11 @@ class hashtable_impl
//! <b>Requires</b>:
//!
- //! <b>Effects</b>:
- //!
- //! <b>Complexity</b>:
- //!
- //! <b>Throws</b>:
+ //! <b>Effects</b>:
+ //!
+ //! <b>Complexity</b>:
+ //!
+ //! <b>Throws</b>:
//!
//! <b>Note</b>: this method is only available if incremental<true> option is activated.
bool incremental_rehash(bool grow = true)
@@ -2214,15 +2214,15 @@ class hashtable_impl
}
//! <b>Effects</b>: If new_bucket_traits.bucket_count() is not
- //! this->bucket_count()/2 or this->bucket_count()*2, or
+ //! this->bucket_count()/2 or this->bucket_count()*2, or
//! this->split_bucket() != new_bucket_traits.bucket_count() returns false
//! and does nothing.
//!
//! Otherwise, copy assigns new_bucket_traits to the internal bucket_traits
//! and transfers all the objects from old buckets to the new ones.
- //!
+ //!
//! <b>Complexity</b>: Linear to size().
- //!
+ //!
//! <b>Throws</b>: Nothing
//!
//! <b>Note</b>: this method is only available if incremental<true> option is activated.
@@ -2267,11 +2267,11 @@ class hashtable_impl
//! <b>Requires</b>:
//!
- //! <b>Effects</b>:
- //!
- //! <b>Complexity</b>:
- //!
- //! <b>Throws</b>:
+ //! <b>Effects</b>:
+ //!
+ //! <b>Complexity</b>:
+ //!
+ //! <b>Throws</b>:
size_type split_count() const
{
//This function is only available if incremental hashing is activated
@@ -2282,11 +2282,11 @@ class hashtable_impl
//! <b>Effects</b>: Returns the nearest new bucket count optimized for
//! the container that is bigger or equal than n. This suggestion can be
//! used to create bucket arrays with a size that will usually improve
- //! container's performance. If such value does not exist, the
+ //! container's performance. If such value does not exist, the
//! higher possible value is returned.
- //!
+ //!
//! <b>Complexity</b>: Amortized constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static size_type suggested_upper_bucket_count(size_type n)
{
@@ -2301,11 +2301,11 @@ class hashtable_impl
//! <b>Effects</b>: Returns the nearest new bucket count optimized for
//! the container that is smaller or equal than n. This suggestion can be
//! used to create bucket arrays with a size that will usually improve
- //! container's performance. If such value does not exist, the
+ //! container's performance. If such value does not exist, the
//! lowest possible value is returned.
- //!
+ //!
//! <b>Complexity</b>: Amortized constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static size_type suggested_lower_bucket_count(size_type n)
{
@@ -2613,7 +2613,7 @@ class hashtable_impl
bool last_in_group = (first_end_ptr <= nxt && nxt <= last_end_ptr) ||
(group_traits::get_next(nxt) != elem);
bool first_in_group = node_traits::get_next(prev_in_group) != elem;
-
+
if(first_in_group){
node_ptr start_pos;
if(last_in_group){
@@ -2684,7 +2684,7 @@ class hashtable_impl
slist_node_ptr elem(i.slist_it().pointed_node());
slist_node_ptr f_bucket_end, l_bucket_end;
if(store_hash){
- f_bucket_end = l_bucket_end =
+ f_bucket_end = l_bucket_end =
(this->priv_buckets()
[this->priv_hash_to_bucket
(this->priv_stored_hash(elem, store_hash_t()))
@@ -2720,7 +2720,7 @@ class hashtable_impl
const real_bucket_traits &rbt = this->priv_real_bucket_traits();
return rbt.bucket_begin() + rbt.bucket_count();
}
-
+
siterator priv_invalid_local_it() const
{ return priv_invalid_bucket()->end(); }
@@ -2887,7 +2887,7 @@ class hashtable_impl
if(constant_time_size && this->empty()){
return priv_invalid_local_it();
}
-
+
siterator it = previt;
++it;
@@ -3008,7 +3008,7 @@ class hashtable_impl
++count;
}
}
-
+
//If we reached the end, find the first, non-empty bucket
for(bucket_number_second = bucket_number_first+1
; bucket_number_second != this->priv_buckets_len()
@@ -3043,7 +3043,7 @@ template <class T, bool UniqueKeys, class ...Options>
struct make_hashtable_opt
{
typedef typename pack_options
- < uset_defaults<T>,
+ < uset_defaults<T>,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4, O5, O6, O7, O8, O9, O10
#else
@@ -3061,7 +3061,7 @@ struct make_hashtable_opt
, detail::eval_value_traits<value_traits>
, detail::identity<value_traits>
>::type real_value_traits;
- typedef typename packed_options::bucket_traits specified_bucket_traits;
+ typedef typename packed_options::bucket_traits specified_bucket_traits;
//Real bucket traits must be calculated from options and calculated value_traits
typedef typename detail::get_slist_impl
@@ -3111,7 +3111,7 @@ struct make_hashtable
/// @cond
typedef hashtable_impl
< typename make_hashtable_opt
- <T, false,
+ <T, false,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4, O5, O6, O7, O8, O9, O10
#else
@@ -3132,7 +3132,7 @@ template<class T, class ...Options>
template<class T, class O1, class O2, class O3, class O4, class O5, class O6, class O7, class O8, class O9, class O10>
#endif
class hashtable
- : public make_hashtable<T,
+ : public make_hashtable<T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4, O5, O6, O7, O8, O9, O10
#else
@@ -3140,7 +3140,7 @@ class hashtable
#endif
>::type
{
- typedef typename make_hashtable<T,
+ typedef typename make_hashtable<T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4, O5, O6, O7, O8, O9, O10
#else
@@ -3180,8 +3180,8 @@ class hashtable
#endif
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/intrusive_fwd.hpp b/boost/intrusive/intrusive_fwd.hpp
index dc185667e0..c95767ef35 100644
--- a/boost/intrusive/intrusive_fwd.hpp
+++ b/boost/intrusive/intrusive_fwd.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2007-2009
+// (C) Copyright Ion Gaztanaga 2007-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
diff --git a/boost/intrusive/linear_slist_algorithms.hpp b/boost/intrusive/linear_slist_algorithms.hpp
index f33565528e..db4092d2c9 100644
--- a/boost/intrusive/linear_slist_algorithms.hpp
+++ b/boost/intrusive/linear_slist_algorithms.hpp
@@ -1,7 +1,7 @@
/////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -41,7 +41,7 @@ namespace intrusive {
//! <b>Static functions</b>:
//!
//! <tt>static node_ptr get_next(const_node_ptr n);</tt>
-//!
+//!
//! <tt>static void set_next(node_ptr n, node_ptr next);</tt>
template<class NodeTraits>
class linear_slist_algorithms
@@ -63,37 +63,37 @@ class linear_slist_algorithms
//! <b>Effects</b>: Constructs an non-used list element, putting the next
//! pointer to null:
//! <tt>NodeTraits::get_next(this_node) == node_ptr()</tt>
- //!
- //! <b>Complexity</b>: Constant
- //!
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
//! <b>Throws</b>: Nothing.
static void init(const node_ptr & this_node);
//! <b>Requires</b>: this_node must be in a circular list or be an empty circular list.
- //!
+ //!
//! <b>Effects</b>: Returns true is "this_node" is the only node of a circular list:
//! or it's a not inserted node:
//! <tt>return node_ptr() == NodeTraits::get_next(this_node) || NodeTraits::get_next(this_node) == this_node</tt>
- //!
- //! <b>Complexity</b>: Constant
- //!
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
//! <b>Throws</b>: Nothing.
static bool unique(const_node_ptr this_node);
//! <b>Effects</b>: Returns true is "this_node" has the same state as if
//! it was inited using "init(node_ptr)"
- //!
- //! <b>Complexity</b>: Constant
- //!
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
//! <b>Throws</b>: Nothing.
static bool inited(const_node_ptr this_node);
//! <b>Requires</b>: prev_node must be in a circular list or be an empty circular list.
- //!
+ //!
//! <b>Effects</b>: Unlinks the next node of prev_node from the circular list.
- //!
- //! <b>Complexity</b>: Constant
- //!
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
//! <b>Throws</b>: Nothing.
static void unlink_after(const node_ptr & prev_node);
@@ -102,28 +102,28 @@ class linear_slist_algorithms
//!
//! <b>Effects</b>: Unlinks the range (prev_node, last_node) from the linear list.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Constant
//!
//! <b>Throws</b>: Nothing.
static void unlink_after(const node_ptr & prev_node, const node_ptr & last_node);
//! <b>Requires</b>: prev_node must be a node of a linear list.
- //!
+ //!
//! <b>Effects</b>: Links this_node after prev_node in the linear list.
- //!
- //! <b>Complexity</b>: Constant
- //!
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
//! <b>Throws</b>: Nothing.
static void link_after(const node_ptr & prev_node, const node_ptr & this_node);
//! <b>Requires</b>: b and e must be nodes of the same linear list or an empty range.
//! and p must be a node of a different linear list.
- //!
+ //!
//! <b>Effects</b>: Removes the nodes from (b, e] range from their linear list and inserts
//! them after p in p's linear list.
- //!
- //! <b>Complexity</b>: Constant
- //!
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
//! <b>Throws</b>: Nothing.
static void transfer_after(const node_ptr & p, const node_ptr & b, const node_ptr & e);
@@ -132,34 +132,34 @@ class linear_slist_algorithms
//! <b>Effects</b>: Constructs an empty list, making this_node the only
//! node of the circular list:
//! <tt>NodeTraits::get_next(this_node) == this_node</tt>.
- //!
- //! <b>Complexity</b>: Constant
- //!
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
//! <b>Throws</b>: Nothing.
static void init_header(const node_ptr & this_node)
{ NodeTraits::set_next(this_node, node_ptr ()); }
//! <b>Requires</b>: this_node and prev_init_node must be in the same linear list.
- //!
+ //!
//! <b>Effects</b>: Returns the previous node of this_node in the linear list starting.
//! the search from prev_init_node. The first node checked for equality
//! is NodeTraits::get_next(prev_init_node).
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements between prev_init_node and this_node.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static node_ptr get_previous_node(const node_ptr & prev_init_node, const node_ptr & this_node)
{ return base_t::get_previous_node(prev_init_node, this_node); }
//! <b>Requires</b>: this_node must be in a linear list or be an empty linear list.
- //!
+ //!
//! <b>Effects</b>: Returns the number of nodes in a linear list. If the linear list
//! is empty, returns 1.
- //!
- //! <b>Complexity</b>: Linear
- //!
+ //!
+ //! <b>Complexity</b>: Linear
+ //!
//! <b>Throws</b>: Nothing.
- static std::size_t count(const const_node_ptr & this_node)
+ static std::size_t count(const const_node_ptr & this_node)
{
std::size_t result = 0;
const_node_ptr p = this_node;
@@ -172,12 +172,12 @@ class linear_slist_algorithms
//! <b>Requires</b>: this_node and other_node must be nodes inserted
//! in linear lists or be empty linear lists.
- //!
+ //!
//! <b>Effects</b>: Moves all the nodes previously chained after this_node after other_node
//! and vice-versa.
- //!
- //! <b>Complexity</b>: Constant
- //!
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
//! <b>Throws</b>: Nothing.
static void swap_trailing_nodes(const node_ptr & this_node, const node_ptr & other_node)
{
@@ -187,17 +187,17 @@ class linear_slist_algorithms
NodeTraits::set_next(other_node, this_nxt);
}
- //! <b>Effects</b>: Reverses the order of elements in the list.
- //!
- //! <b>Returns</b>: The new first node of the list.
- //!
+ //! <b>Effects</b>: Reverses the order of elements in the list.
+ //!
+ //! <b>Returns</b>: The new first node of the list.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: This function is linear to the contained elements.
static node_ptr reverse(const node_ptr & p)
{
if(!p) return node_ptr();
- node_ptr i = NodeTraits::get_next(p);
+ node_ptr i = NodeTraits::get_next(p);
node_ptr first(p);
while(i){
node_ptr nxti(NodeTraits::get_next(i));
@@ -213,9 +213,9 @@ class linear_slist_algorithms
//!
//! <b>Returns</b>: A pair containing the new first and last node of the list or
//! if there has been any movement, a null pair if n leads to no movement.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements plus the number moved positions.
static std::pair<node_ptr, node_ptr> move_first_n_backwards(const node_ptr & p, std::size_t n)
{
@@ -255,7 +255,7 @@ class linear_slist_algorithms
if(!end_found){
old_last = base_t::get_previous_node(first, node_ptr());
}
-
+
//Now link p after the new last node
NodeTraits::set_next(old_last, p);
NodeTraits::set_next(new_last, node_ptr());
@@ -268,9 +268,9 @@ class linear_slist_algorithms
//!
//! <b>Returns</b>: A pair containing the new first and last node of the list or
//! if there has been any movement, a null pair if n leads to no movement.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements plus the number moved positions.
static std::pair<node_ptr, node_ptr> move_first_n_forward(const node_ptr & p, std::size_t n)
{
@@ -300,7 +300,7 @@ class linear_slist_algorithms
//If the shift is a multiple of the size there is nothing to do
if(!new_before_last_pos)
return ret;
-
+
for( new_last = p
; --new_before_last_pos
; new_last = node_traits::get_next(new_last)){
@@ -319,8 +319,8 @@ class linear_slist_algorithms
}
};
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/link_mode.hpp b/boost/intrusive/link_mode.hpp
index 17012c93cb..c04f77526e 100644
--- a/boost/intrusive/link_mode.hpp
+++ b/boost/intrusive/link_mode.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -40,7 +40,7 @@ enum link_mode_type{
//!the container without using any function provided by the containers.
auto_unlink
};
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#endif //BOOST_INTRUSIVE_VALUE_LINK_TYPE_HPP
diff --git a/boost/intrusive/list.hpp b/boost/intrusive/list.hpp
index dbbf7c93f5..5450bc5d81 100644
--- a/boost/intrusive/list.hpp
+++ b/boost/intrusive/list.hpp
@@ -1,7 +1,7 @@
/////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -59,7 +59,7 @@ struct list_defaults
/// @endcond
-//! The class template list is an intrusive container that mimics most of the
+//! The class template list is an intrusive container that mimics most of the
//! interface of std::list as described in the C++ standard.
//!
//! The template parameter \c T is the type to be managed by the container.
@@ -118,12 +118,12 @@ class list_impl
//noncopyable
BOOST_MOVABLE_BUT_NOT_COPYABLE(list_impl)
- enum { safemode_or_autounlink =
+ enum { safemode_or_autounlink =
(int)real_value_traits::link_mode == (int)auto_unlink ||
(int)real_value_traits::link_mode == (int)safe_link };
//Constant-time size is incompatible with auto-unlink hooks!
- BOOST_STATIC_ASSERT(!(constant_time_size &&
+ BOOST_STATIC_ASSERT(!(constant_time_size &&
((int)real_value_traits::link_mode == (int)auto_unlink)
));
@@ -196,25 +196,25 @@ class list_impl
real_value_traits &get_real_value_traits()
{ return this->get_real_value_traits(detail::bool_<external_value_traits>()); }
- //! <b>Effects</b>: constructs an empty list.
- //!
- //! <b>Complexity</b>: Constant
- //!
+ //! <b>Effects</b>: constructs an empty list.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
//! <b>Throws</b>: If real_value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks).
list_impl(const value_traits &v_traits = value_traits())
: data_(v_traits)
- {
+ {
this->priv_size_traits().set_size(size_type(0));
- node_algorithms::init_header(this->get_root_node());
+ node_algorithms::init_header(this->get_root_node());
}
//! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
- //!
+ //!
//! <b>Effects</b>: Constructs a list equal to the range [first,last).
- //!
- //! <b>Complexity</b>: Linear in std::distance(b, e). No copy constructors are called.
- //!
+ //!
+ //! <b>Complexity</b>: Linear in std::distance(b, e). No copy constructors are called.
+ //!
//! <b>Throws</b>: If real_value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks).
template<class Iterator>
@@ -227,43 +227,43 @@ class list_impl
}
//! <b>Effects</b>: to-do
- //!
+ //!
list_impl(BOOST_RV_REF(list_impl) x)
: data_(::boost::move(x.priv_value_traits()))
{
this->priv_size_traits().set_size(size_type(0));
- node_algorithms::init_header(this->get_root_node());
+ node_algorithms::init_header(this->get_root_node());
this->swap(x);
}
//! <b>Effects</b>: to-do
- //!
- list_impl& operator=(BOOST_RV_REF(list_impl) x)
+ //!
+ list_impl& operator=(BOOST_RV_REF(list_impl) x)
{ this->swap(x); return *this; }
- //! <b>Effects</b>: If it's not a safe-mode or an auto-unlink value_type
+ //! <b>Effects</b>: If it's not a safe-mode or an auto-unlink value_type
//! the destructor does nothing
- //! (ie. no code is generated). Otherwise it detaches all elements from this.
- //! In this case the objects in the list are not deleted (i.e. no destructors
+ //! (ie. no code is generated). Otherwise it detaches all elements from this.
+ //! In this case the objects in the list are not deleted (i.e. no destructors
//! are called), but the hooks according to the ValueTraits template parameter
//! are set to their default value.
- //!
- //! <b>Complexity</b>: Linear to the number of elements in the list, if
- //! it's a safe-mode or auto-unlink value . Otherwise constant.
- ~list_impl()
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements in the list, if
+ //! it's a safe-mode or auto-unlink value . Otherwise constant.
+ ~list_impl()
{}
//! <b>Requires</b>: value must be an lvalue.
- //!
+ //!
//! <b>Effects</b>: Inserts the value in the back of the list.
//! No copy constructors are called.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
- void push_back(reference value)
+ void push_back(reference value)
{
node_ptr to_insert = get_real_value_traits().to_node_ptr(value);
if(safemode_or_autounlink)
@@ -273,31 +273,31 @@ class list_impl
}
//! <b>Requires</b>: value must be an lvalue.
- //!
+ //!
//! <b>Effects</b>: Inserts the value in the front of the list.
//! No copy constructors are called.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
- void push_front(reference value)
+ void push_front(reference value)
{
node_ptr to_insert = get_real_value_traits().to_node_ptr(value);
if(safemode_or_autounlink)
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::inited(to_insert));
- node_algorithms::link_before(node_traits::get_next(this->get_root_node()), to_insert);
+ node_algorithms::link_before(node_traits::get_next(this->get_root_node()), to_insert);
this->priv_size_traits().increment();
}
//! <b>Effects</b>: Erases the last element of the list.
//! No destructors are called.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references) to the erased element.
void pop_back()
{ return this->pop_back_and_dispose(detail::null_disposer()); }
@@ -307,11 +307,11 @@ class list_impl
//! <b>Effects</b>: Erases the last element of the list.
//! No destructors are called.
//! Disposer::operator()(pointer) is called for the removed element.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators to the erased element.
template<class Disposer>
void pop_back_and_dispose(Disposer disposer)
@@ -326,11 +326,11 @@ class list_impl
//! <b>Effects</b>: Erases the first element of the list.
//! No destructors are called.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references) to the erased element.
void pop_front()
{ return this->pop_front_and_dispose(detail::null_disposer()); }
@@ -340,15 +340,15 @@ class list_impl
//! <b>Effects</b>: Erases the first element of the list.
//! No destructors are called.
//! Disposer::operator()(pointer) is called for the removed element.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators to the erased element.
template<class Disposer>
void pop_front_and_dispose(Disposer disposer)
- {
+ {
node_ptr to_erase = node_traits::get_next(this->get_root_node());
node_algorithms::unlink(to_erase);
this->priv_size_traits().decrement();
@@ -358,197 +358,197 @@ class list_impl
}
//! <b>Effects</b>: Returns a reference to the first element of the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- reference front()
+ reference front()
{ return *get_real_value_traits().to_value_ptr(node_traits::get_next(this->get_root_node())); }
//! <b>Effects</b>: Returns a const_reference to the first element of the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reference front() const
+ const_reference front() const
{ return *get_real_value_traits().to_value_ptr(uncast(node_traits::get_next(this->get_root_node()))); }
//! <b>Effects</b>: Returns a reference to the last element of the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- reference back()
+ reference back()
{ return *get_real_value_traits().to_value_ptr(node_traits::get_previous(this->get_root_node())); }
//! <b>Effects</b>: Returns a const_reference to the last element of the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reference back() const
+ const_reference back() const
{ return *get_real_value_traits().to_value_ptr(uncast(node_traits::get_previous(this->get_root_node()))); }
//! <b>Effects</b>: Returns an iterator to the first element contained in the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- iterator begin()
+ iterator begin()
{ return iterator(node_traits::get_next(this->get_root_node()), this); }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator begin() const
+ const_iterator begin() const
{ return this->cbegin(); }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator cbegin() const
+ const_iterator cbegin() const
{ return const_iterator(node_traits::get_next(this->get_root_node()), this); }
//! <b>Effects</b>: Returns an iterator to the end of the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- iterator end()
+ iterator end()
{ return iterator(this->get_root_node(), this); }
//! <b>Effects</b>: Returns a const_iterator to the end of the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator end() const
+ const_iterator end() const
{ return this->cend(); }
//! <b>Effects</b>: Returns a constant iterator to the end of the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_iterator cend() const
{ return const_iterator(uncast(this->get_root_node()), this); }
- //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
- //! of the reversed list.
- //!
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
+ //! of the reversed list.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
reverse_iterator rbegin()
{ return reverse_iterator(this->end()); }
- //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
- //! of the reversed list.
- //!
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed list.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator rbegin() const
+ const_reverse_iterator rbegin() const
{ return this->crbegin(); }
- //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
- //! of the reversed list.
- //!
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed list.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator crbegin() const
+ const_reverse_iterator crbegin() const
{ return const_reverse_iterator(end()); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the end
- //! of the reversed list.
- //!
+ //! of the reversed list.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- reverse_iterator rend()
+ reverse_iterator rend()
{ return reverse_iterator(begin()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
- //! of the reversed list.
- //!
+ //! of the reversed list.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator rend() const
+ const_reverse_iterator rend() const
{ return this->crend(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
- //! of the reversed list.
- //!
+ //! of the reversed list.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_reverse_iterator crend() const
+ const_reverse_iterator crend() const
{ return const_reverse_iterator(this->begin()); }
//! <b>Precondition</b>: end_iterator must be a valid end iterator
//! of list.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the list associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static list_impl &container_from_end_iterator(iterator end_iterator)
{ return list_impl::priv_container_from_end_iterator(end_iterator); }
//! <b>Precondition</b>: end_iterator must be a valid end const_iterator
//! of list.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the list associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static const list_impl &container_from_end_iterator(const_iterator end_iterator)
{ return list_impl::priv_container_from_end_iterator(end_iterator); }
//! <b>Effects</b>: Returns the number of the elements contained in the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements contained in the list.
//! if constant-time size option is disabled. Constant time otherwise.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
size_type size() const
{
if(constant_time_size)
return this->priv_size_traits().get_size();
else
- return node_algorithms::count(this->get_root_node()) - 1;
+ return node_algorithms::count(this->get_root_node()) - 1;
}
//! <b>Effects</b>: Returns true if the list contains no elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
bool empty() const
{ return node_algorithms::unique(this->get_root_node()); }
//! <b>Effects</b>: Swaps the elements of x and *this.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
void swap(list_impl& other)
{
- node_algorithms::swap_nodes(this->get_root_node(), other.get_root_node());
+ node_algorithms::swap_nodes(this->get_root_node(), other.get_root_node());
if(constant_time_size){
size_type backup = this->priv_size_traits().get_size();
this->priv_size_traits().set_size(other.priv_size_traits().get_size());
@@ -559,11 +559,11 @@ class list_impl
//! <b>Effects</b>: Moves backwards all the elements, so that the first
//! element becomes the second, the second becomes the third...
//! the last element becomes the first one.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of shifts.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
void shift_backwards(size_type n = 1)
{ node_algorithms::move_forward(this->get_root_node(), n); }
@@ -571,11 +571,11 @@ class list_impl
//! <b>Effects</b>: Moves forward all the elements, so that the second
//! element becomes the first, the third becomes the second...
//! the first element becomes the last one.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of shifts.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
void shift_forward(size_type n = 1)
{ node_algorithms::move_backwards(this->get_root_node(), n); }
@@ -587,9 +587,9 @@ class list_impl
//! or end() if no such element exists.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references) to the
//! erased element.
iterator erase(const_iterator i)
@@ -602,13 +602,13 @@ class list_impl
//!
//! <b>Returns</b>: the first element remaining beyond the removed elements,
//! or end() if no such element exists.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of erased elements if it's a safe-mode
//! or auto-unlink value, or constant-time size is enabled. Constant-time otherwise.
- //!
- //! <b>Note</b>: Invalidates the iterators (but not the references) to the
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references) to the
//! erased elements.
iterator erase(const_iterator b, const_iterator e)
{
@@ -629,13 +629,13 @@ class list_impl
//!
//! <b>Returns</b>: the first element remaining beyond the removed elements,
//! or end() if no such element exists.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of erased elements if it's a safe-mode
//! or auto-unlink value is enabled. Constant-time otherwise.
- //!
- //! <b>Note</b>: Invalidates the iterators (but not the references) to the
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references) to the
//! erased elements.
iterator erase(const_iterator b, const_iterator e, difference_type n)
{
@@ -662,9 +662,9 @@ class list_impl
//! or end() if no such element exists.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators to the erased element.
template <class Disposer>
iterator erase_and_dispose(const_iterator i, Disposer disposer)
@@ -693,11 +693,11 @@ class list_impl
//!
//! <b>Returns</b>: the first element remaining beyond the removed elements,
//! or end() if no such element exists.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements erased.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators to the erased elements.
template <class Disposer>
iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer)
@@ -717,17 +717,17 @@ class list_impl
//! <b>Effects</b>: Erases all the elements of the container.
//! No destructors are called.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements of the list.
//! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references) to the erased elements.
void clear()
{
if(safemode_or_autounlink){
- this->clear_and_dispose(detail::null_disposer());
+ this->clear_and_dispose(detail::null_disposer());
}
else{
node_algorithms::init_header(this->get_root_node());
@@ -740,11 +740,11 @@ class list_impl
//! <b>Effects</b>: Erases all the elements of the container.
//! No destructors are called.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements of the list.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators to the erased elements.
template <class Disposer>
void clear_and_dispose(Disposer disposer)
@@ -765,15 +765,15 @@ class list_impl
//! Cloner should yield to nodes equivalent to the original nodes.
//!
//! <b>Effects</b>: Erases all the elements from *this
- //! calling Disposer::operator()(pointer), clones all the
+ //! calling Disposer::operator()(pointer), clones all the
//! elements from src calling Cloner::operator()(const_reference )
//! and inserts them on *this.
//!
//! If cloner throws, all cloned elements are unlinked and disposed
//! calling Disposer::operator()(pointer).
- //!
+ //!
//! <b>Complexity</b>: Linear to erased plus inserted elements.
- //!
+ //!
//! <b>Throws</b>: If cloner throws. Basic guarantee.
template <class Cloner, class Disposer>
void clone_from(const list_impl &src, Cloner cloner, Disposer disposer)
@@ -793,11 +793,11 @@ class list_impl
//! <b>Effects</b>: Inserts the value before the position pointed by p.
//!
//! <b>Returns</b>: An iterator to the inserted element.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant time. No copy constructors are called.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
iterator insert(const_iterator p, reference value)
{
@@ -809,16 +809,16 @@ class list_impl
return iterator(to_insert, this);
}
- //! <b>Requires</b>: Dereferencing iterator must yield
+ //! <b>Requires</b>: Dereferencing iterator must yield
//! an lvalue of type value_type and p must be a valid iterator of *this.
- //!
+ //!
//! <b>Effects</b>: Inserts the range pointed by b and e before the position p.
//! No copy constructors are called.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements inserted.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
template<class Iterator>
void insert(const_iterator p, Iterator b, Iterator e)
@@ -827,19 +827,19 @@ class list_impl
this->insert(p, *b);
}
- //! <b>Requires</b>: Dereferencing iterator must yield
+ //! <b>Requires</b>: Dereferencing iterator must yield
//! an lvalue of type value_type.
- //!
+ //!
//! <b>Effects</b>: Clears the list and inserts the range pointed by b and e.
//! No destructors or copy constructors are called.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements inserted plus
//! linear to the elements contained in the list if it's a safe-mode
//! or auto-unlink value.
//! Linear to the number of elements inserted in the list otherwise.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements.
template<class Iterator>
@@ -851,18 +851,18 @@ class list_impl
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//!
- //! <b>Requires</b>: Dereferencing iterator must yield
+ //! <b>Requires</b>: Dereferencing iterator must yield
//! an lvalue of type value_type.
- //!
+ //!
//! <b>Effects</b>: Clears the list and inserts the range pointed by b and e.
//! No destructors or copy constructors are called.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements inserted plus
//! linear to the elements contained in the list.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements.
template<class Iterator, class Disposer>
@@ -880,7 +880,7 @@ class list_impl
//! <b>Throws</b>: Nothing.
//!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of
//! this list. Iterators of this list and all the references are not invalidated.
void splice(const_iterator p, list_impl& x)
@@ -897,15 +897,15 @@ class list_impl
//! <b>Requires</b>: p must be a valid iterator of *this.
//! new_ele must point to an element contained in list x.
- //!
- //! <b>Effects</b>: Transfers the value pointed by new_ele, from list x to this list,
+ //!
+ //! <b>Effects</b>: Transfers the value pointed by new_ele, from list x to this list,
//! before the the element pointed by p. No destructors or copy constructors are called.
- //! If p == new_ele or p == ++new_ele, this function is a null operation.
- //!
+ //! If p == new_ele or p == ++new_ele, this function is a null operation.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
//! list. Iterators of this list and all the references are not invalidated.
void splice(const_iterator p, list_impl&x, const_iterator new_ele)
@@ -917,15 +917,15 @@ class list_impl
//! <b>Requires</b>: p must be a valid iterator of *this.
//! start and end must point to elements contained in list x.
- //!
- //! <b>Effects</b>: Transfers the range pointed by start and end from list x to this list,
+ //!
+ //! <b>Effects</b>: Transfers the range pointed by start and end from list x to this list,
//! before the the element pointed by p. No destructors or copy constructors are called.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements transferred
//! if constant-time size option is enabled. Constant-time otherwise.
- //!
+ //!
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
//! list. Iterators of this list and all the references are not invalidated.
void splice(const_iterator p, list_impl&x, const_iterator start, const_iterator end)
@@ -939,14 +939,14 @@ class list_impl
//! <b>Requires</b>: p must be a valid iterator of *this.
//! start and end must point to elements contained in list x.
//! n == std::distance(start, end)
- //!
- //! <b>Effects</b>: Transfers the range pointed by start and end from list x to this list,
+ //!
+ //! <b>Effects</b>: Transfers the range pointed by start and end from list x to this list,
//! before the the element pointed by p. No destructors or copy constructors are called.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
//! list. Iterators of this list and all the references are not invalidated.
void splice(const_iterator p, list_impl&x, const_iterator start, const_iterator end, difference_type n)
@@ -966,25 +966,25 @@ class list_impl
}
}
- //! <b>Effects</b>: This function sorts the list *this according to std::less<value_type>.
+ //! <b>Effects</b>: This function sorts the list *this according to std::less<value_type>.
//! The sort is stable, that is, the relative order of equivalent elements is preserved.
- //!
+ //!
//! <b>Throws</b>: If real_value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
//! or std::less<value_type> throws. Basic guarantee.
//!
//! <b>Notes</b>: Iterators and references are not invalidated.
- //!
+ //!
//! <b>Complexity</b>: The number of comparisons is approximately N log N, where N
//! is the list's size.
- void sort()
+ void sort()
{ this->sort(std::less<value_type>()); }
//! <b>Requires</b>: p must be a comparison function that induces a strict weak ordering
- //!
- //! <b>Effects</b>: This function sorts the list *this according to p. The sort is
+ //!
+ //! <b>Effects</b>: This function sorts the list *this according to p. The sort is
//! stable, that is, the relative order of equivalent elements is preserved.
- //!
+ //!
//! <b>Throws</b>: If real_value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
//! or the predicate throws. Basic guarantee.
@@ -992,13 +992,13 @@ class list_impl
//! <b>Notes</b>: This won't throw if list_base_hook<> or
//! list_member_hook are used.
//! Iterators and references are not invalidated.
- //!
+ //!
//! <b>Complexity</b>: The number of comparisons is approximately N log N, where N
//! is the list's size.
template<class Predicate>
void sort(Predicate p)
{
- if(node_traits::get_next(this->get_root_node())
+ if(node_traits::get_next(this->get_root_node())
!= node_traits::get_previous(this->get_root_node())){
list_impl carry(this->priv_value_traits());
detail::array_initializer<list_impl, 64> counter(this->priv_value_traits());
@@ -1021,32 +1021,32 @@ class list_impl
}
//! <b>Effects</b>: This function removes all of x's elements and inserts them
- //! in order into *this according to std::less<value_type>. The merge is stable;
- //! that is, if an element from *this is equivalent to one from x, then the element
- //! from *this will precede the one from x.
- //!
+ //! in order into *this according to std::less<value_type>. The merge is stable;
+ //! that is, if an element from *this is equivalent to one from x, then the element
+ //! from *this will precede the one from x.
+ //!
//! <b>Throws</b>: If std::less<value_type> throws. Basic guarantee.
- //!
+ //!
//! <b>Complexity</b>: This function is linear time: it performs at most
//! size() + x.size() - 1 comparisons.
- //!
+ //!
//! <b>Note</b>: Iterators and references are not invalidated
void merge(list_impl& x)
{ this->merge(x, std::less<value_type>()); }
//! <b>Requires</b>: p must be a comparison function that induces a strict weak
//! ordering and both *this and x must be sorted according to that ordering
- //! The lists x and *this must be distinct.
- //!
+ //! The lists x and *this must be distinct.
+ //!
//! <b>Effects</b>: This function removes all of x's elements and inserts them
- //! in order into *this. The merge is stable; that is, if an element from *this is
- //! equivalent to one from x, then the element from *this will precede the one from x.
- //!
+ //! in order into *this. The merge is stable; that is, if an element from *this is
+ //! equivalent to one from x, then the element from *this will precede the one from x.
+ //!
//! <b>Throws</b>: If the predicate throws. Basic guarantee.
- //!
+ //!
//! <b>Complexity</b>: This function is linear time: it performs at most
//! size() + x.size() - 1 comparisons.
- //!
+ //!
//! <b>Note</b>: Iterators and references are not invalidated.
template<class Predicate>
void merge(list_impl& x, Predicate p)
@@ -1073,23 +1073,23 @@ class list_impl
}
}
- //! <b>Effects</b>: Reverses the order of elements in the list.
- //!
+ //! <b>Effects</b>: Reverses the order of elements in the list.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: This function is linear time.
- //!
+ //!
//! <b>Note</b>: Iterators and references are not invalidated
void reverse()
{ node_algorithms::reverse(this->get_root_node()); }
//! <b>Effects</b>: Removes all the elements that compare equal to value.
//! No destructors are called.
- //!
+ //!
//! <b>Throws</b>: If std::equal_to<value_type> throws. Basic guarantee.
- //!
+ //!
//! <b>Complexity</b>: Linear time. It performs exactly size() comparisons for equality.
- //!
+ //!
//! <b>Note</b>: The relative order of elements that are not removed is unchanged,
//! and iterators to elements that are not removed remain valid.
void remove(const_reference value)
@@ -1101,9 +1101,9 @@ class list_impl
//! Disposer::operator()(pointer) is called for every removed element.
//!
//! <b>Throws</b>: If std::equal_to<value_type> throws. Basic guarantee.
- //!
+ //!
//! <b>Complexity</b>: Linear time. It performs exactly size() comparisons for equality.
- //!
+ //!
//! <b>Note</b>: The relative order of elements that are not removed is unchanged,
//! and iterators to elements that are not removed remain valid.
template<class Disposer>
@@ -1112,11 +1112,11 @@ class list_impl
//! <b>Effects</b>: Removes all the elements for which a specified
//! predicate is satisfied. No destructors are called.
- //!
+ //!
//! <b>Throws</b>: If pred throws. Basic guarantee.
- //!
+ //!
//! <b>Complexity</b>: Linear time. It performs exactly size() calls to the predicate.
- //!
+ //!
//! <b>Note</b>: The relative order of elements that are not removed is unchanged,
//! and iterators to elements that are not removed remain valid.
template<class Pred>
@@ -1130,7 +1130,7 @@ class list_impl
//! Disposer::operator()(pointer) is called for every removed element.
//!
//! <b>Throws</b>: If pred throws. Basic guarantee.
- //!
+ //!
//! <b>Complexity</b>: Linear time. It performs exactly size() comparisons for equality.
//!
//! <b>Note</b>: The relative order of elements that are not removed is unchanged,
@@ -1150,26 +1150,26 @@ class list_impl
}
}
- //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
+ //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
//! elements that are equal from the list. No destructors are called.
- //!
+ //!
//! <b>Throws</b>: If std::equal_to<value_type throws. Basic guarantee.
- //!
+ //!
//! <b>Complexity</b>: Linear time (size()-1 comparisons calls to pred()).
- //!
+ //!
//! <b>Note</b>: The relative order of elements that are not removed is unchanged,
//! and iterators to elements that are not removed remain valid.
void unique()
{ this->unique_and_dispose(std::equal_to<value_type>(), detail::null_disposer()); }
- //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
+ //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
//! elements that satisfy some binary predicate from the list.
//! No destructors are called.
- //!
+ //!
//! <b>Throws</b>: If pred throws. Basic guarantee.
- //!
+ //!
//! <b>Complexity</b>: Linear time (size()-1 comparisons equality comparisons).
- //!
+ //!
//! <b>Note</b>: The relative order of elements that are not removed is unchanged,
//! and iterators to elements that are not removed remain valid.
template<class BinaryPredicate>
@@ -1178,14 +1178,14 @@ class list_impl
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//!
- //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
+ //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
//! elements that are equal from the list.
//! Disposer::operator()(pointer) is called for every removed element.
- //!
+ //!
//! <b>Throws</b>: If std::equal_to<value_type throws. Basic guarantee.
- //!
+ //!
//! <b>Complexity</b>: Linear time (size()-1) comparisons equality comparisons.
- //!
+ //!
//! <b>Note</b>: The relative order of elements that are not removed is unchanged,
//! and iterators to elements that are not removed remain valid.
template<class Disposer>
@@ -1194,14 +1194,14 @@ class list_impl
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//!
- //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
+ //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
//! elements that satisfy some binary predicate from the list.
//! Disposer::operator()(pointer) is called for every removed element.
- //!
+ //!
//! <b>Throws</b>: If pred throws. Basic guarantee.
- //!
+ //!
//! <b>Complexity</b>: Linear time (size()-1) comparisons equality comparisons.
- //!
+ //!
//! <b>Note</b>: The relative order of elements that are not removed is unchanged,
//! and iterators to elements that are not removed remain valid.
template<class BinaryPredicate, class Disposer>
@@ -1226,13 +1226,13 @@ class list_impl
}
//! <b>Requires</b>: value must be a reference to a value inserted in a list.
- //!
+ //!
//! <b>Effects</b>: This function returns a const_iterator pointing to the element
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Note</b>: Iterators and references are not invalidated.
//! This static function is available only if the <i>value traits</i>
//! is stateless.
@@ -1244,17 +1244,17 @@ class list_impl
}
//! <b>Requires</b>: value must be a const reference to a value inserted in a list.
- //!
+ //!
//! <b>Effects</b>: This function returns an iterator pointing to the element.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Note</b>: Iterators and references are not invalidated.
//! This static function is available only if the <i>value traits</i>
//! is stateless.
- static const_iterator s_iterator_to(const_reference value)
+ static const_iterator s_iterator_to(const_reference value)
{
BOOST_STATIC_ASSERT((!stateful_value_traits));
BOOST_INTRUSIVE_INVARIANT_ASSERT(!node_algorithms::inited(real_value_traits::to_node_ptr(const_cast<reference> (value))));
@@ -1262,13 +1262,13 @@ class list_impl
}
//! <b>Requires</b>: value must be a reference to a value inserted in a list.
- //!
+ //!
//! <b>Effects</b>: This function returns a const_iterator pointing to the element
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Note</b>: Iterators and references are not invalidated.
iterator iterator_to(reference value)
{
@@ -1277,13 +1277,13 @@ class list_impl
}
//! <b>Requires</b>: value must be a const reference to a value inserted in a list.
- //!
+ //!
//! <b>Effects</b>: This function returns an iterator pointing to the element.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Note</b>: Iterators and references are not invalidated.
const_iterator iterator_to(const_reference value) const
{
@@ -1434,7 +1434,7 @@ struct make_list
{
/// @cond
typedef typename pack_options
- < list_defaults<T>,
+ < list_defaults<T>,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3
#else
@@ -1466,7 +1466,7 @@ template<class T, class O1, class O2, class O3>
template<class T, class ...Options>
#endif
class list
- : public make_list<T,
+ : public make_list<T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3
#else
@@ -1475,7 +1475,7 @@ class list
>::type
{
typedef typename make_list
- <T,
+ <T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3
#else
@@ -1517,8 +1517,8 @@ class list
#endif
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/list_hook.hpp b/boost/intrusive/list_hook.hpp
index ed93434a3f..b674868242 100644
--- a/boost/intrusive/list_hook.hpp
+++ b/boost/intrusive/list_hook.hpp
@@ -1,7 +1,7 @@
/////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -44,7 +44,7 @@ struct make_list_base_hook
{
/// @cond
typedef typename pack_options
- < hook_defaults,
+ < hook_defaults,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3
#else
@@ -64,13 +64,13 @@ struct make_list_base_hook
//! Derive a class from this hook in order to store objects of that class
//! in an list.
-//!
+//!
//! The hook admits the following options: \c tag<>, \c void_pointer<> and
//! \c link_mode<>.
//!
-//! \c tag<> defines a tag to identify the node.
-//! The same tag value can be used in different classes, but if a class is
-//! derived from more than one \c list_base_hook, then each \c list_base_hook needs its
+//! \c tag<> defines a tag to identify the node.
+//! The same tag value can be used in different classes, but if a class is
+//! derived from more than one \c list_base_hook, then each \c list_base_hook needs its
//! unique tag.
//!
//! \c link_mode<> will specify the linking mode of the hook (\c normal_link,
@@ -96,27 +96,27 @@ class list_base_hook
public:
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
list_base_hook();
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state. The argument is ignored.
- //!
- //! <b>Throws</b>: Nothing.
- //!
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
//! <b>Rationale</b>: Providing a copy-constructor
- //! makes classes using the hook STL-compliant without forcing the
+ //! makes classes using the hook STL-compliant without forcing the
//! user to do some additional work. \c swap can be used to emulate
//! move-semantics.
list_base_hook(const list_base_hook& );
//! <b>Effects</b>: Empty function. The argument is ignored.
- //!
- //! <b>Throws</b>: Nothing.
- //!
- //! <b>Rationale</b>: Providing an assignment operator
- //! makes classes using the hook STL-compliant without forcing the
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing an assignment operator
+ //! makes classes using the hook STL-compliant without forcing the
//! user to do some additional work. \c swap can be used to emulate
//! move-semantics.
list_base_hook& operator=(const list_base_hook& );
@@ -125,37 +125,37 @@ class list_base_hook
//! nothing (ie. no code is generated). If link_mode is \c safe_link and the
//! object is stored in an list an assertion is raised. If link_mode is
//! \c auto_unlink and \c is_linked() is true, the node is unlinked.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
~list_base_hook();
- //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
- //! related to those nodes in one or two containers. That is, if the node
- //! this is part of the element e1, the node x is part of the element e2
- //! and both elements are included in the containers s1 and s2, then after
- //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
- //! at the position of e1. If one element is not in a container, then
- //! after the swap-operation the other element is not in a container.
- //! Iterators to e1 and e2 related to those nodes are invalidated.
+ //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
+ //! related to those nodes in one or two containers. That is, if the node
+ //! this is part of the element e1, the node x is part of the element e2
+ //! and both elements are included in the containers s1 and s2, then after
+ //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
+ //! at the position of e1. If one element is not in a container, then
+ //! after the swap-operation the other element is not in a container.
+ //! Iterators to e1 and e2 related to those nodes are invalidated.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Constant
//!
- //! <b>Throws</b>: Nothing.
+ //! <b>Throws</b>: Nothing.
void swap_nodes(list_base_hook &other);
//! <b>Precondition</b>: link_mode must be \c safe_link or \c auto_unlink.
//!
//! <b>Returns</b>: true, if the node belongs to a container, false
- //! otherwise. This function can be used to test whether \c list::iterator_to
- //! will return a valid iterator.
+ //! otherwise. This function can be used to test whether \c list::iterator_to
+ //! will return a valid iterator.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Constant
bool is_linked() const;
//! <b>Effects</b>: Removes the node if it's inserted in a container.
//! This function is only allowed if link_mode is \c auto_unlink.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
void unlink();
#endif
};
@@ -171,7 +171,7 @@ struct make_list_member_hook
{
/// @cond
typedef typename pack_options
- < hook_defaults,
+ < hook_defaults,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3
#else
@@ -191,10 +191,10 @@ struct make_list_member_hook
//! Store this hook in a class to be inserted
//! in an list.
-//!
+//!
//! The hook admits the following options: \c void_pointer<> and
//! \c link_mode<>.
-//!
+//!
//! \c link_mode<> will specify the linking mode of the hook (\c normal_link,
//! \c auto_unlink or \c safe_link).
//!
@@ -218,27 +218,27 @@ class list_member_hook
public:
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
list_member_hook();
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state. The argument is ignored.
- //!
- //! <b>Throws</b>: Nothing.
- //!
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
//! <b>Rationale</b>: Providing a copy-constructor
- //! makes classes using the hook STL-compliant without forcing the
+ //! makes classes using the hook STL-compliant without forcing the
//! user to do some additional work. \c swap can be used to emulate
//! move-semantics.
list_member_hook(const list_member_hook& );
//! <b>Effects</b>: Empty function. The argument is ignored.
- //!
- //! <b>Throws</b>: Nothing.
- //!
- //! <b>Rationale</b>: Providing an assignment operator
- //! makes classes using the hook STL-compliant without forcing the
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing an assignment operator
+ //! makes classes using the hook STL-compliant without forcing the
//! user to do some additional work. \c swap can be used to emulate
//! move-semantics.
list_member_hook& operator=(const list_member_hook& );
@@ -247,43 +247,43 @@ class list_member_hook
//! nothing (ie. no code is generated). If link_mode is \c safe_link and the
//! object is stored in an list an assertion is raised. If link_mode is
//! \c auto_unlink and \c is_linked() is true, the node is unlinked.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
~list_member_hook();
- //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
- //! related to those nodes in one or two containers. That is, if the node
- //! this is part of the element e1, the node x is part of the element e2
- //! and both elements are included in the containers s1 and s2, then after
- //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
- //! at the position of e1. If one element is not in a container, then
- //! after the swap-operation the other element is not in a container.
- //! Iterators to e1 and e2 related to those nodes are invalidated.
+ //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
+ //! related to those nodes in one or two containers. That is, if the node
+ //! this is part of the element e1, the node x is part of the element e2
+ //! and both elements are included in the containers s1 and s2, then after
+ //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
+ //! at the position of e1. If one element is not in a container, then
+ //! after the swap-operation the other element is not in a container.
+ //! Iterators to e1 and e2 related to those nodes are invalidated.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Constant
//!
- //! <b>Throws</b>: Nothing.
+ //! <b>Throws</b>: Nothing.
void swap_nodes(list_member_hook &other);
//! <b>Precondition</b>: link_mode must be \c safe_link or \c auto_unlink.
//!
//! <b>Returns</b>: true, if the node belongs to a container, false
- //! otherwise. This function can be used to test whether \c list::iterator_to
- //! will return a valid iterator.
+ //! otherwise. This function can be used to test whether \c list::iterator_to
+ //! will return a valid iterator.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Constant
bool is_linked() const;
//! <b>Effects</b>: Removes the node if it's inserted in a container.
//! This function is only allowed if link_mode is \c auto_unlink.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
void unlink();
#endif
};
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/member_value_traits.hpp b/boost/intrusive/member_value_traits.hpp
index 378c4e05b8..0462dbd65d 100644
--- a/boost/intrusive/member_value_traits.hpp
+++ b/boost/intrusive/member_value_traits.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -54,17 +54,17 @@ struct member_value_traits
static pointer to_value_ptr(const node_ptr &n)
{
return pointer(detail::parent_from_member<value_type, node>
- (boost::intrusive::detail::to_raw_pointer(n), PtrToMember));
+ (boost::intrusive::detail::to_raw_pointer(n), PtrToMember));
}
static const_pointer to_value_ptr(const const_node_ptr &n)
{
return pointer(detail::parent_from_member<value_type, node>
- (boost::intrusive::detail::to_raw_pointer(n), PtrToMember));
+ (boost::intrusive::detail::to_raw_pointer(n), PtrToMember));
}
};
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#endif //BOOST_INTRUSIVE_MEMBER_VALUE_TRAITS_HPP
diff --git a/boost/intrusive/options.hpp b/boost/intrusive/options.hpp
index 4cdeccdeaa..e657438836 100644
--- a/boost/intrusive/options.hpp
+++ b/boost/intrusive/options.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2007-2009
+// (C) Copyright Ion Gaztanaga 2007-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -245,7 +245,7 @@ struct compare
//!alpha value that does not need floating-point operations.
//!
//!If activated, the fixed alpha value is 1/sqrt(2). This
-//!option also saves some space in the container since
+//!option also saves some space in the container since
//!the alpha value and some additional data does not need
//!to be stored in the container.
//!
@@ -567,7 +567,7 @@ struct compare_hash
//!This option setter specifies if the hash container will use incremental
//!hashing. With incremental hashing the cost of hash table expansion is spread
-//!out across each hash table insertion operation, as opposed to be incurred all at once.
+//!out across each hash table insertion operation, as opposed to be incurred all at once.
//!Therefore linear hashing is well suited for interactive applications or real-time
//!appplications where the worst-case insertion time of non-incremental hash containers
//!(rehashing the whole bucket array) is not admisible.
@@ -651,9 +651,9 @@ struct pack_options
, O9
>::type
, O10
- >::type
+ >::type
, O11
- >::type
+ >::type
type;
};
#else
@@ -666,7 +666,7 @@ struct index_tuple{};
template<std::size_t Num, typename Tuple = index_tuple<> >
struct build_number_seq;
-template<std::size_t Num, int... Indexes>
+template<std::size_t Num, int... Indexes>
struct build_number_seq<Num, index_tuple<Indexes...> >
: build_number_seq<Num - 1, index_tuple<Indexes..., sizeof...(Indexes)> >
{};
diff --git a/boost/intrusive/parent_from_member.hpp b/boost/intrusive/parent_from_member.hpp
index 882c073531..f4658e5c5c 100644
--- a/boost/intrusive/parent_from_member.hpp
+++ b/boost/intrusive/parent_from_member.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2010-2010
+// (C) Copyright Ion Gaztanaga 2010-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -20,7 +20,7 @@ namespace intrusive {
//! Given a pointer to a member and its corresponding pointer to data member,
//! this function returns the pointer of the parent containing that member.
-//! Note: this function does not work with pointer to members that rely on
+//! Note: this function does not work with pointer to members that rely on
//! virtual inheritance.
template<class Parent, class Member>
inline Parent *get_parent_from_member(Member *member, const Member Parent::* ptr_to_member)
@@ -28,7 +28,7 @@ inline Parent *get_parent_from_member(Member *member, const Member Parent::* ptr
//! Given a const pointer to a member and its corresponding const pointer to data member,
//! this function returns the const pointer of the parent containing that member.
-//! Note: this function does not work with pointer to members that rely on
+//! Note: this function does not work with pointer to members that rely on
//! virtual inheritance.
template<class Parent, class Member>
inline const Parent *get_parent_from_member(const Member *member, const Member Parent::* ptr_to_member)
diff --git a/boost/intrusive/pointer_plus_bits.hpp b/boost/intrusive/pointer_plus_bits.hpp
index 10b2fe0eb9..a2a9f1bf72 100644
--- a/boost/intrusive/pointer_plus_bits.hpp
+++ b/boost/intrusive/pointer_plus_bits.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2007-2009
+// (C) Copyright Ion Gaztanaga 2007-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -63,7 +63,7 @@ struct pointer_plus_bits<T*, NumBits>
static void set_pointer(pointer &n, pointer p)
{
BOOST_INTRUSIVE_INVARIANT_ASSERT(0 == (std::size_t(p) & Mask));
- n = pointer(std::size_t(p) | (std::size_t(n) & Mask));
+ n = pointer(std::size_t(p) | (std::size_t(n) & Mask));
}
static std::size_t get_bits(pointer n)
@@ -76,7 +76,7 @@ struct pointer_plus_bits<T*, NumBits>
}
};
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#endif //BOOST_INTRUSIVE_POINTER_PLUS_BITS_HPP
diff --git a/boost/intrusive/pointer_traits.hpp b/boost/intrusive/pointer_traits.hpp
index 9f7d2fa443..3ed1afb032 100644
--- a/boost/intrusive/pointer_traits.hpp
+++ b/boost/intrusive/pointer_traits.hpp
@@ -6,7 +6,7 @@
//
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2011-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2011-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -52,7 +52,7 @@ struct pointer_traits
typedef unspecified_type difference_type;
//!Ptr::rebind<U> if such a type exists; otherwise, SomePointer<U, Args> if Ptr is
- //!a class template instantiation of the form SomePointer<T, Args>, where Args is zero or
+ //!a class template instantiation of the form SomePointer<T, Args>, where Args is zero or
//!more type arguments ; otherwise, the instantiation of rebind is ill-formed.
//!
//!For portable code for C++03 and C++11, <pre>typename rebind_pointer<U>::type</pre>
@@ -60,7 +60,7 @@ struct pointer_traits
template <class U> using rebind = unspecified;
//!Ptr::rebind<U> if such a type exists; otherwise, SomePointer<U, Args> if Ptr is
- //!a class template instantiation of the form SomePointer<T, Args>, where Args is zero or
+ //!a class template instantiation of the form SomePointer<T, Args>, where Args is zero or
//!more type arguments ; otherwise, the instantiation of rebind is ill-formed.
//!
typedef element_type &reference;
@@ -232,7 +232,7 @@ struct pointer_traits<T*>
template <class U> struct rebind_pointer
{ typedef U* type; };
-
+
//! <b>Returns</b>: addressof(r)
//!
static pointer pointer_to(reference r)
diff --git a/boost/intrusive/rbtree.hpp b/boost/intrusive/rbtree.hpp
index 26dfb4d890..1c0c30edcb 100644
--- a/boost/intrusive/rbtree.hpp
+++ b/boost/intrusive/rbtree.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -64,8 +64,8 @@ struct set_defaults
/// @endcond
//! The class template rbtree is an intrusive red-black tree container, that
-//! is used to construct intrusive set and multiset containers. The no-throw
-//! guarantee holds only, if the value_compare object
+//! is used to construct intrusive set and multiset containers. The no-throw
+//! guarantee holds only, if the value_compare object
//! doesn't throw.
//!
//! The template parameter \c T is the type to be managed by the container.
@@ -126,7 +126,7 @@ class rbtree_impl
//noncopyable
BOOST_MOVABLE_BUT_NOT_COPYABLE(rbtree_impl)
- enum { safemode_or_autounlink =
+ enum { safemode_or_autounlink =
(int)real_value_traits::link_mode == (int)auto_unlink ||
(int)real_value_traits::link_mode == (int)safe_link };
@@ -217,18 +217,18 @@ class rbtree_impl
typedef typename node_algorithms::insert_commit_data insert_commit_data;
- //! <b>Effects</b>: Constructs an empty tree.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //! <b>Effects</b>: Constructs an empty tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
//! or the copy constructorof the value_compare object throws. Basic guarantee.
rbtree_impl( const value_compare &cmp = value_compare()
- , const value_traits &v_traits = value_traits())
+ , const value_traits &v_traits = value_traits())
: data_(cmp, v_traits)
- {
- node_algorithms::init_header(this->priv_header_ptr());
+ {
+ node_algorithms::init_header(this->priv_header_ptr());
this->priv_size_traits().set_size(size_type(0));
}
@@ -240,7 +240,7 @@ class rbtree_impl
//!
//! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
//! comp and otherwise N * log N, where N is the distance between first and last.
- //!
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
//! or the copy constructor/operator() of the value_compare object throws. Basic guarantee.
@@ -259,58 +259,58 @@ class rbtree_impl
}
//! <b>Effects</b>: to-do
- //!
+ //!
rbtree_impl(BOOST_RV_REF(rbtree_impl) x)
: data_(::boost::move(x.priv_comp()), ::boost::move(x.priv_value_traits()))
{
- node_algorithms::init_header(this->priv_header_ptr());
+ node_algorithms::init_header(this->priv_header_ptr());
this->priv_size_traits().set_size(size_type(0));
this->swap(x);
}
//! <b>Effects</b>: to-do
- //!
- rbtree_impl& operator=(BOOST_RV_REF(rbtree_impl) x)
+ //!
+ rbtree_impl& operator=(BOOST_RV_REF(rbtree_impl) x)
{ this->swap(x); return *this; }
- //! <b>Effects</b>: Detaches all elements from this. The objects in the set
- //! are not deleted (i.e. no destructors are called), but the nodes according to
- //! the value_traits template parameter are reinitialized and thus can be reused.
- //!
- //! <b>Complexity</b>: Linear to elements contained in *this.
- //!
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the set
+ //! are not deleted (i.e. no destructors are called), but the nodes according to
+ //! the value_traits template parameter are reinitialized and thus can be reused.
+ //!
+ //! <b>Complexity</b>: Linear to elements contained in *this.
+ //!
//! <b>Throws</b>: Nothing.
- ~rbtree_impl()
+ ~rbtree_impl()
{}
//! <b>Effects</b>: Returns an iterator pointing to the beginning of the tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator begin()
{ return iterator (node_traits::get_left(this->priv_header_ptr()), this); }
//! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator begin() const
{ return cbegin(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cbegin() const
{ return const_iterator (node_traits::get_left(this->priv_header_ptr()), this); }
//! <b>Effects</b>: Returns an iterator pointing to the end of the tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator end()
{ return iterator (this->priv_header_ptr(), this); }
@@ -318,138 +318,138 @@ class rbtree_impl
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the tree.
//!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator end() const
{ return cend(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cend() const
{ return const_iterator (uncast(this->priv_header_ptr()), this); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning of the
//! reversed tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rbegin()
{ return reverse_iterator(end()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rbegin() const
{ return const_reverse_iterator(end()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crbegin() const
{ return const_reverse_iterator(end()); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the end
//! of the reversed tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rend()
{ return reverse_iterator(begin()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rend() const
{ return const_reverse_iterator(begin()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crend() const
{ return const_reverse_iterator(begin()); }
//! <b>Precondition</b>: end_iterator must be a valid end iterator
//! of rbtree.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the rbtree associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static rbtree_impl &container_from_end_iterator(iterator end_iterator)
{ return priv_container_from_end_iterator(end_iterator); }
//! <b>Precondition</b>: end_iterator must be a valid end const_iterator
//! of rbtree.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the rbtree associated to the iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static const rbtree_impl &container_from_end_iterator(const_iterator end_iterator)
{ return priv_container_from_end_iterator(end_iterator); }
//! <b>Precondition</b>: it must be a valid iterator
//! of rbtree.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the tree associated to the iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
static rbtree_impl &container_from_iterator(iterator it)
{ return priv_container_from_iterator(it); }
//! <b>Precondition</b>: it must be a valid end const_iterator
//! of rbtree.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the tree associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
static const rbtree_impl &container_from_iterator(const_iterator it)
{ return priv_container_from_iterator(it); }
//! <b>Effects</b>: Returns the value_compare object used by the tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If value_compare copy-constructor throws.
value_compare value_comp() const
{ return priv_comp(); }
//! <b>Effects</b>: Returns true if the container is empty.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
bool empty() const
{ return node_algorithms::unique(this->priv_header_ptr()); }
//! <b>Effects</b>: Returns the number of elements stored in the tree.
- //!
+ //!
//! <b>Complexity</b>: Linear to elements contained in *this
//! if constant-time size option is disabled. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
size_type size() const
{
@@ -461,9 +461,9 @@ class rbtree_impl
}
//! <b>Effects</b>: Swaps the contents of two rbtrees.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If the comparison functor's swap call throws.
void swap(rbtree_impl& other)
{
@@ -480,14 +480,14 @@ class rbtree_impl
}
//! <b>Requires</b>: value must be an lvalue
- //!
+ //!
//! <b>Effects</b>: Inserts value into the tree before the upper bound.
- //!
+ //!
//! <b>Complexity</b>: Average complexity for insert element is at
//! most logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
iterator insert_equal(reference value)
@@ -505,16 +505,16 @@ class rbtree_impl
//! <b>Requires</b>: value must be an lvalue, and "hint" must be
//! a valid iterator.
- //!
+ //!
//! <b>Effects</b>: Inserts x into the tree, using "hint" as a hint to
//! where it will be inserted. If "hint" is the upper_bound
//! the insertion takes constant time (two comparisons in the worst case)
- //!
+ //!
//! <b>Complexity</b>: Logarithmic in general, but it is amortized
//! constant time if t is inserted immediately before hint.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
iterator insert_equal(const_iterator hint, reference value)
@@ -530,18 +530,18 @@ class rbtree_impl
return ret;
}
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
//! of type value_type.
- //!
+ //!
//! <b>Effects</b>: Inserts a each element of a range into the tree
//! before the upper bound of the key of each element.
- //!
+ //!
//! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
//! size of the range. However, it is linear in N if the range is already sorted
//! by value_comp().
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
template<class Iterator>
@@ -553,15 +553,15 @@ class rbtree_impl
}
//! <b>Requires</b>: value must be an lvalue
- //!
+ //!
//! <b>Effects</b>: Inserts value into the tree if the value
//! is not already present.
- //!
+ //!
//! <b>Complexity</b>: Average complexity for insert element is at
//! most logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
std::pair<iterator, bool> insert_unique(reference value)
@@ -575,16 +575,16 @@ class rbtree_impl
//! <b>Requires</b>: value must be an lvalue, and "hint" must be
//! a valid iterator
- //!
+ //!
//! <b>Effects</b>: Tries to insert x into the tree, using "hint" as a hint
//! to where it will be inserted.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic in general, but it is amortized
//! constant time (two comparisons in the worst case)
//! if t is inserted immediately before hint.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
iterator insert_unique(const_iterator hint, reference value)
@@ -596,17 +596,17 @@ class rbtree_impl
return insert_unique_commit(value, commit_data);
}
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
//! of type value_type.
- //!
+ //!
//! <b>Effects</b>: Tries to insert each element of a range into the tree.
- //!
- //! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
- //! size of the range. However, it is linear in N if the range is already sorted
+ //!
+ //! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
+ //! size of the range. However, it is linear in N if the range is already sorted
//! by value_comp().
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
template<class Iterator>
@@ -623,10 +623,10 @@ class rbtree_impl
}
}
- //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
//! the same strict weak ordering as value_compare. The difference is that
//! key_value_comp compares an arbitrary key with the contained values.
- //!
+ //!
//! <b>Effects</b>: Checks if a value can be inserted in the container, using
//! a user provided key instead of the value itself.
//!
@@ -635,16 +635,16 @@ class rbtree_impl
//! and false. If the value can be inserted returns true in the returned
//! pair boolean and fills "commit_data" that is meant to be used with
//! the "insert_commit" function.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is at most logarithmic.
//!
//! <b>Throws</b>: If the key_value_comp ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Notes</b>: This function is used to improve performance when constructing
//! a value_type is expensive: if there is an equivalent value
//! the constructed object must be discarded. Many times, the part of the
//! node that is used to impose the order is much cheaper to construct
- //! than the value_type and this function offers the possibility to use that
+ //! than the value_type and this function offers the possibility to use that
//! part to check if the insertion will be successful.
//!
//! If the check is successful, the user can construct the value_type and use
@@ -659,18 +659,18 @@ class rbtree_impl
{
detail::key_nodeptr_comp<KeyValueCompare, rbtree_impl>
comp(key_value_comp, this);
- std::pair<node_ptr, bool> ret =
+ std::pair<node_ptr, bool> ret =
(node_algorithms::insert_unique_check
(this->priv_header_ptr(), key, comp, commit_data));
return std::pair<iterator, bool>(iterator(ret.first, this), ret.second);
}
- //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
//! the same strict weak ordering as value_compare. The difference is that
//! key_value_comp compares an arbitrary key with the contained values.
- //!
+ //!
//! <b>Effects</b>: Checks if a value can be inserted in the container, using
- //! a user provided key instead of the value itself, using "hint"
+ //! a user provided key instead of the value itself, using "hint"
//! as a hint to where it will be inserted.
//!
//! <b>Returns</b>: If there is an equivalent value
@@ -678,23 +678,23 @@ class rbtree_impl
//! and false. If the value can be inserted returns true in the returned
//! pair boolean and fills "commit_data" that is meant to be used with
//! the "insert_commit" function.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic in general, but it's amortized
//! constant time if t is inserted immediately before hint.
//!
//! <b>Throws</b>: If the key_value_comp ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Notes</b>: This function is used to improve performance when constructing
//! a value_type is expensive: if there is an equivalent value
//! the constructed object must be discarded. Many times, the part of the
//! constructing that is used to impose the order is much cheaper to construct
- //! than the value_type and this function offers the possibility to use that key
+ //! than the value_type and this function offers the possibility to use that key
//! to check if the insertion will be successful.
//!
//! If the check is successful, the user can construct the value_type and use
//! "insert_commit" to insert the object in constant-time. This can give a total
//! constant-time complexity to the insertion: check(O(1)) + commit(O(1)).
- //!
+ //!
//! "commit_data" remains valid for a subsequent "insert_commit" only if no more
//! objects are inserted or erased from the container.
template<class KeyType, class KeyValueCompare>
@@ -704,7 +704,7 @@ class rbtree_impl
{
detail::key_nodeptr_comp<KeyValueCompare, rbtree_impl>
comp(key_value_comp, this);
- std::pair<node_ptr, bool> ret =
+ std::pair<node_ptr, bool> ret =
(node_algorithms::insert_unique_check
(this->priv_header_ptr(), hint.pointed_node(), key, comp, commit_data));
return std::pair<iterator, bool>(iterator(ret.first, this), ret.second);
@@ -714,16 +714,16 @@ class rbtree_impl
//! must have been obtained from a previous call to "insert_check".
//! No objects should have been inserted or erased from the container between
//! the "insert_check" that filled "commit_data" and the call to "insert_commit".
- //!
+ //!
//! <b>Effects</b>: Inserts the value in the avl_set using the information obtained
//! from the "commit_data" that a previous "insert_check" filled.
//!
//! <b>Returns</b>: An iterator to the newly inserted object.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function has only sense if a "insert_check" has been
//! previously executed to fill "commit_data". No value should be inserted or
//! erased between the "insert_check" and "insert_commit" calls.
@@ -743,11 +743,11 @@ class rbtree_impl
//! once inserted according to the predicate
//!
//! <b>Effects</b>: Inserts x into the tree before "pos".
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if "pos" is not
//! the successor of "value" tree ordering invariant will be broken.
//! This is a low-level function to be used only for performance reasons
@@ -766,11 +766,11 @@ class rbtree_impl
//! than the greatest inserted key
//!
//! <b>Effects</b>: Inserts x into the tree in the last position.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if value is
//! less than the greatest inserted key tree ordering invariant will be broken.
//! This function is slightly more efficient than using "insert_before".
@@ -789,11 +789,11 @@ class rbtree_impl
//! than the minimum inserted key
//!
//! <b>Effects</b>: Inserts x into the tree in the first position.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if value is
//! greater than the minimum inserted key tree ordering invariant will be broken.
//! This function is slightly more efficient than using "insert_before".
@@ -808,12 +808,12 @@ class rbtree_impl
node_algorithms::push_front(this->priv_header_ptr(), to_insert);
}
- //! <b>Effects</b>: Erases the element pointed to by pos.
- //!
- //! <b>Complexity</b>: Average complexity for erase element is constant time.
- //!
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
iterator erase(const_iterator i)
@@ -830,26 +830,26 @@ class rbtree_impl
return ret.unconst();
}
- //! <b>Effects</b>: Erases the range pointed to by b end e.
- //!
- //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
//! O(log(size() + N)), where N is the number of elements in the range.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
iterator erase(const_iterator b, const_iterator e)
{ size_type n; return private_erase(b, e, n); }
//! <b>Effects</b>: Erases all the elements with the given value.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + N).
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
size_type erase(const_reference value)
@@ -859,11 +859,11 @@ class rbtree_impl
//! according to the comparison functor "comp".
//!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + N).
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class KeyType, class KeyValueCompare>
@@ -881,14 +881,14 @@ class rbtree_impl
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//!
- //! <b>Effects</b>: Erases the element pointed to by pos.
+ //! <b>Effects</b>: Erases the element pointed to by pos.
//! Disposer::operator()(pointer) is called for the removed element.
- //!
- //! <b>Complexity</b>: Average complexity for erase element is constant time.
- //!
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
//! <b>Throws</b>: Nothing.
- //!
- //! <b>Note</b>: Invalidates the iterators
+ //!
+ //! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
iterator erase_and_dispose(const_iterator i, Disposer disposer)
@@ -909,13 +909,13 @@ class rbtree_impl
//!
//! <b>Effects</b>: Erases all the elements with the given value.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + N).
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class Disposer>
@@ -931,12 +931,12 @@ class rbtree_impl
//!
//! <b>Effects</b>: Erases the range pointed to by b end e.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
- //! <b>Complexity</b>: Average complexity for erase range is at most
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
//! O(log(size() + N)), where N is the number of elements in the range.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
@@ -950,11 +950,11 @@ class rbtree_impl
//! Disposer::operator()(pointer) is called for the removed elements.
//!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + N).
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class KeyType, class KeyValueCompare, class Disposer>
@@ -970,13 +970,13 @@ class rbtree_impl
return n;
}
- //! <b>Effects</b>: Erases all of the elements.
- //!
+ //! <b>Effects</b>: Erases all of the elements.
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
void clear()
@@ -994,9 +994,9 @@ class rbtree_impl
//! each node to be erased.
//! <b>Complexity</b>: Average complexity for is at most O(log(size() + N)),
//! where N is the number of elements in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. Calls N times to disposer functor.
template<class Disposer>
@@ -1009,19 +1009,19 @@ class rbtree_impl
}
//! <b>Effects</b>: Returns the number of contained elements with the given value
- //!
+ //!
//! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
//! to number of objects with the given value.
- //!
+ //!
//! <b>Throws</b>: Nothing.
size_type count(const_reference value) const
{ return this->count(value, priv_comp()); }
//! <b>Effects</b>: Returns the number of contained elements with the given key
- //!
+ //!
//! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
//! to number of objects with the given key.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
size_type count(const KeyType &key, KeyValueCompare comp) const
@@ -1032,27 +1032,27 @@ class rbtree_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator lower_bound(const_reference value)
{ return this->lower_bound(value, priv_comp()); }
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator lower_bound(const_reference value) const
{ return this->lower_bound(value, priv_comp()); }
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
iterator lower_bound(const KeyType &key, KeyValueCompare comp)
@@ -1065,9 +1065,9 @@ class rbtree_impl
//! <b>Effects</b>: Returns a const iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
const_iterator lower_bound(const KeyType &key, KeyValueCompare comp) const
@@ -1080,9 +1080,9 @@ class rbtree_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is greater than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator upper_bound(const_reference value)
{ return this->upper_bound(value, priv_comp()); }
@@ -1092,7 +1092,7 @@ class rbtree_impl
//! does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
iterator upper_bound(const KeyType &key, KeyValueCompare comp)
@@ -1105,9 +1105,9 @@ class rbtree_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is greater than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator upper_bound(const_reference value) const
{ return this->upper_bound(value, priv_comp()); }
@@ -1117,7 +1117,7 @@ class rbtree_impl
//! does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
const_iterator upper_bound(const KeyType &key, KeyValueCompare comp) const
@@ -1128,20 +1128,20 @@ class rbtree_impl
(this->priv_header_ptr(), key, key_node_comp), this);
}
- //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
//! k or end() if that element does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator find(const_reference value)
{ return this->find(value, priv_comp()); }
- //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
//! k or end() if that element does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
iterator find(const KeyType &key, KeyValueCompare comp)
@@ -1152,20 +1152,20 @@ class rbtree_impl
(node_algorithms::find(this->priv_header_ptr(), key, key_node_comp), this);
}
- //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
//! k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator find(const_reference value) const
{ return this->find(value, priv_comp()); }
- //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
//! k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
const_iterator find(const KeyType &key, KeyValueCompare comp) const
@@ -1179,9 +1179,9 @@ class rbtree_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
std::pair<iterator,iterator> equal_range(const_reference value)
{ return this->equal_range(value, priv_comp()); }
@@ -1189,9 +1189,9 @@ class rbtree_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
std::pair<iterator,iterator> equal_range(const KeyType &key, KeyValueCompare comp)
@@ -1206,9 +1206,9 @@ class rbtree_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
std::pair<const_iterator, const_iterator>
equal_range(const_reference value) const
@@ -1217,9 +1217,9 @@ class rbtree_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
std::pair<const_iterator, const_iterator>
@@ -1232,19 +1232,117 @@ class rbtree_impl
return std::pair<const_iterator, const_iterator>(const_iterator(ret.first, this), const_iterator(ret.second, this));
}
+ //! <b>Requires</b>: 'lower_value' must not be greater than 'upper_value'. If
+ //! 'lower_value' == 'upper_value', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_value and upper_value.
+ std::pair<iterator,iterator> bounded_range
+ (const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed)
+ { return this->bounded_range(lower_value, upper_value, priv_comp(), left_closed, right_closed); }
+
+ //! <b>Requires</b>: KeyValueCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise
+ //!
+ //! second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator,iterator> bounded_range
+ (const KeyType &lower_key, const KeyType &upper_key, KeyValueCompare comp, bool left_closed, bool right_closed)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, rbtree_impl>
+ key_node_comp(comp, this);
+ std::pair<node_ptr, node_ptr> ret
+ (node_algorithms::bounded_range
+ (this->priv_header_ptr(), lower_key, upper_key, key_node_comp, left_closed, right_closed));
+ return std::pair<iterator, iterator>(iterator(ret.first, this), iterator(ret.second, this));
+ }
+
+ //! <b>Requires</b>: 'lower_value' must not be greater than 'upper_value'. If
+ //! 'lower_value' == 'upper_value', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_value and upper_value.
+ std::pair<const_iterator,const_iterator> bounded_range
+ (const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed) const
+ { return this->bounded_range(lower_value, upper_value, priv_comp(), left_closed, right_closed); }
+
+ //! <b>Requires</b>: KeyValueCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise
+ //!
+ //! second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<const_iterator,const_iterator> bounded_range
+ (const KeyType &lower_key, const KeyType &upper_key, KeyValueCompare comp, bool left_closed, bool right_closed) const
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, rbtree_impl>
+ key_node_comp(comp, this);
+ std::pair<node_ptr, node_ptr> ret
+ (node_algorithms::bounded_range
+ (this->priv_header_ptr(), lower_key, upper_key, key_node_comp, left_closed, right_closed));
+ return std::pair<const_iterator, const_iterator>(const_iterator(ret.first, this), const_iterator(ret.second, this));
+ }
+
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//! Cloner should yield to nodes equivalent to the original nodes.
//!
//! <b>Effects</b>: Erases all the elements from *this
- //! calling Disposer::operator()(pointer), clones all the
+ //! calling Disposer::operator()(pointer), clones all the
//! elements from src calling Cloner::operator()(const_reference )
//! and inserts them on *this. Copies the predicate from the source container.
//!
//! If cloner throws, all cloned elements are unlinked and disposed
//! calling Disposer::operator()(pointer).
- //!
+ //!
//! <b>Complexity</b>: Linear to erased plus inserted elements.
- //!
+ //!
//! <b>Throws</b>: If cloner throws or predicate copy assignment throws. Basic guarantee.
template <class Cloner, class Disposer>
void clone_from(const rbtree_impl &src, Cloner cloner, Disposer disposer)
@@ -1265,11 +1363,11 @@ class rbtree_impl
}
//! <b>Effects</b>: Unlinks the leftmost node from the tree.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function breaks the tree and the tree can
//! only be used for more unlink_leftmost_without_rebalance calls.
//! This function is normally used to achieve a step by step
@@ -1288,14 +1386,14 @@ class rbtree_impl
//! <b>Requires</b>: replace_this must be a valid iterator of *this
//! and with_this must not be inserted in any tree.
- //!
+ //!
//! <b>Effects</b>: Replaces replace_this in its position in the
//! tree with with_this. The tree does not need to be rebalanced.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! with_this is not equivalent to *replace_this according to the
//! ordering rules. This function is faster than erasing and inserting
@@ -1311,14 +1409,14 @@ class rbtree_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator i belonging to the set
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
static iterator s_iterator_to(reference value)
@@ -1329,17 +1427,17 @@ class rbtree_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
//! set that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
- static const_iterator s_iterator_to(const_reference value)
+ static const_iterator s_iterator_to(const_reference value)
{
BOOST_STATIC_ASSERT((!stateful_value_traits));
return const_iterator (value_traits::to_node_ptr(const_cast<reference> (value)), 0);
@@ -1347,48 +1445,48 @@ class rbtree_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator i belonging to the set
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator iterator_to(reference value)
{ return iterator (value_traits::to_node_ptr(value), this); }
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
//! set that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator iterator_to(const_reference value) const
{ return const_iterator (value_traits::to_node_ptr(const_cast<reference> (value)), this); }
//! <b>Requires</b>: value shall not be in a tree.
- //!
+ //!
//! <b>Effects</b>: init_node puts the hook of a value in a well-known default
//! state.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Note</b>: This function puts the hook in the well-known default state
//! used by auto_unlink and safe hooks.
static void init_node(reference value)
{ node_algorithms::init(value_traits::to_node_ptr(value)); }
//! <b>Effects</b>: removes "value" from the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic time.
- //!
+ //!
//! <b>Note</b>: This static function is only usable with non-constant
//! time size containers that have stateless comparison functors.
//!
@@ -1565,7 +1663,7 @@ template<class T, class ...Options>
struct make_rbtree_opt
{
typedef typename pack_options
- < set_defaults<T>,
+ < set_defaults<T>,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -1596,7 +1694,7 @@ struct make_rbtree
{
/// @cond
typedef rbtree_impl
- < typename make_rbtree_opt<T,
+ < typename make_rbtree_opt<T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -1616,7 +1714,7 @@ template<class T, class O1, class O2, class O3, class O4>
template<class T, class ...Options>
#endif
class rbtree
- : public make_rbtree<T,
+ : public make_rbtree<T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -1625,7 +1723,7 @@ class rbtree
>::type
{
typedef typename make_rbtree
- <T,
+ <T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -1679,8 +1777,8 @@ class rbtree
#endif
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/rbtree_algorithms.hpp b/boost/intrusive/rbtree_algorithms.hpp
index de012c2cad..451a550a84 100644
--- a/boost/intrusive/rbtree_algorithms.hpp
+++ b/boost/intrusive/rbtree_algorithms.hpp
@@ -1,7 +1,7 @@
/////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztanaga 2006-2009.
+// (C) Copyright Ion Gaztanaga 2006-2012.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -11,7 +11,7 @@
//
/////////////////////////////////////////////////////////////////////////////
// The internal implementation of red-black trees is based on that of SGI STL
-// stl_tree.h file:
+// stl_tree.h file:
//
// Copyright (c) 1996,1997
// Silicon Graphics Computer Systems, Inc.
@@ -36,14 +36,14 @@
// representations about the suitability of this software for any
// purpose. It is provided "as is" without express or implied warranty.
//
-// The tree destruction algorithm is based on Julienne Walker and The EC Team code:
-//
+// The tree destruction algorithm is based on Julienne Walker and The EC Team code:
+//
// This code is in the public domain. Anyone may use it or change it in any way that
// they see fit. The author assumes no responsibility for damages incurred through
-// use of the original code or any variations thereof.
-//
+// use of the original code or any variations thereof.
+//
// It is requested, but not required, that due credit is given to the original author
-// and anyone who has modified the code through a header comment, such as this one.
+// and anyone who has modified the code through a header comment, such as this one.
#ifndef BOOST_INTRUSIVE_RBTREE_ALGORITHMS_HPP
#define BOOST_INTRUSIVE_RBTREE_ALGORITHMS_HPP
@@ -61,17 +61,17 @@
namespace boost {
namespace intrusive {
-//! rbtree_algorithms provides basic algorithms to manipulate
-//! nodes forming a red-black tree. The insertion and deletion algorithms are
-//! based on those in Cormen, Leiserson, and Rivest, Introduction to Algorithms
+//! rbtree_algorithms provides basic algorithms to manipulate
+//! nodes forming a red-black tree. The insertion and deletion algorithms are
+//! based on those in Cormen, Leiserson, and Rivest, Introduction to Algorithms
//! (MIT Press, 1990), except that
-//!
+//!
//! (1) the header node is maintained with links not only to the root
//! but also to the leftmost node of the tree, to enable constant time
//! begin(), and to the rightmost node of the tree, to enable linear time
//! performance when used with the generic set algorithms (set_union,
//! etc.);
-//!
+//!
//! (2) when a node being deleted has two children its successor node is
//! relinked into its place, rather than copied, so that the only
//! pointers invalidated are those referring to the deleted node.
@@ -93,23 +93,23 @@ namespace intrusive {
//! <b>Static functions</b>:
//!
//! <tt>static node_ptr get_parent(const_node_ptr n);</tt>
-//!
+//!
//! <tt>static void set_parent(node_ptr n, node_ptr parent);</tt>
//!
//! <tt>static node_ptr get_left(const_node_ptr n);</tt>
-//!
+//!
//! <tt>static void set_left(node_ptr n, node_ptr left);</tt>
//!
//! <tt>static node_ptr get_right(const_node_ptr n);</tt>
-//!
+//!
//! <tt>static void set_right(node_ptr n, node_ptr right);</tt>
-//!
+//!
//! <tt>static color get_color(const_node_ptr n);</tt>
-//!
+//!
//! <tt>static void set_color(node_ptr n, color c);</tt>
-//!
+//!
//! <tt>static color black();</tt>
-//!
+//!
//! <tt>static color red();</tt>
template<class NodeTraits>
class rbtree_algorithms
@@ -135,7 +135,7 @@ class rbtree_algorithms
rbtree_node_cloner(F f)
: base_t(f)
{}
-
+
node_ptr operator()(const node_ptr & p)
{
node_ptr n = base_t::get()(p);
@@ -172,27 +172,27 @@ class rbtree_algorithms
//! <b>Requires</b>: header1 and header2 must be the header nodes
//! of two trees.
- //!
- //! <b>Effects</b>: Swaps two trees. After the function header1 will contain
+ //!
+ //! <b>Effects</b>: Swaps two trees. After the function header1 will contain
//! links to the second tree and header2 will have links to the first tree.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
static void swap_tree(const node_ptr & header1, const node_ptr & header2)
{ return tree_algorithms::swap_tree(header1, header2); }
//! <b>Requires</b>: node1 and node2 can't be header nodes
//! of two trees.
- //!
+ //!
//! <b>Effects</b>: Swaps two nodes. After the function node1 will be inserted
//! in the position node2 before the function. node2 will be inserted in the
//! position node1 had before the function.
- //!
- //! <b>Complexity</b>: Logarithmic.
- //!
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! node1 and node2 are not equivalent according to the ordering rules.
//!
@@ -201,22 +201,22 @@ class rbtree_algorithms
{
if(node1 == node2)
return;
-
+
node_ptr header1(tree_algorithms::get_header(node1)), header2(tree_algorithms::get_header(node2));
swap_nodes(node1, header1, node2, header2);
}
//! <b>Requires</b>: node1 and node2 can't be header nodes
//! of two trees with header header1 and header2.
- //!
+ //!
//! <b>Effects</b>: Swaps two nodes. After the function node1 will be inserted
//! in the position node2 before the function. node2 will be inserted in the
//! position node1 had before the function.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! node1 and node2 are not equivalent according to the ordering rules.
//!
@@ -228,20 +228,20 @@ class rbtree_algorithms
tree_algorithms::swap_nodes(node1, header1, node2, header2);
//Swap color
color c = NodeTraits::get_color(node1);
- NodeTraits::set_color(node1, NodeTraits::get_color(node2));
- NodeTraits::set_color(node2, c);
+ NodeTraits::set_color(node1, NodeTraits::get_color(node2));
+ NodeTraits::set_color(node2, c);
}
//! <b>Requires</b>: node_to_be_replaced must be inserted in a tree
//! and new_node must not be inserted in a tree.
- //!
+ //!
//! <b>Effects</b>: Replaces node_to_be_replaced in its position in the
//! tree with new_node. The tree does not need to be rebalanced
- //!
- //! <b>Complexity</b>: Logarithmic.
- //!
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! new_node is not equivalent to node_to_be_replaced according to the
//! ordering rules. This function is faster than erasing and inserting
@@ -257,14 +257,14 @@ class rbtree_algorithms
//! <b>Requires</b>: node_to_be_replaced must be inserted in a tree
//! with header "header" and new_node must not be inserted in a tree.
- //!
+ //!
//! <b>Effects</b>: Replaces node_to_be_replaced in its position in the
//! tree with new_node. The tree does not need to be rebalanced
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! new_node is not equivalent to node_to_be_replaced according to the
//! ordering rules. This function is faster than erasing and inserting
@@ -274,15 +274,15 @@ class rbtree_algorithms
static void replace_node(const node_ptr & node_to_be_replaced, const node_ptr & header, const node_ptr & new_node)
{
tree_algorithms::replace_node(node_to_be_replaced, header, new_node);
- NodeTraits::set_color(new_node, NodeTraits::get_color(node_to_be_replaced));
+ NodeTraits::set_color(new_node, NodeTraits::get_color(node_to_be_replaced));
}
//! <b>Requires</b>: node is a tree node but not the header.
- //!
+ //!
//! <b>Effects</b>: Unlinks the node and rebalances the tree.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static void unlink(const node_ptr & node)
{
@@ -295,14 +295,14 @@ class rbtree_algorithms
}
//! <b>Requires</b>: header is the header of a tree.
- //!
+ //!
//! <b>Effects</b>: Unlinks the leftmost node from the tree, and
//! updates the header link to the new leftmost node.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function breaks the tree and the tree can
//! only be used for more unlink_leftmost_without_rebalance calls.
//! This function is normally used to achieve a step by step
@@ -312,51 +312,51 @@ class rbtree_algorithms
//! <b>Requires</b>: node is a node of the tree or an node initialized
//! by init(...).
- //!
+ //!
//! <b>Effects</b>: Returns true if the node is initialized by init().
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static bool unique(const const_node_ptr & node)
{ return tree_algorithms::unique(node); }
//! <b>Requires</b>: node is a node of the tree but it's not the header.
- //!
+ //!
//! <b>Effects</b>: Returns the number of nodes of the subtree.
- //!
+ //!
//! <b>Complexity</b>: Linear time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static std::size_t count(const const_node_ptr & node)
{ return tree_algorithms::count(node); }
//! <b>Requires</b>: header is the header node of the tree.
- //!
+ //!
//! <b>Effects</b>: Returns the number of nodes above the header.
- //!
+ //!
//! <b>Complexity</b>: Linear time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static std::size_t size(const const_node_ptr & header)
{ return tree_algorithms::size(header); }
//! <b>Requires</b>: p is a node from the tree except the header.
- //!
+ //!
//! <b>Effects</b>: Returns the next node of the tree.
- //!
+ //!
//! <b>Complexity</b>: Average constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static node_ptr next_node(const node_ptr & p)
{ return tree_algorithms::next_node(p); }
//! <b>Requires</b>: p is a node from the tree except the leftmost node.
- //!
+ //!
//! <b>Effects</b>: Returns the previous node of the tree.
- //!
+ //!
//! <b>Complexity</b>: Average constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static node_ptr prev_node(const node_ptr & p)
{ return tree_algorithms::prev_node(p); }
@@ -364,9 +364,9 @@ class rbtree_algorithms
//! <b>Requires</b>: node must not be part of any tree.
//!
//! <b>Effects</b>: After the function unique(node) == true.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
//!
//! <b>Nodes</b>: If node is inserted in a tree, this function corrupts the tree.
@@ -377,25 +377,25 @@ class rbtree_algorithms
//!
//! <b>Effects</b>: Initializes the header to represent an empty tree.
//! unique(header) == true.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
//!
//! <b>Nodes</b>: If node is inserted in a tree, this function corrupts the tree.
static void init_header(const node_ptr & header)
{
tree_algorithms::init_header(header);
- NodeTraits::set_color(header, NodeTraits::red());
+ NodeTraits::set_color(header, NodeTraits::red());
}
//! <b>Requires</b>: header must be the header of a tree, z a node
//! of that tree and z != header.
//!
//! <b>Effects</b>: Erases node "z" from the tree with header "header".
- //!
+ //!
//! <b>Complexity</b>: Amortized constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static node_ptr erase(const node_ptr & header, const node_ptr & z)
{
@@ -415,18 +415,18 @@ class rbtree_algorithms
//! object taking a node_ptr and returning a new cloned node of it. "disposer" must
//! take a node_ptr and shouldn't throw.
//!
- //! <b>Effects</b>: First empties target tree calling
+ //! <b>Effects</b>: First empties target tree calling
//! <tt>void disposer::operator()(const node_ptr &)</tt> for every node of the tree
//! except the header.
- //!
+ //!
//! Then, duplicates the entire tree pointed by "source_header" cloning each
- //! source node with <tt>node_ptr Cloner::operator()(const node_ptr &)</tt> to obtain
+ //! source node with <tt>node_ptr Cloner::operator()(const node_ptr &)</tt> to obtain
//! the nodes of the target tree. If "cloner" throws, the cloned target nodes
//! are disposed using <tt>void disposer(const node_ptr &)</tt>.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of element of the source tree plus the.
//! number of elements of tree target tree when calling this function.
- //!
+ //!
//! <b>Throws</b>: If cloner functor throws. If this happens target nodes are disposed.
template <class Cloner, class Disposer>
static void clone
@@ -439,13 +439,13 @@ class rbtree_algorithms
//! <b>Requires</b>: "disposer" must be an object function
//! taking a node_ptr parameter and shouldn't throw.
//!
- //! <b>Effects</b>: Empties the target tree calling
+ //! <b>Effects</b>: Empties the target tree calling
//! <tt>void disposer::operator()(const node_ptr &)</tt> for every node of the tree
//! except the header.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of element of the source tree plus the.
//! number of elements of tree target tree when calling this function.
- //!
+ //!
//! <b>Throws</b>: If cloner functor throws. If this happens target nodes are disposed.
template<class Disposer>
static void clear_and_dispose(const node_ptr & header, Disposer disposer)
@@ -461,7 +461,7 @@ class rbtree_algorithms
//! not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class KeyType, class KeyNodePtrCompare>
static node_ptr lower_bound
@@ -477,7 +477,7 @@ class rbtree_algorithms
//! than "key" according to "comp" or "header" if that element does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class KeyType, class KeyNodePtrCompare>
static node_ptr upper_bound
@@ -493,7 +493,7 @@ class rbtree_algorithms
//! "key" according to "comp" or "header" if that element does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class KeyType, class KeyNodePtrCompare>
static node_ptr find
@@ -511,13 +511,38 @@ class rbtree_algorithms
//! if they there are no equivalent elements.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class KeyType, class KeyNodePtrCompare>
static std::pair<node_ptr, node_ptr> equal_range
(const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp)
{ return tree_algorithms::equal_range(header, key, comp); }
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyNodePtrCompare>
+ static std::pair<node_ptr, node_ptr> bounded_range
+ (const const_node_ptr & header, const KeyType &lower_key, const KeyType &upper_key, KeyNodePtrCompare comp
+ , bool left_closed, bool right_closed)
+ { return tree_algorithms::bounded_range(header, lower_key, upper_key, comp, left_closed, right_closed); }
+
//! <b>Requires</b>: "h" must be the header node of a tree.
//! NodePtrCompare is a function object that induces a strict weak
//! ordering compatible with the strict weak ordering used to create the
@@ -525,10 +550,10 @@ class rbtree_algorithms
//!
//! <b>Effects</b>: Inserts new_node into the tree before the upper bound
//! according to "comp".
- //!
+ //!
//! <b>Complexity</b>: Average complexity for insert element is at
//! most logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class NodePtrCompare>
static node_ptr insert_equal_upper_bound
@@ -546,10 +571,10 @@ class rbtree_algorithms
//!
//! <b>Effects</b>: Inserts new_node into the tree before the lower bound
//! according to "comp".
- //!
+ //!
//! <b>Complexity</b>: Average complexity for insert element is at
//! most logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class NodePtrCompare>
static node_ptr insert_equal_lower_bound
@@ -565,14 +590,14 @@ class rbtree_algorithms
//! ordering compatible with the strict weak ordering used to create the
//! the tree. NodePtrCompare compares two node_ptrs. "hint" is node from
//! the "header"'s tree.
- //!
+ //!
//! <b>Effects</b>: Inserts new_node into the tree, using "hint" as a hint to
//! where it will be inserted. If "hint" is the upper_bound
//! the insertion takes constant time (two comparisons in the worst case).
//!
//! <b>Complexity</b>: Logarithmic in general, but it is amortized
//! constant time if new_node is inserted immediately before "hint".
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class NodePtrCompare>
static node_ptr insert_equal
@@ -588,13 +613,13 @@ class rbtree_algorithms
//! "pos" must be an iterator pointing to the successor to "new_node"
//! once inserted according to the order of already inserted nodes. This function does not
//! check "pos" and this precondition must be guaranteed by the caller.
- //!
+ //!
//! <b>Effects</b>: Inserts new_node into the tree before "pos".
//!
//! <b>Complexity</b>: Constant-time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: If "pos" is not the successor of the newly inserted "new_node"
//! tree invariants might be broken.
static node_ptr insert_before
@@ -608,13 +633,13 @@ class rbtree_algorithms
//! <b>Requires</b>: "header" must be the header node of a tree.
//! "new_node" must be, according to the used ordering no less than the
//! greatest inserted key.
- //!
+ //!
//! <b>Effects</b>: Inserts new_node into the tree before "pos".
//!
//! <b>Complexity</b>: Constant-time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: If "new_node" is less than the greatest inserted key
//! tree invariants are broken. This function is slightly faster than
//! using "insert_before".
@@ -627,13 +652,13 @@ class rbtree_algorithms
//! <b>Requires</b>: "header" must be the header node of a tree.
//! "new_node" must be, according to the used ordering, no greater than the
//! lowest inserted key.
- //!
+ //!
//! <b>Effects</b>: Inserts new_node into the tree before "pos".
//!
//! <b>Complexity</b>: Constant-time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: If "new_node" is greater than the lowest inserted key
//! tree invariants are broken. This function is slightly faster than
//! using "insert_before".
@@ -647,7 +672,7 @@ class rbtree_algorithms
//! KeyNodePtrCompare is a function object that induces a strict weak
//! ordering compatible with the strict weak ordering used to create the
//! the tree. NodePtrCompare compares KeyType with a node_ptr.
- //!
+ //!
//! <b>Effects</b>: Checks if there is an equivalent node to "key" in the
//! tree according to "comp" and obtains the needed information to realize
//! a constant-time node insertion if there is no equivalent node.
@@ -658,11 +683,11 @@ class rbtree_algorithms
//! in the returned pair's boolean and fills "commit_data" that is meant to
//! be used with the "insert_commit" function to achieve a constant-time
//! insertion function.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is at most logarithmic.
//!
//! <b>Throws</b>: If "comp" throws.
- //!
+ //!
//! <b>Notes</b>: This function is used to improve performance when constructing
//! a node is expensive and the user does not want to have two equivalent nodes
//! in the tree: if there is an equivalent value
@@ -688,12 +713,12 @@ class rbtree_algorithms
//! ordering compatible with the strict weak ordering used to create the
//! the tree. NodePtrCompare compares KeyType with a node_ptr.
//! "hint" is node from the "header"'s tree.
- //!
+ //!
//! <b>Effects</b>: Checks if there is an equivalent node to "key" in the
//! tree according to "comp" using "hint" as a hint to where it should be
//! inserted and obtains the needed information to realize
- //! a constant-time node insertion if there is no equivalent node.
- //! If "hint" is the upper_bound the function has constant time
+ //! a constant-time node insertion if there is no equivalent node.
+ //! If "hint" is the upper_bound the function has constant time
//! complexity (two comparisons in the worst case).
//!
//! <b>Returns</b>: If there is an equivalent value
@@ -702,12 +727,12 @@ class rbtree_algorithms
//! in the returned pair's boolean and fills "commit_data" that is meant to
//! be used with the "insert_commit" function to achieve a constant-time
//! insertion function.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is at most logarithmic, but it is
//! amortized constant time if new_node should be inserted immediately before "hint".
//!
//! <b>Throws</b>: If "comp" throws.
- //!
+ //!
//! <b>Notes</b>: This function is used to improve performance when constructing
//! a node is expensive and the user does not want to have two equivalent nodes
//! in the tree: if there is an equivalent value
@@ -732,16 +757,16 @@ class rbtree_algorithms
//! "commit_data" must have been obtained from a previous call to
//! "insert_unique_check". No objects should have been inserted or erased
//! from the set between the "insert_unique_check" that filled "commit_data"
- //! and the call to "insert_commit".
- //!
- //!
+ //! and the call to "insert_commit".
+ //!
+ //!
//! <b>Effects</b>: Inserts new_node in the set using the information obtained
//! from the "commit_data" that a previous "insert_check" filled.
//!
//! <b>Complexity</b>: Constant time.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function has only sense if a "insert_unique_check" has been
//! previously executed to fill "commit_data". No value should be inserted or
//! erased between the "insert_check" and "insert_commit" calls.
@@ -757,7 +782,7 @@ class rbtree_algorithms
//! <b>Effects</b>: Returns a pointer to the header node of the tree.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static node_ptr get_header(const node_ptr & n)
{ return tree_algorithms::get_header(n); }
@@ -766,17 +791,17 @@ class rbtree_algorithms
private:
//! <b>Requires</b>: p is a node of a tree.
- //!
+ //!
//! <b>Effects</b>: Returns true if p is the header of the tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static bool is_header(const const_node_ptr & p)
{
return NodeTraits::get_color(p) == NodeTraits::red() &&
tree_algorithms::is_header(p);
- //return NodeTraits::get_color(p) == NodeTraits::red() &&
+ //return NodeTraits::get_color(p) == NodeTraits::red() &&
// NodeTraits::get_parent(NodeTraits::get_parent(p)) == p;
}
@@ -797,7 +822,7 @@ class rbtree_algorithms
NodeTraits::set_color(w, NodeTraits::red());
x = x_parent;
x_parent = NodeTraits::get_parent(x_parent);
- }
+ }
else {
if(NodeTraits::get_right(w) == node_ptr() || NodeTraits::get_color(NodeTraits::get_right(w)) == NodeTraits::black()){
NodeTraits::set_color(NodeTraits::get_left(w), NodeTraits::black());
@@ -902,8 +927,8 @@ class rbtree_algorithms
/// @endcond
};
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/set.hpp b/boost/intrusive/set.hpp
index 9b0207023d..9a61560d75 100644
--- a/boost/intrusive/set.hpp
+++ b/boost/intrusive/set.hpp
@@ -1,7 +1,7 @@
/////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -23,9 +23,9 @@
namespace boost {
namespace intrusive {
-//! The class template set is an intrusive container, that mimics most of
+//! The class template set is an intrusive container, that mimics most of
//! the interface of std::set as described in the C++ standard.
-//!
+//!
//! The template parameter \c T is the type to be managed by the container.
//! The user can specify additional options and if no options are provided
//! default options are used.
@@ -86,30 +86,30 @@ class set_impl
/// @endcond
public:
- //! <b>Effects</b>: Constructs an empty set.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //! <b>Effects</b>: Constructs an empty set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
- //! or the copy constructor of the value_compare object throws.
+ //! or the copy constructor of the value_compare object throws.
set_impl( const value_compare &cmp = value_compare()
- , const value_traits &v_traits = value_traits())
+ , const value_traits &v_traits = value_traits())
: tree_(cmp, v_traits)
{}
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
//! cmp must be a comparison function that induces a strict weak ordering.
- //!
- //! <b>Effects</b>: Constructs an empty set and inserts elements from
+ //!
+ //! <b>Effects</b>: Constructs an empty set and inserts elements from
//! [b, e).
- //!
- //! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
+ //!
+ //! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
//! comp and otherwise N * log N, where N is std::distance(last, first).
- //!
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
- //! or the copy constructor/operator() of the value_compare object throws.
+ //! or the copy constructor/operator() of the value_compare object throws.
template<class Iterator>
set_impl( Iterator b, Iterator e
, const value_compare &cmp = value_compare()
@@ -118,135 +118,135 @@ class set_impl
{}
//! <b>Effects</b>: to-do
- //!
- set_impl(BOOST_RV_REF(set_impl) x)
+ //!
+ set_impl(BOOST_RV_REF(set_impl) x)
: tree_(::boost::move(x.tree_))
{}
//! <b>Effects</b>: to-do
- //!
- set_impl& operator=(BOOST_RV_REF(set_impl) x)
+ //!
+ set_impl& operator=(BOOST_RV_REF(set_impl) x)
{ tree_ = ::boost::move(x.tree_); return *this; }
- //! <b>Effects</b>: Detaches all elements from this. The objects in the set
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the set
//! are not deleted (i.e. no destructors are called).
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- ~set_impl()
+ ~set_impl()
{}
//! <b>Effects</b>: Returns an iterator pointing to the beginning of the set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator begin()
{ return tree_.begin(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator begin() const
{ return tree_.begin(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cbegin() const
{ return tree_.cbegin(); }
//! <b>Effects</b>: Returns an iterator pointing to the end of the set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator end()
{ return tree_.end(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator end() const
{ return tree_.end(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cend() const
{ return tree_.cend(); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning of the
//! reversed set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rbegin()
{ return tree_.rbegin(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rbegin() const
{ return tree_.rbegin(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crbegin() const
{ return tree_.crbegin(); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the end
//! of the reversed set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rend()
{ return tree_.rend(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rend() const
{ return tree_.rend(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crend() const
{ return tree_.crend(); }
//! <b>Precondition</b>: end_iterator must be a valid end iterator
//! of set.
- //!
+ //!
//! <b>Effects</b>: Returns a reference to the set associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static set_impl &container_from_end_iterator(iterator end_iterator)
{
@@ -257,11 +257,11 @@ class set_impl
//! <b>Precondition</b>: end_iterator must be a valid end const_iterator
//! of set.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the set associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static const set_impl &container_from_end_iterator(const_iterator end_iterator)
{
@@ -271,11 +271,11 @@ class set_impl
}
//! <b>Precondition</b>: it must be a valid iterator of set.
- //!
+ //!
//! <b>Effects</b>: Returns a reference to the set associated to the iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
static set_impl &container_from_iterator(iterator it)
{
@@ -285,11 +285,11 @@ class set_impl
}
//! <b>Precondition</b>: it must be a valid const_iterator of set.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the set associated to the iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
static const set_impl &container_from_iterator(const_iterator it)
{
@@ -299,42 +299,42 @@ class set_impl
}
//! <b>Effects</b>: Returns the key_compare object used by the set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If key_compare copy-constructor throws.
key_compare key_comp() const
{ return tree_.value_comp(); }
//! <b>Effects</b>: Returns the value_compare object used by the set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If value_compare copy-constructor throws.
value_compare value_comp() const
{ return tree_.value_comp(); }
//! <b>Effects</b>: Returns true if the container is empty.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
bool empty() const
{ return tree_.empty(); }
//! <b>Effects</b>: Returns the number of elements stored in the set.
- //!
+ //!
//! <b>Complexity</b>: Linear to elements contained in *this if,
//! constant-time size option is enabled. Constant-time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
size_type size() const
{ return tree_.size(); }
//! <b>Effects</b>: Swaps the contents of two sets.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If the swap() call for the comparison functor
//! found using ADL throws. Strong guarantee.
void swap(set_impl& other)
@@ -344,22 +344,22 @@ class set_impl
//! Cloner should yield to nodes equivalent to the original nodes.
//!
//! <b>Effects</b>: Erases all the elements from *this
- //! calling Disposer::operator()(pointer), clones all the
+ //! calling Disposer::operator()(pointer), clones all the
//! elements from src calling Cloner::operator()(const_reference )
//! and inserts them on *this. Copies the predicate from the source container.
//!
//! If cloner throws, all cloned elements are unlinked and disposed
//! calling Disposer::operator()(pointer).
- //!
+ //!
//! <b>Complexity</b>: Linear to erased plus inserted elements.
- //!
+ //!
//! <b>Throws</b>: If cloner throws or predicate copy assignment throws. Basic guarantee.
template <class Cloner, class Disposer>
void clone_from(const set_impl &src, Cloner cloner, Disposer disposer)
{ tree_.clone_from(src.tree_, cloner, disposer); }
//! <b>Requires</b>: value must be an lvalue
- //!
+ //!
//! <b>Effects</b>: Tries to inserts value into the set.
//!
//! <b>Returns</b>: If the value
@@ -367,39 +367,39 @@ class set_impl
//! iterator to the new value and true. If there is an equivalent value
//! returns a pair containing an iterator to the already present value
//! and false.
- //!
+ //!
//! <b>Complexity</b>: Average complexity for insert element is at
//! most logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
std::pair<iterator, bool> insert(reference value)
{ return tree_.insert_unique(value); }
//! <b>Requires</b>: value must be an lvalue
- //!
- //! <b>Effects</b>: Tries to to insert x into the set, using "hint"
+ //!
+ //! <b>Effects</b>: Tries to to insert x into the set, using "hint"
//! as a hint to where it will be inserted.
//!
- //! <b>Returns</b>: An iterator that points to the position where the
+ //! <b>Returns</b>: An iterator that points to the position where the
//! new element was inserted into the set.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic in general, but it's amortized
//! constant time if t is inserted immediately before hint.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
iterator insert(const_iterator hint, reference value)
{ return tree_.insert_unique(hint, value); }
- //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
//! the same strict weak ordering as value_compare. The difference is that
//! key_value_comp compares an arbitrary key with the contained values.
- //!
+ //!
//! <b>Effects</b>: Checks if a value can be inserted in the set, using
//! a user provided key instead of the value itself.
//!
@@ -408,16 +408,16 @@ class set_impl
//! and false. If the value can be inserted returns true in the returned
//! pair boolean and fills "commit_data" that is meant to be used with
//! the "insert_commit" function.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is at most logarithmic.
//!
//! <b>Throws</b>: If the key_value_comp ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Notes</b>: This function is used to improve performance when constructing
//! a value_type is expensive: if there is an equivalent value
//! the constructed object must be discarded. Many times, the part of the
//! node that is used to impose the order is much cheaper to construct
- //! than the value_type and this function offers the possibility to use that
+ //! than the value_type and this function offers the possibility to use that
//! part to check if the insertion will be successful.
//!
//! If the check is successful, the user can construct the value_type and use
@@ -431,12 +431,12 @@ class set_impl
(const KeyType &key, KeyValueCompare key_value_comp, insert_commit_data &commit_data)
{ return tree_.insert_unique_check(key, key_value_comp, commit_data); }
- //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
//! the same strict weak ordering as value_compare. The difference is that
//! key_value_comp compares an arbitrary key with the contained values.
- //!
+ //!
//! <b>Effects</b>: Checks if a value can be inserted in the set, using
- //! a user provided key instead of the value itself, using "hint"
+ //! a user provided key instead of the value itself, using "hint"
//! as a hint to where it will be inserted.
//!
//! <b>Returns</b>: If there is an equivalent value
@@ -444,23 +444,23 @@ class set_impl
//! and false. If the value can be inserted returns true in the returned
//! pair boolean and fills "commit_data" that is meant to be used with
//! the "insert_commit" function.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic in general, but it's amortized
//! constant time if t is inserted immediately before hint.
//!
//! <b>Throws</b>: If the key_value_comp ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Notes</b>: This function is used to improve performance when constructing
//! a value_type is expensive: if there is an equivalent value
//! the constructed object must be discarded. Many times, the part of the
//! constructing that is used to impose the order is much cheaper to construct
- //! than the value_type and this function offers the possibility to use that key
+ //! than the value_type and this function offers the possibility to use that key
//! to check if the insertion will be successful.
//!
//! If the check is successful, the user can construct the value_type and use
//! "insert_commit" to insert the object in constant-time. This can give a total
//! constant-time complexity to the insertion: check(O(1)) + commit(O(1)).
- //!
+ //!
//! "commit_data" remains valid for a subsequent "insert_commit" only if no more
//! objects are inserted or erased from the set.
template<class KeyType, class KeyValueCompare>
@@ -473,33 +473,33 @@ class set_impl
//! must have been obtained from a previous call to "insert_check".
//! No objects should have been inserted or erased from the set between
//! the "insert_check" that filled "commit_data" and the call to "insert_commit".
- //!
+ //!
//! <b>Effects</b>: Inserts the value in the set using the information obtained
//! from the "commit_data" that a previous "insert_check" filled.
//!
//! <b>Returns</b>: An iterator to the newly inserted object.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function has only sense if a "insert_check" has been
//! previously executed to fill "commit_data". No value should be inserted or
//! erased between the "insert_check" and "insert_commit" calls.
iterator insert_commit(reference value, const insert_commit_data &commit_data)
{ return tree_.insert_unique_commit(value, commit_data); }
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
//! of type value_type.
- //!
+ //!
//! <b>Effects</b>: Inserts a range into the set.
- //!
+ //!
//! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
//! size of the range. However, it is linear in N if the range is already sorted
//! by value_comp().
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
template<class Iterator>
@@ -512,11 +512,11 @@ class set_impl
//! inserted key according to the predicate.
//!
//! <b>Effects</b>: Inserts x into the tree before "pos".
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if "pos" is not
//! the successor of "value" or "value" is not unique tree ordering and uniqueness
//! invariants will be broken respectively.
@@ -529,11 +529,11 @@ class set_impl
//! any inserted key according to the predicate.
//!
//! <b>Effects</b>: Inserts x into the tree in the last position.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if value is
//! less than or equal to the greatest inserted key tree ordering invariant will be broken.
//! This function is slightly more efficient than using "insert_before".
@@ -546,11 +546,11 @@ class set_impl
//! than any inserted key according to the predicate.
//!
//! <b>Effects</b>: Inserts x into the tree in the first position.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if value is
//! greater than or equal to the the mimum inserted key tree ordering or uniqueness
//! invariants will be broken.
@@ -560,41 +560,41 @@ class set_impl
void push_front(reference value)
{ tree_.push_front(value); }
- //! <b>Effects</b>: Erases the element pointed to by pos.
- //!
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //!
//! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //!
//! <b>Returns</b>: An iterator to the element after the erased element.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
iterator erase(const_iterator i)
{ return tree_.erase(i); }
- //! <b>Effects</b>: Erases the range pointed to by b end e.
- //!
- //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
//! O(log(size() + N)), where N is the number of elements in the range.
- //!
+ //!
//! <b>Returns</b>: An iterator to the element after the erased elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
iterator erase(const_iterator b, const_iterator e)
{ return tree_.erase(b, e); }
//! <b>Effects</b>: Erases all the elements with the given value.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size()) + this->count(value)).
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
size_type erase(const_reference value)
@@ -602,13 +602,13 @@ class set_impl
//! <b>Effects</b>: Erases all the elements that compare equal with
//! the given key and the given comparison functor.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + this->count(key, comp)).
- //!
+ //!
//! <b>Throws</b>: If the comp ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class KeyType, class KeyValueCompare>
@@ -621,16 +621,16 @@ class set_impl
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//!
- //! <b>Effects</b>: Erases the element pointed to by pos.
+ //! <b>Effects</b>: Erases the element pointed to by pos.
//! Disposer::operator()(pointer) is called for the removed element.
- //!
- //! <b>Complexity</b>: Average complexity for erase element is constant time.
- //!
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
//! <b>Returns</b>: An iterator to the element after the erased element.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
- //! <b>Note</b>: Invalidates the iterators
+ //!
+ //! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
iterator erase_and_dispose(const_iterator i, Disposer disposer)
@@ -646,14 +646,14 @@ class set_impl
//!
//! <b>Effects</b>: Erases the range pointed to by b end e.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
- //! <b>Complexity</b>: Average complexity for erase range is at most
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
//! O(log(size() + N)), where N is the number of elements in the range.
- //!
+ //!
//! <b>Returns</b>: An iterator to the element after the erased elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
@@ -664,13 +664,13 @@ class set_impl
//!
//! <b>Effects</b>: Erases all the elements with the given value.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + this->count(value)). Basic guarantee.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class Disposer>
@@ -684,11 +684,11 @@ class set_impl
//! Disposer::operator()(pointer) is called for the removed elements.
//!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + this->count(key, comp)).
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class KeyType, class KeyValueCompare, class Disposer>
@@ -700,26 +700,26 @@ class set_impl
{ return tree_.erase_and_dispose(key, comp, disposer); }
//! <b>Effects</b>: Erases all the elements of the container.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
void clear()
{ return tree_.clear(); }
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
- //!
+ //!
//! <b>Effects</b>: Erases all the elements of the container.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class Disposer>
@@ -727,20 +727,20 @@ class set_impl
{ return tree_.clear_and_dispose(disposer); }
//! <b>Effects</b>: Returns the number of contained elements with the given key
- //!
+ //!
//! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
//! to number of objects with the given key.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
size_type count(const_reference value) const
{ return tree_.find(value) != end(); }
//! <b>Effects</b>: Returns the number of contained elements with the same key
//! compared with the given comparison functor.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
//! to number of objects with the given key.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
template<class KeyType, class KeyValueCompare>
size_type count(const KeyType& key, KeyValueCompare comp) const
@@ -748,9 +748,9 @@ class set_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
iterator lower_bound(const_reference value)
{ return tree_.lower_bound(value); }
@@ -760,13 +760,13 @@ class set_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns an iterator to the first element whose
- //! key according to the comparison functor is not less than k or
+ //! key according to the comparison functor is not less than k or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
- //!
+ //!
//! <b>Note</b>: This function is used when constructing a value_type
//! is expensive and the value_type can be compared with a cheaper
//! key type. Usually this key is part of the value_type.
@@ -776,9 +776,9 @@ class set_impl
//! <b>Effects</b>: Returns a const iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
const_iterator lower_bound(const_reference value) const
{ return tree_.lower_bound(value); }
@@ -788,13 +788,13 @@ class set_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns a const_iterator to the first element whose
- //! key according to the comparison functor is not less than k or
+ //! key according to the comparison functor is not less than k or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
- //!
+ //!
//! <b>Note</b>: This function is used when constructing a value_type
//! is expensive and the value_type can be compared with a cheaper
//! key type. Usually this key is part of the value_type.
@@ -804,9 +804,9 @@ class set_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is greater than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
iterator upper_bound(const_reference value)
{ return tree_.upper_bound(value); }
@@ -816,11 +816,11 @@ class set_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns an iterator to the first element whose
- //! key according to the comparison functor is greater than key or
+ //! key according to the comparison functor is greater than key or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -832,9 +832,9 @@ class set_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is greater than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
const_iterator upper_bound(const_reference value) const
{ return tree_.upper_bound(value); }
@@ -844,11 +844,11 @@ class set_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns a const_iterator to the first element whose
- //! key according to the comparison functor is greater than key or
+ //! key according to the comparison functor is greater than key or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -858,11 +858,11 @@ class set_impl
const_iterator upper_bound(const KeyType& key, KeyValueCompare comp) const
{ return tree_.upper_bound(key, comp); }
- //! <b>Effects</b>: Finds an iterator to the first element whose value is
+ //! <b>Effects</b>: Finds an iterator to the first element whose value is
//! "value" or end() if that element does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
iterator find(const_reference value)
{ return tree_.find(value); }
@@ -871,12 +871,12 @@ class set_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds an iterator to the first element whose key is
- //! "key" according to the comparison functor or end() if that element
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
//! does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -886,11 +886,11 @@ class set_impl
iterator find(const KeyType& key, KeyValueCompare comp)
{ return tree_.find(key, comp); }
- //! <b>Effects</b>: Finds a const_iterator to the first element whose value is
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose value is
//! "value" or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
const_iterator find(const_reference value) const
{ return tree_.find(value); }
@@ -899,12 +899,12 @@ class set_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
- //! "key" according to the comparison functor or end() if that element
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
//! does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -917,9 +917,9 @@ class set_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
std::pair<iterator,iterator> equal_range(const_reference value)
{ return tree_.equal_range(value); }
@@ -928,13 +928,13 @@ class set_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds a range containing all elements whose key is k
- //! according to the comparison functor or an empty range
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
//! that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -947,9 +947,9 @@ class set_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
std::pair<const_iterator, const_iterator>
equal_range(const_reference value) const
@@ -959,13 +959,13 @@ class set_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds a range containing all elements whose key is k
- //! according to the comparison functor or an empty range
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
//! that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -976,16 +976,101 @@ class set_impl
equal_range(const KeyType& key, KeyValueCompare comp) const
{ return tree_.equal_range(key, comp); }
+ //! <b>Requires</b>: 'lower_value' must not be greater than 'upper_value'. If
+ //! 'lower_value' == 'upper_value', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_value and upper_value.
+ std::pair<iterator,iterator> bounded_range
+ (const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed)
+ { return tree_.bounded_range(lower_value, upper_value, left_closed, right_closed); }
+
+ //! <b>Requires</b>: KeyValueCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise
+ //!
+ //! second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator,iterator> bounded_range
+ (const KeyType& lower_key, const KeyType& upper_key, KeyValueCompare comp, bool left_closed, bool right_closed)
+ { return tree_.bounded_range(lower_key, upper_key, comp, left_closed, right_closed); }
+
+ //! <b>Requires</b>: 'lower_value' must not be greater than 'upper_value'. If
+ //! 'lower_value' == 'upper_value', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_value and upper_value.
+ std::pair<const_iterator, const_iterator>
+ bounded_range(const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed) const
+ { return tree_.bounded_range(lower_value, upper_value, left_closed, right_closed); }
+
+ //! <b>Requires</b>: KeyValueCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise
+ //!
+ //! second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<const_iterator, const_iterator>
+ bounded_range
+ (const KeyType& lower_key, const KeyType& upper_key, KeyValueCompare comp, bool left_closed, bool right_closed) const
+ { return tree_.bounded_range(lower_key, upper_key, comp, left_closed, right_closed); }
+
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator i belonging to the set
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
static iterator s_iterator_to(reference value)
@@ -993,14 +1078,14 @@ class set_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
//! set that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
static const_iterator s_iterator_to(const_reference value)
@@ -1008,48 +1093,48 @@ class set_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator i belonging to the set
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator iterator_to(reference value)
{ return tree_.iterator_to(value); }
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
//! set that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator iterator_to(const_reference value) const
{ return tree_.iterator_to(value); }
//! <b>Requires</b>: value shall not be in a set/multiset.
- //!
+ //!
//! <b>Effects</b>: init_node puts the hook of a value in a well-known default
//! state.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Note</b>: This function puts the hook in the well-known default state
//! used by auto_unlink and safe hooks.
static void init_node(reference value)
{ tree_type::init_node(value); }
//! <b>Effects</b>: Unlinks the leftmost node from the tree.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function breaks the tree and the tree can
//! only be used for more unlink_leftmost_without_rebalance calls.
//! This function is normally used to achieve a step by step
@@ -1059,14 +1144,14 @@ class set_impl
//! <b>Requires</b>: replace_this must be a valid iterator of *this
//! and with_this must not be inserted in any tree.
- //!
+ //!
//! <b>Effects</b>: Replaces replace_this in its position in the
//! tree with with_this. The tree does not need to be rebalanced.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! with_this is not equivalent to *replace_this according to the
//! ordering rules. This function is faster than erasing and inserting
@@ -1188,7 +1273,7 @@ class set
>::type
{
typedef typename make_set
- <T,
+ <T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -1240,9 +1325,9 @@ class set
#endif
-//! The class template multiset is an intrusive container, that mimics most of
+//! The class template multiset is an intrusive container, that mimics most of
//! the interface of std::multiset as described in the C++ standard.
-//!
+//!
//! The template parameter \c T is the type to be managed by the container.
//! The user can specify additional options and if no options are provided
//! default options are used.
@@ -1302,30 +1387,30 @@ class multiset_impl
/// @endcond
public:
- //! <b>Effects</b>: Constructs an empty multiset.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //! <b>Effects</b>: Constructs an empty multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
- //! or the copy constructor/operator() of the value_compare object throws.
+ //! or the copy constructor/operator() of the value_compare object throws.
multiset_impl( const value_compare &cmp = value_compare()
- , const value_traits &v_traits = value_traits())
+ , const value_traits &v_traits = value_traits())
: tree_(cmp, v_traits)
{}
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
//! cmp must be a comparison function that induces a strict weak ordering.
- //!
- //! <b>Effects</b>: Constructs an empty multiset and inserts elements from
+ //!
+ //! <b>Effects</b>: Constructs an empty multiset and inserts elements from
//! [b, e).
- //!
+ //!
//! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
//! comp and otherwise N * log N, where N is the distance between first and last
- //!
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
- //! or the copy constructor/operator() of the value_compare object throws.
+ //! or the copy constructor/operator() of the value_compare object throws.
template<class Iterator>
multiset_impl( Iterator b, Iterator e
, const value_compare &cmp = value_compare()
@@ -1334,135 +1419,135 @@ class multiset_impl
{}
//! <b>Effects</b>: to-do
- //!
- multiset_impl(BOOST_RV_REF(multiset_impl) x)
+ //!
+ multiset_impl(BOOST_RV_REF(multiset_impl) x)
: tree_(::boost::move(x.tree_))
{}
//! <b>Effects</b>: to-do
- //!
- multiset_impl& operator=(BOOST_RV_REF(multiset_impl) x)
+ //!
+ multiset_impl& operator=(BOOST_RV_REF(multiset_impl) x)
{ tree_ = ::boost::move(x.tree_); return *this; }
- //! <b>Effects</b>: Detaches all elements from this. The objects in the set
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the set
//! are not deleted (i.e. no destructors are called).
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- ~multiset_impl()
+ ~multiset_impl()
{}
//! <b>Effects</b>: Returns an iterator pointing to the beginning of the multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator begin()
{ return tree_.begin(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator begin() const
{ return tree_.begin(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cbegin() const
{ return tree_.cbegin(); }
//! <b>Effects</b>: Returns an iterator pointing to the end of the multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator end()
{ return tree_.end(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator end() const
{ return tree_.end(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cend() const
{ return tree_.cend(); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning of the
//! reversed multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rbegin()
{ return tree_.rbegin(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rbegin() const
{ return tree_.rbegin(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crbegin() const
{ return tree_.crbegin(); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the end
//! of the reversed multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rend()
{ return tree_.rend(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rend() const
{ return tree_.rend(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crend() const
{ return tree_.crend(); }
//! <b>Precondition</b>: end_iterator must be a valid end iterator
//! of multiset.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the multiset associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static multiset_impl &container_from_end_iterator(iterator end_iterator)
{
@@ -1473,11 +1558,11 @@ class multiset_impl
//! <b>Precondition</b>: end_iterator must be a valid end const_iterator
//! of multiset.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the multiset associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static const multiset_impl &container_from_end_iterator(const_iterator end_iterator)
{
@@ -1487,11 +1572,11 @@ class multiset_impl
}
//! <b>Precondition</b>: it must be a valid iterator of multiset.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the multiset associated to the iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
static multiset_impl &container_from_iterator(iterator it)
{
@@ -1501,11 +1586,11 @@ class multiset_impl
}
//! <b>Precondition</b>: it must be a valid const_iterator of multiset.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the multiset associated to the iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
static const multiset_impl &container_from_iterator(const_iterator it)
{
@@ -1515,42 +1600,42 @@ class multiset_impl
}
//! <b>Effects</b>: Returns the key_compare object used by the multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If key_compare copy-constructor throws.
key_compare key_comp() const
{ return tree_.value_comp(); }
//! <b>Effects</b>: Returns the value_compare object used by the multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If value_compare copy-constructor throws.
value_compare value_comp() const
{ return tree_.value_comp(); }
//! <b>Effects</b>: Returns true if the container is empty.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
bool empty() const
{ return tree_.empty(); }
//! <b>Effects</b>: Returns the number of elements stored in the multiset.
- //!
+ //!
//! <b>Complexity</b>: Linear to elements contained in *this if,
//! constant-time size option is enabled. Constant-time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
size_type size() const
{ return tree_.size(); }
//! <b>Effects</b>: Swaps the contents of two multisets.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If the swap() call for the comparison functor
//! found using ADL throws. Strong guarantee.
void swap(multiset_impl& other)
@@ -1560,69 +1645,69 @@ class multiset_impl
//! Cloner should yield to nodes equivalent to the original nodes.
//!
//! <b>Effects</b>: Erases all the elements from *this
- //! calling Disposer::operator()(pointer), clones all the
+ //! calling Disposer::operator()(pointer), clones all the
//! elements from src calling Cloner::operator()(const_reference )
//! and inserts them on *this. Copies the predicate from the source container.
//!
//! If cloner throws, all cloned elements are unlinked and disposed
//! calling Disposer::operator()(pointer).
- //!
+ //!
//! <b>Complexity</b>: Linear to erased plus inserted elements.
- //!
+ //!
//! <b>Throws</b>: If cloner throws or predicate copy assignment throws. Basic guarantee.
template <class Cloner, class Disposer>
void clone_from(const multiset_impl &src, Cloner cloner, Disposer disposer)
{ tree_.clone_from(src.tree_, cloner, disposer); }
//! <b>Requires</b>: value must be an lvalue
- //!
+ //!
//! <b>Effects</b>: Inserts value into the multiset.
- //!
+ //!
//! <b>Returns</b>: An iterator that points to the position where the new
//! element was inserted.
- //!
+ //!
//! <b>Complexity</b>: Average complexity for insert element is at
//! most logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
iterator insert(reference value)
{ return tree_.insert_equal(value); }
//! <b>Requires</b>: value must be an lvalue
- //!
+ //!
//! <b>Effects</b>: Inserts x into the multiset, using pos as a hint to
//! where it will be inserted.
- //!
+ //!
//! <b>Returns</b>: An iterator that points to the position where the new
//! element was inserted.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic in general, but it is amortized
//! constant time if t is inserted immediately before hint.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
iterator insert(const_iterator hint, reference value)
{ return tree_.insert_equal(hint, value); }
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
//! of type value_type.
- //!
+ //!
//! <b>Effects</b>: Inserts a range into the multiset.
- //!
+ //!
//! <b>Returns</b>: An iterator that points to the position where the new
//! element was inserted.
- //!
+ //!
//! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
//! size of the range. However, it is linear in N if the range is already sorted
//! by value_comp().
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
template<class Iterator>
@@ -1634,11 +1719,11 @@ class multiset_impl
//! once inserted according to the predicate
//!
//! <b>Effects</b>: Inserts x into the tree before "pos".
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if "pos" is not
//! the successor of "value" tree ordering invariant will be broken.
//! This is a low-level function to be used only for performance reasons
@@ -1650,11 +1735,11 @@ class multiset_impl
//! than the greatest inserted key
//!
//! <b>Effects</b>: Inserts x into the tree in the last position.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if value is
//! less than the greatest inserted key tree ordering invariant will be broken.
//! This function is slightly more efficient than using "insert_before".
@@ -1667,11 +1752,11 @@ class multiset_impl
//! than the minimum inserted key
//!
//! <b>Effects</b>: Inserts x into the tree in the first position.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if value is
//! greater than the minimum inserted key tree ordering invariant will be broken.
//! This function is slightly more efficient than using "insert_before".
@@ -1680,41 +1765,41 @@ class multiset_impl
void push_front(reference value)
{ tree_.push_front(value); }
- //! <b>Effects</b>: Erases the element pointed to by pos.
- //!
- //! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
//! <b>Returns</b>: An iterator to the element after the erased element.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
iterator erase(const_iterator i)
{ return tree_.erase(i); }
- //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
//!
//! <b>Returns</b>: An iterator to the element after the erased elements.
- //!
- //! <b>Complexity</b>: Average complexity for erase range is at most
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
//! O(log(size() + N)), where N is the number of elements in the range.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
iterator erase(const_iterator b, iterator e)
{ return tree_.erase(b, e); }
//! <b>Effects</b>: Erases all the elements with the given value.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + this->count(value)).
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
size_type erase(const_reference value)
@@ -1722,13 +1807,13 @@ class multiset_impl
//! <b>Effects</b>: Erases all the elements that compare equal with
//! the given key and the given comparison functor.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + this->count(key, comp)).
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class KeyType, class KeyValueCompare>
@@ -1743,14 +1828,14 @@ class multiset_impl
//!
//! <b>Returns</b>: An iterator to the element after the erased element.
//!
- //! <b>Effects</b>: Erases the element pointed to by pos.
+ //! <b>Effects</b>: Erases the element pointed to by pos.
//! Disposer::operator()(pointer) is called for the removed element.
- //!
- //! <b>Complexity</b>: Average complexity for erase element is constant time.
- //!
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
//! <b>Throws</b>: Nothing.
- //!
- //! <b>Note</b>: Invalidates the iterators
+ //!
+ //! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
iterator erase_and_dispose(const_iterator i, Disposer disposer)
@@ -1768,12 +1853,12 @@ class multiset_impl
//!
//! <b>Effects</b>: Erases the range pointed to by b end e.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
- //! <b>Complexity</b>: Average complexity for erase range is at most
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
//! O(log(size() + N)), where N is the number of elements in the range.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
@@ -1784,13 +1869,13 @@ class multiset_impl
//!
//! <b>Effects</b>: Erases all the elements with the given value.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + this->count(value)).
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class Disposer>
@@ -1804,11 +1889,11 @@ class multiset_impl
//! Disposer::operator()(pointer) is called for the removed elements.
//!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + this->count(key, comp)).
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class KeyType, class KeyValueCompare, class Disposer>
@@ -1820,26 +1905,26 @@ class multiset_impl
{ return tree_.erase_and_dispose(key, comp, disposer); }
//! <b>Effects</b>: Erases all the elements of the container.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
void clear()
{ return tree_.clear(); }
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
- //!
+ //!
//! <b>Effects</b>: Erases all the elements of the container.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class Disposer>
@@ -1847,20 +1932,20 @@ class multiset_impl
{ return tree_.clear_and_dispose(disposer); }
//! <b>Effects</b>: Returns the number of contained elements with the given key
- //!
+ //!
//! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
//! to number of objects with the given key.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
size_type count(const_reference value) const
{ return tree_.count(value); }
//! <b>Effects</b>: Returns the number of contained elements with the same key
//! compared with the given comparison functor.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
//! to number of objects with the given key.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
template<class KeyType, class KeyValueCompare>
size_type count(const KeyType& key, KeyValueCompare comp) const
@@ -1868,9 +1953,9 @@ class multiset_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
iterator lower_bound(const_reference value)
{ return tree_.lower_bound(value); }
@@ -1880,13 +1965,13 @@ class multiset_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns an iterator to the first element whose
- //! key according to the comparison functor is not less than k or
+ //! key according to the comparison functor is not less than k or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
- //!
+ //!
//! <b>Note</b>: This function is used when constructing a value_type
//! is expensive and the value_type can be compared with a cheaper
//! key type. Usually this key is part of the value_type.
@@ -1896,9 +1981,9 @@ class multiset_impl
//! <b>Effects</b>: Returns a const iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
const_iterator lower_bound(const_reference value) const
{ return tree_.lower_bound(value); }
@@ -1908,13 +1993,13 @@ class multiset_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns a const_iterator to the first element whose
- //! key according to the comparison functor is not less than k or
+ //! key according to the comparison functor is not less than k or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
- //!
+ //!
//! <b>Note</b>: This function is used when constructing a value_type
//! is expensive and the value_type can be compared with a cheaper
//! key type. Usually this key is part of the value_type.
@@ -1924,9 +2009,9 @@ class multiset_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is greater than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
iterator upper_bound(const_reference value)
{ return tree_.upper_bound(value); }
@@ -1936,11 +2021,11 @@ class multiset_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns an iterator to the first element whose
- //! key according to the comparison functor is greater than key or
+ //! key according to the comparison functor is greater than key or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -1952,9 +2037,9 @@ class multiset_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is greater than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
const_iterator upper_bound(const_reference value) const
{ return tree_.upper_bound(value); }
@@ -1964,11 +2049,11 @@ class multiset_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns a const_iterator to the first element whose
- //! key according to the comparison functor is greater than key or
+ //! key according to the comparison functor is greater than key or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -1978,11 +2063,11 @@ class multiset_impl
const_iterator upper_bound(const KeyType& key, KeyValueCompare comp) const
{ return tree_.upper_bound(key, comp); }
- //! <b>Effects</b>: Finds an iterator to the first element whose value is
+ //! <b>Effects</b>: Finds an iterator to the first element whose value is
//! "value" or end() if that element does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
iterator find(const_reference value)
{ return tree_.find(value); }
@@ -1991,12 +2076,12 @@ class multiset_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds an iterator to the first element whose key is
- //! "key" according to the comparison functor or end() if that element
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
//! does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -2006,11 +2091,11 @@ class multiset_impl
iterator find(const KeyType& key, KeyValueCompare comp)
{ return tree_.find(key, comp); }
- //! <b>Effects</b>: Finds a const_iterator to the first element whose value is
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose value is
//! "value" or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
const_iterator find(const_reference value) const
{ return tree_.find(value); }
@@ -2019,12 +2104,12 @@ class multiset_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
- //! "key" according to the comparison functor or end() if that element
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
//! does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -2037,9 +2122,9 @@ class multiset_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
std::pair<iterator,iterator> equal_range(const_reference value)
{ return tree_.equal_range(value); }
@@ -2048,13 +2133,13 @@ class multiset_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds a range containing all elements whose key is k
- //! according to the comparison functor or an empty range
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
//! that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -2067,9 +2152,9 @@ class multiset_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
std::pair<const_iterator, const_iterator>
equal_range(const_reference value) const
@@ -2079,13 +2164,13 @@ class multiset_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds a range containing all elements whose key is k
- //! according to the comparison functor or an empty range
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
//! that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -2096,16 +2181,101 @@ class multiset_impl
equal_range(const KeyType& key, KeyValueCompare comp) const
{ return tree_.equal_range(key, comp); }
+ //! <b>Requires</b>: 'lower_value' must not be greater than 'upper_value'. If
+ //! 'lower_value' == 'upper_value', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_value and upper_value.
+ std::pair<iterator,iterator> bounded_range
+ (const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed)
+ { return tree_.bounded_range(lower_value, upper_value, left_closed, right_closed); }
+
+ //! <b>Requires</b>: KeyValueCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise
+ //!
+ //! second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator,iterator> bounded_range
+ (const KeyType& lower_key, const KeyType& upper_key, KeyValueCompare comp, bool left_closed, bool right_closed)
+ { return tree_.bounded_range(lower_key, upper_key, comp, left_closed, right_closed); }
+
+ //! <b>Requires</b>: 'lower_value' must not be greater than 'upper_value'. If
+ //! 'lower_value' == 'upper_value', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_value and upper_value.
+ std::pair<const_iterator, const_iterator>
+ bounded_range(const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed) const
+ { return tree_.bounded_range(lower_value, upper_value, left_closed, right_closed); }
+
+ //! <b>Requires</b>: KeyValueCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise
+ //!
+ //! second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<const_iterator, const_iterator>
+ bounded_range
+ (const KeyType& lower_key, const KeyType& upper_key, KeyValueCompare comp, bool left_closed, bool right_closed) const
+ { return tree_.bounded_range(lower_key, upper_key, comp, left_closed, right_closed); }
+
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator i belonging to the set
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
static iterator s_iterator_to(reference value)
@@ -2113,14 +2283,14 @@ class multiset_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
//! set that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
static const_iterator s_iterator_to(const_reference value)
@@ -2128,48 +2298,48 @@ class multiset_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator i belonging to the set
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator iterator_to(reference value)
{ return tree_.iterator_to(value); }
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
//! set that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator iterator_to(const_reference value) const
{ return tree_.iterator_to(value); }
//! <b>Requires</b>: value shall not be in a set/multiset.
- //!
+ //!
//! <b>Effects</b>: init_node puts the hook of a value in a well-known default
//! state.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Note</b>: This function puts the hook in the well-known default state
//! used by auto_unlink and safe hooks.
static void init_node(reference value)
{ tree_type::init_node(value); }
//! <b>Effects</b>: Unlinks the leftmost node from the tree.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function breaks the tree and the tree can
//! only be used for more unlink_leftmost_without_rebalance calls.
//! This function is normally used to achieve a step by step
@@ -2179,14 +2349,14 @@ class multiset_impl
//! <b>Requires</b>: replace_this must be a valid iterator of *this
//! and with_this must not be inserted in any tree.
- //!
+ //!
//! <b>Effects</b>: Replaces replace_this in its position in the
//! tree with with_this. The tree does not need to be rebalanced.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! with_this is not equivalent to *replace_this according to the
//! ordering rules. This function is faster than erasing and inserting
@@ -2195,11 +2365,11 @@ class multiset_impl
{ tree_.replace_node(replace_this, with_this); }
//! <b>Effects</b>: removes "value" from the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic time.
- //!
+ //!
//! <b>Note</b>: This static function is only usable with non-constant
//! time size containers that have stateless comparison functors.
//!
@@ -2323,14 +2493,14 @@ class multiset
#endif
>::type
{
- typedef typename make_multiset<T,
+ typedef typename make_multiset<T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
Options...
#endif
>::type Base;
-
+
BOOST_MOVABLE_BUT_NOT_COPYABLE(multiset)
public:
@@ -2376,8 +2546,8 @@ class multiset
#endif
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/set_hook.hpp b/boost/intrusive/set_hook.hpp
index 35746a29a5..2634b42eef 100644
--- a/boost/intrusive/set_hook.hpp
+++ b/boost/intrusive/set_hook.hpp
@@ -1,7 +1,7 @@
/////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -44,7 +44,7 @@ struct make_set_base_hook
{
/// @cond
typedef typename pack_options
- < hook_defaults,
+ < hook_defaults,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -63,16 +63,16 @@ struct make_set_base_hook
typedef implementation_defined type;
};
-//! Derive a class from set_base_hook in order to store objects in
-//! in a set/multiset. set_base_hook holds the data necessary to maintain
+//! Derive a class from set_base_hook in order to store objects in
+//! in a set/multiset. set_base_hook holds the data necessary to maintain
//! the set/multiset and provides an appropriate value_traits class for set/multiset.
-//!
+//!
//! The hook admits the following options: \c tag<>, \c void_pointer<>,
//! \c link_mode<> and \c optimize_size<>.
//!
-//! \c tag<> defines a tag to identify the node.
-//! The same tag value can be used in different classes, but if a class is
-//! derived from more than one \c list_base_hook, then each \c list_base_hook needs its
+//! \c tag<> defines a tag to identify the node.
+//! The same tag value can be used in different classes, but if a class is
+//! derived from more than one \c list_base_hook, then each \c list_base_hook needs its
//! unique tag.
//!
//! \c void_pointer<> is the pointer type that will be used internally in the hook
@@ -101,27 +101,27 @@ class set_base_hook
public:
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
set_base_hook();
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state. The argument is ignored.
- //!
- //! <b>Throws</b>: Nothing.
- //!
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
//! <b>Rationale</b>: Providing a copy-constructor
- //! makes classes using the hook STL-compliant without forcing the
+ //! makes classes using the hook STL-compliant without forcing the
//! user to do some additional work. \c swap can be used to emulate
//! move-semantics.
set_base_hook(const set_base_hook& );
//! <b>Effects</b>: Empty function. The argument is ignored.
- //!
- //! <b>Throws</b>: Nothing.
- //!
- //! <b>Rationale</b>: Providing an assignment operator
- //! makes classes using the hook STL-compliant without forcing the
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing an assignment operator
+ //! makes classes using the hook STL-compliant without forcing the
//! user to do some additional work. \c swap can be used to emulate
//! move-semantics.
set_base_hook& operator=(const set_base_hook& );
@@ -130,37 +130,37 @@ class set_base_hook
//! nothing (ie. no code is generated). If link_mode is \c safe_link and the
//! object is stored in a set an assertion is raised. If link_mode is
//! \c auto_unlink and \c is_linked() is true, the node is unlinked.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
~set_base_hook();
- //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
- //! related to those nodes in one or two containers. That is, if the node
- //! this is part of the element e1, the node x is part of the element e2
- //! and both elements are included in the containers s1 and s2, then after
- //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
- //! at the position of e1. If one element is not in a container, then
- //! after the swap-operation the other element is not in a container.
- //! Iterators to e1 and e2 related to those nodes are invalidated.
+ //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
+ //! related to those nodes in one or two containers. That is, if the node
+ //! this is part of the element e1, the node x is part of the element e2
+ //! and both elements are included in the containers s1 and s2, then after
+ //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
+ //! at the position of e1. If one element is not in a container, then
+ //! after the swap-operation the other element is not in a container.
+ //! Iterators to e1 and e2 related to those nodes are invalidated.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Constant
//!
- //! <b>Throws</b>: Nothing.
+ //! <b>Throws</b>: Nothing.
void swap_nodes(set_base_hook &other);
//! <b>Precondition</b>: link_mode must be \c safe_link or \c auto_unlink.
//!
//! <b>Returns</b>: true, if the node belongs to a container, false
- //! otherwise. This function can be used to test whether \c set::iterator_to
- //! will return a valid iterator.
+ //! otherwise. This function can be used to test whether \c set::iterator_to
+ //! will return a valid iterator.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Constant
bool is_linked() const;
//! <b>Effects</b>: Removes the node if it's inserted in a container.
//! This function is only allowed if link_mode is \c auto_unlink.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
void unlink();
#endif
};
@@ -176,7 +176,7 @@ struct make_set_member_hook
{
/// @cond
typedef typename pack_options
- < hook_defaults,
+ < hook_defaults,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -198,7 +198,7 @@ struct make_set_member_hook
//! Put a public data member set_member_hook in order to store objects of this class in
//! a set/multiset. set_member_hook holds the data necessary for maintaining the
//! set/multiset and provides an appropriate value_traits class for set/multiset.
-//!
+//!
//! The hook admits the following options: \c void_pointer<>,
//! \c link_mode<> and \c optimize_size<>.
//!
@@ -228,27 +228,27 @@ class set_member_hook
public:
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
set_member_hook();
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state. The argument is ignored.
- //!
- //! <b>Throws</b>: Nothing.
- //!
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
//! <b>Rationale</b>: Providing a copy-constructor
- //! makes classes using the hook STL-compliant without forcing the
+ //! makes classes using the hook STL-compliant without forcing the
//! user to do some additional work. \c swap can be used to emulate
//! move-semantics.
set_member_hook(const set_member_hook& );
//! <b>Effects</b>: Empty function. The argument is ignored.
- //!
- //! <b>Throws</b>: Nothing.
- //!
- //! <b>Rationale</b>: Providing an assignment operator
- //! makes classes using the hook STL-compliant without forcing the
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing an assignment operator
+ //! makes classes using the hook STL-compliant without forcing the
//! user to do some additional work. \c swap can be used to emulate
//! move-semantics.
set_member_hook& operator=(const set_member_hook& );
@@ -257,43 +257,43 @@ class set_member_hook
//! nothing (ie. no code is generated). If link_mode is \c safe_link and the
//! object is stored in a set an assertion is raised. If link_mode is
//! \c auto_unlink and \c is_linked() is true, the node is unlinked.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
~set_member_hook();
- //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
- //! related to those nodes in one or two containers. That is, if the node
- //! this is part of the element e1, the node x is part of the element e2
- //! and both elements are included in the containers s1 and s2, then after
- //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
- //! at the position of e1. If one element is not in a container, then
- //! after the swap-operation the other element is not in a container.
- //! Iterators to e1 and e2 related to those nodes are invalidated.
+ //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
+ //! related to those nodes in one or two containers. That is, if the node
+ //! this is part of the element e1, the node x is part of the element e2
+ //! and both elements are included in the containers s1 and s2, then after
+ //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
+ //! at the position of e1. If one element is not in a container, then
+ //! after the swap-operation the other element is not in a container.
+ //! Iterators to e1 and e2 related to those nodes are invalidated.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Constant
//!
- //! <b>Throws</b>: Nothing.
+ //! <b>Throws</b>: Nothing.
void swap_nodes(set_member_hook &other);
//! <b>Precondition</b>: link_mode must be \c safe_link or \c auto_unlink.
//!
//! <b>Returns</b>: true, if the node belongs to a container, false
- //! otherwise. This function can be used to test whether \c set::iterator_to
- //! will return a valid iterator.
+ //! otherwise. This function can be used to test whether \c set::iterator_to
+ //! will return a valid iterator.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Constant
bool is_linked() const;
//! <b>Effects</b>: Removes the node if it's inserted in a container.
//! This function is only allowed if link_mode is \c auto_unlink.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
void unlink();
#endif
};
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/sg_set.hpp b/boost/intrusive/sg_set.hpp
index fb59496ee1..9b020cc221 100644
--- a/boost/intrusive/sg_set.hpp
+++ b/boost/intrusive/sg_set.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2007-2009
+// (C) Copyright Ion Gaztanaga 2007-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -22,9 +22,9 @@
namespace boost {
namespace intrusive {
-//! The class template sg_set is an intrusive container, that mimics most of
+//! The class template sg_set is an intrusive container, that mimics most of
//! the interface of std::set as described in the C++ standard.
-//!
+//!
//! The template parameter \c T is the type to be managed by the container.
//! The user can specify additional options and if no options are provided
//! default options are used.
@@ -77,30 +77,30 @@ class sg_set_impl
/// @endcond
public:
- //! <b>Effects</b>: Constructs an empty sg_set.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //! <b>Effects</b>: Constructs an empty sg_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
- //! or the copy constructor of the value_compare object throws.
+ //! or the copy constructor of the value_compare object throws.
sg_set_impl( const value_compare &cmp = value_compare()
- , const value_traits &v_traits = value_traits())
+ , const value_traits &v_traits = value_traits())
: tree_(cmp, v_traits)
{}
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
//! cmp must be a comparison function that induces a strict weak ordering.
- //!
- //! <b>Effects</b>: Constructs an empty sg_set and inserts elements from
+ //!
+ //! <b>Effects</b>: Constructs an empty sg_set and inserts elements from
//! [b, e).
- //!
- //! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
+ //!
+ //! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
//! comp and otherwise N * log N, where N is std::distance(last, first).
- //!
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
- //! or the copy constructor/operator() of the value_compare object throws.
+ //! or the copy constructor/operator() of the value_compare object throws.
template<class Iterator>
sg_set_impl( Iterator b, Iterator e
, const value_compare &cmp = value_compare()
@@ -109,135 +109,135 @@ class sg_set_impl
{}
//! <b>Effects</b>: to-do
- //!
- sg_set_impl(BOOST_RV_REF(sg_set_impl) x)
+ //!
+ sg_set_impl(BOOST_RV_REF(sg_set_impl) x)
: tree_(::boost::move(x.tree_))
{}
//! <b>Effects</b>: to-do
- //!
- sg_set_impl& operator=(BOOST_RV_REF(sg_set_impl) x)
+ //!
+ sg_set_impl& operator=(BOOST_RV_REF(sg_set_impl) x)
{ tree_ = ::boost::move(x.tree_); return *this; }
- //! <b>Effects</b>: Detaches all elements from this. The objects in the sg_set
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the sg_set
//! are not deleted (i.e. no destructors are called).
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- ~sg_set_impl()
+ ~sg_set_impl()
{}
//! <b>Effects</b>: Returns an iterator pointing to the beginning of the sg_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator begin()
{ return tree_.begin(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the sg_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator begin() const
{ return tree_.begin(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the sg_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cbegin() const
{ return tree_.cbegin(); }
//! <b>Effects</b>: Returns an iterator pointing to the end of the sg_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator end()
{ return tree_.end(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the sg_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator end() const
{ return tree_.end(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the sg_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cend() const
{ return tree_.cend(); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning of the
//! reversed sg_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rbegin()
{ return tree_.rbegin(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed sg_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rbegin() const
{ return tree_.rbegin(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed sg_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crbegin() const
{ return tree_.crbegin(); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the end
//! of the reversed sg_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rend()
{ return tree_.rend(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed sg_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rend() const
{ return tree_.rend(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed sg_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crend() const
{ return tree_.crend(); }
//! <b>Precondition</b>: end_iterator must be a valid end iterator
//! of sg_set.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the sg_set associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static sg_set_impl &container_from_end_iterator(iterator end_iterator)
{
@@ -248,11 +248,11 @@ class sg_set_impl
//! <b>Precondition</b>: end_iterator must be a valid end const_iterator
//! of sg_set.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the sg_set associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static const sg_set_impl &container_from_end_iterator(const_iterator end_iterator)
{
@@ -262,11 +262,11 @@ class sg_set_impl
}
//! <b>Precondition</b>: it must be a valid iterator of set.
- //!
+ //!
//! <b>Effects</b>: Returns a reference to the set associated to the iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
static sg_set_impl &container_from_iterator(iterator it)
{
@@ -276,11 +276,11 @@ class sg_set_impl
}
//! <b>Precondition</b>: it must be a valid const_iterator of set.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the set associated to the iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
static const sg_set_impl &container_from_iterator(const_iterator it)
{
@@ -290,42 +290,42 @@ class sg_set_impl
}
//! <b>Effects</b>: Returns the key_compare object used by the sg_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If key_compare copy-constructor throws.
key_compare key_comp() const
{ return tree_.value_comp(); }
//! <b>Effects</b>: Returns the value_compare object used by the sg_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If value_compare copy-constructor throws.
value_compare value_comp() const
{ return tree_.value_comp(); }
//! <b>Effects</b>: Returns true if the container is empty.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
bool empty() const
{ return tree_.empty(); }
//! <b>Effects</b>: Returns the number of elements stored in the sg_set.
- //!
+ //!
//! <b>Complexity</b>: Linear to elements contained in *this if,
//! constant-time size option is enabled. Constant-time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
size_type size() const
{ return tree_.size(); }
//! <b>Effects</b>: Swaps the contents of two sets.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If the swap() call for the comparison functor
//! found using ADL throws. Strong guarantee.
void swap(sg_set_impl& other)
@@ -335,22 +335,22 @@ class sg_set_impl
//! Cloner should yield to nodes equivalent to the original nodes.
//!
//! <b>Effects</b>: Erases all the elements from *this
- //! calling Disposer::operator()(pointer), clones all the
+ //! calling Disposer::operator()(pointer), clones all the
//! elements from src calling Cloner::operator()(const_reference )
//! and inserts them on *this. Copies the predicate from the source container.
//!
//! If cloner throws, all cloned elements are unlinked and disposed
//! calling Disposer::operator()(pointer).
- //!
+ //!
//! <b>Complexity</b>: Linear to erased plus inserted elements.
- //!
+ //!
//! <b>Throws</b>: If cloner throws or predicate copy assignment throws. Basic guarantee.
template <class Cloner, class Disposer>
void clone_from(const sg_set_impl &src, Cloner cloner, Disposer disposer)
{ tree_.clone_from(src.tree_, cloner, disposer); }
//! <b>Requires</b>: value must be an lvalue
- //!
+ //!
//! <b>Effects</b>: Tries to inserts value into the sg_set.
//!
//! <b>Returns</b>: If the value
@@ -358,39 +358,39 @@ class sg_set_impl
//! iterator to the new value and true. If there is an equivalent value
//! returns a pair containing an iterator to the already present value
//! and false.
- //!
+ //!
//! <b>Complexity</b>: Average complexity for insert element is at
//! most logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
std::pair<iterator, bool> insert(reference value)
{ return tree_.insert_unique(value); }
//! <b>Requires</b>: value must be an lvalue
- //!
- //! <b>Effects</b>: Tries to to insert x into the sg_set, using "hint"
+ //!
+ //! <b>Effects</b>: Tries to to insert x into the sg_set, using "hint"
//! as a hint to where it will be inserted.
//!
- //! <b>Returns</b>: An iterator that points to the position where the
+ //! <b>Returns</b>: An iterator that points to the position where the
//! new element was inserted into the sg_set.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic in general, but it's amortized
//! constant time if t is inserted immediately before hint.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
iterator insert(const_iterator hint, reference value)
{ return tree_.insert_unique(hint, value); }
- //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
//! the same strict weak ordering as value_compare. The difference is that
//! key_value_comp compares an arbitrary key with the contained values.
- //!
+ //!
//! <b>Effects</b>: Checks if a value can be inserted in the sg_set, using
//! a user provided key instead of the value itself.
//!
@@ -399,16 +399,16 @@ class sg_set_impl
//! and false. If the value can be inserted returns true in the returned
//! pair boolean and fills "commit_data" that is meant to be used with
//! the "insert_commit" function.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is at most logarithmic.
//!
//! <b>Throws</b>: If the key_value_comp ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Notes</b>: This function is used to improve performance when constructing
//! a value_type is expensive: if there is an equivalent value
//! the constructed object must be discarded. Many times, the part of the
//! node that is used to impose the order is much cheaper to construct
- //! than the value_type and this function offers the possibility to use that
+ //! than the value_type and this function offers the possibility to use that
//! part to check if the insertion will be successful.
//!
//! If the check is successful, the user can construct the value_type and use
@@ -422,12 +422,12 @@ class sg_set_impl
(const KeyType &key, KeyValueCompare key_value_comp, insert_commit_data &commit_data)
{ return tree_.insert_unique_check(key, key_value_comp, commit_data); }
- //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
//! the same strict weak ordering as value_compare. The difference is that
//! key_value_comp compares an arbitrary key with the contained values.
- //!
+ //!
//! <b>Effects</b>: Checks if a value can be inserted in the sg_set, using
- //! a user provided key instead of the value itself, using "hint"
+ //! a user provided key instead of the value itself, using "hint"
//! as a hint to where it will be inserted.
//!
//! <b>Returns</b>: If there is an equivalent value
@@ -435,23 +435,23 @@ class sg_set_impl
//! and false. If the value can be inserted returns true in the returned
//! pair boolean and fills "commit_data" that is meant to be used with
//! the "insert_commit" function.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic in general, but it's amortized
//! constant time if t is inserted immediately before hint.
//!
//! <b>Throws</b>: If the key_value_comp ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Notes</b>: This function is used to improve performance when constructing
//! a value_type is expensive: if there is an equivalent value
//! the constructed object must be discarded. Many times, the part of the
//! constructing that is used to impose the order is much cheaper to construct
- //! than the value_type and this function offers the possibility to use that key
+ //! than the value_type and this function offers the possibility to use that key
//! to check if the insertion will be successful.
//!
//! If the check is successful, the user can construct the value_type and use
//! "insert_commit" to insert the object in constant-time. This can give a total
//! constant-time complexity to the insertion: check(O(1)) + commit(O(1)).
- //!
+ //!
//! "commit_data" remains valid for a subsequent "insert_commit" only if no more
//! objects are inserted or erased from the sg_set.
template<class KeyType, class KeyValueCompare>
@@ -464,33 +464,33 @@ class sg_set_impl
//! must have been obtained from a previous call to "insert_check".
//! No objects should have been inserted or erased from the sg_set between
//! the "insert_check" that filled "commit_data" and the call to "insert_commit".
- //!
+ //!
//! <b>Effects</b>: Inserts the value in the sg_set using the information obtained
//! from the "commit_data" that a previous "insert_check" filled.
//!
//! <b>Returns</b>: An iterator to the newly inserted object.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function has only sense if a "insert_check" has been
//! previously executed to fill "commit_data". No value should be inserted or
//! erased between the "insert_check" and "insert_commit" calls.
iterator insert_commit(reference value, const insert_commit_data &commit_data)
{ return tree_.insert_unique_commit(value, commit_data); }
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
//! of type value_type.
- //!
+ //!
//! <b>Effects</b>: Inserts a range into the sg_set.
- //!
+ //!
//! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
//! size of the range. However, it is linear in N if the range is already sorted
//! by value_comp().
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
template<class Iterator>
@@ -503,11 +503,11 @@ class sg_set_impl
//! inserted key according to the predicate.
//!
//! <b>Effects</b>: Inserts x into the tree before "pos".
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if "pos" is not
//! the successor of "value" or "value" is not unique tree ordering and uniqueness
//! invariants will be broken respectively.
@@ -520,11 +520,11 @@ class sg_set_impl
//! any inserted key according to the predicate.
//!
//! <b>Effects</b>: Inserts x into the tree in the last position.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if value is
//! less than or equal to the greatest inserted key tree ordering invariant will be broken.
//! This function is slightly more efficient than using "insert_before".
@@ -537,11 +537,11 @@ class sg_set_impl
//! than any inserted key according to the predicate.
//!
//! <b>Effects</b>: Inserts x into the tree in the first position.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if value is
//! greater than or equal to the the mimum inserted key tree ordering or uniqueness
//! invariants will be broken.
@@ -551,41 +551,41 @@ class sg_set_impl
void push_front(reference value)
{ tree_.push_front(value); }
- //! <b>Effects</b>: Erases the element pointed to by pos.
- //!
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //!
//! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //!
//! <b>Returns</b>: An iterator to the element after the erased element.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
iterator erase(const_iterator i)
{ return tree_.erase(i); }
- //! <b>Effects</b>: Erases the range pointed to by b end e.
- //!
- //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
//! O(log(size() + N)), where N is the number of elements in the range.
- //!
+ //!
//! <b>Returns</b>: An iterator to the element after the erased elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
iterator erase(const_iterator b, const_iterator e)
{ return tree_.erase(b, e); }
//! <b>Effects</b>: Erases all the elements with the given value.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size()) + this->count(value)).
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
size_type erase(const_reference value)
@@ -593,13 +593,13 @@ class sg_set_impl
//! <b>Effects</b>: Erases all the elements that compare equal with
//! the given key and the given comparison functor.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + this->count(key, comp)).
- //!
+ //!
//! <b>Throws</b>: If the comp ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class KeyType, class KeyValueCompare>
@@ -612,16 +612,16 @@ class sg_set_impl
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//!
- //! <b>Effects</b>: Erases the element pointed to by pos.
+ //! <b>Effects</b>: Erases the element pointed to by pos.
//! Disposer::operator()(pointer) is called for the removed element.
- //!
- //! <b>Complexity</b>: Average complexity for erase element is constant time.
- //!
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
//! <b>Returns</b>: An iterator to the element after the erased element.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
- //! <b>Note</b>: Invalidates the iterators
+ //!
+ //! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
iterator erase_and_dispose(const_iterator i, Disposer disposer)
@@ -637,14 +637,14 @@ class sg_set_impl
//!
//! <b>Effects</b>: Erases the range pointed to by b end e.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
- //! <b>Complexity</b>: Average complexity for erase range is at most
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
//! O(log(size() + N)), where N is the number of elements in the range.
- //!
+ //!
//! <b>Returns</b>: An iterator to the element after the erased elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
@@ -655,13 +655,13 @@ class sg_set_impl
//!
//! <b>Effects</b>: Erases all the elements with the given value.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + this->count(value)). Basic guarantee.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class Disposer>
@@ -675,11 +675,11 @@ class sg_set_impl
//! Disposer::operator()(pointer) is called for the removed elements.
//!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + this->count(key, comp)).
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class KeyType, class KeyValueCompare, class Disposer>
@@ -691,26 +691,26 @@ class sg_set_impl
{ return tree_.erase_and_dispose(key, comp, disposer); }
//! <b>Effects</b>: Erases all the elements of the container.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
void clear()
{ return tree_.clear(); }
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
- //!
+ //!
//! <b>Effects</b>: Erases all the elements of the container.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class Disposer>
@@ -718,20 +718,20 @@ class sg_set_impl
{ return tree_.clear_and_dispose(disposer); }
//! <b>Effects</b>: Returns the number of contained elements with the given key
- //!
+ //!
//! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
//! to number of objects with the given key.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
size_type count(const_reference value) const
{ return tree_.find(value) != end(); }
//! <b>Effects</b>: Returns the number of contained elements with the same key
//! compared with the given comparison functor.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
//! to number of objects with the given key.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
template<class KeyType, class KeyValueCompare>
size_type count(const KeyType& key, KeyValueCompare comp) const
@@ -739,9 +739,9 @@ class sg_set_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
iterator lower_bound(const_reference value)
{ return tree_.lower_bound(value); }
@@ -751,13 +751,13 @@ class sg_set_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns an iterator to the first element whose
- //! key according to the comparison functor is not less than k or
+ //! key according to the comparison functor is not less than k or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
- //!
+ //!
//! <b>Note</b>: This function is used when constructing a value_type
//! is expensive and the value_type can be compared with a cheaper
//! key type. Usually this key is part of the value_type.
@@ -767,9 +767,9 @@ class sg_set_impl
//! <b>Effects</b>: Returns a const iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
const_iterator lower_bound(const_reference value) const
{ return tree_.lower_bound(value); }
@@ -779,13 +779,13 @@ class sg_set_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns a const_iterator to the first element whose
- //! key according to the comparison functor is not less than k or
+ //! key according to the comparison functor is not less than k or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
- //!
+ //!
//! <b>Note</b>: This function is used when constructing a value_type
//! is expensive and the value_type can be compared with a cheaper
//! key type. Usually this key is part of the value_type.
@@ -795,9 +795,9 @@ class sg_set_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is greater than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
iterator upper_bound(const_reference value)
{ return tree_.upper_bound(value); }
@@ -807,11 +807,11 @@ class sg_set_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns an iterator to the first element whose
- //! key according to the comparison functor is greater than key or
+ //! key according to the comparison functor is greater than key or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -823,9 +823,9 @@ class sg_set_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is greater than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
const_iterator upper_bound(const_reference value) const
{ return tree_.upper_bound(value); }
@@ -835,11 +835,11 @@ class sg_set_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns a const_iterator to the first element whose
- //! key according to the comparison functor is greater than key or
+ //! key according to the comparison functor is greater than key or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -849,11 +849,11 @@ class sg_set_impl
const_iterator upper_bound(const KeyType& key, KeyValueCompare comp) const
{ return tree_.upper_bound(key, comp); }
- //! <b>Effects</b>: Finds an iterator to the first element whose value is
+ //! <b>Effects</b>: Finds an iterator to the first element whose value is
//! "value" or end() if that element does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
iterator find(const_reference value)
{ return tree_.find(value); }
@@ -862,12 +862,12 @@ class sg_set_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds an iterator to the first element whose key is
- //! "key" according to the comparison functor or end() if that element
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
//! does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -877,11 +877,11 @@ class sg_set_impl
iterator find(const KeyType& key, KeyValueCompare comp)
{ return tree_.find(key, comp); }
- //! <b>Effects</b>: Finds a const_iterator to the first element whose value is
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose value is
//! "value" or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
const_iterator find(const_reference value) const
{ return tree_.find(value); }
@@ -890,12 +890,12 @@ class sg_set_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
- //! "key" according to the comparison functor or end() if that element
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
//! does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -908,9 +908,9 @@ class sg_set_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
std::pair<iterator,iterator> equal_range(const_reference value)
{ return tree_.equal_range(value); }
@@ -919,13 +919,13 @@ class sg_set_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds a range containing all elements whose key is k
- //! according to the comparison functor or an empty range
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
//! that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -938,9 +938,9 @@ class sg_set_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
std::pair<const_iterator, const_iterator>
equal_range(const_reference value) const
@@ -950,13 +950,13 @@ class sg_set_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds a range containing all elements whose key is k
- //! according to the comparison functor or an empty range
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
//! that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -967,16 +967,101 @@ class sg_set_impl
equal_range(const KeyType& key, KeyValueCompare comp) const
{ return tree_.equal_range(key, comp); }
+ //! <b>Requires</b>: 'lower_value' must not be greater than 'upper_value'. If
+ //! 'lower_value' == 'upper_value', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_value and upper_value.
+ std::pair<iterator,iterator> bounded_range
+ (const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed)
+ { return tree_.bounded_range(lower_value, upper_value, left_closed, right_closed); }
+
+ //! <b>Requires</b>: KeyValueCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise
+ //!
+ //! second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator,iterator> bounded_range
+ (const KeyType& lower_key, const KeyType& upper_key, KeyValueCompare comp, bool left_closed, bool right_closed)
+ { return tree_.bounded_range(lower_key, upper_key, comp, left_closed, right_closed); }
+
+ //! <b>Requires</b>: 'lower_value' must not be greater than 'upper_value'. If
+ //! 'lower_value' == 'upper_value', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_value and upper_value.
+ std::pair<const_iterator, const_iterator>
+ bounded_range(const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed) const
+ { return tree_.bounded_range(lower_value, upper_value, left_closed, right_closed); }
+
+ //! <b>Requires</b>: KeyValueCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise
+ //!
+ //! second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<const_iterator, const_iterator>
+ bounded_range
+ (const KeyType& lower_key, const KeyType& upper_key, KeyValueCompare comp, bool left_closed, bool right_closed) const
+ { return tree_.bounded_range(lower_key, upper_key, comp, left_closed, right_closed); }
+
//! <b>Requires</b>: value must be an lvalue and shall be in a sg_set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator i belonging to the sg_set
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
static iterator s_iterator_to(reference value)
@@ -984,14 +1069,14 @@ class sg_set_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a sg_set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
//! sg_set that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
static const_iterator s_iterator_to(const_reference value)
@@ -999,48 +1084,48 @@ class sg_set_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a sg_set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator i belonging to the sg_set
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator iterator_to(reference value)
{ return tree_.iterator_to(value); }
//! <b>Requires</b>: value must be an lvalue and shall be in a sg_set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
//! sg_set that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator iterator_to(const_reference value) const
{ return tree_.iterator_to(value); }
//! <b>Requires</b>: value shall not be in a sg_set/sg_multiset.
- //!
+ //!
//! <b>Effects</b>: init_node puts the hook of a value in a well-known default
//! state.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Note</b>: This function puts the hook in the well-known default state
//! used by auto_unlink and safe hooks.
static void init_node(reference value)
{ tree_type::init_node(value); }
//! <b>Effects</b>: Unlinks the leftmost node from the tree.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function breaks the tree and the tree can
//! only be used for more unlink_leftmost_without_rebalance calls.
//! This function is normally used to achieve a step by step
@@ -1050,14 +1135,14 @@ class sg_set_impl
//! <b>Requires</b>: replace_this must be a valid iterator of *this
//! and with_this must not be inserted in any tree.
- //!
+ //!
//! <b>Effects</b>: Replaces replace_this in its position in the
//! tree with with_this. The tree does not need to be rebalanced.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! with_this is not equivalent to *replace_this according to the
//! ordering rules. This function is faster than erasing and inserting
@@ -1066,21 +1151,21 @@ class sg_set_impl
{ tree_.replace_node(replace_this, with_this); }
//! <b>Effects</b>: Rebalances the tree.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear.
void rebalance()
{ tree_.rebalance(); }
//! <b>Requires</b>: old_root is a node of a tree.
- //!
+ //!
//! <b>Effects</b>: Rebalances the subtree rooted at old_root.
//!
//! <b>Returns</b>: The new root of the subtree.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the elements in the subtree.
iterator rebalance_subtree(iterator root)
{ return tree_.rebalance_subtree(root); }
@@ -1088,18 +1173,18 @@ class sg_set_impl
//! <b>Returns</b>: The balance factor (alpha) used in this tree
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
float balance_factor() const
{ return tree_.balance_factor(); }
//! <b>Requires</b>: new_alpha must be a value between 0.5 and 1.0
- //!
+ //!
//! <b>Effects</b>: Establishes a new balance factor (alpha) and rebalances
//! the tree if the new balance factor is stricter (less) than the old factor.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the elements in the subtree.
void balance_factor(float new_alpha)
{ tree_.balance_factor(new_alpha); }
@@ -1190,7 +1275,7 @@ struct make_sg_set
{
/// @cond
typedef sg_set_impl
- < typename make_sgtree_opt<T,
+ < typename make_sgtree_opt<T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -1210,7 +1295,7 @@ template<class T, class O1, class O2, class O3, class O4>
template<class T, class ...Options>
#endif
class sg_set
- : public make_sg_set<T,
+ : public make_sg_set<T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -1219,7 +1304,7 @@ class sg_set
>::type
{
typedef typename make_sg_set
- <T,
+ <T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -1271,9 +1356,9 @@ class sg_set
#endif
-//! The class template sg_multiset is an intrusive container, that mimics most of
+//! The class template sg_multiset is an intrusive container, that mimics most of
//! the interface of std::sg_multiset as described in the C++ standard.
-//!
+//!
//! The template parameter \c T is the type to be managed by the container.
//! The user can specify additional options and if no options are provided
//! default options are used.
@@ -1325,30 +1410,30 @@ class sg_multiset_impl
/// @endcond
public:
- //! <b>Effects</b>: Constructs an empty sg_multiset.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //! <b>Effects</b>: Constructs an empty sg_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
- //! or the copy constructor/operator() of the value_compare object throws.
+ //! or the copy constructor/operator() of the value_compare object throws.
sg_multiset_impl( const value_compare &cmp = value_compare()
- , const value_traits &v_traits = value_traits())
+ , const value_traits &v_traits = value_traits())
: tree_(cmp, v_traits)
{}
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
//! cmp must be a comparison function that induces a strict weak ordering.
- //!
- //! <b>Effects</b>: Constructs an empty sg_multiset and inserts elements from
+ //!
+ //! <b>Effects</b>: Constructs an empty sg_multiset and inserts elements from
//! [b, e).
- //!
+ //!
//! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
//! comp and otherwise N * log N, where N is the distance between first and last
- //!
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
- //! or the copy constructor/operator() of the value_compare object throws.
+ //! or the copy constructor/operator() of the value_compare object throws.
template<class Iterator>
sg_multiset_impl( Iterator b, Iterator e
, const value_compare &cmp = value_compare()
@@ -1357,135 +1442,135 @@ class sg_multiset_impl
{}
//! <b>Effects</b>: to-do
- //!
- sg_multiset_impl(BOOST_RV_REF(sg_multiset_impl) x)
+ //!
+ sg_multiset_impl(BOOST_RV_REF(sg_multiset_impl) x)
: tree_(::boost::move(x.tree_))
{}
//! <b>Effects</b>: to-do
- //!
- sg_multiset_impl& operator=(BOOST_RV_REF(sg_multiset_impl) x)
+ //!
+ sg_multiset_impl& operator=(BOOST_RV_REF(sg_multiset_impl) x)
{ tree_ = ::boost::move(x.tree_); return *this; }
- //! <b>Effects</b>: Detaches all elements from this. The objects in the sg_multiset
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the sg_multiset
//! are not deleted (i.e. no destructors are called).
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- ~sg_multiset_impl()
+ ~sg_multiset_impl()
{}
//! <b>Effects</b>: Returns an iterator pointing to the beginning of the sg_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator begin()
{ return tree_.begin(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the sg_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator begin() const
{ return tree_.begin(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the sg_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cbegin() const
{ return tree_.cbegin(); }
//! <b>Effects</b>: Returns an iterator pointing to the end of the sg_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator end()
{ return tree_.end(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the sg_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator end() const
{ return tree_.end(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the sg_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cend() const
{ return tree_.cend(); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning of the
//! reversed sg_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rbegin()
{ return tree_.rbegin(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed sg_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rbegin() const
{ return tree_.rbegin(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed sg_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crbegin() const
{ return tree_.crbegin(); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the end
//! of the reversed sg_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rend()
{ return tree_.rend(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed sg_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rend() const
{ return tree_.rend(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed sg_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crend() const
{ return tree_.crend(); }
//! <b>Precondition</b>: end_iterator must be a valid end iterator
//! of sg_multiset.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the sg_multiset associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static sg_multiset_impl &container_from_end_iterator(iterator end_iterator)
{
@@ -1496,11 +1581,11 @@ class sg_multiset_impl
//! <b>Precondition</b>: end_iterator must be a valid end const_iterator
//! of sg_multiset.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the sg_multiset associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static const sg_multiset_impl &container_from_end_iterator(const_iterator end_iterator)
{
@@ -1510,11 +1595,11 @@ class sg_multiset_impl
}
//! <b>Precondition</b>: it must be a valid iterator of multiset.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the multiset associated to the iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static sg_multiset_impl &container_from_iterator(iterator it)
{
@@ -1524,11 +1609,11 @@ class sg_multiset_impl
}
//! <b>Precondition</b>: it must be a valid const_iterator of multiset.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the multiset associated to the iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static const sg_multiset_impl &container_from_iterator(const_iterator it)
{
@@ -1538,42 +1623,42 @@ class sg_multiset_impl
}
//! <b>Effects</b>: Returns the key_compare object used by the sg_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If key_compare copy-constructor throws.
key_compare key_comp() const
{ return tree_.value_comp(); }
//! <b>Effects</b>: Returns the value_compare object used by the sg_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If value_compare copy-constructor throws.
value_compare value_comp() const
{ return tree_.value_comp(); }
//! <b>Effects</b>: Returns true if the container is empty.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
bool empty() const
{ return tree_.empty(); }
//! <b>Effects</b>: Returns the number of elements stored in the sg_multiset.
- //!
+ //!
//! <b>Complexity</b>: Linear to elements contained in *this if,
//! constant-time size option is enabled. Constant-time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
size_type size() const
{ return tree_.size(); }
//! <b>Effects</b>: Swaps the contents of two sg_multisets.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If the swap() call for the comparison functor
//! found using ADL throws. Strong guarantee.
void swap(sg_multiset_impl& other)
@@ -1583,69 +1668,69 @@ class sg_multiset_impl
//! Cloner should yield to nodes equivalent to the original nodes.
//!
//! <b>Effects</b>: Erases all the elements from *this
- //! calling Disposer::operator()(pointer), clones all the
+ //! calling Disposer::operator()(pointer), clones all the
//! elements from src calling Cloner::operator()(const_reference )
//! and inserts them on *this. Copies the predicate from the source container.
//!
//! If cloner throws, all cloned elements are unlinked and disposed
//! calling Disposer::operator()(pointer).
- //!
+ //!
//! <b>Complexity</b>: Linear to erased plus inserted elements.
- //!
+ //!
//! <b>Throws</b>: If cloner throws or predicate copy assignment throws. Basic guarantee.
template <class Cloner, class Disposer>
void clone_from(const sg_multiset_impl &src, Cloner cloner, Disposer disposer)
{ tree_.clone_from(src.tree_, cloner, disposer); }
//! <b>Requires</b>: value must be an lvalue
- //!
+ //!
//! <b>Effects</b>: Inserts value into the sg_multiset.
- //!
+ //!
//! <b>Returns</b>: An iterator that points to the position where the new
//! element was inserted.
- //!
+ //!
//! <b>Complexity</b>: Average complexity for insert element is at
//! most logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
iterator insert(reference value)
{ return tree_.insert_equal(value); }
//! <b>Requires</b>: value must be an lvalue
- //!
+ //!
//! <b>Effects</b>: Inserts x into the sg_multiset, using pos as a hint to
//! where it will be inserted.
- //!
+ //!
//! <b>Returns</b>: An iterator that points to the position where the new
//! element was inserted.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic in general, but it is amortized
//! constant time if t is inserted immediately before hint.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
iterator insert(const_iterator hint, reference value)
{ return tree_.insert_equal(hint, value); }
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
//! of type value_type.
- //!
+ //!
//! <b>Effects</b>: Inserts a range into the sg_multiset.
- //!
+ //!
//! <b>Returns</b>: An iterator that points to the position where the new
//! element was inserted.
- //!
+ //!
//! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
//! size of the range. However, it is linear in N if the range is already sorted
//! by value_comp().
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
template<class Iterator>
@@ -1657,11 +1742,11 @@ class sg_multiset_impl
//! once inserted according to the predicate
//!
//! <b>Effects</b>: Inserts x into the tree before "pos".
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if "pos" is not
//! the successor of "value" tree ordering invariant will be broken.
//! This is a low-level function to be used only for performance reasons
@@ -1673,11 +1758,11 @@ class sg_multiset_impl
//! than the greatest inserted key
//!
//! <b>Effects</b>: Inserts x into the tree in the last position.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if value is
//! less than the greatest inserted key tree ordering invariant will be broken.
//! This function is slightly more efficient than using "insert_before".
@@ -1690,11 +1775,11 @@ class sg_multiset_impl
//! than the minimum inserted key
//!
//! <b>Effects</b>: Inserts x into the tree in the first position.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if value is
//! greater than the minimum inserted key tree ordering invariant will be broken.
//! This function is slightly more efficient than using "insert_before".
@@ -1703,41 +1788,41 @@ class sg_multiset_impl
void push_front(reference value)
{ tree_.push_front(value); }
- //! <b>Effects</b>: Erases the element pointed to by pos.
- //!
- //! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
//! <b>Returns</b>: An iterator to the element after the erased element.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
iterator erase(const_iterator i)
{ return tree_.erase(i); }
- //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
//!
//! <b>Returns</b>: An iterator to the element after the erased elements.
- //!
- //! <b>Complexity</b>: Average complexity for erase range is at most
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
//! O(log(size() + N)), where N is the number of elements in the range.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
iterator erase(const_iterator b, const_iterator e)
{ return tree_.erase(b, e); }
//! <b>Effects</b>: Erases all the elements with the given value.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + this->count(value)).
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
size_type erase(const_reference value)
@@ -1745,13 +1830,13 @@ class sg_multiset_impl
//! <b>Effects</b>: Erases all the elements that compare equal with
//! the given key and the given comparison functor.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + this->count(key, comp)).
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class KeyType, class KeyValueCompare>
@@ -1766,14 +1851,14 @@ class sg_multiset_impl
//!
//! <b>Returns</b>: An iterator to the element after the erased element.
//!
- //! <b>Effects</b>: Erases the element pointed to by pos.
+ //! <b>Effects</b>: Erases the element pointed to by pos.
//! Disposer::operator()(pointer) is called for the removed element.
- //!
- //! <b>Complexity</b>: Average complexity for erase element is constant time.
- //!
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
//! <b>Throws</b>: Nothing.
- //!
- //! <b>Note</b>: Invalidates the iterators
+ //!
+ //! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
iterator erase_and_dispose(const_iterator i, Disposer disposer)
@@ -1791,12 +1876,12 @@ class sg_multiset_impl
//!
//! <b>Effects</b>: Erases the range pointed to by b end e.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
- //! <b>Complexity</b>: Average complexity for erase range is at most
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
//! O(log(size() + N)), where N is the number of elements in the range.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
@@ -1807,13 +1892,13 @@ class sg_multiset_impl
//!
//! <b>Effects</b>: Erases all the elements with the given value.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + this->count(value)).
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class Disposer>
@@ -1827,11 +1912,11 @@ class sg_multiset_impl
//! Disposer::operator()(pointer) is called for the removed elements.
//!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + this->count(key, comp)).
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class KeyType, class KeyValueCompare, class Disposer>
@@ -1843,26 +1928,26 @@ class sg_multiset_impl
{ return tree_.erase_and_dispose(key, comp, disposer); }
//! <b>Effects</b>: Erases all the elements of the container.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
void clear()
{ return tree_.clear(); }
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
- //!
+ //!
//! <b>Effects</b>: Erases all the elements of the container.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class Disposer>
@@ -1870,20 +1955,20 @@ class sg_multiset_impl
{ return tree_.clear_and_dispose(disposer); }
//! <b>Effects</b>: Returns the number of contained elements with the given key
- //!
+ //!
//! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
//! to number of objects with the given key.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
size_type count(const_reference value) const
{ return tree_.count(value); }
//! <b>Effects</b>: Returns the number of contained elements with the same key
//! compared with the given comparison functor.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
//! to number of objects with the given key.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
template<class KeyType, class KeyValueCompare>
size_type count(const KeyType& key, KeyValueCompare comp) const
@@ -1891,9 +1976,9 @@ class sg_multiset_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
iterator lower_bound(const_reference value)
{ return tree_.lower_bound(value); }
@@ -1903,13 +1988,13 @@ class sg_multiset_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns an iterator to the first element whose
- //! key according to the comparison functor is not less than k or
+ //! key according to the comparison functor is not less than k or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
- //!
+ //!
//! <b>Note</b>: This function is used when constructing a value_type
//! is expensive and the value_type can be compared with a cheaper
//! key type. Usually this key is part of the value_type.
@@ -1919,9 +2004,9 @@ class sg_multiset_impl
//! <b>Effects</b>: Returns a const iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
const_iterator lower_bound(const_reference value) const
{ return tree_.lower_bound(value); }
@@ -1931,13 +2016,13 @@ class sg_multiset_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns a const_iterator to the first element whose
- //! key according to the comparison functor is not less than k or
+ //! key according to the comparison functor is not less than k or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
- //!
+ //!
//! <b>Note</b>: This function is used when constructing a value_type
//! is expensive and the value_type can be compared with a cheaper
//! key type. Usually this key is part of the value_type.
@@ -1947,9 +2032,9 @@ class sg_multiset_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is greater than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
iterator upper_bound(const_reference value)
{ return tree_.upper_bound(value); }
@@ -1959,11 +2044,11 @@ class sg_multiset_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns an iterator to the first element whose
- //! key according to the comparison functor is greater than key or
+ //! key according to the comparison functor is greater than key or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -1975,9 +2060,9 @@ class sg_multiset_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is greater than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
const_iterator upper_bound(const_reference value) const
{ return tree_.upper_bound(value); }
@@ -1987,11 +2072,11 @@ class sg_multiset_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns a const_iterator to the first element whose
- //! key according to the comparison functor is greater than key or
+ //! key according to the comparison functor is greater than key or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -2001,11 +2086,11 @@ class sg_multiset_impl
const_iterator upper_bound(const KeyType& key, KeyValueCompare comp) const
{ return tree_.upper_bound(key, comp); }
- //! <b>Effects</b>: Finds an iterator to the first element whose value is
+ //! <b>Effects</b>: Finds an iterator to the first element whose value is
//! "value" or end() if that element does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
iterator find(const_reference value)
{ return tree_.find(value); }
@@ -2014,12 +2099,12 @@ class sg_multiset_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds an iterator to the first element whose key is
- //! "key" according to the comparison functor or end() if that element
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
//! does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -2029,11 +2114,11 @@ class sg_multiset_impl
iterator find(const KeyType& key, KeyValueCompare comp)
{ return tree_.find(key, comp); }
- //! <b>Effects</b>: Finds a const_iterator to the first element whose value is
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose value is
//! "value" or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
const_iterator find(const_reference value) const
{ return tree_.find(value); }
@@ -2042,12 +2127,12 @@ class sg_multiset_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
- //! "key" according to the comparison functor or end() if that element
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
//! does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -2060,9 +2145,9 @@ class sg_multiset_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
std::pair<iterator,iterator> equal_range(const_reference value)
{ return tree_.equal_range(value); }
@@ -2071,13 +2156,13 @@ class sg_multiset_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds a range containing all elements whose key is k
- //! according to the comparison functor or an empty range
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
//! that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -2090,9 +2175,9 @@ class sg_multiset_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
std::pair<const_iterator, const_iterator>
equal_range(const_reference value) const
@@ -2102,13 +2187,13 @@ class sg_multiset_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds a range containing all elements whose key is k
- //! according to the comparison functor or an empty range
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
//! that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -2119,16 +2204,101 @@ class sg_multiset_impl
equal_range(const KeyType& key, KeyValueCompare comp) const
{ return tree_.equal_range(key, comp); }
+ //! <b>Requires</b>: 'lower_value' must not be greater than 'upper_value'. If
+ //! 'lower_value' == 'upper_value', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_value and upper_value.
+ std::pair<iterator,iterator> bounded_range
+ (const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed)
+ { return tree_.bounded_range(lower_value, upper_value, left_closed, right_closed); }
+
+ //! <b>Requires</b>: KeyValueCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise
+ //!
+ //! second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator,iterator> bounded_range
+ (const KeyType& lower_key, const KeyType& upper_key, KeyValueCompare comp, bool left_closed, bool right_closed)
+ { return tree_.bounded_range(lower_key, upper_key, comp, left_closed, right_closed); }
+
+ //! <b>Requires</b>: 'lower_value' must not be greater than 'upper_value'. If
+ //! 'lower_value' == 'upper_value', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_value and upper_value.
+ std::pair<const_iterator, const_iterator>
+ bounded_range(const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed) const
+ { return tree_.bounded_range(lower_value, upper_value, left_closed, right_closed); }
+
+ //! <b>Requires</b>: KeyValueCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise
+ //!
+ //! second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<const_iterator, const_iterator>
+ bounded_range
+ (const KeyType& lower_key, const KeyType& upper_key, KeyValueCompare comp, bool left_closed, bool right_closed) const
+ { return tree_.bounded_range(lower_key, upper_key, comp, left_closed, right_closed); }
+
//! <b>Requires</b>: value must be an lvalue and shall be in a sg_multiset of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator i belonging to the sg_multiset
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
static iterator s_iterator_to(reference value)
@@ -2136,14 +2306,14 @@ class sg_multiset_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a sg_multiset of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
//! sg_multiset that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
static const_iterator s_iterator_to(const_reference value)
@@ -2151,48 +2321,48 @@ class sg_multiset_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a sg_multiset of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator i belonging to the sg_multiset
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator iterator_to(reference value)
{ return tree_.iterator_to(value); }
//! <b>Requires</b>: value must be an lvalue and shall be in a sg_multiset of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
//! sg_multiset that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator iterator_to(const_reference value) const
{ return tree_.iterator_to(value); }
//! <b>Requires</b>: value shall not be in a sg_multiset/sg_multiset.
- //!
+ //!
//! <b>Effects</b>: init_node puts the hook of a value in a well-known default
//! state.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Note</b>: This function puts the hook in the well-known default state
//! used by auto_unlink and safe hooks.
static void init_node(reference value)
{ tree_type::init_node(value); }
//! <b>Effects</b>: Unlinks the leftmost node from the tree.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function breaks the tree and the tree can
//! only be used for more unlink_leftmost_without_rebalance calls.
//! This function is normally used to achieve a step by step
@@ -2202,14 +2372,14 @@ class sg_multiset_impl
//! <b>Requires</b>: replace_this must be a valid iterator of *this
//! and with_this must not be inserted in any tree.
- //!
+ //!
//! <b>Effects</b>: Replaces replace_this in its position in the
//! tree with with_this. The tree does not need to be rebalanced.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! with_this is not equivalent to *replace_this according to the
//! ordering rules. This function is faster than erasing and inserting
@@ -2218,21 +2388,21 @@ class sg_multiset_impl
{ tree_.replace_node(replace_this, with_this); }
//! <b>Effects</b>: Rebalances the tree.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear.
void rebalance()
{ tree_.rebalance(); }
//! <b>Requires</b>: old_root is a node of a tree.
- //!
+ //!
//! <b>Effects</b>: Rebalances the subtree rooted at old_root.
//!
//! <b>Returns</b>: The new root of the subtree.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the elements in the subtree.
iterator rebalance_subtree(iterator root)
{ return tree_.rebalance_subtree(root); }
@@ -2240,18 +2410,18 @@ class sg_multiset_impl
//! <b>Returns</b>: The balance factor (alpha) used in this tree
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
float balance_factor() const
{ return tree_.balance_factor(); }
//! <b>Requires</b>: new_alpha must be a value between 0.5 and 1.0
- //!
+ //!
//! <b>Effects</b>: Establishes a new balance factor (alpha) and rebalances
//! the tree if the new balance factor is stricter (less) than the old factor.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the elements in the subtree.
void balance_factor(float new_alpha)
{ tree_.balance_factor(new_alpha); }
@@ -2342,7 +2512,7 @@ struct make_sg_multiset
{
/// @cond
typedef sg_multiset_impl
- < typename make_sgtree_opt<T,
+ < typename make_sgtree_opt<T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -2362,7 +2532,7 @@ template<class T, class O1, class O2, class O3, class O4>
template<class T, class ...Options>
#endif
class sg_multiset
- : public make_sg_multiset<T,
+ : public make_sg_multiset<T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -2371,7 +2541,7 @@ class sg_multiset
>::type
{
typedef typename make_sg_multiset
- <T,
+ <T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -2423,8 +2593,8 @@ class sg_multiset
#endif
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/sgtree.hpp b/boost/intrusive/sgtree.hpp
index 0c4177ba42..f181f54005 100644
--- a/boost/intrusive/sgtree.hpp
+++ b/boost/intrusive/sgtree.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2007-2009
+// (C) Copyright Ion Gaztanaga 2007-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -48,7 +48,7 @@ namespace intrusive {
namespace detail{
-//! Returns floor(log(n)/log(sqrt(2))) -> floor(2*log2(n))
+//! Returns floor(log2(n)/log2(sqrt(2))) -> floor(2*log2(n))
//! Undefined if N is 0.
//!
//! This function does not use float point operations.
@@ -83,9 +83,9 @@ struct h_alpha_t
std::size_t operator()(std::size_t n) const
{
- //Returns floor(log1/alpha(n)) ->
- // floor(log(n)/log(1/alpha)) ->
- // floor(log(n)/(-log(alpha)))
+ //Returns floor(log2(1/alpha(n))) ->
+ // floor(log2(n)/log(1/alpha)) ->
+ // floor(log2(n)/(-log2(alpha)))
//return static_cast<std::size_t>(std::log(float(n))*inv_minus_logalpha_);
return static_cast<std::size_t>(detail::fast_log2(float(n))*inv_minus_logalpha_);
}
@@ -103,7 +103,7 @@ struct alpha_by_max_size_t
alpha_by_max_size_t(float alpha)
: alpha_(alpha)
{}
-
+
float operator()(std::size_t max_tree_size) const
{ return float(max_tree_size)*alpha_; }
@@ -125,7 +125,7 @@ struct alpha_holder
{ return alpha_; }
void set_alpha(float alpha)
- {
+ {
alpha_ = alpha;
inv_minus_logalpha_ = 1/(-detail::fast_log2(alpha));
}
@@ -191,7 +191,7 @@ struct sg_set_defaults
//! The class template sgtree is an intrusive scapegoat tree container, that
//! is used to construct intrusive sg_set and sg_multiset containers.
-//! The no-throw guarantee holds only, if the value_compare object
+//! The no-throw guarantee holds only, if the value_compare object
//! doesn't throw.
//!
//! The template parameter \c T is the type to be managed by the container.
@@ -260,7 +260,7 @@ class sgtree_impl
//noncopyable
BOOST_MOVABLE_BUT_NOT_COPYABLE(sgtree_impl)
- enum { safemode_or_autounlink =
+ enum { safemode_or_autounlink =
(int)real_value_traits::link_mode == (int)auto_unlink ||
(int)real_value_traits::link_mode == (int)safe_link };
@@ -299,7 +299,7 @@ class sgtree_impl
void priv_alpha(float alpha)
{ return this->priv_alpha_traits().set_alpha(alpha); }
-
+
const value_compare &priv_comp() const
{ return data_.node_plus_pred_.get(); }
@@ -363,18 +363,18 @@ class sgtree_impl
typedef typename node_algorithms::insert_commit_data insert_commit_data;
- //! <b>Effects</b>: Constructs an empty tree.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //! <b>Effects</b>: Constructs an empty tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
//! or the copy constructorof the value_compare object throws. Basic guarantee.
sgtree_impl( const value_compare &cmp = value_compare()
- , const value_traits &v_traits = value_traits())
+ , const value_traits &v_traits = value_traits())
: data_(cmp, v_traits)
- {
- node_algorithms::init_header(this->priv_header_ptr());
+ {
+ node_algorithms::init_header(this->priv_header_ptr());
this->priv_size_traits().set_size(size_type(0));
}
@@ -386,7 +386,7 @@ class sgtree_impl
//!
//! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
//! comp and otherwise N * log N, where N is the distance between first and last.
- //!
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
//! or the copy constructor/operator() of the value_compare object throws. Basic guarantee.
@@ -405,58 +405,58 @@ class sgtree_impl
}
//! <b>Effects</b>: to-do
- //!
+ //!
sgtree_impl(BOOST_RV_REF(sgtree_impl) x)
: data_(::boost::move(x.priv_comp()), ::boost::move(x.priv_value_traits()))
{
- node_algorithms::init_header(this->priv_header_ptr());
+ node_algorithms::init_header(this->priv_header_ptr());
this->priv_size_traits().set_size(size_type(0));
this->swap(x);
}
//! <b>Effects</b>: to-do
- //!
- sgtree_impl& operator=(BOOST_RV_REF(sgtree_impl) x)
+ //!
+ sgtree_impl& operator=(BOOST_RV_REF(sgtree_impl) x)
{ this->swap(x); return *this; }
- //! <b>Effects</b>: Detaches all elements from this. The objects in the set
- //! are not deleted (i.e. no destructors are called), but the nodes according to
- //! the value_traits template parameter are reinitialized and thus can be reused.
- //!
- //! <b>Complexity</b>: Linear to elements contained in *this.
- //!
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the set
+ //! are not deleted (i.e. no destructors are called), but the nodes according to
+ //! the value_traits template parameter are reinitialized and thus can be reused.
+ //!
+ //! <b>Complexity</b>: Linear to elements contained in *this.
+ //!
//! <b>Throws</b>: Nothing.
- ~sgtree_impl()
+ ~sgtree_impl()
{}
//! <b>Effects</b>: Returns an iterator pointing to the beginning of the tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator begin()
{ return iterator (node_traits::get_left(this->priv_header_ptr()), this); }
//! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator begin() const
{ return cbegin(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cbegin() const
{ return const_iterator (node_traits::get_left(this->priv_header_ptr()), this); }
//! <b>Effects</b>: Returns an iterator pointing to the end of the tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator end()
{ return iterator (this->priv_header_ptr(), this); }
@@ -464,138 +464,138 @@ class sgtree_impl
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the tree.
//!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator end() const
{ return cend(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cend() const
{ return const_iterator (uncast(this->priv_header_ptr()), this); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning of the
//! reversed tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rbegin()
{ return reverse_iterator(end()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rbegin() const
{ return const_reverse_iterator(end()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crbegin() const
{ return const_reverse_iterator(end()); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the end
//! of the reversed tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rend()
{ return reverse_iterator(begin()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rend() const
{ return const_reverse_iterator(begin()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crend() const
{ return const_reverse_iterator(begin()); }
//! <b>Precondition</b>: end_iterator must be a valid end iterator
//! of sgtree.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the sgtree associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static sgtree_impl &container_from_end_iterator(iterator end_iterator)
{ return priv_container_from_end_iterator(end_iterator); }
//! <b>Precondition</b>: end_iterator must be a valid end const_iterator
//! of sgtree.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the sgtree associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static const sgtree_impl &container_from_end_iterator(const_iterator end_iterator)
{ return priv_container_from_end_iterator(end_iterator); }
//! <b>Precondition</b>: it must be a valid iterator
//! of rbtree.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the tree associated to the iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
static sgtree_impl &container_from_iterator(iterator it)
{ return priv_container_from_iterator(it); }
//! <b>Precondition</b>: it must be a valid end const_iterator
//! of rbtree.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the tree associated to the iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
static const sgtree_impl &container_from_iterator(const_iterator it)
{ return priv_container_from_iterator(it); }
//! <b>Effects</b>: Returns the value_compare object used by the tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If value_compare copy-constructor throws.
value_compare value_comp() const
{ return priv_comp(); }
//! <b>Effects</b>: Returns true if the container is empty.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
bool empty() const
{ return node_algorithms::unique(this->priv_header_ptr()); }
//! <b>Effects</b>: Returns the number of elements stored in the tree.
- //!
+ //!
//! <b>Complexity</b>: Linear to elements contained in *this
//! if constant-time size option is disabled. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
size_type size() const
{
@@ -607,9 +607,9 @@ class sgtree_impl
}
//! <b>Effects</b>: Swaps the contents of two sgtrees.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If the comparison functor's swap call throws.
void swap(sgtree_impl& other)
{
@@ -628,14 +628,14 @@ class sgtree_impl
}
//! <b>Requires</b>: value must be an lvalue
- //!
+ //!
//! <b>Effects</b>: Inserts value into the tree before the upper bound.
- //!
+ //!
//! <b>Complexity</b>: Average complexity for insert element is at
//! most logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
iterator insert_equal(reference value)
@@ -656,16 +656,16 @@ class sgtree_impl
//! <b>Requires</b>: value must be an lvalue, and "hint" must be
//! a valid iterator.
- //!
+ //!
//! <b>Effects</b>: Inserts x into the tree, using "hint" as a hint to
//! where it will be inserted. If "hint" is the upper_bound
//! the insertion takes constant time (two comparisons in the worst case)
- //!
+ //!
//! <b>Complexity</b>: Logarithmic in general, but it is amortized
//! constant time if t is inserted immediately before hint.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
iterator insert_equal(const_iterator hint, reference value)
@@ -684,18 +684,18 @@ class sgtree_impl
return iterator(p, this);
}
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
//! of type value_type.
- //!
+ //!
//! <b>Effects</b>: Inserts a each element of a range into the tree
//! before the upper bound of the key of each element.
- //!
+ //!
//! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
//! size of the range. However, it is linear in N if the range is already sorted
//! by value_comp().
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
template<class Iterator>
@@ -707,15 +707,15 @@ class sgtree_impl
}
//! <b>Requires</b>: value must be an lvalue
- //!
+ //!
//! <b>Effects</b>: Inserts value into the tree if the value
//! is not already present.
- //!
+ //!
//! <b>Complexity</b>: Average complexity for insert element is at
//! most logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
std::pair<iterator, bool> insert_unique(reference value)
@@ -729,16 +729,16 @@ class sgtree_impl
//! <b>Requires</b>: value must be an lvalue, and "hint" must be
//! a valid iterator
- //!
+ //!
//! <b>Effects</b>: Tries to insert x into the tree, using "hint" as a hint
//! to where it will be inserted.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic in general, but it is amortized
//! constant time (two comparisons in the worst case)
//! if t is inserted immediately before hint.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
iterator insert_unique(const_iterator hint, reference value)
@@ -750,17 +750,17 @@ class sgtree_impl
return insert_unique_commit(value, commit_data);
}
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
//! of type value_type.
- //!
+ //!
//! <b>Effects</b>: Tries to insert each element of a range into the tree.
- //!
- //! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
- //! size of the range. However, it is linear in N if the range is already sorted
+ //!
+ //! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
+ //! size of the range. However, it is linear in N if the range is already sorted
//! by value_comp().
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
template<class Iterator>
@@ -777,10 +777,10 @@ class sgtree_impl
}
}
- //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
//! the same strict weak ordering as value_compare. The difference is that
//! key_value_comp compares an arbitrary key with the contained values.
- //!
+ //!
//! <b>Effects</b>: Checks if a value can be inserted in the container, using
//! a user provided key instead of the value itself.
//!
@@ -789,16 +789,16 @@ class sgtree_impl
//! and false. If the value can be inserted returns true in the returned
//! pair boolean and fills "commit_data" that is meant to be used with
//! the "insert_commit" function.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is at most logarithmic.
//!
//! <b>Throws</b>: If the key_value_comp ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Notes</b>: This function is used to improve performance when constructing
//! a value_type is expensive: if there is an equivalent value
//! the constructed object must be discarded. Many times, the part of the
//! node that is used to impose the order is much cheaper to construct
- //! than the value_type and this function offers the possibility to use that
+ //! than the value_type and this function offers the possibility to use that
//! part to check if the insertion will be successful.
//!
//! If the check is successful, the user can construct the value_type and use
@@ -813,18 +813,18 @@ class sgtree_impl
{
detail::key_nodeptr_comp<KeyValueCompare, sgtree_impl>
comp(key_value_comp, this);
- std::pair<node_ptr, bool> ret =
+ std::pair<node_ptr, bool> ret =
(node_algorithms::insert_unique_check
(this->priv_header_ptr(), key, comp, commit_data));
return std::pair<iterator, bool>(iterator(ret.first, this), ret.second);
}
- //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
//! the same strict weak ordering as value_compare. The difference is that
//! key_value_comp compares an arbitrary key with the contained values.
- //!
+ //!
//! <b>Effects</b>: Checks if a value can be inserted in the container, using
- //! a user provided key instead of the value itself, using "hint"
+ //! a user provided key instead of the value itself, using "hint"
//! as a hint to where it will be inserted.
//!
//! <b>Returns</b>: If there is an equivalent value
@@ -832,23 +832,23 @@ class sgtree_impl
//! and false. If the value can be inserted returns true in the returned
//! pair boolean and fills "commit_data" that is meant to be used with
//! the "insert_commit" function.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic in general, but it's amortized
//! constant time if t is inserted immediately before hint.
//!
//! <b>Throws</b>: If the key_value_comp ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Notes</b>: This function is used to improve performance when constructing
//! a value_type is expensive: if there is an equivalent value
//! the constructed object must be discarded. Many times, the part of the
//! constructing that is used to impose the order is much cheaper to construct
- //! than the value_type and this function offers the possibility to use that key
+ //! than the value_type and this function offers the possibility to use that key
//! to check if the insertion will be successful.
//!
//! If the check is successful, the user can construct the value_type and use
//! "insert_commit" to insert the object in constant-time. This can give a total
//! constant-time complexity to the insertion: check(O(1)) + commit(O(1)).
- //!
+ //!
//! "commit_data" remains valid for a subsequent "insert_commit" only if no more
//! objects are inserted or erased from the container.
template<class KeyType, class KeyValueCompare>
@@ -858,7 +858,7 @@ class sgtree_impl
{
detail::key_nodeptr_comp<KeyValueCompare, sgtree_impl>
comp(key_value_comp, this);
- std::pair<node_ptr, bool> ret =
+ std::pair<node_ptr, bool> ret =
(node_algorithms::insert_unique_check
(this->priv_header_ptr(), hint.pointed_node(), key, comp, commit_data));
return std::pair<iterator, bool>(iterator(ret.first, this), ret.second);
@@ -868,16 +868,16 @@ class sgtree_impl
//! must have been obtained from a previous call to "insert_check".
//! No objects should have been inserted or erased from the container between
//! the "insert_check" that filled "commit_data" and the call to "insert_commit".
- //!
+ //!
//! <b>Effects</b>: Inserts the value in the avl_set using the information obtained
//! from the "commit_data" that a previous "insert_check" filled.
//!
//! <b>Returns</b>: An iterator to the newly inserted object.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function has only sense if a "insert_check" has been
//! previously executed to fill "commit_data". No value should be inserted or
//! erased between the "insert_check" and "insert_commit" calls.
@@ -900,11 +900,11 @@ class sgtree_impl
//! once inserted according to the predicate
//!
//! <b>Effects</b>: Inserts x into the tree before "pos".
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if "pos" is not
//! the successor of "value" tree ordering invariant will be broken.
//! This is a low-level function to be used only for performance reasons
@@ -927,11 +927,11 @@ class sgtree_impl
//! than the greatest inserted key
//!
//! <b>Effects</b>: Inserts x into the tree in the last position.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if value is
//! less than the greatest inserted key tree ordering invariant will be broken.
//! This function is slightly more efficient than using "insert_before".
@@ -944,7 +944,7 @@ class sgtree_impl
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
std::size_t max_tree_size = (std::size_t)data_.max_tree_size_;
node_algorithms::push_back
- ( this->priv_header_ptr(), to_insert
+ ( this->priv_header_ptr(), to_insert
, (size_type)this->size(), this->get_h_alpha_func(), max_tree_size);
this->priv_size_traits().increment();
data_.max_tree_size_ = (size_type)max_tree_size;
@@ -954,11 +954,11 @@ class sgtree_impl
//! than the minimum inserted key
//!
//! <b>Effects</b>: Inserts x into the tree in the first position.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if value is
//! greater than the minimum inserted key tree ordering invariant will be broken.
//! This function is slightly more efficient than using "insert_before".
@@ -977,12 +977,12 @@ class sgtree_impl
data_.max_tree_size_ = (size_type)max_tree_size;
}
- //! <b>Effects</b>: Erases the element pointed to by pos.
- //!
- //! <b>Complexity</b>: Average complexity for erase element is constant time.
- //!
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
iterator erase(const_iterator i)
@@ -1003,26 +1003,26 @@ class sgtree_impl
return ret.unconst();
}
- //! <b>Effects</b>: Erases the range pointed to by b end e.
- //!
- //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
//! O(log(size() + N)), where N is the number of elements in the range.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
iterator erase(const_iterator b, const_iterator e)
{ size_type n; return private_erase(b, e, n); }
//! <b>Effects</b>: Erases all the elements with the given value.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + N).
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
size_type erase(const_reference value)
@@ -1032,15 +1032,15 @@ class sgtree_impl
//! according to the comparison functor "comp".
//!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + N).
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class KeyType, class KeyValueCompare>
- size_type erase(const KeyType& key, KeyValueCompare comp
+ size_type erase(const KeyType& key, KeyValueCompare comp
/// @cond
, typename detail::enable_if_c<!detail::is_convertible<KeyValueCompare, const_iterator>::value >::type * = 0
/// @endcond
@@ -1054,14 +1054,14 @@ class sgtree_impl
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//!
- //! <b>Effects</b>: Erases the element pointed to by pos.
+ //! <b>Effects</b>: Erases the element pointed to by pos.
//! Disposer::operator()(pointer) is called for the removed element.
- //!
- //! <b>Complexity</b>: Average complexity for erase element is constant time.
- //!
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
//! <b>Throws</b>: Nothing.
- //!
- //! <b>Note</b>: Invalidates the iterators
+ //!
+ //! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
iterator erase_and_dispose(const_iterator i, Disposer disposer)
@@ -1082,12 +1082,12 @@ class sgtree_impl
//!
//! <b>Effects</b>: Erases the range pointed to by b end e.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
- //! <b>Complexity</b>: Average complexity for erase range is at most
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
//! O(log(size() + N)), where N is the number of elements in the range.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
@@ -1098,13 +1098,13 @@ class sgtree_impl
//!
//! <b>Effects</b>: Erases all the elements with the given value.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + N).
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class Disposer>
@@ -1123,11 +1123,11 @@ class sgtree_impl
//! Disposer::operator()(pointer) is called for the removed elements.
//!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + N).
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class KeyType, class KeyValueCompare, class Disposer>
@@ -1143,13 +1143,13 @@ class sgtree_impl
return n;
}
- //! <b>Effects</b>: Erases all of the elements.
- //!
+ //! <b>Effects</b>: Erases all of the elements.
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
void clear()
@@ -1167,9 +1167,9 @@ class sgtree_impl
//! each node to be erased.
//! <b>Complexity</b>: Average complexity for is at most O(log(size() + N)),
//! where N is the number of elements in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. Calls N times to disposer functor.
template<class Disposer>
@@ -1181,19 +1181,19 @@ class sgtree_impl
}
//! <b>Effects</b>: Returns the number of contained elements with the given value
- //!
+ //!
//! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
//! to number of objects with the given value.
- //!
+ //!
//! <b>Throws</b>: Nothing.
size_type count(const_reference value) const
{ return this->count(value, priv_comp()); }
//! <b>Effects</b>: Returns the number of contained elements with the given key
- //!
+ //!
//! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
//! to number of objects with the given key.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
size_type count(const KeyType &key, KeyValueCompare comp) const
@@ -1204,27 +1204,27 @@ class sgtree_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator lower_bound(const_reference value)
{ return this->lower_bound(value, priv_comp()); }
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator lower_bound(const_reference value) const
{ return this->lower_bound(value, priv_comp()); }
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
iterator lower_bound(const KeyType &key, KeyValueCompare comp)
@@ -1237,9 +1237,9 @@ class sgtree_impl
//! <b>Effects</b>: Returns a const iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
const_iterator lower_bound(const KeyType &key, KeyValueCompare comp) const
@@ -1252,9 +1252,9 @@ class sgtree_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is greater than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator upper_bound(const_reference value)
{ return this->upper_bound(value, priv_comp()); }
@@ -1264,7 +1264,7 @@ class sgtree_impl
//! does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
iterator upper_bound(const KeyType &key, KeyValueCompare comp)
@@ -1277,9 +1277,9 @@ class sgtree_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is greater than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator upper_bound(const_reference value) const
{ return this->upper_bound(value, priv_comp()); }
@@ -1289,7 +1289,7 @@ class sgtree_impl
//! does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
const_iterator upper_bound(const KeyType &key, KeyValueCompare comp) const
@@ -1300,20 +1300,20 @@ class sgtree_impl
(this->priv_header_ptr(), key, key_node_comp), this);
}
- //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
//! k or end() if that element does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator find(const_reference value)
{ return this->find(value, priv_comp()); }
- //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
//! k or end() if that element does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
iterator find(const KeyType &key, KeyValueCompare comp)
@@ -1324,20 +1324,20 @@ class sgtree_impl
(node_algorithms::find(this->priv_header_ptr(), key, key_node_comp), this);
}
- //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
//! k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator find(const_reference value) const
{ return this->find(value, priv_comp()); }
- //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
//! k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
const_iterator find(const KeyType &key, KeyValueCompare comp) const
@@ -1351,9 +1351,9 @@ class sgtree_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
std::pair<iterator,iterator> equal_range(const_reference value)
{ return this->equal_range(value, priv_comp()); }
@@ -1361,9 +1361,9 @@ class sgtree_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
std::pair<iterator,iterator> equal_range(const KeyType &key, KeyValueCompare comp)
@@ -1378,9 +1378,9 @@ class sgtree_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
std::pair<const_iterator, const_iterator>
equal_range(const_reference value) const
@@ -1389,9 +1389,9 @@ class sgtree_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
std::pair<const_iterator, const_iterator>
@@ -1404,19 +1404,117 @@ class sgtree_impl
return std::pair<const_iterator, const_iterator>(const_iterator(ret.first, this), const_iterator(ret.second, this));
}
+ //! <b>Requires</b>: 'lower_value' must not be greater than 'upper_value'. If
+ //! 'lower_value' == 'upper_value', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_value and upper_value.
+ std::pair<iterator,iterator> bounded_range
+ (const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed)
+ { return this->bounded_range(lower_value, upper_value, priv_comp(), left_closed, right_closed); }
+
+ //! <b>Requires</b>: KeyValueCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise
+ //!
+ //! second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator,iterator> bounded_range
+ (const KeyType &lower_key, const KeyType &upper_key, KeyValueCompare comp, bool left_closed, bool right_closed)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, sgtree_impl>
+ key_node_comp(comp, this);
+ std::pair<node_ptr, node_ptr> ret
+ (node_algorithms::bounded_range
+ (this->priv_header_ptr(), lower_key, upper_key, key_node_comp, left_closed, right_closed));
+ return std::pair<iterator, iterator>(iterator(ret.first, this), iterator(ret.second, this));
+ }
+
+ //! <b>Requires</b>: 'lower_value' must not be greater than 'upper_value'. If
+ //! 'lower_value' == 'upper_value', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_value and upper_value.
+ std::pair<const_iterator,const_iterator> bounded_range
+ (const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed) const
+ { return this->bounded_range(lower_value, upper_value, priv_comp(), left_closed, right_closed); }
+
+ //! <b>Requires</b>: KeyValueCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise
+ //!
+ //! second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<const_iterator,const_iterator> bounded_range
+ (const KeyType &lower_key, const KeyType &upper_key, KeyValueCompare comp, bool left_closed, bool right_closed) const
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, sgtree_impl>
+ key_node_comp(comp, this);
+ std::pair<node_ptr, node_ptr> ret
+ (node_algorithms::bounded_range
+ (this->priv_header_ptr(), lower_key, upper_key, key_node_comp, left_closed, right_closed));
+ return std::pair<const_iterator, const_iterator>(const_iterator(ret.first, this), const_iterator(ret.second, this));
+ }
+
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//! Cloner should yield to nodes equivalent to the original nodes.
//!
//! <b>Effects</b>: Erases all the elements from *this
- //! calling Disposer::operator()(pointer), clones all the
+ //! calling Disposer::operator()(pointer), clones all the
//! elements from src calling Cloner::operator()(const_reference )
//! and inserts them on *this. Copies the predicate from the source container.
//!
//! If cloner throws, all cloned elements are unlinked and disposed
//! calling Disposer::operator()(pointer).
- //!
+ //!
//! <b>Complexity</b>: Linear to erased plus inserted elements.
- //!
+ //!
//! <b>Throws</b>: If cloner throws or predicate copy assignment throws. Basic guarantee.
template <class Cloner, class Disposer>
void clone_from(const sgtree_impl &src, Cloner cloner, Disposer disposer)
@@ -1437,11 +1535,11 @@ class sgtree_impl
}
//! <b>Effects</b>: Unlinks the leftmost node from the tree.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function breaks the tree and the tree can
//! only be used for more unlink_leftmost_without_rebalance calls.
//! This function is normally used to achieve a step by step
@@ -1460,14 +1558,14 @@ class sgtree_impl
//! <b>Requires</b>: replace_this must be a valid iterator of *this
//! and with_this must not be inserted in any tree.
- //!
+ //!
//! <b>Effects</b>: Replaces replace_this in its position in the
//! tree with with_this. The tree does not need to be rebalanced.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! with_this is not equivalent to *replace_this according to the
//! ordering rules. This function is faster than erasing and inserting
@@ -1483,14 +1581,14 @@ class sgtree_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator i belonging to the set
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
static iterator s_iterator_to(reference value)
@@ -1501,17 +1599,17 @@ class sgtree_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
//! set that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
- static const_iterator s_iterator_to(const_reference value)
+ static const_iterator s_iterator_to(const_reference value)
{
BOOST_STATIC_ASSERT((!stateful_value_traits));
return const_iterator (value_traits::to_node_ptr(const_cast<reference> (value)), 0);
@@ -1519,58 +1617,58 @@ class sgtree_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator i belonging to the set
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator iterator_to(reference value)
{ return iterator (value_traits::to_node_ptr(value), this); }
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
//! set that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator iterator_to(const_reference value) const
{ return const_iterator (value_traits::to_node_ptr(const_cast<reference> (value)), this); }
//! <b>Requires</b>: value shall not be in a tree.
- //!
+ //!
//! <b>Effects</b>: init_node puts the hook of a value in a well-known default
//! state.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Note</b>: This function puts the hook in the well-known default state
//! used by auto_unlink and safe hooks.
static void init_node(reference value)
{ node_algorithms::init(value_traits::to_node_ptr(value)); }
//! <b>Effects</b>: Rebalances the tree.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear.
void rebalance()
{ node_algorithms::rebalance(this->priv_header_ptr()); }
//! <b>Requires</b>: old_root is a node of a tree.
- //!
+ //!
//! <b>Effects</b>: Rebalances the subtree rooted at old_root.
//!
//! <b>Returns</b>: The new root of the subtree.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the elements in the subtree.
iterator rebalance_subtree(iterator root)
{ return iterator(node_algorithms::rebalance_subtree(root.pointed_node()), this); }
@@ -1578,18 +1676,18 @@ class sgtree_impl
//! <b>Returns</b>: The balance factor (alpha) used in this tree
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
float balance_factor() const
{ return this->priv_alpha(); }
//! <b>Requires</b>: new_alpha must be a value between 0.5 and 1.0
- //!
+ //!
//! <b>Effects</b>: Establishes a new balance factor (alpha) and rebalances
//! the tree if the new balance factor is stricter (less) than the old factor.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the elements in the subtree.
void balance_factor(float new_alpha)
{
@@ -1609,12 +1707,12 @@ class sgtree_impl
}
/*
//! <b>Effects</b>: removes x from a tree of the appropriate type. It has no effect,
- //! if x is not in such a tree.
- //!
+ //! if x is not in such a tree.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Note</b>: This static function is only usable with the "safe mode"
//! hook and non-constant time size lists. Otherwise, the user must use
//! the non-static "erase(reference )" member. If the user calls
@@ -1624,7 +1722,7 @@ class sgtree_impl
static void remove_node(T& value)
{
//This function is only usable for safe mode hooks and non-constant
- //time lists.
+ //time lists.
//BOOST_STATIC_ASSERT((!(safemode_or_autounlink && constant_time_size)));
BOOST_STATIC_ASSERT((!constant_time_size));
BOOST_STATIC_ASSERT((boost::is_convertible<T, value_type>::value));
@@ -1795,7 +1893,7 @@ template<class T, class ...Options>
struct make_sgtree_opt
{
typedef typename pack_options
- < sg_set_defaults<T>,
+ < sg_set_defaults<T>,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -1826,7 +1924,7 @@ struct make_sgtree
{
/// @cond
typedef sgtree_impl
- < typename make_sgtree_opt<T,
+ < typename make_sgtree_opt<T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -1845,7 +1943,7 @@ template<class T, class O1, class O2, class O3, class O4>
template<class T, class ...Options>
#endif
class sgtree
- : public make_sgtree<T,
+ : public make_sgtree<T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -1854,7 +1952,7 @@ class sgtree
>::type
{
typedef typename make_sgtree
- <T,
+ <T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -1903,8 +2001,8 @@ class sgtree
#endif
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/sgtree_algorithms.hpp b/boost/intrusive/sgtree_algorithms.hpp
index f3c433225e..bad1c325a0 100644
--- a/boost/intrusive/sgtree_algorithms.hpp
+++ b/boost/intrusive/sgtree_algorithms.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2007.
+// (C) Copyright Ion Gaztanaga 2007-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -45,15 +45,15 @@ namespace intrusive {
//! <b>Static functions</b>:
//!
//! <tt>static node_ptr get_parent(const_node_ptr n);</tt>
-//!
+//!
//! <tt>static void set_parent(node_ptr n, node_ptr parent);</tt>
//!
//! <tt>static node_ptr get_left(const_node_ptr n);</tt>
-//!
+//!
//! <tt>static void set_left(node_ptr n, node_ptr left);</tt>
//!
//! <tt>static node_ptr get_right(const_node_ptr n);</tt>
-//!
+//!
//! <tt>static void set_right(node_ptr n, node_ptr right);</tt>
template<class NodeTraits>
class sgtree_algorithms
@@ -90,27 +90,27 @@ class sgtree_algorithms
//! <b>Requires</b>: header1 and header2 must be the header nodes
//! of two trees.
- //!
- //! <b>Effects</b>: Swaps two trees. After the function header1 will contain
+ //!
+ //! <b>Effects</b>: Swaps two trees. After the function header1 will contain
//! links to the second tree and header2 will have links to the first tree.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
static void swap_tree(const node_ptr & header1, const node_ptr & header2)
{ return tree_algorithms::swap_tree(header1, header2); }
//! <b>Requires</b>: node1 and node2 can't be header nodes
//! of two trees.
- //!
+ //!
//! <b>Effects</b>: Swaps two nodes. After the function node1 will be inserted
//! in the position node2 before the function. node2 will be inserted in the
//! position node1 had before the function.
- //!
- //! <b>Complexity</b>: Logarithmic.
- //!
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! node1 and node2 are not equivalent according to the ordering rules.
//!
@@ -119,22 +119,22 @@ class sgtree_algorithms
{
if(node1 == node2)
return;
-
+
node_ptr header1(tree_algorithms::get_header(node1)), header2(tree_algorithms::get_header(node2));
swap_nodes(node1, header1, node2, header2);
}
//! <b>Requires</b>: node1 and node2 can't be header nodes
//! of two trees with header header1 and header2.
- //!
+ //!
//! <b>Effects</b>: Swaps two nodes. After the function node1 will be inserted
//! in the position node2 before the function. node2 will be inserted in the
//! position node1 had before the function.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! node1 and node2 are not equivalent according to the ordering rules.
//!
@@ -144,14 +144,14 @@ class sgtree_algorithms
//! <b>Requires</b>: node_to_be_replaced must be inserted in a tree
//! and new_node must not be inserted in a tree.
- //!
+ //!
//! <b>Effects</b>: Replaces node_to_be_replaced in its position in the
//! tree with new_node. The tree does not need to be rebalanced
- //!
- //! <b>Complexity</b>: Logarithmic.
- //!
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! new_node is not equivalent to node_to_be_replaced according to the
//! ordering rules. This function is faster than erasing and inserting
@@ -167,14 +167,14 @@ class sgtree_algorithms
//! <b>Requires</b>: node_to_be_replaced must be inserted in a tree
//! with header "header" and new_node must not be inserted in a tree.
- //!
+ //!
//! <b>Effects</b>: Replaces node_to_be_replaced in its position in the
//! tree with new_node. The tree does not need to be rebalanced
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! new_node is not equivalent to node_to_be_replaced according to the
//! ordering rules. This function is faster than erasing and inserting
@@ -185,11 +185,11 @@ class sgtree_algorithms
{ tree_algorithms::replace_node(node_to_be_replaced, header, new_node); }
//! <b>Requires</b>: node is a tree node but not the header.
- //!
+ //!
//! <b>Effects</b>: Unlinks the node and rebalances the tree.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static void unlink(const node_ptr & node)
{
@@ -202,14 +202,14 @@ class sgtree_algorithms
}
//! <b>Requires</b>: header is the header of a tree.
- //!
+ //!
//! <b>Effects</b>: Unlinks the leftmost node from the tree, and
//! updates the header link to the new leftmost node.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function breaks the tree and the tree can
//! only be used for more unlink_leftmost_without_rebalance calls.
//! This function is normally used to achieve a step by step
@@ -219,51 +219,51 @@ class sgtree_algorithms
//! <b>Requires</b>: node is a node of the tree or an node initialized
//! by init(...).
- //!
+ //!
//! <b>Effects</b>: Returns true if the node is initialized by init().
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static bool unique(const const_node_ptr & node)
{ return tree_algorithms::unique(node); }
//! <b>Requires</b>: node is a node of the tree but it's not the header.
- //!
+ //!
//! <b>Effects</b>: Returns the number of nodes of the subtree.
- //!
+ //!
//! <b>Complexity</b>: Linear time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static std::size_t count(const const_node_ptr & node)
{ return tree_algorithms::count(node); }
//! <b>Requires</b>: header is the header node of the tree.
- //!
+ //!
//! <b>Effects</b>: Returns the number of nodes above the header.
- //!
+ //!
//! <b>Complexity</b>: Linear time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static std::size_t size(const const_node_ptr & header)
{ return tree_algorithms::size(header); }
//! <b>Requires</b>: p is a node from the tree except the header.
- //!
+ //!
//! <b>Effects</b>: Returns the next node of the tree.
- //!
+ //!
//! <b>Complexity</b>: Average constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static node_ptr next_node(const node_ptr & p)
{ return tree_algorithms::next_node(p); }
//! <b>Requires</b>: p is a node from the tree except the leftmost node.
- //!
+ //!
//! <b>Effects</b>: Returns the previous node of the tree.
- //!
+ //!
//! <b>Complexity</b>: Average constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static node_ptr prev_node(const node_ptr & p)
{ return tree_algorithms::prev_node(p); }
@@ -271,9 +271,9 @@ class sgtree_algorithms
//! <b>Requires</b>: node must not be part of any tree.
//!
//! <b>Effects</b>: After the function unique(node) == true.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
//!
//! <b>Nodes</b>: If node is inserted in a tree, this function corrupts the tree.
@@ -284,9 +284,9 @@ class sgtree_algorithms
//!
//! <b>Effects</b>: Initializes the header to represent an empty tree.
//! unique(header) == true.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
//!
//! <b>Nodes</b>: If node is inserted in a tree, this function corrupts the tree.
@@ -297,9 +297,9 @@ class sgtree_algorithms
//! of that tree and z != header.
//!
//! <b>Effects</b>: Erases node "z" from the tree with header "header".
- //!
+ //!
//! <b>Complexity</b>: Amortized constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class AlphaByMaxSize>
static node_ptr erase(const node_ptr & header, const node_ptr & z, std::size_t tree_size, std::size_t &max_tree_size, AlphaByMaxSize alpha_by_maxsize)
@@ -307,7 +307,7 @@ class sgtree_algorithms
//typename tree_algorithms::data_for_rebalance info;
tree_algorithms::erase(header, z);
--tree_size;
- if (tree_size > 0 &&
+ if (tree_size > 0 &&
tree_size < alpha_by_maxsize(max_tree_size)){
tree_algorithms::rebalance(header);
max_tree_size = tree_size;
@@ -319,18 +319,18 @@ class sgtree_algorithms
//! object taking a node_ptr and returning a new cloned node of it. "disposer" must
//! take a node_ptr and shouldn't throw.
//!
- //! <b>Effects</b>: First empties target tree calling
+ //! <b>Effects</b>: First empties target tree calling
//! <tt>void disposer::operator()(const node_ptr &)</tt> for every node of the tree
//! except the header.
- //!
+ //!
//! Then, duplicates the entire tree pointed by "source_header" cloning each
- //! source node with <tt>node_ptr Cloner::operator()(const node_ptr &)</tt> to obtain
+ //! source node with <tt>node_ptr Cloner::operator()(const node_ptr &)</tt> to obtain
//! the nodes of the target tree. If "cloner" throws, the cloned target nodes
//! are disposed using <tt>void disposer(const node_ptr &)</tt>.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of element of the source tree plus the.
//! number of elements of tree target tree when calling this function.
- //!
+ //!
//! <b>Throws</b>: If cloner functor throws. If this happens target nodes are disposed.
template <class Cloner, class Disposer>
static void clone
@@ -342,13 +342,13 @@ class sgtree_algorithms
//! <b>Requires</b>: "disposer" must be an object function
//! taking a node_ptr parameter and shouldn't throw.
//!
- //! <b>Effects</b>: Empties the target tree calling
+ //! <b>Effects</b>: Empties the target tree calling
//! <tt>void disposer::operator()(const node_ptr &)</tt> for every node of the tree
//! except the header.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of element of the source tree plus the.
//! number of elements of tree target tree when calling this function.
- //!
+ //!
//! <b>Throws</b>: If cloner functor throws. If this happens target nodes are disposed.
template<class Disposer>
static void clear_and_dispose(const node_ptr & header, Disposer disposer)
@@ -364,7 +364,7 @@ class sgtree_algorithms
//! not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class KeyType, class KeyNodePtrCompare>
static node_ptr lower_bound
@@ -380,7 +380,7 @@ class sgtree_algorithms
//! than "key" according to "comp" or "header" if that element does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class KeyType, class KeyNodePtrCompare>
static node_ptr upper_bound
@@ -396,7 +396,7 @@ class sgtree_algorithms
//! "key" according to "comp" or "header" if that element does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class KeyType, class KeyNodePtrCompare>
static node_ptr find
@@ -414,13 +414,38 @@ class sgtree_algorithms
//! if they there are no equivalent elements.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class KeyType, class KeyNodePtrCompare>
static std::pair<node_ptr, node_ptr> equal_range
(const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp)
{ return tree_algorithms::equal_range(header, key, comp); }
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyNodePtrCompare>
+ static std::pair<node_ptr, node_ptr> bounded_range
+ (const const_node_ptr & header, const KeyType &lower_key, const KeyType &upper_key, KeyNodePtrCompare comp
+ , bool left_closed, bool right_closed)
+ { return tree_algorithms::bounded_range(header, lower_key, upper_key, comp, left_closed, right_closed); }
+
//! <b>Requires</b>: "h" must be the header node of a tree.
//! NodePtrCompare is a function object that induces a strict weak
//! ordering compatible with the strict weak ordering used to create the
@@ -428,10 +453,10 @@ class sgtree_algorithms
//!
//! <b>Effects</b>: Inserts new_node into the tree before the upper bound
//! according to "comp".
- //!
+ //!
//! <b>Complexity</b>: Average complexity for insert element is at
//! most logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class NodePtrCompare, class H_Alpha>
static node_ptr insert_equal_upper_bound
@@ -451,10 +476,10 @@ class sgtree_algorithms
//!
//! <b>Effects</b>: Inserts new_node into the tree before the lower bound
//! according to "comp".
- //!
+ //!
//! <b>Complexity</b>: Average complexity for insert element is at
//! most logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class NodePtrCompare, class H_Alpha>
static node_ptr insert_equal_lower_bound
@@ -472,14 +497,14 @@ class sgtree_algorithms
//! ordering compatible with the strict weak ordering used to create the
//! the tree. NodePtrCompare compares two node_ptrs. "hint" is node from
//! the "header"'s tree.
- //!
+ //!
//! <b>Effects</b>: Inserts new_node into the tree, using "hint" as a hint to
//! where it will be inserted. If "hint" is the upper_bound
//! the insertion takes constant time (two comparisons in the worst case).
//!
//! <b>Complexity</b>: Logarithmic in general, but it is amortized
//! constant time if new_node is inserted immediately before "hint".
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class NodePtrCompare, class H_Alpha>
static node_ptr insert_equal
@@ -496,7 +521,7 @@ class sgtree_algorithms
//! KeyNodePtrCompare is a function object that induces a strict weak
//! ordering compatible with the strict weak ordering used to create the
//! the tree. NodePtrCompare compares KeyType with a node_ptr.
- //!
+ //!
//! <b>Effects</b>: Checks if there is an equivalent node to "key" in the
//! tree according to "comp" and obtains the needed information to realize
//! a constant-time node insertion if there is no equivalent node.
@@ -507,11 +532,11 @@ class sgtree_algorithms
//! in the returned pair's boolean and fills "commit_data" that is meant to
//! be used with the "insert_commit" function to achieve a constant-time
//! insertion function.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is at most logarithmic.
//!
//! <b>Throws</b>: If "comp" throws.
- //!
+ //!
//! <b>Notes</b>: This function is used to improve performance when constructing
//! a node is expensive and the user does not want to have two equivalent nodes
//! in the tree: if there is an equivalent value
@@ -532,7 +557,7 @@ class sgtree_algorithms
,KeyNodePtrCompare comp, insert_commit_data &commit_data)
{
std::size_t depth;
- std::pair<node_ptr, bool> ret =
+ std::pair<node_ptr, bool> ret =
tree_algorithms::insert_unique_check(header, key, comp, commit_data, &depth);
commit_data.depth = depth;
return ret;
@@ -544,13 +569,13 @@ class sgtree_algorithms
//! "pos" must be an iterator pointing to the successor to "new_node"
//! once inserted according to the order of already inserted nodes. This function does not
//! check "pos" and this precondition must be guaranteed by the caller.
- //!
+ //!
//! <b>Effects</b>: Inserts new_node into the tree before "pos".
//!
//! <b>Complexity</b>: Constant-time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: If "pos" is not the successor of the newly inserted "new_node"
//! tree invariants might be broken.
template<class H_Alpha>
@@ -567,13 +592,13 @@ class sgtree_algorithms
//! <b>Requires</b>: "header" must be the header node of a tree.
//! "new_node" must be, according to the used ordering no less than the
//! greatest inserted key.
- //!
+ //!
//! <b>Effects</b>: Inserts new_node into the tree before "pos".
//!
//! <b>Complexity</b>: Constant-time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: If "new_node" is less than the greatest inserted key
//! tree invariants are broken. This function is slightly faster than
//! using "insert_before".
@@ -589,13 +614,13 @@ class sgtree_algorithms
//! <b>Requires</b>: "header" must be the header node of a tree.
//! "new_node" must be, according to the used ordering, no greater than the
//! lowest inserted key.
- //!
+ //!
//! <b>Effects</b>: Inserts new_node into the tree before "pos".
//!
//! <b>Complexity</b>: Constant-time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: If "new_node" is greater than the lowest inserted key
//! tree invariants are broken. This function is slightly faster than
//! using "insert_before".
@@ -613,12 +638,12 @@ class sgtree_algorithms
//! ordering compatible with the strict weak ordering used to create the
//! the tree. NodePtrCompare compares KeyType with a node_ptr.
//! "hint" is node from the "header"'s tree.
- //!
+ //!
//! <b>Effects</b>: Checks if there is an equivalent node to "key" in the
//! tree according to "comp" using "hint" as a hint to where it should be
//! inserted and obtains the needed information to realize
- //! a constant-time node insertion if there is no equivalent node.
- //! If "hint" is the upper_bound the function has constant time
+ //! a constant-time node insertion if there is no equivalent node.
+ //! If "hint" is the upper_bound the function has constant time
//! complexity (two comparisons in the worst case).
//!
//! <b>Returns</b>: If there is an equivalent value
@@ -627,12 +652,12 @@ class sgtree_algorithms
//! in the returned pair's boolean and fills "commit_data" that is meant to
//! be used with the "insert_commit" function to achieve a constant-time
//! insertion function.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is at most logarithmic, but it is
//! amortized constant time if new_node should be inserted immediately before "hint".
//!
//! <b>Throws</b>: If "comp" throws.
- //!
+ //!
//! <b>Notes</b>: This function is used to improve performance when constructing
//! a node is expensive and the user does not want to have two equivalent nodes
//! in the tree: if there is an equivalent value
@@ -653,7 +678,7 @@ class sgtree_algorithms
,KeyNodePtrCompare comp, insert_commit_data &commit_data)
{
std::size_t depth;
- std::pair<node_ptr, bool> ret =
+ std::pair<node_ptr, bool> ret =
tree_algorithms::insert_unique_check
(header, hint, key, comp, commit_data, &depth);
commit_data.depth = depth;
@@ -664,16 +689,16 @@ class sgtree_algorithms
//! "commit_data" must have been obtained from a previous call to
//! "insert_unique_check". No objects should have been inserted or erased
//! from the set between the "insert_unique_check" that filled "commit_data"
- //! and the call to "insert_commit".
- //!
- //!
+ //! and the call to "insert_commit".
+ //!
+ //!
//! <b>Effects</b>: Inserts new_node in the set using the information obtained
//! from the "commit_data" that a previous "insert_check" filled.
//!
//! <b>Complexity</b>: Constant time.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function has only sense if a "insert_unique_check" has been
//! previously executed to fill "commit_data". No value should be inserted or
//! erased between the "insert_check" and "insert_commit" calls.
@@ -687,23 +712,23 @@ class sgtree_algorithms
}
//! <b>Requires</b>: header must be the header of a tree.
- //!
+ //!
//! <b>Effects</b>: Rebalances the tree.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear.
static void rebalance(const node_ptr & header)
{ tree_algorithms::rebalance(header); }
//! <b>Requires</b>: old_root is a node of a tree.
- //!
+ //!
//! <b>Effects</b>: Rebalances the subtree rooted at old_root.
//!
//! <b>Returns</b>: The new root of the subtree.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear.
static node_ptr rebalance_subtree(const node_ptr & old_root)
{ return tree_algorithms::rebalance_subtree(old_root); }
@@ -713,7 +738,7 @@ class sgtree_algorithms
//! <b>Effects</b>: Returns a pointer to the header node of the tree.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static node_ptr get_header(const node_ptr & n)
{ return tree_algorithms::get_header(n); }
@@ -722,11 +747,11 @@ class sgtree_algorithms
private:
//! <b>Requires</b>: p is a node of a tree.
- //!
+ //!
//! <b>Effects</b>: Returns true if p is the header of the tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static bool is_header(const const_node_ptr & p)
{ return tree_algorithms::is_header(p); }
@@ -774,8 +799,8 @@ class sgtree_algorithms
/// @endcond
};
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/slist.hpp b/boost/intrusive/slist.hpp
index 505343869a..d7fc1316b1 100644
--- a/boost/intrusive/slist.hpp
+++ b/boost/intrusive/slist.hpp
@@ -1,7 +1,7 @@
/////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -75,12 +75,12 @@ struct slist_defaults
/// @endcond
-//! The class template slist is an intrusive container, that encapsulates
-//! a singly-linked list. You can use such a list to squeeze the last bit
-//! of performance from your application. Unfortunately, the little gains
-//! come with some huge drawbacks. A lot of member functions can't be
-//! implemented as efficiently as for standard containers. To overcome
-//! this limitation some other member functions with rather unusual semantics
+//! The class template slist is an intrusive container, that encapsulates
+//! a singly-linked list. You can use such a list to squeeze the last bit
+//! of performance from your application. Unfortunately, the little gains
+//! come with some huge drawbacks. A lot of member functions can't be
+//! implemented as efficiently as for standard containers. To overcome
+//! this limitation some other member functions with rather unusual semantics
//! have to be introduced.
//!
//! The template parameter \c T is the type to be managed by the container.
@@ -91,11 +91,11 @@ struct slist_defaults
//! \c base_hook<>/member_hook<>/value_traits<>,
//! \c constant_time_size<>, \c size_type<>,
//! \c linear<> and \c cache_last<>.
-//!
-//! The iterators of slist are forward iterators. slist provides a static
-//! function called "previous" to compute the previous iterator of a given iterator.
-//! This function has linear complexity. To improve the usability esp. with
-//! the '*_after' functions, ++end() == begin() and previous(begin()) == end()
+//!
+//! The iterators of slist are forward iterators. slist provides a static
+//! function called "previous" to compute the previous iterator of a given iterator.
+//! This function has linear complexity. To improve the usability esp. with
+//! the '*_after' functions, ++end() == begin() and previous(begin()) == end()
//! are defined. An new special function "before_begin()" is defined, which returns
//! an iterator that points one less the beginning of the list: ++before_begin() == begin()
#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
@@ -151,7 +151,7 @@ class slist_impl
//noncopyable
BOOST_MOVABLE_BUT_NOT_COPYABLE(slist_impl)
- enum { safemode_or_autounlink =
+ enum { safemode_or_autounlink =
(int)real_value_traits::link_mode == (int)auto_unlink ||
(int)real_value_traits::link_mode == (int)safe_link };
@@ -273,10 +273,10 @@ class slist_impl
{ return this->get_real_value_traits(detail::bool_<external_value_traits>()); }
public:
- //! <b>Effects</b>: constructs an empty list.
- //!
- //! <b>Complexity</b>: Constant
- //!
+ //! <b>Effects</b>: constructs an empty list.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks).
slist_impl(const value_traits &v_traits = value_traits())
@@ -284,11 +284,11 @@ class slist_impl
{ this->set_default_constructed_state(); }
//! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
- //!
+ //!
//! <b>Effects</b>: Constructs a list equal to [first,last).
- //!
- //! <b>Complexity</b>: Linear in std::distance(b, e). No copy constructors are called.
- //!
+ //!
+ //! <b>Complexity</b>: Linear in std::distance(b, e). No copy constructors are called.
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks).
template<class Iterator>
@@ -300,44 +300,44 @@ class slist_impl
}
//! <b>Effects</b>: to-do
- //!
+ //!
slist_impl(BOOST_RV_REF(slist_impl) x)
: data_(::boost::move(x.priv_value_traits()))
{
this->priv_size_traits().set_size(size_type(0));
- node_algorithms::init_header(this->get_root_node());
+ node_algorithms::init_header(this->get_root_node());
this->swap(x);
}
//! <b>Effects</b>: to-do
- //!
- slist_impl& operator=(BOOST_RV_REF(slist_impl) x)
+ //!
+ slist_impl& operator=(BOOST_RV_REF(slist_impl) x)
{ this->swap(x); return *this; }
//! <b>Effects</b>: If it's a safe-mode
//! or auto-unlink value, the destructor does nothing
- //! (ie. no code is generated). Otherwise it detaches all elements from this.
- //! In this case the objects in the list are not deleted (i.e. no destructors
+ //! (ie. no code is generated). Otherwise it detaches all elements from this.
+ //! In this case the objects in the list are not deleted (i.e. no destructors
//! are called), but the hooks according to the value_traits template parameter
//! are set to their default value.
- //!
- //! <b>Complexity</b>: Linear to the number of elements in the list, if
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements in the list, if
//! it's a safe-mode or auto-unlink value. Otherwise constant.
~slist_impl()
{}
//! <b>Effects</b>: Erases all the elements of the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements of the list.
//! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references) to the erased elements.
void clear()
{
if(safemode_or_autounlink){
- this->clear_and_dispose(detail::null_disposer());
+ this->clear_and_dispose(detail::null_disposer());
}
else{
this->set_default_constructed_state();
@@ -348,11 +348,11 @@ class slist_impl
//!
//! <b>Effects</b>: Erases all the elements of the container
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements of the list.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators to the erased elements.
template <class Disposer>
void clear_and_dispose(Disposer disposer)
@@ -369,16 +369,16 @@ class slist_impl
}
//! <b>Requires</b>: value must be an lvalue.
- //!
+ //!
//! <b>Effects</b>: Inserts the value in the front of the list.
//! No copy constructors are called.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
- void push_front(reference value)
+ void push_front(reference value)
{
node_ptr to_insert = get_real_value_traits().to_node_ptr(value);
if(safemode_or_autounlink)
@@ -388,22 +388,22 @@ class slist_impl
this->set_last_node(to_insert);
}
}
- node_algorithms::link_after(this->get_root_node(), to_insert);
+ node_algorithms::link_after(this->get_root_node(), to_insert);
this->priv_size_traits().increment();
}
//! <b>Requires</b>: value must be an lvalue.
- //!
+ //!
//! <b>Effects</b>: Inserts the value in the back of the list.
//! No copy constructors are called.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! This function is only available is cache_last<> is true.
- void push_back(reference value)
+ void push_back(reference value)
{
BOOST_STATIC_ASSERT((cache_last));
this->insert_after(const_iterator(this->get_last_node(), this), value);
@@ -411,24 +411,24 @@ class slist_impl
//! <b>Effects</b>: Erases the first element of the list.
//! No destructors are called.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references) to the erased element.
- void pop_front()
+ void pop_front()
{ return this->pop_front_and_dispose(detail::null_disposer()); }
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//!
//! <b>Effects</b>: Erases the first element of the list.
//! Disposer::operator()(pointer) is called for the removed element.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators to the erased element.
template<class Disposer>
void pop_front_and_dispose(Disposer disposer)
@@ -447,23 +447,23 @@ class slist_impl
}
//! <b>Effects</b>: Returns a reference to the first element of the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
reference front()
{ return *this->get_real_value_traits().to_value_ptr(node_traits::get_next(this->get_root_node())); }
//! <b>Effects</b>: Returns a const_reference to the first element of the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
const_reference front() const
{ return *this->get_real_value_traits().to_value_ptr(uncast(node_traits::get_next(this->get_root_node()))); }
//! <b>Effects</b>: Returns a reference to the last element of the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
//!
//! <b>Complexity</b>: Constant.
@@ -477,9 +477,9 @@ class slist_impl
}
//! <b>Effects</b>: Returns a const_reference to the last element of the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
//!
//! <b>Note</b>: Does not affect the validity of iterators and references.
@@ -491,165 +491,165 @@ class slist_impl
}
//! <b>Effects</b>: Returns an iterator to the first element contained in the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- iterator begin()
+ iterator begin()
{ return iterator (node_traits::get_next(this->get_root_node()), this); }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator begin() const
+ const_iterator begin() const
{ return const_iterator (node_traits::get_next(this->get_root_node()), this); }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator cbegin() const
+ const_iterator cbegin() const
{ return const_iterator(node_traits::get_next(this->get_root_node()), this); }
//! <b>Effects</b>: Returns an iterator to the end of the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- iterator end()
+ iterator end()
{ return iterator(this->get_end_node(), this); }
//! <b>Effects</b>: Returns a const_iterator to the end of the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator end() const
+ const_iterator end() const
{ return const_iterator(uncast(this->get_end_node()), this); }
//! <b>Effects</b>: Returns a const_iterator to the end of the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator cend() const
+ const_iterator cend() const
{ return this->end(); }
//! <b>Effects</b>: Returns an iterator that points to a position
//! before the first element. Equivalent to "end()"
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- iterator before_begin()
+ iterator before_begin()
{ return iterator(this->get_root_node(), this); }
//! <b>Effects</b>: Returns an iterator that points to a position
//! before the first element. Equivalent to "end()"
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator before_begin() const
+ const_iterator before_begin() const
{ return const_iterator(uncast(this->get_root_node()), this); }
//! <b>Effects</b>: Returns an iterator that points to a position
//! before the first element. Equivalent to "end()"
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- const_iterator cbefore_begin() const
+ const_iterator cbefore_begin() const
{ return this->before_begin(); }
//! <b>Effects</b>: Returns an iterator to the last element contained in the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: This function is present only if cached_last<> option is true.
- iterator last()
+ iterator last()
{ return iterator (this->get_last_node(), this); }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: This function is present only if cached_last<> option is true.
- const_iterator last() const
+ const_iterator last() const
{ return const_iterator (this->get_last_node(), this); }
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: This function is present only if cached_last<> option is true.
- const_iterator clast() const
+ const_iterator clast() const
{ return const_iterator(this->get_last_node(), this); }
//! <b>Precondition</b>: end_iterator must be a valid end iterator
//! of slist.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the slist associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static slist_impl &container_from_end_iterator(iterator end_iterator)
{ return slist_impl::priv_container_from_end_iterator(end_iterator); }
//! <b>Precondition</b>: end_iterator must be a valid end const_iterator
//! of slist.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the slist associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static const slist_impl &container_from_end_iterator(const_iterator end_iterator)
{ return slist_impl::priv_container_from_end_iterator(end_iterator); }
//! <b>Effects</b>: Returns the number of the elements contained in the list.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements contained in the list.
//! if constant_time_size is false. Constant time otherwise.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
size_type size() const
{
if(constant_time_size)
return this->priv_size_traits().get_size();
else
- return node_algorithms::count(this->get_root_node()) - 1;
+ return node_algorithms::count(this->get_root_node()) - 1;
}
//! <b>Effects</b>: Returns true if the list contains no elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
bool empty() const
{ return node_algorithms::unique(this->get_root_node()); }
//! <b>Effects</b>: Swaps the elements of x and *this.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
- //! <b>Complexity</b>: Linear to the number of elements of both lists.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements of both lists.
//! Constant-time if linear<> and/or cache_last<> options are used.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
void swap(slist_impl& other)
{
@@ -669,11 +669,11 @@ class slist_impl
//! <b>Effects</b>: Moves backwards all the elements, so that the first
//! element becomes the second, the second becomes the third...
//! the last element becomes the first one.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements plus the number shifts.
- //!
+ //!
//! <b>Note</b>: Iterators Does not affect the validity of iterators and references.
void shift_backwards(size_type n = 1)
{ this->priv_shift_backwards(n, detail::bool_<linear>()); }
@@ -681,11 +681,11 @@ class slist_impl
//! <b>Effects</b>: Moves forward all the elements, so that the second
//! element becomes the first, the third becomes the second...
//! the first element becomes the last one.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements plus the number shifts.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
void shift_forward(size_type n = 1)
{ this->priv_shift_forward(n, detail::bool_<linear>()); }
@@ -694,15 +694,15 @@ class slist_impl
//! Cloner should yield to nodes equivalent to the original nodes.
//!
//! <b>Effects</b>: Erases all the elements from *this
- //! calling Disposer::operator()(pointer), clones all the
+ //! calling Disposer::operator()(pointer), clones all the
//! elements from src calling Cloner::operator()(const_reference )
//! and inserts them on *this.
//!
//! If cloner throws, all cloned elements are unlinked and disposed
//! calling Disposer::operator()(pointer).
- //!
+ //!
//! <b>Complexity</b>: Linear to erased plus inserted elements.
- //!
+ //!
//! <b>Throws</b>: If cloner throws.
template <class Cloner, class Disposer>
void clone_from(const slist_impl &src, Cloner cloner, Disposer disposer)
@@ -725,11 +725,11 @@ class slist_impl
//! No copy constructor is called.
//!
//! <b>Returns</b>: An iterator to the inserted element.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
iterator insert_after(const_iterator prev_p, reference value)
{
@@ -745,17 +745,17 @@ class slist_impl
return iterator (n, this);
}
- //! <b>Requires</b>: Dereferencing iterator must yield
+ //! <b>Requires</b>: Dereferencing iterator must yield
//! an lvalue of type value_type and prev_p must point to an element
//! contained by the list or to the end node.
- //!
+ //!
//! <b>Effects</b>: Inserts the [first, last)
//! after the position prev_p.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements inserted.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
template<class Iterator>
void insert_after(const_iterator prev_p, Iterator first, Iterator last)
@@ -769,44 +769,44 @@ class slist_impl
//!
//! <b>Effects</b>: Inserts the value before the position pointed by p.
//! No copy constructor is called.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements before p.
//! Constant-time if cache_last<> is true and p == end().
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
iterator insert(const_iterator p, reference value)
{ return this->insert_after(this->previous(p), value); }
- //! <b>Requires</b>: Dereferencing iterator must yield
- //! an lvalue of type value_type and p must point to an element
+ //! <b>Requires</b>: Dereferencing iterator must yield
+ //! an lvalue of type value_type and p must point to an element
//! contained by the list or to the end node.
- //!
+ //!
//! <b>Effects</b>: Inserts the pointed by b and e
//! before the position p. No copy constructors are called.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements inserted plus linear
//! to the elements before b.
//! Linear to the number of elements to insert if cache_last<> option is true and p == end().
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
template<class Iterator>
void insert(const_iterator p, Iterator b, Iterator e)
{ return this->insert_after(this->previous(p), b, e); }
- //! <b>Effects</b>: Erases the element after the element pointed by prev of
+ //! <b>Effects</b>: Erases the element after the element pointed by prev of
//! the list. No destructors are called.
//!
//! <b>Returns</b>: the first element remaining beyond the removed elements,
//! or end() if no such element exists.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references) to the
//! erased element.
iterator erase_after(const_iterator prev)
@@ -817,12 +817,12 @@ class slist_impl
//!
//! <b>Returns</b>: the first element remaining beyond the removed elements,
//! or end() if no such element exists.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of erased elements if it's a safe-mode
//! , auto-unlink value or constant-time size is activated. Constant time otherwise.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references) to the
//! erased element.
iterator erase_after(const_iterator before_first, const_iterator last)
@@ -849,12 +849,12 @@ class slist_impl
//!
//! <b>Returns</b>: the first element remaining beyond the removed elements,
//! or end() if no such element exists.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
- //! <b>Complexity</b>: constant-time if link_mode is normal_link.
+ //!
+ //! <b>Complexity</b>: constant-time if link_mode is normal_link.
//! Linear to the elements (last - before_first) otherwise.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references) to the
//! erased element.
iterator erase_after(const_iterator before_first, const_iterator last, difference_type n)
@@ -879,33 +879,33 @@ class slist_impl
}
}
- //! <b>Effects</b>: Erases the element pointed by i of the list.
+ //! <b>Effects</b>: Erases the element pointed by i of the list.
//! No destructors are called.
//!
//! <b>Returns</b>: the first element remaining beyond the removed element,
//! or end() if no such element exists.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the elements before i.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references) to the
//! erased element.
iterator erase(const_iterator i)
{ return this->erase_after(this->previous(i)); }
//! <b>Requires</b>: first and last must be valid iterator to elements in *this.
- //!
+ //!
//! <b>Effects</b>: Erases the range pointed by b and e.
//! No destructors are called.
//!
//! <b>Returns</b>: the first element remaining beyond the removed elements,
//! or end() if no such element exists.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the elements before last.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references) to the
//! erased elements.
iterator erase(const_iterator first, const_iterator last)
@@ -917,12 +917,12 @@ class slist_impl
//!
//! <b>Returns</b>: the first element remaining beyond the removed elements,
//! or end() if no such element exists.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: linear to the elements before first if link_mode is normal_link
//! and constant_time_size is activated. Linear to the elements before last otherwise.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references) to the
//! erased element.
iterator erase(const_iterator first, const_iterator last, difference_type n)
@@ -930,17 +930,17 @@ class slist_impl
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//!
- //! <b>Effects</b>: Erases the element after the element pointed by prev of
+ //! <b>Effects</b>: Erases the element after the element pointed by prev of
//! the list.
//! Disposer::operator()(pointer) is called for the removed element.
//!
//! <b>Returns</b>: the first element remaining beyond the removed elements,
//! or end() if no such element exists.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators to the erased element.
template<class Disposer>
iterator erase_after_and_dispose(const_iterator prev, Disposer disposer)
@@ -992,11 +992,11 @@ class slist_impl
//!
//! <b>Returns</b>: the first element remaining beyond the removed elements,
//! or end() if no such element exists.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Lineal to the elements (last - before_first + 1).
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators to the erased element.
template<class Disposer>
iterator erase_after_and_dispose(const_iterator before_first, const_iterator last, Disposer disposer)
@@ -1020,17 +1020,17 @@ class slist_impl
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//!
- //! <b>Effects</b>: Erases the element pointed by i of the list.
+ //! <b>Effects</b>: Erases the element pointed by i of the list.
//! No destructors are called.
//! Disposer::operator()(pointer) is called for the removed element.
//!
//! <b>Returns</b>: the first element remaining beyond the removed element,
//! or end() if no such element exists.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the elements before i.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references) to the
//! erased element.
template<class Disposer>
@@ -1045,38 +1045,38 @@ class slist_impl
//! <b>Requires</b>: first and last must be valid iterator to elements in *this.
//! Disposer::operator()(pointer) shouldn't throw.
- //!
+ //!
//! <b>Effects</b>: Erases the range pointed by b and e.
//! No destructors are called.
//! Disposer::operator()(pointer) is called for the removed elements.
//!
//! <b>Returns</b>: the first element remaining beyond the removed elements,
//! or end() if no such element exists.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of erased elements plus linear
//! to the elements before first.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references) to the
//! erased elements.
template<class Disposer>
iterator erase_and_dispose(const_iterator first, const_iterator last, Disposer disposer)
{ return this->erase_after_and_dispose(this->previous(first), last, disposer); }
- //! <b>Requires</b>: Dereferencing iterator must yield
+ //! <b>Requires</b>: Dereferencing iterator must yield
//! an lvalue of type value_type.
- //!
+ //!
//! <b>Effects</b>: Clears the list and inserts the range pointed by b and e.
//! No destructors or copy constructors are called.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements inserted plus
//! linear to the elements contained in the list if it's a safe-mode
//! or auto-unlink value.
//! Linear to the number of elements inserted in the list otherwise.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements.
template<class Iterator>
@@ -1088,18 +1088,18 @@ class slist_impl
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//!
- //! <b>Requires</b>: Dereferencing iterator must yield
+ //! <b>Requires</b>: Dereferencing iterator must yield
//! an lvalue of type value_type.
- //!
+ //!
//! <b>Effects</b>: Clears the list and inserts the range pointed by b and e.
//! No destructors or copy constructors are called.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements inserted plus
//! linear to the elements contained in the list.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements.
template<class Iterator, class Disposer>
@@ -1111,18 +1111,18 @@ class slist_impl
//! <b>Requires</b>: prev must point to an element contained by this list or
//! to the before_begin() element
- //!
+ //!
//! <b>Effects</b>: Transfers all the elements of list x to this list, after the
//! the element pointed by prev. No destructors or copy constructors are called.
- //!
+ //!
//! <b>Returns</b>: Nothing.
- //!
+ //!
//! <b>Throws</b>: Nothing.
//!
//! <b>Complexity</b>: In general, linear to the elements contained in x.
- //! Constant-time if cache_last<> option is true and also constant-time if
+ //! Constant-time if cache_last<> option is true and also constant-time if
//! linear<> option is true "this" is empty and "last" is not used.
- //!
+ //!
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
//! list. Iterators of this list and all the references are not invalidated.
//!
@@ -1159,14 +1159,14 @@ class slist_impl
//! <b>Requires</b>: prev must point to an element contained by this list or
//! to the before_begin() element. prev_ele must point to an element contained in list
//! x or must be x.before_begin().
- //!
- //! <b>Effects</b>: Transfers the element after prev_ele, from list x to this list,
+ //!
+ //! <b>Effects</b>: Transfers the element after prev_ele, from list x to this list,
//! after the element pointed by prev. No destructors or copy constructors are called.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
//! list. Iterators of this list and all the references are not invalidated.
void splice_after(const_iterator prev_pos, slist_impl &x, const_iterator prev_ele)
@@ -1177,17 +1177,17 @@ class slist_impl
//! <b>Requires</b>: prev_pos must be a dereferenceable iterator in *this or be
//! before_begin(), and before_first and before_last belong to x and
- //! ++before_first != x.end() && before_last != x.end().
- //!
+ //! ++before_first != x.end() && before_last != x.end().
+ //!
//! <b>Effects</b>: Transfers the range (before_first, before_last] from list x to this
//! list, after the element pointed by prev_pos.
//! No destructors or copy constructors are called.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements transferred
//! if constant_time_size is true. Constant-time otherwise.
- //!
+ //!
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
//! list. Iterators of this list and all the references are not invalidated.
void splice_after(const_iterator prev_pos, slist_impl &x, const_iterator before_first, const_iterator before_last)
@@ -1203,14 +1203,14 @@ class slist_impl
//! before_begin(), and before_first and before_last belong to x and
//! ++before_first != x.end() && before_last != x.end() and
//! n == std::distance(before_first, before_last).
- //!
+ //!
//! <b>Effects</b>: Transfers the range (before_first, before_last] from list x to this
//! list, after the element pointed by p. No destructors or copy constructors are called.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
//! list. Iterators of this list and all the references are not invalidated.
void splice_after(const_iterator prev_pos, slist_impl &x, const_iterator before_first, const_iterator before_last, difference_type n)
@@ -1227,19 +1227,19 @@ class slist_impl
}
//! <b>Requires</b>: it is an iterator to an element in *this.
- //!
+ //!
//! <b>Effects</b>: Transfers all the elements of list x to this list, before the
//! the element pointed by it. No destructors or copy constructors are called.
- //!
+ //!
//! <b>Returns</b>: Nothing.
- //!
+ //!
//! <b>Throws</b>: Nothing.
//!
//! <b>Complexity</b>: Linear to the elements contained in x plus linear to
//! the elements before it.
//! Linear to the elements before it if cache_last<> option is true.
//! Constant-time if cache_last<> option is true and it == end().
- //!
+ //!
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
//! list. Iterators of this list and all the references are not invalidated.
//!
@@ -1253,66 +1253,66 @@ class slist_impl
//! <b>Requires</b>: it p must be a valid iterator of *this.
//! elem must point to an element contained in list
//! x.
- //!
- //! <b>Effects</b>: Transfers the element elem, from list x to this list,
+ //!
+ //! <b>Effects</b>: Transfers the element elem, from list x to this list,
//! before the element pointed by pos. No destructors or copy constructors are called.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the elements before pos and before elem.
//! Linear to the elements before elem if cache_last<> option is true and pos == end().
- //!
+ //!
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
//! list. Iterators of this list and all the references are not invalidated.
void splice(const_iterator pos, slist_impl &x, const_iterator elem)
{ return this->splice_after(this->previous(pos), x, x.previous(elem)); }
//! <b>Requires</b>: pos must be a dereferenceable iterator in *this
- //! and first and last belong to x and first and last a valid range on x.
- //!
+ //! and first and last belong to x and first and last a valid range on x.
+ //!
//! <b>Effects</b>: Transfers the range [first, last) from list x to this
//! list, before the element pointed by pos.
//! No destructors or copy constructors are called.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the sum of elements before pos, first, and last
//! plus linear to the number of elements transferred if constant_time_size is true.
//! Linear to the sum of elements before first, and last
//! plus linear to the number of elements transferred if constant_time_size is true
//! if cache_last<> is true and pos == end()
- //!
+ //!
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
//! list. Iterators of this list and all the references are not invalidated.
void splice(const_iterator pos, slist_impl &x, const_iterator first, const_iterator last)
{ return this->splice_after(this->previous(pos), x, x.previous(first), x.previous(last)); }
//! <b>Requires</b>: pos must be a dereferenceable iterator in *this
- //! and first and last belong to x and first and last a valid range on x.
+ //! and first and last belong to x and first and last a valid range on x.
//! n == std::distance(first, last).
- //!
+ //!
//! <b>Effects</b>: Transfers the range [first, last) from list x to this
//! list, before the element pointed by pos.
//! No destructors or copy constructors are called.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the sum of elements before pos, first, and last.
//! Linear to the sum of elements before first and last
//! if cache_last<> is true and pos == end().
- //!
+ //!
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
//! list. Iterators of this list and all the references are not invalidated.
void splice(const_iterator pos, slist_impl &x, const_iterator first, const_iterator last, difference_type n)
{ return this->splice_after(this->previous(pos), x, x.previous(first), x.previous(last), n); }
- //! <b>Effects</b>: This function sorts the list *this according to std::less<value_type>.
+ //! <b>Effects</b>: This function sorts the list *this according to std::less<value_type>.
//! The sort is stable, that is, the relative order of equivalent elements is preserved.
- //!
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
//! or the predicate throws. Basic guarantee.
- //!
+ //!
//! <b>Complexity</b>: The number of comparisons is approximately N log N, where N
//! is the list's size.
//!
@@ -1368,44 +1368,44 @@ class slist_impl
//! <b>Requires</b>: p must be a comparison function that induces a strict weak
//! ordering and both *this and x must be sorted according to that ordering
- //! The lists x and *this must be distinct.
- //!
+ //! The lists x and *this must be distinct.
+ //!
//! <b>Effects</b>: This function removes all of x's elements and inserts them
- //! in order into *this. The merge is stable; that is, if an element from *this is
- //! equivalent to one from x, then the element from *this will precede the one from x.
- //!
+ //! in order into *this. The merge is stable; that is, if an element from *this is
+ //! equivalent to one from x, then the element from *this will precede the one from x.
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
//! or std::less<value_type> throws. Basic guarantee.
- //!
+ //!
//! <b>Complexity</b>: This function is linear time: it performs at most
//! size() + x.size() - 1 comparisons.
- //!
+ //!
//! <b>Note</b>: Iterators and references are not invalidated.
void sort()
{ this->sort(std::less<value_type>()); }
//! <b>Requires</b>: p must be a comparison function that induces a strict weak
//! ordering and both *this and x must be sorted according to that ordering
- //! The lists x and *this must be distinct.
- //!
+ //! The lists x and *this must be distinct.
+ //!
//! <b>Effects</b>: This function removes all of x's elements and inserts them
- //! in order into *this. The merge is stable; that is, if an element from *this is
- //! equivalent to one from x, then the element from *this will precede the one from x.
- //!
+ //! in order into *this. The merge is stable; that is, if an element from *this is
+ //! equivalent to one from x, then the element from *this will precede the one from x.
+ //!
//! <b>Returns</b>: Nothing.
- //!
+ //!
//! <b>Throws</b>: If the predicate throws. Basic guarantee.
- //!
+ //!
//! <b>Complexity</b>: This function is linear time: it performs at most
//! size() + x.size() - 1 comparisons.
- //!
+ //!
//! <b>Note</b>: Iterators and references are not invalidated.
- //!
+ //!
//! <b>Additional note</b>: If optional "last" argument is passed, it is assigned
//! to an iterator to the last transferred value or end() is x is empty.
template<class Predicate>
- void merge(slist_impl& x, Predicate p, const_iterator *last = 0)
+ void merge(slist_impl& x, Predicate p, const_iterator *last = 0)
{
const_iterator e(this->cend()), ex(x.cend()), bb(this->cbefore_begin()),
bb_next;
@@ -1432,25 +1432,25 @@ class slist_impl
}
//! <b>Effects</b>: This function removes all of x's elements and inserts them
- //! in order into *this according to std::less<value_type>. The merge is stable;
- //! that is, if an element from *this is equivalent to one from x, then the element
- //! from *this will precede the one from x.
- //!
+ //! in order into *this according to std::less<value_type>. The merge is stable;
+ //! that is, if an element from *this is equivalent to one from x, then the element
+ //! from *this will precede the one from x.
+ //!
//! <b>Throws</b>: if std::less<value_type> throws. Basic guarantee.
- //!
+ //!
//! <b>Complexity</b>: This function is linear time: it performs at most
//! size() + x.size() - 1 comparisons.
- //!
+ //!
//! <b>Note</b>: Iterators and references are not invalidated
void merge(slist_impl& x)
{ this->merge(x, std::less<value_type>()); }
- //! <b>Effects</b>: Reverses the order of elements in the list.
- //!
+ //! <b>Effects</b>: Reverses the order of elements in the list.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: This function is linear to the contained elements.
- //!
+ //!
//! <b>Note</b>: Iterators and references are not invalidated
void reverse()
{
@@ -1462,13 +1462,13 @@ class slist_impl
//! <b>Effects</b>: Removes all the elements that compare equal to value.
//! No destructors are called.
- //!
+ //!
//! <b>Throws</b>: If std::equal_to<value_type> throws. Basic guarantee.
- //!
+ //!
//! <b>Complexity</b>: Linear time. It performs exactly size() comparisons for equality.
- //!
+ //!
//! <b>Note</b>: The relative order of elements that are not removed is unchanged,
- //! and iterators to elements that are not removed remain valid. This function is
+ //! and iterators to elements that are not removed remain valid. This function is
//! linear time: it performs exactly size() comparisons for equality.
void remove(const_reference value)
{ this->remove_if(detail::equal_to_value<const_reference>(value)); }
@@ -1479,9 +1479,9 @@ class slist_impl
//! Disposer::operator()(pointer) is called for every removed element.
//!
//! <b>Throws</b>: If std::equal_to<value_type> throws. Basic guarantee.
- //!
+ //!
//! <b>Complexity</b>: Linear time. It performs exactly size() comparisons for equality.
- //!
+ //!
//! <b>Note</b>: The relative order of elements that are not removed is unchanged,
//! and iterators to elements that are not removed remain valid.
template<class Disposer>
@@ -1490,11 +1490,11 @@ class slist_impl
//! <b>Effects</b>: Removes all the elements for which a specified
//! predicate is satisfied. No destructors are called.
- //!
+ //!
//! <b>Throws</b>: If pred throws. Basic guarantee.
- //!
+ //!
//! <b>Complexity</b>: Linear time. It performs exactly size() calls to the predicate.
- //!
+ //!
//! <b>Note</b>: The relative order of elements that are not removed is unchanged,
//! and iterators to elements that are not removed remain valid.
template<class Pred>
@@ -1508,7 +1508,7 @@ class slist_impl
//! Disposer::operator()(pointer) is called for every removed element.
//!
//! <b>Throws</b>: If pred throws. Basic guarantee.
- //!
+ //!
//! <b>Complexity</b>: Linear time. It performs exactly size() comparisons for equality.
//!
//! <b>Note</b>: The relative order of elements that are not removed is unchanged,
@@ -1517,7 +1517,7 @@ class slist_impl
void remove_and_dispose_if(Pred pred, Disposer disposer)
{
const_iterator bcur(this->before_begin()), cur(this->begin()), e(this->end());
-
+
while(cur != e){
if (pred(*cur)){
cur = this->erase_after_and_dispose(bcur, disposer);
@@ -1532,26 +1532,26 @@ class slist_impl
}
}
- //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
+ //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
//! elements that are equal from the list. No destructors are called.
- //!
+ //!
//! <b>Throws</b>: If std::equal_to<value_type> throws. Basic guarantee.
- //!
+ //!
//! <b>Complexity</b>: Linear time (size()-1) comparisons calls to pred()).
- //!
+ //!
//! <b>Note</b>: The relative order of elements that are not removed is unchanged,
//! and iterators to elements that are not removed remain valid.
void unique()
{ this->unique_and_dispose(std::equal_to<value_type>(), detail::null_disposer()); }
- //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
+ //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
//! elements that satisfy some binary predicate from the list.
//! No destructors are called.
- //!
+ //!
//! <b>Throws</b>: If the predicate throws. Basic guarantee.
- //!
+ //!
//! <b>Complexity</b>: Linear time (size()-1) comparisons equality comparisons.
- //!
+ //!
//! <b>Note</b>: The relative order of elements that are not removed is unchanged,
//! and iterators to elements that are not removed remain valid.
template<class BinaryPredicate>
@@ -1560,14 +1560,14 @@ class slist_impl
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//!
- //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
+ //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
//! elements that satisfy some binary predicate from the list.
//! Disposer::operator()(pointer) is called for every removed element.
- //!
+ //!
//! <b>Throws</b>: If std::equal_to<value_type> throws. Basic guarantee.
- //!
+ //!
//! <b>Complexity</b>: Linear time (size()-1) comparisons equality comparisons.
- //!
+ //!
//! <b>Note</b>: The relative order of elements that are not removed is unchanged,
//! and iterators to elements that are not removed remain valid.
template<class Disposer>
@@ -1576,14 +1576,14 @@ class slist_impl
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//!
- //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
+ //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
//! elements that satisfy some binary predicate from the list.
//! Disposer::operator()(pointer) is called for every removed element.
- //!
+ //!
//! <b>Throws</b>: If the predicate throws. Basic guarantee.
- //!
+ //!
//! <b>Complexity</b>: Linear time (size()-1) comparisons equality comparisons.
- //!
+ //!
//! <b>Note</b>: The relative order of elements that are not removed is unchanged,
//! and iterators to elements that are not removed remain valid.
template<class BinaryPredicate, class Disposer>
@@ -1610,17 +1610,17 @@ class slist_impl
}
//! <b>Requires</b>: value must be a reference to a value inserted in a list.
- //!
+ //!
//! <b>Effects</b>: This function returns a const_iterator pointing to the element
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Note</b>: Iterators and references are not invalidated.
//! This static function is available only if the <i>value traits</i>
//! is stateless.
- static iterator s_iterator_to(reference value)
+ static iterator s_iterator_to(reference value)
{
BOOST_STATIC_ASSERT((!stateful_value_traits));
//BOOST_INTRUSIVE_INVARIANT_ASSERT (!node_algorithms::inited(value_traits::to_node_ptr(value)));
@@ -1628,17 +1628,17 @@ class slist_impl
}
//! <b>Requires</b>: value must be a const reference to a value inserted in a list.
- //!
+ //!
//! <b>Effects</b>: This function returns an iterator pointing to the element.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Note</b>: Iterators and references are not invalidated.
//! This static function is available only if the <i>value traits</i>
//! is stateless.
- static const_iterator s_iterator_to(const_reference value)
+ static const_iterator s_iterator_to(const_reference value)
{
BOOST_STATIC_ASSERT((!stateful_value_traits));
//BOOST_INTRUSIVE_INVARIANT_ASSERT (!node_algorithms::inited(value_traits::to_node_ptr(const_cast<reference> (value))));
@@ -1646,28 +1646,28 @@ class slist_impl
}
//! <b>Requires</b>: value must be a reference to a value inserted in a list.
- //!
+ //!
//! <b>Effects</b>: This function returns a const_iterator pointing to the element
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Note</b>: Iterators and references are not invalidated.
- iterator iterator_to(reference value)
+ iterator iterator_to(reference value)
{
//BOOST_INTRUSIVE_INVARIANT_ASSERT (!node_algorithms::inited(value_traits::to_node_ptr(value)));
return iterator (value_traits::to_node_ptr(value), this);
}
//! <b>Requires</b>: value must be a const reference to a value inserted in a list.
- //!
+ //!
//! <b>Effects</b>: This function returns an iterator pointing to the element.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Note</b>: Iterators and references are not invalidated.
const_iterator iterator_to(const_reference value) const
{
@@ -1675,35 +1675,35 @@ class slist_impl
return const_iterator (value_traits::to_node_ptr(const_cast<reference> (value)), this);
}
- //! <b>Returns</b>: The iterator to the element before i in the list.
- //! Returns the end-iterator, if either i is the begin-iterator or the
- //! list is empty.
- //!
+ //! <b>Returns</b>: The iterator to the element before i in the list.
+ //! Returns the end-iterator, if either i is the begin-iterator or the
+ //! list is empty.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements before i.
//! Constant if cache_last<> is true and i == end().
iterator previous(iterator i)
{ return this->previous(this->cbefore_begin(), i); }
- //! <b>Returns</b>: The const_iterator to the element before i in the list.
- //! Returns the end-const_iterator, if either i is the begin-const_iterator or
- //! the list is empty.
- //!
+ //! <b>Returns</b>: The const_iterator to the element before i in the list.
+ //! Returns the end-const_iterator, if either i is the begin-const_iterator or
+ //! the list is empty.
+ //!
//! <b>Throws</b>: Nothing.
- //!
- //! <b>Complexity</b>: Linear to the number of elements before i.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements before i.
//! Constant if cache_last<> is true and i == end().
const_iterator previous(const_iterator i) const
{ return this->previous(this->cbefore_begin(), i); }
//! <b>Returns</b>: The iterator to the element before i in the list,
//! starting the search on element after prev_from.
- //! Returns the end-iterator, if either i is the begin-iterator or the
- //! list is empty.
- //!
+ //! Returns the end-iterator, if either i is the begin-iterator or the
+ //! list is empty.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements before i.
//! Constant if cache_last<> is true and i == end().
iterator previous(const_iterator prev_from, iterator i)
@@ -1711,12 +1711,12 @@ class slist_impl
//! <b>Returns</b>: The const_iterator to the element before i in the list,
//! starting the search on element after prev_from.
- //! Returns the end-const_iterator, if either i is the begin-const_iterator or
- //! the list is empty.
- //!
+ //! Returns the end-const_iterator, if either i is the begin-const_iterator or
+ //! the list is empty.
+ //!
//! <b>Throws</b>: Nothing.
- //!
- //! <b>Complexity</b>: Linear to the number of elements before i.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements before i.
//! Constant if cache_last<> is true and i == end().
const_iterator previous(const_iterator prev_from, const_iterator i) const
{
@@ -1730,17 +1730,17 @@ class slist_impl
//! <b>Requires</b>: prev_pos must be a dereferenceable iterator in *this or be
//! before_begin(), and before_first and before_last belong to x and
- //! ++before_first != x.end() && before_last != x.end().
- //!
+ //! ++before_first != x.end() && before_last != x.end().
+ //!
//! <b>Effects</b>: Transfers the range (before_first, before_last] to this
//! list, after the element pointed by prev_pos.
//! No destructors or copy constructors are called.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements transferred
//! if constant_time_size is true. Constant-time otherwise.
- //!
+ //!
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
//! list. Iterators of this list and all the references are not invalidated.
void incorporate_after(const_iterator prev_from, const node_ptr & first, const node_ptr & before_last)
@@ -1756,14 +1756,14 @@ class slist_impl
//! before_begin(), and before_first and before_last belong to x and
//! ++before_first != x.end() && before_last != x.end() and
//! n == std::distance(first, before_last) + 1.
- //!
+ //!
//! <b>Effects</b>: Transfers the range (before_first, before_last] from list x to this
//! list, after the element pointed by p. No destructors or copy constructors are called.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
//! list. Iterators of this list and all the references are not invalidated.
void incorporate_after(const_iterator prev_pos, const node_ptr & first, const node_ptr & before_last, difference_type n)
@@ -1837,7 +1837,7 @@ class slist_impl
void priv_shift_forward(size_type n, detail::bool_<false>)
{
- node_ptr last = node_algorithms::move_backwards(this->get_root_node(), (std::size_t)n);
+ node_ptr last = node_algorithms::move_backwards(this->get_root_node(), (std::size_t)n);
if(cache_last && last){
this->set_last_node(last);
}
@@ -1860,7 +1860,7 @@ class slist_impl
{
bool other_was_empty = false;
if(this_impl->empty()){
- //Check if both are empty or
+ //Check if both are empty or
if(other_impl->empty())
return;
//If this is empty swap pointers
@@ -2043,7 +2043,7 @@ struct make_slist
{
/// @cond
typedef typename pack_options
- < slist_defaults<T>,
+ < slist_defaults<T>,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4, O5
#else
@@ -2075,7 +2075,7 @@ template<class T, class O1, class O2, class O3, class O4, class O5>
template<class T, class ...Options>
#endif
class slist
- : public make_slist<T,
+ : public make_slist<T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4, O5
#else
@@ -2084,7 +2084,7 @@ class slist
>::type
{
typedef typename make_slist
- <T,
+ <T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4, O5
#else
@@ -2126,8 +2126,8 @@ class slist
#endif
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/slist_hook.hpp b/boost/intrusive/slist_hook.hpp
index 1debe66c86..cd94a7e7aa 100644
--- a/boost/intrusive/slist_hook.hpp
+++ b/boost/intrusive/slist_hook.hpp
@@ -1,7 +1,7 @@
/////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -46,7 +46,7 @@ struct make_slist_base_hook
{
/// @cond
typedef typename pack_options
- < hook_defaults,
+ < hook_defaults,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3
#else
@@ -64,16 +64,16 @@ struct make_slist_base_hook
typedef implementation_defined type;
};
-//! Derive a class from slist_base_hook in order to store objects in
-//! in an list. slist_base_hook holds the data necessary to maintain the
+//! Derive a class from slist_base_hook in order to store objects in
+//! in an list. slist_base_hook holds the data necessary to maintain the
//! list and provides an appropriate value_traits class for list.
-//!
+//!
//! The hook admits the following options: \c tag<>, \c void_pointer<> and
//! \c link_mode<>.
//!
-//! \c tag<> defines a tag to identify the node.
-//! The same tag value can be used in different classes, but if a class is
-//! derived from more than one \c list_base_hook, then each \c list_base_hook needs its
+//! \c tag<> defines a tag to identify the node.
+//! The same tag value can be used in different classes, but if a class is
+//! derived from more than one \c list_base_hook, then each \c list_base_hook needs its
//! unique tag.
//!
//! \c link_mode<> will specify the linking mode of the hook (\c normal_link,
@@ -99,27 +99,27 @@ class slist_base_hook
public:
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
slist_base_hook();
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state. The argument is ignored.
- //!
- //! <b>Throws</b>: Nothing.
- //!
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
//! <b>Rationale</b>: Providing a copy-constructor
- //! makes classes using the hook STL-compliant without forcing the
+ //! makes classes using the hook STL-compliant without forcing the
//! user to do some additional work. \c swap can be used to emulate
//! move-semantics.
slist_base_hook(const slist_base_hook& );
//! <b>Effects</b>: Empty function. The argument is ignored.
- //!
- //! <b>Throws</b>: Nothing.
- //!
- //! <b>Rationale</b>: Providing an assignment operator
- //! makes classes using the hook STL-compliant without forcing the
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing an assignment operator
+ //! makes classes using the hook STL-compliant without forcing the
//! user to do some additional work. \c swap can be used to emulate
//! move-semantics.
slist_base_hook& operator=(const slist_base_hook& );
@@ -128,37 +128,37 @@ class slist_base_hook
//! nothing (ie. no code is generated). If link_mode is \c safe_link and the
//! object is stored in an slist an assertion is raised. If link_mode is
//! \c auto_unlink and \c is_linked() is true, the node is unlinked.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
~slist_base_hook();
- //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
- //! related to those nodes in one or two containers. That is, if the node
- //! this is part of the element e1, the node x is part of the element e2
- //! and both elements are included in the containers s1 and s2, then after
- //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
- //! at the position of e1. If one element is not in a container, then
- //! after the swap-operation the other element is not in a container.
- //! Iterators to e1 and e2 related to those nodes are invalidated.
+ //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
+ //! related to those nodes in one or two containers. That is, if the node
+ //! this is part of the element e1, the node x is part of the element e2
+ //! and both elements are included in the containers s1 and s2, then after
+ //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
+ //! at the position of e1. If one element is not in a container, then
+ //! after the swap-operation the other element is not in a container.
+ //! Iterators to e1 and e2 related to those nodes are invalidated.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Constant
//!
- //! <b>Throws</b>: Nothing.
+ //! <b>Throws</b>: Nothing.
void swap_nodes(slist_base_hook &other);
//! <b>Precondition</b>: link_mode must be \c safe_link or \c auto_unlink.
//!
//! <b>Returns</b>: true, if the node belongs to a container, false
- //! otherwise. This function can be used to test whether \c slist::iterator_to
- //! will return a valid iterator.
+ //! otherwise. This function can be used to test whether \c slist::iterator_to
+ //! will return a valid iterator.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Constant
bool is_linked() const;
//! <b>Effects</b>: Removes the node if it's inserted in a container.
//! This function is only allowed if link_mode is \c auto_unlink.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
void unlink();
#endif
};
@@ -174,7 +174,7 @@ struct make_slist_member_hook
{
/// @cond
typedef typename pack_options
- < hook_defaults,
+ < hook_defaults,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3
#else
@@ -193,12 +193,12 @@ struct make_slist_member_hook
};
//! Put a public data member slist_member_hook in order to store objects of this class in
-//! an list. slist_member_hook holds the data necessary for maintaining the list and
+//! an list. slist_member_hook holds the data necessary for maintaining the list and
//! provides an appropriate value_traits class for list.
-//!
+//!
//! The hook admits the following options: \c void_pointer<> and
//! \c link_mode<>.
-//!
+//!
//! \c link_mode<> will specify the linking mode of the hook (\c normal_link,
//! \c auto_unlink or \c safe_link).
//!
@@ -222,27 +222,27 @@ class slist_member_hook
public:
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
slist_member_hook();
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state. The argument is ignored.
- //!
- //! <b>Throws</b>: Nothing.
- //!
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
//! <b>Rationale</b>: Providing a copy-constructor
- //! makes classes using the hook STL-compliant without forcing the
+ //! makes classes using the hook STL-compliant without forcing the
//! user to do some additional work. \c swap can be used to emulate
//! move-semantics.
slist_member_hook(const slist_member_hook& );
//! <b>Effects</b>: Empty function. The argument is ignored.
- //!
- //! <b>Throws</b>: Nothing.
- //!
- //! <b>Rationale</b>: Providing an assignment operator
- //! makes classes using the hook STL-compliant without forcing the
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing an assignment operator
+ //! makes classes using the hook STL-compliant without forcing the
//! user to do some additional work. \c swap can be used to emulate
//! move-semantics.
slist_member_hook& operator=(const slist_member_hook& );
@@ -251,43 +251,43 @@ class slist_member_hook
//! nothing (ie. no code is generated). If link_mode is \c safe_link and the
//! object is stored in an slist an assertion is raised. If link_mode is
//! \c auto_unlink and \c is_linked() is true, the node is unlinked.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
~slist_member_hook();
- //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
- //! related to those nodes in one or two containers. That is, if the node
- //! this is part of the element e1, the node x is part of the element e2
- //! and both elements are included in the containers s1 and s2, then after
- //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
- //! at the position of e1. If one element is not in a container, then
- //! after the swap-operation the other element is not in a container.
- //! Iterators to e1 and e2 related to those nodes are invalidated.
+ //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
+ //! related to those nodes in one or two containers. That is, if the node
+ //! this is part of the element e1, the node x is part of the element e2
+ //! and both elements are included in the containers s1 and s2, then after
+ //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
+ //! at the position of e1. If one element is not in a container, then
+ //! after the swap-operation the other element is not in a container.
+ //! Iterators to e1 and e2 related to those nodes are invalidated.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Constant
//!
- //! <b>Throws</b>: Nothing.
+ //! <b>Throws</b>: Nothing.
void swap_nodes(slist_member_hook &other);
//! <b>Precondition</b>: link_mode must be \c safe_link or \c auto_unlink.
//!
//! <b>Returns</b>: true, if the node belongs to a container, false
- //! otherwise. This function can be used to test whether \c slist::iterator_to
- //! will return a valid iterator.
+ //! otherwise. This function can be used to test whether \c slist::iterator_to
+ //! will return a valid iterator.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Constant
bool is_linked() const;
//! <b>Effects</b>: Removes the node if it's inserted in a container.
//! This function is only allowed if link_mode is \c auto_unlink.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
void unlink();
#endif
};
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/splay_set.hpp b/boost/intrusive/splay_set.hpp
index 5a21a06af8..e7f3b9470b 100644
--- a/boost/intrusive/splay_set.hpp
+++ b/boost/intrusive/splay_set.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2007-2009
+// (C) Copyright Ion Gaztanaga 2007-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -22,9 +22,9 @@
namespace boost {
namespace intrusive {
-//! The class template splay_set is an intrusive container, that mimics most of
+//! The class template splay_set is an intrusive container, that mimics most of
//! the interface of std::set as described in the C++ standard.
-//!
+//!
//! The template parameter \c T is the type to be managed by the container.
//! The user can specify additional options and if no options are provided
//! default options are used.
@@ -79,30 +79,30 @@ class splay_set_impl
/// @endcond
public:
- //! <b>Effects</b>: Constructs an empty splay_set.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //! <b>Effects</b>: Constructs an empty splay_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
- //! or the copy constructor of the value_compare object throws.
+ //! or the copy constructor of the value_compare object throws.
splay_set_impl( const value_compare &cmp = value_compare()
- , const value_traits &v_traits = value_traits())
+ , const value_traits &v_traits = value_traits())
: tree_(cmp, v_traits)
{}
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
//! cmp must be a comparison function that induces a strict weak ordering.
- //!
- //! <b>Effects</b>: Constructs an empty splay_set and inserts elements from
+ //!
+ //! <b>Effects</b>: Constructs an empty splay_set and inserts elements from
//! [b, e).
- //!
- //! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
+ //!
+ //! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
//! comp and otherwise amortized N * log N, where N is std::distance(last, first).
- //!
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
- //! or the copy constructor/operator() of the value_compare object throws.
+ //! or the copy constructor/operator() of the value_compare object throws.
template<class Iterator>
splay_set_impl( Iterator b, Iterator e
, const value_compare &cmp = value_compare()
@@ -111,135 +111,135 @@ class splay_set_impl
{}
//! <b>Effects</b>: to-do
- //!
- splay_set_impl(BOOST_RV_REF(splay_set_impl) x)
+ //!
+ splay_set_impl(BOOST_RV_REF(splay_set_impl) x)
: tree_(::boost::move(x.tree_))
{}
//! <b>Effects</b>: to-do
- //!
- splay_set_impl& operator=(BOOST_RV_REF(splay_set_impl) x)
+ //!
+ splay_set_impl& operator=(BOOST_RV_REF(splay_set_impl) x)
{ tree_ = ::boost::move(x.tree_); return *this; }
- //! <b>Effects</b>: Detaches all elements from this. The objects in the splay_set
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the splay_set
//! are not deleted (i.e. no destructors are called).
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- ~splay_set_impl()
+ ~splay_set_impl()
{}
//! <b>Effects</b>: Returns an iterator pointing to the beginning of the splay_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator begin()
{ return tree_.begin(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the splay_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator begin() const
{ return tree_.begin(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the splay_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cbegin() const
{ return tree_.cbegin(); }
//! <b>Effects</b>: Returns an iterator pointing to the end of the splay_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator end()
{ return tree_.end(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the splay_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator end() const
{ return tree_.end(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the splay_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cend() const
{ return tree_.cend(); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning of the
//! reversed splay_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rbegin()
{ return tree_.rbegin(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed splay_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rbegin() const
{ return tree_.rbegin(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed splay_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crbegin() const
{ return tree_.crbegin(); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the end
//! of the reversed splay_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rend()
{ return tree_.rend(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed splay_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rend() const
{ return tree_.rend(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed splay_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crend() const
{ return tree_.crend(); }
//! <b>Precondition</b>: end_iterator must be a valid end iterator
//! of splay_set.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the splay_set associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static splay_set_impl &container_from_end_iterator(iterator end_iterator)
{
@@ -250,11 +250,11 @@ class splay_set_impl
//! <b>Precondition</b>: end_iterator must be a valid end const_iterator
//! of splay_set.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the splay_set associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static const splay_set_impl &container_from_end_iterator(const_iterator end_iterator)
{
@@ -264,11 +264,11 @@ class splay_set_impl
}
//! <b>Precondition</b>: it must be a valid iterator of set.
- //!
+ //!
//! <b>Effects</b>: Returns a reference to the set associated to the iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static splay_set_impl &container_from_iterator(iterator it)
{
@@ -278,11 +278,11 @@ class splay_set_impl
}
//! <b>Precondition</b>: it must be a valid const_iterator of set.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the set associated to the iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
static const splay_set_impl &container_from_iterator(const_iterator it)
{
@@ -292,42 +292,42 @@ class splay_set_impl
}
//! <b>Effects</b>: Returns the key_compare object used by the splay_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If key_compare copy-constructor throws.
key_compare key_comp() const
{ return tree_.value_comp(); }
//! <b>Effects</b>: Returns the value_compare object used by the splay_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If value_compare copy-constructor throws.
value_compare value_comp() const
{ return tree_.value_comp(); }
//! <b>Effects</b>: Returns true if the container is empty.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
bool empty() const
{ return tree_.empty(); }
//! <b>Effects</b>: Returns the number of elements stored in the splay_set.
- //!
+ //!
//! <b>Complexity</b>: Linear to elements contained in *this if,
//! constant-time size option is enabled. Constant-time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
size_type size() const
{ return tree_.size(); }
//! <b>Effects</b>: Swaps the contents of two splay_sets.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If the swap() call for the comparison functor
//! found using ADL throws. Strong guarantee.
void swap(splay_set_impl& other)
@@ -337,22 +337,22 @@ class splay_set_impl
//! Cloner should yield to nodes equivalent to the original nodes.
//!
//! <b>Effects</b>: Erases all the elements from *this
- //! calling Disposer::operator()(pointer), clones all the
+ //! calling Disposer::operator()(pointer), clones all the
//! elements from src calling Cloner::operator()(const_reference )
//! and inserts them on *this. Copies the predicate from the source container.
//!
//! If cloner throws, all cloned elements are unlinked and disposed
//! calling Disposer::operator()(pointer).
- //!
+ //!
//! <b>Complexity</b>: Linear to erased plus inserted elements.
- //!
+ //!
//! <b>Throws</b>: If cloner throws or predicate copy assignment throws. Basic guarantee.
template <class Cloner, class Disposer>
void clone_from(const splay_set_impl &src, Cloner cloner, Disposer disposer)
{ tree_.clone_from(src.tree_, cloner, disposer); }
//! <b>Requires</b>: value must be an lvalue
- //!
+ //!
//! <b>Effects</b>: Tries to inserts value into the splay_set.
//!
//! <b>Returns</b>: If the value
@@ -360,38 +360,38 @@ class splay_set_impl
//! iterator to the new value and true. If there is an equivalent value
//! returns a pair containing an iterator to the already present value
//! and false.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
std::pair<iterator, bool> insert(reference value)
{ return tree_.insert_unique(value); }
//! <b>Requires</b>: value must be an lvalue
- //!
- //! <b>Effects</b>: Tries to to insert x into the splay_set, using "hint"
+ //!
+ //! <b>Effects</b>: Tries to to insert x into the splay_set, using "hint"
//! as a hint to where it will be inserted.
//!
- //! <b>Returns</b>: An iterator that points to the position where the
+ //! <b>Returns</b>: An iterator that points to the position where the
//! new element was inserted into the splay_set.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic in general, but it's amortized
//! constant time if t is inserted immediately before hint.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
iterator insert(const_iterator hint, reference value)
{ return tree_.insert_unique(hint, value); }
- //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
//! the same strict weak ordering as value_compare. The difference is that
//! key_value_comp compares an arbitrary key with the contained values.
- //!
+ //!
//! <b>Effects</b>: Checks if a value can be inserted in the splay_set, using
//! a user provided key instead of the value itself.
//!
@@ -400,16 +400,16 @@ class splay_set_impl
//! and false. If the value can be inserted returns true in the returned
//! pair boolean and fills "commit_data" that is meant to be used with
//! the "insert_commit" function.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic.
//!
//! <b>Throws</b>: If the key_value_comp ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Notes</b>: This function is used to improve performance when constructing
//! a value_type is expensive: if there is an equivalent value
//! the constructed object must be discarded. Many times, the part of the
//! node that is used to impose the order is much cheaper to construct
- //! than the value_type and this function offers the possibility to use that
+ //! than the value_type and this function offers the possibility to use that
//! part to check if the insertion will be successful.
//!
//! If the check is successful, the user can construct the value_type and use
@@ -423,12 +423,12 @@ class splay_set_impl
(const KeyType &key, KeyValueCompare key_value_comp, insert_commit_data &commit_data)
{ return tree_.insert_unique_check(key, key_value_comp, commit_data); }
- //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
//! the same strict weak ordering as value_compare. The difference is that
//! key_value_comp compares an arbitrary key with the contained values.
- //!
+ //!
//! <b>Effects</b>: Checks if a value can be inserted in the splay_set, using
- //! a user provided key instead of the value itself, using "hint"
+ //! a user provided key instead of the value itself, using "hint"
//! as a hint to where it will be inserted.
//!
//! <b>Returns</b>: If there is an equivalent value
@@ -436,23 +436,23 @@ class splay_set_impl
//! and false. If the value can be inserted returns true in the returned
//! pair boolean and fills "commit_data" that is meant to be used with
//! the "insert_commit" function.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic in general, but it's amortized
//! constant time if t is inserted immediately before hint.
//!
//! <b>Throws</b>: If the key_value_comp ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Notes</b>: This function is used to improve performance when constructing
//! a value_type is expensive: if there is an equivalent value
//! the constructed object must be discarded. Many times, the part of the
//! constructing that is used to impose the order is much cheaper to construct
- //! than the value_type and this function offers the possibility to use that key
+ //! than the value_type and this function offers the possibility to use that key
//! to check if the insertion will be successful.
//!
//! If the check is successful, the user can construct the value_type and use
//! "insert_commit" to insert the object in constant-time. This can give a total
//! constant-time complexity to the insertion: check(O(1)) + commit(O(1)).
- //!
+ //!
//! "commit_data" remains valid for a subsequent "insert_commit" only if no more
//! objects are inserted or erased from the splay_set.
template<class KeyType, class KeyValueCompare>
@@ -465,74 +465,74 @@ class splay_set_impl
//! must have been obtained from a previous call to "insert_check".
//! No objects should have been inserted or erased from the splay_set between
//! the "insert_check" that filled "commit_data" and the call to "insert_commit".
- //!
+ //!
//! <b>Effects</b>: Inserts the value in the splay_set using the information obtained
//! from the "commit_data" that a previous "insert_check" filled.
//!
//! <b>Returns</b>: An iterator to the newly inserted object.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function has only sense if a "insert_check" has been
//! previously executed to fill "commit_data". No value should be inserted or
//! erased between the "insert_check" and "insert_commit" calls.
iterator insert_commit(reference value, const insert_commit_data &commit_data)
{ return tree_.insert_unique_commit(value, commit_data); }
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
//! of type value_type.
- //!
+ //!
//! <b>Effects</b>: Inserts a range into the splay_set.
- //!
+ //!
//! <b>Complexity</b>: Insert range is amortized O(N * log(N)), where N is the
//! size of the range. However, it is linear in N if the range is already sorted
//! by value_comp().
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
template<class Iterator>
void insert(Iterator b, Iterator e)
{ tree_.insert_unique(b, e); }
- //! <b>Effects</b>: Erases the element pointed to by pos.
- //!
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //!
//! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //!
//! <b>Returns</b>: An iterator to the element after the erased element.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
iterator erase(const_iterator i)
{ return tree_.erase(i); }
- //! <b>Effects</b>: Erases the range pointed to by b end e.
- //!
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //!
//! <b>Complexity</b>: Average complexity for erase range is amortized
//! O(log(size() + N)), where N is the number of elements in the range.
- //!
+ //!
//! <b>Returns</b>: An iterator to the element after the erased elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
iterator erase(const_iterator b, const_iterator e)
{ return tree_.erase(b, e); }
//! <b>Effects</b>: Erases all the elements with the given value.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: Amortized O(log(size()) + this->count(value)).
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
size_type erase(const_reference value)
@@ -540,13 +540,13 @@ class splay_set_impl
//! <b>Effects</b>: Erases all the elements that compare equal with
//! the given key and the given comparison functor.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: Amortized O(log(size() + this->count(key, comp)).
- //!
+ //!
//! <b>Throws</b>: If the comp ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class KeyType, class KeyValueCompare>
@@ -559,16 +559,16 @@ class splay_set_impl
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//!
- //! <b>Effects</b>: Erases the element pointed to by pos.
+ //! <b>Effects</b>: Erases the element pointed to by pos.
//! Disposer::operator()(pointer) is called for the removed element.
- //!
- //! <b>Complexity</b>: Average complexity for erase element is constant time.
- //!
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
//! <b>Returns</b>: An iterator to the element after the erased element.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
- //! <b>Note</b>: Invalidates the iterators
+ //!
+ //! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
iterator erase_and_dispose(const_iterator i, Disposer disposer)
@@ -584,14 +584,14 @@ class splay_set_impl
//!
//! <b>Effects</b>: Erases the range pointed to by b end e.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
- //! <b>Complexity</b>: Average complexity for erase range is at most
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
//! O(log(size() + N)), where N is the number of elements in the range.
- //!
+ //!
//! <b>Returns</b>: An iterator to the element after the erased elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
@@ -602,13 +602,13 @@ class splay_set_impl
//!
//! <b>Effects</b>: Erases all the elements with the given value.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
- //!
+ //!
//! <b>Complexity</b>: Amortized O(log(size() + this->count(value)). Basic guarantee.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class Disposer>
@@ -622,11 +622,11 @@ class splay_set_impl
//! Disposer::operator()(pointer) is called for the removed elements.
//!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: Amortized O(log(size() + this->count(key, comp)).
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class KeyType, class KeyValueCompare, class Disposer>
@@ -638,26 +638,26 @@ class splay_set_impl
{ return tree_.erase_and_dispose(key, comp, disposer); }
//! <b>Effects</b>: Erases all the elements of the container.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
void clear()
{ return tree_.clear(); }
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
- //!
+ //!
//! <b>Effects</b>: Erases all the elements of the container.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class Disposer>
@@ -665,40 +665,40 @@ class splay_set_impl
{ return tree_.clear_and_dispose(disposer); }
//! <b>Effects</b>: Returns the number of contained elements with the given key
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic to the number of elements contained plus lineal
//! to number of objects with the given key.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
size_type count(const_reference value)
{ return tree_.find(value) != end(); }
//! <b>Effects</b>: Returns the number of contained elements with the same key
//! compared with the given comparison functor.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic to the number of elements contained plus lineal
//! to number of objects with the given key.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
template<class KeyType, class KeyValueCompare>
size_type count(const KeyType& key, KeyValueCompare comp)
{ return tree_.find(key, comp) != end(); }
//! <b>Effects</b>: Returns the number of contained elements with the given key
- //!
+ //!
//! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
//! to number of objects with the given key.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
size_type count_dont_splay(const_reference value)const
{ return tree_.find_dont_splay(value) != end(); }
//! <b>Effects</b>: Returns the number of contained elements with the same key
//! compared with the given comparison functor.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
//! to number of objects with the given key.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
template<class KeyType, class KeyValueCompare>
size_type count_dont_splay(const KeyType& key, KeyValueCompare comp)const
@@ -706,9 +706,9 @@ class splay_set_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
iterator lower_bound(const_reference value)
{ return tree_.lower_bound(value); }
@@ -718,13 +718,13 @@ class splay_set_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns an iterator to the first element whose
- //! key according to the comparison functor is not less than k or
+ //! key according to the comparison functor is not less than k or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
- //!
+ //!
//! <b>Note</b>: This function is used when constructing a value_type
//! is expensive and the value_type can be compared with a cheaper
//! key type. Usually this key is part of the value_type.
@@ -734,9 +734,9 @@ class splay_set_impl
//! <b>Effects</b>: Returns a const iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
const_iterator lower_bound_dont_splay(const_reference value) const
{ return tree_.lower_bound_dont_splay(value); }
@@ -746,13 +746,13 @@ class splay_set_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns a const_iterator to the first element whose
- //! key according to the comparison functor is not less than k or
+ //! key according to the comparison functor is not less than k or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
- //!
+ //!
//! <b>Note</b>: This function is used when constructing a value_type
//! is expensive and the value_type can be compared with a cheaper
//! key type. Usually this key is part of the value_type.
@@ -762,9 +762,9 @@ class splay_set_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is greater than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
iterator upper_bound(const_reference value)
{ return tree_.upper_bound(value); }
@@ -774,11 +774,11 @@ class splay_set_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns an iterator to the first element whose
- //! key according to the comparison functor is greater than key or
+ //! key according to the comparison functor is greater than key or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -790,9 +790,9 @@ class splay_set_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is greater than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
const_iterator upper_bound_dont_splay(const_reference value) const
{ return tree_.upper_bound_dont_splay(value); }
@@ -802,11 +802,11 @@ class splay_set_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns a const_iterator to the first element whose
- //! key according to the comparison functor is greater than key or
+ //! key according to the comparison functor is greater than key or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -816,11 +816,11 @@ class splay_set_impl
const_iterator upper_bound_dont_splay(const KeyType& key, KeyValueCompare comp) const
{ return tree_.upper_bound_dont_splay(key, comp); }
- //! <b>Effects</b>: Finds an iterator to the first element whose value is
+ //! <b>Effects</b>: Finds an iterator to the first element whose value is
//! "value" or end() if that element does not exist.
//!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
iterator find(const_reference value)
{ return tree_.find(value); }
@@ -829,12 +829,12 @@ class splay_set_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds an iterator to the first element whose key is
- //! "key" according to the comparison functor or end() if that element
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
//! does not exist.
//!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -844,11 +844,11 @@ class splay_set_impl
iterator find(const KeyType& key, KeyValueCompare comp)
{ return tree_.find(key, comp); }
- //! <b>Effects</b>: Finds a const_iterator to the first element whose value is
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose value is
//! "value" or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
const_iterator find_dont_splay(const_reference value) const
{ return tree_.find_dont_splay(value); }
@@ -857,12 +857,12 @@ class splay_set_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
- //! "key" according to the comparison functor or end() if that element
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
//! does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -875,9 +875,9 @@ class splay_set_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
std::pair<iterator,iterator> equal_range(const_reference value)
{ return tree_.equal_range(value); }
@@ -886,13 +886,13 @@ class splay_set_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds a range containing all elements whose key is k
- //! according to the comparison functor or an empty range
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
//! that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -905,9 +905,9 @@ class splay_set_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
std::pair<const_iterator, const_iterator>
equal_range_dont_splay(const_reference value) const
@@ -917,13 +917,13 @@ class splay_set_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds a range containing all elements whose key is k
- //! according to the comparison functor or an empty range
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
//! that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -934,16 +934,102 @@ class splay_set_impl
equal_range_dont_splay(const KeyType& key, KeyValueCompare comp) const
{ return tree_.equal_range_dont_splay(key, comp); }
+ //! <b>Requires</b>: 'lower_value' must not be greater than 'upper_value'. If
+ //! 'lower_value' == 'upper_value', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_value and upper_value.
+ std::pair<iterator,iterator> bounded_range
+ (const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed)
+ { return tree_.bounded_range(lower_value, upper_value, left_closed, right_closed); }
+
+ //! <b>Requires</b>: KeyValueCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise
+ //!
+ //! second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator,iterator> bounded_range
+ (const KeyType& lower_key, const KeyType& upper_key, KeyValueCompare comp, bool left_closed, bool right_closed)
+ { return tree_.bounded_range(lower_key, upper_key, comp, left_closed, right_closed); }
+
+ //! <b>Requires</b>: 'lower_value' must not be greater than 'upper_value'. If
+ //! 'lower_value' == 'upper_value', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_value and upper_value.
+ std::pair<const_iterator, const_iterator>
+ bounded_range_dont_splay_dont_splay
+ (const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed) const
+ { return tree_.bounded_range_dont_splay(lower_value, upper_value, left_closed, right_closed); }
+
+ //! <b>Requires</b>: KeyValueCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise
+ //!
+ //! second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<const_iterator, const_iterator>
+ bounded_range_dont_splay
+ (const KeyType& lower_key, const KeyType& upper_key, KeyValueCompare comp, bool left_closed, bool right_closed) const
+ { return tree_.bounded_range_dont_splay(lower_key, upper_key, comp, left_closed, right_closed); }
+
//! <b>Requires</b>: value must be an lvalue and shall be in a splay_set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator i belonging to the splay_set
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
static iterator s_iterator_to(reference value)
@@ -951,14 +1037,14 @@ class splay_set_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a splay_set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
//! splay_set that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
static const_iterator s_iterator_to(const_reference value)
@@ -966,48 +1052,48 @@ class splay_set_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a splay_set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator i belonging to the splay_set
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator iterator_to(reference value)
{ return tree_.iterator_to(value); }
//! <b>Requires</b>: value must be an lvalue and shall be in a splay_set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
//! splay_set that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator iterator_to(const_reference value) const
{ return tree_.iterator_to(value); }
//! <b>Requires</b>: value shall not be in a splay_set/multisplay_set.
- //!
+ //!
//! <b>Effects</b>: init_node puts the hook of a value in a well-known default
//! state.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Note</b>: This function puts the hook in the well-known default state
//! used by auto_unlink and safe hooks.
static void init_node(reference value)
{ tree_type::init_node(value); }
//! <b>Effects</b>: Unlinks the leftmost node from the tree.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function breaks the tree and the tree can
//! only be used for more unlink_leftmost_without_rebalance calls.
//! This function is normally used to achieve a step by step
@@ -1017,14 +1103,14 @@ class splay_set_impl
//! <b>Requires</b>: replace_this must be a valid iterator of *this
//! and with_this must not be inserted in any tree.
- //!
+ //!
//! <b>Effects</b>: Replaces replace_this in its position in the
//! tree with with_this. The tree does not need to be rebalanced.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! with_this is not equivalent to *replace_this according to the
//! ordering rules. This function is faster than erasing and inserting
@@ -1033,12 +1119,12 @@ class splay_set_impl
{ tree_.replace_node(replace_this, with_this); }
//! <b>Requires</b>: i must be a valid iterator of *this.
- //!
+ //!
//! <b>Effects</b>: Rearranges the splay set so that the element pointed by i
//! is placed as the root of the tree, improving future searches of this value.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
void splay_up(iterator i)
{ tree_.splay_up(i); }
@@ -1047,9 +1133,9 @@ class splay_set_impl
//! with a key equivalent to value the element is placed as the root of the
//! tree. If the element is not present returns the last node compared with the key.
//! If the tree is empty, end() is returned.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Returns</b>: An iterator to the new root of the tree, end() if the tree is empty.
//!
//! <b>Throws</b>: If the comparison functor throws.
@@ -1060,9 +1146,9 @@ class splay_set_impl
//! <b>Effects</b>: Rearranges the splay set so that if *this stores an element
//! with a key equivalent to value the element is placed as the root of the
//! tree.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Returns</b>: An iterator to the new root of the tree, end() if the tree is empty.
//!
//! <b>Throws</b>: If the predicate throws.
@@ -1070,21 +1156,21 @@ class splay_set_impl
{ return tree_.splay_down(value); }
//! <b>Effects</b>: Rebalances the tree.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear.
void rebalance()
{ tree_.rebalance(); }
//! <b>Requires</b>: old_root is a node of a tree.
- //!
+ //!
//! <b>Effects</b>: Rebalances the subtree rooted at old_root.
//!
//! <b>Returns</b>: The new root of the subtree.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the elements in the subtree.
iterator rebalance_subtree(iterator root)
{ return tree_.rebalance_subtree(root); }
@@ -1175,7 +1261,7 @@ struct make_splay_set
{
/// @cond
typedef splay_set_impl
- < typename make_splaytree_opt<T,
+ < typename make_splaytree_opt<T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -1194,7 +1280,7 @@ template<class T, class O1, class O2, class O3, class O4>
template<class T, class ...Options>
#endif
class splay_set
- : public make_splay_set<T,
+ : public make_splay_set<T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -1203,7 +1289,7 @@ class splay_set
>::type
{
typedef typename make_splay_set
- <T,
+ <T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -1255,9 +1341,9 @@ class splay_set
#endif
-//! The class template splay_multiset is an intrusive container, that mimics most of
+//! The class template splay_multiset is an intrusive container, that mimics most of
//! the interface of std::multiset as described in the C++ standard.
-//!
+//!
//! The template parameter \c T is the type to be managed by the container.
//! The user can specify additional options and if no options are provided
//! default options are used.
@@ -1311,30 +1397,30 @@ class splay_multiset_impl
/// @endcond
public:
- //! <b>Effects</b>: Constructs an empty splay_multiset.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //! <b>Effects</b>: Constructs an empty splay_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
- //! or the copy constructor/operator() of the value_compare object throws.
+ //! or the copy constructor/operator() of the value_compare object throws.
splay_multiset_impl( const value_compare &cmp = value_compare()
- , const value_traits &v_traits = value_traits())
+ , const value_traits &v_traits = value_traits())
: tree_(cmp, v_traits)
{}
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
//! cmp must be a comparison function that induces a strict weak ordering.
- //!
- //! <b>Effects</b>: Constructs an empty splay_multiset and inserts elements from
+ //!
+ //! <b>Effects</b>: Constructs an empty splay_multiset and inserts elements from
//! [b, e).
- //!
+ //!
//! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
//! comp and otherwise amortized N * log N, where N is the distance between first and last.
- //!
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
- //! or the copy constructor/operator() of the value_compare object throws.
+ //! or the copy constructor/operator() of the value_compare object throws.
template<class Iterator>
splay_multiset_impl( Iterator b, Iterator e
, const value_compare &cmp = value_compare()
@@ -1343,135 +1429,135 @@ class splay_multiset_impl
{}
//! <b>Effects</b>: to-do
- //!
- splay_multiset_impl(BOOST_RV_REF(splay_multiset_impl) x)
+ //!
+ splay_multiset_impl(BOOST_RV_REF(splay_multiset_impl) x)
: tree_(::boost::move(x.tree_))
{}
//! <b>Effects</b>: to-do
- //!
- splay_multiset_impl& operator=(BOOST_RV_REF(splay_multiset_impl) x)
+ //!
+ splay_multiset_impl& operator=(BOOST_RV_REF(splay_multiset_impl) x)
{ tree_ = ::boost::move(x.tree_); return *this; }
- //! <b>Effects</b>: Detaches all elements from this. The objects in the set
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the set
//! are not deleted (i.e. no destructors are called).
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- ~splay_multiset_impl()
+ ~splay_multiset_impl()
{}
//! <b>Effects</b>: Returns an iterator pointing to the beginning of the splay_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator begin()
{ return tree_.begin(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the splay_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator begin() const
{ return tree_.begin(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the splay_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cbegin() const
{ return tree_.cbegin(); }
//! <b>Effects</b>: Returns an iterator pointing to the end of the splay_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator end()
{ return tree_.end(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the splay_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator end() const
{ return tree_.end(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the splay_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cend() const
{ return tree_.cend(); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning of the
//! reversed splay_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rbegin()
{ return tree_.rbegin(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed splay_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rbegin() const
{ return tree_.rbegin(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed splay_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crbegin() const
{ return tree_.crbegin(); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the end
//! of the reversed splay_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rend()
{ return tree_.rend(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed splay_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rend() const
{ return tree_.rend(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed splay_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crend() const
{ return tree_.crend(); }
//! <b>Precondition</b>: end_iterator must be a valid end iterator
//! of splay_multiset.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the splay_multiset associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static splay_multiset_impl &container_from_end_iterator(iterator end_iterator)
{
@@ -1482,11 +1568,11 @@ class splay_multiset_impl
//! <b>Precondition</b>: end_iterator must be a valid end const_iterator
//! of splay_multiset.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the splay_multiset associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static const splay_multiset_impl &container_from_end_iterator(const_iterator end_iterator)
{
@@ -1496,11 +1582,11 @@ class splay_multiset_impl
}
//! <b>Precondition</b>: it must be a valid iterator of multiset.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the multiset associated to the iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
static splay_multiset_impl &container_from_iterator(iterator it)
{
@@ -1510,11 +1596,11 @@ class splay_multiset_impl
}
//! <b>Precondition</b>: it must be a valid const_iterator of multiset.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the multiset associated to the iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static const splay_multiset_impl &container_from_iterator(const_iterator it)
{
@@ -1524,42 +1610,42 @@ class splay_multiset_impl
}
//! <b>Effects</b>: Returns the key_compare object used by the splay_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If key_compare copy-constructor throws.
key_compare key_comp() const
{ return tree_.value_comp(); }
//! <b>Effects</b>: Returns the value_compare object used by the splay_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If value_compare copy-constructor throws.
value_compare value_comp() const
{ return tree_.value_comp(); }
//! <b>Effects</b>: Returns true if the container is empty.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
bool empty() const
{ return tree_.empty(); }
//! <b>Effects</b>: Returns the number of elements stored in the splay_multiset.
- //!
+ //!
//! <b>Complexity</b>: Linear to elements contained in *this if,
//! constant-time size option is enabled. Constant-time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
size_type size() const
{ return tree_.size(); }
//! <b>Effects</b>: Swaps the contents of two splay_multisets.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If the swap() call for the comparison functor
//! found using ADL throws. Strong guarantee.
void swap(splay_multiset_impl& other)
@@ -1569,109 +1655,109 @@ class splay_multiset_impl
//! Cloner should yield to nodes equivalent to the original nodes.
//!
//! <b>Effects</b>: Erases all the elements from *this
- //! calling Disposer::operator()(pointer), clones all the
+ //! calling Disposer::operator()(pointer), clones all the
//! elements from src calling Cloner::operator()(const_reference )
//! and inserts them on *this. Copies the predicate from the source container.
//!
//! If cloner throws, all cloned elements are unlinked and disposed
//! calling Disposer::operator()(pointer).
- //!
+ //!
//! <b>Complexity</b>: Linear to erased plus inserted elements.
- //!
+ //!
//! <b>Throws</b>: If cloner throws or predicate copy assignment throws. Basic guarantee.
template <class Cloner, class Disposer>
void clone_from(const splay_multiset_impl &src, Cloner cloner, Disposer disposer)
{ tree_.clone_from(src.tree_, cloner, disposer); }
//! <b>Requires</b>: value must be an lvalue
- //!
+ //!
//! <b>Effects</b>: Inserts value into the splay_multiset.
- //!
+ //!
//! <b>Returns</b>: An iterator that points to the position where the new
//! element was inserted.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
iterator insert(reference value)
{ return tree_.insert_equal(this->end(), value); }
//! <b>Requires</b>: value must be an lvalue
- //!
+ //!
//! <b>Effects</b>: Inserts x into the splay_multiset, using pos as a hint to
//! where it will be inserted.
- //!
+ //!
//! <b>Returns</b>: An iterator that points to the position where the new
//! element was inserted.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic in general, but it is amortized
//! constant time if t is inserted immediately before hint.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
iterator insert(const_iterator hint, reference value)
{ return tree_.insert_equal(hint, value); }
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
//! of type value_type.
- //!
+ //!
//! <b>Effects</b>: Inserts a range into the splay_multiset.
- //!
+ //!
//! <b>Returns</b>: An iterator that points to the position where the new
//! element was inserted.
- //!
+ //!
//! <b>Complexity</b>: Insert range is amortized O(N * log(N)), where N is the
//! size of the range. However, it is linear in N if the range is already sorted
//! by value_comp().
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
template<class Iterator>
void insert(Iterator b, Iterator e)
{ tree_.insert_equal(b, e); }
- //! <b>Effects</b>: Erases the element pointed to by pos.
- //!
- //! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
//! <b>Returns</b>: An iterator to the element after the erased element.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
iterator erase(const_iterator i)
{ return tree_.erase(i); }
- //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
//!
//! <b>Returns</b>: An iterator to the element after the erased elements.
- //!
+ //!
//! <b>Complexity</b>: Average complexity for erase range is amortized
//! O(log(size() + N)), where N is the number of elements in the range.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
iterator erase(const_iterator b, const_iterator e)
{ return tree_.erase(b, e); }
//! <b>Effects</b>: Erases all the elements with the given value.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: Amortized O(log(size() + this->count(value)).
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
size_type erase(const_reference value)
@@ -1679,13 +1765,13 @@ class splay_multiset_impl
//! <b>Effects</b>: Erases all the elements that compare equal with
//! the given key and the given comparison functor.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: Amortized O(log(size() + this->count(key, comp)).
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class KeyType, class KeyValueCompare>
@@ -1700,14 +1786,14 @@ class splay_multiset_impl
//!
//! <b>Returns</b>: An iterator to the element after the erased element.
//!
- //! <b>Effects</b>: Erases the element pointed to by pos.
+ //! <b>Effects</b>: Erases the element pointed to by pos.
//! Disposer::operator()(pointer) is called for the removed element.
- //!
- //! <b>Complexity</b>: Average complexity for erase element is constant time.
- //!
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
//! <b>Throws</b>: Nothing.
- //!
- //! <b>Note</b>: Invalidates the iterators
+ //!
+ //! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
iterator erase_and_dispose(const_iterator i, Disposer disposer)
@@ -1725,12 +1811,12 @@ class splay_multiset_impl
//!
//! <b>Effects</b>: Erases the range pointed to by b end e.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Complexity</b>: Average complexity for erase range is amortized
//! O(log(size() + N)), where N is the number of elements in the range.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
@@ -1741,13 +1827,13 @@ class splay_multiset_impl
//!
//! <b>Effects</b>: Erases all the elements with the given value.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: Amortized O(log(size() + this->count(value)).
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class Disposer>
@@ -1761,11 +1847,11 @@ class splay_multiset_impl
//! Disposer::operator()(pointer) is called for the removed elements.
//!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: Amortized O(log(size() + this->count(key, comp)).
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class KeyType, class KeyValueCompare, class Disposer>
@@ -1777,26 +1863,26 @@ class splay_multiset_impl
{ return tree_.erase_and_dispose(key, comp, disposer); }
//! <b>Effects</b>: Erases all the elements of the container.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
void clear()
{ return tree_.clear(); }
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
- //!
+ //!
//! <b>Effects</b>: Erases all the elements of the container.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class Disposer>
@@ -1804,40 +1890,40 @@ class splay_multiset_impl
{ return tree_.clear_and_dispose(disposer); }
//! <b>Effects</b>: Returns the number of contained elements with the given key
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic to the number of elements contained plus lineal
//! to number of objects with the given key.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
size_type count(const_reference value)
{ return tree_.count(value); }
//! <b>Effects</b>: Returns the number of contained elements with the same key
//! compared with the given comparison functor.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic to the number of elements contained plus lineal
//! to number of objects with the given key.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
template<class KeyType, class KeyValueCompare>
size_type count(const KeyType& key, KeyValueCompare comp)
{ return tree_.count(key, comp); }
//! <b>Effects</b>: Returns the number of contained elements with the given key
- //!
+ //!
//! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
//! to number of objects with the given key.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
size_type count_dont_splay(const_reference value) const
{ return tree_.count_dont_splay(value); }
//! <b>Effects</b>: Returns the number of contained elements with the same key
//! compared with the given comparison functor.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
//! to number of objects with the given key.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
template<class KeyType, class KeyValueCompare>
size_type count_dont_splay(const KeyType& key, KeyValueCompare comp) const
@@ -1845,9 +1931,9 @@ class splay_multiset_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
iterator lower_bound(const_reference value)
{ return tree_.lower_bound(value); }
@@ -1857,13 +1943,13 @@ class splay_multiset_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns an iterator to the first element whose
- //! key according to the comparison functor is not less than k or
+ //! key according to the comparison functor is not less than k or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
- //!
+ //!
//! <b>Note</b>: This function is used when constructing a value_type
//! is expensive and the value_type can be compared with a cheaper
//! key type. Usually this key is part of the value_type.
@@ -1873,9 +1959,9 @@ class splay_multiset_impl
//! <b>Effects</b>: Returns a const iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
const_iterator lower_bound_dont_splay(const_reference value) const
{ return tree_.lower_bound_dont_splay(value); }
@@ -1885,13 +1971,13 @@ class splay_multiset_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns a const_iterator to the first element whose
- //! key according to the comparison functor is not less than k or
+ //! key according to the comparison functor is not less than k or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
- //!
+ //!
//! <b>Note</b>: This function is used when constructing a value_type
//! is expensive and the value_type can be compared with a cheaper
//! key type. Usually this key is part of the value_type.
@@ -1901,9 +1987,9 @@ class splay_multiset_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is greater than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
iterator upper_bound(const_reference value)
{ return tree_.upper_bound(value); }
@@ -1913,11 +1999,11 @@ class splay_multiset_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns an iterator to the first element whose
- //! key according to the comparison functor is greater than key or
+ //! key according to the comparison functor is greater than key or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -1929,9 +2015,9 @@ class splay_multiset_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is greater than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
const_iterator upper_bound_dont_splay(const_reference value) const
{ return tree_.upper_bound_dont_splay(value); }
@@ -1941,11 +2027,11 @@ class splay_multiset_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns a const_iterator to the first element whose
- //! key according to the comparison functor is greater than key or
+ //! key according to the comparison functor is greater than key or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -1955,11 +2041,11 @@ class splay_multiset_impl
const_iterator upper_bound_dont_splay(const KeyType& key, KeyValueCompare comp) const
{ return tree_.upper_bound_dont_splay(key, comp); }
- //! <b>Effects</b>: Finds an iterator to the first element whose value is
+ //! <b>Effects</b>: Finds an iterator to the first element whose value is
//! "value" or end() if that element does not exist.
//!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
iterator find(const_reference value)
{ return tree_.find(value); }
@@ -1968,12 +2054,12 @@ class splay_multiset_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds an iterator to the first element whose key is
- //! "key" according to the comparison functor or end() if that element
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
//! does not exist.
//!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -1983,11 +2069,11 @@ class splay_multiset_impl
iterator find(const KeyType& key, KeyValueCompare comp)
{ return tree_.find(key, comp); }
- //! <b>Effects</b>: Finds a const_iterator to the first element whose value is
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose value is
//! "value" or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
const_iterator find_dont_splay(const_reference value) const
{ return tree_.find_dont_splay(value); }
@@ -1996,12 +2082,12 @@ class splay_multiset_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
- //! "key" according to the comparison functor or end() if that element
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
//! does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -2014,9 +2100,9 @@ class splay_multiset_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
std::pair<iterator,iterator> equal_range(const_reference value)
{ return tree_.equal_range(value); }
@@ -2025,13 +2111,13 @@ class splay_multiset_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds a range containing all elements whose key is k
- //! according to the comparison functor or an empty range
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
//! that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -2044,9 +2130,9 @@ class splay_multiset_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
std::pair<const_iterator, const_iterator>
equal_range_dont_splay(const_reference value) const
@@ -2056,13 +2142,13 @@ class splay_multiset_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds a range containing all elements whose key is k
- //! according to the comparison functor or an empty range
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
//! that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -2073,16 +2159,102 @@ class splay_multiset_impl
equal_range_dont_splay(const KeyType& key, KeyValueCompare comp) const
{ return tree_.equal_range_dont_splay(key, comp); }
+ //! <b>Requires</b>: 'lower_value' must not be greater than 'upper_value'. If
+ //! 'lower_value' == 'upper_value', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_value and upper_value.
+ std::pair<iterator,iterator> bounded_range
+ (const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed)
+ { return tree_.bounded_range(lower_value, upper_value, left_closed, right_closed); }
+
+ //! <b>Requires</b>: KeyValueCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise
+ //!
+ //! second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator,iterator> bounded_range
+ (const KeyType& lower_key, const KeyType& upper_key, KeyValueCompare comp, bool left_closed, bool right_closed)
+ { return tree_.bounded_range(lower_key, upper_key, comp, left_closed, right_closed); }
+
+ //! <b>Requires</b>: 'lower_value' must not be greater than 'upper_value'. If
+ //! 'lower_value' == 'upper_value', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_value and upper_value.
+ std::pair<const_iterator, const_iterator>
+ bounded_range_dont_splay
+ (const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed) const
+ { return tree_.bounded_range_dont_splay(lower_value, upper_value, left_closed, right_closed); }
+
+ //! <b>Requires</b>: KeyValueCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise
+ //!
+ //! second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<const_iterator, const_iterator>
+ bounded_range_dont_splay
+ (const KeyType& lower_key, const KeyType& upper_key, KeyValueCompare comp, bool left_closed, bool right_closed) const
+ { return tree_.bounded_range_dont_splay(lower_key, upper_key, comp, left_closed, right_closed); }
+
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator i belonging to the set
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
static iterator s_iterator_to(reference value)
@@ -2090,14 +2262,14 @@ class splay_multiset_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
//! set that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
static const_iterator s_iterator_to(const_reference value)
@@ -2105,48 +2277,48 @@ class splay_multiset_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator i belonging to the set
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator iterator_to(reference value)
{ return tree_.iterator_to(value); }
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
//! set that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator iterator_to(const_reference value) const
{ return tree_.iterator_to(value); }
//! <b>Requires</b>: value shall not be in a set/splay_multiset.
- //!
+ //!
//! <b>Effects</b>: init_node puts the hook of a value in a well-known default
//! state.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Note</b>: This function puts the hook in the well-known default state
//! used by auto_unlink and safe hooks.
static void init_node(reference value)
{ tree_type::init_node(value); }
//! <b>Effects</b>: Unlinks the leftmost node from the tree.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function breaks the tree and the tree can
//! only be used for more unlink_leftmost_without_rebalance calls.
//! This function is normally used to achieve a step by step
@@ -2156,14 +2328,14 @@ class splay_multiset_impl
//! <b>Requires</b>: replace_this must be a valid iterator of *this
//! and with_this must not be inserted in any tree.
- //!
+ //!
//! <b>Effects</b>: Replaces replace_this in its position in the
//! tree with with_this. The tree does not need to be rebalanced.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! with_this is not equivalent to *replace_this according to the
//! ordering rules. This function is faster than erasing and inserting
@@ -2172,12 +2344,12 @@ class splay_multiset_impl
{ tree_.replace_node(replace_this, with_this); }
//! <b>Requires</b>: i must be a valid iterator of *this.
- //!
+ //!
//! <b>Effects</b>: Rearranges the splay set so that the element pointed by i
//! is placed as the root of the tree, improving future searches of this value.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
void splay_up(iterator i)
{ tree_.splay_up(i); }
@@ -2186,9 +2358,9 @@ class splay_multiset_impl
//! with a key equivalent to value the element is placed as the root of the
//! tree. If the element is not present returns the last node compared with the key.
//! If the tree is empty, end() is returned.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Returns</b>: An iterator to the new root of the tree, end() if the tree is empty.
//!
//! <b>Throws</b>: If the comparison functor throws.
@@ -2199,9 +2371,9 @@ class splay_multiset_impl
//! <b>Effects</b>: Rearranges the splay set so that if *this stores an element
//! with a key equivalent to value the element is placed as the root of the
//! tree.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Returns</b>: An iterator to the new root of the tree, end() if the tree is empty.
//!
//! <b>Throws</b>: If the predicate throws.
@@ -2209,21 +2381,21 @@ class splay_multiset_impl
{ return tree_.splay_down(value); }
//! <b>Effects</b>: Rebalances the tree.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear.
void rebalance()
{ tree_.rebalance(); }
//! <b>Requires</b>: old_root is a node of a tree.
- //!
+ //!
//! <b>Effects</b>: Rebalances the subtree rooted at old_root.
//!
//! <b>Returns</b>: The new root of the subtree.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the elements in the subtree.
iterator rebalance_subtree(iterator root)
{ return tree_.rebalance_subtree(root); }
@@ -2314,7 +2486,7 @@ struct make_splay_multiset
{
/// @cond
typedef splay_multiset_impl
- < typename make_splaytree_opt<T,
+ < typename make_splaytree_opt<T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -2334,7 +2506,7 @@ template<class T, class O1, class O2, class O3, class O4>
template<class T, class ...Options>
#endif
class splay_multiset
- : public make_splay_multiset<T,
+ : public make_splay_multiset<T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -2343,7 +2515,7 @@ class splay_multiset
>::type
{
typedef typename make_splay_multiset
- <T,
+ <T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -2395,8 +2567,8 @@ class splay_multiset
#endif
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/splay_set_hook.hpp b/boost/intrusive/splay_set_hook.hpp
index d42f4c8bee..c8698c65b0 100644
--- a/boost/intrusive/splay_set_hook.hpp
+++ b/boost/intrusive/splay_set_hook.hpp
@@ -1,7 +1,7 @@
/////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -43,7 +43,7 @@ struct make_splay_set_base_hook
{
/// @cond
typedef typename pack_options
- < hook_defaults,
+ < hook_defaults,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3
#else
@@ -61,16 +61,16 @@ struct make_splay_set_base_hook
typedef implementation_defined type;
};
-//! Derive a class from splay_set_base_hook in order to store objects in
-//! in a splay_set/splay_multiset. splay_set_base_hook holds the data necessary to maintain
+//! Derive a class from splay_set_base_hook in order to store objects in
+//! in a splay_set/splay_multiset. splay_set_base_hook holds the data necessary to maintain
//! the splay_set/splay_multiset and provides an appropriate value_traits class for splay_set/splay_multiset.
-//!
+//!
//! The hook admits the following options: \c tag<>, \c void_pointer<>,
//! \c link_mode<> and \c optimize_size<>.
//!
-//! \c tag<> defines a tag to identify the node.
-//! The same tag value can be used in different classes, but if a class is
-//! derived from more than one \c list_base_hook, then each \c list_base_hook needs its
+//! \c tag<> defines a tag to identify the node.
+//! The same tag value can be used in different classes, but if a class is
+//! derived from more than one \c list_base_hook, then each \c list_base_hook needs its
//! unique tag.
//!
//! \c void_pointer<> is the pointer type that will be used internally in the hook
@@ -96,27 +96,27 @@ class splay_set_base_hook
public:
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
splay_set_base_hook();
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state. The argument is ignored.
- //!
- //! <b>Throws</b>: Nothing.
- //!
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
//! <b>Rationale</b>: Providing a copy-constructor
- //! makes classes using the hook STL-compliant without forcing the
+ //! makes classes using the hook STL-compliant without forcing the
//! user to do some additional work. \c swap can be used to emulate
//! move-semantics.
splay_set_base_hook(const splay_set_base_hook& );
//! <b>Effects</b>: Empty function. The argument is ignored.
- //!
- //! <b>Throws</b>: Nothing.
- //!
- //! <b>Rationale</b>: Providing an assignment operator
- //! makes classes using the hook STL-compliant without forcing the
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing an assignment operator
+ //! makes classes using the hook STL-compliant without forcing the
//! user to do some additional work. \c swap can be used to emulate
//! move-semantics.
splay_set_base_hook& operator=(const splay_set_base_hook& );
@@ -125,37 +125,37 @@ class splay_set_base_hook
//! nothing (ie. no code is generated). If link_mode is \c safe_link and the
//! object is stored in a set an assertion is raised. If link_mode is
//! \c auto_unlink and \c is_linked() is true, the node is unlinked.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
~splay_set_base_hook();
- //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
- //! related to those nodes in one or two containers. That is, if the node
- //! this is part of the element e1, the node x is part of the element e2
- //! and both elements are included in the containers s1 and s2, then after
- //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
- //! at the position of e1. If one element is not in a container, then
- //! after the swap-operation the other element is not in a container.
- //! Iterators to e1 and e2 related to those nodes are invalidated.
+ //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
+ //! related to those nodes in one or two containers. That is, if the node
+ //! this is part of the element e1, the node x is part of the element e2
+ //! and both elements are included in the containers s1 and s2, then after
+ //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
+ //! at the position of e1. If one element is not in a container, then
+ //! after the swap-operation the other element is not in a container.
+ //! Iterators to e1 and e2 related to those nodes are invalidated.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Constant
//!
- //! <b>Throws</b>: Nothing.
+ //! <b>Throws</b>: Nothing.
void swap_nodes(splay_set_base_hook &other);
//! <b>Precondition</b>: link_mode must be \c safe_link or \c auto_unlink.
//!
//! <b>Returns</b>: true, if the node belongs to a container, false
- //! otherwise. This function can be used to test whether \c set::iterator_to
- //! will return a valid iterator.
+ //! otherwise. This function can be used to test whether \c set::iterator_to
+ //! will return a valid iterator.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Constant
bool is_linked() const;
//! <b>Effects</b>: Removes the node if it's inserted in a container.
//! This function is only allowed if link_mode is \c auto_unlink.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
void unlink();
#endif
};
@@ -171,7 +171,7 @@ struct make_splay_set_member_hook
{
/// @cond
typedef typename pack_options
- < hook_defaults,
+ < hook_defaults,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3
#else
@@ -193,7 +193,7 @@ struct make_splay_set_member_hook
//! class in a splay_set/splay_multiset. splay_set_member_hook holds the data
//! necessary for maintaining the splay_set/splay_multiset and provides an appropriate
//! value_traits class for splay_set/splay_multiset.
-//!
+//!
//! The hook admits the following options: \c void_pointer<>,
//! \c link_mode<> and \c optimize_size<>.
//!
@@ -220,27 +220,27 @@ class splay_set_member_hook
public:
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
splay_set_member_hook();
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state. The argument is ignored.
- //!
- //! <b>Throws</b>: Nothing.
- //!
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
//! <b>Rationale</b>: Providing a copy-constructor
- //! makes classes using the hook STL-compliant without forcing the
+ //! makes classes using the hook STL-compliant without forcing the
//! user to do some additional work. \c swap can be used to emulate
//! move-semantics.
splay_set_member_hook(const splay_set_member_hook& );
//! <b>Effects</b>: Empty function. The argument is ignored.
- //!
- //! <b>Throws</b>: Nothing.
- //!
- //! <b>Rationale</b>: Providing an assignment operator
- //! makes classes using the hook STL-compliant without forcing the
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing an assignment operator
+ //! makes classes using the hook STL-compliant without forcing the
//! user to do some additional work. \c swap can be used to emulate
//! move-semantics.
splay_set_member_hook& operator=(const splay_set_member_hook& );
@@ -249,43 +249,43 @@ class splay_set_member_hook
//! nothing (ie. no code is generated). If link_mode is \c safe_link and the
//! object is stored in a set an assertion is raised. If link_mode is
//! \c auto_unlink and \c is_linked() is true, the node is unlinked.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
~splay_set_member_hook();
- //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
- //! related to those nodes in one or two containers. That is, if the node
- //! this is part of the element e1, the node x is part of the element e2
- //! and both elements are included in the containers s1 and s2, then after
- //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
- //! at the position of e1. If one element is not in a container, then
- //! after the swap-operation the other element is not in a container.
- //! Iterators to e1 and e2 related to those nodes are invalidated.
+ //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
+ //! related to those nodes in one or two containers. That is, if the node
+ //! this is part of the element e1, the node x is part of the element e2
+ //! and both elements are included in the containers s1 and s2, then after
+ //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
+ //! at the position of e1. If one element is not in a container, then
+ //! after the swap-operation the other element is not in a container.
+ //! Iterators to e1 and e2 related to those nodes are invalidated.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Constant
//!
- //! <b>Throws</b>: Nothing.
+ //! <b>Throws</b>: Nothing.
void swap_nodes(splay_set_member_hook &other);
//! <b>Precondition</b>: link_mode must be \c safe_link or \c auto_unlink.
//!
//! <b>Returns</b>: true, if the node belongs to a container, false
- //! otherwise. This function can be used to test whether \c set::iterator_to
- //! will return a valid iterator.
+ //! otherwise. This function can be used to test whether \c set::iterator_to
+ //! will return a valid iterator.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Constant
bool is_linked() const;
//! <b>Effects</b>: Removes the node if it's inserted in a container.
//! This function is only allowed if link_mode is \c auto_unlink.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
void unlink();
#endif
};
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/splaytree.hpp b/boost/intrusive/splaytree.hpp
index 01b28d0a77..a1c5209dc1 100644
--- a/boost/intrusive/splaytree.hpp
+++ b/boost/intrusive/splaytree.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2007-2009
+// (C) Copyright Ion Gaztanaga 2007-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -63,8 +63,8 @@ struct splay_set_defaults
/// @endcond
//! The class template splaytree is an intrusive splay tree container that
-//! is used to construct intrusive splay_set and splay_multiset containers. The no-throw
-//! guarantee holds only, if the value_compare object
+//! is used to construct intrusive splay_set and splay_multiset containers. The no-throw
+//! guarantee holds only, if the value_compare object
//! doesn't throw.
//!
//! The template parameter \c T is the type to be managed by the container.
@@ -129,7 +129,7 @@ class splaytree_impl
//noncopyable
BOOST_MOVABLE_BUT_NOT_COPYABLE(splaytree_impl)
- enum { safemode_or_autounlink =
+ enum { safemode_or_autounlink =
(int)real_value_traits::link_mode == (int)auto_unlink ||
(int)real_value_traits::link_mode == (int)safe_link };
@@ -155,7 +155,7 @@ class splaytree_impl
{}
node_plus_pred_t node_plus_pred_;
} data_;
-
+
const value_compare &priv_comp() const
{ return data_.node_plus_pred_.get(); }
@@ -207,18 +207,18 @@ class splaytree_impl
typedef typename node_algorithms::insert_commit_data insert_commit_data;
- //! <b>Effects</b>: Constructs an empty tree.
- //!
+ //! <b>Effects</b>: Constructs an empty tree.
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
//! or the copy constructorof the value_compare object throws. Basic guarantee.
splaytree_impl( const value_compare &cmp = value_compare()
- , const value_traits &v_traits = value_traits())
+ , const value_traits &v_traits = value_traits())
: data_(cmp, v_traits)
- {
- node_algorithms::init_header(this->priv_header_ptr());
+ {
+ node_algorithms::init_header(this->priv_header_ptr());
this->priv_size_traits().set_size(size_type(0));
}
@@ -230,7 +230,7 @@ class splaytree_impl
//!
//! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
//! comp and otherwise amortized N * log N, where N is the distance between first and last.
- //!
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
//! or the copy constructor/operator() of the value_compare object throws. Basic guarantee.
@@ -249,59 +249,59 @@ class splaytree_impl
}
//! <b>Effects</b>: to-do
- //!
+ //!
splaytree_impl(BOOST_RV_REF(splaytree_impl) x)
: data_(::boost::move(x.priv_comp()), ::boost::move(x.priv_value_traits()))
{
- node_algorithms::init_header(this->priv_header_ptr());
+ node_algorithms::init_header(this->priv_header_ptr());
this->priv_size_traits().set_size(size_type(0));
this->swap(x);
}
//! <b>Effects</b>: to-do
- //!
- splaytree_impl& operator=(BOOST_RV_REF(splaytree_impl) x)
+ //!
+ splaytree_impl& operator=(BOOST_RV_REF(splaytree_impl) x)
{ this->swap(x); return *this; }
- //! <b>Effects</b>: Detaches all elements from this. The objects in the set
- //! are not deleted (i.e. no destructors are called), but the nodes according to
- //! the value_traits template parameter are reinitialized and thus can be reused.
- //!
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the set
+ //! are not deleted (i.e. no destructors are called), but the nodes according to
+ //! the value_traits template parameter are reinitialized and thus can be reused.
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- ~splaytree_impl()
+ ~splaytree_impl()
{}
//! <b>Effects</b>: Returns an iterator pointing to the beginning of the tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator begin()
{ return iterator(node_algorithms::begin_node(this->priv_header_ptr()), this); }
//! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator begin() const
{ return cbegin(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cbegin() const
{ return const_iterator(node_algorithms::begin_node(this->priv_header_ptr()), this); }
//! <b>Effects</b>: Returns an iterator pointing to the end of the tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator end()
{ return iterator (this->priv_header_ptr(), this); }
@@ -309,138 +309,138 @@ class splaytree_impl
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the tree.
//!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator end() const
{ return cend(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cend() const
{ return const_iterator (uncast(this->priv_header_ptr()), this); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning of the
//! reversed tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rbegin()
{ return reverse_iterator(end()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rbegin() const
{ return const_reverse_iterator(end()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crbegin() const
{ return const_reverse_iterator(end()); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the end
//! of the reversed tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rend()
{ return reverse_iterator(begin()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rend() const
{ return const_reverse_iterator(begin()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crend() const
{ return const_reverse_iterator(begin()); }
//! <b>Precondition</b>: end_iterator must be a valid end iterator
//! of splaytree.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the splaytree associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static splaytree_impl &container_from_end_iterator(iterator end_iterator)
{ return priv_container_from_end_iterator(end_iterator); }
//! <b>Precondition</b>: end_iterator must be a valid end const_iterator
//! of splaytree.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the splaytree associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static const splaytree_impl &container_from_end_iterator(const_iterator end_iterator)
{ return priv_container_from_end_iterator(end_iterator); }
//! <b>Precondition</b>: it must be a valid iterator
//! of rbtree.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the tree associated to the iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
static splaytree_impl &container_from_iterator(iterator it)
{ return priv_container_from_iterator(it); }
//! <b>Precondition</b>: it must be a valid end const_iterator
//! of rbtree.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the tree associated to the iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
static const splaytree_impl &container_from_iterator(const_iterator it)
{ return priv_container_from_iterator(it); }
//! <b>Effects</b>: Returns the value_compare object used by the tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If value_compare copy-constructor throws.
value_compare value_comp() const
{ return priv_comp(); }
//! <b>Effects</b>: Returns true if the container is empty.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
bool empty() const
{ return this->cbegin() == this->cend(); }
//! <b>Effects</b>: Returns the number of elements stored in the tree.
- //!
+ //!
//! <b>Complexity</b>: Linear to elements contained in *this
//! if constant-time size option is disabled. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
size_type size() const
{
@@ -453,9 +453,9 @@ class splaytree_impl
}
//! <b>Effects</b>: Swaps the contents of two splaytrees.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If the comparison functor's swap call throws.
void swap(splaytree_impl& other)
{
@@ -472,14 +472,14 @@ class splaytree_impl
}
//! <b>Requires</b>: value must be an lvalue
- //!
+ //!
//! <b>Effects</b>: Inserts value into the tree before the lower bound.
- //!
+ //!
//! <b>Complexity</b>: Average complexity for insert element is amortized
//! logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
iterator insert_equal(reference value)
@@ -497,16 +497,16 @@ class splaytree_impl
//! <b>Requires</b>: value must be an lvalue, and "hint" must be
//! a valid iterator.
- //!
+ //!
//! <b>Effects</b>: Inserts x into the tree, using "hint" as a hint to
//! where it will be inserted. If "hint" is the upper_bound
//! the insertion takes constant time (two comparisons in the worst case)
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic in general, but it is amortized
//! constant time if t is inserted immediately before hint.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
iterator insert_equal(const_iterator hint, reference value)
@@ -522,18 +522,18 @@ class splaytree_impl
return ret;
}
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
//! of type value_type.
- //!
+ //!
//! <b>Effects</b>: Inserts a each element of a range into the tree
//! before the upper bound of the key of each element.
- //!
+ //!
//! <b>Complexity</b>: Insert range is in general amortized O(N * log(N)), where N is the
//! size of the range. However, it is linear in N if the range is already sorted
//! by value_comp().
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
template<class Iterator>
@@ -547,14 +547,14 @@ class splaytree_impl
}
//! <b>Requires</b>: value must be an lvalue
- //!
+ //!
//! <b>Effects</b>: Inserts value into the tree if the value
//! is not already present.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
std::pair<iterator, bool> insert_unique(reference value)
@@ -568,16 +568,16 @@ class splaytree_impl
//! <b>Requires</b>: value must be an lvalue, and "hint" must be
//! a valid iterator
- //!
+ //!
//! <b>Effects</b>: Tries to insert x into the tree, using "hint" as a hint
//! to where it will be inserted.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic in general, but it is amortized
//! constant time (two comparisons in the worst case)
//! if t is inserted immediately before hint.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
iterator insert_unique(const_iterator hint, reference value)
@@ -589,17 +589,17 @@ class splaytree_impl
return insert_unique_commit(value, commit_data);
}
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
//! of type value_type.
- //!
+ //!
//! <b>Effects</b>: Tries to insert each element of a range into the tree.
- //!
- //! <b>Complexity</b>: Insert range is in general amortized O(N * log(N)), where N is the
- //! size of the range. However, it is linear in N if the range is already sorted
+ //!
+ //! <b>Complexity</b>: Insert range is in general amortized O(N * log(N)), where N is the
+ //! size of the range. However, it is linear in N if the range is already sorted
//! by value_comp().
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
template<class Iterator>
@@ -609,10 +609,10 @@ class splaytree_impl
this->insert_unique(*b);
}
- //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
//! the same strict weak ordering as value_compare. The difference is that
//! key_value_comp compares an arbitrary key with the contained values.
- //!
+ //!
//! <b>Effects</b>: Checks if a value can be inserted in the container, using
//! a user provided key instead of the value itself.
//!
@@ -621,16 +621,16 @@ class splaytree_impl
//! and false. If the value can be inserted returns true in the returned
//! pair boolean and fills "commit_data" that is meant to be used with
//! the "insert_commit" function.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is at most logarithmic.
//!
//! <b>Throws</b>: If the key_value_comp ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Notes</b>: This function is used to improve performance when constructing
//! a value_type is expensive: if there is an equivalent value
//! the constructed object must be discarded. Many times, the part of the
//! node that is used to impose the order is much cheaper to construct
- //! than the value_type and this function offers the possibility to use that
+ //! than the value_type and this function offers the possibility to use that
//! part to check if the insertion will be successful.
//!
//! If the check is successful, the user can construct the value_type and use
@@ -645,18 +645,18 @@ class splaytree_impl
{
detail::key_nodeptr_comp<KeyValueCompare, splaytree_impl>
comp(key_value_comp, this);
- std::pair<node_ptr, bool> ret =
+ std::pair<node_ptr, bool> ret =
(node_algorithms::insert_unique_check
(this->priv_header_ptr(), key, comp, commit_data));
return std::pair<iterator, bool>(iterator(ret.first, this), ret.second);
}
- //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
//! the same strict weak ordering as value_compare. The difference is that
//! key_value_comp compares an arbitrary key with the contained values.
- //!
+ //!
//! <b>Effects</b>: Checks if a value can be inserted in the container, using
- //! a user provided key instead of the value itself, using "hint"
+ //! a user provided key instead of the value itself, using "hint"
//! as a hint to where it will be inserted.
//!
//! <b>Returns</b>: If there is an equivalent value
@@ -664,23 +664,23 @@ class splaytree_impl
//! and false. If the value can be inserted returns true in the returned
//! pair boolean and fills "commit_data" that is meant to be used with
//! the "insert_commit" function.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic in general, but it's amortized
//! constant time if t is inserted immediately before hint.
//!
//! <b>Throws</b>: If the key_value_comp ordering function throws. Strong guarantee.
- //!
+ //!
//! <b>Notes</b>: This function is used to improve performance when constructing
//! a value_type is expensive: if there is an equivalent value
//! the constructed object must be discarded. Many times, the part of the
//! constructing that is used to impose the order is much cheaper to construct
- //! than the value_type and this function offers the possibility to use that key
+ //! than the value_type and this function offers the possibility to use that key
//! to check if the insertion will be successful.
//!
//! If the check is successful, the user can construct the value_type and use
//! "insert_commit" to insert the object in constant-time. This can give a total
//! constant-time complexity to the insertion: check(O(1)) + commit(O(1)).
- //!
+ //!
//! "commit_data" remains valid for a subsequent "insert_commit" only if no more
//! objects are inserted or erased from the container.
template<class KeyType, class KeyValueCompare>
@@ -690,7 +690,7 @@ class splaytree_impl
{
detail::key_nodeptr_comp<KeyValueCompare, splaytree_impl>
comp(key_value_comp, this);
- std::pair<node_ptr, bool> ret =
+ std::pair<node_ptr, bool> ret =
node_algorithms::insert_unique_check
(this->priv_header_ptr(), hint.pointed_node(), key, comp, commit_data);
return std::pair<iterator, bool>(iterator(ret.first, this), ret.second);
@@ -700,16 +700,16 @@ class splaytree_impl
//! must have been obtained from a previous call to "insert_check".
//! No objects should have been inserted or erased from the container between
//! the "insert_check" that filled "commit_data" and the call to "insert_commit".
- //!
+ //!
//! <b>Effects</b>: Inserts the value in the avl_set using the information obtained
//! from the "commit_data" that a previous "insert_check" filled.
//!
//! <b>Returns</b>: An iterator to the newly inserted object.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function has only sense if a "insert_check" has been
//! previously executed to fill "commit_data". No value should be inserted or
//! erased between the "insert_check" and "insert_commit" calls.
@@ -724,12 +724,12 @@ class splaytree_impl
return iterator(to_insert, this);
}
- //! <b>Effects</b>: Erases the element pointed to by pos.
- //!
- //! <b>Complexity</b>: Average complexity for erase element is constant time.
- //!
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
iterator erase(const_iterator i)
@@ -746,26 +746,26 @@ class splaytree_impl
return ret.unconst();
}
- //! <b>Effects</b>: Erases the range pointed to by b end e.
- //!
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //!
//! <b>Complexity</b>: Average complexity for erase range is amortized
//! O(log(size() + N)), where N is the number of elements in the range.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
iterator erase(const_iterator b, const_iterator e)
{ size_type n; return private_erase(b, e, n); }
//! <b>Effects</b>: Erases all the elements with the given value.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: Amortized O(log(size() + N).
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
size_type erase(const_reference value)
@@ -775,11 +775,11 @@ class splaytree_impl
//! according to the comparison functor "comp".
//!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: Amortized O(log(size() + N).
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class KeyType, class KeyValueCompare>
@@ -797,14 +797,14 @@ class splaytree_impl
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//!
- //! <b>Effects</b>: Erases the element pointed to by pos.
+ //! <b>Effects</b>: Erases the element pointed to by pos.
//! Disposer::operator()(pointer) is called for the removed element.
- //!
- //! <b>Complexity</b>: Average complexity for erase element is constant time.
- //!
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
//! <b>Throws</b>: Nothing.
- //!
- //! <b>Note</b>: Invalidates the iterators
+ //!
+ //! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
iterator erase_and_dispose(const_iterator i, Disposer disposer)
@@ -825,12 +825,12 @@ class splaytree_impl
//!
//! <b>Effects</b>: Erases the range pointed to by b end e.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Complexity</b>: Average complexity for erase range is amortized
//! O(log(size() + N)), where N is the number of elements in the range.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
@@ -841,13 +841,13 @@ class splaytree_impl
//!
//! <b>Effects</b>: Erases all the elements with the given value.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: Amortized O(log(size() + N).
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class Disposer>
@@ -866,11 +866,11 @@ class splaytree_impl
//! Disposer::operator()(pointer) is called for the removed elements.
//!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: Amortized O(log(size() + N).
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class KeyType, class KeyValueCompare, class Disposer>
@@ -886,13 +886,13 @@ class splaytree_impl
return n;
}
- //! <b>Effects</b>: Erases all of the elements.
- //!
+ //! <b>Effects</b>: Erases all of the elements.
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
void clear()
@@ -910,9 +910,9 @@ class splaytree_impl
//! each node to be erased.
//! <b>Complexity</b>: Amortized O(log(size() + N)),
//! where N is the number of elements in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. Calls N times to disposer functor.
template<class Disposer>
@@ -924,19 +924,19 @@ class splaytree_impl
}
//! <b>Effects</b>: Returns the number of contained elements with the given value
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic to the number of elements contained plus lineal
//! to number of objects with the given value.
- //!
+ //!
//! <b>Throws</b>: Nothing.
size_type count(const_reference value)
{ return this->count(value, priv_comp()); }
//! <b>Effects</b>: Returns the number of contained elements with the given key
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic to the number of elements contained plus lineal
//! to number of objects with the given key.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
size_type count(const KeyType &key, KeyValueCompare comp)
@@ -946,19 +946,19 @@ class splaytree_impl
}
//! <b>Effects</b>: Returns the number of contained elements with the given value
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic to the number of elements contained plus lineal
//! to number of objects with the given value.
- //!
+ //!
//! <b>Throws</b>: Nothing.
size_type count_dont_splay(const_reference value) const
{ return this->count_dont_splay(value, priv_comp()); }
//! <b>Effects</b>: Returns the number of contained elements with the given key
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic to the number of elements contained plus lineal
//! to number of objects with the given key.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
size_type count_dont_splay(const KeyType &key, KeyValueCompare comp) const
@@ -969,27 +969,27 @@ class splaytree_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator lower_bound(const_reference value)
{ return this->lower_bound(value, priv_comp()); }
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator lower_bound_dont_splay(const_reference value) const
{ return this->lower_bound_dont_splay(value, priv_comp()); }
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
iterator lower_bound(const KeyType &key, KeyValueCompare comp)
@@ -1002,9 +1002,9 @@ class splaytree_impl
//! <b>Effects</b>: Returns a const iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
const_iterator lower_bound_dont_splay(const KeyType &key, KeyValueCompare comp) const
@@ -1017,9 +1017,9 @@ class splaytree_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is greater than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator upper_bound(const_reference value)
{ return this->upper_bound(value, priv_comp()); }
@@ -1029,7 +1029,7 @@ class splaytree_impl
//! does not exist.
//!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
iterator upper_bound(const KeyType &key, KeyValueCompare comp)
@@ -1042,9 +1042,9 @@ class splaytree_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is greater than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator upper_bound_dont_splay(const_reference value) const
{ return this->upper_bound_dont_splay(value, priv_comp()); }
@@ -1054,7 +1054,7 @@ class splaytree_impl
//! does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
const_iterator upper_bound_dont_splay(const KeyType &key, KeyValueCompare comp) const
@@ -1065,20 +1065,20 @@ class splaytree_impl
(this->priv_header_ptr(), key, key_node_comp, false), this);
}
- //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
//! k or end() if that element does not exist.
//!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator find(const_reference value)
{ return this->find(value, priv_comp()); }
- //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
//! k or end() if that element does not exist.
//!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
iterator find(const KeyType &key, KeyValueCompare comp)
@@ -1089,20 +1089,20 @@ class splaytree_impl
(node_algorithms::find(this->priv_header_ptr(), key, key_node_comp), this);
}
- //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
//! k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator find_dont_splay(const_reference value) const
{ return this->find_dont_splay(value, priv_comp()); }
- //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
//! k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
const_iterator find_dont_splay(const KeyType &key, KeyValueCompare comp) const
@@ -1116,9 +1116,9 @@ class splaytree_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
std::pair<iterator,iterator> equal_range(const_reference value)
{ return this->equal_range(value, priv_comp()); }
@@ -1126,9 +1126,9 @@ class splaytree_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
std::pair<iterator,iterator> equal_range(const KeyType &key, KeyValueCompare comp)
@@ -1143,9 +1143,9 @@ class splaytree_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
std::pair<const_iterator, const_iterator>
equal_range_dont_splay(const_reference value) const
@@ -1154,9 +1154,9 @@ class splaytree_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
std::pair<const_iterator, const_iterator>
@@ -1169,19 +1169,117 @@ class splaytree_impl
return std::pair<const_iterator, const_iterator>(const_iterator(ret.first, this), const_iterator(ret.second, this));
}
+ //! <b>Requires</b>: 'lower_value' must not be greater than 'upper_value'. If
+ //! 'lower_value' == 'upper_value', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_value and upper_value.
+ std::pair<iterator,iterator> bounded_range
+ (const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed)
+ { return this->bounded_range(lower_value, upper_value, priv_comp(), left_closed, right_closed); }
+
+ //! <b>Requires</b>: KeyValueCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise
+ //!
+ //! second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator,iterator> bounded_range
+ (const KeyType &lower_key, const KeyType &upper_key, KeyValueCompare comp, bool left_closed, bool right_closed)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, splaytree_impl>
+ key_node_comp(comp, this);
+ std::pair<node_ptr, node_ptr> ret
+ (node_algorithms::bounded_range
+ (this->priv_header_ptr(), lower_key, upper_key, key_node_comp, left_closed, right_closed));
+ return std::pair<iterator, iterator>(iterator(ret.first, this), iterator(ret.second, this));
+ }
+
+ //! <b>Requires</b>: 'lower_value' must not be greater than 'upper_value'. If
+ //! 'lower_value' == 'upper_value', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_value and upper_value.
+ std::pair<const_iterator,const_iterator> bounded_range
+ (const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed) const
+ { return this->bounded_range_dont_splay(lower_value, upper_value, priv_comp(), left_closed, right_closed); }
+
+ //! <b>Requires</b>: KeyValueCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise
+ //!
+ //! second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<const_iterator,const_iterator> bounded_range
+ (const KeyType &lower_key, const KeyType &upper_key, KeyValueCompare comp, bool left_closed, bool right_closed) const
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, splaytree_impl>
+ key_node_comp(comp, this);
+ std::pair<node_ptr, node_ptr> ret
+ (node_algorithms::bounded_range
+ (this->priv_header_ptr(), lower_key, upper_key, key_node_comp, left_closed, right_closed, false));
+ return std::pair<const_iterator, const_iterator>(const_iterator(ret.first, this), const_iterator(ret.second, this));
+ }
+
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//! Cloner should yield to nodes equivalent to the original nodes.
//!
//! <b>Effects</b>: Erases all the elements from *this
- //! calling Disposer::operator()(pointer), clones all the
+ //! calling Disposer::operator()(pointer), clones all the
//! elements from src calling Cloner::operator()(const_reference )
//! and inserts them on *this. Copies the predicate from the source container.
//!
//! If cloner throws, all cloned elements are unlinked and disposed
//! calling Disposer::operator()(pointer).
- //!
+ //!
//! <b>Complexity</b>: Linear to erased plus inserted elements.
- //!
+ //!
//! <b>Throws</b>: If cloner throws or predicate copy assignment throws. Basic guarantee.
template <class Cloner, class Disposer>
void clone_from(const splaytree_impl &src, Cloner cloner, Disposer disposer)
@@ -1202,11 +1300,11 @@ class splaytree_impl
}
//! <b>Effects</b>: Unlinks the leftmost node from the tree.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function breaks the tree and the tree can
//! only be used for more unlink_leftmost_without_rebalance calls.
//! This function is normally used to achieve a step by step
@@ -1224,12 +1322,12 @@ class splaytree_impl
}
//! <b>Requires</b>: i must be a valid iterator of *this.
- //!
+ //!
//! <b>Effects</b>: Rearranges the splay set so that the element pointed by i
//! is placed as the root of the tree, improving future searches of this value.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
void splay_up(iterator i)
{ return node_algorithms::splay_up(i.pointed_node(), this->priv_header_ptr()); }
@@ -1238,7 +1336,7 @@ class splaytree_impl
//! with a key equivalent to value the element is placed as the root of the
//! tree. If the element is not present returns the last node compared with the key.
//! If the tree is empty, end() is returned.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic.
//!
//! <b>Returns</b>: An iterator to the new root of the tree, end() if the tree is empty.
@@ -1256,9 +1354,9 @@ class splaytree_impl
//! <b>Effects</b>: Rearranges the splay set so that if *this stores an element
//! with a key equivalent to value the element is placed as the root of the
//! tree.
- //!
+ //!
//! <b>Complexity</b>: Amortized logarithmic.
- //!
+ //!
//! <b>Returns</b>: An iterator to the new root of the tree, end() if the tree is empty.
//!
//! <b>Throws</b>: If the predicate throws.
@@ -1267,14 +1365,14 @@ class splaytree_impl
//! <b>Requires</b>: replace_this must be a valid iterator of *this
//! and with_this must not be inserted in any tree.
- //!
+ //!
//! <b>Effects</b>: Replaces replace_this in its position in the
//! tree with with_this. The tree does not need to be rebalanced.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! with_this is not equivalent to *replace_this according to the
//! ordering rules. This function is faster than erasing and inserting
@@ -1290,14 +1388,14 @@ class splaytree_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator i belonging to the set
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
static iterator s_iterator_to(reference value)
@@ -1308,17 +1406,17 @@ class splaytree_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
//! set that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
- static const_iterator s_iterator_to(const_reference value)
+ static const_iterator s_iterator_to(const_reference value)
{
BOOST_STATIC_ASSERT((!stateful_value_traits));
return const_iterator (value_traits::to_node_ptr(const_cast<reference> (value)), 0);
@@ -1326,70 +1424,70 @@ class splaytree_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator i belonging to the set
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator iterator_to(reference value)
{ return iterator (value_traits::to_node_ptr(value), this); }
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
//! set that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator iterator_to(const_reference value) const
{ return const_iterator (value_traits::to_node_ptr(const_cast<reference> (value)), this); }
//! <b>Requires</b>: value shall not be in a tree.
- //!
+ //!
//! <b>Effects</b>: init_node puts the hook of a value in a well-known default
//! state.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Note</b>: This function puts the hook in the well-known default state
//! used by auto_unlink and safe hooks.
static void init_node(reference value)
{ node_algorithms::init(value_traits::to_node_ptr(value)); }
//! <b>Effects</b>: Rebalances the tree.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear.
void rebalance()
{ node_algorithms::rebalance(this->priv_header_ptr()); }
//! <b>Requires</b>: old_root is a node of a tree.
- //!
+ //!
//! <b>Effects</b>: Rebalances the subtree rooted at old_root.
//!
//! <b>Returns</b>: The new root of the subtree.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the elements in the subtree.
iterator rebalance_subtree(iterator root)
{ return iterator(node_algorithms::rebalance_subtree(root.pointed_node()), this); }
/*
//! <b>Effects</b>: removes x from a tree of the appropriate type. It has no effect,
- //! if x is not in such a tree.
- //!
+ //! if x is not in such a tree.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Note</b>: This static function is only usable with the "safe mode"
//! hook and non-constant time size lists. Otherwise, the user must use
//! the non-static "erase(reference )" member. If the user calls
@@ -1399,7 +1497,7 @@ class splaytree_impl
static void remove_node(T& value)
{
//This function is only usable for safe mode hooks and non-constant
- //time lists.
+ //time lists.
//BOOST_STATIC_ASSERT((!(safemode_or_autounlink && constant_time_size)));
BOOST_STATIC_ASSERT((!constant_time_size));
BOOST_STATIC_ASSERT((boost::is_convertible<T, value_type>::value));
@@ -1571,7 +1669,7 @@ template<class T, class ...Options>
struct make_splaytree_opt
{
typedef typename pack_options
- < splay_set_defaults<T>,
+ < splay_set_defaults<T>,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -1602,7 +1700,7 @@ struct make_splaytree
{
/// @cond
typedef splaytree_impl
- < typename make_splaytree_opt<T,
+ < typename make_splaytree_opt<T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -1621,7 +1719,7 @@ template<class T, class O1, class O2, class O3, class O4>
template<class T, class ...Options>
#endif
class splaytree
- : public make_splaytree<T,
+ : public make_splaytree<T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -1630,7 +1728,7 @@ class splaytree
>::type
{
typedef typename make_splaytree
- <T,
+ <T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -1678,8 +1776,8 @@ class splaytree
#endif
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/splaytree_algorithms.hpp b/boost/intrusive/splaytree_algorithms.hpp
index 0c699030ea..8155648983 100644
--- a/boost/intrusive/splaytree_algorithms.hpp
+++ b/boost/intrusive/splaytree_algorithms.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2007.
+// (C) Copyright Ion Gaztanaga 2007-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -15,8 +15,8 @@
// The code has been modified and (supposely) improved by Ion Gaztanaga.
// Here is the header of the file used as base code:
//
-// splay_tree.h -- implementation of a STL complatible splay tree.
-//
+// splay_tree.h -- implementation of a STL compatible splay tree.
+//
// Copyright (c) 2004 Ralf Mattethat
//
// Permission to copy, use, modify, sell and distribute this software
@@ -24,22 +24,22 @@
// This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
//
-// Please send questions, comments, complaints, performance data, etc to
+// Please send questions, comments, complaints, performance data, etc to
// ralf.mattethat@teknologisk.dk
//
// Requirements for element type
// * must be copy-constructible
// * destructor must not throw exception
//
-// Methods marked with note A only throws an exception if the evaluation of the
-// predicate throws an exception. If an exception is thrown the call has no
+// Methods marked with note A only throws an exception if the evaluation of the
+// predicate throws an exception. If an exception is thrown the call has no
// effect on the containers state
//
// Methods marked with note B only throws an exception if the coppy constructor
-// or assignment operator of the predicate throws an exception. If an exception
+// or assignment operator of the predicate throws an exception. If an exception
// is thrown the call has no effect on the containers state
//
-// iterators are only invalidated, if the element pointed to by the iterator
+// iterators are only invalidated, if the element pointed to by the iterator
// is deleted. The same goes for element references
//
@@ -95,8 +95,8 @@ struct splaydown_rollback
//! A splay tree is an implementation of a binary search tree. The tree is
//! self balancing using the splay algorithm as described in
-//!
-//! "Self-Adjusting Binary Search Trees
+//!
+//! "Self-Adjusting Binary Search Trees
//! by Daniel Dominic Sleator and Robert Endre Tarjan
//! AT&T Bell Laboratories, Murray Hill, NJ
//! Journal of the ACM, Vol 32, no 3, July 1985, pp 652-686
@@ -116,15 +116,15 @@ struct splaydown_rollback
//! <b>Static functions</b>:
//!
//! <tt>static node_ptr get_parent(const_node_ptr n);</tt>
-//!
+//!
//! <tt>static void set_parent(node_ptr n, node_ptr parent);</tt>
//!
//! <tt>static node_ptr get_left(const_node_ptr n);</tt>
-//!
+//!
//! <tt>static void set_left(node_ptr n, node_ptr left);</tt>
//!
//! <tt>static node_ptr get_right(const_node_ptr n);</tt>
-//!
+//!
//! <tt>static void set_right(node_ptr n, node_ptr right);</tt>
template<class NodeTraits>
class splaytree_algorithms
@@ -159,11 +159,11 @@ class splaytree_algorithms
//! <b>Requires</b>: node is a node of the tree or an node initialized
//! by init(...).
- //!
+ //!
//! <b>Effects</b>: Returns true if the node is initialized by init().
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static bool unique(const const_node_ptr & node)
{ return tree_algorithms::unique(node); }
@@ -173,15 +173,15 @@ class splaytree_algorithms
//! <b>Requires</b>: node1 and node2 can't be header nodes
//! of two trees.
- //!
+ //!
//! <b>Effects</b>: Swaps two nodes. After the function node1 will be inserted
//! in the position node2 before the function. node2 will be inserted in the
//! position node1 had before the function.
- //!
- //! <b>Complexity</b>: Logarithmic.
- //!
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! node1 and node2 are not equivalent according to the ordering rules.
//!
@@ -190,22 +190,22 @@ class splaytree_algorithms
{
if(node1 == node2)
return;
-
+
node_ptr header1(tree_algorithms::get_header(node1)), header2(tree_algorithms::get_header(node2));
swap_nodes(node1, header1, node2, header2);
}
//! <b>Requires</b>: node1 and node2 can't be header nodes
//! of two trees with header header1 and header2.
- //!
+ //!
//! <b>Effects</b>: Swaps two nodes. After the function node1 will be inserted
//! in the position node2 before the function. node2 will be inserted in the
//! position node1 had before the function.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! node1 and node2 are not equivalent according to the ordering rules.
//!
@@ -215,14 +215,14 @@ class splaytree_algorithms
//! <b>Requires</b>: node_to_be_replaced must be inserted in a tree
//! and new_node must not be inserted in a tree.
- //!
+ //!
//! <b>Effects</b>: Replaces node_to_be_replaced in its position in the
//! tree with new_node. The tree does not need to be rebalanced
- //!
- //! <b>Complexity</b>: Logarithmic.
- //!
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! new_node is not equivalent to node_to_be_replaced according to the
//! ordering rules. This function is faster than erasing and inserting
@@ -238,14 +238,14 @@ class splaytree_algorithms
//! <b>Requires</b>: node_to_be_replaced must be inserted in a tree
//! with header "header" and new_node must not be inserted in a tree.
- //!
+ //!
//! <b>Effects</b>: Replaces node_to_be_replaced in its position in the
//! tree with new_node. The tree does not need to be rebalanced
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! new_node is not equivalent to node_to_be_replaced according to the
//! ordering rules. This function is faster than erasing and inserting
@@ -256,21 +256,21 @@ class splaytree_algorithms
{ tree_algorithms::replace_node(node_to_be_replaced, header, new_node); }
//! <b>Requires</b>: p is a node from the tree except the header.
- //!
+ //!
//! <b>Effects</b>: Returns the next node of the tree.
- //!
+ //!
//! <b>Complexity</b>: Average constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static node_ptr next_node(const node_ptr & p)
{ return tree_algorithms::next_node(p); }
//! <b>Requires</b>: p is a node from the tree except the leftmost node.
- //!
+ //!
//! <b>Effects</b>: Returns the previous node of the tree.
- //!
+ //!
//! <b>Complexity</b>: Average constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static node_ptr prev_node(const node_ptr & p)
{ return tree_algorithms::prev_node(p); }
@@ -278,9 +278,9 @@ class splaytree_algorithms
//! <b>Requires</b>: node must not be part of any tree.
//!
//! <b>Effects</b>: After the function unique(node) == true.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
//!
//! <b>Nodes</b>: If node is inserted in a tree, this function corrupts the tree.
@@ -291,9 +291,9 @@ class splaytree_algorithms
//!
//! <b>Effects</b>: Initializes the header to represent an empty tree.
//! unique(header) == true.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
//!
//! <b>Nodes</b>: If node is inserted in a tree, this function corrupts the tree.
@@ -303,46 +303,46 @@ class splaytree_algorithms
//! <b>Requires</b>: "disposer" must be an object function
//! taking a node_ptr parameter and shouldn't throw.
//!
- //! <b>Effects</b>: Empties the target tree calling
+ //! <b>Effects</b>: Empties the target tree calling
//! <tt>void disposer::operator()(const node_ptr &)</tt> for every node of the tree
//! except the header.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of element of the source tree plus the.
//! number of elements of tree target tree when calling this function.
- //!
+ //!
//! <b>Throws</b>: If cloner functor throws. If this happens target nodes are disposed.
template<class Disposer>
static void clear_and_dispose(const node_ptr & header, Disposer disposer)
{ tree_algorithms::clear_and_dispose(header, disposer); }
//! <b>Requires</b>: node is a node of the tree but it's not the header.
- //!
+ //!
//! <b>Effects</b>: Returns the number of nodes of the subtree.
- //!
+ //!
//! <b>Complexity</b>: Linear time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static std::size_t count(const const_node_ptr & node)
{ return tree_algorithms::count(node); }
//! <b>Requires</b>: header is the header node of the tree.
- //!
+ //!
//! <b>Effects</b>: Returns the number of nodes above the header.
- //!
+ //!
//! <b>Complexity</b>: Linear time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static std::size_t size(const const_node_ptr & header)
{ return tree_algorithms::size(header); }
//! <b>Requires</b>: header1 and header2 must be the header nodes
//! of two trees.
- //!
- //! <b>Effects</b>: Swaps two trees. After the function header1 will contain
+ //!
+ //! <b>Effects</b>: Swaps two trees. After the function header1 will contain
//! links to the second tree and header2 will have links to the first tree.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
static void swap_tree(const node_ptr & header1, const node_ptr & header2)
{ return tree_algorithms::swap_tree(header1, header2); }
@@ -351,16 +351,16 @@ class splaytree_algorithms
//! "commit_data" must have been obtained from a previous call to
//! "insert_unique_check". No objects should have been inserted or erased
//! from the set between the "insert_unique_check" that filled "commit_data"
- //! and the call to "insert_commit".
- //!
- //!
+ //! and the call to "insert_commit".
+ //!
+ //!
//! <b>Effects</b>: Inserts new_node in the set using the information obtained
//! from the "commit_data" that a previous "insert_check" filled.
//!
//! <b>Complexity</b>: Constant time.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function has only sense if a "insert_unique_check" has been
//! previously executed to fill "commit_data". No value should be inserted or
//! erased between the "insert_check" and "insert_commit" calls.
@@ -372,7 +372,7 @@ class splaytree_algorithms
//! KeyNodePtrCompare is a function object that induces a strict weak
//! ordering compatible with the strict weak ordering used to create the
//! the tree. NodePtrCompare compares KeyType with a node_ptr.
- //!
+ //!
//! <b>Effects</b>: Checks if there is an equivalent node to "key" in the
//! tree according to "comp" and obtains the needed information to realize
//! a constant-time node insertion if there is no equivalent node.
@@ -383,11 +383,11 @@ class splaytree_algorithms
//! in the returned pair's boolean and fills "commit_data" that is meant to
//! be used with the "insert_commit" function to achieve a constant-time
//! insertion function.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is at most logarithmic.
//!
//! <b>Throws</b>: If "comp" throws.
- //!
+ //!
//! <b>Notes</b>: This function is used to improve performance when constructing
//! a node is expensive and the user does not want to have two equivalent nodes
//! in the tree: if there is an equivalent value
@@ -432,7 +432,7 @@ class splaytree_algorithms
//! "key" according to "comp" or "header" if that element does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class KeyType, class KeyNodePtrCompare>
static node_ptr find
@@ -457,7 +457,7 @@ class splaytree_algorithms
//! if they there are no equivalent elements.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class KeyType, class KeyNodePtrCompare>
static std::pair<node_ptr, node_ptr> equal_range
@@ -477,13 +477,45 @@ class splaytree_algorithms
//! KeyNodePtrCompare is a function object that induces a strict weak
//! ordering compatible with the strict weak ordering used to create the
//! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyNodePtrCompare>
+ static std::pair<node_ptr, node_ptr> bounded_range
+ (const const_node_ptr & header, const KeyType &lower_key, const KeyType &upper_key, KeyNodePtrCompare comp
+ , bool left_closed, bool right_closed, bool splay = true)
+ {
+ std::pair<node_ptr, node_ptr> ret =
+ tree_algorithms::bounded_range(header, lower_key, upper_key, comp, left_closed, right_closed);
+
+ if(splay)
+ splay_up(ret.first, uncast(header));
+ return ret;
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
//!
//! <b>Effects</b>: Returns an node_ptr to the first element that is
//! not less than "key" according to "comp" or "header" if that element does
//! not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class KeyType, class KeyNodePtrCompare>
static node_ptr lower_bound
@@ -506,7 +538,7 @@ class splaytree_algorithms
//! than "key" according to "comp" or "header" if that element does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class KeyType, class KeyNodePtrCompare>
static node_ptr upper_bound
@@ -525,14 +557,14 @@ class splaytree_algorithms
//! ordering compatible with the strict weak ordering used to create the
//! the tree. NodePtrCompare compares two node_ptrs. "hint" is node from
//! the "header"'s tree.
- //!
+ //!
//! <b>Effects</b>: Inserts new_node into the tree, using "hint" as a hint to
//! where it will be inserted. If "hint" is the upper_bound
//! the insertion takes constant time (two comparisons in the worst case).
//!
//! <b>Complexity</b>: Logarithmic in general, but it is amortized
//! constant time if new_node is inserted immediately before "hint".
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class NodePtrCompare>
static node_ptr insert_equal
@@ -548,13 +580,13 @@ class splaytree_algorithms
//! "pos" must be an iterator pointing to the successor to "new_node"
//! once inserted according to the order of already inserted nodes. This function does not
//! check "pos" and this precondition must be guaranteed by the caller.
- //!
+ //!
//! <b>Effects</b>: Inserts new_node into the tree before "pos".
//!
//! <b>Complexity</b>: Constant-time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: If "pos" is not the successor of the newly inserted "new_node"
//! tree invariants might be broken.
static node_ptr insert_before
@@ -568,13 +600,13 @@ class splaytree_algorithms
//! <b>Requires</b>: "header" must be the header node of a tree.
//! "new_node" must be, according to the used ordering no less than the
//! greatest inserted key.
- //!
+ //!
//! <b>Effects</b>: Inserts new_node into the tree before "pos".
//!
//! <b>Complexity</b>: Constant-time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: If "new_node" is less than the greatest inserted key
//! tree invariants are broken. This function is slightly faster than
//! using "insert_before".
@@ -587,13 +619,13 @@ class splaytree_algorithms
//! <b>Requires</b>: "header" must be the header node of a tree.
//! "new_node" must be, according to the used ordering, no greater than the
//! lowest inserted key.
- //!
+ //!
//! <b>Effects</b>: Inserts new_node into the tree before "pos".
//!
//! <b>Complexity</b>: Constant-time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: If "new_node" is greater than the lowest inserted key
//! tree invariants are broken. This function is slightly faster than
//! using "insert_before".
@@ -610,10 +642,10 @@ class splaytree_algorithms
//!
//! <b>Effects</b>: Inserts new_node into the tree before the upper bound
//! according to "comp".
- //!
+ //!
//! <b>Complexity</b>: Average complexity for insert element is at
//! most logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class NodePtrCompare>
static node_ptr insert_equal_upper_bound
@@ -630,10 +662,10 @@ class splaytree_algorithms
//!
//! <b>Effects</b>: Inserts new_node into the tree before the lower bound
//! according to "comp".
- //!
+ //!
//! <b>Complexity</b>: Average complexity for insert element is at
//! most logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class NodePtrCompare>
static node_ptr insert_equal_lower_bound
@@ -647,18 +679,18 @@ class splaytree_algorithms
//! object taking a node_ptr and returning a new cloned node of it. "disposer" must
//! take a node_ptr and shouldn't throw.
//!
- //! <b>Effects</b>: First empties target tree calling
+ //! <b>Effects</b>: First empties target tree calling
//! <tt>void disposer::operator()(const node_ptr &)</tt> for every node of the tree
//! except the header.
- //!
+ //!
//! Then, duplicates the entire tree pointed by "source_header" cloning each
- //! source node with <tt>node_ptr Cloner::operator()(const node_ptr &)</tt> to obtain
+ //! source node with <tt>node_ptr Cloner::operator()(const node_ptr &)</tt> to obtain
//! the nodes of the target tree. If "cloner" throws, the cloned target nodes
//! are disposed using <tt>void disposer(const node_ptr &)</tt>.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of element of the source tree plus the.
//! number of elements of tree target tree when calling this function.
- //!
+ //!
//! <b>Throws</b>: If cloner functor throws. If this happens target nodes are disposed.
template <class Cloner, class Disposer>
static void clone
@@ -723,13 +755,13 @@ class splaytree_algorithms
node_ptr t(header);
if( n == t ) return;
-
+
for( ;; ){
node_ptr p(NodeTraits::get_parent(n));
node_ptr g(NodeTraits::get_parent(p));
if( p == t ) break;
-
+
if( g == t ){
// zig
rotate(n);
@@ -772,10 +804,11 @@ class splaytree_algorithms
node_ptr leftmost (NodeTraits::get_left(header));
node_ptr rightmost(NodeTraits::get_right(header));
{
+ //Anti-exception rollback, recovers the original header node if an exception is thrown.
detail::splaydown_rollback<NodeTraits> rollback(&t, header, leftmost, rightmost);
- node_ptr null = header;
- node_ptr l = null;
- node_ptr r = null;
+ node_ptr null_node = header;
+ node_ptr l = null_node;
+ node_ptr r = null_node;
for( ;; ){
if(comp(key, t)){
@@ -827,10 +860,12 @@ class splaytree_algorithms
}
}
- assemble(t, l, r, null);
+ assemble(t, l, r, null_node);
rollback.release();
}
+ //Now recover the original header except for the
+ //splayed root node.
//t is the current root
NodeTraits::set_parent(header, t);
NodeTraits::set_parent(t, header);
@@ -841,23 +876,23 @@ class splaytree_algorithms
}
//! <b>Requires</b>: header must be the header of a tree.
- //!
+ //!
//! <b>Effects</b>: Rebalances the tree.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear.
static void rebalance(const node_ptr & header)
{ tree_algorithms::rebalance(header); }
//! <b>Requires</b>: old_root is a node of a tree.
- //!
+ //!
//! <b>Effects</b>: Rebalances the subtree rooted at old_root.
//!
//! <b>Returns</b>: The new root of the subtree.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear.
static node_ptr rebalance_subtree(const node_ptr & old_root)
{ return tree_algorithms::rebalance_subtree(old_root); }
@@ -868,7 +903,7 @@ class splaytree_algorithms
//! <b>Effects</b>: Returns a pointer to the header node of the tree.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static node_ptr get_header(const node_ptr & n)
{ return tree_algorithms::get_header(n); }
@@ -926,10 +961,10 @@ class splaytree_algorithms
{
node_ptr p = NodeTraits::get_parent(n);
node_ptr g = NodeTraits::get_parent(p);
- //Test if g is header before breaking tree
+ //Test if g is header before breaking tree
//invariants that would make is_header invalid
bool g_is_header = is_header(g);
-
+
if(NodeTraits::get_left(p) == n){
NodeTraits::set_left(p, NodeTraits::get_right(n));
if(NodeTraits::get_left(p) != node_ptr())
@@ -965,8 +1000,8 @@ class splaytree_algorithms
/// @endcond
};
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/treap.hpp b/boost/intrusive/treap.hpp
index cbf81c180e..b539acc569 100644
--- a/boost/intrusive/treap.hpp
+++ b/boost/intrusive/treap.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2008
+// (C) Copyright Ion Gaztanaga 2008-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -66,7 +66,7 @@ struct treap_set_defaults
/// @endcond
//! The class template treap is an intrusive treap container that
-//! is used to construct intrusive set and multiset containers. The no-throw
+//! is used to construct intrusive set and multiset containers. The no-throw
//! guarantee holds only, if the value_compare object and priority_compare object
//! don't throw.
//!
@@ -133,7 +133,7 @@ class treap_impl
//noncopyable
BOOST_MOVABLE_BUT_NOT_COPYABLE(treap_impl)
- enum { safemode_or_autounlink =
+ enum { safemode_or_autounlink =
(int)real_value_traits::link_mode == (int)auto_unlink ||
(int)real_value_traits::link_mode == (int)safe_link };
@@ -167,7 +167,7 @@ class treap_impl
{}
node_plus_pred_t node_plus_pred_;
} data_;
-
+
const value_compare &priv_comp() const
{ return data_.node_plus_pred_.get(); }
@@ -225,19 +225,19 @@ class treap_impl
typedef typename node_algorithms::insert_commit_data insert_commit_data;
- //! <b>Effects</b>: Constructs an empty treap.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //! <b>Effects</b>: Constructs an empty treap.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
//! or the copy constructor of the value_compare/priority_compare objects throw. Basic guarantee.
treap_impl( const value_compare &cmp = value_compare()
, const priority_compare &pcmp = priority_compare()
- , const value_traits &v_traits = value_traits())
+ , const value_traits &v_traits = value_traits())
: data_(cmp, pcmp, v_traits)
- {
- node_algorithms::init_header(this->priv_header_ptr());
+ {
+ node_algorithms::init_header(this->priv_header_ptr());
this->priv_size_traits().set_size(size_type(0));
}
@@ -249,10 +249,10 @@ class treap_impl
//!
//! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
//! comp and otherwise N * log N, where N is the distance between first and last.
- //!
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
- //! or the copy constructor/operator() of the value_compare/priority_compare objects
+ //! or the copy constructor/operator() of the value_compare/priority_compare objects
//! throw. Basic guarantee.
template<class Iterator>
treap_impl( bool unique, Iterator b, Iterator e
@@ -270,61 +270,61 @@ class treap_impl
}
//! <b>Effects</b>: to-do
- //!
+ //!
treap_impl(BOOST_RV_REF(treap_impl) x)
: data_( ::boost::move(x.priv_comp())
, ::boost::move(x.priv_pcomp())
, ::boost::move(x.priv_value_traits()))
{
- node_algorithms::init_header(this->priv_header_ptr());
+ node_algorithms::init_header(this->priv_header_ptr());
this->priv_size_traits().set_size(size_type(0));
this->swap(x);
}
//! <b>Effects</b>: to-do
- //!
- treap_impl& operator=(BOOST_RV_REF(treap_impl) x)
+ //!
+ treap_impl& operator=(BOOST_RV_REF(treap_impl) x)
{ this->swap(x); return *this; }
- //! <b>Effects</b>: Detaches all elements from this. The objects in the set
- //! are not deleted (i.e. no destructors are called), but the nodes according to
- //! the value_traits template parameter are reinitialized and thus can be reused.
- //!
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the set
+ //! are not deleted (i.e. no destructors are called), but the nodes according to
+ //! the value_traits template parameter are reinitialized and thus can be reused.
+ //!
//! <b>Complexity</b>: Linear to elements contained in *this
//! if constant-time size option is disabled. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- ~treap_impl()
+ ~treap_impl()
{}
//! <b>Effects</b>: Returns an iterator pointing to the beginning of the treap.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator begin()
{ return iterator (node_traits::get_left(this->priv_header_ptr()), this); }
//! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the treap.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator begin() const
{ return this->cbegin(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the treap.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cbegin() const
{ return const_iterator (node_traits::get_left(this->priv_header_ptr()), this); }
//! <b>Effects</b>: Returns an iterator pointing to the end of the treap.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator end()
{ return iterator (this->priv_header_ptr(), this); }
@@ -332,198 +332,198 @@ class treap_impl
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the treap.
//!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator end() const
{ return this->cend(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the treap.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cend() const
{ return const_iterator (uncast(this->priv_header_ptr()), this); }
//! <b>Effects</b>: Returns an iterator pointing to the highest priority object of the treap.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator top()
{ return this->empty() ? this->end() : iterator (node_traits::get_parent(this->priv_header_ptr()), this); }
//! <b>Effects</b>: Returns a const_iterator pointing to the highest priority object of the treap..
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator top() const
{ return this->ctop(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the highest priority object of the treap..
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator ctop() const
{ return this->empty() ? this->cend() : const_iterator (node_traits::get_parent(this->priv_header_ptr()), this); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning of the
//! reversed treap.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rbegin()
{ return reverse_iterator(this->end()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed treap.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rbegin() const
{ return const_reverse_iterator(this->end()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed treap.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crbegin() const
{ return const_reverse_iterator(this->end()); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the end
//! of the reversed treap.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rend()
{ return reverse_iterator(this->begin()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed treap.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rend() const
{ return const_reverse_iterator(this->begin()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed treap.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crend() const
{ return const_reverse_iterator(this->begin()); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the highest priority object of the
//! reversed treap.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rtop()
{ return reverse_iterator(this->top()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the highest priority objec
//! of the reversed treap.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rtop() const
{ return const_reverse_iterator(this->top()); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the highest priority object
//! of the reversed treap.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crtop() const
{ return const_reverse_iterator(this->top()); }
//! <b>Precondition</b>: end_iterator must be a valid end iterator
//! of treap.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the treap associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static treap_impl &container_from_end_iterator(iterator end_iterator)
{ return priv_container_from_end_iterator(end_iterator); }
//! <b>Precondition</b>: end_iterator must be a valid end const_iterator
//! of treap.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the treap associated to the iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static const treap_impl &container_from_end_iterator(const_iterator end_iterator)
{ return priv_container_from_end_iterator(end_iterator); }
//! <b>Precondition</b>: it must be a valid iterator
//! of treap.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the treap associated to the iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
static treap_impl &container_from_iterator(iterator it)
{ return priv_container_from_iterator(it); }
//! <b>Precondition</b>: it must be a valid end const_iterator
//! of treap.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the treap associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
static const treap_impl &container_from_iterator(const_iterator it)
{ return priv_container_from_iterator(it); }
//! <b>Effects</b>: Returns the value_compare object used by the treap.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If value_compare copy-constructor throws.
value_compare value_comp() const
{ return this->priv_comp(); }
//! <b>Effects</b>: Returns the priority_compare object used by the treap.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If priority_compare copy-constructor throws.
priority_compare priority_comp() const
{ return this->priv_pcomp(); }
//! <b>Effects</b>: Returns true if the container is empty.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
bool empty() const
{ return node_algorithms::unique(this->priv_header_ptr()); }
//! <b>Effects</b>: Returns the number of elements stored in the treap.
- //!
+ //!
//! <b>Complexity</b>: Linear to elements contained in *this
//! if constant-time size option is disabled. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
size_type size() const
{
@@ -535,9 +535,9 @@ class treap_impl
}
//! <b>Effects</b>: Swaps the contents of two treaps.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If the comparison functor's swap call throws.
void swap(treap_impl& other)
{
@@ -555,14 +555,14 @@ class treap_impl
}
//! <b>Requires</b>: value must be an lvalue
- //!
+ //!
//! <b>Effects</b>: Inserts value into the treap before the upper bound.
- //!
+ //!
//! <b>Complexity</b>: Average complexity for insert element is at
//! most logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare or priority_compare functions throw. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
iterator insert_equal(reference value)
@@ -582,16 +582,16 @@ class treap_impl
//! <b>Requires</b>: value must be an lvalue, and "hint" must be
//! a valid iterator.
- //!
+ //!
//! <b>Effects</b>: Inserts x into the treap, using "hint" as a hint to
//! where it will be inserted. If "hint" is the upper_bound
//! the insertion takes constant time (two comparisons in the worst case)
- //!
+ //!
//! <b>Complexity</b>: Logarithmic in general, but it is amortized
//! constant time if t is inserted immediately before hint.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare or priority_compare functions throw. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
iterator insert_equal(const_iterator hint, reference value)
@@ -609,19 +609,19 @@ class treap_impl
return ret;
}
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
//! of type value_type.
- //!
+ //!
//! <b>Effects</b>: Inserts a each element of a range into the treap
//! before the upper bound of the key of each element.
- //!
+ //!
//! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
//! size of the range. However, it is linear in N if the range is already sorted
//! by value_comp().
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare or priority_compare functions throw.
//! Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
template<class Iterator>
@@ -633,16 +633,16 @@ class treap_impl
}
//! <b>Requires</b>: value must be an lvalue
- //!
+ //!
//! <b>Effects</b>: Inserts value into the treap if the value
//! is not already present.
- //!
+ //!
//! <b>Complexity</b>: Average complexity for insert element is at
//! most logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare or priority_compare functions throw.
//! Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
std::pair<iterator, bool> insert_unique(reference value)
@@ -656,17 +656,17 @@ class treap_impl
//! <b>Requires</b>: value must be an lvalue, and "hint" must be
//! a valid iterator
- //!
+ //!
//! <b>Effects</b>: Tries to insert x into the treap, using "hint" as a hint
//! to where it will be inserted.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic in general, but it is amortized
//! constant time (two comparisons in the worst case)
//! if t is inserted immediately before hint.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare or priority_compare functions throw.
//! Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
iterator insert_unique(const_iterator hint, reference value)
@@ -678,18 +678,18 @@ class treap_impl
return insert_unique_commit(value, commit_data);
}
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
//! of type value_type.
- //!
+ //!
//! <b>Effects</b>: Tries to insert each element of a range into the treap.
- //!
- //! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
- //! size of the range. However, it is linear in N if the range is already sorted
+ //!
+ //! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
+ //! size of the range. However, it is linear in N if the range is already sorted
//! by value_comp().
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare or priority_compare functions throw.
//! Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
template<class Iterator>
@@ -706,12 +706,12 @@ class treap_impl
}
}
- //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
//! the same strict weak ordering as value_compare.
- //! key_value_pcomp must be a comparison function that induces
+ //! key_value_pcomp must be a comparison function that induces
//! the same strict weak ordering as priority_compare. The difference is that
//! key_value_pcomp and key_value_comp compare an arbitrary key with the contained values.
- //!
+ //!
//! <b>Effects</b>: Checks if a value can be inserted in the container, using
//! a user provided key instead of the value itself.
//!
@@ -720,17 +720,17 @@ class treap_impl
//! and false. If the value can be inserted returns true in the returned
//! pair boolean and fills "commit_data" that is meant to be used with
//! the "insert_commit" function.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is at most logarithmic.
//!
//! <b>Throws</b>: If the key_value_comp or key_value_pcomp
//! ordering functions throw. Strong guarantee.
- //!
+ //!
//! <b>Notes</b>: This function is used to improve performance when constructing
//! a value_type is expensive: if there is an equivalent value
//! the constructed object must be discarded. Many times, the part of the
//! node that is used to impose the order is much cheaper to construct
- //! than the value_type and this function offers the possibility to use that
+ //! than the value_type and this function offers the possibility to use that
//! part to check if the insertion will be successful.
//!
//! If the check is successful, the user can construct the value_type and use
@@ -748,20 +748,20 @@ class treap_impl
comp(key_value_comp, this);
detail::key_nodeptr_comp<KeyValuePrioCompare, treap_impl>
pcomp(key_value_pcomp, this);
- std::pair<node_ptr, bool> ret =
+ std::pair<node_ptr, bool> ret =
(node_algorithms::insert_unique_check
(this->priv_header_ptr(), key, comp, pcomp, commit_data));
return std::pair<iterator, bool>(iterator(ret.first, this), ret.second);
}
- //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
//! the same strict weak ordering as value_compare.
- //! key_value_pcomp must be a comparison function that induces
+ //! key_value_pcomp must be a comparison function that induces
//! the same strict weak ordering as priority_compare. The difference is that
//! key_value_pcomp and key_value_comp compare an arbitrary key with the contained values.
- //!
+ //!
//! <b>Effects</b>: Checks if a value can be inserted in the container, using
- //! a user provided key instead of the value itself, using "hint"
+ //! a user provided key instead of the value itself, using "hint"
//! as a hint to where it will be inserted.
//!
//! <b>Returns</b>: If there is an equivalent value
@@ -769,24 +769,24 @@ class treap_impl
//! and false. If the value can be inserted returns true in the returned
//! pair boolean and fills "commit_data" that is meant to be used with
//! the "insert_commit" function.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic in general, but it's amortized
//! constant time if t is inserted immediately before hint.
//!
//! <b>Throws</b>: If the key_value_comp or key_value_pcomp
//! ordering functions throw. Strong guarantee.
- //!
+ //!
//! <b>Notes</b>: This function is used to improve performance when constructing
//! a value_type is expensive: if there is an equivalent value
//! the constructed object must be discarded. Many times, the part of the
//! constructing that is used to impose the order is much cheaper to construct
- //! than the value_type and this function offers the possibility to use that key
+ //! than the value_type and this function offers the possibility to use that key
//! to check if the insertion will be successful.
//!
//! If the check is successful, the user can construct the value_type and use
//! "insert_commit" to insert the object in constant-time. This can give a total
//! constant-time complexity to the insertion: check(O(1)) + commit(O(1)).
- //!
+ //!
//! "commit_data" remains valid for a subsequent "insert_commit" only if no more
//! objects are inserted or erased from the container.
template<class KeyType, class KeyValueCompare, class KeyValuePrioCompare>
@@ -800,7 +800,7 @@ class treap_impl
comp(key_value_comp, this);
detail::key_nodeptr_comp<KeyValuePrioCompare, treap_impl>
pcomp(key_value_pcomp, this);
- std::pair<node_ptr, bool> ret =
+ std::pair<node_ptr, bool> ret =
(node_algorithms::insert_unique_check
(this->priv_header_ptr(), hint.pointed_node(), key, comp, pcomp, commit_data));
return std::pair<iterator, bool>(iterator(ret.first, this), ret.second);
@@ -810,16 +810,16 @@ class treap_impl
//! must have been obtained from a previous call to "insert_check".
//! No objects should have been inserted or erased from the container between
//! the "insert_check" that filled "commit_data" and the call to "insert_commit".
- //!
+ //!
//! <b>Effects</b>: Inserts the value in the avl_set using the information obtained
//! from the "commit_data" that a previous "insert_check" filled.
//!
//! <b>Returns</b>: An iterator to the newly inserted object.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
//!
//! <b>Throws</b>: Nothing
- //!
+ //!
//! <b>Notes</b>: This function has only sense if a "insert_check" has been
//! previously executed to fill "commit_data". No value should be inserted or
//! erased between the "insert_check" and "insert_commit" calls.
@@ -838,11 +838,11 @@ class treap_impl
//! once inserted according to the predicate
//!
//! <b>Effects</b>: Inserts x into the treap before "pos".
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: If the internal priority_compare function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if "pos" is not
//! the successor of "value" treap ordering invariant will be broken.
//! This is a low-level function to be used only for performance reasons
@@ -864,11 +864,11 @@ class treap_impl
//! than the greatest inserted key
//!
//! <b>Effects</b>: Inserts x into the treap in the last position.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: If the internal priority_compare function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if value is
//! less than the greatest inserted key treap ordering invariant will be broken.
//! This function is slightly more efficient than using "insert_before".
@@ -889,11 +889,11 @@ class treap_impl
//! than the minimum inserted key
//!
//! <b>Effects</b>: Inserts x into the treap in the first position.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: If the internal priority_compare function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if value is
//! greater than the minimum inserted key treap ordering invariant will be broken.
//! This function is slightly more efficient than using "insert_before".
@@ -910,12 +910,12 @@ class treap_impl
this->priv_size_traits().increment();
}
- //! <b>Effects</b>: Erases the element pointed to by pos.
- //!
- //! <b>Complexity</b>: Average complexity for erase element is constant time.
- //!
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
//! <b>Throws</b>: if the internal priority_compare function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
iterator erase(const_iterator i)
@@ -934,26 +934,26 @@ class treap_impl
return ret.unconst();
}
- //! <b>Effects</b>: Erases the range pointed to by b end e.
- //!
- //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
//! O(log(size() + N)), where N is the number of elements in the range.
- //!
+ //!
//! <b>Throws</b>: if the internal priority_compare function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
iterator erase(const_iterator b, const_iterator e)
{ size_type n; return private_erase(b, e, n); }
//! <b>Effects</b>: Erases all the elements with the given value.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + N).
- //!
+ //!
//! <b>Throws</b>: if the internal priority_compare function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
size_type erase(const_reference value)
@@ -963,12 +963,12 @@ class treap_impl
//! according to the comparison functor "comp".
//!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + N).
- //!
+ //!
//! <b>Throws</b>: if the internal priority_compare function throws.
//! Equivalent guarantee to <i>while(beg != end) erase(beg++);</i>
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class KeyType, class KeyValueCompare>
@@ -986,14 +986,14 @@ class treap_impl
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//!
- //! <b>Effects</b>: Erases the element pointed to by pos.
+ //! <b>Effects</b>: Erases the element pointed to by pos.
//! Disposer::operator()(pointer) is called for the removed element.
- //!
- //! <b>Complexity</b>: Average complexity for erase element is constant time.
- //!
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
//! <b>Throws</b>: if the internal priority_compare function throws. Strong guarantee.
- //!
- //! <b>Note</b>: Invalidates the iterators
+ //!
+ //! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
iterator erase_and_dispose(const_iterator i, Disposer disposer)
@@ -1014,12 +1014,12 @@ class treap_impl
//!
//! <b>Effects</b>: Erases the range pointed to by b end e.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
- //! <b>Complexity</b>: Average complexity for erase range is at most
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
//! O(log(size() + N)), where N is the number of elements in the range.
- //!
+ //!
//! <b>Throws</b>: if the internal priority_compare function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
@@ -1030,14 +1030,14 @@ class treap_impl
//!
//! <b>Effects</b>: Erases all the elements with the given value.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + N).
- //!
+ //!
//! <b>Throws</b>: if the priority_compare function throws then weak guarantee and heap invariants are broken.
//! The safest thing would be to clear or destroy the container.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class Disposer>
@@ -1056,12 +1056,12 @@ class treap_impl
//! Disposer::operator()(pointer) is called for the removed elements.
//!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + N).
- //!
+ //!
//! <b>Throws</b>: if the priority_compare function throws then weak guarantee and heap invariants are broken.
//! The safest thing would be to clear or destroy the container.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class KeyType, class KeyValueCompare, class Disposer>
@@ -1077,13 +1077,13 @@ class treap_impl
return n;
}
- //! <b>Effects</b>: Erases all of the elements.
- //!
+ //! <b>Effects</b>: Erases all of the elements.
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
void clear()
@@ -1101,9 +1101,9 @@ class treap_impl
//! each node to be erased.
//! <b>Complexity</b>: Average complexity for is at most O(log(size() + N)),
//! where N is the number of elements in the container.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. Calls N times to disposer functor.
template<class Disposer>
@@ -1116,19 +1116,19 @@ class treap_impl
}
//! <b>Effects</b>: Returns the number of contained elements with the given value
- //!
+ //!
//! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
//! to number of objects with the given value.
- //!
+ //!
//! <b>Throws</b>: Nothing.
size_type count(const_reference value) const
{ return this->count(value, priv_comp()); }
//! <b>Effects</b>: Returns the number of contained elements with the given key
- //!
+ //!
//! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
//! to number of objects with the given key.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
size_type count(const KeyType &key, KeyValueCompare comp) const
@@ -1139,27 +1139,27 @@ class treap_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator lower_bound(const_reference value)
{ return this->lower_bound(value, priv_comp()); }
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator lower_bound(const_reference value) const
{ return this->lower_bound(value, priv_comp()); }
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
iterator lower_bound(const KeyType &key, KeyValueCompare comp)
@@ -1172,9 +1172,9 @@ class treap_impl
//! <b>Effects</b>: Returns a const iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
const_iterator lower_bound(const KeyType &key, KeyValueCompare comp) const
@@ -1187,9 +1187,9 @@ class treap_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is greater than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator upper_bound(const_reference value)
{ return this->upper_bound(value, priv_comp()); }
@@ -1199,7 +1199,7 @@ class treap_impl
//! does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
iterator upper_bound(const KeyType &key, KeyValueCompare comp)
@@ -1212,9 +1212,9 @@ class treap_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is greater than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator upper_bound(const_reference value) const
{ return this->upper_bound(value, priv_comp()); }
@@ -1224,7 +1224,7 @@ class treap_impl
//! does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
const_iterator upper_bound(const KeyType &key, KeyValueCompare comp) const
@@ -1235,20 +1235,20 @@ class treap_impl
(this->priv_header_ptr(), key, key_node_comp), this);
}
- //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
//! k or end() if that element does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator find(const_reference value)
{ return this->find(value, priv_comp()); }
- //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
//! k or end() if that element does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
iterator find(const KeyType &key, KeyValueCompare comp)
@@ -1259,20 +1259,20 @@ class treap_impl
(node_algorithms::find(this->priv_header_ptr(), key, key_node_comp), this);
}
- //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
//! k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator find(const_reference value) const
{ return this->find(value, priv_comp()); }
- //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
//! k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
const_iterator find(const KeyType &key, KeyValueCompare comp) const
@@ -1286,9 +1286,9 @@ class treap_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
std::pair<iterator,iterator> equal_range(const_reference value)
{ return this->equal_range(value, priv_comp()); }
@@ -1296,9 +1296,9 @@ class treap_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
std::pair<iterator,iterator> equal_range(const KeyType &key, KeyValueCompare comp)
@@ -1313,9 +1313,9 @@ class treap_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
std::pair<const_iterator, const_iterator>
equal_range(const_reference value) const
@@ -1324,9 +1324,9 @@ class treap_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
template<class KeyType, class KeyValueCompare>
std::pair<const_iterator, const_iterator>
@@ -1339,19 +1339,117 @@ class treap_impl
return std::pair<const_iterator, const_iterator>(const_iterator(ret.first, this), const_iterator(ret.second, this));
}
+ //! <b>Requires</b>: 'lower_value' must not be greater than 'upper_value'. If
+ //! 'lower_value' == 'upper_value', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_value and upper_value.
+ std::pair<iterator,iterator> bounded_range
+ (const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed)
+ { return this->bounded_range(lower_value, upper_value, priv_comp(), left_closed, right_closed); }
+
+ //! <b>Requires</b>: KeyValueCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise
+ //!
+ //! second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator,iterator> bounded_range
+ (const KeyType &lower_key, const KeyType &upper_key, KeyValueCompare comp, bool left_closed, bool right_closed)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, treap_impl>
+ key_node_comp(comp, this);
+ std::pair<node_ptr, node_ptr> ret
+ (node_algorithms::bounded_range
+ (this->priv_header_ptr(), lower_key, upper_key, key_node_comp, left_closed, right_closed));
+ return std::pair<iterator, iterator>(iterator(ret.first, this), iterator(ret.second, this));
+ }
+
+ //! <b>Requires</b>: 'lower_value' must not be greater than 'upper_value'. If
+ //! 'lower_value' == 'upper_value', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_value and upper_value.
+ std::pair<const_iterator,const_iterator> bounded_range
+ (const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed) const
+ { return this->bounded_range(lower_value, upper_value, priv_comp(), left_closed, right_closed); }
+
+ //! <b>Requires</b>: KeyValueCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise
+ //!
+ //! second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<const_iterator,const_iterator> bounded_range
+ (const KeyType &lower_key, const KeyType &upper_key, KeyValueCompare comp, bool left_closed, bool right_closed) const
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, treap_impl>
+ key_node_comp(comp, this);
+ std::pair<node_ptr, node_ptr> ret
+ (node_algorithms::bounded_range
+ (this->priv_header_ptr(), lower_key, upper_key, key_node_comp, left_closed, right_closed));
+ return std::pair<const_iterator, const_iterator>(const_iterator(ret.first, this), const_iterator(ret.second, this));
+ }
+
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//! Cloner should yield to nodes equivalent to the original nodes.
//!
//! <b>Effects</b>: Erases all the elements from *this
- //! calling Disposer::operator()(pointer), clones all the
+ //! calling Disposer::operator()(pointer), clones all the
//! elements from src calling Cloner::operator()(const_reference )
//! and inserts them on *this. Copies the predicate from the source container.
//!
//! If cloner throws, all cloned elements are unlinked and disposed
//! calling Disposer::operator()(pointer).
- //!
+ //!
//! <b>Complexity</b>: Linear to erased plus inserted elements.
- //!
+ //!
//! <b>Throws</b>: If cloner throws or predicate copy assignment throws. Basic guarantee.
template <class Cloner, class Disposer>
void clone_from(const treap_impl &src, Cloner cloner, Disposer disposer)
@@ -1372,11 +1470,11 @@ class treap_impl
}
//! <b>Effects</b>: Unlinks the leftmost node from the treap.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function breaks the treap and the treap can
//! only be used for more unlink_leftmost_without_rebalance calls.
//! This function is normally used to achieve a step by step
@@ -1395,14 +1493,14 @@ class treap_impl
//! <b>Requires</b>: replace_this must be a valid iterator of *this
//! and with_this must not be inserted in any treap.
- //!
+ //!
//! <b>Effects</b>: Replaces replace_this in its position in the
//! treap with with_this. The treap does not need to be rebalanced.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! with_this is not equivalent to *replace_this according to the
//! ordering and priority rules. This function is faster than erasing and inserting
@@ -1418,14 +1516,14 @@ class treap_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator i belonging to the set
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
static iterator s_iterator_to(reference value)
@@ -1436,17 +1534,17 @@ class treap_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
//! set that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
- static const_iterator s_iterator_to(const_reference value)
+ static const_iterator s_iterator_to(const_reference value)
{
BOOST_STATIC_ASSERT((!stateful_value_traits));
return const_iterator (value_traits::to_node_ptr(const_cast<reference> (value)), 0);
@@ -1454,37 +1552,37 @@ class treap_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator i belonging to the set
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator iterator_to(reference value)
{ return iterator (value_traits::to_node_ptr(value), this); }
//! <b>Requires</b>: value must be an lvalue and shall be in a set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
//! set that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator iterator_to(const_reference value) const
{ return const_iterator (value_traits::to_node_ptr(const_cast<reference> (value)), this); }
//! <b>Requires</b>: value shall not be in a treap.
- //!
+ //!
//! <b>Effects</b>: init_node puts the hook of a value in a well-known default
//! state.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Note</b>: This function puts the hook in the well-known default state
//! used by auto_unlink and safe hooks.
static void init_node(reference value)
@@ -1658,7 +1756,7 @@ template<class T, class ...Options>
struct make_treap_opt
{
typedef typename pack_options
- < treap_set_defaults<T>,
+ < treap_set_defaults<T>,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -1690,7 +1788,7 @@ struct make_trie
{
/// @cond
typedef treap_impl
- < typename make_treap_opt<T,
+ < typename make_treap_opt<T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -1710,7 +1808,7 @@ template<class T, class O1, class O2, class O3, class O4>
template<class T, class ...Options>
#endif
class treap
- : public make_trie<T,
+ : public make_trie<T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -1719,7 +1817,7 @@ class treap
>::type
{
typedef typename make_trie
- <T,
+ <T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -1776,8 +1874,8 @@ class treap
#endif
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/treap_algorithms.hpp b/boost/intrusive/treap_algorithms.hpp
index 128e7ce227..967e7315cf 100644
--- a/boost/intrusive/treap_algorithms.hpp
+++ b/boost/intrusive/treap_algorithms.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2006-2009.
+// (C) Copyright Ion Gaztanaga 2006-2012.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -28,15 +28,15 @@
namespace boost {
namespace intrusive {
-//! treap_algorithms provides basic algorithms to manipulate
+//! treap_algorithms provides basic algorithms to manipulate
//! nodes forming a treap.
-//!
+//!
//! (1) the header node is maintained with links not only to the root
//! but also to the leftmost node of the tree, to enable constant time
//! begin(), and to the rightmost node of the tree, to enable linear time
//! performance when used with the generic set algorithms (set_union,
//! etc.);
-//!
+//!
//! (2) when a node being deleted has two children its successor node is
//! relinked into its place, rather than copied, so that the only
//! pointers invalidated are those referring to the deleted node.
@@ -56,15 +56,15 @@ namespace intrusive {
//! <b>Static functions</b>:
//!
//! <tt>static node_ptr get_parent(const_node_ptr n);</tt>
-//!
+//!
//! <tt>static void set_parent(node_ptr n, node_ptr parent);</tt>
//!
//! <tt>static node_ptr get_left(const_node_ptr n);</tt>
-//!
+//!
//! <tt>static void set_left(node_ptr n, node_ptr left);</tt>
//!
//! <tt>static node_ptr get_right(const_node_ptr n);</tt>
-//!
+//!
//! <tt>static void set_right(node_ptr n, node_ptr right);</tt>
template<class NodeTraits>
class treap_algorithms
@@ -92,7 +92,7 @@ class treap_algorithms
tree_algorithms::erase(header_, z_);
}
}
-
+
void release()
{ remove_it_ = false; }
@@ -117,7 +117,7 @@ class treap_algorithms
rotate_up_n(header_, p_, n_);
}
}
-
+
void release()
{ remove_it_ = false; }
@@ -170,27 +170,27 @@ class treap_algorithms
//! <b>Requires</b>: header1 and header2 must be the header nodes
//! of two trees.
- //!
- //! <b>Effects</b>: Swaps two trees. After the function header1 will contain
+ //!
+ //! <b>Effects</b>: Swaps two trees. After the function header1 will contain
//! links to the second tree and header2 will have links to the first tree.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
static void swap_tree(const node_ptr & header1, const node_ptr & header2)
{ return tree_algorithms::swap_tree(header1, header2); }
//! <b>Requires</b>: node1 and node2 can't be header nodes
//! of two trees.
- //!
+ //!
//! <b>Effects</b>: Swaps two nodes. After the function node1 will be inserted
//! in the position node2 before the function. node2 will be inserted in the
//! position node1 had before the function.
- //!
- //! <b>Complexity</b>: Logarithmic.
- //!
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! node1 and node2 are not equivalent according to the ordering rules.
//!
@@ -199,22 +199,22 @@ class treap_algorithms
{
if(node1 == node2)
return;
-
+
node_ptr header1(tree_algorithms::get_header(node1)), header2(tree_algorithms::get_header(node2));
swap_nodes(node1, header1, node2, header2);
}
//! <b>Requires</b>: node1 and node2 can't be header nodes
//! of two trees with header header1 and header2.
- //!
+ //!
//! <b>Effects</b>: Swaps two nodes. After the function node1 will be inserted
//! in the position node2 before the function. node2 will be inserted in the
//! position node1 had before the function.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! node1 and node2 are not equivalent according to the ordering rules.
//!
@@ -224,14 +224,14 @@ class treap_algorithms
//! <b>Requires</b>: node_to_be_replaced must be inserted in a tree
//! and new_node must not be inserted in a tree.
- //!
+ //!
//! <b>Effects</b>: Replaces node_to_be_replaced in its position in the
//! tree with new_node. The tree does not need to be rebalanced
- //!
- //! <b>Complexity</b>: Logarithmic.
- //!
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! new_node is not equivalent to node_to_be_replaced according to the
//! ordering rules. This function is faster than erasing and inserting
@@ -247,14 +247,14 @@ class treap_algorithms
//! <b>Requires</b>: node_to_be_replaced must be inserted in a tree
//! with header "header" and new_node must not be inserted in a tree.
- //!
+ //!
//! <b>Effects</b>: Replaces node_to_be_replaced in its position in the
//! tree with new_node. The tree does not need to be rebalanced
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! new_node is not equivalent to node_to_be_replaced according to the
//! ordering rules. This function is faster than erasing and inserting
@@ -265,11 +265,11 @@ class treap_algorithms
{ tree_algorithms::replace_node(node_to_be_replaced, header, new_node); }
//! <b>Requires</b>: node is a tree node but not the header.
- //!
+ //!
//! <b>Effects</b>: Unlinks the node and rebalances the tree.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //!
//! <b>Throws</b>: If "pcomp" throws, strong guarantee
template<class NodePtrPriorityCompare>
static void unlink(const node_ptr & node, NodePtrPriorityCompare pcomp)
@@ -283,14 +283,14 @@ class treap_algorithms
}
//! <b>Requires</b>: header is the header of a tree.
- //!
+ //!
//! <b>Effects</b>: Unlinks the leftmost node from the tree, and
//! updates the header link to the new leftmost node.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function breaks the tree and the tree can
//! only be used for more unlink_leftmost_without_rebalance calls.
//! This function is normally used to achieve a step by step
@@ -300,51 +300,51 @@ class treap_algorithms
//! <b>Requires</b>: node is a node of the tree or an node initialized
//! by init(...).
- //!
+ //!
//! <b>Effects</b>: Returns true if the node is initialized by init().
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static bool unique(const const_node_ptr & node)
{ return tree_algorithms::unique(node); }
//! <b>Requires</b>: node is a node of the tree but it's not the header.
- //!
+ //!
//! <b>Effects</b>: Returns the number of nodes of the subtree.
- //!
+ //!
//! <b>Complexity</b>: Linear time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static std::size_t count(const const_node_ptr & node)
{ return tree_algorithms::count(node); }
//! <b>Requires</b>: header is the header node of the tree.
- //!
+ //!
//! <b>Effects</b>: Returns the number of nodes above the header.
- //!
+ //!
//! <b>Complexity</b>: Linear time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static std::size_t size(const const_node_ptr & header)
{ return tree_algorithms::size(header); }
//! <b>Requires</b>: p is a node from the tree except the header.
- //!
+ //!
//! <b>Effects</b>: Returns the next node of the tree.
- //!
+ //!
//! <b>Complexity</b>: Average constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static node_ptr next_node(const node_ptr & p)
{ return tree_algorithms::next_node(p); }
//! <b>Requires</b>: p is a node from the tree except the leftmost node.
- //!
+ //!
//! <b>Effects</b>: Returns the previous node of the tree.
- //!
+ //!
//! <b>Complexity</b>: Average constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static node_ptr prev_node(const node_ptr & p)
{ return tree_algorithms::prev_node(p); }
@@ -352,9 +352,9 @@ class treap_algorithms
//! <b>Requires</b>: node must not be part of any tree.
//!
//! <b>Effects</b>: After the function unique(node) == true.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
//!
//! <b>Nodes</b>: If node is inserted in a tree, this function corrupts the tree.
@@ -365,9 +365,9 @@ class treap_algorithms
//!
//! <b>Effects</b>: Initializes the header to represent an empty tree.
//! unique(header) == true.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
//!
//! <b>Nodes</b>: If node is inserted in a tree, this function corrupts the tree.
@@ -380,9 +380,9 @@ class treap_algorithms
//! of that tree and z != header.
//!
//! <b>Effects</b>: Erases node "z" from the tree with header "header".
- //!
+ //!
//! <b>Complexity</b>: Amortized constant time.
- //!
+ //!
//! <b>Throws</b>: If "pcomp" throws, strong guarantee.
template<class NodePtrPriorityCompare>
static node_ptr erase(const node_ptr & header, const node_ptr & z, NodePtrPriorityCompare pcomp)
@@ -397,18 +397,18 @@ class treap_algorithms
//! object taking a node_ptr and returning a new cloned node of it. "disposer" must
//! take a node_ptr and shouldn't throw.
//!
- //! <b>Effects</b>: First empties target tree calling
+ //! <b>Effects</b>: First empties target tree calling
//! <tt>void disposer::operator()(const node_ptr &)</tt> for every node of the tree
//! except the header.
- //!
+ //!
//! Then, duplicates the entire tree pointed by "source_header" cloning each
- //! source node with <tt>node_ptr Cloner::operator()(const node_ptr &)</tt> to obtain
+ //! source node with <tt>node_ptr Cloner::operator()(const node_ptr &)</tt> to obtain
//! the nodes of the target tree. If "cloner" throws, the cloned target nodes
//! are disposed using <tt>void disposer(const node_ptr &)</tt>.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of element of the source tree plus the.
//! number of elements of tree target tree when calling this function.
- //!
+ //!
//! <b>Throws</b>: If cloner functor throws. If this happens target nodes are disposed.
template <class Cloner, class Disposer>
static void clone
@@ -420,13 +420,13 @@ class treap_algorithms
//! <b>Requires</b>: "disposer" must be an object function
//! taking a node_ptr parameter and shouldn't throw.
//!
- //! <b>Effects</b>: Empties the target tree calling
+ //! <b>Effects</b>: Empties the target tree calling
//! <tt>void disposer::operator()(const node_ptr &)</tt> for every node of the tree
//! except the header.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of element of the source tree plus the.
//! number of elements of tree target tree when calling this function.
- //!
+ //!
//! <b>Throws</b>: If cloner functor throws. If this happens target nodes are disposed.
template<class Disposer>
static void clear_and_dispose(const node_ptr & header, Disposer disposer)
@@ -442,7 +442,7 @@ class treap_algorithms
//! not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class KeyType, class KeyNodePtrCompare>
static node_ptr lower_bound
@@ -458,7 +458,7 @@ class treap_algorithms
//! than "key" according to "comp" or "header" if that element does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class KeyType, class KeyNodePtrCompare>
static node_ptr upper_bound
@@ -474,7 +474,7 @@ class treap_algorithms
//! "key" according to "comp" or "header" if that element does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class KeyType, class KeyNodePtrCompare>
static node_ptr find
@@ -492,13 +492,38 @@ class treap_algorithms
//! if they there are no equivalent elements.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class KeyType, class KeyNodePtrCompare>
static std::pair<node_ptr, node_ptr> equal_range
(const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp)
{ return tree_algorithms::equal_range(header, key, comp); }
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyNodePtrCompare>
+ static std::pair<node_ptr, node_ptr> bounded_range
+ (const const_node_ptr & header, const KeyType &lower_key, const KeyType &upper_key, KeyNodePtrCompare comp
+ , bool left_closed, bool right_closed)
+ { return tree_algorithms::bounded_range(header, lower_key, upper_key, comp, left_closed, right_closed); }
+
//! <b>Requires</b>: "h" must be the header node of a tree.
//! NodePtrCompare is a function object that induces a strict weak
//! ordering compatible with the strict weak ordering used to create the
@@ -509,10 +534,10 @@ class treap_algorithms
//!
//! <b>Effects</b>: Inserts new_node into the tree before the upper bound
//! according to "comp" and rotates the tree according to "pcomp".
- //!
+ //!
//! <b>Complexity</b>: Average complexity for insert element is at
//! most logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throw or "pcomp" throw.
template<class NodePtrCompare, class NodePtrPriorityCompare>
static node_ptr insert_equal_upper_bound
@@ -534,10 +559,10 @@ class treap_algorithms
//!
//! <b>Effects</b>: Inserts new_node into the tree before the upper bound
//! according to "comp" and rotates the tree according to "pcomp".
- //!
+ //!
//! <b>Complexity</b>: Average complexity for insert element is at
//! most logarithmic.
- //!
+ //!
//! <b>Throws</b>: If "comp" throws.
template<class NodePtrCompare, class NodePtrPriorityCompare>
static node_ptr insert_equal_lower_bound
@@ -557,7 +582,7 @@ class treap_algorithms
//! NodePtrPriorityCompare is a priority function object that induces a strict weak
//! ordering compatible with the one used to create the
//! the tree. NodePtrPriorityCompare compares two node_ptrs.
- //!
+ //!
//! <b>Effects</b>: Inserts new_node into the tree, using "hint" as a hint to
//! where it will be inserted. If "hint" is the upper_bound
//! the insertion takes constant time (two comparisons in the worst case).
@@ -565,7 +590,7 @@ class treap_algorithms
//!
//! <b>Complexity</b>: Logarithmic in general, but it is amortized
//! constant time if new_node is inserted immediately before "hint".
- //!
+ //!
//! <b>Throws</b>: If "comp" throw or "pcomp" throw.
template<class NodePtrCompare, class NodePtrPriorityCompare>
static node_ptr insert_equal
@@ -585,14 +610,14 @@ class treap_algorithms
//! NodePtrPriorityCompare is a priority function object that induces a strict weak
//! ordering compatible with the one used to create the
//! the tree. NodePtrPriorityCompare compares two node_ptrs.
- //!
+ //!
//! <b>Effects</b>: Inserts new_node into the tree before "pos"
//! and rotates the tree according to "pcomp".
//!
//! <b>Complexity</b>: Constant-time.
- //!
+ //!
//! <b>Throws</b>: If "pcomp" throws, strong guarantee.
- //!
+ //!
//! <b>Note</b>: If "pos" is not the successor of the newly inserted "new_node"
//! tree invariants might be broken.
template<class NodePtrPriorityCompare>
@@ -611,14 +636,14 @@ class treap_algorithms
//! NodePtrPriorityCompare is a priority function object that induces a strict weak
//! ordering compatible with the one used to create the
//! the tree. NodePtrPriorityCompare compares two node_ptrs.
- //!
+ //!
//! <b>Effects</b>: Inserts x into the tree in the last position
//! and rotates the tree according to "pcomp".
//!
//! <b>Complexity</b>: Constant-time.
- //!
+ //!
//! <b>Throws</b>: If "pcomp" throws, strong guarantee.
- //!
+ //!
//! <b>Note</b>: If "new_node" is less than the greatest inserted key
//! tree invariants are broken. This function is slightly faster than
//! using "insert_before".
@@ -636,14 +661,14 @@ class treap_algorithms
//! NodePtrPriorityCompare is a priority function object that induces a strict weak
//! ordering compatible with the one used to create the
//! the tree. NodePtrPriorityCompare compares two node_ptrs.
- //!
+ //!
//! <b>Effects</b>: Inserts x into the tree in the first position
//! and rotates the tree according to "pcomp".
//!
//! <b>Complexity</b>: Constant-time.
- //!
+ //!
//! <b>Throws</b>: If "pcomp" throws, strong guarantee.
- //!
+ //!
//! <b>Note</b>: If "new_node" is greater than the lowest inserted key
//! tree invariants are broken. This function is slightly faster than
//! using "insert_before".
@@ -659,7 +684,7 @@ class treap_algorithms
//! KeyNodePtrCompare is a function object that induces a strict weak
//! ordering compatible with the strict weak ordering used to create the
//! the tree. NodePtrCompare compares KeyType with a node_ptr.
- //!
+ //!
//! <b>Effects</b>: Checks if there is an equivalent node to "key" in the
//! tree according to "comp" and obtains the needed information to realize
//! a constant-time node insertion if there is no equivalent node.
@@ -670,11 +695,11 @@ class treap_algorithms
//! in the returned pair's boolean and fills "commit_data" that is meant to
//! be used with the "insert_commit" function to achieve a constant-time
//! insertion function.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is at most logarithmic.
//!
//! <b>Throws</b>: If "comp" throws.
- //!
+ //!
//! <b>Notes</b>: This function is used to improve performance when constructing
//! a node is expensive and the user does not want to have two equivalent nodes
//! in the tree: if there is an equivalent value
@@ -707,12 +732,12 @@ class treap_algorithms
//! ordering compatible with the strict weak ordering used to create the
//! the tree. NodePtrCompare compares KeyType with a node_ptr.
//! "hint" is node from the "header"'s tree.
- //!
+ //!
//! <b>Effects</b>: Checks if there is an equivalent node to "key" in the
//! tree according to "comp" using "hint" as a hint to where it should be
//! inserted and obtains the needed information to realize
- //! a constant-time node insertion if there is no equivalent node.
- //! If "hint" is the upper_bound the function has constant time
+ //! a constant-time node insertion if there is no equivalent node.
+ //! If "hint" is the upper_bound the function has constant time
//! complexity (two comparisons in the worst case).
//!
//! <b>Returns</b>: If there is an equivalent value
@@ -721,12 +746,12 @@ class treap_algorithms
//! in the returned pair's boolean and fills "commit_data" that is meant to
//! be used with the "insert_commit" function to achieve a constant-time
//! insertion function.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is at most logarithmic, but it is
//! amortized constant time if new_node should be inserted immediately before "hint".
//!
//! <b>Throws</b>: If "comp" throws.
- //!
+ //!
//! <b>Notes</b>: This function is used to improve performance when constructing
//! a node is expensive and the user does not want to have two equivalent nodes
//! in the tree: if there is an equivalent value
@@ -757,16 +782,16 @@ class treap_algorithms
//! "commit_data" must have been obtained from a previous call to
//! "insert_unique_check". No objects should have been inserted or erased
//! from the set between the "insert_unique_check" that filled "commit_data"
- //! and the call to "insert_commit".
- //!
- //!
+ //! and the call to "insert_commit".
+ //!
+ //!
//! <b>Effects</b>: Inserts new_node in the set using the information obtained
//! from the "commit_data" that a previous "insert_check" filled.
//!
//! <b>Complexity</b>: Constant time.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function has only sense if a "insert_unique_check" has been
//! previously executed to fill "commit_data". No value should be inserted or
//! erased between the "insert_check" and "insert_commit" calls.
@@ -782,7 +807,7 @@ class treap_algorithms
//! <b>Effects</b>: Returns a pointer to the header node of the tree.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static node_ptr get_header(const node_ptr & n)
{ return tree_algorithms::get_header(n); }
@@ -791,11 +816,11 @@ class treap_algorithms
private:
//! <b>Requires</b>: p is a node of a tree.
- //!
+ //!
//! <b>Effects</b>: Returns true if p is the header of the tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static bool is_header(const const_node_ptr & p)
{
@@ -887,8 +912,8 @@ class treap_algorithms
/// @endcond
};
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/treap_set.hpp b/boost/intrusive/treap_set.hpp
index 01dfcd8b30..66adfaf207 100644
--- a/boost/intrusive/treap_set.hpp
+++ b/boost/intrusive/treap_set.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2007-2009
+// (C) Copyright Ion Gaztanaga 2007-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -22,9 +22,9 @@
namespace boost {
namespace intrusive {
-//! The class template treap_set is an intrusive container, that mimics most of
+//! The class template treap_set is an intrusive container, that mimics most of
//! the interface of std::set as described in the C++ standard.
-//!
+//!
//! The template parameter \c T is the type to be managed by the container.
//! The user can specify additional options and if no options are provided
//! default options are used.
@@ -80,31 +80,31 @@ class treap_set_impl
/// @endcond
public:
- //! <b>Effects</b>: Constructs an empty treap_set.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //! <b>Effects</b>: Constructs an empty treap_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
- //! or the copy constructor of the value_compare object throws.
+ //! or the copy constructor of the value_compare object throws.
treap_set_impl( const value_compare &cmp = value_compare()
, const priority_compare &pcmp = priority_compare()
- , const value_traits &v_traits = value_traits())
+ , const value_traits &v_traits = value_traits())
: tree_(cmp, pcmp, v_traits)
{}
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
//! cmp must be a comparison function that induces a strict weak ordering.
- //!
- //! <b>Effects</b>: Constructs an empty treap_set and inserts elements from
+ //!
+ //! <b>Effects</b>: Constructs an empty treap_set and inserts elements from
//! [b, e).
- //!
- //! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
+ //!
+ //! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
//! comp and otherwise N * log N, where N is std::distance(last, first).
- //!
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
- //! or the copy constructor/operator() of the value_compare object throws.
+ //! or the copy constructor/operator() of the value_compare object throws.
template<class Iterator>
treap_set_impl( Iterator b, Iterator e
, const value_compare &cmp = value_compare()
@@ -114,186 +114,186 @@ class treap_set_impl
{}
//! <b>Effects</b>: to-do
- //!
- treap_set_impl(BOOST_RV_REF(treap_set_impl) x)
+ //!
+ treap_set_impl(BOOST_RV_REF(treap_set_impl) x)
: tree_(::boost::move(x.tree_))
{}
//! <b>Effects</b>: to-do
- //!
- treap_set_impl& operator=(BOOST_RV_REF(treap_set_impl) x)
+ //!
+ treap_set_impl& operator=(BOOST_RV_REF(treap_set_impl) x)
{ tree_ = ::boost::move(x.tree_); return *this; }
- //! <b>Effects</b>: Detaches all elements from this. The objects in the treap_set
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the treap_set
//! are not deleted (i.e. no destructors are called).
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- ~treap_set_impl()
+ ~treap_set_impl()
{}
//! <b>Effects</b>: Returns an iterator pointing to the beginning of the treap_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator begin()
{ return tree_.begin(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the treap_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator begin() const
{ return tree_.begin(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the treap_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cbegin() const
{ return tree_.cbegin(); }
//! <b>Effects</b>: Returns an iterator pointing to the end of the treap_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator end()
{ return tree_.end(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the treap_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator end() const
{ return tree_.end(); }
//! <b>Effects</b>: Returns an iterator pointing to the highest priority object of the tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator top()
{ return tree_.top(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the highest priority object of the tree..
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator top() const
{ return this->ctop(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the highest priority object of the tree..
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator ctop() const
{ return tree_.ctop(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the treap_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cend() const
{ return tree_.cend(); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning of the
//! reversed treap_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rbegin()
{ return tree_.rbegin(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed treap_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rbegin() const
{ return tree_.rbegin(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed treap_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crbegin() const
{ return tree_.crbegin(); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the end
//! of the reversed treap_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rend()
{ return tree_.rend(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed treap_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rend() const
{ return tree_.rend(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed treap_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crend() const
{ return tree_.crend(); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the highest priority object of the
//! reversed tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rtop()
{ return tree_.rtop(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the highest priority objec
//! of the reversed tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rtop() const
{ return tree_.crtop(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the highest priority object
//! of the reversed tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crtop() const
{ return tree_.crtop(); }
//! <b>Precondition</b>: end_iterator must be a valid end iterator
//! of treap_set.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the treap_set associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static treap_set_impl &container_from_end_iterator(iterator end_iterator)
{
@@ -304,11 +304,11 @@ class treap_set_impl
//! <b>Precondition</b>: end_iterator must be a valid end const_iterator
//! of treap_set.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the treap_set associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static const treap_set_impl &container_from_end_iterator(const_iterator end_iterator)
{
@@ -318,11 +318,11 @@ class treap_set_impl
}
//! <b>Precondition</b>: it must be a valid iterator of set.
- //!
+ //!
//! <b>Effects</b>: Returns a reference to the set associated to the iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
static treap_set_impl &container_from_iterator(iterator it)
{
@@ -332,11 +332,11 @@ class treap_set_impl
}
//! <b>Precondition</b>: it must be a valid const_iterator of set.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the set associated to the iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
static const treap_set_impl &container_from_iterator(const_iterator it)
{
@@ -346,50 +346,50 @@ class treap_set_impl
}
//! <b>Effects</b>: Returns the key_compare object used by the treap_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If key_compare copy-constructor throws.
key_compare key_comp() const
{ return tree_.value_comp(); }
//! <b>Effects</b>: Returns the value_compare object used by the treap_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If value_compare copy-constructor throws.
value_compare value_comp() const
{ return tree_.value_comp(); }
//! <b>Effects</b>: Returns the priority_compare object used by the treap_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If priority_compare copy-constructor throws.
priority_compare priority_comp() const
{ return tree_.priority_comp(); }
//! <b>Effects</b>: Returns true if the container is empty.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
bool empty() const
{ return tree_.empty(); }
//! <b>Effects</b>: Returns the number of elements stored in the treap_set.
- //!
+ //!
//! <b>Complexity</b>: Linear to elements contained in *this if,
//! constant-time size option is enabled. Constant-time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
size_type size() const
{ return tree_.size(); }
//! <b>Effects</b>: Swaps the contents of two sets.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If the swap() call for the comparison functor
//! found using ADL throws. Strong guarantee.
void swap(treap_set_impl& other)
@@ -399,22 +399,22 @@ class treap_set_impl
//! Cloner should yield to nodes equivalent to the original nodes.
//!
//! <b>Effects</b>: Erases all the elements from *this
- //! calling Disposer::operator()(pointer), clones all the
+ //! calling Disposer::operator()(pointer), clones all the
//! elements from src calling Cloner::operator()(const_reference )
//! and inserts them on *this. Copies the predicate from the source container.
//!
//! If cloner throws, all cloned elements are unlinked and disposed
//! calling Disposer::operator()(pointer).
- //!
+ //!
//! <b>Complexity</b>: Linear to erased plus inserted elements.
- //!
+ //!
//! <b>Throws</b>: If cloner throws or predicate copy assignment throws. Basic guarantee.
template <class Cloner, class Disposer>
void clone_from(const treap_set_impl &src, Cloner cloner, Disposer disposer)
{ tree_.clone_from(src.tree_, cloner, disposer); }
//! <b>Requires</b>: value must be an lvalue
- //!
+ //!
//! <b>Effects</b>: Tries to inserts value into the treap_set.
//!
//! <b>Returns</b>: If the value
@@ -422,43 +422,43 @@ class treap_set_impl
//! iterator to the new value and true. If there is an equivalent value
//! returns a pair containing an iterator to the already present value
//! and false.
- //!
+ //!
//! <b>Complexity</b>: Average complexity for insert element is at
//! most logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare or priority_compare ordering function throw.
//! Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
std::pair<iterator, bool> insert(reference value)
{ return tree_.insert_unique(value); }
//! <b>Requires</b>: value must be an lvalue
- //!
- //! <b>Effects</b>: Tries to to insert x into the treap_set, using "hint"
+ //!
+ //! <b>Effects</b>: Tries to to insert x into the treap_set, using "hint"
//! as a hint to where it will be inserted.
//!
- //! <b>Returns</b>: An iterator that points to the position where the
+ //! <b>Returns</b>: An iterator that points to the position where the
//! new element was inserted into the treap_set.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic in general, but it's amortized
//! constant time if t is inserted immediately before hint.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare or priority_compare ordering
//! functions throw. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
iterator insert(const_iterator hint, reference value)
{ return tree_.insert_unique(hint, value); }
- //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
//! the same strict weak ordering as value_compare.
- //! key_value_pcomp must be a comparison function that induces
+ //! key_value_pcomp must be a comparison function that induces
//! the same strict weak ordering as priority_compare. The difference is that
//! key_value_pcomp and key_value_comp compare an arbitrary key with the contained values.
- //!
+ //!
//! <b>Effects</b>: Checks if a value can be inserted in the treap_set, using
//! a user provided key instead of the value itself.
//!
@@ -467,17 +467,17 @@ class treap_set_impl
//! and false. If the value can be inserted returns true in the returned
//! pair boolean and fills "commit_data" that is meant to be used with
//! the "insert_commit" function.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is at most logarithmic.
//!
//! <b>Throws</b>: If key_value_comp or key_value_pcomp ordering function throw.
//! Strong guarantee.
- //!
+ //!
//! <b>Notes</b>: This function is used to improve performance when constructing
//! a value_type is expensive: if there is an equivalent value
//! the constructed object must be discarded. Many times, the part of the
//! node that is used to impose the order is much cheaper to construct
- //! than the value_type and this function offers the possibility to use that
+ //! than the value_type and this function offers the possibility to use that
//! part to check if the insertion will be successful.
//!
//! If the check is successful, the user can construct the value_type and use
@@ -492,14 +492,14 @@ class treap_set_impl
, insert_commit_data &commit_data)
{ return tree_.insert_unique_check(key, key_value_comp, key_value_pcomp, commit_data); }
- //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
//! the same strict weak ordering as value_compare.
- //! key_value_pcomp must be a comparison function that induces
+ //! key_value_pcomp must be a comparison function that induces
//! the same strict weak ordering as priority_compare. The difference is that
//! key_value_pcomp and key_value_comp compare an arbitrary key with the contained values.
- //!
+ //!
//! <b>Effects</b>: Checks if a value can be inserted in the treap_set, using
- //! a user provided key instead of the value itself, using "hint"
+ //! a user provided key instead of the value itself, using "hint"
//! as a hint to where it will be inserted.
//!
//! <b>Returns</b>: If there is an equivalent value
@@ -507,24 +507,24 @@ class treap_set_impl
//! and false. If the value can be inserted returns true in the returned
//! pair boolean and fills "commit_data" that is meant to be used with
//! the "insert_commit" function.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic in general, but it's amortized
//! constant time if t is inserted immediately before hint.
//!
//! <b>Throws</b>: If key_value_comp or key_value_pcomp ordering function throw.
//! Strong guarantee.
- //!
+ //!
//! <b>Notes</b>: This function is used to improve performance when constructing
//! a value_type is expensive: if there is an equivalent value
//! the constructed object must be discarded. Many times, the part of the
//! constructing that is used to impose the order is much cheaper to construct
- //! than the value_type and this function offers the possibility to use that key
+ //! than the value_type and this function offers the possibility to use that key
//! to check if the insertion will be successful.
//!
//! If the check is successful, the user can construct the value_type and use
//! "insert_commit" to insert the object in constant-time. This can give a total
//! constant-time complexity to the insertion: check(O(1)) + commit(O(1)).
- //!
+ //!
//! "commit_data" remains valid for a subsequent "insert_commit" only if no more
//! objects are inserted or erased from the treap_set.
template<class KeyType, class KeyValueCompare, class KeyValuePriorityCompare>
@@ -538,34 +538,34 @@ class treap_set_impl
//! must have been obtained from a previous call to "insert_check".
//! No objects should have been inserted or erased from the treap_set between
//! the "insert_check" that filled "commit_data" and the call to "insert_commit".
- //!
+ //!
//! <b>Effects</b>: Inserts the value in the treap_set using the information obtained
//! from the "commit_data" that a previous "insert_check" filled.
//!
//! <b>Returns</b>: An iterator to the newly inserted object.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function has only sense if a "insert_check" has been
//! previously executed to fill "commit_data". No value should be inserted or
//! erased between the "insert_check" and "insert_commit" calls.
iterator insert_commit(reference value, const insert_commit_data &commit_data)
{ return tree_.insert_unique_commit(value, commit_data); }
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
//! of type value_type.
- //!
+ //!
//! <b>Effects</b>: Inserts a range into the treap_set.
- //!
+ //!
//! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
//! size of the range. However, it is linear in N if the range is already sorted
//! by value_comp().
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare or priority_compare ordering function
//! throw. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
template<class Iterator>
@@ -578,11 +578,11 @@ class treap_set_impl
//! inserted key according to the predicate.
//!
//! <b>Effects</b>: Inserts x into the treap before "pos".
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: If the internal priority_compare function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if "pos" is not
//! the successor of "value" treap ordering invariant will be broken.
//! This is a low-level function to be used only for performance reasons
@@ -594,11 +594,11 @@ class treap_set_impl
//! any inserted key according to the predicate.
//!
//! <b>Effects</b>: Inserts x into the treap in the last position.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: If the internal priority_compare function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if value is
//! less than the greatest inserted key treap ordering invariant will be broken.
//! This function is slightly more efficient than using "insert_before".
@@ -611,11 +611,11 @@ class treap_set_impl
//! than any inserted key according to the predicate.
//!
//! <b>Effects</b>: Inserts x into the treap in the first position.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: If the internal priority_compare function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if value is
//! greater than the minimum inserted key treap ordering invariant will be broken.
//! This function is slightly more efficient than using "insert_before".
@@ -624,42 +624,42 @@ class treap_set_impl
void push_front(reference value)
{ tree_.push_front(value); }
- //! <b>Effects</b>: Erases the element pointed to by pos.
- //!
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //!
//! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //!
//! <b>Returns</b>: An iterator to the element after the erased element.
//!
//! <b>Throws</b>: If the internal priority_compare function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
iterator erase(const_iterator i)
{ return tree_.erase(i); }
- //! <b>Effects</b>: Erases the range pointed to by b end e.
- //!
- //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
//! O(log(size() + N)), where N is the number of elements in the range.
- //!
+ //!
//! <b>Returns</b>: An iterator to the element after the erased elements.
- //!
+ //!
//! <b>Throws</b>: If the internal priority_compare function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
iterator erase(const_iterator b, const_iterator e)
{ return tree_.erase(b, e); }
//! <b>Effects</b>: Erases all the elements with the given value.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size()) + this->count(value)).
- //!
+ //!
//! <b>Throws</b>: If internal value_compare or priority_compare
//! ordering functions throw. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
size_type erase(const_reference value)
@@ -667,14 +667,14 @@ class treap_set_impl
//! <b>Effects</b>: Erases all the elements that compare equal with
//! the given key and the given comparison functor.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + this->count(key, comp)).
- //!
+ //!
//! <b>Throws</b>: If comp or internal priority_compare
//! ordering functions throw. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class KeyType, class KeyValueCompare>
@@ -687,16 +687,16 @@ class treap_set_impl
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//!
- //! <b>Effects</b>: Erases the element pointed to by pos.
+ //! <b>Effects</b>: Erases the element pointed to by pos.
//! Disposer::operator()(pointer) is called for the removed element.
- //!
- //! <b>Complexity</b>: Average complexity for erase element is constant time.
- //!
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
//! <b>Returns</b>: An iterator to the element after the erased element.
- //!
+ //!
//! <b>Throws</b>: If the internal priority_compare function throws. Strong guarantee.
- //!
- //! <b>Note</b>: Invalidates the iterators
+ //!
+ //! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
iterator erase_and_dispose(const_iterator i, Disposer disposer)
@@ -712,14 +712,14 @@ class treap_set_impl
//!
//! <b>Effects</b>: Erases the range pointed to by b end e.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
- //! <b>Complexity</b>: Average complexity for erase range is at most
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
//! O(log(size() + N)), where N is the number of elements in the range.
- //!
+ //!
//! <b>Returns</b>: An iterator to the element after the erased elements.
- //!
+ //!
//! <b>Throws</b>: If the internal priority_compare function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
@@ -730,13 +730,13 @@ class treap_set_impl
//!
//! <b>Effects</b>: Erases all the elements with the given value.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + this->count(value)). Basic guarantee.
- //!
+ //!
//! <b>Throws</b>: If the internal priority_compare function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class Disposer>
@@ -750,12 +750,12 @@ class treap_set_impl
//! Disposer::operator()(pointer) is called for the removed elements.
//!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + this->count(key, comp)).
- //!
+ //!
//! <b>Throws</b>: If comp or internal priority_compare ordering functions throw.
//! Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class KeyType, class KeyValueCompare, class Disposer>
@@ -767,26 +767,26 @@ class treap_set_impl
{ return tree_.erase_and_dispose(key, comp, disposer); }
//! <b>Effects</b>: Erases all the elements of the container.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
void clear()
{ return tree_.clear(); }
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
- //!
+ //!
//! <b>Effects</b>: Erases all the elements of the container.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class Disposer>
@@ -794,20 +794,20 @@ class treap_set_impl
{ return tree_.clear_and_dispose(disposer); }
//! <b>Effects</b>: Returns the number of contained elements with the given key
- //!
+ //!
//! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
//! to number of objects with the given key.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
size_type count(const_reference value) const
{ return tree_.find(value) != end(); }
//! <b>Effects</b>: Returns the number of contained elements with the same key
//! compared with the given comparison functor.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
//! to number of objects with the given key.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
template<class KeyType, class KeyValueCompare>
size_type count(const KeyType& key, KeyValueCompare comp) const
@@ -815,9 +815,9 @@ class treap_set_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
iterator lower_bound(const_reference value)
{ return tree_.lower_bound(value); }
@@ -827,13 +827,13 @@ class treap_set_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns an iterator to the first element whose
- //! key according to the comparison functor is not less than k or
+ //! key according to the comparison functor is not less than k or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
- //!
+ //!
//! <b>Note</b>: This function is used when constructing a value_type
//! is expensive and the value_type can be compared with a cheaper
//! key type. Usually this key is part of the value_type.
@@ -843,9 +843,9 @@ class treap_set_impl
//! <b>Effects</b>: Returns a const iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
const_iterator lower_bound(const_reference value) const
{ return tree_.lower_bound(value); }
@@ -855,13 +855,13 @@ class treap_set_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns a const_iterator to the first element whose
- //! key according to the comparison functor is not less than k or
+ //! key according to the comparison functor is not less than k or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
- //!
+ //!
//! <b>Note</b>: This function is used when constructing a value_type
//! is expensive and the value_type can be compared with a cheaper
//! key type. Usually this key is part of the value_type.
@@ -871,9 +871,9 @@ class treap_set_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is greater than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
iterator upper_bound(const_reference value)
{ return tree_.upper_bound(value); }
@@ -883,11 +883,11 @@ class treap_set_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns an iterator to the first element whose
- //! key according to the comparison functor is greater than key or
+ //! key according to the comparison functor is greater than key or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -899,9 +899,9 @@ class treap_set_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is greater than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
const_iterator upper_bound(const_reference value) const
{ return tree_.upper_bound(value); }
@@ -911,11 +911,11 @@ class treap_set_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns a const_iterator to the first element whose
- //! key according to the comparison functor is greater than key or
+ //! key according to the comparison functor is greater than key or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -925,11 +925,11 @@ class treap_set_impl
const_iterator upper_bound(const KeyType& key, KeyValueCompare comp) const
{ return tree_.upper_bound(key, comp); }
- //! <b>Effects</b>: Finds an iterator to the first element whose value is
+ //! <b>Effects</b>: Finds an iterator to the first element whose value is
//! "value" or end() if that element does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
iterator find(const_reference value)
{ return tree_.find(value); }
@@ -938,12 +938,12 @@ class treap_set_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds an iterator to the first element whose key is
- //! "key" according to the comparison functor or end() if that element
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
//! does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -953,11 +953,11 @@ class treap_set_impl
iterator find(const KeyType& key, KeyValueCompare comp)
{ return tree_.find(key, comp); }
- //! <b>Effects</b>: Finds a const_iterator to the first element whose value is
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose value is
//! "value" or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
const_iterator find(const_reference value) const
{ return tree_.find(value); }
@@ -966,12 +966,12 @@ class treap_set_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
- //! "key" according to the comparison functor or end() if that element
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
//! does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -984,9 +984,9 @@ class treap_set_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
std::pair<iterator,iterator> equal_range(const_reference value)
{ return tree_.equal_range(value); }
@@ -995,13 +995,13 @@ class treap_set_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds a range containing all elements whose key is k
- //! according to the comparison functor or an empty range
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
//! that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -1014,9 +1014,9 @@ class treap_set_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
std::pair<const_iterator, const_iterator>
equal_range(const_reference value) const
@@ -1026,13 +1026,13 @@ class treap_set_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds a range containing all elements whose key is k
- //! according to the comparison functor or an empty range
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
//! that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -1043,16 +1043,101 @@ class treap_set_impl
equal_range(const KeyType& key, KeyValueCompare comp) const
{ return tree_.equal_range(key, comp); }
+ //! <b>Requires</b>: 'lower_value' must not be greater than 'upper_value'. If
+ //! 'lower_value' == 'upper_value', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_value and upper_value.
+ std::pair<iterator,iterator> bounded_range
+ (const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed)
+ { return tree_.bounded_range(lower_value, upper_value, left_closed, right_closed); }
+
+ //! <b>Requires</b>: KeyValueCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise
+ //!
+ //! second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator,iterator> bounded_range
+ (const KeyType& lower_key, const KeyType& upper_key, KeyValueCompare comp, bool left_closed, bool right_closed)
+ { return tree_.bounded_range(lower_key, upper_key, comp, left_closed, right_closed); }
+
+ //! <b>Requires</b>: 'lower_value' must not be greater than 'upper_value'. If
+ //! 'lower_value' == 'upper_value', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_value and upper_value.
+ std::pair<const_iterator, const_iterator>
+ bounded_range(const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed) const
+ { return tree_.bounded_range(lower_value, upper_value, left_closed, right_closed); }
+
+ //! <b>Requires</b>: KeyValueCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise
+ //!
+ //! second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<const_iterator, const_iterator>
+ bounded_range
+ (const KeyType& lower_key, const KeyType& upper_key, KeyValueCompare comp, bool left_closed, bool right_closed) const
+ { return tree_.bounded_range(lower_key, upper_key, comp, left_closed, right_closed); }
+
//! <b>Requires</b>: value must be an lvalue and shall be in a treap_set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator i belonging to the treap_set
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
static iterator s_iterator_to(reference value)
@@ -1060,14 +1145,14 @@ class treap_set_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a treap_set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
//! treap_set that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
static const_iterator s_iterator_to(const_reference value)
@@ -1075,48 +1160,48 @@ class treap_set_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a treap_set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator i belonging to the treap_set
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator iterator_to(reference value)
{ return tree_.iterator_to(value); }
//! <b>Requires</b>: value must be an lvalue and shall be in a treap_set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
//! treap_set that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator iterator_to(const_reference value) const
{ return tree_.iterator_to(value); }
//! <b>Requires</b>: value shall not be in a treap_set/treap_multiset.
- //!
+ //!
//! <b>Effects</b>: init_node puts the hook of a value in a well-known default
//! state.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Note</b>: This function puts the hook in the well-known default state
//! used by auto_unlink and safe hooks.
static void init_node(reference value)
{ tree_type::init_node(value); }
//! <b>Effects</b>: Unlinks the leftmost node from the tree.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function breaks the tree and the tree can
//! only be used for more unlink_leftmost_without_rebalance calls.
//! This function is normally used to achieve a step by step
@@ -1126,14 +1211,14 @@ class treap_set_impl
//! <b>Requires</b>: replace_this must be a valid iterator of *this
//! and with_this must not be inserted in any tree.
- //!
+ //!
//! <b>Effects</b>: Replaces replace_this in its position in the
//! tree with with_this. The tree does not need to be rebalanced.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! with_this is not equivalent to *replace_this according to the
//! ordering rules. This function is faster than erasing and inserting
@@ -1142,21 +1227,21 @@ class treap_set_impl
{ tree_.replace_node(replace_this, with_this); }
//! <b>Effects</b>: Rebalances the tree.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear.
void rebalance()
{ tree_.rebalance(); }
//! <b>Requires</b>: old_root is a node of a tree.
- //!
+ //!
//! <b>Effects</b>: Rebalances the subtree rooted at old_root.
//!
//! <b>Returns</b>: The new root of the subtree.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the elements in the subtree.
iterator rebalance_subtree(iterator root)
{ return tree_.rebalance_subtree(root); }
@@ -1164,18 +1249,18 @@ class treap_set_impl
//! <b>Returns</b>: The balance factor (alpha) used in this tree
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
float balance_factor() const
{ return tree_.balance_factor(); }
//! <b>Requires</b>: new_alpha must be a value between 0.5 and 1.0
- //!
+ //!
//! <b>Effects</b>: Establishes a new balance factor (alpha) and rebalances
//! the tree if the new balance factor is stricter (less) than the old factor.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the elements in the subtree.
void balance_factor(float new_alpha)
{ tree_.balance_factor(new_alpha); }
@@ -1266,7 +1351,7 @@ struct make_treap_set
{
/// @cond
typedef treap_set_impl
- < typename make_treap_opt<T,
+ < typename make_treap_opt<T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -1286,7 +1371,7 @@ template<class T, class O1, class O2, class O3, class O4>
template<class T, class ...Options>
#endif
class treap_set
- : public make_treap_set<T,
+ : public make_treap_set<T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -1295,7 +1380,7 @@ class treap_set
>::type
{
typedef typename make_treap_set
- <T,
+ <T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -1350,9 +1435,9 @@ class treap_set
#endif
-//! The class template treap_multiset is an intrusive container, that mimics most of
+//! The class template treap_multiset is an intrusive container, that mimics most of
//! the interface of std::treap_multiset as described in the C++ standard.
-//!
+//!
//! The template parameter \c T is the type to be managed by the container.
//! The user can specify additional options and if no options are provided
//! default options are used.
@@ -1406,31 +1491,31 @@ class treap_multiset_impl
/// @endcond
public:
- //! <b>Effects</b>: Constructs an empty treap_multiset.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //! <b>Effects</b>: Constructs an empty treap_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
- //! or the copy constructor of the value_compare/priority_compare objects throw.
+ //! or the copy constructor of the value_compare/priority_compare objects throw.
treap_multiset_impl( const value_compare &cmp = value_compare()
, const priority_compare &pcmp = priority_compare()
- , const value_traits &v_traits = value_traits())
+ , const value_traits &v_traits = value_traits())
: tree_(cmp, pcmp, v_traits)
{}
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
//! cmp must be a comparison function that induces a strict weak ordering.
- //!
- //! <b>Effects</b>: Constructs an empty treap_multiset and inserts elements from
+ //!
+ //! <b>Effects</b>: Constructs an empty treap_multiset and inserts elements from
//! [b, e).
- //!
+ //!
//! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
//! comp and otherwise N * log N, where N is the distance between first and last
- //!
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
- //! or the copy constructor/operator() of the value_compare/priority_compare objects throw.
+ //! or the copy constructor/operator() of the value_compare/priority_compare objects throw.
template<class Iterator>
treap_multiset_impl( Iterator b, Iterator e
, const value_compare &cmp = value_compare()
@@ -1440,186 +1525,186 @@ class treap_multiset_impl
{}
//! <b>Effects</b>: to-do
- //!
- treap_multiset_impl(BOOST_RV_REF(treap_multiset_impl) x)
+ //!
+ treap_multiset_impl(BOOST_RV_REF(treap_multiset_impl) x)
: tree_(::boost::move(x.tree_))
{}
//! <b>Effects</b>: to-do
- //!
- treap_multiset_impl& operator=(BOOST_RV_REF(treap_multiset_impl) x)
+ //!
+ treap_multiset_impl& operator=(BOOST_RV_REF(treap_multiset_impl) x)
{ tree_ = ::boost::move(x.tree_); return *this; }
- //! <b>Effects</b>: Detaches all elements from this. The objects in the treap_multiset
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the treap_multiset
//! are not deleted (i.e. no destructors are called).
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- ~treap_multiset_impl()
+ ~treap_multiset_impl()
{}
//! <b>Effects</b>: Returns an iterator pointing to the beginning of the treap_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator begin()
{ return tree_.begin(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the treap_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator begin() const
{ return tree_.begin(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the treap_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cbegin() const
{ return tree_.cbegin(); }
//! <b>Effects</b>: Returns an iterator pointing to the end of the treap_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator end()
{ return tree_.end(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the treap_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator end() const
{ return tree_.end(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the treap_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cend() const
{ return tree_.cend(); }
//! <b>Effects</b>: Returns an iterator pointing to the highest priority object of the tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator top()
{ return tree_.top(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the highest priority object of the tree..
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator top() const
{ return this->ctop(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the highest priority object of the tree..
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator ctop() const
{ return tree_.ctop(); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning of the
//! reversed treap_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rbegin()
{ return tree_.rbegin(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed treap_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rbegin() const
{ return tree_.rbegin(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
//! of the reversed treap_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crbegin() const
{ return tree_.crbegin(); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the end
//! of the reversed treap_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rend()
{ return tree_.rend(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed treap_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rend() const
{ return tree_.rend(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
//! of the reversed treap_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crend() const
{ return tree_.crend(); }
//! <b>Effects</b>: Returns a reverse_iterator pointing to the highest priority object of the
//! reversed tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
reverse_iterator rtop()
{ return tree_.rtop(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the highest priority objec
//! of the reversed tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator rtop() const
{ return tree_.crtop(); }
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the highest priority object
//! of the reversed tree.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_reverse_iterator crtop() const
{ return tree_.crtop(); }
//! <b>Precondition</b>: end_iterator must be a valid end iterator
//! of treap_multiset.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the treap_multiset associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static treap_multiset_impl &container_from_end_iterator(iterator end_iterator)
{
@@ -1630,11 +1715,11 @@ class treap_multiset_impl
//! <b>Precondition</b>: end_iterator must be a valid end const_iterator
//! of treap_multiset.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the treap_multiset associated to the end iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static const treap_multiset_impl &container_from_end_iterator(const_iterator end_iterator)
{
@@ -1644,11 +1729,11 @@ class treap_multiset_impl
}
//! <b>Precondition</b>: it must be a valid iterator of multiset.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the multiset associated to the iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static treap_multiset_impl &container_from_iterator(iterator it)
{
@@ -1658,11 +1743,11 @@ class treap_multiset_impl
}
//! <b>Precondition</b>: it must be a valid const_iterator of multiset.
- //!
+ //!
//! <b>Effects</b>: Returns a const reference to the multiset associated to the iterator
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
static const treap_multiset_impl &container_from_iterator(const_iterator it)
{
@@ -1672,50 +1757,50 @@ class treap_multiset_impl
}
//! <b>Effects</b>: Returns the key_compare object used by the treap_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If key_compare copy-constructor throws.
key_compare key_comp() const
{ return tree_.value_comp(); }
//! <b>Effects</b>: Returns the value_compare object used by the treap_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If value_compare copy-constructor throws.
value_compare value_comp() const
{ return tree_.value_comp(); }
//! <b>Effects</b>: Returns the priority_compare object used by the treap_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If priority_compare copy-constructor throws.
priority_compare priority_comp() const
{ return tree_.priority_comp(); }
//! <b>Effects</b>: Returns true if the container is empty.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
bool empty() const
{ return tree_.empty(); }
//! <b>Effects</b>: Returns the number of elements stored in the treap_multiset.
- //!
+ //!
//! <b>Complexity</b>: Linear to elements contained in *this if,
//! constant-time size option is enabled. Constant-time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
size_type size() const
{ return tree_.size(); }
//! <b>Effects</b>: Swaps the contents of two treap_multisets.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If the swap() call for the comparison functor
//! found using ADL throws. Strong guarantee.
void swap(treap_multiset_impl& other)
@@ -1725,72 +1810,72 @@ class treap_multiset_impl
//! Cloner should yield to nodes equivalent to the original nodes.
//!
//! <b>Effects</b>: Erases all the elements from *this
- //! calling Disposer::operator()(pointer), clones all the
+ //! calling Disposer::operator()(pointer), clones all the
//! elements from src calling Cloner::operator()(const_reference )
//! and inserts them on *this. Copies the predicate from the source container.
//!
//! If cloner throws, all cloned elements are unlinked and disposed
//! calling Disposer::operator()(pointer).
- //!
+ //!
//! <b>Complexity</b>: Linear to erased plus inserted elements.
- //!
+ //!
//! <b>Throws</b>: If cloner throws or predicate copy assignment throws. Basic guarantee.
template <class Cloner, class Disposer>
void clone_from(const treap_multiset_impl &src, Cloner cloner, Disposer disposer)
{ tree_.clone_from(src.tree_, cloner, disposer); }
//! <b>Requires</b>: value must be an lvalue
- //!
+ //!
//! <b>Effects</b>: Inserts value into the treap_multiset.
- //!
+ //!
//! <b>Returns</b>: An iterator that points to the position where the new
//! element was inserted.
- //!
+ //!
//! <b>Complexity</b>: Average complexity for insert element is at
//! most logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare or priority_compare ordering
//! function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
iterator insert(reference value)
{ return tree_.insert_equal(value); }
//! <b>Requires</b>: value must be an lvalue
- //!
+ //!
//! <b>Effects</b>: Inserts x into the treap_multiset, using pos as a hint to
//! where it will be inserted.
- //!
+ //!
//! <b>Returns</b>: An iterator that points to the position where the new
//! element was inserted.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic in general, but it is amortized
//! constant time if t is inserted immediately before hint.
- //!
+ //!
//! <b>Throws</b>: If internal value_compare or priority_compare ordering functions throw.
//! Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
iterator insert(const_iterator hint, reference value)
{ return tree_.insert_equal(hint, value); }
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
//! of type value_type.
- //!
+ //!
//! <b>Effects</b>: Inserts a range into the treap_multiset.
- //!
+ //!
//! <b>Returns</b>: An iterator that points to the position where the new
//! element was inserted.
- //!
+ //!
//! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
//! size of the range. However, it is linear in N if the range is already sorted
//! by value_comp().
- //!
+ //!
//! <b>Throws</b>: If internal value_compare or priority_compare ordering functions throw.
//! Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
template<class Iterator>
@@ -1802,11 +1887,11 @@ class treap_multiset_impl
//! once inserted according to the predicate
//!
//! <b>Effects</b>: Inserts x into the treap before "pos".
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: If the internal priority_compare function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if "pos" is not
//! the successor of "value" treap ordering invariant will be broken.
//! This is a low-level function to be used only for performance reasons
@@ -1818,11 +1903,11 @@ class treap_multiset_impl
//! than the greatest inserted key.
//!
//! <b>Effects</b>: Inserts x into the treap in the last position.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: If the internal priority_compare function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if value is
//! less than the greatest inserted key treap ordering invariant will be broken.
//! This function is slightly more efficient than using "insert_before".
@@ -1835,11 +1920,11 @@ class treap_multiset_impl
//! than the minimum inserted key
//!
//! <b>Effects</b>: Inserts x into the treap in the first position.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Throws</b>: If the internal priority_compare function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: This function does not check preconditions so if value is
//! greater than the minimum inserted key treap ordering invariant will be broken.
//! This function is slightly more efficient than using "insert_before".
@@ -1848,42 +1933,42 @@ class treap_multiset_impl
void push_front(reference value)
{ tree_.push_front(value); }
- //! <b>Effects</b>: Erases the element pointed to by pos.
- //!
- //! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
//! <b>Returns</b>: An iterator to the element after the erased element.
//!
//! <b>Throws</b>: If the internal priority_compare function throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
iterator erase(const_iterator i)
{ return tree_.erase(i); }
- //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
//!
//! <b>Returns</b>: An iterator to the element after the erased elements.
- //!
- //! <b>Complexity</b>: Average complexity for erase range is at most
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
//! O(log(size() + N)), where N is the number of elements in the range.
- //!
+ //!
//! <b>Throws</b>: If the internal priority_compare function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
iterator erase(const_iterator b, const_iterator e)
{ return tree_.erase(b, e); }
//! <b>Effects</b>: Erases all the elements with the given value.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + this->count(value)).
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare or priority_compare ordering
//! functiona throw. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
size_type erase(const_reference value)
@@ -1891,13 +1976,13 @@ class treap_multiset_impl
//! <b>Effects</b>: Erases all the elements that compare equal with
//! the given key and the given comparison functor.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + this->count(key, comp)).
- //!
+ //!
//! <b>Throws</b>: If comp or internal priority_compare ordering functions throw. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class KeyType, class KeyValueCompare>
@@ -1912,14 +1997,14 @@ class treap_multiset_impl
//!
//! <b>Returns</b>: An iterator to the element after the erased element.
//!
- //! <b>Effects</b>: Erases the element pointed to by pos.
+ //! <b>Effects</b>: Erases the element pointed to by pos.
//! Disposer::operator()(pointer) is called for the removed element.
- //!
- //! <b>Complexity</b>: Average complexity for erase element is constant time.
- //!
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
//! <b>Throws</b>: If the internal priority_compare function throws. Strong guarantee.
- //!
- //! <b>Note</b>: Invalidates the iterators
+ //!
+ //! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
iterator erase_and_dispose(const_iterator i, Disposer disposer)
@@ -1937,12 +2022,12 @@ class treap_multiset_impl
//!
//! <b>Effects</b>: Erases the range pointed to by b end e.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
- //! <b>Complexity</b>: Average complexity for erase range is at most
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
//! O(log(size() + N)), where N is the number of elements in the range.
- //!
+ //!
//! <b>Throws</b>: If the internal priority_compare function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
@@ -1953,13 +2038,13 @@ class treap_multiset_impl
//!
//! <b>Effects</b>: Erases all the elements with the given value.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + this->count(value)).
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class Disposer>
@@ -1973,11 +2058,11 @@ class treap_multiset_impl
//! Disposer::operator()(pointer) is called for the removed elements.
//!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: O(log(size() + this->count(key, comp)).
- //!
+ //!
//! <b>Throws</b>: If comp or internal priority_compare ordering functions throw. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class KeyType, class KeyValueCompare, class Disposer>
@@ -1989,26 +2074,26 @@ class treap_multiset_impl
{ return tree_.erase_and_dispose(key, comp, disposer); }
//! <b>Effects</b>: Erases all the elements of the container.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
void clear()
{ return tree_.clear(); }
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
- //!
+ //!
//! <b>Effects</b>: Erases all the elements of the container.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class Disposer>
@@ -2016,20 +2101,20 @@ class treap_multiset_impl
{ return tree_.clear_and_dispose(disposer); }
//! <b>Effects</b>: Returns the number of contained elements with the given key
- //!
+ //!
//! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
//! to number of objects with the given key.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
size_type count(const_reference value) const
{ return tree_.count(value); }
//! <b>Effects</b>: Returns the number of contained elements with the same key
//! compared with the given comparison functor.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
//! to number of objects with the given key.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
template<class KeyType, class KeyValueCompare>
size_type count(const KeyType& key, KeyValueCompare comp) const
@@ -2037,9 +2122,9 @@ class treap_multiset_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
iterator lower_bound(const_reference value)
{ return tree_.lower_bound(value); }
@@ -2049,13 +2134,13 @@ class treap_multiset_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns an iterator to the first element whose
- //! key according to the comparison functor is not less than k or
+ //! key according to the comparison functor is not less than k or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
- //!
+ //!
//! <b>Note</b>: This function is used when constructing a value_type
//! is expensive and the value_type can be compared with a cheaper
//! key type. Usually this key is part of the value_type.
@@ -2065,9 +2150,9 @@ class treap_multiset_impl
//! <b>Effects</b>: Returns a const iterator to the first element whose
//! key is not less than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
const_iterator lower_bound(const_reference value) const
{ return tree_.lower_bound(value); }
@@ -2077,13 +2162,13 @@ class treap_multiset_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns a const_iterator to the first element whose
- //! key according to the comparison functor is not less than k or
+ //! key according to the comparison functor is not less than k or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
- //!
+ //!
//! <b>Note</b>: This function is used when constructing a value_type
//! is expensive and the value_type can be compared with a cheaper
//! key type. Usually this key is part of the value_type.
@@ -2093,9 +2178,9 @@ class treap_multiset_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is greater than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
iterator upper_bound(const_reference value)
{ return tree_.upper_bound(value); }
@@ -2105,11 +2190,11 @@ class treap_multiset_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns an iterator to the first element whose
- //! key according to the comparison functor is greater than key or
+ //! key according to the comparison functor is greater than key or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -2121,9 +2206,9 @@ class treap_multiset_impl
//! <b>Effects</b>: Returns an iterator to the first element whose
//! key is greater than k or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
const_iterator upper_bound(const_reference value) const
{ return tree_.upper_bound(value); }
@@ -2133,11 +2218,11 @@ class treap_multiset_impl
//! that is used in the ordering functor.
//!
//! <b>Effects</b>: Returns a const_iterator to the first element whose
- //! key according to the comparison functor is greater than key or
+ //! key according to the comparison functor is greater than key or
//! end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -2147,11 +2232,11 @@ class treap_multiset_impl
const_iterator upper_bound(const KeyType& key, KeyValueCompare comp) const
{ return tree_.upper_bound(key, comp); }
- //! <b>Effects</b>: Finds an iterator to the first element whose value is
+ //! <b>Effects</b>: Finds an iterator to the first element whose value is
//! "value" or end() if that element does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
iterator find(const_reference value)
{ return tree_.find(value); }
@@ -2160,12 +2245,12 @@ class treap_multiset_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds an iterator to the first element whose key is
- //! "key" according to the comparison functor or end() if that element
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
//! does not exist.
//!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -2175,11 +2260,11 @@ class treap_multiset_impl
iterator find(const KeyType& key, KeyValueCompare comp)
{ return tree_.find(key, comp); }
- //! <b>Effects</b>: Finds a const_iterator to the first element whose value is
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose value is
//! "value" or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
const_iterator find(const_reference value) const
{ return tree_.find(value); }
@@ -2188,12 +2273,12 @@ class treap_multiset_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
- //! "key" according to the comparison functor or end() if that element
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
//! does not exist.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -2206,9 +2291,9 @@ class treap_multiset_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
std::pair<iterator,iterator> equal_range(const_reference value)
{ return tree_.equal_range(value); }
@@ -2217,13 +2302,13 @@ class treap_multiset_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds a range containing all elements whose key is k
- //! according to the comparison functor or an empty range
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
//! that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -2236,9 +2321,9 @@ class treap_multiset_impl
//! <b>Effects</b>: Finds a range containing all elements whose key is k or
//! an empty range that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If the internal value_compare ordering function throws.
std::pair<const_iterator, const_iterator>
equal_range(const_reference value) const
@@ -2248,13 +2333,13 @@ class treap_multiset_impl
//! value_compare. Usually key is the part of the value_type
//! that is used in the ordering functor.
//!
- //! <b>Effects</b>: Finds a range containing all elements whose key is k
- //! according to the comparison functor or an empty range
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
//! that indicates the position where those elements would be
//! if they there is no elements with key k.
- //!
+ //!
//! <b>Complexity</b>: Logarithmic.
- //!
+ //!
//! <b>Throws</b>: If comp ordering function throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -2265,16 +2350,101 @@ class treap_multiset_impl
equal_range(const KeyType& key, KeyValueCompare comp) const
{ return tree_.equal_range(key, comp); }
+ //! <b>Requires</b>: 'lower_value' must not be greater than 'upper_value'. If
+ //! 'lower_value' == 'upper_value', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_value and upper_value.
+ std::pair<iterator,iterator> bounded_range
+ (const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed)
+ { return tree_.bounded_range(lower_value, upper_value, left_closed, right_closed); }
+
+ //! <b>Requires</b>: KeyValueCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise
+ //!
+ //! second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator,iterator> bounded_range
+ (const KeyType& lower_key, const KeyType& upper_key, KeyValueCompare comp, bool left_closed, bool right_closed)
+ { return tree_.bounded_range(lower_key, upper_key, comp, left_closed, right_closed); }
+
+ //! <b>Requires</b>: 'lower_value' must not be greater than 'upper_value'. If
+ //! 'lower_value' == 'upper_value', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
+ //!
+ //! second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_value and upper_value.
+ std::pair<const_iterator, const_iterator>
+ bounded_range(const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed) const
+ { return tree_.bounded_range(lower_value, upper_value, left_closed, right_closed); }
+
+ //! <b>Requires</b>: KeyValueCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree.
+ //! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
+ //! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
+ //!
+ //! <b>Effects</b>: Returns an a pair with the following criteria:
+ //!
+ //! first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise
+ //!
+ //! second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Note</b>: This function can be more efficient than calling upper_bound
+ //! and lower_bound for lower_key and upper_key.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<const_iterator, const_iterator>
+ bounded_range
+ (const KeyType& lower_key, const KeyType& upper_key, KeyValueCompare comp, bool left_closed, bool right_closed) const
+ { return tree_.bounded_range(lower_key, upper_key, comp, left_closed, right_closed); }
+
//! <b>Requires</b>: value must be an lvalue and shall be in a treap_multiset of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator i belonging to the treap_multiset
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
static iterator s_iterator_to(reference value)
@@ -2282,14 +2452,14 @@ class treap_multiset_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a treap_multiset of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
//! treap_multiset that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
static const_iterator s_iterator_to(const_reference value)
@@ -2297,48 +2467,48 @@ class treap_multiset_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a treap_multiset of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator i belonging to the treap_multiset
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator iterator_to(reference value)
{ return tree_.iterator_to(value); }
//! <b>Requires</b>: value must be an lvalue and shall be in a treap_multiset of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
//! treap_multiset that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator iterator_to(const_reference value) const
{ return tree_.iterator_to(value); }
//! <b>Requires</b>: value shall not be in a treap_multiset/treap_multiset.
- //!
+ //!
//! <b>Effects</b>: init_node puts the hook of a value in a well-known default
//! state.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
- //!
+ //!
//! <b>Note</b>: This function puts the hook in the well-known default state
//! used by auto_unlink and safe hooks.
static void init_node(reference value)
{ tree_type::init_node(value); }
//! <b>Effects</b>: Unlinks the leftmost node from the tree.
- //!
+ //!
//! <b>Complexity</b>: Average complexity is constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function breaks the tree and the tree can
//! only be used for more unlink_leftmost_without_rebalance calls.
//! This function is normally used to achieve a step by step
@@ -2348,14 +2518,14 @@ class treap_multiset_impl
//! <b>Requires</b>: replace_this must be a valid iterator of *this
//! and with_this must not be inserted in any tree.
- //!
+ //!
//! <b>Effects</b>: Replaces replace_this in its position in the
//! tree with with_this. The tree does not need to be rebalanced.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This function will break container ordering invariants if
//! with_this is not equivalent to *replace_this according to the
//! ordering rules. This function is faster than erasing and inserting
@@ -2364,21 +2534,21 @@ class treap_multiset_impl
{ tree_.replace_node(replace_this, with_this); }
//! <b>Effects</b>: Rebalances the tree.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear.
void rebalance()
{ tree_.rebalance(); }
//! <b>Requires</b>: old_root is a node of a tree.
- //!
+ //!
//! <b>Effects</b>: Rebalances the subtree rooted at old_root.
//!
//! <b>Returns</b>: The new root of the subtree.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the elements in the subtree.
iterator rebalance_subtree(iterator root)
{ return tree_.rebalance_subtree(root); }
@@ -2386,18 +2556,18 @@ class treap_multiset_impl
//! <b>Returns</b>: The balance factor (alpha) used in this tree
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Constant.
float balance_factor() const
{ return tree_.balance_factor(); }
//! <b>Requires</b>: new_alpha must be a value between 0.5 and 1.0
- //!
+ //!
//! <b>Effects</b>: Establishes a new balance factor (alpha) and rebalances
//! the tree if the new balance factor is stricter (less) than the old factor.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Complexity</b>: Linear to the elements in the subtree.
void balance_factor(float new_alpha)
{ tree_.balance_factor(new_alpha); }
@@ -2488,7 +2658,7 @@ struct make_treap_multiset
{
/// @cond
typedef treap_multiset_impl
- < typename make_treap_opt<T,
+ < typename make_treap_opt<T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -2508,7 +2678,7 @@ template<class T, class O1, class O2, class O3, class O4>
template<class T, class ...Options>
#endif
class treap_multiset
- : public make_treap_multiset<T,
+ : public make_treap_multiset<T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -2517,7 +2687,7 @@ class treap_multiset
>::type
{
typedef typename make_treap_multiset
- <T,
+ <T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -2573,8 +2743,8 @@ class treap_multiset
#endif
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/trivial_value_traits.hpp b/boost/intrusive/trivial_value_traits.hpp
index c924022608..5c166fdaa1 100644
--- a/boost/intrusive/trivial_value_traits.hpp
+++ b/boost/intrusive/trivial_value_traits.hpp
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -40,7 +40,7 @@ struct trivial_value_traits
static const const_pointer &to_value_ptr(const const_node_ptr &n) { return n; }
};
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#endif //BOOST_INTRUSIVE_TRIVIAL_VALUE_TRAITS_HPP
diff --git a/boost/intrusive/unordered_set.hpp b/boost/intrusive/unordered_set.hpp
index 6407fcfa45..a06d74bf31 100644
--- a/boost/intrusive/unordered_set.hpp
+++ b/boost/intrusive/unordered_set.hpp
@@ -1,7 +1,7 @@
/////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -23,7 +23,7 @@
namespace boost {
namespace intrusive {
-//! The class template unordered_set is an intrusive container, that mimics most of
+//! The class template unordered_set is an intrusive container, that mimics most of
//! the interface of std::tr1::unordered_set as described in the C++ TR1.
//!
//! unordered_set is a semi-intrusive container: each object to be stored in the
@@ -113,73 +113,73 @@ class unordered_set_impl
//!
//! <b>Effects</b>: Constructs an empty unordered_set_impl, storing a reference
//! to the bucket array and copies of the hasher and equal functors.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
- //! or the copy constructor or invocation of Hash or Equal throws.
+ //! or the copy constructor or invocation of Hash or Equal throws.
//!
//! <b>Notes</b>: buckets array must be disposed only after
- //! *this is disposed.
+ //! *this is disposed.
unordered_set_impl( const bucket_traits &b_traits
, const hasher & hash_func = hasher()
, const key_equal &equal_func = key_equal()
- , const value_traits &v_traits = value_traits())
+ , const value_traits &v_traits = value_traits())
: table_(b_traits, hash_func, equal_func, v_traits)
{}
//! <b>Requires</b>: buckets must not be being used by any other resource
//! and Dereferencing iterator must yield an lvalue of type value_type.
- //!
- //! <b>Effects</b>: Constructs an empty unordered_set and inserts elements from
+ //!
+ //! <b>Effects</b>: Constructs an empty unordered_set and inserts elements from
//! [b, e).
- //!
+ //!
//! <b>Complexity</b>: If N is std::distance(b, e): Average case is O(N)
//! (with a good hash function and with buckets_len >= N),worst case O(N2).
- //!
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
- //! or the copy constructor or invocation of hasher or key_equal throws.
+ //! or the copy constructor or invocation of hasher or key_equal throws.
//!
//! <b>Notes</b>: buckets array must be disposed only after
- //! *this is disposed.
+ //! *this is disposed.
template<class Iterator>
unordered_set_impl( Iterator b
, Iterator e
, const bucket_traits &b_traits
, const hasher & hash_func = hasher()
, const key_equal &equal_func = key_equal()
- , const value_traits &v_traits = value_traits())
+ , const value_traits &v_traits = value_traits())
: table_(b_traits, hash_func, equal_func, v_traits)
{ table_.insert_unique(b, e); }
//! <b>Effects</b>: to-do
- //!
- unordered_set_impl(BOOST_RV_REF(unordered_set_impl) x)
+ //!
+ unordered_set_impl(BOOST_RV_REF(unordered_set_impl) x)
: table_(::boost::move(x.table_))
{}
//! <b>Effects</b>: to-do
- //!
- unordered_set_impl& operator=(BOOST_RV_REF(unordered_set_impl) x)
+ //!
+ unordered_set_impl& operator=(BOOST_RV_REF(unordered_set_impl) x)
{ table_ = ::boost::move(x.table_); return *this; }
- //! <b>Effects</b>: Detaches all elements from this. The objects in the unordered_set
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the unordered_set
//! are not deleted (i.e. no destructors are called).
- //!
- //! <b>Complexity</b>: Linear to the number of elements in the unordered_set, if
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements in the unordered_set, if
//! it's a safe-mode or auto-unlink value. Otherwise constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- ~unordered_set_impl()
+ ~unordered_set_impl()
{}
//! <b>Effects</b>: Returns an iterator pointing to the beginning of the unordered_set.
- //!
+ //!
//! <b>Complexity</b>: Constant time if `cache_begin<>` is true. Amortized
//! constant time with worst case (empty unordered_set) O(this->bucket_count())
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator begin()
{ return table_.begin(); }
@@ -189,7 +189,7 @@ class unordered_set_impl
//!
//! <b>Complexity</b>: Constant time if `cache_begin<>` is true. Amortized
//! constant time with worst case (empty unordered_set) O(this->bucket_count())
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator begin() const
{ return table_.begin(); }
@@ -199,76 +199,76 @@ class unordered_set_impl
//!
//! <b>Complexity</b>: Constant time if `cache_begin<>` is true. Amortized
//! constant time with worst case (empty unordered_set) O(this->bucket_count())
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cbegin() const
{ return table_.cbegin(); }
//! <b>Effects</b>: Returns an iterator pointing to the end of the unordered_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator end()
{ return table_.end(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the unordered_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator end() const
{ return table_.end(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the unordered_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cend() const
{ return table_.cend(); }
//! <b>Effects</b>: Returns the hasher object used by the unordered_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If hasher copy-constructor throws.
hasher hash_function() const
{ return table_.hash_function(); }
//! <b>Effects</b>: Returns the key_equal object used by the unordered_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If key_equal copy-constructor throws.
key_equal key_eq() const
{ return table_.key_eq(); }
//! <b>Effects</b>: Returns true if the container is empty.
- //!
+ //!
//! <b>Complexity</b>: if constant-time size and cache_last options are disabled,
//! average constant time (worst case, with empty() == true: O(this->bucket_count()).
//! Otherwise constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
bool empty() const
{ return table_.empty(); }
//! <b>Effects</b>: Returns the number of elements stored in the unordered_set.
- //!
+ //!
//! <b>Complexity</b>: Linear to elements contained in *this if
//! constant-time size option is disabled. Constant-time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
size_type size() const
{ return table_.size(); }
//! <b>Requires</b>: the hasher and the equality function unqualified swap
//! call should not throw.
- //!
+ //!
//! <b>Effects</b>: Swaps the contents of two unordered_sets.
//! Swaps also the contained bucket array and equality and hasher functors.
- //!
+ //!
//! <b>Complexity</b>: Constant.
//!
//! <b>Throws</b>: If the swap() call for the comparison or hash functors
@@ -281,7 +281,7 @@ class unordered_set_impl
//! hash than the original node.
//!
//! <b>Effects</b>: Erases all the elements from *this
- //! calling Disposer::operator()(pointer), clones all the
+ //! calling Disposer::operator()(pointer), clones all the
//! elements from src calling Cloner::operator()(const_reference )
//! and inserts them on *this. The hash function and the equality
//! predicate are copied from the source.
@@ -290,9 +290,9 @@ class unordered_set_impl
//!
//! If any operation throws, all cloned elements are unlinked and disposed
//! calling Disposer::operator()(pointer).
- //!
+ //!
//! <b>Complexity</b>: Linear to erased plus inserted elements.
- //!
+ //!
//! <b>Throws</b>: If cloner or hasher throw or hash or equality predicate copying
//! throws. Basic guarantee.
template <class Cloner, class Disposer>
@@ -300,7 +300,7 @@ class unordered_set_impl
{ table_.clone_from(src.table_, cloner, disposer); }
//! <b>Requires</b>: value must be an lvalue
- //!
+ //!
//! <b>Effects</b>: Tries to inserts value into the unordered_set.
//!
//! <b>Returns</b>: If the value
@@ -308,40 +308,40 @@ class unordered_set_impl
//! iterator to the new value and true. If there is an equivalent value
//! returns a pair containing an iterator to the already present value
//! and false.
- //!
+ //!
//! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
std::pair<iterator, bool> insert(reference value)
{ return table_.insert_unique(value); }
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
//! of type value_type.
- //!
+ //!
//! <b>Effects</b>: Equivalent to this->insert(t) for each element in [b, e).
- //!
+ //!
//! <b>Complexity</b>: Average case O(N), where N is std::distance(b, e).
//! Worst case O(N*this->size()).
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
template<class Iterator>
void insert(Iterator b, Iterator e)
{ table_.insert_unique(b, e); }
- //! <b>Requires</b>: "hasher" must be a hash function that induces
+ //! <b>Requires</b>: "hasher" must be a hash function that induces
//! the same hash values as the stored hasher. The difference is that
//! "hasher" hashes the given key instead of the value_type.
//!
- //! "key_value_equal" must be a equality function that induces
+ //! "key_value_equal" must be a equality function that induces
//! the same equality as key_equal. The difference is that
//! "key_value_equal" compares an arbitrary key with the contained values.
- //!
+ //!
//! <b>Effects</b>: Checks if a value can be inserted in the unordered_set, using
//! a user provided key instead of the value itself.
//!
@@ -350,11 +350,11 @@ class unordered_set_impl
//! and false. If the value can be inserted returns true in the returned
//! pair boolean and fills "commit_data" that is meant to be used with
//! the "insert_commit" function.
- //!
+ //!
//! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
//!
//! <b>Throws</b>: If hasher or key_value_equal throw. Strong guarantee.
- //!
+ //!
//! <b>Notes</b>: This function is used to improve performance when constructing
//! a value_type is expensive: if there is an equivalent value
//! the constructed object must be discarded. Many times, the part of the
@@ -378,16 +378,16 @@ class unordered_set_impl
//! must have been obtained from a previous call to "insert_check".
//! No objects should have been inserted or erased from the unordered_set between
//! the "insert_check" that filled "commit_data" and the call to "insert_commit".
- //!
+ //!
//! <b>Effects</b>: Inserts the value in the unordered_set using the information obtained
//! from the "commit_data" that a previous "insert_check" filled.
//!
//! <b>Returns</b>: An iterator to the newly inserted object.
- //!
+ //!
//! <b>Complexity</b>: Constant time.
//!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Notes</b>: This function has only sense if a "insert_check" has been
//! previously executed to fill "commit_data". No value should be inserted or
//! erased between the "insert_check" and "insert_commit" calls.
@@ -396,61 +396,61 @@ class unordered_set_impl
iterator insert_commit(reference value, const insert_commit_data &commit_data)
{ return table_.insert_unique_commit(value, commit_data); }
- //! <b>Effects</b>: Erases the element pointed to by i.
- //!
+ //! <b>Effects</b>: Erases the element pointed to by i.
+ //!
//! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased element. No destructors are called.
void erase(const_iterator i)
{ table_.erase(i); }
- //! <b>Effects</b>: Erases the range pointed to by b end e.
- //!
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //!
//! <b>Complexity</b>: Average case O(std::distance(b, e)),
//! worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
void erase(const_iterator b, const_iterator e)
{ table_.erase(b, e); }
//! <b>Effects</b>: Erases all the elements with the given value.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: Average case O(this->count(value)).
//! Worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
size_type erase(const_reference value)
{ return table_.erase(value); }
- //! <b>Requires</b>: "hasher" must be a hash function that induces
+ //! <b>Requires</b>: "hasher" must be a hash function that induces
//! the same hash values as the stored hasher. The difference is that
//! "hasher" hashes the given key instead of the value_type.
//!
- //! "key_value_equal" must be a equality function that induces
+ //! "key_value_equal" must be a equality function that induces
//! the same equality as key_equal. The difference is that
//! "key_value_equal" compares an arbitrary key with the contained values.
//!
//! <b>Effects</b>: Erases all the elements that have the same hash and
//! compare equal with the given key.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: Average case O(this->count(value)).
//! Worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If hash_func or equal_func throw. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class KeyType, class KeyHasher, class KeyValueEqual>
@@ -459,14 +459,14 @@ class unordered_set_impl
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//!
- //! <b>Effects</b>: Erases the element pointed to by i.
+ //! <b>Effects</b>: Erases the element pointed to by i.
//! Disposer::operator()(pointer) is called for the removed element.
- //!
+ //!
//! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
- //! <b>Note</b>: Invalidates the iterators
+ //!
+ //! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
void erase_and_dispose(const_iterator i, Disposer disposer
@@ -480,12 +480,12 @@ class unordered_set_impl
//!
//! <b>Effects</b>: Erases the range pointed to by b end e.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Complexity</b>: Average case O(std::distance(b, e)),
//! worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
@@ -496,14 +496,14 @@ class unordered_set_impl
//!
//! <b>Effects</b>: Erases all the elements with the given value.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: Average case O(this->count(value)).
//! Worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class Disposer>
@@ -517,39 +517,39 @@ class unordered_set_impl
//! Disposer::operator()(pointer) is called for the removed elements.
//!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: Average case O(this->count(value)).
//! Worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If hash_func or equal_func throw. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class KeyType, class KeyHasher, class KeyValueEqual, class Disposer>
size_type erase_and_dispose(const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func, Disposer disposer)
{ return table_.erase_and_dispose(key, hash_func, equal_func, disposer); }
- //! <b>Effects</b>: Erases all of the elements.
- //!
+ //! <b>Effects</b>: Erases all of the elements.
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
void clear()
{ return table_.clear(); }
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
- //!
- //! <b>Effects</b>: Erases all of the elements.
- //!
+ //!
+ //! <b>Effects</b>: Erases all of the elements.
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class Disposer>
@@ -557,25 +557,25 @@ class unordered_set_impl
{ return table_.clear_and_dispose(disposer); }
//! <b>Effects</b>: Returns the number of contained elements with the given value
- //!
+ //!
//! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws.
size_type count(const_reference value) const
{ return table_.find(value) != end(); }
- //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
//! the same hash values as the stored hasher. The difference is that
//! "hash_func" hashes the given key instead of the value_type.
//!
- //! "equal_func" must be a equality function that induces
+ //! "equal_func" must be a equality function that induces
//! the same equality as key_equal. The difference is that
//! "equal_func" compares an arbitrary key with the contained values.
//!
//! <b>Effects</b>: Returns the number of contained elements with the given key
//!
//! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If hash_func or equal_func throw.
template<class KeyType, class KeyHasher, class KeyValueEqual>
size_type count(const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func) const
@@ -585,25 +585,25 @@ class unordered_set_impl
//! "value" or end() if that element does not exist.
//!
//! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws.
iterator find(const_reference value)
{ return table_.find(value); }
- //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
//! the same hash values as the stored hasher. The difference is that
//! "hash_func" hashes the given key instead of the value_type.
//!
- //! "equal_func" must be a equality function that induces
+ //! "equal_func" must be a equality function that induces
//! the same equality as key_equal. The difference is that
//! "equal_func" compares an arbitrary key with the contained values.
//!
- //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
//! "key" according to the given hasher and equality functor or end() if
//! that element does not exist.
//!
//! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If hash_func or equal_func throw.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -613,29 +613,29 @@ class unordered_set_impl
iterator find(const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func)
{ return table_.find(key, hash_func, equal_func); }
- //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
//! "key" or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws.
const_iterator find(const_reference value) const
{ return table_.find(value); }
- //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
//! the same hash values as the stored hasher. The difference is that
//! "hash_func" hashes the given key instead of the value_type.
//!
- //! "equal_func" must be a equality function that induces
+ //! "equal_func" must be a equality function that induces
//! the same equality as key_equal. The difference is that
//! "equal_func" compares an arbitrary key with the contained values.
//!
- //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
//! "key" according to the given hasher and equality functor or end() if
//! that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If hash_func or equal_func throw.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -646,30 +646,30 @@ class unordered_set_impl
{ return table_.find(key, hash_func, equal_func); }
//! <b>Effects</b>: Returns a range containing all elements with values equivalent
- //! to value. Returns std::make_pair(this->end(), this->end()) if no such
+ //! to value. Returns std::make_pair(this->end(), this->end()) if no such
//! elements exist.
- //!
+ //!
//! <b>Complexity</b>: Average case O(this->count(value)). Worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws.
std::pair<iterator,iterator> equal_range(const_reference value)
{ return table_.equal_range(value); }
- //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
//! the same hash values as the stored hasher. The difference is that
//! "hash_func" hashes the given key instead of the value_type.
//!
- //! "equal_func" must be a equality function that induces
+ //! "equal_func" must be a equality function that induces
//! the same equality as key_equal. The difference is that
//! "equal_func" compares an arbitrary key with the contained values.
//!
//! <b>Effects</b>: Returns a range containing all elements with equivalent
- //! keys. Returns std::make_pair(this->end(), this->end()) if no such
+ //! keys. Returns std::make_pair(this->end(), this->end()) if no such
//! elements exist.
- //!
+ //!
//! <b>Complexity</b>: Average case O(this->count(key, hash_func, hash_func)).
//! Worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If hash_func or the equal_func throw.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -680,31 +680,31 @@ class unordered_set_impl
{ return table_.equal_range(key, hash_func, equal_func); }
//! <b>Effects</b>: Returns a range containing all elements with values equivalent
- //! to value. Returns std::make_pair(this->end(), this->end()) if no such
+ //! to value. Returns std::make_pair(this->end(), this->end()) if no such
//! elements exist.
- //!
+ //!
//! <b>Complexity</b>: Average case O(this->count(value)). Worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws.
std::pair<const_iterator, const_iterator>
equal_range(const_reference value) const
{ return table_.equal_range(value); }
- //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
//! the same hash values as the stored hasher. The difference is that
//! "hash_func" hashes the given key instead of the value_type.
//!
- //! "equal_func" must be a equality function that induces
+ //! "equal_func" must be a equality function that induces
//! the same equality as key_equal. The difference is that
//! "equal_func" compares an arbitrary key with the contained values.
//!
//! <b>Effects</b>: Returns a range containing all elements with equivalent
- //! keys. Returns std::make_pair(this->end(), this->end()) if no such
+ //! keys. Returns std::make_pair(this->end(), this->end()) if no such
//! elements exist.
- //!
+ //!
//! <b>Complexity</b>: Average case O(this->count(key, hash_func, equal_func)).
//! Worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If the hash_func or equal_func throw.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -717,38 +717,38 @@ class unordered_set_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator belonging to the unordered_set
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If the internal hash function throws.
iterator iterator_to(reference value)
{ return table_.iterator_to(value); }
//! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator belonging to the
//! unordered_set that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If the internal hash function throws.
const_iterator iterator_to(const_reference value) const
{ return table_.iterator_to(value); }
//! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid local_iterator belonging to the unordered_set
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
static local_iterator s_local_iterator_to(reference value)
@@ -756,14 +756,14 @@ class unordered_set_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_local_iterator belonging to
//! the unordered_set that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
static const_local_iterator s_local_iterator_to(const_reference value)
@@ -771,33 +771,33 @@ class unordered_set_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid local_iterator belonging to the unordered_set
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
local_iterator local_iterator_to(reference value)
{ return table_.local_iterator_to(value); }
//! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_local_iterator belonging to
//! the unordered_set that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_local_iterator local_iterator_to(const_reference value) const
{ return table_.local_iterator_to(value); }
//! <b>Effects</b>: Returns the number of buckets passed in the constructor
//! or the last rehash function.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
size_type bucket_count() const
{ return table_.bucket_count(); }
@@ -805,33 +805,33 @@ class unordered_set_impl
//! <b>Requires</b>: n is in the range [0, this->bucket_count()).
//!
//! <b>Effects</b>: Returns the number of elements in the nth bucket.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
size_type bucket_size(size_type n) const
{ return table_.bucket_size(n); }
//! <b>Effects</b>: Returns the index of the bucket in which elements
//! with keys equivalent to k would be found, if any such element existed.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If the hash functor throws.
//!
//! <b>Note</b>: the return value is in the range [0, this->bucket_count()).
size_type bucket(const value_type& k) const
{ return table_.bucket(k); }
- //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
//! the same hash values as the stored hasher. The difference is that
//! "hash_func" hashes the given key instead of the value_type.
//!
//! <b>Effects</b>: Returns the index of the bucket in which elements
//! with keys equivalent to k would be found, if any such element existed.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If hash_func throws.
//!
//! <b>Note</b>: the return value is in the range [0, this->bucket_count()).
@@ -841,9 +841,9 @@ class unordered_set_impl
//! <b>Effects</b>: Returns the bucket array pointer passed in the constructor
//! or the last rehash function.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
bucket_ptr bucket_pointer() const
{ return table_.bucket_pointer(); }
@@ -852,13 +852,13 @@ class unordered_set_impl
//!
//! <b>Effects</b>: Returns a local_iterator pointing to the beginning
//! of the sequence stored in the bucket n.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
- //! containing all of the elements in the nth bucket.
+ //! containing all of the elements in the nth bucket.
local_iterator begin(size_type n)
{ return table_.begin(n); }
@@ -866,13 +866,13 @@ class unordered_set_impl
//!
//! <b>Effects</b>: Returns a const_local_iterator pointing to the beginning
//! of the sequence stored in the bucket n.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
- //! containing all of the elements in the nth bucket.
+ //! containing all of the elements in the nth bucket.
const_local_iterator begin(size_type n) const
{ return table_.begin(n); }
@@ -880,13 +880,13 @@ class unordered_set_impl
//!
//! <b>Effects</b>: Returns a const_local_iterator pointing to the beginning
//! of the sequence stored in the bucket n.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
- //! containing all of the elements in the nth bucket.
+ //! containing all of the elements in the nth bucket.
const_local_iterator cbegin(size_type n) const
{ return table_.cbegin(n); }
@@ -894,13 +894,13 @@ class unordered_set_impl
//!
//! <b>Effects</b>: Returns a local_iterator pointing to the end
//! of the sequence stored in the bucket n.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
- //! containing all of the elements in the nth bucket.
+ //! containing all of the elements in the nth bucket.
local_iterator end(size_type n)
{ return table_.end(n); }
@@ -908,13 +908,13 @@ class unordered_set_impl
//!
//! <b>Effects</b>: Returns a const_local_iterator pointing to the end
//! of the sequence stored in the bucket n.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
- //! containing all of the elements in the nth bucket.
+ //! containing all of the elements in the nth bucket.
const_local_iterator end(size_type n) const
{ return table_.end(n); }
@@ -922,13 +922,13 @@ class unordered_set_impl
//!
//! <b>Effects</b>: Returns a const_local_iterator pointing to the end
//! of the sequence stored in the bucket n.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
- //! containing all of the elements in the nth bucket.
+ //! containing all of the elements in the nth bucket.
const_local_iterator cend(size_type n) const
{ return table_.cend(n); }
@@ -938,22 +938,22 @@ class unordered_set_impl
//! n can be bigger or smaller than this->bucket_count().
//!
//! <b>Effects</b>: Updates the internal reference with the new bucket erases
- //! the values from the old bucket and inserts then in the new one.
+ //! the values from the old bucket and inserts then in the new one.
//!
//! If store_hash option is true, this method does not use the hash function.
- //!
+ //!
//! <b>Complexity</b>: Average case linear in this->size(), worst case quadratic.
- //!
+ //!
//! <b>Throws</b>: If the hasher functor throws. Basic guarantee.
void rehash(const bucket_traits &new_bucket_traits)
{ table_.rehash(new_bucket_traits); }
//! <b>Requires</b>:
//!
- //! <b>Effects</b>:
- //!
- //! <b>Complexity</b>:
- //!
+ //! <b>Effects</b>:
+ //!
+ //! <b>Complexity</b>:
+ //!
//! <b>Throws</b>:
//!
//! <b>Note</b>: this method is only available if incremental<true> option is activated.
@@ -966,22 +966,22 @@ class unordered_set_impl
//! <b>Requires</b>:
//!
- //! <b>Effects</b>:
- //!
- //! <b>Complexity</b>:
- //!
- //! <b>Throws</b>:
+ //! <b>Effects</b>:
+ //!
+ //! <b>Complexity</b>:
+ //!
+ //! <b>Throws</b>:
size_type split_count() const
{ return table_.split_count(); }
//! <b>Effects</b>: Returns the nearest new bucket count optimized for
//! the container that is bigger than n. This suggestion can be used
//! to create bucket arrays with a size that will usually improve
- //! container's performance. If such value does not exist, the
+ //! container's performance. If such value does not exist, the
//! higher possible value is returned.
- //!
+ //!
//! <b>Complexity</b>: Amortized constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static size_type suggested_upper_bucket_count(size_type n)
{ return table_type::suggested_upper_bucket_count(n); }
@@ -989,11 +989,11 @@ class unordered_set_impl
//! <b>Effects</b>: Returns the nearest new bucket count optimized for
//! the container that is smaller than n. This suggestion can be used
//! to create bucket arrays with a size that will usually improve
- //! container's performance. If such value does not exist, the
+ //! container's performance. If such value does not exist, the
//! lower possible value is returned.
- //!
+ //!
//! <b>Complexity</b>: Amortized constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static size_type suggested_lower_bucket_count(size_type n)
{ return table_type::suggested_lower_bucket_count(n); }
@@ -1016,7 +1016,7 @@ struct make_unordered_set
/// @cond
typedef unordered_set_impl
< typename make_hashtable_opt
- <T, true,
+ <T, true,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4, O5, O6, O7, O8, O9, O10
#else
@@ -1036,7 +1036,7 @@ template<class T, class O1, class O2, class O3, class O4, class O5, class O6, cl
template<class T, class ...Options>
#endif
class unordered_set
- : public make_unordered_set<T,
+ : public make_unordered_set<T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4, O5, O6, O7, O8, O9, O10
#else
@@ -1045,7 +1045,7 @@ class unordered_set
>::type
{
typedef typename make_unordered_set
- <T,
+ <T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4, O5, O6, O7, O8, O9, O10
#else
@@ -1070,7 +1070,7 @@ class unordered_set
unordered_set ( const bucket_traits &b_traits
, const hasher & hash_func = hasher()
, const key_equal &equal_func = key_equal()
- , const value_traits &v_traits = value_traits())
+ , const value_traits &v_traits = value_traits())
: Base(b_traits, hash_func, equal_func, v_traits)
{}
@@ -1080,7 +1080,7 @@ class unordered_set
, const bucket_traits &b_traits
, const hasher & hash_func = hasher()
, const key_equal &equal_func = key_equal()
- , const value_traits &v_traits = value_traits())
+ , const value_traits &v_traits = value_traits())
: Base(b, e, b_traits, hash_func, equal_func, v_traits)
{}
@@ -1095,7 +1095,7 @@ class unordered_set
#endif
-//! The class template unordered_multiset is an intrusive container, that mimics most of
+//! The class template unordered_multiset is an intrusive container, that mimics most of
//! the interface of std::tr1::unordered_multiset as described in the C++ TR1.
//!
//! unordered_multiset is a semi-intrusive container: each object to be stored in the
@@ -1184,34 +1184,34 @@ class unordered_multiset_impl
//!
//! <b>Effects</b>: Constructs an empty unordered_multiset, storing a reference
//! to the bucket array and copies of the hasher and equal functors.
- //!
- //! <b>Complexity</b>: Constant.
- //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
- //! or the copy constructor or invocation of Hash or Equal throws.
+ //! or the copy constructor or invocation of Hash or Equal throws.
//!
//! <b>Notes</b>: buckets array must be disposed only after
- //! *this is disposed.
+ //! *this is disposed.
unordered_multiset_impl ( const bucket_traits &b_traits
, const hasher & hash_func = hasher()
, const key_equal &equal_func = key_equal()
- , const value_traits &v_traits = value_traits())
+ , const value_traits &v_traits = value_traits())
: table_(b_traits, hash_func, equal_func, v_traits)
{}
//! <b>Requires</b>: buckets must not be being used by any other resource
//! and Dereferencing iterator must yield an lvalue of type value_type.
- //!
- //! <b>Effects</b>: Constructs an empty unordered_multiset and inserts elements from
+ //!
+ //! <b>Effects</b>: Constructs an empty unordered_multiset and inserts elements from
//! [b, e).
- //!
+ //!
//! <b>Complexity</b>: If N is std::distance(b, e): Average case is O(N)
//! (with a good hash function and with buckets_len >= N),worst case O(N2).
- //!
+ //!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
- //! or the copy constructor or invocation of hasher or key_equal throws.
+ //! or the copy constructor or invocation of hasher or key_equal throws.
//!
//! <b>Notes</b>: buckets array must be disposed only after
//! *this is disposed.
@@ -1221,36 +1221,36 @@ class unordered_multiset_impl
, const bucket_traits &b_traits
, const hasher & hash_func = hasher()
, const key_equal &equal_func = key_equal()
- , const value_traits &v_traits = value_traits())
+ , const value_traits &v_traits = value_traits())
: table_(b_traits, hash_func, equal_func, v_traits)
{ table_.insert_equal(b, e); }
//! <b>Effects</b>: to-do
- //!
- unordered_multiset_impl(BOOST_RV_REF(unordered_multiset_impl) x)
+ //!
+ unordered_multiset_impl(BOOST_RV_REF(unordered_multiset_impl) x)
: table_(::boost::move(x.table_))
{}
//! <b>Effects</b>: to-do
- //!
- unordered_multiset_impl& operator=(BOOST_RV_REF(unordered_multiset_impl) x)
+ //!
+ unordered_multiset_impl& operator=(BOOST_RV_REF(unordered_multiset_impl) x)
{ table_ = ::boost::move(x.table_); return *this; }
- //! <b>Effects</b>: Detaches all elements from this. The objects in the unordered_multiset
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the unordered_multiset
//! are not deleted (i.e. no destructors are called).
- //!
- //! <b>Complexity</b>: Linear to the number of elements in the unordered_multiset, if
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements in the unordered_multiset, if
//! it's a safe-mode or auto-unlink value. Otherwise constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- ~unordered_multiset_impl()
+ ~unordered_multiset_impl()
{}
//! <b>Effects</b>: Returns an iterator pointing to the beginning of the unordered_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant time if `cache_begin<>` is true. Amortized
//! constant time with worst case (empty unordered_set) O(this->bucket_count())
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator begin()
{ return table_.begin(); }
@@ -1260,7 +1260,7 @@ class unordered_multiset_impl
//!
//! <b>Complexity</b>: Constant time if `cache_begin<>` is true. Amortized
//! constant time with worst case (empty unordered_set) O(this->bucket_count())
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator begin() const
{ return table_.begin(); }
@@ -1270,77 +1270,77 @@ class unordered_multiset_impl
//!
//! <b>Complexity</b>: Constant time if `cache_begin<>` is true. Amortized
//! constant time with worst case (empty unordered_set) O(this->bucket_count())
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cbegin() const
{ return table_.cbegin(); }
//! <b>Effects</b>: Returns an iterator pointing to the end of the unordered_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
iterator end()
{ return table_.end(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the unordered_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator end() const
{ return table_.end(); }
//! <b>Effects</b>: Returns a const_iterator pointing to the end of the unordered_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_iterator cend() const
{ return table_.cend(); }
//! <b>Effects</b>: Returns the hasher object used by the unordered_set.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If hasher copy-constructor throws.
hasher hash_function() const
{ return table_.hash_function(); }
//! <b>Effects</b>: Returns the key_equal object used by the unordered_multiset.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If key_equal copy-constructor throws.
key_equal key_eq() const
{ return table_.key_eq(); }
//! <b>Effects</b>: Returns true if the container is empty.
- //!
+ //!
//! <b>Complexity</b>: if constant-time size and cache_last options are disabled,
//! average constant time (worst case, with empty() == true: O(this->bucket_count()).
//! Otherwise constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
bool empty() const
{ return table_.empty(); }
//! <b>Effects</b>: Returns the number of elements stored in the unordered_multiset.
- //!
+ //!
//! <b>Complexity</b>: Linear to elements contained in *this if
//! constant-time size option is disabled. Constant-time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
size_type size() const
{ return table_.size(); }
//! <b>Requires</b>: the hasher and the equality function unqualified swap
//! call should not throw.
- //!
+ //!
//! <b>Effects</b>: Swaps the contents of two unordered_multisets.
//! Swaps also the contained bucket array and equality and hasher functors.
//!
- //!
+ //!
//! <b>Complexity</b>: Constant.
//!
//! <b>Throws</b>: If the swap() call for the comparison or hash functors
@@ -1353,7 +1353,7 @@ class unordered_multiset_impl
//! hash than the original node.
//!
//! <b>Effects</b>: Erases all the elements from *this
- //! calling Disposer::operator()(pointer), clones all the
+ //! calling Disposer::operator()(pointer), clones all the
//! elements from src calling Cloner::operator()(const_reference )
//! and inserts them on *this. The hash function and the equality
//! predicate are copied from the source.
@@ -1362,9 +1362,9 @@ class unordered_multiset_impl
//!
//! If any operation throws, all cloned elements are unlinked and disposed
//! calling Disposer::operator()(pointer).
- //!
+ //!
//! <b>Complexity</b>: Linear to erased plus inserted elements.
- //!
+ //!
//! <b>Throws</b>: If cloner or hasher throw or hash or equality predicate copying
//! throws. Basic guarantee.
template <class Cloner, class Disposer>
@@ -1372,92 +1372,92 @@ class unordered_multiset_impl
{ table_.clone_from(src.table_, cloner, disposer); }
//! <b>Requires</b>: value must be an lvalue
- //!
+ //!
//! <b>Effects</b>: Inserts value into the unordered_multiset.
//!
//! <b>Returns</b>: An iterator to the new inserted value.
- //!
+ //!
//! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws. Strong guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
iterator insert(reference value)
{ return table_.insert_equal(value); }
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
//! of type value_type.
- //!
+ //!
//! <b>Effects</b>: Equivalent to this->insert(t) for each element in [b, e).
- //!
+ //!
//! <b>Complexity</b>: Average case is O(N), where N is the
//! size of the range.
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Does not affect the validity of iterators and references.
//! No copy-constructors are called.
template<class Iterator>
void insert(Iterator b, Iterator e)
{ table_.insert_equal(b, e); }
- //! <b>Effects</b>: Erases the element pointed to by i.
- //!
+ //! <b>Effects</b>: Erases the element pointed to by i.
+ //!
//! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased element. No destructors are called.
void erase(const_iterator i)
{ table_.erase(i); }
- //! <b>Effects</b>: Erases the range pointed to by b end e.
- //!
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //!
//! <b>Complexity</b>: Average case O(std::distance(b, e)),
//! worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
void erase(const_iterator b, const_iterator e)
{ table_.erase(b, e); }
//! <b>Effects</b>: Erases all the elements with the given value.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: Average case O(this->count(value)).
//! Worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
size_type erase(const_reference value)
{ return table_.erase(value); }
- //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
//! the same hash values as the stored hasher. The difference is that
//! "hash_func" hashes the given key instead of the value_type.
//!
- //! "key_value_equal" must be a equality function that induces
+ //! "key_value_equal" must be a equality function that induces
//! the same equality as key_equal. The difference is that
//! "key_value_equal" compares an arbitrary key with the contained values.
//!
//! <b>Effects</b>: Erases all the elements that have the same hash and
//! compare equal with the given key.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: Average case O(this->count(value)).
//! Worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If the hash_func or the equal_func functors throws.
//! Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class KeyType, class KeyHasher, class KeyValueEqual>
@@ -1466,14 +1466,14 @@ class unordered_multiset_impl
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//!
- //! <b>Effects</b>: Erases the element pointed to by i.
+ //! <b>Effects</b>: Erases the element pointed to by i.
//! Disposer::operator()(pointer) is called for the removed element.
- //!
+ //!
//! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
- //! <b>Note</b>: Invalidates the iterators
+ //!
+ //! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
void erase_and_dispose(const_iterator i, Disposer disposer
@@ -1493,12 +1493,12 @@ class unordered_multiset_impl
//!
//! <b>Effects</b>: Erases the range pointed to by b end e.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Complexity</b>: Average case O(std::distance(b, e)),
//! worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class Disposer>
@@ -1509,14 +1509,14 @@ class unordered_multiset_impl
//!
//! <b>Effects</b>: Erases all the elements with the given value.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: Average case O(this->count(value)).
//! Worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class Disposer>
@@ -1530,12 +1530,12 @@ class unordered_multiset_impl
//! Disposer::operator()(pointer) is called for the removed elements.
//!
//! <b>Returns</b>: The number of erased elements.
- //!
+ //!
//! <b>Complexity</b>: Average case O(this->count(value)).
//! Worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If hash_func or equal_func throw. Basic guarantee.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators
//! to the erased elements.
template<class KeyType, class KeyHasher, class KeyValueEqual, class Disposer>
@@ -1543,26 +1543,26 @@ class unordered_multiset_impl
{ return table_.erase_and_dispose(key, hash_func, equal_func, disposer); }
//! <b>Effects</b>: Erases all the elements of the container.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
void clear()
{ return table_.clear(); }
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
- //!
+ //!
//! <b>Effects</b>: Erases all the elements of the container.
- //!
+ //!
//! <b>Complexity</b>: Linear to the number of elements on the container.
//! Disposer::operator()(pointer) is called for the removed elements.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: Invalidates the iterators (but not the references)
//! to the erased elements. No destructors are called.
template<class Disposer>
@@ -1570,53 +1570,53 @@ class unordered_multiset_impl
{ return table_.clear_and_dispose(disposer); }
//! <b>Effects</b>: Returns the number of contained elements with the given key
- //!
+ //!
//! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws.
size_type count(const_reference value) const
{ return table_.count(value); }
- //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
//! the same hash values as the stored hasher. The difference is that
//! "hash_func" hashes the given key instead of the value_type.
//!
- //! "key_value_equal" must be a equality function that induces
+ //! "key_value_equal" must be a equality function that induces
//! the same equality as key_equal. The difference is that
//! "key_value_equal" compares an arbitrary key with the contained values.
//!
//! <b>Effects</b>: Returns the number of contained elements with the given key
//!
//! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws.
template<class KeyType, class KeyHasher, class KeyValueEqual>
size_type count(const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func) const
{ return table_.count(key, hash_func, equal_func); }
- //! <b>Effects</b>: Finds an iterator to the first element whose value is
+ //! <b>Effects</b>: Finds an iterator to the first element whose value is
//! "value" or end() if that element does not exist.
//!
//! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws.
iterator find(const_reference value)
{ return table_.find(value); }
- //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
//! the same hash values as the stored hasher. The difference is that
//! "hash_func" hashes the given key instead of the value_type.
//!
- //! "key_value_equal" must be a equality function that induces
+ //! "key_value_equal" must be a equality function that induces
//! the same equality as key_equal. The difference is that
//! "key_value_equal" compares an arbitrary key with the contained values.
//!
- //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
//! "key" according to the given hasher and equality functor or end() if
//! that element does not exist.
//!
//! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -1626,29 +1626,29 @@ class unordered_multiset_impl
iterator find(const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func)
{ return table_.find(key, hash_func, equal_func); }
- //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
//! "key" or end() if that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws.
const_iterator find(const_reference value) const
{ return table_.find(value); }
- //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
//! the same hash values as the stored hasher. The difference is that
//! "hash_func" hashes the given key instead of the value_type.
//!
- //! "key_value_equal" must be a equality function that induces
+ //! "key_value_equal" must be a equality function that induces
//! the same equality as key_equal. The difference is that
//! "key_value_equal" compares an arbitrary key with the contained values.
//!
- //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
//! "key" according to the given hasher and equality functor or end() if
//! that element does not exist.
- //!
+ //!
//! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -1659,30 +1659,30 @@ class unordered_multiset_impl
{ return table_.find(key, hash_func, equal_func); }
//! <b>Effects</b>: Returns a range containing all elements with values equivalent
- //! to value. Returns std::make_pair(this->end(), this->end()) if no such
+ //! to value. Returns std::make_pair(this->end(), this->end()) if no such
//! elements exist.
- //!
+ //!
//! <b>Complexity</b>: Average case O(this->count(value)). Worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws.
std::pair<iterator,iterator> equal_range(const_reference value)
{ return table_.equal_range(value); }
- //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
//! the same hash values as the stored hasher. The difference is that
//! "hash_func" hashes the given key instead of the value_type.
//!
- //! "key_value_equal" must be a equality function that induces
+ //! "key_value_equal" must be a equality function that induces
//! the same equality as key_equal. The difference is that
//! "key_value_equal" compares an arbitrary key with the contained values.
//!
//! <b>Effects</b>: Returns a range containing all elements with equivalent
- //! keys. Returns std::make_pair(this->end(), this->end()) if no such
+ //! keys. Returns std::make_pair(this->end(), this->end()) if no such
//! elements exist.
- //!
+ //!
//! <b>Complexity</b>: Average case O(this->count(key, hash_func, equal_func)).
//! Worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -1694,31 +1694,31 @@ class unordered_multiset_impl
{ return table_.equal_range(key, hash_func, equal_func); }
//! <b>Effects</b>: Returns a range containing all elements with values equivalent
- //! to value. Returns std::make_pair(this->end(), this->end()) if no such
+ //! to value. Returns std::make_pair(this->end(), this->end()) if no such
//! elements exist.
- //!
+ //!
//! <b>Complexity</b>: Average case O(this->count(value)). Worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws.
std::pair<const_iterator, const_iterator>
equal_range(const_reference value) const
{ return table_.equal_range(value); }
- //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
//! the same hash values as the stored hasher. The difference is that
//! "hash_func" hashes the given key instead of the value_type.
//!
- //! "key_value_equal" must be a equality function that induces
+ //! "key_value_equal" must be a equality function that induces
//! the same equality as key_equal. The difference is that
//! "key_value_equal" compares an arbitrary key with the contained values.
//!
//! <b>Effects</b>: Returns a range containing all elements with equivalent
- //! keys. Returns std::make_pair(this->end(), this->end()) if no such
+ //! keys. Returns std::make_pair(this->end(), this->end()) if no such
//! elements exist.
- //!
+ //!
//! <b>Complexity</b>: Average case O(this->count(key, hash_func, equal_func)).
//! Worst case O(this->size()).
- //!
+ //!
//! <b>Throws</b>: If the internal hasher or the equality functor throws.
//!
//! <b>Note</b>: This function is used when constructing a value_type
@@ -1731,38 +1731,38 @@ class unordered_multiset_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a unordered_multiset of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid iterator belonging to the unordered_multiset
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If the hash function throws.
iterator iterator_to(reference value)
{ return table_.iterator_to(value); }
//! <b>Requires</b>: value must be an lvalue and shall be in a unordered_multiset of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_iterator belonging to the
//! unordered_multiset that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If the hash function throws.
const_iterator iterator_to(const_reference value) const
{ return table_.iterator_to(value); }
//! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid local_iterator belonging to the unordered_set
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
static local_iterator s_local_iterator_to(reference value)
@@ -1770,14 +1770,14 @@ class unordered_multiset_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_local_iterator belonging to
//! the unordered_set that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: This static function is available only if the <i>value traits</i>
//! is stateless.
static const_local_iterator s_local_iterator_to(const_reference value)
@@ -1785,33 +1785,33 @@ class unordered_multiset_impl
//! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid local_iterator belonging to the unordered_set
//! that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
local_iterator local_iterator_to(reference value)
{ return table_.local_iterator_to(value); }
//! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
//! appropriate type. Otherwise the behavior is undefined.
- //!
+ //!
//! <b>Effects</b>: Returns: a valid const_local_iterator belonging to
//! the unordered_set that points to the value
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
const_local_iterator local_iterator_to(const_reference value) const
{ return table_.local_iterator_to(value); }
//! <b>Effects</b>: Returns the number of buckets passed in the constructor
//! or the last rehash function.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
size_type bucket_count() const
{ return table_.bucket_count(); }
@@ -1819,33 +1819,33 @@ class unordered_multiset_impl
//! <b>Requires</b>: n is in the range [0, this->bucket_count()).
//!
//! <b>Effects</b>: Returns the number of elements in the nth bucket.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
size_type bucket_size(size_type n) const
{ return table_.bucket_size(n); }
//! <b>Effects</b>: Returns the index of the bucket in which elements
//! with keys equivalent to k would be found, if any such element existed.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If the hash functor throws.
//!
//! <b>Note</b>: the return value is in the range [0, this->bucket_count()).
size_type bucket(const value_type& k) const
{ return table_.bucket(k); }
- //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
//! the same hash values as the stored hasher. The difference is that
//! "hash_func" hashes the given key instead of the value_type.
//!
//! <b>Effects</b>: Returns the index of the bucket in which elements
//! with keys equivalent to k would be found, if any such element existed.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: If the hash functor throws.
//!
//! <b>Note</b>: the return value is in the range [0, this->bucket_count()).
@@ -1855,9 +1855,9 @@ class unordered_multiset_impl
//! <b>Effects</b>: Returns the bucket array pointer passed in the constructor
//! or the last rehash function.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
bucket_ptr bucket_pointer() const
{ return table_.bucket_pointer(); }
@@ -1866,13 +1866,13 @@ class unordered_multiset_impl
//!
//! <b>Effects</b>: Returns a local_iterator pointing to the beginning
//! of the sequence stored in the bucket n.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
- //! containing all of the elements in the nth bucket.
+ //! containing all of the elements in the nth bucket.
local_iterator begin(size_type n)
{ return table_.begin(n); }
@@ -1880,13 +1880,13 @@ class unordered_multiset_impl
//!
//! <b>Effects</b>: Returns a const_local_iterator pointing to the beginning
//! of the sequence stored in the bucket n.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
- //! containing all of the elements in the nth bucket.
+ //! containing all of the elements in the nth bucket.
const_local_iterator begin(size_type n) const
{ return table_.begin(n); }
@@ -1894,13 +1894,13 @@ class unordered_multiset_impl
//!
//! <b>Effects</b>: Returns a const_local_iterator pointing to the beginning
//! of the sequence stored in the bucket n.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
- //! containing all of the elements in the nth bucket.
+ //! containing all of the elements in the nth bucket.
const_local_iterator cbegin(size_type n) const
{ return table_.cbegin(n); }
@@ -1908,13 +1908,13 @@ class unordered_multiset_impl
//!
//! <b>Effects</b>: Returns a local_iterator pointing to the end
//! of the sequence stored in the bucket n.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
- //! containing all of the elements in the nth bucket.
+ //! containing all of the elements in the nth bucket.
local_iterator end(size_type n)
{ return table_.end(n); }
@@ -1922,13 +1922,13 @@ class unordered_multiset_impl
//!
//! <b>Effects</b>: Returns a const_local_iterator pointing to the end
//! of the sequence stored in the bucket n.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
- //! containing all of the elements in the nth bucket.
+ //! containing all of the elements in the nth bucket.
const_local_iterator end(size_type n) const
{ return table_.end(n); }
@@ -1936,13 +1936,13 @@ class unordered_multiset_impl
//!
//! <b>Effects</b>: Returns a const_local_iterator pointing to the end
//! of the sequence stored in the bucket n.
- //!
+ //!
//! <b>Complexity</b>: Constant.
- //!
+ //!
//! <b>Throws</b>: Nothing.
- //!
+ //!
//! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
- //! containing all of the elements in the nth bucket.
+ //! containing all of the elements in the nth bucket.
const_local_iterator cend(size_type n) const
{ return table_.cend(n); }
@@ -1952,22 +1952,22 @@ class unordered_multiset_impl
//! n can be bigger or smaller than this->bucket_count().
//!
//! <b>Effects</b>: Updates the internal reference with the new bucket erases
- //! the values from the old bucket and inserts then in the new one.
+ //! the values from the old bucket and inserts then in the new one.
//!
//! If store_hash option is true, this method does not use the hash function.
- //!
+ //!
//! <b>Complexity</b>: Average case linear in this->size(), worst case quadratic.
- //!
+ //!
//! <b>Throws</b>: If the hasher functor throws.
void rehash(const bucket_traits &new_bucket_traits)
{ table_.rehash(new_bucket_traits); }
//! <b>Requires</b>:
//!
- //! <b>Effects</b>:
- //!
- //! <b>Complexity</b>:
- //!
+ //! <b>Effects</b>:
+ //!
+ //! <b>Complexity</b>:
+ //!
//! <b>Throws</b>:
//!
//! <b>Note</b>: this method is only available if incremental<true> option is activated.
@@ -1980,22 +1980,22 @@ class unordered_multiset_impl
//! <b>Requires</b>:
//!
- //! <b>Effects</b>:
- //!
- //! <b>Complexity</b>:
- //!
- //! <b>Throws</b>:
+ //! <b>Effects</b>:
+ //!
+ //! <b>Complexity</b>:
+ //!
+ //! <b>Throws</b>:
size_type split_count() const
{ return table_.split_count(); }
//! <b>Effects</b>: Returns the nearest new bucket count optimized for
//! the container that is bigger than n. This suggestion can be used
//! to create bucket arrays with a size that will usually improve
- //! container's performance. If such value does not exist, the
+ //! container's performance. If such value does not exist, the
//! higher possible value is returned.
- //!
+ //!
//! <b>Complexity</b>: Amortized constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static size_type suggested_upper_bucket_count(size_type n)
{ return table_type::suggested_upper_bucket_count(n); }
@@ -2003,11 +2003,11 @@ class unordered_multiset_impl
//! <b>Effects</b>: Returns the nearest new bucket count optimized for
//! the container that is smaller than n. This suggestion can be used
//! to create bucket arrays with a size that will usually improve
- //! container's performance. If such value does not exist, the
+ //! container's performance. If such value does not exist, the
//! lower possible value is returned.
- //!
+ //!
//! <b>Complexity</b>: Amortized constant time.
- //!
+ //!
//! <b>Throws</b>: Nothing.
static size_type suggested_lower_bucket_count(size_type n)
{ return table_type::suggested_lower_bucket_count(n); }
@@ -2030,7 +2030,7 @@ struct make_unordered_multiset
/// @cond
typedef unordered_multiset_impl
< typename make_hashtable_opt
- <T, false,
+ <T, false,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4, O5, O6, O7, O8, O9, O10
#else
@@ -2050,7 +2050,7 @@ template<class T, class O1, class O2, class O3, class O4, class O5, class O6, cl
template<class T, class ...Options>
#endif
class unordered_multiset
- : public make_unordered_multiset<T,
+ : public make_unordered_multiset<T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4, O5, O6, O7, O8, O9, O10
#else
@@ -2059,7 +2059,7 @@ class unordered_multiset
>::type
{
typedef typename make_unordered_multiset
- <T,
+ <T,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4, O5, O6, O7, O8, O9, O10
#else
@@ -2083,7 +2083,7 @@ class unordered_multiset
unordered_multiset( const bucket_traits &b_traits
, const hasher & hash_func = hasher()
, const key_equal &equal_func = key_equal()
- , const value_traits &v_traits = value_traits())
+ , const value_traits &v_traits = value_traits())
: Base(b_traits, hash_func, equal_func, v_traits)
{}
@@ -2093,7 +2093,7 @@ class unordered_multiset
, const bucket_traits &b_traits
, const hasher & hash_func = hasher()
, const key_equal &equal_func = key_equal()
- , const value_traits &v_traits = value_traits())
+ , const value_traits &v_traits = value_traits())
: Base(b, e, b_traits, hash_func, equal_func, v_traits)
{}
@@ -2107,8 +2107,8 @@ class unordered_multiset
#endif
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/intrusive/unordered_set_hook.hpp b/boost/intrusive/unordered_set_hook.hpp
index 2912d32be7..c7e95b222c 100644
--- a/boost/intrusive/unordered_set_hook.hpp
+++ b/boost/intrusive/unordered_set_hook.hpp
@@ -1,7 +1,7 @@
/////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -95,10 +95,10 @@ struct unordered_node_traits
{ n->prev_in_group_ = prev; }
static std::size_t get_hash(const const_node_ptr & n)
- { return n->hash_; }
+ { return n->hash_; }
static void set_hash(const node_ptr & n, std::size_t h)
- { n->hash_ = h; }
+ { n->hash_ = h; }
};
template<class NodeTraits>
@@ -147,12 +147,12 @@ struct get_uset_node_algo
{
typedef typename detail::if_c
< (StoreHash || OptimizeMultiKey)
- , unordered_node_traits<VoidPointer, StoreHash, OptimizeMultiKey>
- , slist_node_traits<VoidPointer>
+ , unordered_node_traits<VoidPointer, StoreHash, OptimizeMultiKey>
+ , slist_node_traits<VoidPointer>
>::type node_traits_type;
typedef typename detail::if_c
< OptimizeMultiKey
- , unordered_algorithms<node_traits_type>
+ , unordered_algorithms<node_traits_type>
, circular_slist_algorithms<node_traits_type>
>::type type;
};
@@ -169,7 +169,7 @@ struct make_unordered_set_base_hook
{
/// @cond
typedef typename pack_options
- < hook_defaults,
+ < hook_defaults,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -190,16 +190,16 @@ struct make_unordered_set_base_hook
typedef implementation_defined type;
};
-//! Derive a class from unordered_set_base_hook in order to store objects in
-//! in an unordered_set/unordered_multi_set. unordered_set_base_hook holds the data necessary to maintain
+//! Derive a class from unordered_set_base_hook in order to store objects in
+//! in an unordered_set/unordered_multi_set. unordered_set_base_hook holds the data necessary to maintain
//! the unordered_set/unordered_multi_set and provides an appropriate value_traits class for unordered_set/unordered_multi_set.
-//!
+//!
//! The hook admits the following options: \c tag<>, \c void_pointer<>,
//! \c link_mode<>, \c store_hash<> and \c optimize_multikey<>.
//!
-//! \c tag<> defines a tag to identify the node.
-//! The same tag value can be used in different classes, but if a class is
-//! derived from more than one \c list_base_hook, then each \c list_base_hook needs its
+//! \c tag<> defines a tag to identify the node.
+//! The same tag value can be used in different classes, but if a class is
+//! derived from more than one \c list_base_hook, then each \c list_base_hook needs its
//! unique tag.
//!
//! \c void_pointer<> is the pointer type that will be used internally in the hook
@@ -232,27 +232,27 @@ class unordered_set_base_hook
public:
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
unordered_set_base_hook();
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state. The argument is ignored.
- //!
- //! <b>Throws</b>: Nothing.
- //!
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
//! <b>Rationale</b>: Providing a copy-constructor
- //! makes classes using the hook STL-compliant without forcing the
+ //! makes classes using the hook STL-compliant without forcing the
//! user to do some additional work. \c swap can be used to emulate
//! move-semantics.
unordered_set_base_hook(const unordered_set_base_hook& );
//! <b>Effects</b>: Empty function. The argument is ignored.
- //!
- //! <b>Throws</b>: Nothing.
- //!
- //! <b>Rationale</b>: Providing an assignment operator
- //! makes classes using the hook STL-compliant without forcing the
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing an assignment operator
+ //! makes classes using the hook STL-compliant without forcing the
//! user to do some additional work. \c swap can be used to emulate
//! move-semantics.
unordered_set_base_hook& operator=(const unordered_set_base_hook& );
@@ -261,37 +261,37 @@ class unordered_set_base_hook
//! nothing (ie. no code is generated). If link_mode is \c safe_link and the
//! object is stored in an unordered_set an assertion is raised. If link_mode is
//! \c auto_unlink and \c is_linked() is true, the node is unlinked.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
~unordered_set_base_hook();
- //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
- //! related to those nodes in one or two containers. That is, if the node
- //! this is part of the element e1, the node x is part of the element e2
- //! and both elements are included in the containers s1 and s2, then after
- //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
- //! at the position of e1. If one element is not in a container, then
- //! after the swap-operation the other element is not in a container.
- //! Iterators to e1 and e2 related to those nodes are invalidated.
+ //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
+ //! related to those nodes in one or two containers. That is, if the node
+ //! this is part of the element e1, the node x is part of the element e2
+ //! and both elements are included in the containers s1 and s2, then after
+ //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
+ //! at the position of e1. If one element is not in a container, then
+ //! after the swap-operation the other element is not in a container.
+ //! Iterators to e1 and e2 related to those nodes are invalidated.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Constant
//!
- //! <b>Throws</b>: Nothing.
+ //! <b>Throws</b>: Nothing.
void swap_nodes(unordered_set_base_hook &other);
//! <b>Precondition</b>: link_mode must be \c safe_link or \c auto_unlink.
//!
//! <b>Returns</b>: true, if the node belongs to a container, false
- //! otherwise. This function can be used to test whether \c unordered_set::iterator_to
- //! will return a valid iterator.
+ //! otherwise. This function can be used to test whether \c unordered_set::iterator_to
+ //! will return a valid iterator.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Constant
bool is_linked() const;
//! <b>Effects</b>: Removes the node if it's inserted in a container.
//! This function is only allowed if link_mode is \c auto_unlink.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
void unlink();
#endif
};
@@ -308,7 +308,7 @@ struct make_unordered_set_member_hook
{
/// @cond
typedef typename pack_options
- < hook_defaults,
+ < hook_defaults,
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
O1, O2, O3, O4
#else
@@ -332,7 +332,7 @@ struct make_unordered_set_member_hook
//! Put a public data member unordered_set_member_hook in order to store objects of this class in
//! an unordered_set/unordered_multi_set. unordered_set_member_hook holds the data necessary for maintaining the
//! unordered_set/unordered_multi_set and provides an appropriate value_traits class for unordered_set/unordered_multi_set.
-//!
+//!
//! The hook admits the following options: \c void_pointer<>,
//! \c link_mode<> and \c store_hash<>.
//!
@@ -362,27 +362,27 @@ class unordered_set_member_hook
public:
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
unordered_set_member_hook();
//! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
//! initializes the node to an unlinked state. The argument is ignored.
- //!
- //! <b>Throws</b>: Nothing.
- //!
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
//! <b>Rationale</b>: Providing a copy-constructor
- //! makes classes using the hook STL-compliant without forcing the
+ //! makes classes using the hook STL-compliant without forcing the
//! user to do some additional work. \c swap can be used to emulate
//! move-semantics.
unordered_set_member_hook(const unordered_set_member_hook& );
//! <b>Effects</b>: Empty function. The argument is ignored.
- //!
- //! <b>Throws</b>: Nothing.
- //!
- //! <b>Rationale</b>: Providing an assignment operator
- //! makes classes using the hook STL-compliant without forcing the
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing an assignment operator
+ //! makes classes using the hook STL-compliant without forcing the
//! user to do some additional work. \c swap can be used to emulate
//! move-semantics.
unordered_set_member_hook& operator=(const unordered_set_member_hook& );
@@ -391,43 +391,43 @@ class unordered_set_member_hook
//! nothing (ie. no code is generated). If link_mode is \c safe_link and the
//! object is stored in an unordered_set an assertion is raised. If link_mode is
//! \c auto_unlink and \c is_linked() is true, the node is unlinked.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
~unordered_set_member_hook();
- //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
- //! related to those nodes in one or two containers. That is, if the node
- //! this is part of the element e1, the node x is part of the element e2
- //! and both elements are included in the containers s1 and s2, then after
- //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
- //! at the position of e1. If one element is not in a container, then
- //! after the swap-operation the other element is not in a container.
- //! Iterators to e1 and e2 related to those nodes are invalidated.
+ //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
+ //! related to those nodes in one or two containers. That is, if the node
+ //! this is part of the element e1, the node x is part of the element e2
+ //! and both elements are included in the containers s1 and s2, then after
+ //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
+ //! at the position of e1. If one element is not in a container, then
+ //! after the swap-operation the other element is not in a container.
+ //! Iterators to e1 and e2 related to those nodes are invalidated.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Constant
//!
- //! <b>Throws</b>: Nothing.
+ //! <b>Throws</b>: Nothing.
void swap_nodes(unordered_set_member_hook &other);
//! <b>Precondition</b>: link_mode must be \c safe_link or \c auto_unlink.
//!
//! <b>Returns</b>: true, if the node belongs to a container, false
- //! otherwise. This function can be used to test whether \c unordered_set::iterator_to
- //! will return a valid iterator.
+ //! otherwise. This function can be used to test whether \c unordered_set::iterator_to
+ //! will return a valid iterator.
//!
- //! <b>Complexity</b>: Constant
+ //! <b>Complexity</b>: Constant
bool is_linked() const;
//! <b>Effects</b>: Removes the node if it's inserted in a container.
//! This function is only allowed if link_mode is \c auto_unlink.
- //!
- //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
void unlink();
#endif
};
-} //namespace intrusive
-} //namespace boost
+} //namespace intrusive
+} //namespace boost
#include <boost/intrusive/detail/config_end.hpp>
diff --git a/boost/iostreams/chain.hpp b/boost/iostreams/chain.hpp
index cea24beb86..4af8cc985c 100644
--- a/boost/iostreams/chain.hpp
+++ b/boost/iostreams/chain.hpp
@@ -84,7 +84,7 @@ template<typename Chain> class chain_client;
//
// Concept name: Chain.
// Description: Represents a chain of stream buffers which provides access
-// to the first buffer in the chain and send notifications when the
+// to the first buffer in the chain and sends notifications when the
// streambufs are added to or removed from chain.
// Refines: Closable device with mode equal to typename Chain::mode.
// Models: chain, converting_chain.
diff --git a/boost/iostreams/close.hpp b/boost/iostreams/close.hpp
index 3bb63e76e5..d0d186ecac 100644
--- a/boost/iostreams/close.hpp
+++ b/boost/iostreams/close.hpp
@@ -73,7 +73,7 @@ void close_all(T& t, Sink& snk)
boost::iostreams::close(t, snk, BOOST_IOS::out);
}
-} // End namespaces detail.
+} // End namespace detail.
} } // End namespaces iostreams, boost.
diff --git a/boost/iostreams/combine.hpp b/boost/iostreams/combine.hpp
index 250de2a65b..c404663031 100644
--- a/boost/iostreams/combine.hpp
+++ b/boost/iostreams/combine.hpp
@@ -37,7 +37,7 @@ namespace detail {
//
// Template name: combined_device.
// Description: Model of Device defined in terms of a Source/Sink pair.
-// Template paramters:
+// Template parameters:
// Source - A model of Source, with the same char_type and traits_type
// as Sink.
// Sink - A model of Sink, with the same char_type and traits_type
@@ -77,7 +77,7 @@ private:
//
// Template name: combined_filter.
// Description: Model of Device defined in terms of a Source/Sink pair.
-// Template paramters:
+// Template parameters:
// InputFilter - A model of InputFilter, with the same char_type as
// OutputFilter.
// OutputFilter - A model of OutputFilter, with the same char_type as
@@ -179,9 +179,9 @@ struct combine_traits {
//
// Template name: combine.
// Description: Takes a Source/Sink pair or InputFilter/OutputFilter pair and
-// returns a Reource or Filter which performs input using the first member
+// returns a Source or Filter which performs input using the first member
// of the pair and output using the second member of the pair.
-// Template paramters:
+// Template parameters:
// In - A model of Source or InputFilter, with the same char_type as Out.
// Out - A model of Sink or OutputFilter, with the same char_type as In.
//
diff --git a/boost/iostreams/compose.hpp b/boost/iostreams/compose.hpp
index 5bc5702ea9..dfc3df6658 100644
--- a/boost/iostreams/compose.hpp
+++ b/boost/iostreams/compose.hpp
@@ -55,7 +55,7 @@ struct composite_mode
//
// Template name: composite_device.
// Description: Provides a Device view of a Filter, Device pair.
-// Template paramters:
+// Template parameters:
// Filter - A model of Filter.
// Device - An indirect model of Device.
//
@@ -115,7 +115,7 @@ private:
//
// Template name: composite_device.
// Description: Provides a Device view of a Filter, Device pair.
-// Template paramters:
+// Template parameters:
// Filter - A model of Filter.
// Device - An indirect model of Device.
//
diff --git a/boost/iostreams/detail/adapter/range_adapter.hpp b/boost/iostreams/detail/adapter/range_adapter.hpp
index 1eb65c3bc3..4086d31867 100644
--- a/boost/iostreams/detail/adapter/range_adapter.hpp
+++ b/boost/iostreams/detail/adapter/range_adapter.hpp
@@ -36,7 +36,7 @@ template<typename Traversal> struct range_adapter_impl;
//
// Template name: range_adapter
// Description: Device based on an instance of boost::iterator_range.
-// Template paramters:
+// Template parameters:
// Mode - A mode tag.
// Range - An instance of iterator_range.
//
diff --git a/boost/iostreams/detail/buffer.hpp b/boost/iostreams/detail/buffer.hpp
index c830ae5bf7..1168289d91 100644
--- a/boost/iostreams/detail/buffer.hpp
+++ b/boost/iostreams/detail/buffer.hpp
@@ -30,7 +30,7 @@ namespace boost { namespace iostreams { namespace detail {
//
// Template name: buffer
// Description: Character buffer.
-// Template paramters:
+// Template parameters:
// Ch - The character type.
// Alloc - The Allocator type.
//
@@ -69,7 +69,7 @@ void swap(basic_buffer<Ch, Alloc>& lhs, basic_buffer<Ch, Alloc>& rhs)
// Template name: buffer
// Description: Character buffer with two pointers accessible via ptr() and
// eptr().
-// Template paramters:
+// Template parameters:
// Ch - A character type.
//
template< typename Ch,
diff --git a/boost/iostreams/detail/restrict_impl.hpp b/boost/iostreams/detail/restrict_impl.hpp
index 3175bf1f2a..aab9411462 100644
--- a/boost/iostreams/detail/restrict_impl.hpp
+++ b/boost/iostreams/detail/restrict_impl.hpp
@@ -56,7 +56,7 @@ namespace detail {
//
// Template name: restricted_indirect_device.
// Description: Provides an restricted view of an indirect Device.
-// Template paramters:
+// Template parameters:
// Device - An indirect model of Device that models either Source or
// SeekableDevice.
//
@@ -88,7 +88,7 @@ private:
//
// Template name: restricted_direct_device.
// Description: Provides an restricted view of a Direct Device.
-// Template paramters:
+// Template parameters:
// Device - A model of Direct and Device.
//
template<typename Device>
@@ -118,7 +118,7 @@ private:
//
// Template name: restricted_filter.
// Description: Provides an restricted view of a Filter.
-// Template paramters:
+// Template parameters:
// Filter - An indirect model of Filter.
//
template<typename Filter>
diff --git a/boost/iostreams/detail/streambuf/chainbuf.hpp b/boost/iostreams/detail/streambuf/chainbuf.hpp
index 9481c3a9d8..4e14383843 100644
--- a/boost/iostreams/detail/streambuf/chainbuf.hpp
+++ b/boost/iostreams/detail/streambuf/chainbuf.hpp
@@ -31,7 +31,7 @@ namespace boost { namespace iostreams { namespace detail {
// Template name: chainbuf.
// Description: Stream buffer which operates by delegating to the first
// linked_streambuf in a chain.
-// Template paramters:
+// Template parameters:
// Chain - The chain type.
//
template<typename Chain, typename Mode, typename Access>
diff --git a/boost/iostreams/filter/aggregate.hpp b/boost/iostreams/filter/aggregate.hpp
index d37e734507..d578582e6e 100644
--- a/boost/iostreams/filter/aggregate.hpp
+++ b/boost/iostreams/filter/aggregate.hpp
@@ -33,7 +33,7 @@ namespace boost { namespace iostreams {
//
// Template name: aggregate_filter.
-// Template paramters:
+// Template parameters:
// Ch - The character type.
// Alloc - The allocator type.
// Description: Utility for defining DualUseFilters which filter an
diff --git a/boost/iostreams/filter/counter.hpp b/boost/iostreams/filter/counter.hpp
index e47cba9417..646d2875a1 100644
--- a/boost/iostreams/filter/counter.hpp
+++ b/boost/iostreams/filter/counter.hpp
@@ -25,7 +25,7 @@ namespace boost { namespace iostreams {
//
// Template name: basic_counter.
-// Template paramters:
+// Template parameters:
// Ch - The character type.
// Description: Filter which counts lines and characters.
//
diff --git a/boost/iostreams/filter/line.hpp b/boost/iostreams/filter/line.hpp
index 9cdf7f7ee2..3597ef7898 100644
--- a/boost/iostreams/filter/line.hpp
+++ b/boost/iostreams/filter/line.hpp
@@ -31,7 +31,7 @@ namespace boost { namespace iostreams {
//
// Template name: line_filter.
-// Template paramters:
+// Template parameters:
// Ch - The character type.
// Alloc - The allocator type.
// Description: Filter which processes data one line at a time.
diff --git a/boost/iostreams/invert.hpp b/boost/iostreams/invert.hpp
index d88bf4c2ca..82e6a4b437 100644
--- a/boost/iostreams/invert.hpp
+++ b/boost/iostreams/invert.hpp
@@ -36,7 +36,7 @@ namespace boost { namespace iostreams {
//
// Template name: inverse.
-// Template paramters:
+// Template parameters:
// Filter - A model of InputFilter or OutputFilter.
// Description: Generates an InputFilter from an OutputFilter or
// vice versa.
@@ -151,7 +151,7 @@ private:
//
// Template name: invert.
-// Template paramters:
+// Template parameters:
// Filter - A model of InputFilter or OutputFilter.
// Description: Returns an instance of an appropriate specialization of inverse.
//
diff --git a/boost/iostreams/stream.hpp b/boost/iostreams/stream.hpp
index ac9f22547a..25f6a7d81d 100644
--- a/boost/iostreams/stream.hpp
+++ b/boost/iostreams/stream.hpp
@@ -31,7 +31,7 @@ struct stream_traits {
typedef Tr traits_type;
typedef typename category_of<Device>::type mode;
typedef typename
- iostreams::select< // Dismbiguation required for Tru64.
+ iostreams::select< // Disambiguation required for Tru64.
mpl::and_<
is_convertible<mode, input>,
is_convertible<mode, output>
@@ -43,7 +43,7 @@ struct stream_traits {
BOOST_IOSTREAMS_BASIC_OSTREAM(char_type, traits_type)
>::type stream_type;
typedef typename
- iostreams::select< // Dismbiguation required for Tru64.
+ iostreams::select< // Disambiguation required for Tru64.
mpl::and_<
is_convertible<mode, input>,
is_convertible<mode, output>
@@ -57,7 +57,7 @@ struct stream_traits {
};
// By encapsulating initialization in a base, we can define the macro
-// BOOST_IOSTREAMS_DEFINE_FORWARDING_FUNCTIONS to generate constuctors
+// BOOST_IOSTREAMS_DEFINE_FORWARDING_FUNCTIONS to generate constructors
// without base member initializer lists.
template< typename Device,
typename Tr =
@@ -96,7 +96,7 @@ namespace boost { namespace iostreams {
// Template name: stream.
// Description: A iostream which reads from and writes to an instance of a
// designated device type.
-// Template paramters:
+// Template parameters:
// Device - A device type.
// Alloc - The allocator type.
//
diff --git a/boost/iostreams/tee.hpp b/boost/iostreams/tee.hpp
index bcb60a862a..57a32ccd02 100644
--- a/boost/iostreams/tee.hpp
+++ b/boost/iostreams/tee.hpp
@@ -31,7 +31,7 @@ namespace boost { namespace iostreams {
//
// Template name: tee_filter.
-// Template paramters:
+// Template parameters:
// Device - A blocking Sink.
//
template<typename Device>
@@ -99,7 +99,7 @@ BOOST_IOSTREAMS_PIPABLE(tee_filter, 1)
//
// Template name: tee_device.
-// Template paramters:
+// Template parameters:
// Device - A blocking Device.
// Sink - A blocking Sink.
//
diff --git a/boost/iterator/iterator_facade.hpp b/boost/iterator/iterator_facade.hpp
index 5ee73b5aa4..1ca09028be 100644
--- a/boost/iterator/iterator_facade.hpp
+++ b/boost/iterator/iterator_facade.hpp
@@ -14,8 +14,8 @@
#include <boost/iterator/detail/facade_iterator_category.hpp>
#include <boost/iterator/detail/enable_if.hpp>
-#include <boost/implicit_cast.hpp>
#include <boost/static_assert.hpp>
+#include <boost/utility/addressof.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/add_const.hpp>
@@ -294,46 +294,43 @@ namespace boost
// operator->() needs special support for input iterators to strictly meet the
// standard's requirements. If *i is not a reference type, we must still
- // produce a lvalue to which a pointer can be formed. We do that by
- // returning an instantiation of this special proxy class template.
- template <class T>
- struct operator_arrow_proxy
+ // produce a lvalue to which a pointer can be formed. We do that by
+ // returning a proxy object containing an instance of the reference object.
+ template <class Reference, class Pointer>
+ struct operator_arrow_dispatch // proxy references
{
- operator_arrow_proxy(T const* px) : m_value(*px) {}
- T* operator->() const { return &m_value; }
- // This function is needed for MWCW and BCC, which won't call operator->
- // again automatically per 13.3.1.2 para 8
- operator T*() const { return &m_value; }
- mutable T m_value;
+ struct proxy
+ {
+ explicit proxy(Reference const & x) : m_ref(x) {}
+ Reference* operator->() { return boost::addressof(m_ref); }
+ // This function is needed for MWCW and BCC, which won't call
+ // operator-> again automatically per 13.3.1.2 para 8
+ operator Reference*() { return boost::addressof(m_ref); }
+ Reference m_ref;
+ };
+ typedef proxy result_type;
+ static result_type apply(Reference const & x)
+ {
+ return result_type(x);
+ }
};
- // A metafunction that gets the result type for operator->. Also
- // has a static function make() which builds the result from a
- // Reference
- template <class ValueType, class Reference, class Pointer>
- struct operator_arrow_result
+ template <class T, class Pointer>
+ struct operator_arrow_dispatch<T&, Pointer> // "real" references
{
- // CWPro8.3 won't accept "operator_arrow_result::type", and we
- // need that type below, so metafunction forwarding would be a
- // losing proposition here.
- typedef typename mpl::if_<
- is_reference<Reference>
- , Pointer
- , operator_arrow_proxy<ValueType>
- >::type type;
-
- static type make(Reference x)
+ typedef Pointer result_type;
+ static result_type apply(T& x)
{
- return boost::implicit_cast<type>(&x);
+ return boost::addressof(x);
}
};
# if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
// Deal with ETI
template<>
- struct operator_arrow_result<int, int, int>
+ struct operator_arrow_dispatch<int, int>
{
- typedef int type;
+ typedef int result_type;
};
# endif
@@ -618,11 +615,10 @@ namespace boost
Value, CategoryOrTraversal, Reference, Difference
> associated_types;
- typedef boost::detail::operator_arrow_result<
- typename associated_types::value_type
- , Reference
+ typedef boost::detail::operator_arrow_dispatch<
+ Reference
, typename associated_types::pointer
- > pointer_;
+ > operator_arrow_dispatch_;
protected:
// For use by derived classes
@@ -634,7 +630,7 @@ namespace boost
typedef Reference reference;
typedef Difference difference_type;
- typedef typename pointer_::type pointer;
+ typedef typename operator_arrow_dispatch_::result_type pointer;
typedef typename associated_types::iterator_category iterator_category;
@@ -645,7 +641,7 @@ namespace boost
pointer operator->() const
{
- return pointer_::make(*this->derived());
+ return operator_arrow_dispatch_::apply(*this->derived());
}
typename boost::detail::operator_brackets_result<Derived,Value,reference>::type
diff --git a/boost/iterator/transform_iterator.hpp b/boost/iterator/transform_iterator.hpp
index 86565b8365..b79a440c3a 100644
--- a/boost/iterator/transform_iterator.hpp
+++ b/boost/iterator/transform_iterator.hpp
@@ -46,7 +46,7 @@ namespace boost
// the function.
typedef typename ia_dflt_help<
Reference
- , result_of<UnaryFunc(typename std::iterator_traits<Iterator>::reference)>
+ , result_of<const UnaryFunc(typename std::iterator_traits<Iterator>::reference)>
>::type reference;
// To get the default for Value: remove any reference on the
diff --git a/boost/lexical_cast.hpp b/boost/lexical_cast.hpp
index 5a3d4f072a..acfc3e85f0 100644
--- a/boost/lexical_cast.hpp
+++ b/boost/lexical_cast.hpp
@@ -26,58 +26,22 @@
#define BOOST_LCAST_NO_WCHAR_T
#endif
-#if (defined(__MINGW32__) || defined(__MINGW64__)) && (__GNUC__ == 4) \
- && ((__GNUC_MINOR__ == 4) || (__GNUC_MINOR__ == 5)) && defined(__STRICT_ANSI__) \
- && !defined(BOOST_LCAST_NO_WCHAR_T)
-
-// workaround for a mingw bug
-// http://sourceforge.net/tracker/index.php?func=detail&aid=2373234&group_id=2435&atid=102435
-#include <_mingw.h>
-#if (__GNUC_MINOR__ == 4)
-extern "C" {
-_CRTIMP int __cdecl swprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ , ...);
-_CRTIMP int __cdecl vswprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ , ...);
-}
-#endif
-#if (__GNUC_MINOR__ == 5)
-extern "C" {
-_CRTIMP int __cdecl swprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ , ...);
-_CRTIMP int __cdecl vswprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ , va_list);
-}
-#endif
-#endif
-
#include <climits>
#include <cstddef>
-#include <istream>
#include <string>
#include <cstring>
#include <cstdio>
#include <typeinfo>
#include <exception>
-#include <cmath>
#include <boost/limits.hpp>
#include <boost/mpl/if.hpp>
#include <boost/throw_exception.hpp>
-#include <boost/type_traits/is_pointer.hpp>
-#include <boost/type_traits/is_integral.hpp>
-#include <boost/type_traits/is_arithmetic.hpp>
-#include <boost/type_traits/remove_pointer.hpp>
-#include <boost/numeric/conversion/cast.hpp>
#include <boost/type_traits/ice.hpp>
-#include <boost/type_traits/make_unsigned.hpp>
-#include <boost/type_traits/is_signed.hpp>
-#include <boost/math/special_functions/sign.hpp>
-#include <boost/math/special_functions/fpclassify.hpp>
+#include <boost/type_traits/is_pointer.hpp>
#include <boost/static_assert.hpp>
#include <boost/detail/lcast_precision.hpp>
#include <boost/detail/workaround.hpp>
-#if !defined(__SUNPRO_CC)
-#include <boost/container/container_fwd.hpp>
-#endif // !defined(__SUNPRO_CC)
-#ifndef BOOST_NO_CWCHAR
-# include <cwchar>
-#endif
+
#ifndef BOOST_NO_STD_LOCALE
# include <locale>
@@ -104,7 +68,7 @@ _CRTIMP int __cdecl vswprintf(wchar_t * __restrict__ , const wchar_t * __restric
namespace boost
{
// exception used to indicate runtime lexical_cast failure
- class bad_lexical_cast :
+ class BOOST_SYMBOL_VISIBLE bad_lexical_cast :
// workaround MSVC bug with std::bad_cast when _HAS_EXCEPTIONS == 0
#if defined(BOOST_MSVC) && defined(_HAS_EXCEPTIONS) && !_HAS_EXCEPTIONS
public std::exception
@@ -157,118 +121,201 @@ namespace boost
const std::type_info *target;
};
- namespace detail // selectors for choosing stream character type
- {
- template<typename Type>
- struct stream_char
+ namespace detail // widest_char
{
- typedef char type;
- };
+ template <typename TargetChar, typename SourceChar>
+ struct widest_char
+ {
+ typedef BOOST_DEDUCED_TYPENAME boost::mpl::if_c<
+ (sizeof(TargetChar) > sizeof(SourceChar))
+ , TargetChar
+ , SourceChar >::type type;
+ };
+ }
+} // namespace boost
-#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
- template<class CharT, class Traits, class Alloc>
- struct stream_char< std::basic_string<CharT,Traits,Alloc> >
- {
- typedef CharT type;
- };
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(__SUNPRO_CC) && !defined(__PGIC__)
-#if !defined(__SUNPRO_CC)
- template<class CharT, class Traits, class Alloc>
- struct stream_char< ::boost::container::basic_string<CharT,Traits,Alloc> >
- {
- typedef CharT type;
- };
-#endif // !defined(__SUNPRO_CC)
+#include <cmath>
+#include <istream>
+
+#if !defined(BOOST_NO_CXX11_HDR_ARRAY) && defined(BOOST_HAS_TR1_ARRAY)
+#include <array>
#endif
-#ifndef BOOST_LCAST_NO_WCHAR_T
-#ifndef BOOST_NO_INTRINSIC_WCHAR_T
- template<>
- struct stream_char<wchar_t>
- {
- typedef wchar_t type;
- };
+#include <boost/array.hpp>
+#include <boost/numeric/conversion/cast.hpp>
+#include <boost/type_traits/make_unsigned.hpp>
+#include <boost/type_traits/is_signed.hpp>
+#include <boost/type_traits/is_integral.hpp>
+#include <boost/type_traits/is_arithmetic.hpp>
+#include <boost/type_traits/remove_pointer.hpp>
+#include <boost/math/special_functions/sign.hpp>
+#include <boost/math/special_functions/fpclassify.hpp>
+#include <boost/range/iterator_range_core.hpp>
+#include <boost/container/container_fwd.hpp>
+#ifndef BOOST_NO_CWCHAR
+# include <cwchar>
#endif
- template<>
- struct stream_char<wchar_t *>
+namespace boost {
+ namespace detail // widest_char<...> (continuation)
{
- typedef wchar_t type;
- };
+ struct not_a_character_type{};
- template<>
- struct stream_char<const wchar_t *>
- {
- typedef wchar_t type;
- };
+ template <typename CharT>
+ struct widest_char<not_a_character_type, CharT >
+ {
+ typedef CharT type;
+ };
-#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
- template<>
- struct stream_char<std::wstring>
+ template <typename CharT>
+ struct widest_char< CharT, not_a_character_type >
+ {
+ typedef CharT type;
+ };
+
+ template <>
+ struct widest_char< not_a_character_type, not_a_character_type >
+ {
+ typedef char type;
+ };
+ }
+
+ namespace detail // is_char_or_wchar<...> and stream_char<...> templates
{
- typedef wchar_t type;
- };
-#endif
-#endif
+ // returns true, if T is one of the character types
+ template <typename T>
+ struct is_char_or_wchar
+ {
+ typedef ::boost::type_traits::ice_or<
+ ::boost::is_same< T, char >::value,
+ #ifndef BOOST_LCAST_NO_WCHAR_T
+ ::boost::is_same< T, wchar_t >::value,
+ #endif
+ #ifndef BOOST_NO_CHAR16_T
+ ::boost::is_same< T, char16_t >::value,
+ #endif
+ #ifndef BOOST_NO_CHAR32_T
+ ::boost::is_same< T, char32_t >::value,
+ #endif
+ ::boost::is_same< T, unsigned char >::value,
+ ::boost::is_same< T, signed char >::value
+ > result_type;
+
+ BOOST_STATIC_CONSTANT(bool, value = (result_type::value) );
+ };
+ // selectors for choosing stream character type
+ // returns one of char, wchar_t, char16_t, char32_t or not_a_character_type types
+ template <typename Type>
+ struct stream_char
+ {
+ typedef BOOST_DEDUCED_TYPENAME boost::mpl::if_c<
+ is_char_or_wchar<Type >::value,
+ Type,
+ boost::detail::not_a_character_type
+ >::type type;
+ };
-#ifndef BOOST_NO_CHAR16_T
+ template <>
+ struct stream_char<unsigned char>
+ {
+ typedef char type;
+ };
- template<>
- struct stream_char<char16_t>
- {
- typedef char16_t type;
- };
+ template <>
+ struct stream_char<signed char>
+ {
+ typedef char type;
+ };
- template<>
- struct stream_char<char16_t *>
- {
- typedef char16_t type;
- };
+ template <typename CharT>
+ struct stream_char<CharT*>
+ {
+ typedef BOOST_DEDUCED_TYPENAME stream_char<CharT>::type type;
+ };
- template<>
- struct stream_char<const char16_t *>
- {
- typedef char16_t type;
- };
+ template <typename CharT>
+ struct stream_char<const CharT*>
+ {
+ typedef BOOST_DEDUCED_TYPENAME stream_char<CharT>::type type;
+ };
-#endif
+ template <typename CharT>
+ struct stream_char<iterator_range<CharT*> >
+ {
+ typedef BOOST_DEDUCED_TYPENAME stream_char<CharT*>::type type;
+ };
+
+ template <typename CharT>
+ struct stream_char<iterator_range<const CharT*> >
+ {
+ typedef BOOST_DEDUCED_TYPENAME stream_char<const CharT*>::type type;
+ };
-#ifndef BOOST_NO_CHAR32_T
+ template <class CharT, class Traits, class Alloc>
+ struct stream_char< std::basic_string<CharT, Traits, Alloc> >
+ {
+ typedef CharT type;
+ };
- template<>
- struct stream_char<char32_t>
- {
- typedef char32_t type;
- };
+ template <class CharT, class Traits, class Alloc>
+ struct stream_char< ::boost::container::basic_string<CharT, Traits, Alloc> >
+ {
+ typedef CharT type;
+ };
- template<>
- struct stream_char<char32_t *>
- {
- typedef char32_t type;
- };
+ template<typename CharT, std::size_t N>
+ struct stream_char<boost::array<CharT, N> >
+ {
+ typedef BOOST_DEDUCED_TYPENAME stream_char<CharT>::type type;
+ };
- template<>
- struct stream_char<const char32_t *>
- {
- typedef char32_t type;
- };
+ template<typename CharT, std::size_t N>
+ struct stream_char<boost::array<const CharT, N> >
+ {
+ typedef BOOST_DEDUCED_TYPENAME stream_char<CharT>::type type;
+ };
-#endif
+#if !defined(BOOST_NO_CXX11_HDR_ARRAY) && defined(BOOST_HAS_TR1_ARRAY)
+ template <typename CharT, std::size_t N>
+ struct stream_char<std::array<CharT, N> >
+ {
+ typedef BOOST_DEDUCED_TYPENAME stream_char<CharT>::type type;
+ };
- template<typename TargetChar, typename SourceChar>
- struct widest_char
+ template <typename CharT, std::size_t N>
+ struct stream_char<std::array<const CharT, N> >
{
- typedef BOOST_DEDUCED_TYPENAME boost::mpl::if_c<
- (sizeof(TargetChar) > sizeof(SourceChar))
- , TargetChar
- , SourceChar >::type type;
+ typedef BOOST_DEDUCED_TYPENAME stream_char<CharT>::type type;
};
+#endif // !defined(BOOST_NO_CXX11_HDR_ARRAY) && defined(BOOST_HAS_TR1_ARRAY)
+
+#if !defined(BOOST_LCAST_NO_WCHAR_T) && defined(BOOST_NO_INTRINSIC_WCHAR_T)
+ template<>
+ struct stream_char<wchar_t>
+ {
+ typedef boost::detail::not_a_character_type type;
+ };
+
+ template<>
+ struct stream_char<wchar_t*>
+ {
+ typedef wchar_t type;
+ };
+
+ template<>
+ struct stream_char<const wchar_t*>
+ {
+ typedef wchar_t type;
+ };
+#endif
}
namespace detail // deduce_char_traits template
{
-#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
template<class CharT, class Target, class Source>
struct deduce_char_traits
{
@@ -293,7 +340,6 @@ namespace boost
typedef Traits type;
};
-#if !defined(__SUNPRO_CC)
template<class CharT, class Traits, class Alloc, class Source>
struct deduce_char_traits< CharT
, ::boost::container::basic_string<CharT,Traits,Alloc>
@@ -333,7 +379,7 @@ namespace boost
template<class CharT, class Traits, class Alloc1, class Alloc2>
struct deduce_char_traits< CharT
, ::boost::container::basic_string<CharT,Traits,Alloc1>
- , std::basic_string<CharT,Traits,Alloc2>
+ , ::std::basic_string<CharT,Traits,Alloc2>
>
{
typedef Traits type;
@@ -341,14 +387,12 @@ namespace boost
template<class CharT, class Traits, class Alloc1, class Alloc2>
struct deduce_char_traits< CharT
- , std::basic_string<CharT,Traits,Alloc1>
+ , ::std::basic_string<CharT,Traits,Alloc1>
, ::boost::container::basic_string<CharT,Traits,Alloc2>
>
{
typedef Traits type;
};
-#endif // !defined(__SUNPRO_CC)
-#endif
}
namespace detail // lcast_src_length
@@ -391,7 +435,7 @@ namespace boost
BOOST_STATIC_ASSERT(sizeof(Source) * CHAR_BIT <= 256);
#endif
};
-// TODO: FIX for char16_t, char32_t, we can ignore CharT
+
#define BOOST_LCAST_DEF(T) \
template<> struct lcast_src_length<T> \
: lcast_src_length_integral<T> \
@@ -488,7 +532,7 @@ namespace boost
};
#endif
-#ifndef BOOST_NO_CHAR16_T
+#if !defined(BOOST_NO_CHAR16_T) && !defined(BOOST_NO_UNICODE_LITERALS)
template<>
struct lcast_char_constants<char16_t>
{
@@ -501,7 +545,7 @@ namespace boost
};
#endif
-#ifndef BOOST_NO_CHAR32_T
+#if !defined(BOOST_NO_CHAR32_T) && !defined(BOOST_NO_UNICODE_LITERALS)
template<>
struct lcast_char_constants<char32_t>
{
@@ -732,6 +776,15 @@ namespace boost
namespace detail
{
+ template <class CharT>
+ bool lc_iequal(const CharT* val, const CharT* lcase, const CharT* ucase, unsigned int len) {
+ for( unsigned int i=0; i < len; ++i ) {
+ if ( val[i] != lcase[i] && val[i] != ucase[i] ) return false;
+ }
+
+ return true;
+ }
+
/* Returns true and sets the correct value if found NaN or Inf. */
template <class CharT, class T>
inline bool parse_inf_nan_impl(const CharT* begin, const CharT* end, T& value
@@ -755,7 +808,7 @@ namespace boost
else if( *begin == plus ) ++begin;
if( end-begin < 3 ) return false;
- if( !memcmp(begin, lc_nan, 3*sizeof(CharT)) || !memcmp(begin, lc_NAN, 3*sizeof(CharT)) )
+ if( lc_iequal(begin, lc_nan, lc_NAN, 3) )
{
begin += 3;
if (end != begin) /* It is 'nan(...)' or some bad input*/
@@ -772,13 +825,13 @@ namespace boost
if (( /* 'INF' or 'inf' */
end-begin==3
&&
- (!memcmp(begin, lc_infinity, 3*sizeof(CharT)) || !memcmp(begin, lc_INFINITY, 3*sizeof(CharT)))
+ lc_iequal(begin, lc_infinity, lc_INFINITY, 3)
)
||
( /* 'INFINITY' or 'infinity' */
end-begin==inifinity_size
&&
- (!memcmp(begin, lc_infinity, inifinity_size)|| !memcmp(begin, lc_INFINITY, inifinity_size))
+ lc_iequal(begin, lc_infinity, lc_INFINITY, inifinity_size)
)
)
{
@@ -790,6 +843,41 @@ namespace boost
return false;
}
+ template <class CharT, class T>
+ bool put_inf_nan_impl(CharT* begin, CharT*& end, const T& value
+ , const CharT* lc_nan
+ , const CharT* lc_infinity)
+ {
+ using namespace std;
+ const CharT minus = lcast_char_constants<CharT>::minus;
+ if ( (boost::math::isnan)(value) )
+ {
+ if ( (boost::math::signbit)(value) )
+ {
+ *begin = minus;
+ ++ begin;
+ }
+
+ memcpy(begin, lc_nan, 3 * sizeof(CharT));
+ end = begin + 3;
+ return true;
+ } else if ( (boost::math::isinf)(value) )
+ {
+ if ( (boost::math::signbit)(value) )
+ {
+ *begin = minus;
+ ++ begin;
+ }
+
+ memcpy(begin, lc_infinity, 3 * sizeof(CharT));
+ end = begin + 3;
+ return true;
+ }
+
+ return false;
+ }
+
+
#ifndef BOOST_LCAST_NO_WCHAR_T
template <class T>
bool parse_inf_nan(const wchar_t* begin, const wchar_t* end, T& value)
@@ -799,8 +887,15 @@ namespace boost
, L"INFINITY", L"infinity"
, L'(', L')');
}
+
+ template <class T>
+ bool put_inf_nan(wchar_t* begin, wchar_t*& end, const T& value)
+ {
+ return put_inf_nan_impl(begin, end, value, L"nan", L"infinity");
+ }
+
#endif
-#ifndef BOOST_NO_CHAR16_T
+#if !defined(BOOST_NO_CHAR16_T) && !defined(BOOST_NO_UNICODE_LITERALS)
template <class T>
bool parse_inf_nan(const char16_t* begin, const char16_t* end, T& value)
{
@@ -809,8 +904,14 @@ namespace boost
, u"INFINITY", u"infinity"
, u'(', u')');
}
+
+ template <class T>
+ bool put_inf_nan(char16_t* begin, char16_t*& end, const T& value)
+ {
+ return put_inf_nan_impl(begin, end, value, u"nan", u"infinity");
+ }
#endif
-#ifndef BOOST_NO_CHAR32_T
+#if !defined(BOOST_NO_CHAR32_T) && !defined(BOOST_NO_UNICODE_LITERALS)
template <class T>
bool parse_inf_nan(const char32_t* begin, const char32_t* end, T& value)
{
@@ -819,6 +920,12 @@ namespace boost
, U"INFINITY", U"infinity"
, U'(', U')');
}
+
+ template <class T>
+ bool put_inf_nan(char32_t* begin, char32_t*& end, const T& value)
+ {
+ return put_inf_nan_impl(begin, end, value, U"nan", U"infinity");
+ }
#endif
template <class CharT, class T>
@@ -829,73 +936,12 @@ namespace boost
, "INFINITY", "infinity"
, '(', ')');
}
-#ifndef BOOST_LCAST_NO_WCHAR_T
- template <class T>
- bool put_inf_nan(wchar_t* begin, wchar_t*& end, const T& value)
- {
- using namespace std;
- if ( (boost::math::isnan)(value) )
- {
- if ( (boost::math::signbit)(value) )
- {
- memcpy(begin,L"-nan", sizeof(L"-nan"));
- end = begin + 4;
- } else
- {
- memcpy(begin,L"nan", sizeof(L"nan"));
- end = begin + 3;
- }
- return true;
- } else if ( (boost::math::isinf)(value) )
- {
- if ( (boost::math::signbit)(value) )
- {
- memcpy(begin,L"-inf", sizeof(L"-inf"));
- end = begin + 4;
- } else
- {
- memcpy(begin,L"inf", sizeof(L"inf"));
- end = begin + 3;
- }
- return true;
- }
- return false;
- }
-#endif
template <class CharT, class T>
bool put_inf_nan(CharT* begin, CharT*& end, const T& value)
{
- using namespace std;
- if ( (boost::math::isnan)(value) )
- {
- if ( (boost::math::signbit)(value) )
- {
- memcpy(begin,"-nan", sizeof("-nan"));
- end = begin + 4;
- } else
- {
- memcpy(begin,"nan", sizeof("nan"));
- end = begin + 3;
- }
- return true;
- } else if ( (boost::math::isinf)(value) )
- {
- if ( (boost::math::signbit)(value) )
- {
- memcpy(begin,"-inf", sizeof("-inf"));
- end = begin + 4;
- } else
- {
- memcpy(begin,"inf", sizeof("inf"));
- end = begin + 3;
- }
- return true;
- }
-
- return false;
+ return put_inf_nan_impl(begin, end, value, "nan", "infinity");
}
-
}
@@ -951,7 +997,7 @@ namespace boost
CharT const capital_e = lcast_char_constants<CharT>::capital_e;
CharT const lowercase_e = lcast_char_constants<CharT>::lowercase_e;
- value = 0.0;
+ value = static_cast<T>(0);
if (parse_inf_nan(begin, end, value)) return true;
@@ -1042,9 +1088,10 @@ namespace boost
) return false;
#endif
- if(*begin == decimal_point){
+ if(*begin == decimal_point) {
++ begin;
found_decimal = true;
+ if (!found_number_before_exp && begin==end) return false;
continue;
}else {
if (!found_number_before_exp) return false;
@@ -1165,7 +1212,7 @@ namespace boost
namespace detail
{
- struct do_not_construct_stringbuffer_t{};
+ struct do_not_construct_out_stream_t{};
}
namespace detail // optimized stream wrapper
@@ -1177,25 +1224,27 @@ namespace boost
>
class lexical_stream_limited_src
{
- typedef stl_buf_unlocker<std::basic_streambuf<CharT, Traits>, CharT > local_streambuffer_t;
#if defined(BOOST_NO_STRINGSTREAM)
- typedef stl_buf_unlocker<std::strstream, CharT > local_stringbuffer_t;
+ typedef std::ostrstream out_stream_t;
+ typedef stl_buf_unlocker<std::strstreambuf, char> unlocked_but_t;
#elif defined(BOOST_NO_STD_LOCALE)
- typedef stl_buf_unlocker<std::stringstream, CharT > local_stringbuffer_t;
+ typedef std::ostringstream out_stream_t;
+ typedef stl_buf_unlocker<std::stringbuf, char> unlocked_but_t;
#else
- typedef stl_buf_unlocker<std::basic_stringbuf<CharT, Traits>, CharT > local_stringbuffer_t;
+ typedef std::basic_ostringstream<CharT, Traits> out_stream_t;
+ typedef stl_buf_unlocker<std::basic_stringbuf<CharT, Traits>, CharT> unlocked_but_t;
#endif
typedef BOOST_DEDUCED_TYPENAME ::boost::mpl::if_c<
RequiresStringbuffer,
- local_stringbuffer_t,
- do_not_construct_stringbuffer_t
- >::type deduced_stringbuffer_t;
+ out_stream_t,
+ do_not_construct_out_stream_t
+ >::type deduced_out_stream_t;
// A string representation of Source is written to [start, finish).
CharT* start;
CharT* finish;
- deduced_stringbuffer_t stringbuffer;
+ deduced_out_stream_t out_stream;
public:
lexical_stream_limited_src(CharT* sta, CharT* fin)
@@ -1221,7 +1270,7 @@ namespace boost
bool shl_char(T ch)
{
BOOST_STATIC_ASSERT_MSG(( sizeof(T) <= sizeof(CharT)) ,
- "boost::lexical_cast does not support conversions from whar_t to char types."
+ "boost::lexical_cast does not support conversions from wide character to char types."
"Use boost::locale instead" );
#ifndef BOOST_LEXICAL_CAST_ASSUME_C_LOCALE
std::locale loc;
@@ -1242,24 +1291,35 @@ namespace boost
return true;
}
-#ifndef BOOST_LCAST_NO_WCHAR_T
template <class T>
bool shl_char_array(T const* str)
{
BOOST_STATIC_ASSERT_MSG(( sizeof(T) <= sizeof(CharT)),
- "boost::lexical_cast does not support conversions from wchar_t to char types."
+ "boost::lexical_cast does not support conversions from wide characters to char types."
"Use boost::locale instead" );
return shl_input_streamable(str);
}
-#endif
+
+ bool shl_char_array_limited(CharT const* str, std::size_t max_size)
+ {
+ start = const_cast<CharT*>(str);
+ finish = std::find(start, start + max_size, static_cast<CharT>(0));
+ return true;
+ }
template<typename InputStreamable>
bool shl_input_streamable(InputStreamable& input)
{
- std::basic_ostream<CharT> stream(&stringbuffer);
- bool const result = !(stream << input).fail();
- start = stringbuffer.pbase();
- finish = stringbuffer.pptr();
+#if defined(BOOST_NO_STRINGSTREAM) || defined(BOOST_NO_STD_LOCALE)
+ // If you have compilation error at this point, than your STL library
+ // does not support such conversions. Try updating it.
+ BOOST_STATIC_ASSERT((boost::is_same<char, CharT>::value));
+#endif
+ bool const result = !(out_stream << input).fail();
+ const unlocked_but_t* const p
+ = static_cast<unlocked_but_t*>(out_stream.rdbuf()) ;
+ start = p->pbase();
+ finish = p->pptr();
return result;
}
@@ -1276,90 +1336,86 @@ namespace boost
return true;
}
-#if (defined _MSC_VER)
-# pragma warning( push )
-// C4996: This function or variable may be unsafe. Consider using sprintf_s instead
-# pragma warning( disable : 4996 )
-#endif
+ template <class T, class SomeCharT>
+ bool shl_real_type(const T& val, SomeCharT* begin, SomeCharT*& end)
+ {
+ if (put_inf_nan(begin, end, val)) return true;
+ lcast_set_precision(out_stream, &val);
+ return shl_input_streamable(val);
+ }
- template <class T>
- bool shl_float(float val,T* out)
+ static bool shl_real_type(float val, char* begin, char*& end)
{ using namespace std;
- if (put_inf_nan(start,finish,val)) return true;
- finish = start + sprintf(out,"%.*g", static_cast<int>(boost::detail::lcast_get_precision<float >()), val );
- return finish > start;
+ if (put_inf_nan(begin, end, val)) return true;
+ const double val_as_double = val;
+ end = begin +
+#if (defined _MSC_VER)
+ sprintf_s(begin, end-begin,
+#else
+ sprintf(begin,
+#endif
+ "%.*g", static_cast<int>(boost::detail::lcast_get_precision<float>()), val_as_double);
+ return end > begin;
}
- template <class T>
- bool shl_double(double val,T* out)
+ static bool shl_real_type(double val, char* begin, char*& end)
{ using namespace std;
- if (put_inf_nan(start,finish,val)) return true;
- finish = start + sprintf(out,"%.*lg", static_cast<int>(boost::detail::lcast_get_precision<double >()), val );
- return finish > start;
+ if (put_inf_nan(begin, end, val)) return true;
+ end = begin +
+#if (defined _MSC_VER)
+ sprintf_s(begin, end-begin,
+#else
+ sprintf(begin,
+#endif
+ "%.*g", static_cast<int>(boost::detail::lcast_get_precision<double>()), val);
+ return end > begin;
}
+
#ifndef __MINGW32__
- template <class T>
- bool shl_long_double(long double val,T* out)
+ static bool shl_real_type(long double val, char* begin, char*& end)
{ using namespace std;
- if (put_inf_nan(start,finish,val)) return true;
- finish = start + sprintf(out,"%.*Lg", static_cast<int>(boost::detail::lcast_get_precision<long double >()), val );
- return finish > start;
- }
-#endif
-
+ if (put_inf_nan(begin, end, val)) return true;
+ end = begin +
#if (defined _MSC_VER)
-# pragma warning( pop )
+ sprintf_s(begin, end-begin,
+#else
+ sprintf(begin,
+#endif
+ "%.*Lg", static_cast<int>(boost::detail::lcast_get_precision<long double>()), val );
+ return end > begin;
+ }
#endif
-#ifndef BOOST_LCAST_NO_WCHAR_T
- bool shl_float(float val,wchar_t* out)
+#if !defined(BOOST_LCAST_NO_WCHAR_T) && !defined(BOOST_NO_SWPRINTF) && !defined(__MINGW32__)
+ static bool shl_real_type(float val, wchar_t* begin, wchar_t*& end)
{ using namespace std;
- if (put_inf_nan(start,finish,val)) return true;
- finish = start + swprintf(out,
-#if !defined(__MINGW32__) && !defined(UNDER_CE)
- finish-start,
-#endif
- L"%.*g", static_cast<int>(boost::detail::lcast_get_precision<float >()), val );
-
- return finish > start;
+ if (put_inf_nan(begin, end, val)) return true;
+ const double val_as_double = val;
+ end = begin + swprintf(begin, end-begin,
+ L"%.*g",
+ static_cast<int>(boost::detail::lcast_get_precision<float >()),
+ val_as_double );
+ return end > begin;
}
-
- bool shl_double(double val,wchar_t* out)
+ static bool shl_real_type(double val, wchar_t* begin, wchar_t*& end)
{ using namespace std;
- if (put_inf_nan(start,finish,val)) return true;
- /* __MINGW32__ is defined for both mingw.org and for mingw-w64.
- * For mingw-w64, __MINGW64__ is defined, too, when targetting
- * 64 bits.
- *
- * swprintf realization in MinGW and under WinCE does not conform
- * to the ISO C
- * Standard.
- */
- finish = start + swprintf(out,
-#if !defined(__MINGW32__) && !defined(UNDER_CE)
- finish-start,
-#endif
- L"%.*lg", static_cast<int>(boost::detail::lcast_get_precision<double >()), val );
- return finish > start;
+ if (put_inf_nan(begin, end, val)) return true;
+ end = begin + swprintf(begin, end-begin,
+ L"%.*g", static_cast<int>(boost::detail::lcast_get_precision<double >()), val );
+ return end > begin;
}
-#ifndef __MINGW32__
- bool shl_long_double(long double val,wchar_t* out)
+ static bool shl_real_type(long double val, wchar_t* begin, wchar_t*& end)
{ using namespace std;
- if (put_inf_nan(start,finish,val)) return true;
- finish = start + swprintf(out,
-#if !defined(UNDER_CE)
- finish-start,
-#endif
+ if (put_inf_nan(begin, end, val)) return true;
+ end = begin + swprintf(begin, end-begin,
L"%.*Lg", static_cast<int>(boost::detail::lcast_get_precision<long double >()), val );
- return finish > start;
+ return end > begin;
}
#endif
-#endif
-
/************************************ OPERATORS << ( ... ) ********************************/
public:
template<class Alloc>
@@ -1370,7 +1426,6 @@ namespace boost
return true;
}
-#if !defined(__SUNPRO_CC)
template<class Alloc>
bool operator<<(::boost::container::basic_string<CharT,Traits,Alloc> const& str)
{
@@ -1378,7 +1433,7 @@ namespace boost
finish = start + str.length();
return true;
}
-#endif // !defined(__SUNPRO_CC)
+
bool operator<<(bool value)
{
CharT const czero = lcast_char_constants<CharT>::zero;
@@ -1387,6 +1442,52 @@ namespace boost
return true;
}
+ bool operator<<(const iterator_range<CharT*>& rng)
+ {
+ start = rng.begin();
+ finish = rng.end();
+ return true;
+ }
+
+ bool operator<<(const iterator_range<const CharT*>& rng)
+ {
+ start = const_cast<CharT*>(rng.begin());
+ finish = const_cast<CharT*>(rng.end());
+ return true;
+ }
+
+ bool operator<<(const iterator_range<const signed char*>& rng)
+ {
+ return (*this) << iterator_range<char*>(
+ const_cast<char*>(reinterpret_cast<const char*>(rng.begin())),
+ const_cast<char*>(reinterpret_cast<const char*>(rng.end()))
+ );
+ }
+
+ bool operator<<(const iterator_range<const unsigned char*>& rng)
+ {
+ return (*this) << iterator_range<char*>(
+ const_cast<char*>(reinterpret_cast<const char*>(rng.begin())),
+ const_cast<char*>(reinterpret_cast<const char*>(rng.end()))
+ );
+ }
+
+ bool operator<<(const iterator_range<signed char*>& rng)
+ {
+ return (*this) << iterator_range<char*>(
+ reinterpret_cast<char*>(rng.begin()),
+ reinterpret_cast<char*>(rng.end())
+ );
+ }
+
+ bool operator<<(const iterator_range<unsigned char*>& rng)
+ {
+ return (*this) << iterator_range<char*>(
+ reinterpret_cast<char*>(rng.begin()),
+ reinterpret_cast<char*>(rng.end())
+ );
+ }
+
bool operator<<(char ch) { return shl_char(ch); }
bool operator<<(unsigned char ch) { return ((*this) << static_cast<char>(ch)); }
bool operator<<(signed char ch) { return ((*this) << static_cast<char>(ch)); }
@@ -1397,6 +1498,16 @@ namespace boost
bool operator<<(wchar_t ch) { return shl_char(ch); }
#endif
#endif
+#if !defined(BOOST_NO_CHAR16_T) && !defined(BOOST_NO_UNICODE_LITERALS)
+ bool operator<<(char16_t ch) { return shl_char(ch); }
+ bool operator<<(char16_t * str) { return shl_char_array(str); }
+ bool operator<<(char16_t const * str) { return shl_char_array(str); }
+#endif
+#if !defined(BOOST_NO_CHAR32_T) && !defined(BOOST_NO_UNICODE_LITERALS)
+ bool operator<<(char32_t ch) { return shl_char(ch); }
+ bool operator<<(char32_t * str) { return shl_char_array(str); }
+ bool operator<<(char32_t const * str) { return shl_char_array(str); }
+#endif
bool operator<<(unsigned char const* ch) { return ((*this) << reinterpret_cast<char const*>(ch)); }
bool operator<<(unsigned char * ch) { return ((*this) << reinterpret_cast<char *>(ch)); }
bool operator<<(signed char const* ch) { return ((*this) << reinterpret_cast<char const*>(ch)); }
@@ -1417,17 +1528,67 @@ namespace boost
bool operator<<(unsigned __int64 n) { start = lcast_put_unsigned<Traits>(n, finish); return true; }
bool operator<<( __int64 n) { return shl_signed(n); }
#endif
- bool operator<<(float val) { return shl_float(val,start); }
- bool operator<<(double val) { return shl_double(val,start); }
+ bool operator<<(float val) { return shl_real_type(val, start, finish); }
+ bool operator<<(double val) { return shl_real_type(val, start, finish); }
bool operator<<(long double val) {
#ifndef __MINGW32__
- return shl_long_double(val,start);
+ return shl_real_type(val, start, finish);
#else
- return shl_double(val,start);
+ return shl_real_type(static_cast<double>(val), start, finish);
#endif
}
-
- template<class InStreamable>
+
+ template <std::size_t N>
+ bool operator<<(boost::array<CharT, N> const& input)
+ { return shl_char_array_limited(input.begin(), N); }
+
+ template <std::size_t N>
+ bool operator<<(boost::array<unsigned char, N> const& input)
+ { return ((*this) << reinterpret_cast<boost::array<char, N> const& >(input)); }
+
+ template <std::size_t N>
+ bool operator<<(boost::array<signed char, N> const& input)
+ { return ((*this) << reinterpret_cast<boost::array<char, N> const& >(input)); }
+
+ template <std::size_t N>
+ bool operator<<(boost::array<const CharT, N> const& input)
+ { return shl_char_array_limited(input.begin(), N); }
+
+ template <std::size_t N>
+ bool operator<<(boost::array<const unsigned char, N> const& input)
+ { return ((*this) << reinterpret_cast<boost::array<const char, N> const& >(input)); }
+
+ template <std::size_t N>
+ bool operator<<(boost::array<const signed char, N> const& input)
+ { return ((*this) << reinterpret_cast<boost::array<const char, N> const& >(input)); }
+
+#if !defined(BOOST_NO_CXX11_HDR_ARRAY) && defined(BOOST_HAS_TR1_ARRAY)
+ template <std::size_t N>
+ bool operator<<(std::array<CharT, N> const& input)
+ { return shl_char_array_limited(input.begin(), N); }
+
+ template <std::size_t N>
+ bool operator<<(std::array<unsigned char, N> const& input)
+ { return ((*this) << reinterpret_cast<boost::array<char, N> const& >(input)); }
+
+ template <std::size_t N>
+ bool operator<<(std::array<signed char, N> const& input)
+ { return ((*this) << reinterpret_cast<boost::array<char, N> const& >(input)); }
+
+ template <std::size_t N>
+ bool operator<<(std::array<const CharT, N> const& input)
+ { return shl_char_array_limited(input.begin(), N); }
+
+ template <std::size_t N>
+ bool operator<<(std::array<const unsigned char, N> const& input)
+ { return ((*this) << reinterpret_cast<boost::array<const char, N> const& >(input)); }
+
+ template <std::size_t N>
+ bool operator<<(std::array<const signed char, N> const& input)
+ { return ((*this) << reinterpret_cast<boost::array<const char, N> const& >(input)); }
+#endif // !defined(BOOST_NO_CXX11_HDR_ARRAY) && defined(BOOST_HAS_TR1_ARRAY)
+
+ template <class InStreamable>
bool operator<<(const InStreamable& input) { return shl_input_streamable(input); }
/************************************ HELPER FUNCTIONS FOR OPERATORS >> ( ... ) ********************************/
@@ -1524,9 +1685,22 @@ namespace boost
if(is_pointer<InputStreamable>::value)
return false;
- local_streambuffer_t bb;
- bb.setg(start, start, finish);
- std::basic_istream<CharT> stream(&bb);
+#if defined(BOOST_NO_STRINGSTREAM) || defined(BOOST_NO_STD_LOCALE)
+ // If you have compilation error at this point, than your STL library
+ // unsupports such conversions. Try updating it.
+ BOOST_STATIC_ASSERT((boost::is_same<char, CharT>::value));
+#endif
+
+#if defined(BOOST_NO_STRINGSTREAM)
+ std::istrstream stream(start, finish - start);
+#elif defined(BOOST_NO_STD_LOCALE)
+ std::istringstream stream;
+#else
+ std::basic_istringstream<CharT, Traits> stream;
+#endif
+ static_cast<unlocked_but_t*>(stream.rdbuf())
+ ->setg(start, start, finish);
+
stream.unsetf(std::ios::skipws);
lcast_set_precision(stream, static_cast<InputStreamable*>(0));
#if (defined _MSC_VER)
@@ -1549,7 +1723,7 @@ namespace boost
inline bool shr_xchar(T& output)
{
BOOST_STATIC_ASSERT_MSG(( sizeof(CharT) == sizeof(T) ),
- "boost::lexical_cast does not support conversions from whar_t to char types."
+ "boost::lexical_cast does not support conversions from wchar_t to char types."
"Use boost::locale instead" );
bool const ok = (finish - start == 1);
if(ok) {
@@ -1581,25 +1755,82 @@ namespace boost
#if !defined(BOOST_LCAST_NO_WCHAR_T) && !defined(BOOST_NO_INTRINSIC_WCHAR_T)
bool operator>>(wchar_t& output) { return shr_xchar(output); }
#endif
-#ifndef BOOST_NO_CHAR16_T
+#if !defined(BOOST_NO_CHAR16_T) && !defined(BOOST_NO_UNICODE_LITERALS)
bool operator>>(char16_t& output) { return shr_xchar(output); }
#endif
-#ifndef BOOST_NO_CHAR32_T
+#if !defined(BOOST_NO_CHAR32_T) && !defined(BOOST_NO_UNICODE_LITERALS)
bool operator>>(char32_t& output) { return shr_xchar(output); }
#endif
-#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
- bool operator>>(std::string& str) { str.assign(start, finish); return true; }
-# ifndef BOOST_LCAST_NO_WCHAR_T
- bool operator>>(std::wstring& str) { str.assign(start, finish); return true; }
-# endif
-#else
template<class Alloc>
bool operator>>(std::basic_string<CharT,Traits,Alloc>& str) { str.assign(start, finish); return true; }
-#if !defined(__SUNPRO_CC)
+
template<class Alloc>
bool operator>>(::boost::container::basic_string<CharT,Traits,Alloc>& str) { str.assign(start, finish); return true; }
-#endif // !defined(__SUNPRO_CC)
-#endif
+
+
+ private:
+ template <std::size_t N, class ArrayT>
+ bool shr_std_array(ArrayT& output, boost::mpl::bool_<true> /*is_T_char_tag*/)
+ {
+ using namespace std;
+ const std::size_t size = finish - start;
+ if (size > N - 1) { // `-1` because we need to store \0 at the end
+ return false;
+ }
+
+ memcpy(output.begin(), start, size * sizeof(CharT));
+ *(output.begin() + size) = static_cast<CharT>(0);
+ return true;
+ }
+
+ template <std::size_t N, class ArrayT>
+ bool shr_std_array(ArrayT& output, boost::mpl::bool_<false> /*is_T_char_tag*/)
+ {
+ return shr_using_base_class(output); // Array consist of non character types or unmatching character type
+ }
+ public:
+
+ template <std::size_t N>
+ bool operator>>(boost::array<CharT, N>& output)
+ {
+ typedef boost::mpl::bool_<true> tag_type;
+ return shr_std_array<N>(output, tag_type());
+ }
+
+ template <std::size_t N>
+ bool operator>>(boost::array<unsigned char, N>& output)
+ {
+ return ((*this) >> reinterpret_cast<boost::array<char, N>& >(output));
+ }
+
+ template <std::size_t N>
+ bool operator>>(boost::array<signed char, N>& output)
+ {
+ return ((*this) >> reinterpret_cast<boost::array<char, N>& >(output));
+ }
+
+#if !defined(BOOST_NO_CXX11_HDR_ARRAY) && defined(BOOST_HAS_TR1_ARRAY)
+ template <std::size_t N>
+ bool operator>>(std::array<CharT, N>& output)
+ {
+ typedef boost::mpl::bool_<true> tag_type;
+ return shr_std_array<N>(output, tag_type());
+ }
+
+ template <std::size_t N>
+ bool operator>>(std::array<unsigned char, N>& output)
+ {
+ return ((*this) >> reinterpret_cast<std::array<char, N>& >(output));
+ }
+
+ template <std::size_t N>
+ bool operator>>(std::array<signed char, N>& in)
+ {
+ return ((*this) >> reinterpret_cast<std::array<char, N>& >(output));
+ }
+#endif // !defined(BOOST_NO_CXX11_HDR_ARRAY) && defined(BOOST_HAS_TR1_ARRAY)
+
+
/*
* case "-0" || "0" || "+0" : output = false; return true;
* case "1" || "+1": output = true; return true;
@@ -1705,10 +1936,6 @@ namespace boost
};
}
-#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-
- // call-by-const reference version
-
namespace detail
{
template<class T>
@@ -1734,49 +1961,12 @@ namespace boost
{
BOOST_STATIC_CONSTANT(bool, value = true );
};
-#if !defined(__SUNPRO_CC)
+
template<typename CharT, typename Traits, typename Alloc>
struct is_stdstring< ::boost::container::basic_string<CharT, Traits, Alloc> >
{
BOOST_STATIC_CONSTANT(bool, value = true );
};
-#endif // !defined(__SUNPRO_CC)
- template<typename T>
- struct is_char_or_wchar
- {
- private:
-#ifndef BOOST_LCAST_NO_WCHAR_T
- typedef wchar_t wchar_t_if_supported;
-#else
- typedef char wchar_t_if_supported;
-#endif
-
-#ifndef BOOST_NO_CHAR16_T
- typedef char16_t char16_t_if_supported;
-#else
- typedef char char16_t_if_supported;
-#endif
-
-#ifndef BOOST_NO_CHAR32_T
- typedef char32_t char32_t_if_supported;
-#else
- typedef char char32_t_if_supported;
-#endif
- public:
-
- BOOST_STATIC_CONSTANT(bool, value =
- (
- ::boost::type_traits::ice_or<
- is_same< T, char >::value,
- is_same< T, wchar_t_if_supported >::value,
- is_same< T, char16_t_if_supported >::value,
- is_same< T, char32_t_if_supported >::value,
- is_same< T, unsigned char >::value,
- is_same< T, signed char >::value
- >::value
- )
- );
- };
template<typename Target, typename Source>
struct is_arithmetic_and_not_xchars
@@ -1784,8 +1974,8 @@ namespace boost
BOOST_STATIC_CONSTANT(bool, value =
(
::boost::type_traits::ice_and<
- is_arithmetic<Source>::value,
- is_arithmetic<Target>::value,
+ ::boost::is_arithmetic<Source>::value,
+ ::boost::is_arithmetic<Target>::value,
::boost::type_traits::ice_not<
detail::is_char_or_wchar<Target>::value
>::value,
@@ -1823,6 +2013,28 @@ namespace boost
);
};
+
+ // this metafunction evaluates to true, if we have optimized comnversion
+ // from Float type to Char array.
+ // Must be in sync with lexical_stream_limited_src<Char, ...>::shl_real_type(...)
+ template <typename Float, typename Char>
+ struct is_this_float_conversion_optimized
+ {
+ typedef ::boost::type_traits::ice_and<
+ ::boost::is_float<Float>::value,
+#if !defined(BOOST_LCAST_NO_WCHAR_T) && !defined(BOOST_NO_SWPRINTF) && !defined(__MINGW32__)
+ ::boost::type_traits::ice_or<
+ ::boost::type_traits::ice_eq<sizeof(Char), sizeof(char) >::value,
+ ::boost::is_same<Char, wchar_t>::value
+ >::value
+#else
+ ::boost::type_traits::ice_eq<sizeof(Char), sizeof(char) >::value
+#endif
+ > result_type;
+
+ BOOST_STATIC_CONSTANT(bool, value = (result_type::value) );
+ };
+
template<typename Target, typename Source>
struct is_char_array_to_stdstring
{
@@ -1840,7 +2052,7 @@ namespace boost
{
BOOST_STATIC_CONSTANT(bool, value = true );
};
-#if !defined(__SUNPRO_CC)
+
template<typename CharT, typename Traits, typename Alloc>
struct is_char_array_to_stdstring< ::boost::container::basic_string<CharT, Traits, Alloc>, CharT* >
{
@@ -1852,7 +2064,6 @@ namespace boost
{
BOOST_STATIC_CONSTANT(bool, value = true );
};
-#endif // !defined(__SUNPRO_CC)
#if (defined _MSC_VER)
# pragma warning( push )
@@ -1866,59 +2077,64 @@ namespace boost
static inline Target lexical_cast_impl(const Source& arg)
{
typedef BOOST_DEDUCED_TYPENAME detail::array_to_pointer_decay<Source>::type src;
-
+ typedef BOOST_DEDUCED_TYPENAME ::boost::remove_cv<src>::type no_cv_src;
+ typedef BOOST_DEDUCED_TYPENAME detail::stream_char<Target>::type target_char_t;
+ typedef BOOST_DEDUCED_TYPENAME detail::stream_char<no_cv_src>::type src_char_type;
typedef BOOST_DEDUCED_TYPENAME detail::widest_char<
- BOOST_DEDUCED_TYPENAME detail::stream_char<Target>::type
- , BOOST_DEDUCED_TYPENAME detail::stream_char<src>::type
+ target_char_t, src_char_type
>::type char_type;
- typedef detail::lcast_src_length<src> lcast_src_length;
- std::size_t const src_len = lcast_src_length::value;
- char_type buf[src_len + 1];
- lcast_src_length::check_coverage();
+#if !defined(BOOST_NO_CHAR16_T) && defined(BOOST_NO_UNICODE_LITERALS)
+ BOOST_STATIC_ASSERT_MSG(( !::boost::is_same<char16_t, src_char_type>::value
+ && !::boost::is_same<char16_t, target_char_t>::value),
+ "Your compiler does not have full support for char16_t" );
+#endif
+#if !defined(BOOST_NO_CHAR32_T) && defined(BOOST_NO_UNICODE_LITERALS)
+ BOOST_STATIC_ASSERT_MSG(( !::boost::is_same<char32_t, src_char_type>::value
+ && !::boost::is_same<char32_t, target_char_t>::value),
+ "Your compiler does not have full support for char32_t" );
+#endif
- typedef BOOST_DEDUCED_TYPENAME
- deduce_char_traits<char_type,Target,Source>::type traits;
+ typedef BOOST_DEDUCED_TYPENAME ::boost::detail::deduce_char_traits<
+ char_type, Target, no_cv_src
+ >::type traits;
- typedef BOOST_DEDUCED_TYPENAME remove_pointer<src >::type removed_ptr_t;
+ typedef ::boost::type_traits::ice_and<
+ ::boost::detail::is_char_or_wchar<src_char_type>::value, // source is lexical type
+ ::boost::detail::is_char_or_wchar<target_char_t>::value, // target is a lexical type
+ ::boost::is_same<char, src_char_type>::value, // source is not a wide character based type
+ ::boost::type_traits::ice_ne<sizeof(char), sizeof(target_char_t) >::value // target type is based on wide character
+ > is_string_widening_required_t;
- // is_char_types_match variable value can be computed via
- // sizeof(char_type) == sizeof(removed_ptr_t). But when
- // removed_ptr_t is an incomplete type or void*, compilers
- // produce warnings or errors.
- const bool is_char_types_match =
- (::boost::type_traits::ice_or<
- ::boost::type_traits::ice_and<
- ::boost::type_traits::ice_eq<sizeof(char_type), sizeof(char) >::value,
- ::boost::type_traits::ice_or<
- ::boost::is_same<char, removed_ptr_t>::value,
- ::boost::is_same<unsigned char, removed_ptr_t>::value,
- ::boost::is_same<signed char, removed_ptr_t>::value
- >::value
- >::value,
- is_same<char_type, removed_ptr_t>::value
- >::value);
-
- const bool requires_stringbuf =
- !(
- ::boost::type_traits::ice_or<
- is_stdstring<src >::value,
- is_arithmetic<src >::value,
- ::boost::type_traits::ice_and<
- is_pointer<src >::value,
- is_char_or_wchar<removed_ptr_t >::value,
- is_char_types_match
- >::value
- >::value
- );
-
- detail::lexical_stream_limited_src<char_type,traits, requires_stringbuf >
- interpreter(buf, buf + src_len);
+ typedef ::boost::type_traits::ice_or<
+ ::boost::is_integral<no_cv_src>::value,
+ ::boost::detail::is_this_float_conversion_optimized<no_cv_src, char_type >::value,
+ ::boost::detail::is_char_or_wchar<src_char_type >::value
+ > is_source_input_optimized_t;
+ // Target type must be default constructible
Target result;
+
+ // If we have an optimized conversion for
+ // Source, we do not need to construct stringbuf.
+ const bool requires_stringbuf = ::boost::type_traits::ice_or<
+ is_string_widening_required_t::value,
+ ::boost::type_traits::ice_not< is_source_input_optimized_t::value >::value
+ >::value;
+
+ typedef detail::lexical_stream_limited_src<char_type, traits, requires_stringbuf > interpreter_type;
+
+ typedef detail::lcast_src_length<no_cv_src> lcast_src_length;
+ std::size_t const src_len = lcast_src_length::value;
+ char_type buf[src_len + 1];
+ lcast_src_length::check_coverage();
+
+ interpreter_type interpreter(buf, buf + src_len);
+
// Disabling ADL, by directly specifying operators.
if(!(interpreter.operator <<(arg) && interpreter.operator >>(result)))
BOOST_LCAST_THROW_BAD_CAST(Source, Target);
+
return result;
}
};
@@ -1926,7 +2142,7 @@ namespace boost
# pragma warning( pop )
#endif
- template<typename Source>
+ template <typename Source>
struct lexical_cast_copy
{
static inline Source lexical_cast_impl(const Source &arg)
@@ -1935,79 +2151,71 @@ namespace boost
}
};
- class precision_loss_error : public boost::numeric::bad_numeric_cast
+ template <class Source, class Target >
+ struct detect_precision_loss
{
- public:
- virtual const char * what() const throw()
- { return "bad numeric conversion: precision loss error"; }
- };
+ typedef boost::numeric::Trunc<Source> Rounder;
+ typedef Source source_type ;
- template<class S >
- struct throw_on_precision_loss
- {
- typedef boost::numeric::Trunc<S> Rounder;
- typedef S source_type ;
-
- typedef typename mpl::if_< is_arithmetic<S>,S,S const&>::type argument_type ;
+ typedef BOOST_DEDUCED_TYPENAME mpl::if_<
+ ::boost::is_arithmetic<Source>, Source, Source const&
+ >::type argument_type ;
static source_type nearbyint ( argument_type s )
{
- source_type orig_div_round = s / Rounder::nearbyint(s);
+ const source_type orig_div_round = s / Rounder::nearbyint(s);
+ const source_type eps = std::numeric_limits<source_type>::epsilon();
+
+ if ((orig_div_round > 1 ? orig_div_round - 1 : 1 - orig_div_round) > eps)
+ BOOST_LCAST_THROW_BAD_CAST(Source, Target);
- if ( (orig_div_round > 1 ? orig_div_round - 1 : 1 - orig_div_round) > std::numeric_limits<source_type>::epsilon() )
- BOOST_THROW_EXCEPTION( precision_loss_error() );
return s ;
}
typedef typename Rounder::round_style round_style;
} ;
- template<typename Target, typename Source>
+ template <class Source, class Target >
+ struct nothrow_overflow_handler
+ {
+ void operator() ( boost::numeric::range_check_result r )
+ {
+ if (r != boost::numeric::cInRange)
+ BOOST_LCAST_THROW_BAD_CAST(Source, Target);
+ }
+ } ;
+
+ template <typename Target, typename Source>
struct lexical_cast_dynamic_num_not_ignoring_minus
{
static inline Target lexical_cast_impl(const Source &arg)
{
- try{
- typedef boost::numeric::converter<
- Target,
- Source,
- boost::numeric::conversion_traits<Target,Source>,
- boost::numeric::def_overflow_handler,
- throw_on_precision_loss<Source>
- > Converter ;
-
- return Converter::convert(arg);
- } catch( ::boost::numeric::bad_numeric_cast const& ) {
- BOOST_LCAST_THROW_BAD_CAST(Source, Target);
- }
- BOOST_UNREACHABLE_RETURN(static_cast<Target>(0));
+ return boost::numeric::converter<
+ Target,
+ Source,
+ boost::numeric::conversion_traits<Target,Source>,
+ nothrow_overflow_handler<Source, Target>,
+ detect_precision_loss<Source, Target>
+ >::convert(arg);
}
};
- template<typename Target, typename Source>
+ template <typename Target, typename Source>
struct lexical_cast_dynamic_num_ignoring_minus
{
static inline Target lexical_cast_impl(const Source &arg)
{
- try{
- typedef boost::numeric::converter<
- Target,
- Source,
- boost::numeric::conversion_traits<Target,Source>,
- boost::numeric::def_overflow_handler,
- throw_on_precision_loss<Source>
- > Converter ;
-
- bool has_minus = ( arg < 0);
- if ( has_minus ) {
- return static_cast<Target>(-Converter::convert(-arg));
- } else {
- return Converter::convert(arg);
- }
- } catch( ::boost::numeric::bad_numeric_cast const& ) {
- BOOST_LCAST_THROW_BAD_CAST(Source, Target);
- }
- BOOST_UNREACHABLE_RETURN(static_cast<Target>(0));
+ typedef boost::numeric::converter<
+ Target,
+ Source,
+ boost::numeric::conversion_traits<Target,Source>,
+ nothrow_overflow_handler<Source, Target>,
+ detect_precision_loss<Source, Target>
+ > converter_t;
+
+ return (
+ arg < 0 ? -converter_t::convert(-arg) : converter_t::convert(arg)
+ );
}
};
@@ -2029,7 +2237,7 @@ namespace boost
* optional, so if a negative number is read, no errors will arise
* and the result will be the two's complement.
*/
- template<typename Target, typename Source>
+ template <typename Target, typename Source>
struct lexical_cast_dynamic_num
{
static inline Target lexical_cast_impl(const Source &arg)
@@ -2041,10 +2249,10 @@ namespace boost
::boost::is_float<Source>::value
>::value,
::boost::type_traits::ice_not<
- is_same<Source, bool>::value
+ ::boost::is_same<Source, bool>::value
>::value,
::boost::type_traits::ice_not<
- is_same<Target, bool>::value
+ ::boost::is_same<Target, bool>::value
>::value,
::boost::is_unsigned<Target>::value
>::value,
@@ -2057,40 +2265,80 @@ namespace boost
};
}
- template<typename Target, typename Source>
+ template <typename Target, typename Source>
inline Target lexical_cast(const Source &arg)
{
- typedef BOOST_DEDUCED_TYPENAME detail::array_to_pointer_decay<Source>::type src;
+ typedef BOOST_DEDUCED_TYPENAME ::boost::detail::array_to_pointer_decay<Source>::type src;
typedef BOOST_DEDUCED_TYPENAME ::boost::type_traits::ice_or<
- detail::is_xchar_to_xchar<Target, src>::value,
- detail::is_char_array_to_stdstring<Target,src>::value,
+ ::boost::detail::is_xchar_to_xchar<Target, src >::value,
+ ::boost::detail::is_char_array_to_stdstring<Target, src >::value,
::boost::type_traits::ice_and<
- is_same<Target, src>::value,
- detail::is_stdstring<Target>::value
+ ::boost::is_same<Target, src >::value,
+ ::boost::detail::is_stdstring<Target >::value
>::value
- > do_copy_type;
+ > shall_we_copy_t;
typedef BOOST_DEDUCED_TYPENAME
- detail::is_arithmetic_and_not_xchars<Target, src> do_copy_with_dynamic_check_type;
+ ::boost::detail::is_arithmetic_and_not_xchars<Target, src > shall_we_copy_with_dynamic_check_t;
typedef BOOST_DEDUCED_TYPENAME ::boost::mpl::if_c<
- do_copy_type::value,
- detail::lexical_cast_copy<src>,
+ shall_we_copy_t::value,
+ ::boost::detail::lexical_cast_copy<src >,
BOOST_DEDUCED_TYPENAME ::boost::mpl::if_c<
- do_copy_with_dynamic_check_type::value,
- detail::lexical_cast_dynamic_num<Target, src>,
- detail::lexical_cast_do_cast<Target, src>
+ shall_we_copy_with_dynamic_check_t::value,
+ ::boost::detail::lexical_cast_dynamic_num<Target, src >,
+ ::boost::detail::lexical_cast_do_cast<Target, src >
>::type
>::type caster_type;
return caster_type::lexical_cast_impl(arg);
}
- #else
+} // namespace boost
+
+#else // #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
- namespace detail // stream wrapper for handling lexical conversions
+namespace boost {
+ namespace detail
{
+
+ // selectors for choosing stream character type
+ template<typename Type>
+ struct stream_char
+ {
+ typedef char type;
+ };
+
+#ifndef BOOST_LCAST_NO_WCHAR_T
+#ifndef BOOST_NO_INTRINSIC_WCHAR_T
+ template<>
+ struct stream_char<wchar_t>
+ {
+ typedef wchar_t type;
+ };
+#endif
+
+ template<>
+ struct stream_char<wchar_t *>
+ {
+ typedef wchar_t type;
+ };
+
+ template<>
+ struct stream_char<const wchar_t *>
+ {
+ typedef wchar_t type;
+ };
+
+ template<>
+ struct stream_char<std::wstring>
+ {
+ typedef wchar_t type;
+ };
+#endif
+
+ // stream wrapper for handling lexical conversions
template<typename Target, typename Source, typename Traits>
class lexical_stream
{
@@ -2180,8 +2428,9 @@ namespace boost
return result;
}
- #endif
-}
+} // namespace boost
+
+#endif
// Copyright Kevlin Henney, 2000-2005.
// Copyright Alexander Nasonov, 2006-2010.
@@ -2191,5 +2440,8 @@ namespace boost
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
+#undef BOOST_LCAST_THROW_BAD_CAST
#undef BOOST_LCAST_NO_WCHAR_T
-#endif
+
+#endif // BOOST_LEXICAL_CAST_INCLUDED
+
diff --git a/boost/local_function.hpp b/boost/local_function.hpp
new file mode 100644
index 0000000000..9f259e6e19
--- /dev/null
+++ b/boost/local_function.hpp
@@ -0,0 +1,459 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_HPP_
+#define BOOST_LOCAL_FUNCTION_HPP_
+
+#ifndef DOXYGEN
+
+#include <boost/local_function/aux_/macro/decl.hpp>
+#include <boost/local_function/aux_/macro/name.hpp>
+#include <boost/local_function/aux_/macro/typeof.hpp>
+#include <boost/local_function/aux_/preprocessor/traits/decl.hpp>
+#include <boost/local_function/detail/preprocessor/line_counter.hpp>
+#include <boost/local_function/detail/preprocessor/void_list.hpp>
+#include <boost/config.hpp>
+
+// PUBLIC //
+
+#ifdef BOOST_NO_VARIADIC_MACROS
+# define BOOST_LOCAL_FUNCTION_ID(id, declarations) \
+ BOOST_LOCAL_FUNCTION_AUX_DECL(id, 0 /* not within template */, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST( \
+ declarations)))
+# define BOOST_LOCAL_FUNCTION(declarations) \
+ BOOST_LOCAL_FUNCTION_ID( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER, declarations)
+# define BOOST_LOCAL_FUNCTION_ID_TPL(id, declarations) \
+ BOOST_LOCAL_FUNCTION_AUX_DECL(id, 1 /* within template */, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST( \
+ declarations)))
+# define BOOST_LOCAL_FUNCTION_TPL(declarations) \
+ BOOST_LOCAL_FUNCTION_ID_TPL( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER, declarations)
+#else // VARIADIC
+# define BOOST_LOCAL_FUNCTION_ID(id, ...) \
+ BOOST_LOCAL_FUNCTION_AUX_DECL(id, 0 /* not within template */, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST(__VA_ARGS__)))
+# define BOOST_LOCAL_FUNCTION(...) \
+ BOOST_LOCAL_FUNCTION_ID( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER, __VA_ARGS__)
+# define BOOST_LOCAL_FUNCTION_ID_TPL(id, ...) \
+ BOOST_LOCAL_FUNCTION_AUX_DECL(id, 1 /* within template */, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST(__VA_ARGS__)))
+# define BOOST_LOCAL_FUNCTION_TPL(...) \
+ BOOST_LOCAL_FUNCTION_ID_TPL( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER, __VA_ARGS__)
+#endif // VARIADIC
+
+#define BOOST_LOCAL_FUNCTION_NAME(qualified_name) \
+ BOOST_LOCAL_FUNCTION_AUX_NAME(0 /* not within template */, qualified_name)
+#define BOOST_LOCAL_FUNCTION_NAME_TPL(qualified_name) \
+ BOOST_LOCAL_FUNCTION_AUX_NAME(1 /* within template */, qualified_name)
+
+#define BOOST_LOCAL_FUNCTION_TYPEOF(bound_variable_name) \
+ BOOST_LOCAL_FUNCTION_AUX_TYPEOF_TYPE(bound_variable_name)
+
+// DOCUMENTATION //
+
+#else // DOXYGEN
+
+/** @file
+@brief Local functions allow to program functions locally, within other
+functions, and directly within the scope where they are needed.
+*/
+
+/**
+@brief This macro is used to start a local function declaration.
+
+This macro must be used within a declarative context, it must follow the local
+function result type, it must be followed by the local function body code, and
+then by the @RefMacro{BOOST_LOCAL_FUNCTION_NAME} macro (see the
+@RefSect{tutorial, Tutorial} and @RefSect{advanced_topics, Advanced Topics}
+sections):
+@code
+{ // Some declarative context.
+ ...
+ result_type BOOST_LOCAL_FUNCTION(declarations) {
+ ... // Body code.
+ } BOOST_LOCAL_FUNCTION_NAME(qualified_name)
+ ...
+}
+@endcode
+
+As usual, exceptions specifications can be optionally programmed just after the
+macro and before the body code block <c>{ ... }</c> (but the exception
+specifications will only apply to the body code and not to the library code
+automatically generated by the macro expansion, see the
+@RefSect{advanced_topics, Advanced Topics} section).
+
+Within templates, the special macros @RefMacro{BOOST_LOCAL_FUNCTION_TPL}
+and @RefMacro{BOOST_LOCAL_FUNCTION_NAME_TPL} must be used.
+
+@Params
+@Param{declarations,
+On compilers that support variadic macros\, the parameter declarations are
+defined by the following grammar:
+@code
+ declarations:
+ void | declaration_tuple | declaration_sequence
+ declaration_tuple:
+ declaration\, declaration\, ...
+ declaration_sequence:
+ (declaration) (declaration) ...
+ declaration:
+ bound_variable | parameter | default_value | result_type
+ bound_variable:
+ [const] bind [(variable_type)] [&] variable_name
+ parameter:
+ [auto | register] parameter_type parameter_name
+ default_value:
+ default parameter_default_value
+ result_type:
+ return function_result_type
+@endcode
+On compilers that do not support variadic macros\, <c>declaration_tuple</c>
+cannot be used:
+@code
+ declarations:
+ void | declaration_sequence
+@endcode
+
+(Lexical conventions: <c>token1 | token2</c> means either <c>token1</c> or
+<c>token2</c>; <c>[token]</c> means either <c>token</c> or nothing;
+<c>{expression}</c> means the token resulting from the expression.)
+}
+@EndParams
+
+Note that on compilers that support variadic macros, commas can be used to
+separate the declarations resembling more closely the usual C++ function
+declaration syntax (this is the preferred syntax).
+However, for portability, on all C++ compilers (with and without variadic
+macros) the same library macros also accept parameter declarations specified as
+a Boost.Preprocessor sequence separated by round parenthesis <c>()</c>.
+
+When binding the object <c>this</c>, the special symbol <c>this_</c> needs to
+be used instead of <c>this</c> as the name of the variable to bind and also
+within the local function body to access the object.
+(Mistakenly using <c>this</c> instead of <c>this_</c> might not always result in a compiler error and will in general result in undefined behaviour.)
+
+The result type must either be specified just before the macro or within the
+macro declarations prefixed by <c>return</c> (but not in both places).
+
+Within the local function body it possible to access the result type using <c>result_type</c>, the type of the first parameter using <c>arg1_type</c>, the type of the second parameter using <c>arg2_type</c>, etc.
+The bound variable types can be accessed using @RefMacro{BOOST_LOCAL_FUNCTION_TYPEOF}.
+
+This macro cannot be portably expanded multiple times on the same line.
+In these cases, use the @RefMacro{BOOST_LOCAL_FUNCTION_ID} macro instead.
+
+The maximum number of local function parameters (excluding bound variables) is
+specified by the configuration macro
+@RefMacro{BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX}.
+The maximum number of bound variables is specified by the configuration macro
+@RefMacro{BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX}.
+The configuration macro
+@RefMacro{BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS} can be used to force
+optimizations that reduce the local function call run-time overhead.
+
+@Note Local functions are functors so they can be assigned to other functors
+like <c>boost::function</c> (see Boost.Function).
+
+@See @RefSect{tutorial, Tutorial} section,
+@RefSect{advanced_topics, Advanced Topics} section,
+@RefMacro{BOOST_LOCAL_FUNCTION_NAME}, @RefMacro{BOOST_LOCAL_FUNCTION_TPL},
+@RefMacro{BOOST_LOCAL_FUNCTION_NAME_TPL},
+@RefMacro{BOOST_LOCAL_FUNCTION_TYPEOF}, @RefMacro{BOOST_LOCAL_FUNCTION_ID},
+@RefMacro{BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX},
+@RefMacro{BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX},
+@RefMacro{BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS}.
+*/
+#define BOOST_LOCAL_FUNCTION(declarations)
+
+/**
+@brief This macro is used to start a local function declaration within
+templates.
+
+This macro must be used instead of @RefMacro{BOOST_LOCAL_FUNCTION} when
+declaring a local function within a template.
+A part from that, this macro has the exact same syntax a
+@RefMacro{BOOST_LOCAL_FUNCTION} (see @RefMacro{BOOST_LOCAL_FUNCTION} for more
+information):
+@code
+{ // Some declarative context within a template.
+ ...
+ result_type BOOST_LOCAL_FUNCTION_TPL(declarations) {
+ ... // Body code.
+ } BOOST_LOCAL_FUNCTION_NAME_TPL(qualified_name)
+ ...
+}
+@endcode
+
+Note that @RefMacro{BOOST_LOCAL_FUNCTION_NAME_TPL} must be used with this
+macro instead of @RefMacro{BOOST_LOCAL_FUNCTION_NAME}.
+
+This macro cannot be portably expanded multiple times on the same line.
+In these cases, use the @RefMacro{BOOST_LOCAL_FUNCTION_ID_TPL} macro instead.
+
+@Note C++03 does not allow to use <c>typename</c> outside templates.
+This library internally manipulates types, these operations require
+<c>typename</c> but only within templates.
+This macro is used to indicate to the library when the enclosing scope is a
+template so the library can correctly use <c>typename</c>.
+
+@See @RefSect{tutorial, Tutorial} section, @RefMacro{BOOST_LOCAL_FUNCTION},
+@RefMacro{BOOST_LOCAL_FUNCTION_ID_TPL},
+@RefMacro{BOOST_LOCAL_FUNCTION_NAME_TPL}.
+*/
+#define BOOST_LOCAL_FUNCTION_TPL(declarations)
+
+/**
+@brief This macro allows to declare multiple local functions on the same line.
+
+This macro is equivalent to @RefMacro{BOOST_LOCAL_FUNCTION} but it can be
+expanded multiple times on the same line if different identifiers <c>id</c> are
+provided for each expansion (see the
+@RefSect{advanced_topics, Advanced Topics} section).
+
+@Params
+@Param{id,
+A unique identifier token which can be concatenated by the preprocessor
+(<c>__LINE__</c>\, <c>local_function_number_1_on_line_123</c>\, etc).
+}
+@Param{declarations,
+Same as the <c>declarations</c> parameter of the
+@RefMacro{BOOST_LOCAL_FUNCTION} macro.
+}
+@EndParams
+
+The @RefMacro{BOOST_LOCAL_FUNCTION_NAME} macro should be used to end each one
+of the multiple local function declarations as usual (and it will specify a
+unique name for each local function).
+
+Within templates, the special macros @RefMacro{BOOST_LOCAL_FUNCTION_ID_TPL}
+must be used.
+
+@Note This macro can be useful when the local function macros are expanded
+within user-defined macros (because macros all expand on the same line).
+On some compilers (e.g., MSVC which supports the non-standard
+<c>__COUNTER__</c> macro) it might not be necessary to use this macro but
+the use of this macro when expanding multiple local function macros on the same
+line is always necessary to ensure portability (this is because this library
+can only portably use <c>__LINE__</c> to internally generate unique
+identifiers).
+
+@See @RefSect{advanced_topics, Advanced Topics} section,
+@RefMacro{BOOST_LOCAL_FUNCTION}, @RefMacro{BOOST_LOCAL_FUNCTION_NAME},
+@RefMacro{BOOST_LOCAL_FUNCTION_ID_TPL}.
+*/
+#define BOOST_LOCAL_FUNCTION_ID(id, declarations)
+
+/**
+@brief This macro allows to declare multiple local functions on the same line
+within templates.
+
+This macro must be used instead of @RefMacro{BOOST_LOCAL_FUNCTION_TPL} when
+declaring multiple local functions on the same line within a template.
+A part from that, this macro has the exact same syntax as
+@RefMacro{BOOST_LOCAL_FUNCTION_TPL} (see @RefMacro{BOOST_LOCAL_FUNCTION_TPL}
+for more information).
+
+@Params
+@Param{id,
+A unique identifier token which can be concatenated by the preprocessor
+(<c>__LINE__</c>\, <c>local_function_number_1_on_line_123</c>\, etc).
+}
+@Param{declarations,
+Same as the <c>declarations</c> parameter of the
+@RefMacro{BOOST_LOCAL_FUNCTION_TPL} macro.
+}
+@EndParams
+
+The @RefMacro{BOOST_LOCAL_FUNCTION_NAME} macro should be used to end each one
+of the multiple local function declarations as usual (and it will specify a
+unique name for each local function).
+
+Outside template, the macro @RefMacro{BOOST_LOCAL_FUNCTION_ID} should be used
+to declare multiple local functions on the same line.
+
+@Note This macro can be useful when the local function macros are expanded
+within user-defined macros (because macros all expand on the same line).
+On some compilers (e.g., MSVC which supports the non-standard
+<c>__COUNTER__</c> macro) it might not be necessary to use this macro but
+the use of this macro when expanding multiple local function macros on the same
+line is always necessary to ensure portability (this is because this library
+can only portably use <c>__LINE__</c> to internally generate unique
+identifiers).
+
+@See @RefSect{advanced_topics, Advanced Topics} section,
+@RefMacro{BOOST_LOCAL_FUNCTION_TPL}, @RefMacro{BOOST_LOCAL_FUNCTION_NAME},
+@RefMacro{BOOST_LOCAL_FUNCTION_ID}.
+*/
+#define BOOST_LOCAL_FUNCTION_ID_TPL(id, declarations)
+
+/**
+@brief This macro is used to end a local function declaration specifying its
+name.
+
+This macro must follow the local function body code block <c>{ ... }</c>:
+@code
+{ // Some declarative context.
+ ...
+ result_type BOOST_LOCAL_FUNCTION(declarations) {
+ ... // Body code.
+ } BOOST_LOCAL_FUNCTION_NAME(qualified_name)
+ ...
+}
+@endcode
+
+Within templates, the special macros @RefMacro{BOOST_LOCAL_FUNCTION_TPL} and
+@RefMacro{BOOST_LOCAL_FUNCTION_NAME_TPL} must be used.
+
+@Params
+@Param{qualified_name,
+The name of the local function optionally qualified as follow:
+@code
+ name:
+ [inline] [recursive] local_function_name
+@endcode
+(Lexical conventions: <c>token1 | token2</c> means either <c>token1</c> or
+<c>token2</c>; <c>[token]</c> means either <c>token</c> or nothing;
+<c>{expression}</c> means the token resulting from the expression.)
+}
+@EndParams
+
+The local function name can be qualified by prefixing it with the keyword
+<c>inline</c> (see the @RefSect{advanced_topics, Advanced Topics} section):
+@code
+ BOOST_LOCAL_FUNCTION_NAME(inline local_function_name)
+@endcode
+This increases the chances that the compiler will be able to inline the local
+function calls (thus reducing run-time).
+However, inline local functions cannot be passed as template parameters (e.g., to <c>std::for_each</c>) or assigned to other functors (e.g., to
+<c>boost::function</c>).
+That is true on C++03 compilers but inline local functions can instead be
+passed as template parameters on C++11 compilers.
+On C++11 compilers, there is no need to declare a local function lined because
+this library will automatically use C++11 specific features to inline the local
+function while always allowing to pass it as a template parameter.
+This optimization is automatically enabled when the Boost.Config macro
+<c>BOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS</c> is not defined but it also be
+forced using @RefMacro{BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS}.
+
+The local function name can also be qualified by prefixing it with the
+"keyword" <c>recursive</c> (see the
+@RefSect{advanced_topics, Advanced Topics} section):
+@code
+ BOOST_LOCAL_FUNCTION_NAME(recursive local_function_name)
+@endcode
+This allows the local function to recursively call itself from its body (as
+usual in C++).
+However, recursive local functions should only be called within their
+declaration scope (otherwise the result is undefined behaviour).
+Finally, compilers have not been observed to be able to inline recursive local
+function calls, not even when the recursive local function is also declared
+inline:
+@code
+ BOOST_LOCAL_FUNCTION(inline recursive local_function_name)
+@endcode
+
+@Note The local function name cannot be the name of an operator
+<c>operator...</c> and it cannot be the same name of another local function
+declared within the same enclosing scope (but <c>boost::overloaded_function</c>
+can be used to overload local functions, see
+Boost.Functional/OverloadedFunction and the
+@RefSect{advanced_topics, Advanced Topics} section).
+
+@See @RefSect{tutorial, Tutorial} section,
+@RefSect{advanced_topics, Advanced Topics} section,
+@RefMacro{BOOST_LOCAL_FUNCTION},
+@RefMacro{BOOST_LOCAL_FUNCTION_NAME_TPL}.
+*/
+#define BOOST_LOCAL_FUNCTION_NAME(qualified_name)
+
+/**
+@brief This macro is used to end a local function declaration specifying its
+name within templates.
+
+This macro must be used instead of @RefMacro{BOOST_LOCAL_FUNCTION_NAME} when
+declaring a local function within a template.
+A part from that, this macro has the exact same syntax a
+@RefMacro{BOOST_LOCAL_FUNCTION_NAME} (see @RefMacro{BOOST_LOCAL_FUNCTION_NAME}
+for more information):
+@code
+{ // Some declarative context within a template.
+ ...
+ result_type BOOST_LOCAL_FUNCTION_TPL(declarations) {
+ ... // Body code.
+ } BOOST_LOCAL_FUNCTION_NAME_TPL(qualified_name)
+ ...
+}
+@endcode
+
+Note that @RefMacro{BOOST_LOCAL_FUNCTION_TPL} must be used with this macro
+instead of @RefMacro{BOOST_LOCAL_FUNCTION}.
+
+@Note C++03 does not allow to use <c>typename</c> outside templates.
+This library internally manipulates types, these operations require
+<c>typename</c> but only within templates.
+This macro is used to indicate to the library when the enclosing scope is a
+template so the library can correctly use <c>typename</c>.
+
+@See @RefSect{tutorial, Tutorial} section,
+@RefMacro{BOOST_LOCAL_FUNCTION_NAME}, @RefMacro{BOOST_LOCAL_FUNCTION_TPL}.
+*/
+#define BOOST_LOCAL_FUNCTION_NAME_TPL(name)
+
+/**
+@brief This macro expands to the type of the specified bound variable.
+
+This macro can be used within the local functions body to refer to the bound
+variable types so to declare local variables, check concepts (using
+Boost.ConceptCheck), etc (see the @RefSect{advanced_topics, Advanced Topics}
+section).
+This way the local function can be programmed entirely without explicitly
+specifying the bound variable types thus facilitating maintenance (e.g., if
+the type of a bound variable changes in the enclosing scope, the local function
+code does not have to change).
+
+@Params
+@Param{bound_variable_name,
+The name of one of the local function's bound variables.
+}
+@EndParams
+
+The type returned by the macro is fully qualified in that it contains the extra
+constant and reference qualifiers when the specified variable is bound by
+constant and by reference.
+For example, if a variable named <c>t</c> of type <c>T</c> is:
+@li Bound by value using <c>bind t</c> then
+<c>BOOST_LOCAL_FUNCTION_TYPEOF(t)</c> is <c>T</c>.
+@li Bound by constant value using <c>const bind t</c> then
+<c>BOOST_LOCAL_FUNCTION_TYPEOF(t)</c> is <c>const T</c>.
+@li Bound by reference using <c>bind& t</c> then
+<c>BOOST_LOCAL_FUNCTION_TYPEOF(t)</c> is <c>T&</c>.
+@li Bound by constant reference using <c>const bind& t</c> then
+<c>BOOST_LOCAL_FUNCTION_TYPEOF(t)</c> is <c>const T&</c>.
+
+This macro must be prefixed by <c>typename</c> when used within templates.
+
+@Note It is best to use this macro instead of Boost.Typeof so to reduce the
+number of times Boost.Typeof is used to deduce types (see the
+@RefSect{advanced_topics, Advanced Topics} section).
+
+@See @RefSect{advanced_topics, Advanced Topics} section,
+@RefMacro{BOOST_LOCAL_FUNCTION}.
+*/
+#define BOOST_LOCAL_FUNCTION_TYPEOF(bound_variable_name)
+
+#endif // DOXYGEN
+
+#endif // #include guard
+
diff --git a/boost/local_function/aux_/add_pointed_const.hpp b/boost/local_function/aux_/add_pointed_const.hpp
new file mode 100644
index 0000000000..9cd7aa6375
--- /dev/null
+++ b/boost/local_function/aux_/add_pointed_const.hpp
@@ -0,0 +1,33 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_AUX_ADD_POINTED_CONST_HPP_
+#define BOOST_LOCAL_FUNCTION_AUX_ADD_POINTED_CONST_HPP_
+
+namespace boost { namespace local_function { namespace aux {
+
+// Metafunction to add const to pointed type `T` (i.e. converts
+// `T* [const]` to `T const* [const]`). `boost::add_const<>` cannot be used
+// instead because only adds outer const.
+
+template<typename T> struct add_pointed_const { typedef T type; };
+
+template<typename T> struct add_pointed_const<T*> { typedef T const* type; };
+
+template<typename T> struct add_pointed_const<T const*>
+ { typedef T const* type; };
+
+template<typename T> struct add_pointed_const<T* const>
+ { typedef T const* const type; };
+
+template<typename T> struct add_pointed_const<T const* const>
+ { typedef T const* const type; };
+
+} } } // namespace
+
+#endif //#include guard
+
diff --git a/boost/local_function/aux_/function.hpp b/boost/local_function/aux_/function.hpp
new file mode 100644
index 0000000000..e6de939743
--- /dev/null
+++ b/boost/local_function/aux_/function.hpp
@@ -0,0 +1,330 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#if !BOOST_PP_IS_ITERATING
+# ifndef BOOST_LOCAL_FUNCTION_AUX_FUNCTION_HPP_
+# define BOOST_LOCAL_FUNCTION_AUX_FUNCTION_HPP_
+
+# include <boost/local_function/config.hpp>
+# include <boost/local_function/aux_/member.hpp>
+# include <boost/call_traits.hpp>
+# include <boost/typeof/typeof.hpp>
+# include <boost/config.hpp>
+# include <boost/preprocessor/iteration/iterate.hpp>
+# include <boost/preprocessor/repetition/repeat.hpp>
+# include <boost/preprocessor/repetition/enum.hpp>
+# include <boost/preprocessor/punctuation/comma_if.hpp>
+# include <boost/preprocessor/arithmetic/add.hpp>
+# include <boost/preprocessor/arithmetic/sub.hpp>
+# include <boost/preprocessor/arithmetic/inc.hpp>
+# include <boost/preprocessor/control/iif.hpp>
+# include <boost/preprocessor/cat.hpp>
+
+// PRIVATE //
+
+#define BOOST_LOCAL_FUNCTION_AUX_FUNCTION_THIS_FILE_ \
+ "boost/local_function/aux_/function.hpp"
+
+// PUBLIC //
+
+#define BOOST_LOCAL_FUNCTION_AUX_FUNCTION_INIT_CALL_FUNC \
+ BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (init_call) )
+
+#define BOOST_LOCAL_FUNCTION_AUX_typename_seq(z, n, unused) \
+ (typename)
+
+#define BOOST_LOCAL_FUNCTION_AUX_arg_type(z, arg_n, unused) \
+ BOOST_PP_CAT(Arg, arg_n)
+
+#define BOOST_LOCAL_FUNCTION_AUX_arg_typedef(z, arg_n, unused) \
+ typedef \
+ BOOST_LOCAL_FUNCTION_AUX_arg_type(z, arg_n, ~) \
+ /* name must follow Boost.FunctionTraits arg1_type, arg2_type, ... */ \
+ BOOST_PP_CAT(BOOST_PP_CAT(arg, BOOST_PP_INC(arg_n)), _type) \
+ ;
+
+#define BOOST_LOCAL_FUNCTION_AUX_comma_arg_tparam(z, arg_n, unused) \
+ , typename BOOST_LOCAL_FUNCTION_AUX_arg_type(z, arg_n, ~)
+
+#define BOOST_LOCAL_FUNCTION_AUX_arg_param_type(z, arg_n, comma01) \
+ BOOST_PP_COMMA_IF(comma01) \
+ typename ::boost::call_traits< \
+ BOOST_LOCAL_FUNCTION_AUX_arg_type(z, arg_n, ~) \
+ >::param_type
+
+#define BOOST_LOCAL_FUNCTION_AUX_arg_name(z, arg_n, comma01) \
+ BOOST_PP_COMMA_IF(comma01) \
+ BOOST_PP_CAT(arg, arg_n)
+
+#define BOOST_LOCAL_FUNCTION_AUX_arg_param_decl(z, arg_n, unused) \
+ BOOST_LOCAL_FUNCTION_AUX_arg_param_type(z, arg_n, 0 /* no leading comma */)\
+ BOOST_LOCAL_FUNCTION_AUX_arg_name(z, arg_n, 0 /* no leading comma */)
+
+#define BOOST_LOCAL_FUNCTION_AUX_bind_type(z, bind_n, unused) \
+ BOOST_PP_CAT(Bind, bind_n)
+
+#define BOOST_LOCAL_FUNCTION_AUX_comma_bind_type(z, bind_n, unused) \
+ , BOOST_LOCAL_FUNCTION_AUX_bind_type(z, bind_n, ~)
+
+#define BOOST_LOCAL_FUNCTION_AUX_comma_bind_ref(z, bind_n, unused) \
+ , BOOST_LOCAL_FUNCTION_AUX_bind_type(z, bind_n, ~) &
+
+#define BOOST_LOCAL_FUNCTION_AUX_comma_bind_tparam(z, bind_n, unused) \
+ , typename BOOST_LOCAL_FUNCTION_AUX_bind_type(z, bind_n, ~)
+
+#define BOOST_LOCAL_FUNCTION_AUX_bind_name(z, bind_n, unused) \
+ BOOST_PP_CAT(bing, bind_n)
+
+#define BOOST_LOCAL_FUNCTION_AUX_comma_bind_param_decl(z, bind_n, unused) \
+ , \
+ BOOST_LOCAL_FUNCTION_AUX_bind_type(z, bind_n, ~) & \
+ BOOST_LOCAL_FUNCTION_AUX_bind_name(z, bind_n, ~)
+
+#define BOOST_LOCAL_FUNCTION_AUX_bind_member(z, bind_n, unsued) \
+ BOOST_PP_CAT(BOOST_LOCAL_FUNCTION_AUX_bind_name(z, bind_n, ~), _)
+
+#define BOOST_LOCAL_FUNCTION_AUX_comma_bind_member_deref(z, bind_n, unsued) \
+ , member_deref< BOOST_LOCAL_FUNCTION_AUX_bind_type(z, bind_n, ~) >( \
+ BOOST_LOCAL_FUNCTION_AUX_bind_member(z, bind_n, ~))
+
+#define BOOST_LOCAL_FUNCTION_AUX_bind_member_init(z, bind_n, unused) \
+ BOOST_LOCAL_FUNCTION_AUX_bind_member(z, bind_n, ~) = member_addr( \
+ BOOST_LOCAL_FUNCTION_AUX_bind_name(z, bind_n, ~));
+
+#define BOOST_LOCAL_FUNCTION_AUX_bind_member_decl(z, bind_n, unused) \
+ /* must be ptr (not ref) so can use default constr */ \
+ typename member_type< \
+ BOOST_LOCAL_FUNCTION_AUX_bind_type(z, bind_n, ~) \
+ >::pointer BOOST_LOCAL_FUNCTION_AUX_bind_member(z, bind_n, ~) ;
+
+#define BOOST_LOCAL_FUNCTION_AUX_call_ptr(z, n, unused) \
+ BOOST_PP_CAT(call_ptr, n)
+
+#define BOOST_LOCAL_FUNCTION_AUX_call_name(z, n, unused) \
+ BOOST_PP_CAT(call, n)
+
+#define BOOST_LOCAL_FUNCTION_AUX_call_member(z, n, unused) \
+ BOOST_PP_CAT(BOOST_LOCAL_FUNCTION_AUX_call_name(z, n, unused), _)
+
+#define BOOST_LOCAL_FUNCTION_AUX_call_typedef(z, n, arity) \
+ typedef R (*BOOST_LOCAL_FUNCTION_AUX_call_ptr(z, n, ~))( \
+ object_ptr \
+ BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS, \
+ BOOST_PP_TUPLE_EAT(3) \
+ , \
+ BOOST_PP_REPEAT_ ## z \
+ )(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX, \
+ BOOST_LOCAL_FUNCTION_AUX_comma_bind_ref, ~) \
+ BOOST_PP_REPEAT_ ## z(BOOST_PP_SUB(arity, n), \
+ BOOST_LOCAL_FUNCTION_AUX_arg_param_type, 1 /* leading comma */)\
+ );
+
+#define BOOST_LOCAL_FUNCTION_AUX_comma_call_param_decl(z, n, unused) \
+ , \
+ BOOST_LOCAL_FUNCTION_AUX_call_ptr(z, n, ~) \
+ BOOST_LOCAL_FUNCTION_AUX_call_name(z, n, ~)
+
+#define BOOST_LOCAL_FUNCTION_AUX_call_decl(z, n, unused) \
+ BOOST_LOCAL_FUNCTION_AUX_call_ptr(z, n, ~) \
+ BOOST_LOCAL_FUNCTION_AUX_call_member(z, n, ~);
+
+#define BOOST_LOCAL_FUNCTION_AUX_call_init(z, n, unused) \
+ BOOST_LOCAL_FUNCTION_AUX_call_member(z, n, ~) = \
+ BOOST_LOCAL_FUNCTION_AUX_call_name(z, n, ~);
+
+#define BOOST_LOCAL_FUNCTION_AUX_operator_call(z, defaults_n, arity) \
+ /* precondition: object_ && call_function_ */ \
+ inline R operator()( \
+ BOOST_PP_ENUM_ ## z(BOOST_PP_SUB(arity, defaults_n), \
+ BOOST_LOCAL_FUNCTION_AUX_arg_param_decl, ~) \
+ ) /* cannot be const because of binds (same as for local ftor) */ { \
+ /* run-time: do not assert preconditions here for efficiency */ \
+ /* run-time: this function call is done via a function pointer */ \
+ /* so unfortunately does not allow for compiler inlining */ \
+ /* optimizations (an alternative using virtual function was also */ \
+ /* investigated but also virtual functions cannot be optimized */ \
+ /* plus they require virtual table lookups to the alternative */ \
+ /* performed worst) */ \
+ return BOOST_LOCAL_FUNCTION_AUX_call_member(z, defaults_n, ~)( \
+ object_ \
+ BOOST_PP_IIF( \
+ BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS,\
+ BOOST_PP_TUPLE_EAT(3) \
+ , \
+ BOOST_PP_REPEAT_ ## z \
+ )(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX, \
+ BOOST_LOCAL_FUNCTION_AUX_comma_bind_member_deref, ~) \
+ BOOST_PP_REPEAT_ ## z(BOOST_PP_SUB(arity, defaults_n), \
+ BOOST_LOCAL_FUNCTION_AUX_arg_name, 1 /* leading comma */) \
+ ); \
+ }
+
+namespace boost { namespace local_function { namespace aux {
+
+template<
+ typename F
+ , size_t defaults
+#if !BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
+ BOOST_PP_REPEAT(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX,
+ BOOST_LOCAL_FUNCTION_AUX_comma_bind_tparam, ~)
+#endif
+>
+class function {}; // Empty template, only use its specializations.
+
+// Iterate within namespace.
+# define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (0, BOOST_LOCAL_FUNCTION_CONFIG_FUNCTION_ARITY_MAX, \
+ BOOST_LOCAL_FUNCTION_AUX_FUNCTION_THIS_FILE_))
+# include BOOST_PP_ITERATE() // Iterate over function arity.
+
+} } } // namespace
+
+// Register type for type-of emu (NAME use TYPEOF to deduce this fctor type).
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::local_function::aux::function,
+ (typename) // For `F` tparam.
+ (size_t) // For `defaults` tparam.
+ // MSVC error if using #if instead of PP_IIF here.
+ BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS,
+ BOOST_PP_TUPLE_EAT(3) // Nothing.
+ ,
+ BOOST_PP_REPEAT // For bind tparams.
+ )(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX,
+ BOOST_LOCAL_FUNCTION_AUX_typename_seq, ~)
+)
+
+#undef BOOST_LOCAL_FUNCTION_AUX_typename_seq
+#undef BOOST_LOCAL_FUNCTION_AUX_arg_type
+#undef BOOST_LOCAL_FUNCTION_AUX_arg_typedef
+#undef BOOST_LOCAL_FUNCTION_AUX_comma_arg_tparam
+#undef BOOST_LOCAL_FUNCTION_AUX_arg_param_type
+#undef BOOST_LOCAL_FUNCTION_AUX_arg_name
+#undef BOOST_LOCAL_FUNCTION_AUX_arg_param_decl
+#undef BOOST_LOCAL_FUNCTION_AUX_bind_type
+#undef BOOST_LOCAL_FUNCTION_AUX_comma_bind_type
+#undef BOOST_LOCAL_FUNCTION_AUX_comma_bind_ref
+#undef BOOST_LOCAL_FUNCTION_AUX_comma_bind_tparam
+#undef BOOST_LOCAL_FUNCTION_AUX_bind_name
+#undef BOOST_LOCAL_FUNCTION_AUX_comma_bind_param_decl
+#undef BOOST_LOCAL_FUNCTION_AUX_bind_member
+#undef BOOST_LOCAL_FUNCTION_AUX_comma_bind_member_deref
+#undef BOOST_LOCAL_FUNCTION_AUX_bind_member_init
+#undef BOOST_LOCAL_FUNCTION_AUX_bind_member_decl
+#undef BOOST_LOCAL_FUNCTION_AUX_call_ptr
+#undef BOOST_LOCAL_FUNCTION_AUX_call_name
+#undef BOOST_LOCAL_FUNCTION_AUX_call_member
+#undef BOOST_LOCAL_FUNCTION_AUX_call_typedef
+#undef BOOST_LOCAL_FUNCTION_AUX_comma_call_param_decl
+#undef BOOST_LOCAL_FUNCTION_AUX_call_decl
+#undef BOOST_LOCAL_FUNCTION_AUX_call_init
+#undef BOOST_LOCAL_FUNCTION_AUX_operator_call
+
+# endif // #include guard
+
+#elif BOOST_PP_ITERATION_DEPTH() == 1
+# define BOOST_LOCAL_FUNCTION_AUX_arity BOOST_PP_FRAME_ITERATION(1)
+# define BOOST_PP_ITERATION_PARAMS_2 \
+ (3, (0, BOOST_LOCAL_FUNCTION_AUX_arity, \
+ BOOST_LOCAL_FUNCTION_AUX_FUNCTION_THIS_FILE_))
+# include BOOST_PP_ITERATE() // Iterate over default params count.
+# undef BOOST_LOCAL_FUNCTION_AUX_arity
+
+#elif BOOST_PP_ITERATION_DEPTH() == 2
+# define BOOST_LOCAL_FUNCTION_AUX_defaults BOOST_PP_FRAME_ITERATION(2)
+
+template<
+ typename R
+ BOOST_PP_REPEAT(BOOST_LOCAL_FUNCTION_AUX_arity,
+ BOOST_LOCAL_FUNCTION_AUX_comma_arg_tparam, ~)
+#if !BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
+ BOOST_PP_REPEAT(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX,
+ BOOST_LOCAL_FUNCTION_AUX_comma_bind_tparam, ~)
+#endif
+>
+class function<
+ R (
+ BOOST_PP_ENUM(BOOST_LOCAL_FUNCTION_AUX_arity,
+ BOOST_LOCAL_FUNCTION_AUX_arg_type, ~)
+ )
+ , BOOST_LOCAL_FUNCTION_AUX_defaults
+#if !BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
+ BOOST_PP_REPEAT(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX,
+ BOOST_LOCAL_FUNCTION_AUX_comma_bind_type, ~)
+#endif
+> {
+ // The object type will actually be a local class which cannot be passed as
+ // a template parameter so a generic `void*` pointer is used to hold the
+ // object (this pointer will then be cased by the call-function implemented
+ // by the local class itself). This is the trick used to pass a local
+ // function as a template parameter. This trick uses function pointers for
+ // the call-functions and function pointers cannot always be optimized by
+ // the compiler (they cannot be inlined) thus this trick increased run-time
+ // (another trick using virtual functions for the local class was also
+ // investigated but also virtual functions cannot be inlined plus they
+ // require virtual tables lookups so the virtual functions trick measured
+ // worst run-time performance than the function pointer trick).
+ typedef void* object_ptr;
+ BOOST_PP_REPEAT(BOOST_PP_INC(BOOST_LOCAL_FUNCTION_AUX_defaults),
+ BOOST_LOCAL_FUNCTION_AUX_call_typedef, // INC for no defaults.
+ BOOST_LOCAL_FUNCTION_AUX_arity)
+
+public:
+ // Provide public type interface following Boost.Function names
+ // (traits must be defined in both this and the local functor).
+ BOOST_STATIC_CONSTANT(size_t, arity = BOOST_LOCAL_FUNCTION_AUX_arity);
+ typedef R result_type;
+ BOOST_PP_REPEAT(BOOST_LOCAL_FUNCTION_AUX_arity,
+ BOOST_LOCAL_FUNCTION_AUX_arg_typedef, ~)
+
+ // NOTE: Must have default constructor for init without function name in
+ // function macro expansion.
+
+ // Cannot be private but it should never be used by programmers directly
+ // so used internal symbol.
+ inline void BOOST_LOCAL_FUNCTION_AUX_FUNCTION_INIT_CALL_FUNC(
+ object_ptr object
+#if !BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
+ BOOST_PP_REPEAT(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX,
+ BOOST_LOCAL_FUNCTION_AUX_comma_bind_param_decl, ~)
+#endif
+ BOOST_PP_REPEAT(BOOST_PP_INC(BOOST_LOCAL_FUNCTION_AUX_defaults),
+ BOOST_LOCAL_FUNCTION_AUX_comma_call_param_decl, ~)
+ ) {
+ object_ = object;
+#if !BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
+ BOOST_PP_REPEAT(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX,
+ BOOST_LOCAL_FUNCTION_AUX_bind_member_init, ~)
+#endif
+ BOOST_PP_REPEAT(BOOST_PP_INC(BOOST_LOCAL_FUNCTION_AUX_defaults),
+ BOOST_LOCAL_FUNCTION_AUX_call_init, ~) // INC for no defaults.
+ unused_ = 0; // To avoid a GCC uninitialized warning.
+ }
+
+ // Result operator(Arg1, ..., ArgN-1, ArgN) -- iff defaults >= 0
+ // Result operator(Arg1, ..., ArgN-1) -- iff defaults >= 1
+ // ... -- etc
+ BOOST_PP_REPEAT(BOOST_PP_INC(BOOST_LOCAL_FUNCTION_AUX_defaults),
+ BOOST_LOCAL_FUNCTION_AUX_operator_call, // INC for no defaults.
+ BOOST_LOCAL_FUNCTION_AUX_arity)
+
+private:
+ object_ptr object_;
+#if !BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
+ BOOST_PP_REPEAT(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX,
+ BOOST_LOCAL_FUNCTION_AUX_bind_member_decl, ~)
+#endif
+ BOOST_PP_REPEAT(BOOST_PP_INC(BOOST_LOCAL_FUNCTION_AUX_defaults),
+ BOOST_LOCAL_FUNCTION_AUX_call_decl, ~) // INC for no defaults.
+
+ // run-time: this unused void* member variable allows for compiler
+ // optimizations (at least on MSVC it reduces invocation time of about 50%)
+ void* unused_;
+};
+
+# undef BOOST_LOCAL_FUNCTION_AUX_defaults
+#endif // iteration
+
diff --git a/boost/local_function/aux_/macro/code_/bind.hpp b/boost/local_function/aux_/macro/code_/bind.hpp
new file mode 100644
index 0000000000..b235e7384b
--- /dev/null
+++ b/boost/local_function/aux_/macro/code_/bind.hpp
@@ -0,0 +1,252 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_HPP_
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_HPP_
+
+#include <boost/local_function/aux_/symbol.hpp>
+#include <boost/local_function/aux_/macro/decl.hpp>
+#include <boost/local_function/aux_/preprocessor/traits/bind.hpp>
+#include <boost/local_function/aux_/preprocessor/traits/decl_binds.hpp>
+#include <boost/local_function/aux_/preprocessor/traits/decl_const_binds.hpp>
+#include <boost/utility/identity_type.hpp>
+#include <boost/scope_exit.hpp>
+#include <boost/type_traits/remove_reference.hpp>
+#include <boost/type_traits/function_traits.hpp>
+#include <boost/preprocessor/control/expr_iif.hpp>
+#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/facilities/empty.hpp>
+#include <boost/preprocessor/facilities/is_empty.hpp>
+#include <boost/preprocessor/facilities/identity.hpp>
+#include <boost/preprocessor/logical/bitand.hpp>
+#include <boost/preprocessor/punctuation/comma_if.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+#include <boost/preprocessor/tuple/eat.hpp>
+#include <boost/preprocessor/list/adt.hpp>
+#include <boost/preprocessor/list/for_each_i.hpp>
+#include <boost/preprocessor/list/append.hpp>
+
+// PRIVATE //
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_PARAMS_VAR_(id) \
+ BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (params)(id) )
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_TAG_DECL_(r, id, i, bind_traits) \
+ BOOST_SCOPE_EXIT_DETAIL_TAG_DECL(r, id, i, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE( \
+ bind_traits))
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_CAPTURE_DECL_TYPED_( \
+ r, id, typename01, i, bind_traits) \
+ typedef BOOST_PP_EXPR_IIF(typename01, typename) \
+ /* remove ref because typed var can have & prefix */ \
+ ::boost::remove_reference< BOOST_PP_EXPR_IIF(typename01, typename) \
+ ::boost::function_traits< \
+ /* instead of using Boost.Typeof, get bind type as 1st */ \
+ /* argument type of func type `void (type_ [&] var_)` */ \
+ void ( BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_VAR_WITH_TYPE( \
+ bind_traits) ) \
+ >::arg1_type \
+ >::type \
+ BOOST_SCOPE_EXIT_DETAIL_CAPTURE_T(id, i, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE( \
+ bind_traits)) \
+ ; /* close typedef */
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_CAPTURE_DECL_DEDUCED_( \
+ r, id, typename01, i, bind_traits) \
+ BOOST_SCOPE_EXIT_DETAIL_CAPTURE_DECL(r, \
+ ( \
+ id \
+ , \
+ /* ScopeExit expects typename or EMPTY() here */ \
+ BOOST_PP_EXPR_IIF(typename01, typename) \
+ ), \
+ i, BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE( \
+ bind_traits))
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_CAPTURE_DECL_( \
+ r, id_typename, i, bind_traits) \
+ BOOST_PP_IIF(BOOST_PP_IS_EMPTY( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_VAR_WITH_TYPE(bind_traits)), \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_CAPTURE_DECL_DEDUCED_ \
+ , \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_CAPTURE_DECL_TYPED_ \
+ )(r, BOOST_PP_TUPLE_ELEM(2, 0, id_typename), \
+ BOOST_PP_TUPLE_ELEM(2, 1, id_typename), i, bind_traits)
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_PARAM_DECL_( \
+ r, id_typename, i, bind_traits) \
+ BOOST_SCOPE_EXIT_DETAIL_PARAM_DECL(r, \
+ ( \
+ BOOST_PP_TUPLE_ELEM(2, 0, id_typename) \
+ , \
+ /* ScopeExit expects typename or EMPTY() here */ \
+ BOOST_PP_EXPR_IIF(BOOST_PP_TUPLE_ELEM(2, 1, id_typename), \
+ typename \
+ ) \
+ ), \
+ i, BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE( \
+ bind_traits))
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_MEMBER_DECL_VAR_( \
+ r, id, typename01, i, var) \
+ BOOST_PP_EXPR_IIF(typename01, typename) \
+ BOOST_IDENTITY_TYPE(( /* must use IDENTITY because of tparam comma */ \
+ ::boost::scope_exit::detail::member< \
+ BOOST_SCOPE_EXIT_DETAIL_PARAM_T(id, i, var) \
+ , BOOST_SCOPE_EXIT_DETAIL_TAG(id, i) \
+ > \
+ )) \
+ BOOST_SCOPE_EXIT_DETAIL_PARAM(id, i, var);
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_MEMBER_DECL_( \
+ r, id_typename, i, bind_traits) \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_MEMBER_DECL_VAR_(r, \
+ BOOST_PP_TUPLE_ELEM(2, 0, id_typename), \
+ BOOST_PP_TUPLE_ELEM(2, 1, id_typename), \
+ i, BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE( \
+ bind_traits))
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_PARAM_INIT_(r, id, i, bind_traits) \
+ BOOST_SCOPE_EXIT_DETAIL_PARAM_INIT(r, id, i, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE( \
+ bind_traits))
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_CAPTURE_TYPE_(id) \
+ BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (this_capture_type)(id) )
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE_(id) \
+ BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (this_type)(id) )
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPEDEF_DEDUCED_( \
+ id, typename01, all_bind_this_types) \
+ BOOST_SCOPE_EXIT_DETAIL_TYPEDEF_TYPEOF_THIS(id, \
+ BOOST_PP_EXPR_IIF(typename01, typename), /* otherwise EMPTY() */ \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_CAPTURE_TYPE_(id))
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPEDEF_TYPED_( \
+ id, typename01, all_bind_this_types) \
+ typedef \
+ BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_THIS_TYPE(BOOST_PP_LIST_FIRST( \
+ all_bind_this_types)) \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_CAPTURE_TYPE_(id) \
+ ;
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPEDEF_( \
+ id, typename01, all_bind_this_types) \
+ /* typedef type_ */ \
+ BOOST_PP_IIF(BOOST_PP_IS_EMPTY( \
+ /* all_bind_this_type is list with 1 elem (possibly PP_EMPTY), */ \
+ /* otherwise got a pp-parsing error before getting here */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_THIS_TYPE( \
+ BOOST_PP_LIST_FIRST(all_bind_this_types))), \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPEDEF_DEDUCED_ \
+ , \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPEDEF_TYPED_ \
+ )(id, typename01, all_bind_this_types)
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_ALL_( \
+ all_binds, all_bind_this_types, id, typename01) \
+ /* binding tags */ \
+ BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(all_bind_this_types), \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPEDEF_ \
+ , \
+ BOOST_PP_TUPLE_EAT(3) \
+ )(id, typename01, all_bind_this_types) \
+ BOOST_PP_LIST_FOR_EACH_I(BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_TAG_DECL_, id, \
+ all_binds) \
+ BOOST_PP_LIST_FOR_EACH_I(BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_CAPTURE_DECL_, \
+ (id, typename01), all_binds) \
+ /* binding class */ \
+ struct BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id) { \
+ /* interim capture types to workaround internal error on old GCC */ \
+ BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(all_bind_this_types), \
+ typedef BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_CAPTURE_TYPE_(id) \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE_(id) ; \
+ ) \
+ BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(all_bind_this_types), \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE_(id) \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_VAR; \
+ ) \
+ BOOST_PP_LIST_FOR_EACH_I( \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_PARAM_DECL_, \
+ (id, typename01), all_binds) \
+ BOOST_PP_LIST_FOR_EACH_I( \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_MEMBER_DECL_, \
+ (id, typename01), all_binds) \
+ } BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_PARAMS_VAR_(id) = \
+ /* NOTE: there is no way to wrap member initializer commas within */ \
+ /* parenthesis so you must handle these commas manually if expanding */ \
+ /* this macro within another macro */ \
+ { \
+ /* initialize the struct with param values to bind */ \
+ BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(all_bind_this_types), \
+ this) /* here name `this` access object at enclosing scope */ \
+ BOOST_PP_COMMA_IF(BOOST_PP_BITAND( \
+ BOOST_PP_LIST_IS_CONS(all_bind_this_types) \
+ , BOOST_PP_LIST_IS_CONS(all_binds) \
+ )) \
+ BOOST_PP_LIST_FOR_EACH_I( \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_PARAM_INIT_, id, all_binds) \
+ };
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_(id, typename01, decl_traits) \
+ /* IMPORTANT: the order of these appends is important, it must follow */ \
+ /* the indexing order used by the functor code which starts */ \
+ /* enumerating const binds and then non-const binds */ \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_ALL_( \
+ BOOST_PP_LIST_APPEND( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_CONST_BINDS( \
+ decl_traits),\
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_BINDS( \
+ decl_traits)), \
+ BOOST_PP_LIST_APPEND( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_CONST_BIND_THIS_TYPES(decl_traits), \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_BIND_THIS_TYPES( \
+ decl_traits)), \
+ id, typename01)
+
+// PUBLIC //
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id, typename01) \
+ BOOST_PP_EXPR_IIF(typename01, typename) \
+ BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id):: \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE_(id)
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_VAR \
+ BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (this_var) )
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_BIND(id, typename01, decl_traits) \
+ /* the binding data structures must be declared and initialized (to */ \
+ /* empty structs, so hopefully the compiler will optimize away the */ \
+ /* no-op code) even when there is no bound param because these structs */ \
+ /* are used to init `...args.value` which is always used by the `END` */ \
+ /* macro later because this macro does not know if there are bound */ \
+ /* params or not */ \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_(id, typename01, decl_traits) \
+ /* this code takes advantage of the template argument list/comparison */ \
+ /* operator ambiguity to declare a variable iff it hasn't already been */ \
+ /* declared in that scope; the second occurrence is parsed as: */ \
+ /* (declared<(resolve<sizeof(boost_local_auxXargs)>::cmp1<0)>::cmp2> */ \
+ /* ...Xargs); */ \
+ /* which is a no-op */ \
+ ::boost::scope_exit::detail::declared< boost::scope_exit::detail::resolve< \
+ /* cannot prefix with `::` as in `sizeof(:: ...` because the name */ \
+ /* must refer to the local variable name to allow multiple local */ \
+ /* functions (and exits) within the same scope (however this */ \
+ /* does not allow for nesting because local variables cannot be */ \
+ /* used in nested code blocks) */ \
+ sizeof(BOOST_LOCAL_FUNCTION_AUX_DECL_ARGS_VAR) \
+ >::cmp1<0>::cmp2 > BOOST_LOCAL_FUNCTION_AUX_DECL_ARGS_VAR; \
+ /* stores bound types/values into `...args` variable (args variable */ \
+ /* can be accessed by `NAME` macro because doesn't use __LINE__ id) */ \
+ BOOST_LOCAL_FUNCTION_AUX_DECL_ARGS_VAR.value = \
+ &BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_PARAMS_VAR_(id);
+
+#endif // #include guard
+
diff --git a/boost/local_function/aux_/macro/code_/functor.hpp b/boost/local_function/aux_/macro/code_/functor.hpp
new file mode 100644
index 0000000000..cc34946260
--- /dev/null
+++ b/boost/local_function/aux_/macro/code_/functor.hpp
@@ -0,0 +1,892 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_HPP_
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_HPP_
+
+#include <boost/local_function/config.hpp>
+#include <boost/local_function/aux_/symbol.hpp>
+#include <boost/local_function/aux_/function.hpp>
+#include <boost/local_function/aux_/add_pointed_const.hpp>
+#include <boost/local_function/aux_/member.hpp>
+#include <boost/local_function/aux_/nobind.hpp>
+#include <boost/local_function/aux_/macro/decl.hpp>
+#include <boost/local_function/aux_/macro/typeof.hpp>
+#include <boost/local_function/aux_/macro/code_/result.hpp>
+#include <boost/local_function/aux_/macro/code_/bind.hpp>
+#include <boost/local_function/aux_/preprocessor/traits/decl_params.hpp>
+#include <boost/local_function/aux_/preprocessor/traits/decl_binds.hpp>
+#include <boost/local_function/aux_/preprocessor/traits/decl_const_binds.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/auto.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/register.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/thisunderscore.hpp>
+#include <boost/utility/identity_type.hpp>
+#include <boost/scope_exit.hpp>
+#include <boost/type_traits/add_const.hpp>
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/punctuation/comma_if.hpp>
+#include <boost/preprocessor/control/expr_iif.hpp>
+#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/facilities/expand.hpp>
+#include <boost/preprocessor/facilities/is_empty.hpp>
+#include <boost/preprocessor/facilities/empty.hpp>
+#include <boost/preprocessor/facilities/identity.hpp>
+#include <boost/preprocessor/repetition/enum.hpp>
+#include <boost/preprocessor/repetition/repeat.hpp>
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/arithmetic/sub.hpp>
+#include <boost/preprocessor/arithmetic/add.hpp>
+#include <boost/preprocessor/logical/bitor.hpp>
+#include <boost/preprocessor/logical/bitand.hpp>
+#include <boost/preprocessor/logical/compl.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+#include <boost/preprocessor/tuple/eat.hpp>
+#include <boost/preprocessor/tuple/rem.hpp>
+#include <boost/preprocessor/list/adt.hpp>
+#include <boost/preprocessor/list/size.hpp>
+#include <boost/preprocessor/list/for_each_i.hpp>
+#include <boost/preprocessor/list/first_n.hpp>
+
+// PRIVATE //
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_CLASS_TYPE_(id) \
+ BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (functor)(id) )
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_F_TYPE_ \
+ BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (function_type) )
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BODY_FUNC_ \
+ BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (body) )
+
+// Unbind parameters.
+
+// i: 1 for 1st param, 2 for 2nd, ... (start from 1 not 0).
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_ARG_NAME_(i) \
+ /* this must be a generic parameter name because type and name */ \
+ /* are not separate tokens in the macro syntax so name is not available */ \
+ /* separately from its type */ \
+ BOOST_PP_CAT(arg, i)
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_ARG_NAME_ENUM_( \
+ r, unused, i, param_traits) \
+ BOOST_PP_COMMA_IF(i) /* enumeration commas */ \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_ARG_NAME_(BOOST_PP_INC(i))
+
+// i: 1 for 1st param, 2 for 2nd, ... (start from 1 not 0).
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_ARG_TYPE_(typename01, i) \
+ /* the parameter type must be accessed using function traits from */ \
+ /* function type because it is not available to the macro syntax */ \
+ /* separately from the parameter name */ \
+ BOOST_PP_EXPR_IIF(typename01, typename) \
+ ::boost::function_traits< \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_F_TYPE_ \
+ >::BOOST_PP_CAT(BOOST_PP_CAT(arg, i), _type) \
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_ARG_TYPEDEF_( \
+ r, typename01, i, param_traits) \
+ typedef \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_ARG_TYPE_(typename01, \
+ BOOST_PP_INC(i)) \
+ /* name must follow Boost.FunctionTraits arg1_type, arg2_type, ... */ \
+ BOOST_PP_CAT(BOOST_PP_CAT(arg, BOOST_PP_INC(i)), _type) \
+ ;
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_ARG_DECL_( \
+ r, typename01, i, param_traits) \
+ BOOST_PP_EXPR_IIF(typename01, typename) \
+ ::boost::call_traits< \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_ARG_TYPE_(typename01, \
+ BOOST_PP_INC(i)) \
+ >::param_type \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_ARG_NAME_(BOOST_PP_INC(i))
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_ARG_DECL_ENUM_( \
+ r, typename01, i, param_traits) \
+ BOOST_PP_COMMA_IF(i) \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_ARG_DECL_(r, typename01, i, \
+ param_traits)
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_PARAM_ARG_DECL_( \
+ r, typename01, i, param_traits) \
+ , BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_ARG_DECL_(r, typename01, i, \
+ param_traits)
+
+// Precondition: !EMPTY(DEFAULT(param_traits))
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_DEFAULT_ASSIGNMENT_( \
+ param_traits) \
+ = BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_DEFAULT_REMOVE_FRONT( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_PARAM_TRAITS_DEFAULT(param_traits))
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_DECL_ENUM_( \
+ r, default01, i, param_traits) \
+ BOOST_PP_COMMA_IF(i) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_AUTO_REMOVE_BACK( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_REGISTER_REMOVE_BACK( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_PARAM_TRAITS_DECL(param_traits) \
+ )) \
+ BOOST_PP_IIF(BOOST_PP_COMPL(default01), \
+ BOOST_PP_TUPLE_EAT(1) /* without default */ \
+ , BOOST_PP_IIF(BOOST_PP_IS_EMPTY( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_PARAM_TRAITS_DEFAULT(param_traits)), \
+ BOOST_PP_TUPLE_EAT(1) /* has no default */ \
+ , /* else, with default and has default */ \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_DEFAULT_ASSIGNMENT_ \
+ ))(param_traits)
+
+// Bound parameters.
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAMS_ \
+ bind_params /* constructor void* param */
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_VAR_(i) \
+ /* named `bind0`, `bind1`, ... */ \
+ BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (bind)(i) )
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_MEMBER_THIS_ \
+ BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (bind_this) )
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_STATIC_BIND_MEMBER_THIS_( \
+ id) \
+ , static_cast< BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_CLASS_TYPE_(id)* >( \
+ object)->BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_MEMBER_THIS_
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_TYPE_( \
+ id, typename01, offset, i, bind_var_without_type) \
+ BOOST_PP_EXPR_IIF(typename01, typename) \
+ BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id):: \
+ BOOST_SCOPE_EXIT_DETAIL_PARAM_T(id, BOOST_PP_ADD(i, offset), \
+ bind_var_without_type) \
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_MEMBER_BIND_ENUM_( \
+ r, offset, i, bind_traits) \
+ BOOST_PP_COMMA_IF(i) \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_VAR_( \
+ BOOST_PP_ADD(offset, i))
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_TYPE_( \
+ r, id_typename_offset_const, i, bind_var_without_type) \
+ /* IMPORTANT: here can't use `PP_KEYWORD_IS_THISUNDERSCORE_FRONT()` */ \
+ /* because some `param_name` might start with non-alphanumeric symbol */ \
+ /* `&` (but that is never the case for `this`) */ \
+ BOOST_PP_IIF(BOOST_PP_COMPL(BOOST_PP_TUPLE_ELEM(4, 3, \
+ id_typename_offset_const)), \
+ BOOST_PP_EMPTY \
+ , BOOST_PP_IIF( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_THISUNDERSCORE_BACK( \
+ bind_var_without_type), \
+ /* pointed obj const */ \
+ BOOST_PP_EXPR_IIF(BOOST_PP_TUPLE_ELEM(4, 1, id_typename_offset_const), \
+ typename \
+ ) \
+ BOOST_PP_IDENTITY( ::boost::local_function::aux::add_pointed_const< ) \
+ , \
+ BOOST_PP_EXPR_IIF(BOOST_PP_TUPLE_ELEM(4, 1, id_typename_offset_const), \
+ typename \
+ ) \
+ BOOST_PP_IDENTITY( ::boost::add_const< ) /* outer type const */ \
+ ))() \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_TYPE_( \
+ BOOST_PP_TUPLE_ELEM(4, 0, id_typename_offset_const), \
+ BOOST_PP_TUPLE_ELEM(4, 1, id_typename_offset_const), \
+ BOOST_PP_TUPLE_ELEM(4, 2, id_typename_offset_const), \
+ i, bind_var_without_type) \
+ BOOST_PP_EXPR_IIF(BOOST_PP_TUPLE_ELEM(4, 3, id_typename_offset_const), \
+ >::type \
+ )
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_( \
+ r, id_typename_offset_const, i, bind_var_without_type) \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_TYPE_( \
+ r, id_typename_offset_const, i, bind_var_without_type) \
+ BOOST_PP_IIF( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_THISUNDERSCORE_BACK( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE( \
+ bind_var_without_type)), \
+ this_ BOOST_PP_TUPLE_EAT(1) \
+ , \
+ BOOST_PP_TUPLE_REM(1) \
+ )(bind_var_without_type)
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_MAYBECONST_BIND_TYPE_( \
+ r, id_typename_offset_const, i, bind_traits) \
+ , BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_TYPE_( \
+ r, id_typename_offset_const, i, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE( \
+ bind_traits))
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_PARAM_( \
+ offset, i) \
+ BOOST_PP_CAT(bind, BOOST_PP_ADD(offset, i))
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_PARAM_ENUM_( \
+ r, offset, i, bind_traits) \
+ BOOST_PP_COMMA_IF(i) \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_PARAM_(offset, i)
+
+#define \
+BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_MAYBECONST_BIND_PARAM_DECL_( \
+ r, id_typename_offset_const, i, bind_traits) \
+ , BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_TYPE_( \
+ r, id_typename_offset_const, i, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE( \
+ bind_traits)) & \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_PARAM_( \
+ BOOST_PP_TUPLE_ELEM(4, 2, id_typename_offset_const), i)
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_BIND_THIS_TYPE_( \
+ id, typename01) \
+ , BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id, typename01)
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_THIS_PARAM_ \
+ bind_this
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_BIND_THIS_PARAM_DECL_( \
+ id, typename01) \
+ , BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id, typename01) & \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_THIS_PARAM_
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_NOBIND_(z, n, unused) \
+ , ::boost::local_function::aux::nobind
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_NOBIND_TYPE_(z, n, unused) \
+ , ::boost::local_function::aux::nobind_t
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_NOBIND_PARAM_DECL_( \
+ z, n, unused) \
+ , ::boost::local_function::aux::nobind_t & \
+ /* param name not needed here because no bind param not used */
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_ENUM_( \
+ r, id_typename_offset_const, i, bind_traits) \
+ BOOST_PP_COMMA_IF(i) /* enumeration commas */ \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_( \
+ r, id_typename_offset_const, i, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE( \
+ bind_traits))
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_DECL_( \
+ r, id_typename_offset_const, i, bind_traits) \
+ BOOST_PP_EXPR_IIF(BOOST_PP_TUPLE_ELEM(4, 1, id_typename_offset_const), \
+ typename \
+ ) \
+ ::boost::local_function::aux::member_type< \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_TYPE_( \
+ r, id_typename_offset_const, i, bind_var_without_type) \
+ >::reference \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_VAR_( \
+ BOOST_PP_ADD(i, BOOST_PP_TUPLE_ELEM(4, 2, \
+ id_typename_offset_const))) \
+ ; /* end member variable declaration */
+
+#define \
+BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_MAYBECONST_STATIC_BIND_MEMBER_( \
+ r, id_typename_offset_const, i, bind_traits) \
+ , static_cast< BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_CLASS_TYPE_( \
+ BOOST_PP_TUPLE_ELEM(4, 0, id_typename_offset_const))* >(object)-> \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_VAR_( \
+ BOOST_PP_ADD(i, BOOST_PP_TUPLE_ELEM(4, 2, \
+ id_typename_offset_const)))
+
+#define \
+BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_INIT_ENUM_( \
+ r, id_offset, i, bind_traits) \
+ BOOST_PP_COMMA_IF(i) \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_VAR_( \
+ BOOST_PP_ADD(i, BOOST_PP_TUPLE_ELEM(2, 1, id_offset))) \
+ ( /* member variable initialization */ \
+ static_cast< \
+ BOOST_SCOPE_EXIT_DETAIL_PARAMS_T( \
+ BOOST_PP_TUPLE_ELEM(2, 0, id_offset))* \
+ >(BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAMS_)-> \
+ BOOST_SCOPE_EXIT_DETAIL_PARAM( \
+ BOOST_PP_TUPLE_ELEM(2, 0, id_offset) \
+ , BOOST_PP_ADD(i, BOOST_PP_TUPLE_ELEM(2, 1, id_offset)) \
+ , BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE( \
+ bind_traits) \
+ ).value \
+ )
+
+// Typeof type-definitions.
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_TYPEDEF_( \
+ r, id_typename_offset_const, i, bind_traits) \
+ typedef /* the type with the special typeof name */ \
+ BOOST_LOCAL_FUNCTION_AUX_TYPEOF_TYPE( \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_( \
+ r, id_typename_offset_const, i, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE( \
+ bind_traits)) \
+ ) \
+ ; /* end typedef */
+
+// Expand to the function type `R (A1, ...)`.
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_F_( \
+ id, typename01, decl_traits, has_type, function_type) \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE(id, typename01) \
+ BOOST_PP_EXPR_IIF(has_type, (function_type) ) \
+ ( \
+ BOOST_PP_LIST_FOR_EACH_I( \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_DECL_ENUM_, \
+ 0, /* without defaults */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS(decl_traits)) \
+ )
+
+// Functor call operations.
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_CALL_BODY_(id, typename01, \
+ const_bind_macro, bind_macro, const_bind_this_macro, bind_this_macro, \
+ param_macro, params, \
+ const_binds, has_const_bind_this, binds, has_bind_this) \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BODY_FUNC_( \
+ BOOST_PP_LIST_FOR_EACH_I(const_bind_macro, \
+ 0 /* no offset */, const_binds) \
+ /* pass plain binds */ \
+ BOOST_PP_COMMA_IF( \
+ BOOST_PP_BITAND( \
+ BOOST_PP_LIST_IS_CONS(const_binds) \
+ , BOOST_PP_LIST_IS_CONS(binds) \
+ ) \
+ ) \
+ BOOST_PP_LIST_FOR_EACH_I(bind_macro, \
+ /* offset index of # const-binds (could be 0) */ \
+ BOOST_PP_LIST_SIZE(const_binds), binds) \
+ /* pass bind `this` */ \
+ BOOST_PP_COMMA_IF( \
+ BOOST_PP_BITAND( \
+ BOOST_PP_BITOR( \
+ BOOST_PP_LIST_IS_CONS(const_binds) \
+ , BOOST_PP_LIST_IS_CONS(binds) \
+ ) \
+ , BOOST_PP_BITOR(has_const_bind_this, has_bind_this) \
+ ) \
+ ) \
+ BOOST_PP_EXPR_IIF(has_const_bind_this, const_bind_this_macro) \
+ BOOST_PP_EXPR_IIF(has_bind_this, bind_this_macro) \
+ /* pass params */ \
+ BOOST_PP_COMMA_IF( \
+ BOOST_PP_BITAND( \
+ BOOST_PP_BITOR( \
+ BOOST_PP_BITOR( \
+ BOOST_PP_LIST_IS_CONS(const_binds) \
+ , BOOST_PP_LIST_IS_CONS(binds) \
+ ) \
+ , BOOST_PP_BITOR(has_const_bind_this, has_bind_this) \
+ ) \
+ , BOOST_PP_LIST_IS_CONS(params) \
+ ) \
+ ) \
+ BOOST_PP_LIST_FOR_EACH_I(param_macro, ~, params) \
+ )
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_CALL_(z, defaults_n, \
+ id, typename01, decl_traits, params, \
+ const_binds, has_const_bind_this, binds, has_bind_this) \
+ inline BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE(id, typename01) \
+ operator()( \
+ BOOST_PP_LIST_FOR_EACH_I( \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_ARG_DECL_ENUM_, \
+ typename01, params) \
+ ) /* cannot be const because of binds (same as for global fctor) */ { \
+ /* just forward call to member function with local func name */ \
+ return BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_CALL_BODY_(id, typename01,\
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_MEMBER_BIND_ENUM_, \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_MEMBER_BIND_ENUM_, \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_MEMBER_THIS_, \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_MEMBER_THIS_, \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_ARG_NAME_ENUM_, \
+ params, const_binds, has_const_bind_this, binds, \
+ has_bind_this); \
+ }
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_STATIC_CALL_FUNC_( \
+ z, defaults_n, unused) \
+ BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (call)(defaults_n) )
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_STATIC_CALL_COMMA_FUNC_ADDR_( \
+ z, defaults_n, unused) \
+ , &BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_STATIC_CALL_FUNC_(z, defaults_n, ~)
+
+// Precondition: NO_LOCAL_TYPES_AS_TEMPLATE_PARAMS.
+#define \
+BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_STATIC_CALL_COMMA_BIND_PARAM_DECLS_( \
+ id, typename01, const_binds, has_const_bind_this, binds, has_bind_this)\
+ BOOST_PP_LIST_FOR_EACH_I( \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_MAYBECONST_BIND_PARAM_DECL_, \
+ ( id, typename01, 0 /* no offset */, 1 /* const */ ), const_binds) \
+ BOOST_PP_LIST_FOR_EACH_I( \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_MAYBECONST_BIND_PARAM_DECL_, \
+ /* offset of # of const-binds */ \
+ ( id, typename01, BOOST_PP_LIST_SIZE(const_binds), 0 /* const */ ),\
+ binds) \
+ BOOST_PP_IIF(BOOST_PP_BITOR(has_bind_this, \
+ has_const_bind_this), \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_BIND_THIS_PARAM_DECL_ \
+ , \
+ BOOST_PP_TUPLE_EAT(2) \
+ )(id, typename01) \
+ /* fill with nobind_t (if no local-types as tparams) */ \
+ BOOST_PP_REPEAT(BOOST_PP_SUB(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX, \
+ BOOST_PP_IIF(BOOST_PP_BITOR(has_bind_this, \
+ has_const_bind_this), \
+ BOOST_PP_INC \
+ , \
+ BOOST_PP_TUPLE_REM(1) \
+ )(BOOST_PP_LIST_SIZE(BOOST_PP_LIST_APPEND(const_binds, \
+ binds)))), \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_NOBIND_PARAM_DECL_, ~)
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_STATIC_CALL_OPERATOR_( \
+ id, typename01, \
+ params, const_binds, has_const_bind_this, binds, has_bind_this) \
+ operator()( \
+ BOOST_PP_LIST_FOR_EACH_I( \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_ARG_NAME_ENUM_, ~, \
+ params) \
+ )
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_STATIC_CALL_BODY_( \
+ id, typename01, \
+ params, const_binds, has_const_bind_this, binds, has_bind_this) \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_CALL_BODY_(id, typename01, \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_PARAM_ENUM_, \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_PARAM_ENUM_, \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_THIS_PARAM_, \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_THIS_PARAM_, \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_ARG_NAME_ENUM_, \
+ params, const_binds, has_const_bind_this, binds, has_bind_this)
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_STATIC_CALL_(z, defaults_n, \
+ id, typename01, decl_traits, params, \
+ const_binds, has_const_bind_this, binds, has_bind_this) \
+ inline static BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE(id, typename01) \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_STATIC_CALL_FUNC_(z, defaults_n, ~)( \
+ void* object \
+ BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS, \
+ BOOST_PP_TUPLE_EAT(6) \
+ , \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_STATIC_CALL_COMMA_BIND_PARAM_DECLS_ \
+ )(id, typename01, \
+ const_binds, has_const_bind_this, binds, has_bind_this) \
+ BOOST_PP_LIST_FOR_EACH_I( \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_PARAM_ARG_DECL_, \
+ typename01, params) \
+ ) { \
+ /* run-time: casting object to this class type and forward call to */ \
+ /* `operator()` (this performs better than doing multiple casting */ \
+ /* or using a casted object local variable here to call body */ \
+ /* directly from here without passing via `operator()`) */ \
+ /* compliance: passing local class type to `static_cast` is fully */ \
+ /* C++03 compliant because `static_cast` is not a template (even */ \
+ /* if its syntax resembles a function template call) in fact even */ \
+ /* in C is legal to cast to a local struct (using C-style casting) */ \
+ return \
+ static_cast< \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_CLASS_TYPE_(id)* \
+ >(object)-> \
+ BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS,\
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_STATIC_CALL_OPERATOR_ \
+ , \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_STATIC_CALL_BODY_ \
+ )(id, typename01, params, \
+ const_binds, has_const_bind_this, binds, has_bind_this) \
+ ; \
+ }
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_CALL_FOR_DEFAULTS_(z, defaults_n, \
+ op_id_typename_decl_params_constbinds_hasconstthis_binds_hasthis) \
+ BOOST_PP_EXPAND( \
+ BOOST_PP_TUPLE_ELEM(9, 0, \
+ op_id_typename_decl_params_constbinds_hasconstthis_binds_hasthis) \
+ ( z, defaults_n \
+ , BOOST_PP_TUPLE_ELEM(9, 1, /* id */\
+ op_id_typename_decl_params_constbinds_hasconstthis_binds_hasthis) \
+ , BOOST_PP_TUPLE_ELEM(9, 2, /* typename01 */ \
+ op_id_typename_decl_params_constbinds_hasconstthis_binds_hasthis) \
+ , BOOST_PP_TUPLE_ELEM(9, 3, /* decl_traits */ \
+ op_id_typename_decl_params_constbinds_hasconstthis_binds_hasthis) \
+ , BOOST_PP_LIST_FIRST_N( /* remove last n default params */ \
+ BOOST_PP_SUB(BOOST_PP_LIST_SIZE(BOOST_PP_TUPLE_ELEM(9, 4, \
+ op_id_typename_decl_params_constbinds_hasconstthis_binds_hasthis)),\
+ defaults_n) \
+ , BOOST_PP_TUPLE_ELEM(9, 4, \
+ op_id_typename_decl_params_constbinds_hasconstthis_binds_hasthis) \
+ ) \
+ , BOOST_PP_TUPLE_ELEM(9, 5, /* const_binds */ \
+ op_id_typename_decl_params_constbinds_hasconstthis_binds_hasthis) \
+ , BOOST_PP_TUPLE_ELEM(9, 6, /* has_const_bind_this */ \
+ op_id_typename_decl_params_constbinds_hasconstthis_binds_hasthis) \
+ , BOOST_PP_TUPLE_ELEM(9, 7, /* binds */ \
+ op_id_typename_decl_params_constbinds_hasconstthis_binds_hasthis) \
+ , BOOST_PP_TUPLE_ELEM(9, 8, /* has_bind_this */ \
+ op_id_typename_decl_params_constbinds_hasconstthis_binds_hasthis) \
+ ) /* end `op_macro(...)` */ \
+ ) /* end expand */
+
+// Functor binds.
+
+// Precondition: NO_LOCAL_TYPES_AS_TEMPLATE_PARAMS.
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_BIND_TYPES_( \
+ id, typename01, const_binds, has_const_bind_this, binds, has_bind_this)\
+ BOOST_PP_LIST_FOR_EACH_I( \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_MAYBECONST_BIND_TYPE_, \
+ ( id, typename01, 0 /* no offset */, 1 /* const */ ), \
+ const_binds) \
+ BOOST_PP_LIST_FOR_EACH_I( \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_MAYBECONST_BIND_TYPE_, \
+ /* offset of # of const-binds */ \
+ ( id, typename01, BOOST_PP_LIST_SIZE(const_binds), 0 /* const */ ),\
+ binds) \
+ BOOST_PP_IIF(BOOST_PP_BITOR(has_bind_this, \
+ has_const_bind_this), \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_BIND_THIS_TYPE_ \
+ , \
+ BOOST_PP_TUPLE_EAT(2) \
+ )(id, typename01) \
+ /* fill with nobind_t (if no local-types as tparams) */ \
+ BOOST_PP_REPEAT(BOOST_PP_SUB(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX, \
+ BOOST_PP_IIF(BOOST_PP_BITOR(has_bind_this, has_const_bind_this), \
+ BOOST_PP_INC \
+ , \
+ BOOST_PP_TUPLE_REM(1) \
+ )(BOOST_PP_LIST_SIZE(BOOST_PP_LIST_APPEND(const_binds, binds)))), \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_NOBIND_TYPE_, ~)
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_TYPEOF_TYPEDEFS_( \
+ id, typename01, const_binds, has_const_bind_this, binds, has_bind_this)\
+ /* typeof types -- these types are qualified with extra eventual */ \
+ /* const and/or & if their variables are bound by const and/or & */ \
+ /* (this is because it is not possible to strip the eventual & */ \
+ /* given that the var name is always attached to the & symbol plus */ \
+ /* programmers can always remove const& using type traits) */ \
+ /* const bind typeof types */ \
+ BOOST_PP_LIST_FOR_EACH_I( \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_TYPEDEF_,\
+ (id, typename01, 0 /* no offset */, 1 /* const-bind */ ), \
+ const_binds) \
+ /* bind typeof types */ \
+ BOOST_PP_LIST_FOR_EACH_I( \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_TYPEDEF_, \
+ /* offset index with # of preceding const-binds (if any) */ \
+ ( id, typename01, BOOST_PP_LIST_SIZE(const_binds), \
+ 0 /* not const-bind */ ), binds) \
+ /* const this... */ \
+ BOOST_PP_EXPR_IIF(has_const_bind_this, \
+ typedef BOOST_LOCAL_FUNCTION_AUX_TYPEOF_TYPE( \
+ BOOST_PP_EXPR_IIF(typename01, typename) \
+ ::boost::local_function::aux::add_pointed_const< \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id, typename01) \
+ >::type \
+ this_ \
+ ) ; /* close typedef */ \
+ ) \
+ /* ... or, non-const this */ \
+ BOOST_PP_EXPR_IIF(has_bind_this, \
+ typedef BOOST_LOCAL_FUNCTION_AUX_TYPEOF_TYPE( \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id, typename01) \
+ this_ \
+ ) ; /* close typedef */ \
+ )
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_MEMBER_DECLS_( \
+ id, typename01, const_binds, has_const_bind_this, binds, has_bind_this)\
+ /* run-time: it is faster if call `operator()` just accesses member */ \
+ /* references to the ScopeExit struct instead of accessing the bind */ \
+ /* struct at each call (these mem refs are init by the constructor) */ \
+ BOOST_PP_LIST_FOR_EACH_I( /* const bind member references */ \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_DECL_,\
+ ( id, typename01, 0 /* no offset */, 1 /* const */ ), \
+ const_binds) \
+ BOOST_PP_LIST_FOR_EACH_I( /* bind member references */ \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_DECL_,\
+ /* offset index of # of const-binds (could be 0) */ \
+ ( id, typename01, BOOST_PP_LIST_SIZE(const_binds), \
+ 0 /* no const */ ), binds) \
+ /* bind this const or not (pointed-const is not added here because */ \
+ /* this is a reference, it is added to the this_ body param instead */ \
+ BOOST_PP_EXPR_IIF(BOOST_PP_BITOR(has_bind_this, has_const_bind_this), \
+ /* this is * so no & */ \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id, typename01) \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_MEMBER_THIS_ \
+ ; /* end member variable declaration */ \
+ )
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_STATIC_BINDS_( \
+ id, typename01, \
+ const_binds, has_const_bind_this, binds, has_bind_this) \
+ BOOST_PP_LIST_FOR_EACH_I( \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_MAYBECONST_STATIC_BIND_MEMBER_, \
+ ( id, typename01, 0 /* no offset */, 1 /* const */ ), const_binds) \
+ BOOST_PP_LIST_FOR_EACH_I( \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_MAYBECONST_STATIC_BIND_MEMBER_, \
+ /* offset of # of const-binds */ \
+ ( id, typename01, BOOST_PP_LIST_SIZE(const_binds), 0 /* const */ ), \
+ binds) \
+ BOOST_PP_IIF(BOOST_PP_BITOR(has_bind_this, \
+ has_const_bind_this), \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_STATIC_BIND_MEMBER_THIS_ \
+ , \
+ BOOST_PP_TUPLE_EAT(1) \
+ )(id) \
+ /* fill with nobind_t (if no local-types as tparams) */ \
+ BOOST_PP_REPEAT(BOOST_PP_SUB(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX, \
+ BOOST_PP_IIF(BOOST_PP_BITOR(has_bind_this, has_const_bind_this), \
+ BOOST_PP_INC \
+ , \
+ BOOST_PP_TUPLE_REM(1) \
+ )(BOOST_PP_LIST_SIZE(BOOST_PP_LIST_APPEND(const_binds, binds)))), \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_NOBIND_, ~)
+
+// Functor inits.
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MEMBER_INITS_(id, typename01, \
+ const_binds, has_const_bind_this, binds, has_bind_this) \
+ BOOST_PP_EXPR_IIF(BOOST_PP_BITOR(BOOST_PP_BITOR(BOOST_PP_BITOR( \
+ BOOST_PP_LIST_IS_CONS(const_binds), BOOST_PP_LIST_IS_CONS(binds)), \
+ has_bind_this), has_const_bind_this), \
+ : \
+ ) \
+ /* init const binds */ \
+ BOOST_PP_LIST_FOR_EACH_I( \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_INIT_ENUM_, \
+ ( id, 0 /* no offset */ ), const_binds) \
+ /* init plain binds */ \
+ BOOST_PP_COMMA_IF( \
+ BOOST_PP_BITAND( \
+ BOOST_PP_LIST_IS_CONS(const_binds) \
+ , BOOST_PP_LIST_IS_CONS(binds) \
+ ) \
+ ) \
+ BOOST_PP_LIST_FOR_EACH_I( \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_INIT_ENUM_, \
+ /* offset index of # of const-binds (could be 0) */ \
+ ( id, BOOST_PP_LIST_SIZE(const_binds) ), binds) \
+ /* init `this` bind (const or not) */ \
+ BOOST_PP_COMMA_IF( \
+ BOOST_PP_BITAND( \
+ BOOST_PP_BITOR( \
+ BOOST_PP_LIST_IS_CONS(const_binds) \
+ , BOOST_PP_LIST_IS_CONS(binds) \
+ ) \
+ , BOOST_PP_BITOR(has_const_bind_this, has_bind_this) \
+ ) \
+ ) \
+ BOOST_PP_EXPR_IIF(BOOST_PP_BITOR(has_const_bind_this, has_bind_this), \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_MEMBER_THIS_( \
+ static_cast< BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id)* >( \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAMS_)-> \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_VAR \
+ ) \
+ )
+
+// Functor class.
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_( \
+ id, typename01, decl_traits, params, \
+ default_count, const_binds, has_const_bind_this, binds, has_bind_this) \
+ typedef class BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_CLASS_TYPE_(id) \
+ /* run-time: do not use base class to allow for compiler optimizations */ \
+ { \
+ /* function type */ \
+ private: \
+ typedef \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_F_(id, typename01, \
+ decl_traits, 1 /* has type */, \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_F_TYPE_) \
+ ; \
+ /* functor type -- this type cannot have ID postfix because it is */ \
+ /* used the `NAME` macro (this symbol is within functor class so */ \
+ /* it does not have to have ID postfix), must be public so it */ \
+ /* can be accessed by `NAME` macro from outside this class */ \
+ public: \
+ typedef BOOST_PP_EXPR_IIF(typename01, typename) \
+ BOOST_IDENTITY_TYPE(( /* IDENTITY for template param comma */ \
+ ::boost::local_function::aux::function< \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_F_TYPE_ \
+ , default_count \
+ BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS,\
+ BOOST_PP_TUPLE_EAT(6) \
+ , \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_BIND_TYPES_\
+ )(id, typename01, const_binds, has_const_bind_this, \
+ binds, has_bind_this) \
+ > \
+ )) \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_TYPE \
+ ; \
+ private: \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_TYPEOF_TYPEDEFS_( \
+ id, typename01, \
+ const_binds, has_const_bind_this, binds, has_bind_this) \
+ public: \
+ /* public trait interface following Boost.FunctionTraits names */ \
+ /* (traits must be defined in both this and the global functor) */ \
+ enum { arity = ::boost::function_traits< /* can't use static data */ \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_F_TYPE_ >::arity }; \
+ typedef BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE(id, typename01) \
+ result_type; \
+ BOOST_PP_LIST_FOR_EACH_I( \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_ARG_TYPEDEF_, \
+ typename01, params) \
+ /* constructor */ \
+ inline explicit BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_CLASS_TYPE_(id)( \
+ void* BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAMS_) \
+ /* NOTE: there is no way to wrap member initializer commas */ \
+ /* within paren so you must handle these commas manually if */ \
+ /* expanding this macro within another macro */ \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MEMBER_INITS_(id, typename01,\
+ const_binds, has_const_bind_this, binds, has_bind_this) \
+ { /* do nothing */ } \
+ /* run-time: implement `operator()` (and for all default params) so */ \
+ /* this obj can be used directly as a functor for C++03 extensions */ \
+ /* and optimized macros */ \
+ BOOST_PP_REPEAT( \
+ /* PP_INC to handle no dflt (EXPAND for MVSC) */ \
+ BOOST_PP_EXPAND(BOOST_PP_INC(default_count)), \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_CALL_FOR_DEFAULTS_,\
+ ( BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_CALL_, id, typename01 \
+ , decl_traits, params, const_binds, has_const_bind_this, binds \
+ , has_bind_this ) ) \
+ /* compliance: trick to pass this local class as a template param */ \
+ /* on pure C++03 without non C++03 extension */ \
+ /* performance: this trick introduced _one_ indirect function call */ \
+ /* via a function pointer that is usually not inlined by compliers */ \
+ /* thus increasing run-time (also another trick using a base */ \
+ /* interface class was investigated but virtual calls also cannot */ \
+ /* inlined plus they require virtual table lookups to the "virtual */ \
+ /* call trick" measured longer run-times than this "static call */ \
+ /* trick") */ \
+ BOOST_PP_REPEAT( \
+ /* PP_INC to handle no dflt (EXPAND for MVSC) */ \
+ BOOST_PP_EXPAND(BOOST_PP_INC(default_count)), \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_CALL_FOR_DEFAULTS_,\
+ ( BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_STATIC_CALL_, id \
+ , typename01, decl_traits, params, const_binds \
+ , has_const_bind_this, binds, has_bind_this ) ) \
+ inline static void BOOST_LOCAL_FUNCTION_AUX_FUNCTION_INIT_CALL_FUNC( \
+ void* object \
+ , BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_TYPE& functor \
+ ) { \
+ functor.BOOST_LOCAL_FUNCTION_AUX_FUNCTION_INIT_CALL_FUNC( \
+ object \
+ BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS,\
+ BOOST_PP_TUPLE_EAT(6) \
+ , \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_STATIC_BINDS_ \
+ )(id, typename01, const_binds, has_const_bind_this, \
+ binds, has_bind_this) \
+ BOOST_PP_REPEAT( /* INC to handle no dflt (EXPAND for MVSC) */ \
+ BOOST_PP_EXPAND(BOOST_PP_INC(default_count)), \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_STATIC_CALL_COMMA_FUNC_ADDR_, \
+ ~) \
+ ); \
+ } \
+ private: \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_MEMBER_DECLS_(id, \
+ typename01, const_binds, has_const_bind_this, binds, \
+ has_bind_this) \
+ /* this decl allows for nesting (local functions, etc) as */ \
+ /* it makes the args variable visible within the body code (which */ \
+ /* cannot be static); this is for compilation only as the args */ \
+ /* variable is actually declared by the 1st enclosing local func */ \
+ boost::scope_exit::detail::undeclared \
+ BOOST_LOCAL_FUNCTION_AUX_DECL_ARGS_VAR; \
+ /* body function (unfortunately, cannot be static to allow access */ \
+ /* to member var with local function name for recursion but doing */ \
+ /* so also allows the body to misuse `this` instead of `this_`) */ \
+ inline BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE(id, typename01) \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BODY_FUNC_( \
+ /* const binds */ \
+ BOOST_PP_LIST_FOR_EACH_I( \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_ENUM_, \
+ ( id, typename01, 0 /* no offset */, 1 /* const */ ), \
+ const_binds) \
+ /* plain binds */ \
+ BOOST_PP_COMMA_IF( \
+ BOOST_PP_BITAND( \
+ BOOST_PP_LIST_IS_CONS(const_binds) \
+ , BOOST_PP_LIST_IS_CONS(binds) \
+ ) \
+ ) \
+ BOOST_PP_LIST_FOR_EACH_I( \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_ENUM_, \
+ /* offset index of # of const-binds (could be 0) */ \
+ ( id, typename01, BOOST_PP_LIST_SIZE(const_binds), \
+ 0 /* not const-bind */ ), binds) \
+ /* `this` bind */ \
+ BOOST_PP_COMMA_IF( \
+ BOOST_PP_BITAND( \
+ BOOST_PP_BITOR( \
+ BOOST_PP_LIST_IS_CONS(const_binds) \
+ , BOOST_PP_LIST_IS_CONS(binds) \
+ ) \
+ , BOOST_PP_BITOR(has_const_bind_this, has_bind_this) \
+ ) \
+ ) \
+ /* const pointer to const object */ \
+ BOOST_PP_EXPR_IIF(has_const_bind_this, \
+ BOOST_PP_EXPR_IIF(typename01, typename) \
+ ::boost::local_function::aux::add_pointed_const< \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id, \
+ typename01) \
+ >::type \
+ const this_ /* special name to access object this */ \
+ ) \
+ /* const pointer to non-const object */ \
+ BOOST_PP_EXPR_IIF(has_bind_this, \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id, \
+ typename01) \
+ const this_ /* special name to access object this */ \
+ ) \
+ /* params (last because they can have defaults) */ \
+ BOOST_PP_COMMA_IF( \
+ BOOST_PP_BITAND( \
+ BOOST_PP_BITOR( \
+ BOOST_PP_BITOR( \
+ BOOST_PP_LIST_IS_CONS(const_binds) \
+ , BOOST_PP_LIST_IS_CONS(binds) \
+ ) \
+ , BOOST_PP_BITOR(has_const_bind_this, \
+ has_bind_this) \
+ ) \
+ , BOOST_PP_LIST_IS_CONS(params) \
+ ) \
+ ) \
+ BOOST_PP_LIST_FOR_EACH_I( \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_DECL_ENUM_, \
+ 1 /* with defaults */, params) \
+ ) /* end body function params */ \
+ /* cannot be const because recursive functor is non const member */\
+ /* user local function definition `{ ... }` will follow here */ \
+ /* `END` macro will close function class decl `};` here */
+
+// PUBLIC //
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_TYPE \
+ BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (functor_type) )
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR(id, typename01, decl_traits) \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_(id, typename01, decl_traits \
+ /* params (might have defaults) */ \
+ , BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS(decl_traits) \
+ , BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS_DEFAULT_COUNT( \
+ decl_traits) \
+ /* const bind vars (`this` excluded) */ \
+ , BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_CONST_BINDS(decl_traits) \
+ /* if const bind `this` is present */ \
+ , BOOST_PP_LIST_IS_CONS( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_CONST_BIND_THIS_TYPES( \
+ decl_traits)) \
+ /* bind (non-const) vars (`this` excluded) */ \
+ , BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_BINDS(decl_traits) \
+ /* if (non-const) bind `this` is present */ \
+ , BOOST_PP_LIST_IS_CONS( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_BIND_THIS_TYPES( \
+ decl_traits)) \
+ )
+
+#endif // #include guard
+
diff --git a/boost/local_function/aux_/macro/code_/result.hpp b/boost/local_function/aux_/macro/code_/result.hpp
new file mode 100644
index 0000000000..84334e7996
--- /dev/null
+++ b/boost/local_function/aux_/macro/code_/result.hpp
@@ -0,0 +1,107 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_HPP_
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_HPP_
+
+#include <boost/local_function/aux_/symbol.hpp>
+#include <boost/local_function/aux_/preprocessor/traits/decl_returns.hpp>
+#include <boost/scope_exit.hpp>
+#include <boost/typeof/typeof.hpp>
+#include <boost/type_traits/remove_pointer.hpp>
+#include <boost/type_traits/function_traits.hpp>
+#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/control/expr_iif.hpp>
+#include <boost/preprocessor/list/adt.hpp>
+#include <boost/preprocessor/cat.hpp>
+
+// PRIVATE //
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_FUNC_(id) \
+ /* symbol (not internal) also gives error if missing result type */ \
+ BOOST_PP_CAT( \
+ ERROR_missing_result_type_before_the_local_function_parameter_macro_id, \
+ id)
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_PARAMS_(id) \
+ BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (deduce_result_params)(id) )
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE_(id) \
+ BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (result_type)(id) )
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_INDEX_ \
+ /* this does not have to be an integral index because ScopeExit uses */ \
+ /* just as a symbol to concatenate go generate unique symbols (but */ \
+ /* if it'd ever needed to became integral, the number of function */ \
+ /* params + 1 as in the macro CONFIG_ARITY_MAX could be used) */ \
+ result
+
+// User did not explicitly specified result type, deduce it (using Typeof).
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_DEDUCE_( \
+ id, typename01, decl_traits) \
+ /* user specified result type here */ \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_DECL(id) \
+ /* tagging, wrapping, etc as from ScopeExit type deduction are */ \
+ /* necessary within templates (at least on GCC) to work around an */ \
+ /* compiler internal errors) */ \
+ BOOST_SCOPE_EXIT_DETAIL_TAG_DECL(0, /* no recursive step r */ \
+ id, BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_INDEX_, \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_FUNC_(id)) \
+ BOOST_SCOPE_EXIT_DETAIL_CAPTURE_DECL(0, /* no recursive step r */ \
+ ( id, BOOST_PP_EXPR_IIF(typename01, typename) ), \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_INDEX_, \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_FUNC_(id)) \
+ /* extra struct to workaround GCC and other compiler's issues */ \
+ struct BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_PARAMS_(id) { \
+ typedef \
+ BOOST_PP_EXPR_IIF(typename01, typename) \
+ ::boost::function_traits< \
+ BOOST_PP_EXPR_IIF(typename01, typename) \
+ ::boost::remove_pointer< \
+ BOOST_SCOPE_EXIT_DETAIL_CAPTURE_T(id, \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_INDEX_, \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_FUNC_(id)) \
+ >::type \
+ >::result_type \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE_(id) \
+ ; \
+ };
+
+// Use result type as explicitly specified by user (no type deduction needed).
+// Precondition: RETURNS(decl_traits) != NIL
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPED_( \
+ id, typename01, decl_traits) \
+ /* user specified result type here */ \
+ struct BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_PARAMS_(id) { \
+ typedef \
+ BOOST_PP_LIST_FIRST( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_RETURNS( \
+ decl_traits)) \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE_(id) \
+ ; \
+ };
+
+// PUBLIC //
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE(id, typename01) \
+ BOOST_PP_EXPR_IIF(typename01, typename) \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_PARAMS_(id) :: \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE_(id)
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_DECL(id) \
+ /* result type here */ (*BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_FUNC_(id))();
+
+#define BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT(id, typename01, decl_traits) \
+ BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_RETURNS(decl_traits)), \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPED_ \
+ , \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_DEDUCE_ \
+ )(id, typename01, decl_traits)
+
+#endif // #include guard
+
diff --git a/boost/local_function/aux_/macro/decl.hpp b/boost/local_function/aux_/macro/decl.hpp
new file mode 100644
index 0000000000..e5c76dc5e4
--- /dev/null
+++ b/boost/local_function/aux_/macro/decl.hpp
@@ -0,0 +1,65 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_AUX_DECL_HPP_
+#define BOOST_LOCAL_FUNCTION_AUX_DECL_HPP_
+
+#include <boost/local_function/aux_/macro/code_/result.hpp>
+#include <boost/local_function/aux_/macro/code_/bind.hpp>
+#include <boost/local_function/aux_/macro/code_/functor.hpp>
+#include <boost/local_function/aux_/preprocessor/traits/decl.hpp>
+#include <boost/local_function/aux_/preprocessor/traits/decl_error.hpp>
+#include <boost/scope_exit.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/facilities/is_empty.hpp>
+#include <boost/preprocessor/list/adt.hpp>
+#include <boost/preprocessor/tuple/eat.hpp>
+
+// PRIVATE //
+
+#define BOOST_LOCAL_FUNCTION_AUX_DECL_OK_(id, typename01, decl_traits) \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT(id, typename01, decl_traits) \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_BIND(id, typename01, decl_traits) \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR(id, typename01, decl_traits)
+
+#define BOOST_LOCAL_FUNCTION_AUX_DECL_ERROR_(id, typename01, decl_traits) \
+ BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_RETURNS(decl_traits)), \
+ /* return specified, so no result type before this macro expansion */ \
+ BOOST_PP_TUPLE_EAT(1) \
+ , \
+ /* even if error, must declare result type to prevent additional */ \
+ /* error due to result type appearing before this macro expansion */ \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_DECL \
+ )(id) \
+ ; /* close eventual previous statements, otherwise it has no effect */ \
+ BOOST_MPL_ASSERT_MSG(false, /* always fails (there's an error) */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_ERROR_MSG(decl_traits), ())\
+ ; /* must close ASSERT macro for eventual use within class scope */
+
+// PUBLIC //
+
+#define BOOST_LOCAL_FUNCTION_AUX_DECL_ARGS_VAR \
+ BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (args) )
+
+// Undefine local function bound args global variable. Actual declaration of
+// this variable is made using SFINAE mechanisms by each local function macro.
+extern boost::scope_exit::detail::undeclared
+ BOOST_LOCAL_FUNCTION_AUX_DECL_ARGS_VAR;
+
+// sign_params: parsed parenthesized params.
+#define BOOST_LOCAL_FUNCTION_AUX_DECL(id, typename01, decl_traits) \
+ BOOST_PP_IIF(BOOST_PP_IS_EMPTY( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_ERROR_MSG(decl_traits)), \
+ BOOST_LOCAL_FUNCTION_AUX_DECL_OK_ \
+ , \
+ BOOST_LOCAL_FUNCTION_AUX_DECL_ERROR_ \
+ )(id, typename01, decl_traits)
+
+#endif // #include guard
+
diff --git a/boost/local_function/aux_/macro/name.hpp b/boost/local_function/aux_/macro/name.hpp
new file mode 100644
index 0000000000..7f6dc6a55d
--- /dev/null
+++ b/boost/local_function/aux_/macro/name.hpp
@@ -0,0 +1,201 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_AUX_NAME_HPP_
+#define BOOST_LOCAL_FUNCTION_AUX_NAME_HPP_
+
+#include <boost/local_function/config.hpp>
+#include <boost/local_function/aux_/macro/decl.hpp>
+#include <boost/local_function/aux_/macro/code_/functor.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/recursive.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/inline.hpp>
+#include <boost/local_function/aux_/function.hpp>
+#include <boost/local_function/aux_/symbol.hpp>
+#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/control/expr_iif.hpp>
+#include <boost/preprocessor/logical/bitor.hpp>
+#include <boost/preprocessor/tuple/eat.hpp>
+
+// PRIVATE //
+
+#define BOOST_LOCAL_FUNCTION_AUX_NAME_LOCAL_TYPE_(local_function_name) \
+ BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (local_type)(local_function_name) )
+
+#define BOOST_LOCAL_FUNCTION_AUX_NAME_INIT_RECURSION_FUNC_ \
+ BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (init_recursion) )
+
+#define BOOST_LOCAL_FUNCTION_AUX_NAME_RECURSIVE_FUNC_( \
+ is_recursive, local_function_name) \
+ BOOST_PP_IIF(is_recursive, \
+ local_function_name \
+ , \
+ BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (nonrecursive_local_function_name) ) \
+ )
+
+#define BOOST_LOCAL_FUNCTION_AUX_NAME_END_LOCAL_FUNCTOR_(typename01, \
+ local_function_name, is_recursive, \
+ local_functor_name, nonlocal_functor_name) \
+ /* FUNCTION macro expanded to: typedef class functor ## __LINE__ { ... */ \
+ BOOST_PP_EXPR_IIF(is_recursive, \
+ /* member var with function name for recursive calls; it cannot be */ \
+ /* `const` because it is init after construction (because */ \
+ /* constructor doesn't know local function name) */ \
+ /* run-time: even when optimizing, recursive calls cannot be */ \
+ /* optimized (i.e., they must be via the non-local functor) */ \
+ /* because this cannot be a mem ref because its name is not known */ \
+ /* by the constructor so it cannot be set by the mem init list */ \
+ private: \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_TYPE \
+ BOOST_LOCAL_FUNCTION_AUX_NAME_RECURSIVE_FUNC_(is_recursive, \
+ local_function_name); \
+ /* run-time: the `init_recursion()` function cannot be called */ \
+ /* by the constructor to allow for compiler optimization */ \
+ /* (inlining) so it must be public to be called (see below) */ \
+ public: \
+ inline void BOOST_LOCAL_FUNCTION_AUX_NAME_INIT_RECURSION_FUNC_( \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_TYPE& functor) { \
+ local_function_name = functor; \
+ } \
+ ) \
+ } BOOST_LOCAL_FUNCTION_AUX_NAME_LOCAL_TYPE_(local_function_name); \
+ /* local functor can be passed as tparam only on C++11 (faster) */ \
+ BOOST_LOCAL_FUNCTION_AUX_NAME_LOCAL_TYPE_(local_function_name) \
+ local_functor_name(BOOST_LOCAL_FUNCTION_AUX_DECL_ARGS_VAR.value); \
+ /* non-local functor can always be passed as tparam (but slower) */ \
+ BOOST_PP_EXPR_IIF(typename01, typename) \
+ BOOST_LOCAL_FUNCTION_AUX_NAME_LOCAL_TYPE_(local_function_name):: \
+ BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_TYPE \
+ nonlocal_functor_name; /* functor variable */ \
+ /* the order of the following 2 function calls cannot be changed */ \
+ /* because init_recursion uses the local_functor so the local_functor */ \
+ /* must be init first */ \
+ local_functor_name.BOOST_LOCAL_FUNCTION_AUX_FUNCTION_INIT_CALL_FUNC( \
+ &local_functor_name, nonlocal_functor_name); \
+ BOOST_PP_EXPR_IIF(is_recursive, \
+ /* init recursion causes MSVC to not optimize local function not */ \
+ /* even when local functor is used as template parameter so no */ \
+ /* recursion unless all inlining optimizations are specified off */ \
+ local_functor_name.BOOST_LOCAL_FUNCTION_AUX_NAME_INIT_RECURSION_FUNC_( \
+ nonlocal_functor_name); \
+ )
+
+#define BOOST_LOCAL_FUNCTION_AUX_NAME_FUNCTOR_(local_function_name) \
+ BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (local_function_name) )
+
+// This can always be passed as a template parameters (on all compilers).
+// However, it is slower because it cannot be inlined.
+// Passed at tparam: Yes (on all C++). Inlineable: No. Recursive: No.
+#define BOOST_LOCAL_FUNCTION_AUX_NAME_(typename01, local_function_name) \
+ BOOST_LOCAL_FUNCTION_AUX_NAME_END_LOCAL_FUNCTOR_(typename01, \
+ local_function_name, \
+ /* local function is not recursive (because recursion and its */ \
+ /* initialization cannot be inlined even on C++11, */ \
+ /* so this allows optimization at least on C++11) */ \
+ 0 /* not recursive */ , \
+ /* local functor */ \
+ BOOST_LOCAL_FUNCTION_AUX_NAME_FUNCTOR_(local_function_name), \
+ /* local function declared as non-local functor -- but it can */ \
+ /* be inlined only by C++11 and it cannot be recursive */ \
+ local_function_name)
+
+// This is faster on some compilers but not all (e.g., it is faster on GCC
+// because its optimization inlines it but not on MSVC). However, it cannot be
+// passed as a template parameter on non C++11 compilers.
+// Passed at tparam: Only on C++11. Inlineable: Yes. Recursive: No.
+#define BOOST_LOCAL_FUNCTION_AUX_NAME_INLINE_(typename01, local_function_name) \
+ BOOST_LOCAL_FUNCTION_AUX_NAME_END_LOCAL_FUNCTOR_(typename01, \
+ local_function_name, \
+ /* inlined local function is never recursive (because recursion */ \
+ /* and its initialization cannot be inlined)*/ \
+ 0 /* not recursive */ , \
+ /* inlined local function declared as local functor (maybe */ \
+ /* inlined even by non C++11 -- but it can be passed as */ \
+ /* template parameter only on C++11 */ \
+ local_function_name, \
+ /* non-local functor */ \
+ BOOST_LOCAL_FUNCTION_AUX_NAME_FUNCTOR_(local_function_name))
+
+// This is slower on all compilers (C++11 and non) because recursion and its
+// initialization can never be inlined.
+// Passed at tparam: Yes. Inlineable: No. Recursive: Yes.
+#define BOOST_LOCAL_FUNCTION_AUX_NAME_RECURSIVE_( \
+ typename01, local_function_name) \
+ BOOST_LOCAL_FUNCTION_AUX_NAME_END_LOCAL_FUNCTOR_(typename01, \
+ local_function_name, \
+ /* recursive local function -- but it cannot be inlined */ \
+ 1 /* recursive */ , \
+ /* local functor */ \
+ BOOST_LOCAL_FUNCTION_AUX_NAME_FUNCTOR_(local_function_name), \
+ /* local function declared as non-local functor -- but it can */ \
+ /* be inlined only by C++11 */ \
+ local_function_name)
+
+// Inlined local functions are specified by `..._NAME(inline name)`.
+// They have more chances to be inlined for faster run-times by some compilers
+// (for example by GCC but not by MSVC). C++11 compilers can always inline
+// local functions even if they are not explicitly specified inline.
+#define BOOST_LOCAL_FUNCTION_AUX_NAME_PARSE_INLINE_( \
+ typename01, qualified_name) \
+ BOOST_PP_IIF(BOOST_PP_BITOR( \
+ BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_INLINE_FRONT( \
+ qualified_name)), \
+ /* on C++11 always use inlining because compilers might optimize */ \
+ /* it to be faster and it can also be passed as tparam */ \
+ BOOST_LOCAL_FUNCTION_AUX_NAME_INLINE_ \
+ , \
+ /* on non C++11 don't use liniling unless explicitly specified by */ \
+ /* programmers `inline name` the inlined local function cannot be */ \
+ /* passed as tparam */ \
+ BOOST_LOCAL_FUNCTION_AUX_NAME_ \
+ )(typename01, BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_INLINE_REMOVE_FRONT( \
+ qualified_name))
+
+// Expand to 1 iff `recursive name` or `recursive inline name` or
+// `inline recursive name`.
+#define BOOST_LOCAL_FUNCTION_AUX_NAME_IS_RECURSIVE_(qualified_name) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_RECURSIVE_FRONT( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_INLINE_REMOVE_FRONT( \
+ qualified_name \
+ ))
+
+// Revmoes `recursive`, `inline recursive`, and `recursive inline` from front.
+#define BOOST_LOCAL_FUNCTION_AUX_NAME_REMOVE_RECURSIVE_AND_INLINE_( \
+ qualified_name) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_RECURSIVE_REMOVE_FRONT( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_INLINE_REMOVE_FRONT( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_RECURSIVE_REMOVE_FRONT( \
+ qualified_name \
+ )))
+
+#define BOOST_LOCAL_FUNCTION_AUX_NAME_RECURSIVE_REMOVE_(qualified_name) \
+ BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_AUX_NAME_IS_RECURSIVE_(qualified_name), \
+ BOOST_LOCAL_FUNCTION_AUX_NAME_REMOVE_RECURSIVE_AND_INLINE_ \
+ , \
+ qualified_name /* might be `name` or `inline name` */ \
+ BOOST_PP_TUPLE_EAT(1) \
+ )(qualified_name)
+
+// Recursive local function are specified by `..._NAME(recursive name)`.
+// They can never be inlined for faster run-time (not even by C++11 compilers).
+#define BOOST_LOCAL_FUNCTION_AUX_NAME_PARSE_RECURSIVE_( \
+ typename01, qualified_name) \
+ BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_AUX_NAME_IS_RECURSIVE_(qualified_name), \
+ /* recursion can never be inlined (not even on C++11) */ \
+ BOOST_LOCAL_FUNCTION_AUX_NAME_RECURSIVE_ \
+ , \
+ BOOST_LOCAL_FUNCTION_AUX_NAME_PARSE_INLINE_ \
+ )(typename01, \
+ BOOST_LOCAL_FUNCTION_AUX_NAME_RECURSIVE_REMOVE_(qualified_name))
+
+// PUBLIC //
+
+#define BOOST_LOCAL_FUNCTION_AUX_NAME(typename01, qualified_name) \
+ BOOST_LOCAL_FUNCTION_AUX_NAME_PARSE_RECURSIVE_(typename01, qualified_name)
+
+#endif // #include guard
+
diff --git a/boost/local_function/aux_/macro/typeof.hpp b/boost/local_function/aux_/macro/typeof.hpp
new file mode 100644
index 0000000000..65ad5975eb
--- /dev/null
+++ b/boost/local_function/aux_/macro/typeof.hpp
@@ -0,0 +1,22 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_AUX_TYPEOF_HPP_
+#define BOOST_LOCAL_FUNCTION_AUX_TYPEOF_HPP_
+
+#include <boost/local_function/aux_/symbol.hpp>
+
+// PUBLIC //
+
+// Actual type-name for specified symbol name.
+#define BOOST_LOCAL_FUNCTION_AUX_TYPEOF_TYPE(name) \
+ /* cannot prefix in front of name because it could start with non */ \
+ /* alphanumeric symbols (e.g., & for binding by reference) */ \
+ BOOST_LOCAL_FUNCTION_AUX_SYMBOL_POSTFIX( (name)(typeof_type) )
+
+#endif // #include guard
+
diff --git a/boost/local_function/aux_/member.hpp b/boost/local_function/aux_/member.hpp
new file mode 100644
index 0000000000..27d2973294
--- /dev/null
+++ b/boost/local_function/aux_/member.hpp
@@ -0,0 +1,51 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_AUX_MEMBER_HPP_
+#define BOOST_LOCAL_FUNCTION_AUX_MEMBER_HPP_
+
+namespace boost { namespace local_function { namespace aux {
+
+// Metafunctions to manipulate data members.
+
+template<typename T> struct member_type {
+ typedef T& reference;
+ typedef T* pointer;
+};
+
+template<typename T> struct member_type<T*> {
+ typedef T*& reference;
+ typedef T* pointer;
+};
+
+template<typename T> struct member_type<T* const> {
+ typedef T* const& reference;
+ typedef T* pointer;
+};
+
+template<typename T> struct member_type<T const*> {
+ typedef T const*& reference;
+ typedef T const* pointer;
+};
+
+template<typename T> struct member_type<T const* const> {
+ typedef T const* const& reference;
+ typedef T const* pointer;
+};
+
+// NOTE: Do not add specializations for T const[&/*] (ambiguous on VACPP).
+template<typename T> T* member_addr(T& data) { return &data; }
+template<typename T> T* member_addr(T* data) { return data; }
+
+// NOTE: Do not add specializations for T const[&/*] (ambiguous on VACPP).
+template<typename T> T& member_deref(T& data) { return data; }
+template<typename T> T& member_deref(T* data) { return *data; }
+
+} } } // namespace
+
+#endif // #include guard
+
diff --git a/boost/local_function/aux_/nobind.hpp b/boost/local_function/aux_/nobind.hpp
new file mode 100644
index 0000000000..73afc6fd58
--- /dev/null
+++ b/boost/local_function/aux_/nobind.hpp
@@ -0,0 +1,32 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_AUX_NOBIND_HPP_
+#define BOOST_LOCAL_FUNCTION_AUX_NOBIND_HPP_
+
+#include <boost/local_function/config.hpp>
+
+// NOTE: The current implementation needs no-bind placeholders only when
+// local types cannot be passed as template parameters.
+#if !BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
+
+namespace boost { namespace local_function { namespace aux {
+
+typedef int nobind_t; // Tag no-bind type.
+
+static nobind_t nobind; // Global variable so all no-binds can reference it.
+
+// NOTE: Used only to get rid of unused static variable `nobind` (this function
+// is never actually called so it does not need to be defined).
+void no_unused_nobind_warning_(nobind_t* ptr = &nobind);
+
+} } } // namespace
+
+#endif // locals as tparams
+
+#endif // #include guard
+
diff --git a/boost/local_function/aux_/preprocessor/traits/bind.hpp b/boost/local_function/aux_/preprocessor/traits/bind.hpp
new file mode 100644
index 0000000000..601f36f8a1
--- /dev/null
+++ b/boost/local_function/aux_/preprocessor/traits/bind.hpp
@@ -0,0 +1,46 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_HPP_
+#define BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_HPP_
+
+#include <boost/preprocessor/tuple/elem.hpp>
+
+// PRIVATE //
+
+// Non-this bind is 2-tuple `(name_without_type, name_with_type)`.
+#define BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_INDEX_WITHOUT_TYPE_ 0
+#define BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_INDEX_WITH_TYPE_ 1
+#define BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_INDEX_MAX_ 2
+
+// This bind is 1-typle `([type_] EMPTY)`.
+#define BOOST_LOCAL_FUNCTION_AUX_PP_BIND_THIS_TRAITS_INDEX_TYPE_ 0
+#define BOOST_LOCAL_FUNCTION_AUX_PP_BIND_THIS_TRAITS_INDEX_MAX_ 1
+
+// PUBLIC //
+
+// Expand: `[&] var_`.
+#define BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE(bind_traits) \
+ BOOST_PP_TUPLE_ELEM(BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_INDEX_MAX_, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_INDEX_WITHOUT_TYPE_, \
+ bind_traits)
+
+// Expand: `[type_ [&] var_]` (EMPTY if no type_ specified).
+#define BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_VAR_WITH_TYPE(bind_traits) \
+ BOOST_PP_TUPLE_ELEM(BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_INDEX_MAX_, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_INDEX_WITH_TYPE_, \
+ bind_traits)(/* expand EMPTY */)
+
+// Expand: `[type_]` (EMPTY if no type_ specified).
+#define BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_THIS_TYPE(bind_this_traits) \
+ BOOST_PP_TUPLE_ELEM( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_BIND_THIS_TRAITS_INDEX_MAX_, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_BIND_THIS_TRAITS_INDEX_TYPE_, \
+ bind_this_traits)(/* expand EMPTY */)
+
+#endif // #include guard
+
diff --git a/boost/local_function/aux_/preprocessor/traits/decl.hpp b/boost/local_function/aux_/preprocessor/traits/decl.hpp
new file mode 100644
index 0000000000..8f6a6f78fd
--- /dev/null
+++ b/boost/local_function/aux_/preprocessor/traits/decl.hpp
@@ -0,0 +1,29 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_HPP_
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_HPP_
+
+#include <boost/local_function/aux_/preprocessor/traits/decl_sign_/sign.hpp>
+#include <boost/local_function/aux_/preprocessor/traits/decl_/nil.hpp>
+#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/tuple/eat.hpp>
+#include <boost/preprocessor/list/adt.hpp>
+
+// PUBLIC //
+
+// Expand: decl_traits (see DECL_TRAITS macros to inspect these traits).
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS(declarations) \
+ BOOST_PP_IIF(BOOST_PP_LIST_IS_NIL(declarations), \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_NIL \
+ BOOST_PP_TUPLE_EAT(1) \
+ , \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN \
+ )(declarations)
+
+#endif // #include guard
+
diff --git a/boost/local_function/aux_/preprocessor/traits/decl_/append.hpp b/boost/local_function/aux_/preprocessor/traits/decl_/append.hpp
new file mode 100644
index 0000000000..b810c66aac
--- /dev/null
+++ b/boost/local_function/aux_/preprocessor/traits/decl_/append.hpp
@@ -0,0 +1,212 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_APPEND_HPP_
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_APPEND_HPP_
+
+#include <boost/local_function/aux_/preprocessor/traits/decl_returns.hpp>
+#include <boost/local_function/aux_/preprocessor/traits/decl_params.hpp>
+#include <boost/local_function/aux_/preprocessor/traits/decl_const_binds.hpp>
+#include <boost/local_function/aux_/preprocessor/traits/decl_binds.hpp>
+#include <boost/local_function/aux_/preprocessor/traits/decl_error.hpp>
+#include <boost/local_function/aux_/preprocessor/traits/param.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/return.hpp>
+#include <boost/preprocessor/facilities/empty.hpp>
+#include <boost/preprocessor/arithmetic/dec.hpp>
+#include <boost/preprocessor/list/append.hpp>
+#include <boost/preprocessor/list/size.hpp>
+#include <boost/preprocessor/list/at.hpp>
+#include <boost/preprocessor/list/first_n.hpp>
+
+// PRIVATE //
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_APPEND_PARAM_DEFAULT_( \
+ params, default_value) \
+ /* `DEC` ok because precondition that unbinds are not nil-list */ \
+ BOOST_PP_LIST_APPEND( \
+ BOOST_PP_LIST_FIRST_N(BOOST_PP_DEC(BOOST_PP_LIST_SIZE(params)), \
+ params) \
+ , \
+ ( /* list 2-tuple */ \
+ ( /* (param_decl, default) 2-tuple */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_PARAM_TRAITS_DECL( \
+ BOOST_PP_LIST_AT(params, BOOST_PP_DEC( \
+ BOOST_PP_LIST_SIZE(params)))) \
+ , \
+ default_value BOOST_PP_EMPTY \
+ ) \
+ , \
+ BOOST_PP_NIL \
+ ) \
+ )
+
+// PUBLIC //
+
+// return_type: `return result_type`.
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_APPEND_RETURN( \
+ decl_traits, return_type) \
+ ( /* returns */ \
+ BOOST_PP_LIST_APPEND( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_RETURNS(decl_traits), \
+ ( BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_RETURN_REMOVE_FRONT( \
+ return_type), BOOST_PP_NIL ) ) \
+ , /* params and defaults */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS(decl_traits) \
+ , /* const-bind vars */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_CONST_BINDS(decl_traits) \
+ , /* const-bind `this` types */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_CONST_BIND_THIS_TYPES( \
+ decl_traits) \
+ , /* bind vars */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_BINDS(decl_traits) \
+ , /* bind `this` types */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_BIND_THIS_TYPES(decl_traits) \
+ , /* error message (if any) */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_ERROR(decl_traits) \
+ )
+
+
+// param_decl: `[auto | register] type_ name_`.
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_APPEND_PARAM( \
+ decl_traits, param_decl) \
+ ( /* returns */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_RETURNS(decl_traits) \
+ , /* params and defaults */ \
+ BOOST_PP_LIST_APPEND( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS(decl_traits), \
+ /* append param (with no default -- EMPTY) */ \
+ ( (param_decl, BOOST_PP_EMPTY), BOOST_PP_NIL ) ) \
+ , /* const-bind vars */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_CONST_BINDS(decl_traits) \
+ , /* const-bind `this` types */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_CONST_BIND_THIS_TYPES( \
+ decl_traits) \
+ , /* bind vars */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_BINDS(decl_traits) \
+ , /* bind `this` types */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_BIND_THIS_TYPES(decl_traits) \
+ , /* error message (if any) */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_ERROR(decl_traits) \
+ )
+
+// default_value: a valid parameter default value (`-1`, etc).
+// Precondition: already added unbinds are not nil-list.
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_APPEND_PARAM_DEFAULT( \
+ decl_traits, default_value) \
+ ( /* returns */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_RETURNS(decl_traits) \
+ , /* unbind params and defaults */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_APPEND_PARAM_DEFAULT_( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS(decl_traits), \
+ default_value) /* append default to last added param */ \
+ , /* const-bind vars */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_CONST_BINDS(decl_traits) \
+ , /* const-bind `this` types */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_CONST_BIND_THIS_TYPES( \
+ decl_traits) \
+ , /* bind vars */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_BINDS(decl_traits) \
+ , /* bind `this` types */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_BIND_THIS_TYPES(decl_traits) \
+ , /* error message (if any) */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_ERROR(decl_traits) \
+ )
+
+// var_without_type: `[&] var_` (var_ != this).
+// var_with_type: `PP_EMPTY | type [&] var_` (var_ != this).
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_APPEND_BIND( \
+ decl_traits, var_without_type, var_with_type) \
+ ( /* returns */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_RETURNS(decl_traits) \
+ , /* params and defaults */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS(decl_traits) \
+ , /* const-bind vars */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_CONST_BINDS(decl_traits) \
+ , /* const-bind `this` types */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_CONST_BIND_THIS_TYPES( \
+ decl_traits) \
+ , /* bind vars */ \
+ BOOST_PP_LIST_APPEND( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_BINDS(decl_traits), \
+ ( (var_without_type, var_with_type), BOOST_PP_NIL ) ) \
+ , /* bind `this` types */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_BIND_THIS_TYPES(decl_traits) \
+ , /* error message (if any) */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_ERROR(decl_traits) \
+ )
+
+// this_type: `PP_EMPTY | type`.
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_APPEND_BIND_THIS_TYPE( \
+ decl_traits, this_type) \
+ ( /* returns */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_RETURNS(decl_traits) \
+ , /* params and defaults */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS(decl_traits) \
+ , /* const-bind vars */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_CONST_BINDS(decl_traits) \
+ , /* const-bind `this` types */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_CONST_BIND_THIS_TYPES( \
+ decl_traits) \
+ , /* bind vars */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_BINDS(decl_traits) \
+ , /* bind `this` types */ \
+ BOOST_PP_LIST_APPEND( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_BIND_THIS_TYPES( \
+ decl_traits), \
+ ( (this_type), BOOST_PP_NIL ) ) \
+ , /* error message (if any) */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_ERROR(decl_traits) \
+ )
+
+// var_without_type: `[&] var_` (var_ != this).
+// var_with_type: `BOOST_PP_EMPTY | type_ [&] name_` (var_ != this).
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_APPEND_CONST_BIND( \
+ decl_traits, var_without_type, var_with_type) \
+ ( /* returns */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_RETURNS(decl_traits) \
+ , /* params and defaults */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS(decl_traits) \
+ , /* const-bind vars */ \
+ BOOST_PP_LIST_APPEND( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_CONST_BINDS( \
+ decl_traits), \
+ ( (var_without_type, var_with_type), BOOST_PP_NIL ) ) \
+ , /* const-bind `this` types */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_CONST_BIND_THIS_TYPES( \
+ decl_traits) \
+ , /* bind vars */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_BINDS(decl_traits) \
+ , /* bind `this` types */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_BIND_THIS_TYPES(decl_traits) \
+ , /* error message (if any) */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_ERROR(decl_traits) \
+ )
+
+// this_type: `PP_EMPTY | type`.
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_APPEND_CONST_BIND_THIS_TYPE( \
+ decl_traits, this_type) \
+ ( /* returns */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_RETURNS(decl_traits) \
+ , /* params and defaults */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS(decl_traits) \
+ , /* const-bind vars */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_CONST_BINDS(decl_traits) \
+ , /* const-bind `this` types */ \
+ BOOST_PP_LIST_APPEND( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_CONST_BIND_THIS_TYPES( \
+ decl_traits), \
+ ( (this_type), BOOST_PP_NIL ) ) \
+ , /* bind vars */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_BINDS(decl_traits) \
+ , /* bind `this` types */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_BIND_THIS_TYPES(decl_traits) \
+ , /* error message (if any) */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_ERROR(decl_traits) \
+ )
+
+#endif // #include guard
+
diff --git a/boost/local_function/aux_/preprocessor/traits/decl_/index.hpp b/boost/local_function/aux_/preprocessor/traits/decl_/index.hpp
new file mode 100644
index 0000000000..1d62693825
--- /dev/null
+++ b/boost/local_function/aux_/preprocessor/traits/decl_/index.hpp
@@ -0,0 +1,21 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_INDEX_HPP_
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_INDEX_HPP_
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_INDEX_RETURNS 0
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_INDEX_PARAMS 1
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_INDEX_CONST_BINDS 2
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_INDEX_CONST_BIND_THIS_TYPES 3
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_INDEX_BINDS 4
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_INDEX_BIND_THIS_TYPES 5
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_INDEX_ERROR 6
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_INDEX_MAX 7
+
+#endif // #include guard
+
diff --git a/boost/local_function/aux_/preprocessor/traits/decl_/nil.hpp b/boost/local_function/aux_/preprocessor/traits/decl_/nil.hpp
new file mode 100644
index 0000000000..0684dc518f
--- /dev/null
+++ b/boost/local_function/aux_/preprocessor/traits/decl_/nil.hpp
@@ -0,0 +1,39 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_NIL_HPP_
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_NIL_HPP_
+
+#include <boost/preprocessor/facilities/empty.hpp>
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_NIL \
+ ( \
+ /* returns: list of `return result_type` */ \
+ BOOST_PP_NIL /* nil list */ \
+ , \
+ /* params: list of 2-tuples (param_decl, param_default) */ \
+ BOOST_PP_NIL /* nil list */ \
+ , \
+ /* const-binds: list of 2-tuple `(var_untyped, var_typed)` */ \
+ BOOST_PP_NIL /* nil list */ \
+ , \
+ /* const-bind this: list of 1-tuple `(type)` */ \
+ BOOST_PP_NIL \
+ /* number of const-bind `this` */ \
+ , \
+ /* binds: list of 2-tuple `(var_untyped, var_typed)` */ \
+ BOOST_PP_NIL /* nil list */ \
+ , \
+ /* bind this: list of 1-type `(type)` */ \
+ BOOST_PP_NIL \
+ , \
+ /* error: `[ERROR_message_text] EMPTY` */ \
+ BOOST_PP_EMPTY /* no error */ \
+ )
+
+#endif // #include guard
+
diff --git a/boost/local_function/aux_/preprocessor/traits/decl_/set_error.hpp b/boost/local_function/aux_/preprocessor/traits/decl_/set_error.hpp
new file mode 100644
index 0000000000..b3ec1b3fa7
--- /dev/null
+++ b/boost/local_function/aux_/preprocessor/traits/decl_/set_error.hpp
@@ -0,0 +1,38 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SET_ERROR_HPP_
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SET_ERROR_HPP_
+
+#include <boost/local_function/aux_/preprocessor/traits/decl_returns.hpp>
+#include <boost/local_function/aux_/preprocessor/traits/decl_params.hpp>
+#include <boost/local_function/aux_/preprocessor/traits/decl_const_binds.hpp>
+#include <boost/local_function/aux_/preprocessor/traits/decl_binds.hpp>
+
+// PUBLIC //
+
+// error: `[ERROR_message_text] EMPTY`, no ERROR_message_text if no error.
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SET_ERROR(decl_traits, error) \
+ ( /* return types */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_RETURNS(decl_traits) \
+ , /* params and defaults */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS(decl_traits) \
+ , /* const-bind names */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_CONST_BINDS(decl_traits) \
+ , /* const-bind `this` types */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_CONST_BIND_THIS_TYPES( \
+ decl_traits) \
+ , /* bind names */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_BINDS(decl_traits) \
+ , /* bind `this` types */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_BIND_THIS_TYPES(decl_traits) \
+ , /* error message (if any) */ \
+ error \
+ )
+
+#endif // #include guard
+
diff --git a/boost/local_function/aux_/preprocessor/traits/decl_/validate.hpp b/boost/local_function/aux_/preprocessor/traits/decl_/validate.hpp
new file mode 100644
index 0000000000..aab7f8866c
--- /dev/null
+++ b/boost/local_function/aux_/preprocessor/traits/decl_/validate.hpp
@@ -0,0 +1,24 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_VALIDATE_HPP_
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_VALIDATE_HPP_
+
+#include <boost/local_function/aux_/preprocessor/traits/decl_/validate_/this_count.hpp>
+#include <boost/local_function/aux_/preprocessor/traits/decl_/validate_/return_count.hpp>
+
+// PUBLIC //
+
+// Validate params after they have been parsed.
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_VALIDATE(decl_traits) \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_VALIDATE_THIS_COUNT( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_VALIDATE_RETURN_COUNT( \
+ decl_traits \
+ ))
+
+#endif // #include guard
+
diff --git a/boost/local_function/aux_/preprocessor/traits/decl_/validate_/return_count.hpp b/boost/local_function/aux_/preprocessor/traits/decl_/validate_/return_count.hpp
new file mode 100644
index 0000000000..4d337d900b
--- /dev/null
+++ b/boost/local_function/aux_/preprocessor/traits/decl_/validate_/return_count.hpp
@@ -0,0 +1,32 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_VALIDATE_RETURN_COUNT_HPP_
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_VALIDATE_RETURN_COUNT_HPP_
+
+#include <boost/local_function/aux_/preprocessor/traits/decl_/set_error.hpp>
+#include <boost/local_function/aux_/preprocessor/traits/decl_returns.hpp>
+#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/facilities/empty.hpp>
+#include <boost/preprocessor/tuple/eat.hpp>
+#include <boost/preprocessor/comparison/greater.hpp>
+#include <boost/preprocessor/list/size.hpp>
+
+// PRIVATE //
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_VALIDATE_RETURN_COUNT( \
+ decl_traits) \
+ BOOST_PP_IIF(BOOST_PP_GREATER(BOOST_PP_LIST_SIZE( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_RETURNS(decl_traits)), 1), \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SET_ERROR \
+ , /* else do nothing (keeping previous error, if any) */ \
+ decl_traits BOOST_PP_TUPLE_EAT(2) \
+ )(decl_traits, /* trailing `EMPTY` because error might not be present */ \
+ ERROR_cannot_specify_more_than_one_return_type BOOST_PP_EMPTY)
+
+#endif // #include guard
+
diff --git a/boost/local_function/aux_/preprocessor/traits/decl_/validate_/this_count.hpp b/boost/local_function/aux_/preprocessor/traits/decl_/validate_/this_count.hpp
new file mode 100644
index 0000000000..034e8e69b4
--- /dev/null
+++ b/boost/local_function/aux_/preprocessor/traits/decl_/validate_/this_count.hpp
@@ -0,0 +1,38 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_VALIDATE_THIS_COUNT_HPP_
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_VALIDATE_THIS_COUNT_HPP_
+
+#include <boost/local_function/aux_/preprocessor/traits/decl_/set_error.hpp>
+#include <boost/local_function/aux_/preprocessor/traits/decl_const_binds.hpp>
+#include <boost/local_function/aux_/preprocessor/traits/decl_binds.hpp>
+#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/facilities/empty.hpp>
+#include <boost/preprocessor/tuple/eat.hpp>
+#include <boost/preprocessor/comparison/greater.hpp>
+#include <boost/preprocessor/list/append.hpp>
+#include <boost/preprocessor/list/size.hpp>
+
+// PUBLIC //
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_VALIDATE_THIS_COUNT( \
+ decl_traits) \
+ BOOST_PP_IIF(BOOST_PP_GREATER(BOOST_PP_LIST_SIZE(BOOST_PP_LIST_APPEND( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_CONST_BIND_THIS_TYPES( \
+ decl_traits), \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_BIND_THIS_TYPES( \
+ decl_traits))), \
+ 1), \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SET_ERROR \
+ , /* do nothing (keeping previous error, if any) */ \
+ decl_traits BOOST_PP_TUPLE_EAT(2) \
+ )(decl_traits, /* trailing `EMPTY` because error might not be present */ \
+ ERROR_cannot_bind_object_this_multiple_times BOOST_PP_EMPTY)
+
+#endif // #include guard
+
diff --git a/boost/local_function/aux_/preprocessor/traits/decl_binds.hpp b/boost/local_function/aux_/preprocessor/traits/decl_binds.hpp
new file mode 100644
index 0000000000..0d4f18276c
--- /dev/null
+++ b/boost/local_function/aux_/preprocessor/traits/decl_binds.hpp
@@ -0,0 +1,35 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_BINDS_HPP_
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_BINDS_HPP_
+
+#include <boost/local_function/aux_/preprocessor/traits/decl_/index.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+#include <boost/preprocessor/list/transform.hpp>
+
+// PRIVATE //
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_BIND_APPLY_( \
+ d, bind_macro, bind_traits) \
+ bind_macro(bind_traits)
+
+// PUBLIC //
+
+// Expand: pp-list of non-const bind-traits.
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_BINDS(decl_traits) \
+ BOOST_PP_TUPLE_ELEM(BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_INDEX_MAX, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_INDEX_BINDS, decl_traits)
+
+// Expand: pp-list non-const bind-this-traits (size <= 1 after validation).
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_BIND_THIS_TYPES(decl_traits) \
+ BOOST_PP_TUPLE_ELEM(BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_INDEX_MAX, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_INDEX_BIND_THIS_TYPES, \
+ decl_traits)
+
+#endif // #include guard
+
diff --git a/boost/local_function/aux_/preprocessor/traits/decl_const_binds.hpp b/boost/local_function/aux_/preprocessor/traits/decl_const_binds.hpp
new file mode 100644
index 0000000000..0ea40cf6df
--- /dev/null
+++ b/boost/local_function/aux_/preprocessor/traits/decl_const_binds.hpp
@@ -0,0 +1,40 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_CONST_BINDS_HPP_
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_CONST_BINDS_HPP_
+
+#include <boost/local_function/aux_/preprocessor/traits/bind.hpp>
+#include <boost/local_function/aux_/preprocessor/traits/decl_/index.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+#include <boost/preprocessor/list/transform.hpp>
+
+// PRIVATE //
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_CONST_BIND_APPLY_( \
+ d, bind_macro, bind_traits) \
+ bind_macro(bind_traits)
+
+// PUBLIC //
+
+// Expand: pp-list of const bind-traits.
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_CONST_BINDS(decl_traits) \
+ BOOST_PP_TUPLE_ELEM(BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_INDEX_MAX, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_INDEX_CONST_BINDS, \
+ decl_traits)
+
+// Expand: pp-list of const bind-this-traits (size <= 1 after validation).
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_CONST_BIND_THIS_TYPES( \
+ decl_traits) \
+ BOOST_PP_TUPLE_ELEM( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_INDEX_MAX \
+ , BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_INDEX_CONST_BIND_THIS_TYPES \
+ , decl_traits \
+ )
+
+#endif // #include guard
+
diff --git a/boost/local_function/aux_/preprocessor/traits/decl_error.hpp b/boost/local_function/aux_/preprocessor/traits/decl_error.hpp
new file mode 100644
index 0000000000..a95fc7b760
--- /dev/null
+++ b/boost/local_function/aux_/preprocessor/traits/decl_error.hpp
@@ -0,0 +1,27 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_ERROR_HPP_
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_ERROR_HPP_
+
+#include <boost/local_function/aux_/preprocessor/traits/decl_/index.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+
+// PUBLIC //
+
+// Expand: `[ERROR_message_text] EMPTY`, EMPTY iff no pp-parsing error.
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_ERROR(decl_traits) \
+ BOOST_PP_TUPLE_ELEM(BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_INDEX_MAX, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_INDEX_ERROR, decl_traits)
+
+// Expand: `[ERROR_message_text]`, EMPTY iff no pp-parsing error.
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_ERROR_MSG(decl_traits) \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_ERROR(decl_traits) \
+ (/* expand EMPTY */)
+
+#endif // #include guard
+
diff --git a/boost/local_function/aux_/preprocessor/traits/decl_params.hpp b/boost/local_function/aux_/preprocessor/traits/decl_params.hpp
new file mode 100644
index 0000000000..ae5a34f776
--- /dev/null
+++ b/boost/local_function/aux_/preprocessor/traits/decl_params.hpp
@@ -0,0 +1,59 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS_HPP_
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS_HPP_
+
+#include <boost/local_function/aux_/preprocessor/traits/decl_/index.hpp>
+#include <boost/local_function/aux_/preprocessor/traits/param.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/default.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+#include <boost/preprocessor/tuple/eat.hpp>
+#include <boost/preprocessor/tuple/rem.hpp>
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/logical/compl.hpp>
+#include <boost/preprocessor/facilities/is_empty.hpp>
+#include <boost/preprocessor/list/adt.hpp>
+#include <boost/preprocessor/list/fold_left.hpp>
+
+// PRIVATE //
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS_DEFAULT_OP_(s, \
+ default_count, param_traits) \
+ BOOST_PP_IIF(BOOST_PP_IS_EMPTY( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_PARAM_TRAITS_DEFAULT(param_traits)), \
+ BOOST_PP_TUPLE_REM(1) \
+ , \
+ BOOST_PP_INC \
+ )(default_count)
+
+// Precondition: params is a pp-list which is not nil.
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS_DEFAULT_COUNT_(params) \
+ BOOST_PP_LIST_FOLD_LEFT( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS_DEFAULT_OP_, \
+ 0 /* start with defaults_count to 0 */, params)
+
+// PUBLIC //
+
+// Expand: pp-list of param-traits (no bound variables).
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS(decl_traits) \
+ BOOST_PP_TUPLE_ELEM(BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_INDEX_MAX, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_INDEX_PARAMS, decl_traits)
+
+// Expand: number of parameters with default values (0 if no default).
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS_DEFAULT_COUNT( \
+ decl_traits) \
+ BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS(decl_traits)), \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS_DEFAULT_COUNT_ \
+ , \
+ 0 BOOST_PP_TUPLE_EAT(1) \
+ )(BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS(decl_traits))
+
+#endif // #include guard
+
diff --git a/boost/local_function/aux_/preprocessor/traits/decl_returns.hpp b/boost/local_function/aux_/preprocessor/traits/decl_returns.hpp
new file mode 100644
index 0000000000..941358a6d5
--- /dev/null
+++ b/boost/local_function/aux_/preprocessor/traits/decl_returns.hpp
@@ -0,0 +1,22 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_RETURNS_HPP_
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_RETURNS_HPP_
+
+#include <boost/local_function/aux_/preprocessor/traits/decl_/index.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+
+// PUBLIC //
+
+// Expand: pp-list of result types (size <= 1 after validation).
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_RETURNS(decl_traits) \
+ BOOST_PP_TUPLE_ELEM(BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_INDEX_MAX, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_INDEX_RETURNS, decl_traits)
+
+#endif // #include guard
+
diff --git a/boost/local_function/aux_/preprocessor/traits/decl_sign_/any_bind_type.hpp b/boost/local_function/aux_/preprocessor/traits/decl_sign_/any_bind_type.hpp
new file mode 100644
index 0000000000..a39964228a
--- /dev/null
+++ b/boost/local_function/aux_/preprocessor/traits/decl_sign_/any_bind_type.hpp
@@ -0,0 +1,88 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_ANY_BIND_TYPE_HPP_
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_ANY_BIND_TYPE_HPP_
+
+#include <boost/local_function/detail/preprocessor/keyword/const_bind.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/this.hpp>
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/facilities/empty.hpp>
+#include <boost/preprocessor/facilities/expand.hpp>
+#include <boost/preprocessor/tuple/eat.hpp>
+#include <boost/preprocessor/tuple/rem.hpp>
+#include <boost/preprocessor/detail/is_unary.hpp>
+
+// PRIVATE //
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_ANY_BIND_WITH_TYPE_(sign) \
+ /* using PP_EXPAND here does not work on MSVC */ \
+ BOOST_PP_TUPLE_REM(1) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_CONST_BIND_REMOVE_FRONT(sign) \
+ BOOST_PP_EMPTY /* always trail EMPTY because bind type is optional */
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_ANY_BIND_WITHOUT_TYPE_( \
+ sign) \
+ /* using PP_EXPAND here does not work on MSVC */ \
+ BOOST_PP_TUPLE_EAT(1) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_CONST_BIND_REMOVE_FRONT(sign)
+
+#define this_BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_REMOVE_THIS_ \
+ /* must expand to nothing */
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_ANY_BIND_THIS_TYPE_(sign) \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_ANY_BIND_WITH_TYPE( \
+ /* can't use `THISUNDERSCIRE_REMOVE_BACK` because `sign` contains */ \
+ /* multiple tokens (and not just one token) so */ \
+ /* `IS_THISUNDERSCORE_BACK` does not work (but we know `sign` ends */ \
+ /* with this_ if we here so we can manually force the removal using */ \
+ BOOST_PP_CAT(sign, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_REMOVE_THIS_) \
+ ) \
+ /* do not append PP_EMPTY because ANY_BIND_WITH_TYPE macro above */ \
+ /* already appends it */
+
+// PUBLIC //
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_ANY_BIND_HAS_TYPE(sign) \
+ BOOST_PP_IS_UNARY( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_CONST_BIND_REMOVE_FRONT( \
+ sign))
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_ANY_BIND_WITH_TYPE(sign) \
+ BOOST_PP_IIF( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_ANY_BIND_HAS_TYPE( \
+ sign),\
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_ANY_BIND_WITH_TYPE_ \
+ , \
+ BOOST_PP_EMPTY \
+ BOOST_PP_TUPLE_EAT(1) \
+ )(sign)
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_ANY_BIND_WITHOUT_TYPE( \
+ sign) \
+ BOOST_PP_IIF( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_ANY_BIND_HAS_TYPE( \
+ sign),\
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_ANY_BIND_WITHOUT_TYPE_ \
+ , \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_CONST_BIND_REMOVE_FRONT \
+ )(sign)
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_ANY_BIND_THIS_TYPE(sign) \
+ BOOST_PP_IIF( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_ANY_BIND_HAS_TYPE( \
+ sign),\
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_ANY_BIND_THIS_TYPE_ \
+ , \
+ BOOST_PP_EMPTY \
+ BOOST_PP_TUPLE_EAT(1) \
+ )(sign)
+
+#endif // #include guard
+
diff --git a/boost/local_function/aux_/preprocessor/traits/decl_sign_/sign.hpp b/boost/local_function/aux_/preprocessor/traits/decl_sign_/sign.hpp
new file mode 100644
index 0000000000..7dc4db1238
--- /dev/null
+++ b/boost/local_function/aux_/preprocessor/traits/decl_sign_/sign.hpp
@@ -0,0 +1,138 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_HPP_
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_HPP_
+
+#include <boost/local_function/aux_/preprocessor/traits/decl_sign_/validate.hpp>
+#include <boost/local_function/aux_/preprocessor/traits/decl_sign_/any_bind_type.hpp>
+#include <boost/local_function/aux_/preprocessor/traits/decl_/nil.hpp>
+#include <boost/local_function/aux_/preprocessor/traits/decl_/set_error.hpp>
+#include <boost/local_function/aux_/preprocessor/traits/decl_/validate.hpp>
+#include <boost/local_function/aux_/preprocessor/traits/decl_/append.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/const_bind.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/bind.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/return.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/default.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/thisunderscore.hpp>
+#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/facilities/is_empty.hpp>
+#include <boost/preprocessor/list/fold_left.hpp>
+
+// PRIVATE //
+
+// Parse const binds.
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALID_CONST_BIND_THIS_( \
+ decl_traits, sign) \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_APPEND_CONST_BIND_THIS_TYPE( \
+ decl_traits, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_ANY_BIND_THIS_TYPE( \
+ sign))
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALID_CONST_BIND_VAR_( \
+ decl_traits, sign) \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_APPEND_CONST_BIND(decl_traits, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_ANY_BIND_WITHOUT_TYPE(\
+ sign), \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_ANY_BIND_WITH_TYPE( \
+ sign))
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALID_CONST_BIND_( \
+ decl_traits, sign) \
+ /* check from back because non `this` bounds might have `&` in front */ \
+ BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_THISUNDERSCORE_BACK(\
+ /* remove all leading symbols `[const] bind [(type)] ...` */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_ANY_BIND_WITHOUT_TYPE(\
+ sign)),\
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALID_CONST_BIND_THIS_ \
+ , \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALID_CONST_BIND_VAR_ \
+ )(decl_traits, sign)
+
+// Parse binds.
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALID_BIND_THIS_( \
+ decl_traits, sign) \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_APPEND_BIND_THIS_TYPE(decl_traits, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_ANY_BIND_THIS_TYPE( \
+ sign))
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALID_BIND_VAR_( \
+ decl_traits, sign) \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_APPEND_BIND(decl_traits, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_ANY_BIND_WITHOUT_TYPE(\
+ sign), \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_ANY_BIND_WITH_TYPE( \
+ sign))
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALID_BIND_( \
+ decl_traits, sign) \
+ /* check from back because non `this` bounds might have `&` in front */ \
+ BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_THISUNDERSCORE_BACK(\
+ /* remove all leading symbols `[const] bind [(type)] ...` */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_ANY_BIND_WITHOUT_TYPE(\
+ sign)), \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALID_BIND_THIS_ \
+ , \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALID_BIND_VAR_ \
+ )(decl_traits, sign)
+
+// Parse all elements.
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALID_( \
+ s, decl_traits, sign) \
+ BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_RETURN_FRONT(sign), \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_APPEND_RETURN \
+ , BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_BIND_FRONT(sign), \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALID_BIND_ \
+ , BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_CONST_BIND_FRONT( \
+ sign), \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALID_CONST_BIND_ \
+ , BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_DEFAULT_FRONT( \
+ sign), \
+ /* elem is `default ...` where leading default is kept because */ \
+ /* default value might not be alphanumeric (so it fails later CAT */ \
+ /* for checks), leading default will be removed later when getting */ \
+ /* the default value */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_APPEND_PARAM_DEFAULT \
+ , /* else, it is a function parameter */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_APPEND_PARAM \
+ ))))(decl_traits, sign)
+
+// Parse params after following precondition has been validated by caller.
+// Precondition: If list contains a default param value `..., default, ...`,
+// the default value element is never 1st (it always has a previous elem) and
+// its previous element is a unbind param (no const-bind and no bind).
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALID(sign) \
+ BOOST_PP_LIST_FOLD_LEFT( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALID_, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_NIL, sign)
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_OK_(sign, unused) \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_VALIDATE( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALID(sign))
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_ERR_(unused, error) \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SET_ERROR( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_NIL, error)
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_(sign, defaults_error) \
+ BOOST_PP_IIF(BOOST_PP_IS_EMPTY(defaults_error (/* expand EMPTY */)), \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_OK_ \
+ , \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_ERR_ \
+ )(sign, defaults_error)
+
+// PUBLIC //
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN(sign) \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_(sign, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE(sign))
+
+#endif // #include guard
+
diff --git a/boost/local_function/aux_/preprocessor/traits/decl_sign_/validate.hpp b/boost/local_function/aux_/preprocessor/traits/decl_sign_/validate.hpp
new file mode 100644
index 0000000000..ef49610004
--- /dev/null
+++ b/boost/local_function/aux_/preprocessor/traits/decl_sign_/validate.hpp
@@ -0,0 +1,32 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_HPP_
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_HPP_
+
+#include <boost/local_function/aux_/preprocessor/traits/decl_sign_/validate_/defaults.hpp>
+#include <boost/local_function/aux_/preprocessor/traits/decl_sign_/validate_/this.hpp>
+#include <boost/preprocessor/tuple/eat.hpp>
+
+// PRIVATE //
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_1_(sign, error) \
+ BOOST_PP_IIF(BOOST_PP_IS_EMPTY(error(/* expand empty */)), \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_THIS \
+ , \
+ error BOOST_PP_TUPLE_EAT(1) \
+ )(sign)
+
+// PUBLIC //
+
+// Validate params before starting to parse it.
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE(sign) \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_1_(sign, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_DEFAULTS(sign))
+
+#endif // #include guard
+
diff --git a/boost/local_function/aux_/preprocessor/traits/decl_sign_/validate_/defaults.hpp b/boost/local_function/aux_/preprocessor/traits/decl_sign_/validate_/defaults.hpp
new file mode 100644
index 0000000000..28f1efa392
--- /dev/null
+++ b/boost/local_function/aux_/preprocessor/traits/decl_sign_/validate_/defaults.hpp
@@ -0,0 +1,125 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_DEFAULTS_HPP_
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_DEFAULTS_HPP_
+
+#include <boost/local_function/detail/preprocessor/keyword/const_bind.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/bind.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/default.hpp>
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/control/while.hpp>
+#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/control/if.hpp>
+#include <boost/preprocessor/facilities/expand.hpp>
+#include <boost/preprocessor/facilities/empty.hpp>
+#include <boost/preprocessor/facilities/is_empty.hpp>
+#include <boost/preprocessor/logical/bitand.hpp>
+#include <boost/preprocessor/logical/bitor.hpp>
+#include <boost/preprocessor/logical/not.hpp>
+#include <boost/preprocessor/comparison/less.hpp>
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/arithmetic/dec.hpp>
+#include <boost/preprocessor/tuple/eat.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+#include <boost/preprocessor/list/size.hpp>
+#include <boost/preprocessor/list/at.hpp>
+
+// PRIVATE //
+
+#define \
+BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_DEFAULTS_IS_UNBIND_( \
+ sign) \
+ /* PP_OR/PP_BITOR (instead of IIF) don't expand on MSVC */ \
+ BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_DEFAULT_FRONT(sign),\
+ 0 \
+ , BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_CONST_BIND_FRONT( \
+ sign), \
+ 0 \
+ , BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_BIND_FRONT(sign), \
+ 0 \
+ , \
+ 1 \
+ )))
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_DEFAULTS_PREV_( \
+ sign, index, error) \
+ BOOST_PP_IIF( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_DEFAULTS_IS_UNBIND_( \
+ BOOST_PP_LIST_AT(sign, BOOST_PP_DEC(index))), \
+ error /* no err, fwd existing one if any */ \
+ , \
+ BOOST_PP_CAT(BOOST_PP_CAT(ERROR_default_value_at_element_, \
+ BOOST_PP_INC(index)), _must_follow_an_unbound_parameter) \
+ BOOST_PP_EMPTY /* because error might not be present */ \
+ )
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_DEFAULTS_INDEX_( \
+ sign, index, error) \
+ BOOST_PP_IF(index, /* can't use IIF because index can be any number */ \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_DEFAULTS_PREV_ \
+ , \
+ ERROR_default_value_cannot_be_specified_as_the_first_element \
+ BOOST_PP_EMPTY /* because error might not be present */ \
+ BOOST_PP_TUPLE_EAT(3) \
+ )(sign, index, error)
+
+// While's operation.
+
+#define \
+BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_DEFAULTS_OP_DATA_( \
+ sign, index, error) \
+ ( \
+ sign \
+ , \
+ BOOST_PP_INC(index) \
+ , \
+ BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_DEFAULT_FRONT( \
+ BOOST_PP_LIST_AT(sign, index)), \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_DEFAULTS_INDEX_ \
+ , \
+ error BOOST_PP_TUPLE_EAT(3) /* no err, fwd existing one if any */\
+ )(sign, index, error) \
+ )
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_DEFAULTS_OP_(d, \
+ sign_index_error) \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_DEFAULTS_OP_DATA_( \
+ BOOST_PP_TUPLE_ELEM(3, 0, sign_index_error), \
+ BOOST_PP_TUPLE_ELEM(3, 1, sign_index_error), \
+ BOOST_PP_TUPLE_ELEM(3, 2, sign_index_error))
+
+// While predicate.
+
+#define \
+BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_DEFAULTS_PRED_DATA_( \
+ sign, index, error) \
+ BOOST_PP_BITAND( \
+ BOOST_PP_IS_EMPTY(error (/* expand empty */) ) \
+ , BOOST_PP_LESS(index, BOOST_PP_LIST_SIZE(sign)) \
+ )
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_DEFAULTS_PRED_( \
+ d, sign_index_error) \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_DEFAULTS_PRED_DATA_( \
+ BOOST_PP_TUPLE_ELEM(3, 0, sign_index_error), \
+ BOOST_PP_TUPLE_ELEM(3, 1, sign_index_error), \
+ BOOST_PP_TUPLE_ELEM(3, 2, sign_index_error))
+
+// PUBLIC //
+
+// Validate parameters default values: `default ...` cannot be 1st element and
+// it must follow an unbind param. Expand to `EMPTY` if no error, or
+// `ERROR_message EMPTY` if error.
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_DEFAULTS(sign) \
+ BOOST_PP_TUPLE_ELEM(3, 2, BOOST_PP_WHILE( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_DEFAULTS_PRED_, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_DEFAULTS_OP_,\
+ (sign, 0, BOOST_PP_EMPTY)))
+
+#endif // #include guard
+
diff --git a/boost/local_function/aux_/preprocessor/traits/decl_sign_/validate_/this.hpp b/boost/local_function/aux_/preprocessor/traits/decl_sign_/validate_/this.hpp
new file mode 100644
index 0000000000..8a924bdab3
--- /dev/null
+++ b/boost/local_function/aux_/preprocessor/traits/decl_sign_/validate_/this.hpp
@@ -0,0 +1,66 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_THIS_HPP_
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_THIS_HPP_
+
+#include <boost/local_function/detail/preprocessor/keyword/this.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/const.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/bind.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/const_bind.hpp>
+#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/tuple/eat.hpp>
+#include <boost/preprocessor/facilities/empty.hpp>
+#include <boost/preprocessor/list/fold_left.hpp>
+
+// PRIVATE //
+
+#define \
+BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_THIS_TYPED_EAT_(elem) \
+ /* must be in separate macro to delay expansion */ \
+ BOOST_PP_TUPLE_EAT(1) elem
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_THIS_TYPED_( \
+ elem) \
+ BOOST_PP_IIF(BOOST_PP_IS_UNARY(elem), \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_THIS_TYPED_EAT_ \
+ , \
+ BOOST_PP_TUPLE_REM(1) \
+ )(elem)
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_THIS_VAR_( \
+ s, error, elem) \
+ BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_THIS_BACK( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_THIS_TYPED_( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_BIND_REMOVE_FRONT( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_CONST_REMOVE_FRONT( \
+ elem)))), \
+ ERROR_use_this_underscore_instead_of_this BOOST_PP_EMPTY \
+ , \
+ error \
+ )
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_THIS_( \
+ s, error, elem) \
+ BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_BIND_FRONT(elem), \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_THIS_VAR_ \
+ , BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_CONST_BIND_FRONT( \
+ elem), \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_THIS_VAR_ \
+ , \
+ error BOOST_PP_TUPLE_EAT(3) \
+ ))(s, error, elem)
+
+// PUBLIC //
+
+#define BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_THIS(sign) \
+ BOOST_PP_LIST_FOLD_LEFT( \
+ BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_THIS_, \
+ BOOST_PP_EMPTY, sign)
+
+#endif // #include guard
+
diff --git a/boost/local_function/aux_/preprocessor/traits/param.hpp b/boost/local_function/aux_/preprocessor/traits/param.hpp
new file mode 100644
index 0000000000..641cd81766
--- /dev/null
+++ b/boost/local_function/aux_/preprocessor/traits/param.hpp
@@ -0,0 +1,36 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_AUX_PP_PARAM_TRAITS_HPP_
+#define BOOST_LOCAL_FUNCTION_AUX_PP_PARAM_TRAITS_HPP_
+
+#include <boost/preprocessor/tuple/elem.hpp>
+
+// PRIVATE //
+
+// Param 2-tuple `([auto | register] type name, default_value)`.
+#define BOOST_LOCAL_FUNCTION_AUX_PP_PARAM_TRAITS_INDEX_DECL_ 0
+#define BOOST_LOCAL_FUNCTION_AUX_PP_PARAM_TRAITS_INDEX_DEFAULT_ 1
+#define BOOST_LOCAL_FUNCTION_AUX_PP_PARAM_TRAITS_INDEX_MAX_ 2
+
+// PUBLIC //
+
+// Expand: `[auto | register] type_ name_` (parameter declaration).
+#define BOOST_LOCAL_FUNCTION_AUX_PP_PARAM_TRAITS_DECL(param_traits) \
+ BOOST_PP_TUPLE_ELEM(BOOST_LOCAL_FUNCTION_AUX_PP_PARAM_TRAITS_INDEX_MAX_, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_PARAM_TRAITS_INDEX_DECL_, param_traits)
+
+// Expand: `default ... EMPTY()` if default value, `EMPTY()` otherwise.
+// Leading default is kept because default value might not be alphanumeric
+// (e.g., -123) so failing `CAT` for `IS_EMPTY` check.
+#define BOOST_LOCAL_FUNCTION_AUX_PP_PARAM_TRAITS_DEFAULT(param_traits) \
+ BOOST_PP_TUPLE_ELEM(BOOST_LOCAL_FUNCTION_AUX_PP_PARAM_TRAITS_INDEX_MAX_, \
+ BOOST_LOCAL_FUNCTION_AUX_PP_PARAM_TRAITS_INDEX_DEFAULT_, \
+ param_traits)(/* expand EMPTY */)
+
+#endif // #include guard
+
diff --git a/boost/local_function/aux_/symbol.hpp b/boost/local_function/aux_/symbol.hpp
new file mode 100644
index 0000000000..859fed6501
--- /dev/null
+++ b/boost/local_function/aux_/symbol.hpp
@@ -0,0 +1,50 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_AUX_SYMBOL_HPP_
+#define BOOST_LOCAL_FUNCTION_AUX_SYMBOL_HPP_
+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/seq/cat.hpp>
+#include <boost/preprocessor/seq/transform.hpp>
+
+// PRIVATE //
+
+// NOTE: INFIX is used to separate symbols concatenated together. Some of these
+// symbols are user-defined so they can be anything. Because they can contain
+// underscore `_` and/or start with capital letters, it is NOT safe for the
+// INFIX to be the underscore `_` character because that could lead to library
+// defined symbols containing double underscores `__` or a leading underscore
+// (followed or not by a capital letter) in the global namespace. All these
+// symbols are reserved by the C++ standard: (1) "each name that contains a
+// double underscore (_ _) or begins with an underscore followed by an
+// uppercase letter is reserved to the implementation" and (2) "each name that
+// begins with an underscore is reserved to the implementation for use as a
+// name in the global namespace".
+#define BOOST_LOCAL_FUNCTION_AUX_SYMBOL_INFIX_ X // `X` used as separator.
+
+#define BOOST_LOCAL_FUNCTION_AUX_SYMBOL_PREFIX_ boost_local_function_aux
+
+#define BOOST_LOCAL_FUNCTION_AUX_SYMBOL_POSTFIX_(s, unused, tokens) \
+ BOOST_PP_CAT(tokens, BOOST_LOCAL_FUNCTION_AUX_SYMBOL_INFIX_)
+
+// PUBLIC //
+
+// Prefixes this library reserved symbol.
+#define BOOST_LOCAL_FUNCTION_AUX_SYMBOL(seq) \
+ BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_TRANSFORM( \
+ BOOST_LOCAL_FUNCTION_AUX_SYMBOL_POSTFIX_, \
+ ~, (BOOST_LOCAL_FUNCTION_AUX_SYMBOL_PREFIX_) seq ))
+
+// Postfixes this library reserved symbol.
+#define BOOST_LOCAL_FUNCTION_AUX_SYMBOL_POSTFIX(seq) \
+ BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_TRANSFORM( \
+ BOOST_LOCAL_FUNCTION_AUX_SYMBOL_POSTFIX_, \
+ ~, seq (BOOST_LOCAL_FUNCTION_AUX_SYMBOL_PREFIX_) ))
+
+#endif // #include guard
+
diff --git a/boost/local_function/config.hpp b/boost/local_function/config.hpp
new file mode 100644
index 0000000000..bab295378d
--- /dev/null
+++ b/boost/local_function/config.hpp
@@ -0,0 +1,114 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_CONFIG_HPP_
+#define BOOST_LOCAL_FUNCTION_CONFIG_HPP_
+
+#ifndef DOXYGEN
+
+#include <boost/config.hpp>
+
+#ifndef BOOST_LOCAL_FUNCTION_CONFIG_FUNCTION_ARITY_MAX
+# define BOOST_LOCAL_FUNCTION_CONFIG_FUNCTION_ARITY_MAX 5
+#endif
+
+#ifndef BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX
+# define BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX 10
+#endif
+
+#ifndef BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
+# ifdef BOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS
+# define BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS 0
+# else
+# define BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS 1
+# endif
+#elif BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS // If true, force it to 1.
+# undef BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
+# define BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS 1
+#endif
+
+#else // DOXYGEN
+
+/** @file
+@brief Configuration macros allow to change the behaviour of this library at
+compile-time.
+*/
+
+/**
+@brief Maximum number of parameters supported by local functions.
+
+If programmers leave this configuration macro undefined, its default
+value is <c>5</c> (increasing this number might increase compilation time).
+When defined by programmers, this macro must be a non-negative integer number.
+
+@Note This macro specifies the maximum number of local function parameters
+excluding bound variables (which are instead specified by
+@RefMacro{BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX}).
+
+@See @RefSect{tutorial, Tutorial} section,
+@RefSect{getting_started, Getting Started} section,
+@RefMacro{BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX}.
+*/
+#define BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX
+
+/**
+@brief Maximum number of bound variables supported by local functions.
+
+If programmers leave this configuration macro undefined, its default
+value is <c>10</c> (increasing this number might increase compilation time).
+When defined by programmers, this macro must be a non-negative integer number.
+
+@Note This macro specifies the maximum number of bound variables excluding
+local function parameters (which are instead specified by
+@RefMacro{BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX}).
+
+@See @RefSect{tutorial, Tutorial} section,
+@RefSect{getting_started, Getting Started} section,
+@RefMacro{BOOST_LOCAL_FUNCTION_CONFIG_ARITY_MAX}.
+*/
+#define BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX
+
+/**
+@brief Specify when local functions can be passed as template parameters
+without introducing any run-time overhead.
+
+If this macro is defined to <c>1</c>, this library will assume that the
+compiler allows to pass local classes as template parameters:
+@code
+ template<typename T> void f(void) {}
+
+ int main(void) {
+ struct local_class {};
+ f<local_class>();
+ return 0;
+ }
+@endcode
+This is the case for C++11 compilers and some C++03 compilers (e.g., MSVC), but
+it is not the case in general for most C++03 compilers (including GCC).
+This will allow the library to pass local functions as template parameters
+without introducing any run-time overhead (specifically without preventing the
+compiler from optimizing local function calls by inlining their assembly code).
+
+If this macro is defined to <c>0</c> instead, this library will introduce
+a run-time overhead associated to resolving a function pointer call in order to
+still allow to pass the local functions as template parameters.
+
+It is recommended to leave this macro undefined.
+In this case, the library will automatically define this macro to <c>0</c> if
+the Boost.Config macro <c>BOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS</c> is
+defined for the specific compiler, and to <c>1</c> otherwise.
+
+@See @RefSect{getting_started, Getting Started} section,
+@RefSect{advanced_topics, Advanced Topics} section,
+@RefMacro{BOOST_LOCAL_FUNCTION_NAME}.
+*/
+#define BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
+
+#endif // DOXYGEN
+
+#endif // #include guard
+
diff --git a/boost/local_function/detail/preprocessor/keyword/auto.hpp b/boost/local_function/detail/preprocessor/keyword/auto.hpp
new file mode 100644
index 0000000000..f554de9219
--- /dev/null
+++ b/boost/local_function/detail/preprocessor/keyword/auto.hpp
@@ -0,0 +1,58 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_AUTO_HPP_
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_AUTO_HPP_
+
+#include <boost/local_function/detail/preprocessor/keyword/facility/is.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/facility/add.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/facility/remove.hpp>
+
+// PRIVATE //
+
+// These are not local macros -- DO NOT #UNDEF.
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_AUTO_IS_auto (1) /* unary */
+#define auto_BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_AUTO_IS (1) /* unary */
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_AUTO_REMOVE_auto /* nothing */
+#define auto_BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_AUTO_REMOVE /* nothing */
+
+// PUBLIC //
+
+// Is.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_AUTO_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_AUTO_IS_)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_AUTO_BACK(token) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_BACK(token, \
+ _BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_AUTO_IS)
+
+// Remove.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_AUTO_REMOVE_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_AUTO_FRONT, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_AUTO_REMOVE_)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_AUTO_REMOVE_BACK(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_BACK(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_AUTO_BACK, \
+ _BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_AUTO_REMOVE)
+
+// Add.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_AUTO_ADD_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_AUTO_FRONT, auto)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_AUTO_ADD_BACK(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_BACK(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_AUTO_BACK, auto)
+
+#endif // #include guard
+
diff --git a/boost/local_function/detail/preprocessor/keyword/bind.hpp b/boost/local_function/detail/preprocessor/keyword/bind.hpp
new file mode 100644
index 0000000000..44b8c23073
--- /dev/null
+++ b/boost/local_function/detail/preprocessor/keyword/bind.hpp
@@ -0,0 +1,58 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_BIND_HPP_
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_BIND_HPP_
+
+#include <boost/local_function/detail/preprocessor/keyword/facility/is.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/facility/add.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/facility/remove.hpp>
+
+// PRIVATE //
+
+// These are not local macros -- DO NOT #UNDEF.
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_BIND_IS_bind (1) /* unary */
+#define bind_BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_BIND_IS (1) /* unary */
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_BIND_REMOVE_bind /* nothing */
+#define bind_BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_BIND_REMOVE /* nothing */
+
+// PUBLIC //
+
+// Is.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_BIND_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_BIND_IS_)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_BIND_BACK(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_BACK(tokens, \
+ _BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_BIND_IS)
+
+// Remove.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_BIND_REMOVE_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_BIND_FRONT, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_BIND_REMOVE_)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_BIND_REMOVE_BACK(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_BACK(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_BIND_BACK, \
+ _BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_BIND_REMOVE)
+
+// Add.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_BIND_ADD_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_BIND_FRONT, bind)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_BIND_ADD_BACK(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_BACK(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_BIND_BACK, bind)
+
+#endif // #include guard
+
diff --git a/boost/local_function/detail/preprocessor/keyword/const.hpp b/boost/local_function/detail/preprocessor/keyword/const.hpp
new file mode 100644
index 0000000000..c15bfabdc5
--- /dev/null
+++ b/boost/local_function/detail/preprocessor/keyword/const.hpp
@@ -0,0 +1,58 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_CONST_HPP_
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_CONST_HPP_
+
+#include <boost/local_function/detail/preprocessor/keyword/facility/is.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/facility/add.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/facility/remove.hpp>
+
+// PRIVATE //
+
+// These are not local macros -- DO NOT #UNDEF.
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_CONST_IS_const (1) /* unary */
+#define const_BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_CONST_IS (1) /* unary */
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_CONST_REMOVE_const /* nothing */
+#define const_BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_CONST_REMOVE /* nothing */
+
+// PUBLIC //
+
+// Is.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_CONST_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_CONST_IS_)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_CONST_BACK(token) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_BACK(token, \
+ _BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_CONST_IS)
+
+// Remove.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_CONST_REMOVE_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_CONST_FRONT, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_CONST_REMOVE_)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_CONST_REMOVE_BACK(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_BACK(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_CONST_BACK, \
+ _BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_CONST_REMOVE)
+
+// Add.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_CONST_ADD_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_CONST_FRONT, const)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_CONST_ADD_BACK(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_BACK(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_CONST_BACK, const)
+
+#endif // #include guard
+
diff --git a/boost/local_function/detail/preprocessor/keyword/const_bind.hpp b/boost/local_function/detail/preprocessor/keyword/const_bind.hpp
new file mode 100644
index 0000000000..6e886e1a63
--- /dev/null
+++ b/boost/local_function/detail/preprocessor/keyword/const_bind.hpp
@@ -0,0 +1,74 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_CONST_BIND_HPP_
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_CONST_BIND_HPP_
+
+#include <boost/local_function/detail/preprocessor/keyword/bind.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/const.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/facility/add.hpp>
+#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/tuple/eat.hpp>
+
+// PRIVATE //
+
+// These are not local macros -- DO NOT #UNDEF.
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_BIND_IS_bind (1) /* unary */
+#define bind_BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_BIND_IS (1) /* unary */
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_BIND_REMOVE_bind /* nothing */
+#define bind_BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_BIND_REMOVE /* nothing */
+
+// PUBLIC //
+
+// Is.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_CONST_BIND_FRONT_(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_BIND_FRONT( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_CONST_REMOVE_FRONT(tokens))
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_CONST_BIND_FRONT(tokens) \
+ BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_CONST_FRONT(tokens),\
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_CONST_BIND_FRONT_ \
+ , \
+ 0 BOOST_PP_TUPLE_EAT(1) \
+ )(tokens)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_CONST_BIND_BACK_(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_CONST_BACK( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_BIND_REMOVE_BACK(tokens))
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_CONDT_BIND_BACK(tokens) \
+ BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_BIND_BACK(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_CONST_BIND_BACK_ \
+ , \
+ 0 BOOST_PP_TUPLE_EAT(1) \
+ )(tokens)
+
+// Remove.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_CONST_BIND_REMOVE_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_BIND_REMOVE_FRONT( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_CONST_REMOVE_FRONT(tokens))
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_CONST_BIND_REMOVE_BACK(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_CONST_REMOVE_BACK( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_BIND_REMOVE_BACK(tokens))
+
+// Add.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_CONST_BIND_ADD_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_CONST_BIND_FRONT, \
+ const bind)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_CONST_BIND_ADD_BACK(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_BACK(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_CONST_BIND_BACK, \
+ const bind)
+
+#endif // #include guard
+
diff --git a/boost/local_function/detail/preprocessor/keyword/default.hpp b/boost/local_function/detail/preprocessor/keyword/default.hpp
new file mode 100644
index 0000000000..042f50745f
--- /dev/null
+++ b/boost/local_function/detail/preprocessor/keyword/default.hpp
@@ -0,0 +1,58 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_DEFAULT_HPP_
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_DEFAULT_HPP_
+
+#include <boost/local_function/detail/preprocessor/keyword/facility/is.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/facility/add.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/facility/remove.hpp>
+
+// PRIVATE //
+
+// These are not local macros -- DO NOT #UNDEF.
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_DEFAULT_IS_default (1)/* unary */
+#define default_BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_DEFAULT_IS (1)/* unary */
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_DEFAULT_REMOVE_default/*nothing*/
+#define default_BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_DEFAULT_REMOVE/*nothing*/
+
+// PUBLIC //
+
+// Is.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_DEFAULT_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_DEFAULT_IS_)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_DEFAULT_BACK(token) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_BACK(token, \
+ _BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_DEFAULT_IS)
+
+// Remove.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_DEFAULT_REMOVE_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_DEFAULT_FRONT, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_DEFAULT_REMOVE_)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_DEFAULT_REMOVE_BACK(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_BACK(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_DEFAULT_BACK, \
+ _BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_DEFAULT_REMOVE)
+
+// Add.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_DEFAULT_ADD_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_DEFAULT_FRONT, default)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_DEFAULT_ADD_BACK(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_BACK(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_DEFAULT_BACK, default)
+
+#endif // #include guard
+
diff --git a/boost/local_function/detail/preprocessor/keyword/facility/add.hpp b/boost/local_function/detail/preprocessor/keyword/facility/add.hpp
new file mode 100644
index 0000000000..13f5699085
--- /dev/null
+++ b/boost/local_function/detail/preprocessor/keyword/facility/add.hpp
@@ -0,0 +1,25 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_HPP_
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_HPP_
+
+#include <boost/preprocessor/control/expr_iif.hpp>
+#include <boost/preprocessor/logical/compl.hpp>
+
+// `is_front_macro(tokens)` is 1 if `tokens` start w/ `keyword` to add, else 0.
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_FRONT( \
+ tokens, is_front_macro, keyword) \
+ BOOST_PP_EXPR_IIF(BOOST_PP_COMPL(is_front_macro(tokens)), keyword) tokens
+
+// `is_back_macro(tokens)` is 1 if `tokens` end with `keyword` to add, else 0.
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_BACK( \
+ tokens, is_back_macro, keyword) \
+ tokens BOOST_PP_EXPR_IIF(BOOST_PP_COMPL(is_back_macro(tokens)), keyword)
+
+#endif // #include guard
+
diff --git a/boost/local_function/detail/preprocessor/keyword/facility/is.hpp b/boost/local_function/detail/preprocessor/keyword/facility/is.hpp
new file mode 100644
index 0000000000..a5a1151a61
--- /dev/null
+++ b/boost/local_function/detail/preprocessor/keyword/facility/is.hpp
@@ -0,0 +1,51 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_HPP_
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_HPP_
+
+// Boost.Preprocessor author P. Mensodines confirmed on an Boost email thread
+// (subject ``check if a token is a keyword (was "BOOST_PP_IS_UNARY()")'')
+// that it is OK to used `PP_IS_UNARY()` to check if tokens match predefined
+// "keyword" as it is done by the macros below (even if `PP_IS_UNARY()` is
+// technically only part of Boost.Preprocessor private API).
+#include <boost/preprocessor/detail/is_unary.hpp>
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/tuple/eat.hpp>
+
+// PRIVATE //
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_(a, b) \
+ BOOST_PP_IS_UNARY(BOOST_PP_CAT(a, b))
+
+// PUBLIC //
+
+// `checking_prefix ## tokens` expand to unary (e.g., `(1)`) iff `tokens` start
+// with keyword to check.
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_FRONT( \
+ tokens, checking_prefix) \
+ BOOST_PP_IIF(BOOST_PP_IS_UNARY(tokens), \
+ /* on MSVC this check works even if tokens already unary but on */ \
+ /* C++03 (including GCC) this check on non-unary tokens gives */ \
+ /* a concatenation error -- so return false is tokens is not unary */ \
+ 0 BOOST_PP_TUPLE_EAT(2) \
+ , \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_ \
+ )(checking_prefix, tokens)
+
+// `token ## checking_postfix` expand to unary (e.g., `(1)`) iff `token` is the
+// keyword to check. This check only works if `token` is a single token, it
+// will always expand to 0 if token is multiple tokens (e.g., `const *this`).
+// This check will expand to 0 with no error if `token` starts with a
+// non-alphanumeric symbol (e.g., `*this`).
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_BACK( \
+ token, checking_postfix) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_(token, checking_postfix)
+
+#endif // #include guard
+
diff --git a/boost/local_function/detail/preprocessor/keyword/facility/remove.hpp b/boost/local_function/detail/preprocessor/keyword/facility/remove.hpp
new file mode 100644
index 0000000000..e2d2daa930
--- /dev/null
+++ b/boost/local_function/detail/preprocessor/keyword/facility/remove.hpp
@@ -0,0 +1,58 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_HPP_
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_HPP_
+
+#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/tuple/eat.hpp>
+#include <boost/preprocessor/config/config.hpp>
+#include <boost/preprocessor/cat.hpp>
+
+// PRIVATE //
+
+// From PP_EXPAND (my own reentrant version).
+#if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC() && \
+ ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_DMC()
+# define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_EXPAND_(x) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_EXPAND_I_(x)
+#else
+# define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_EXPAND_(x) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_EXPAND_OO_((x))
+# define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_EXPAND_OO_( \
+ par) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_EXPAND_I_ ## par
+#endif
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_EXPAND_I_(x) x
+
+// PUBLIC //
+
+// `is_front_macro(tokens)` is 1 if `tokens` start with keyword to remove.
+// `removing_prefix ## <keyword-to-remove>` must expand to nothing, else 0.
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_FRONT( \
+ tokens, is_front_macro, removing_prefix) \
+ /* without EXPAND doesn't expand on MSVC */ \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_EXPAND_( \
+ BOOST_PP_IIF(is_front_macro(tokens), \
+ BOOST_PP_CAT \
+ , \
+ tokens BOOST_PP_TUPLE_EAT(2) \
+ )(removing_prefix, tokens) \
+ )
+
+// `is_back_macro(tokens)` is 1 iff `tokens` end with keyword to remove.
+// `<keyword-to-remove> ## removing_postfix` must expand to nothing, else 0.
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_BACK( \
+ tokens, is_back_macro, removing_prefix) \
+ BOOST_PP_IIF(is_back_macro(tokens), \
+ BOOST_PP_CAT \
+ , \
+ tokens BOOST_PP_TUPLE_EAT(2) \
+ )(tokens, removing_postfix)
+
+#endif // #include guard
+
diff --git a/boost/local_function/detail/preprocessor/keyword/inline.hpp b/boost/local_function/detail/preprocessor/keyword/inline.hpp
new file mode 100644
index 0000000000..59f8c499ec
--- /dev/null
+++ b/boost/local_function/detail/preprocessor/keyword/inline.hpp
@@ -0,0 +1,58 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_INLINE_HPP_
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_INLINE_HPP_
+
+#include <boost/local_function/detail/preprocessor/keyword/facility/is.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/facility/add.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/facility/remove.hpp>
+
+// PRIVATE //
+
+// These are not local macros -- DO NOT #UNDEF.
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_INLINE_IS_inline (1) /* unary */
+#define inline_BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_INLINE_IS (1) /* unary */
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_INLINE_REMOVE_inline/* nothing */
+#define inline_BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_INLINE_REMOVE/* nothing */
+
+// PUBLIC //
+
+// Is.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_INLINE_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_INLINE_IS_)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_INLINE_BACK(token) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_BACK(token, \
+ _BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_INLINE_IS)
+
+// Remove.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_INLINE_REMOVE_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_INLINE_FRONT, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_INLINE_REMOVE_)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_INLINE_REMOVE_BACK(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_BACK(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_INLINE_BACK, \
+ _BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_INLINE_REMOVE)
+
+// Add.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_INLINE_ADD_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_INLINE_FRONT, inline)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_INLINE_ADD_BACK(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_BACK(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_INLINE_BACK, inline)
+
+#endif // #include guard
+
diff --git a/boost/local_function/detail/preprocessor/keyword/recursive.hpp b/boost/local_function/detail/preprocessor/keyword/recursive.hpp
new file mode 100644
index 0000000000..b299d46614
--- /dev/null
+++ b/boost/local_function/detail/preprocessor/keyword/recursive.hpp
@@ -0,0 +1,60 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_RECURSIVE_HPP_
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_RECURSIVE_HPP_
+
+#include <boost/local_function/detail/preprocessor/keyword/facility/is.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/facility/add.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/facility/remove.hpp>
+
+// PRIVATE //
+
+// These are not local macros -- DO NOT #UNDEF.
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_RECURSIVE_IS_recursive (1)
+#define recursive_BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_RECURSIVE_IS (1)
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_RECURSIVE_REMOVE_recursive
+#define recursive_BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_RECURSIVE_REMOVE
+
+// PUBLIC //
+
+// Is.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_RECURSIVE_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_RECURSIVE_IS_)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_RECURSIVE_BACK(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_BACK(tokens, \
+ _BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_RECURSIVE_IS)
+
+// Remove.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_RECURSIVE_REMOVE_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_RECURSIVE_FRONT, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_RECURSIVE_REMOVE_)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_RECURSIVE_REMOVE_BACK(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_BACK(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_RECURSIVE_BACK, \
+ _BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_RECURSIVE_REMOVE)
+
+// Add.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_RECURSIVE_ADD_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_RECURSIVE_FRONT, \
+ recursive)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_RECURSIVE_ADD_BACK(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_BACK(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_RECURSIVE_BACK, \
+ recursive)
+
+#endif // #include guard
+
diff --git a/boost/local_function/detail/preprocessor/keyword/register.hpp b/boost/local_function/detail/preprocessor/keyword/register.hpp
new file mode 100644
index 0000000000..881bad3bee
--- /dev/null
+++ b/boost/local_function/detail/preprocessor/keyword/register.hpp
@@ -0,0 +1,58 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_REGISTER_HPP_
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_REGISTER_HPP_
+
+#include <boost/local_function/detail/preprocessor/keyword/facility/is.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/facility/add.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/facility/remove.hpp>
+
+// PRIVATE //
+
+// These are not local macros -- DO NOT #UNDEF.
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_REGISTER_IS_register (1)/*unary*/
+#define register_BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_REGISTER_IS (1)/*unary*/
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_REGISTER_REMOVE_register
+#define register_BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_REGISTER_REMOVE
+
+// PUBLIC //
+
+// Is.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_REGISTER_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_REGISTER_IS_)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_REGISTER_BACK(token) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_BACK(token, \
+ _BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_REGISTER_IS)
+
+// Remove.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_REGISTER_REMOVE_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_REGISTER_FRONT, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_REGISTER_REMOVE_)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_REGISTER_REMOVE_BACK(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_BACK(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_REGISTER_BACK, \
+ _BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_REGISTER_REMOVE)
+
+// Add.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_REGISTER_ADD_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_REGISTER_FRONT, register)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_REGISTER_ADD_BACK(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_BACK(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_REGISTER_BACK, register)
+
+#endif // #include guard
+
diff --git a/boost/local_function/detail/preprocessor/keyword/return.hpp b/boost/local_function/detail/preprocessor/keyword/return.hpp
new file mode 100644
index 0000000000..c52ec78c58
--- /dev/null
+++ b/boost/local_function/detail/preprocessor/keyword/return.hpp
@@ -0,0 +1,58 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_RETURN_HPP_
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_RETURN_HPP_
+
+#include <boost/local_function/detail/preprocessor/keyword/facility/is.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/facility/add.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/facility/remove.hpp>
+
+// PRIVATE //
+
+// These are not local macros -- DO NOT #UNDEF.
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_RETURN_IS_return (1) /* unary */
+#define return_BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_RETURN_IS (1) /* unary */
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_RETURN_REMOVE_return /*nothing*/
+#define return_BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_RETURN_REMOVE /*nothing*/
+
+// PUBLIC //
+
+// Is.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_RETURN_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_RETURN_IS_)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_RETURN_BACK(token) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_BACK(token, \
+ _BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_RETURN_IS)
+
+// Remove.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_RETURN_REMOVE_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_RETURN_FRONT, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_RETURN_REMOVE_)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_RETURN_REMOVE_BACK(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_BACK(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_RETURN_BACK, \
+ _BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_RETURN_REMOVE)
+
+// Add.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_RETURN_ADD_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_RETURN_FRONT, return)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_RETURN_ADD_BACK(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_BACK(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_RETURN_BACK, return)
+
+#endif // #include guard
+
diff --git a/boost/local_function/detail/preprocessor/keyword/this.hpp b/boost/local_function/detail/preprocessor/keyword/this.hpp
new file mode 100644
index 0000000000..06d3486f26
--- /dev/null
+++ b/boost/local_function/detail/preprocessor/keyword/this.hpp
@@ -0,0 +1,58 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_THIS_HPP_
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_THIS_HPP_
+
+#include <boost/local_function/detail/preprocessor/keyword/facility/is.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/facility/add.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/facility/remove.hpp>
+
+// PRIVATE //
+
+// These are not local macros -- DO NOT #UNDEF.
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_THIS_IS_this (1) /* unary */
+#define this_BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_THIS_IS (1) /* unary */
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_THIS_REMOVE_this /* nothing */
+#define this_BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_THIS_REMOVE /* nothing */
+
+// PUBLIC //
+
+// Is.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_THIS_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_THIS_IS_)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_THIS_BACK(token) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_BACK(token, \
+ _BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_THIS_IS)
+
+// Remove.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_THIS_REMOVE_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_THIS_FRONT, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_THIS_REMOVE_)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_THIS_REMOVE_BACK(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_BACK(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_THIS_BACK, \
+ _BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_THIS_REMOVE)
+
+// Add.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_THIS_ADD_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_THIS_FRONT, this)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_THIS_ADD_BACK(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_BACK(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_THIS_BACK, this)
+
+#endif // #include guard
+
diff --git a/boost/local_function/detail/preprocessor/keyword/thisunderscore.hpp b/boost/local_function/detail/preprocessor/keyword/thisunderscore.hpp
new file mode 100644
index 0000000000..9bf543b261
--- /dev/null
+++ b/boost/local_function/detail/preprocessor/keyword/thisunderscore.hpp
@@ -0,0 +1,63 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_THISUNDERSCORE_HPP_
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_THISUNDERSCORE_HPP_
+
+#include <boost/local_function/detail/preprocessor/keyword/facility/is.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/facility/add.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/facility/remove.hpp>
+
+// PRIVATE //
+
+// These are not local macros -- DO NOT #UNDEF.
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_THISUNDERSCORE_ISthis_ (1)
+#define this_BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_THISUNDERSCORE_IS (1)
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_THISUNDERSCORE_REMOVEthis_
+#define this_BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_THISUNDERSCORE_REMOVE
+
+// PUBLIC //
+
+// Is.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_THISUNDERSCORE_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_THISUNDERSCORE_IS)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_THISUNDERSCORE_BACK(token) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_BACK(token, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_THISUNDERSCORE_IS)
+
+// Remove.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_THISUNDERSCORE_REMOVE_FRONT( \
+ tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_THISUNDERSCORE_FRONT, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_THISUNDERSCORE_REMOVE)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_THISUNDERSCORE_REMOVE_BACK( \
+ tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_BACK(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_THISUNDERSCORE_BACK, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_THISUNDERSCORE_REMOVE)
+
+// Add.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_THISUNDERSCORE_ADD_FRONT( \
+ tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_THISUNDERSCORE_FRONT, \
+ this_)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_THISUNDERSCORE_ADD_BACK(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_BACK(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_THISUNDERSCORE_BACK, \
+ this_)
+
+#endif // #include guard
+
diff --git a/boost/local_function/detail/preprocessor/keyword/void.hpp b/boost/local_function/detail/preprocessor/keyword/void.hpp
new file mode 100644
index 0000000000..14d4669bab
--- /dev/null
+++ b/boost/local_function/detail/preprocessor/keyword/void.hpp
@@ -0,0 +1,58 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_VOID_HPP_
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_VOID_HPP_
+
+#include <boost/local_function/detail/preprocessor/keyword/facility/is.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/facility/add.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/facility/remove.hpp>
+
+// PRIVATE //
+
+// These are not local macros -- DO NOT #UNDEF.
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_VOID_IS_void (1) /* unary */
+#define void_BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_VOID_IS (1) /* unary */
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_VOID_REMOVE_void /* nothing */
+#define void_BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_VOID_REMOVE /* nothing */
+
+// PUBLIC //
+
+// Is.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_VOID_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_VOID_IS_)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_VOID_BACK(token) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_IS_BACK(token, \
+ _BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_VOID_IS)
+
+// Remove.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_VOID_REMOVE_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_VOID_FRONT, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_VOID_REMOVE_)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_VOID_REMOVE_BACK(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_REMOVE_BACK(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_VOID_BACK, \
+ _BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_VOID_REMOVE)
+
+// Add.
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_VOID_ADD_FRONT(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_FRONT(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_VOID_FRONT, void)
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_VOID_ADD_BACK(tokens) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_FACILITY_ADD_BACK(tokens, \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_VOID_BACK, void)
+
+#endif // #include guard
+
diff --git a/boost/local_function/detail/preprocessor/line_counter.hpp b/boost/local_function/detail/preprocessor/line_counter.hpp
new file mode 100644
index 0000000000..ffb90a65df
--- /dev/null
+++ b/boost/local_function/detail/preprocessor/line_counter.hpp
@@ -0,0 +1,23 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER_HPP_
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER_HPP_
+
+#include <boost/config.hpp>
+
+// PUBLIC //
+
+// MSVC has problems expanding __LINE__ so use (the non standard) __COUNTER__.
+#ifdef BOOST_MSVC
+# define BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER __COUNTER__
+#else
+# define BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER __LINE__
+#endif
+
+#endif // #include guard
+
diff --git a/boost/local_function/detail/preprocessor/void_list.hpp b/boost/local_function/detail/preprocessor/void_list.hpp
new file mode 100644
index 0000000000..2a302c6ea3
--- /dev/null
+++ b/boost/local_function/detail/preprocessor/void_list.hpp
@@ -0,0 +1,120 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/local_function
+
+#ifndef BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST_HPP_
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST_HPP_
+
+#include <boost/local_function/detail/preprocessor/keyword/void.hpp>
+#include <boost/config.hpp>
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/comparison/equal.hpp>
+#include <boost/preprocessor/tuple/to_list.hpp>
+#include <boost/preprocessor/seq/size.hpp>
+#include <boost/preprocessor/seq/to_tuple.hpp>
+
+// PRIVATE //
+
+// Argument: (token1)...
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST_FROM_SEQ_(unused, seq) \
+ BOOST_PP_TUPLE_TO_LIST(BOOST_PP_SEQ_SIZE(seq), BOOST_PP_SEQ_TO_TUPLE(seq))
+
+// Token: void | token1
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST_HANDLE_VOID_( \
+ is_void_macro, token) \
+ BOOST_PP_IIF(is_void_macro(token), \
+ BOOST_PP_NIL \
+ , \
+ (token, BOOST_PP_NIL) \
+ )
+
+// Token: (a)(b)... | empty | void | token
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST_HANDLE_SEQ_( \
+ is_void_macro, token) \
+ BOOST_PP_IIF(BOOST_PP_IS_UNARY(token), /* unary paren (a)... */ \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST_FROM_SEQ_ \
+ , \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST_HANDLE_VOID_ \
+ )(is_void_macro, token)
+
+#ifdef BOOST_NO_VARIADIC_MACROS
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST_(is_void_macro, seq) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST_HANDLE_SEQ_(is_void_macro, seq)
+
+#else // VARIADICS
+
+// FUTURE: Replace this with BOOST_PP_VARIADIC_SIZE when and if
+// BOOST_PP_VARIAIDCS detection will match !BOOST_NO_VARIADIC_MACROS (for now
+// Boost.Preprocessor and Boost.Config disagree on detecting compiler variadic
+// support while this VARIADIC_SIZE works on compilers not detected by PP).
+#if BOOST_MSVC
+# define BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST_VARIADIC_SIZE_(...) \
+ BOOST_PP_CAT(BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST_VARIADIC_SIZE_I_(__VA_ARGS__, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1,),)
+#else // MSVC
+# define BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST_VARIADIC_SIZE_(...) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST_VARIADIC_SIZE_I_(__VA_ARGS__, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1,)
+#endif // MSVC
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST_VARIADIC_SIZE_I_(e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16, e17, e18, e19, e20, e21, e22, e23, e24, e25, e26, e27, e28, e29, e30, e31, e32, e33, e34, e35, e36, e37, e38, e39, e40, e41, e42, e43, e44, e45, e46, e47, e48, e49, e50, e51, e52, e53, e54, e55, e56, e57, e58, e59, e60, e61, e62, e63, size, ...) size
+
+// Argument: token1, ...
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST_FROM_VARIADIC_(unused, ...) \
+ BOOST_PP_TUPLE_TO_LIST( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST_VARIADIC_SIZE_( \
+ __VA_ARGS__), (__VA_ARGS__))
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST_(is_void_macro, ...) \
+ BOOST_PP_IIF(BOOST_PP_EQUAL( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST_VARIADIC_SIZE_( \
+ __VA_ARGS__), 1), \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST_HANDLE_SEQ_ \
+ , \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST_FROM_VARIADIC_ \
+ )(is_void_macro, __VA_ARGS__)
+
+#endif // VARIADICS
+
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST_NEVER_(tokens) \
+ 0 /* void check always returns false */
+
+// PUBLIC //
+
+// NOTE: Empty list must always be represented is void (which is also a way to
+// specify no function parameter) and it can never be empty because (1)
+// IS_EMPTY(&var) fails (because of the leading non alphanumeric symbol) and
+// (2) some compilers (MSVC) fail to correctly pass empty macro parameters
+// even if they support variadic macros. Therefore, always using void to
+// represent is more portable.
+
+#ifdef BOOST_NO_VARIADIC_MACROS
+
+// Expand `void | (a)(b)...` to pp-list `NIL | (a, (b, NIL))`.
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST(sign) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST_( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_VOID_BACK, sign)
+
+// Expand `(a)(b)...` to pp-list `(a, (b, NIL))`.
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_NON_VOID_LIST(seq) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST_( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST_NEVER_, seq)
+
+#else // VARIADICS
+
+// Expand `void | (a)(b)... | a, b, ...` to pp-list `NIL | (a, (b, NIL))`.
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST(...) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST_( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_VOID_BACK, __VA_ARGS__)
+
+// Expand `(a)(b)... | a, b, ...` to pp-list `(a, (b, NIL))`.
+#define BOOST_LOCAL_FUNCTION_DETAIL_PP_NON_VOID_LIST(...) \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST_( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST_NEVER_, __VA_ARGS__)
+
+#endif // VARIADICS
+
+#endif // #include guard
+
diff --git a/boost/locale/boundary/index.hpp b/boost/locale/boundary/index.hpp
index cff6a97b65..5948dccafe 100644
--- a/boost/locale/boundary/index.hpp
+++ b/boost/locale/boundary/index.hpp
@@ -14,6 +14,7 @@
#include <boost/locale/boundary/segment.hpp>
#include <boost/locale/boundary/boundary_point.hpp>
#include <boost/iterator/iterator_facade.hpp>
+#include <boost/type_traits/is_same.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/cstdint.hpp>
#include <boost/assert.hpp>
@@ -59,38 +60,16 @@ namespace boost {
template<typename CharType,typename SomeIteratorType>
struct linear_iterator_traits {
- static const bool is_linear = false;
+ static const bool is_linear =
+ is_same<SomeIteratorType,CharType*>::value
+ || is_same<SomeIteratorType,CharType const*>::value
+ || is_same<SomeIteratorType,typename std::basic_string<CharType>::iterator>::value
+ || is_same<SomeIteratorType,typename std::basic_string<CharType>::const_iterator>::value
+ || is_same<SomeIteratorType,typename std::vector<CharType>::iterator>::value
+ || is_same<SomeIteratorType,typename std::vector<CharType>::const_iterator>::value
+ ;
};
- template<typename CharType>
- struct linear_iterator_traits<CharType,typename std::basic_string<CharType>::iterator> {
- static const bool is_linear = true;
- };
-
- template<typename CharType>
- struct linear_iterator_traits<CharType,typename std::basic_string<CharType>::const_iterator> {
- static const bool is_linear = true;
- };
-
- template<typename CharType>
- struct linear_iterator_traits<CharType,typename std::vector<CharType>::iterator> {
- static const bool is_linear = true;
- };
-
- template<typename CharType>
- struct linear_iterator_traits<CharType,typename std::vector<CharType>::const_iterator> {
- static const bool is_linear = true;
- };
-
- template<typename CharType>
- struct linear_iterator_traits<CharType,CharType *> {
- static const bool is_linear = true;
- };
-
- template<typename CharType>
- struct linear_iterator_traits<CharType,CharType const *> {
- static const bool is_linear = true;
- };
template<typename IteratorType>
diff --git a/boost/locale/utf.hpp b/boost/locale/utf.hpp
index 3bb308a165..f156692ffc 100644
--- a/boost/locale/utf.hpp
+++ b/boost/locale/utf.hpp
@@ -280,23 +280,23 @@ namespace utf {
template<typename Iterator>
static Iterator encode(code_point value,Iterator out)
{
- if(value <=0x7F) {
- *out++ = value;
+ if(value <= 0x7F) {
+ *out++ = static_cast<char_type>(value);
}
- else if(value <=0x7FF) {
- *out++=(value >> 6) | 0xC0;
- *out++=(value & 0x3F) | 0x80;
+ else if(value <= 0x7FF) {
+ *out++ = static_cast<char_type>((value >> 6) | 0xC0);
+ *out++ = static_cast<char_type>((value & 0x3F) | 0x80);
}
- else if(BOOST_LOCALE_LIKELY(value <=0xFFFF)) {
- *out++=(value >> 12) | 0xE0;
- *out++=((value >> 6) & 0x3F) | 0x80;
- *out++=(value & 0x3F) | 0x80;
+ else if(BOOST_LOCALE_LIKELY(value <= 0xFFFF)) {
+ *out++ = static_cast<char_type>((value >> 12) | 0xE0);
+ *out++ = static_cast<char_type>(((value >> 6) & 0x3F) | 0x80);
+ *out++ = static_cast<char_type>((value & 0x3F) | 0x80);
}
else {
- *out++=(value >> 18) | 0xF0;
- *out++=((value >> 12) & 0x3F) | 0x80;
- *out++=((value >> 6) & 0x3F) | 0x80;
- *out++=(value & 0x3F) | 0x80;
+ *out++ = static_cast<char_type>((value >> 18) | 0xF0);
+ *out++ = static_cast<char_type>(((value >> 12) & 0x3F) | 0x80);
+ *out++ = static_cast<char_type>(((value >> 6) & 0x3F) | 0x80);
+ *out++ = static_cast<char_type>((value & 0x3F) | 0x80);
}
return out;
}
@@ -380,12 +380,12 @@ namespace utf {
static It encode(code_point u,It out)
{
if(BOOST_LOCALE_LIKELY(u<=0xFFFF)) {
- *out++ = u;
+ *out++ = static_cast<char_type>(u);
}
else {
- u-=0x10000;
- *out++=0xD800 | (u>>10);
- *out++=0xDC00 | (u & 0x3FF);
+ u -= 0x10000;
+ *out++ = static_cast<char_type>(0xD800 | (u>>10));
+ *out++ = static_cast<char_type>(0xDC00 | (u & 0x3FF));
}
return out;
}
@@ -434,7 +434,7 @@ namespace utf {
template<typename It>
static It encode(code_point u,It out)
{
- *out++ = u;
+ *out++ = static_cast<char_type>(u);
return out;
}
diff --git a/boost/math/bindings/detail/big_lanczos.hpp b/boost/math/bindings/detail/big_lanczos.hpp
index a11f1b8196..314b4f88c4 100644
--- a/boost/math/bindings/detail/big_lanczos.hpp
+++ b/boost/math/bindings/detail/big_lanczos.hpp
@@ -32,6 +32,7 @@ struct lanczos22UDT : public mpl::int_<120>
template <class T>
static T lanczos_sum(const T& z)
{
+ lanczos_initializer<lanczos22UDT, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T num[22] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 46198410803245094237463011094.12173081986)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 43735859291852324413622037436.321513777)),
@@ -86,6 +87,7 @@ struct lanczos22UDT : public mpl::int_<120>
template <class T>
static T lanczos_sum_expG_scaled(const T& z)
{
+ lanczos_initializer<lanczos22UDT, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T num[22] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 6939996264376682180.277485395074954356211)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 6570067992110214451.87201438870245659384)),
@@ -141,6 +143,7 @@ struct lanczos22UDT : public mpl::int_<120>
template<class T>
static T lanczos_sum_near_1(const T& dz)
{
+ lanczos_initializer<lanczos22UDT, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T d[21] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 8.318998691953337183034781139546384476554)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, -63.15415991415959158214140353299240638675)),
@@ -219,6 +222,7 @@ struct lanczos31UDT
template <class T>
static T lanczos_sum(const T& z)
{
+ lanczos_initializer<lanczos31UDT, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T num[31] = {
static_cast<T>(BOOST_MATH_HUGE_CONSTANT(T, 150, 0.2579646553333513328235723061836959833277e46)),
static_cast<T>(BOOST_MATH_HUGE_CONSTANT(T, 150, 0.2444796504337453845497419271639377138264e46)),
@@ -291,6 +295,7 @@ struct lanczos31UDT
template <class T>
static T lanczos_sum_expG_scaled(const T& z)
{
+ lanczos_initializer<lanczos31UDT, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T num[31] = {
static_cast<T>(BOOST_MATH_HUGE_CONSTANT(T, 150, 30137154810677525966583148469478.52374216)),
static_cast<T>(BOOST_MATH_HUGE_CONSTANT(T, 150, 28561746428637727032849890123131.36314653)),
@@ -364,6 +369,7 @@ struct lanczos31UDT
template<class T>
static T lanczos_sum_near_1(const T& dz)
{
+ lanczos_initializer<lanczos31UDT, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T d[30] = {
static_cast<T>(BOOST_MATH_HUGE_CONSTANT(T, 150, 11.80038544942943603508206880307972596807)),
static_cast<T>(BOOST_MATH_HUGE_CONSTANT(T, 150, -130.6355975335626214564236363322099481079)),
@@ -407,6 +413,7 @@ struct lanczos31UDT
template<class T>
static T lanczos_sum_near_2(const T& dz)
{
+ lanczos_initializer<lanczos31UDT, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T d[30] = {
static_cast<T>(BOOST_MATH_HUGE_CONSTANT(T, 150, 147.9979641587472136175636384176549713358)),
static_cast<T>(BOOST_MATH_HUGE_CONSTANT(T, 150, -1638.404318611773924210055619836375434296)),
@@ -461,6 +468,7 @@ struct lanczos61UDT
template <class T>
static T lanczos_sum(const T& z)
{
+ lanczos_initializer<lanczos61UDT, T>::force_instantiate(); // Ensure our constants get initialized before main()
using namespace boost;
static const T d[61] = {
static_cast<T>(BOOST_MATH_HUGE_CONSTANT(T, 150, 2.50662827463100050241576528481104525300698674060993831662992357634229365460784197494659584)),
@@ -536,6 +544,7 @@ struct lanczos61UDT
template <class T>
static T lanczos_sum_expG_scaled(const T& z)
{
+ lanczos_initializer<lanczos61UDT, T>::force_instantiate(); // Ensure our constants get initialized before main()
using namespace boost;
static const T d[61] = {
static_cast<T>(BOOST_MATH_HUGE_CONSTANT(T, 150, 0.901751806425638853077358552989167785490911341809902155556127108480303870921448984935411583e-27)),
@@ -611,6 +620,7 @@ struct lanczos61UDT
template<class T>
static T lanczos_sum_near_1(const T& dz)
{
+ lanczos_initializer<lanczos61UDT, T>::force_instantiate(); // Ensure our constants get initialized before main()
using namespace boost;
static const T d[60] = {
static_cast<T>(BOOST_MATH_HUGE_CONSTANT(T, 150, 23.2463658527729692390378860713647146932236940604550445351214987229819352880524561852919518)),
@@ -685,6 +695,7 @@ struct lanczos61UDT
template<class T>
static T lanczos_sum_near_2(const T& dz)
{
+ lanczos_initializer<lanczos61UDT, T>::force_instantiate(); // Ensure our constants get initialized before main()
using namespace boost;
static const T d[60] = {
static_cast<T>(BOOST_MATH_HUGE_CONSTANT(T, 150, 557.56438192770795764344217888434355281097193198928944200046501607026919782564033547346298)),
diff --git a/boost/math/bindings/e_float.hpp b/boost/math/bindings/e_float.hpp
index 959bff109b..d7f9a73508 100644
--- a/boost/math/bindings/e_float.hpp
+++ b/boost/math/bindings/e_float.hpp
@@ -318,6 +318,11 @@ inline e_float atan(const e_float& v)
return ::ef::atan(v.value());
}
+inline e_float atan2(const e_float& v, const e_float& u)
+{
+ return ::ef::atan2(v.value(), u.value());
+}
+
inline e_float ldexp(const e_float& v, int e)
{
return v.value() * ::ef::pow2(e);
diff --git a/boost/math/bindings/mpfr.hpp b/boost/math/bindings/mpfr.hpp
index 95be0ee2ba..e5c6ba071d 100644
--- a/boost/math/bindings/mpfr.hpp
+++ b/boost/math/bindings/mpfr.hpp
@@ -860,7 +860,11 @@ inline mpfr_class bessel_i1(mpfr_class x)
} // namespace detail
-}}
+}
+
+template<> struct is_convertible<long double, mpfr_class> : public mpl::false_{};
+
+}
#endif // BOOST_MATH_MPLFR_BINDINGS_HPP
diff --git a/boost/math/bindings/rr.hpp b/boost/math/bindings/rr.hpp
index 58c22b8891..6ec79f953d 100644
--- a/boost/math/bindings/rr.hpp
+++ b/boost/math/bindings/rr.hpp
@@ -763,6 +763,17 @@ namespace ntl{
NTL::RR::precision());
}
+ inline RR atan2(RR y, RR x)
+ {
+ if(x > 0)
+ return atan(y / x);
+ if(x < 0)
+ {
+ return y < 0 ? atan(y / x) - boost::math::constants::pi<RR>() : atan(y / x) + boost::math::constants::pi<RR>();
+ }
+ return y < 0 ? -boost::math::constants::half_pi<RR>() : boost::math::constants::half_pi<RR>() ;
+ }
+
inline RR sinh(RR z)
{
return (expm1(z.value()) - expm1(-z.value())) / 2;
diff --git a/boost/math/concepts/real_concept.hpp b/boost/math/concepts/real_concept.hpp
index d9000754c2..1ed2c1df00 100644
--- a/boost/math/concepts/real_concept.hpp
+++ b/boost/math/concepts/real_concept.hpp
@@ -28,6 +28,7 @@
#include <boost/math/special_functions/round.hpp>
#include <boost/math/special_functions/trunc.hpp>
#include <boost/math/special_functions/modf.hpp>
+#include <boost/math/tools/big_constant.hpp>
#include <boost/math/tools/precision.hpp>
#include <boost/math/policies/policy.hpp>
#if defined(__SGI_STL_PORT)
@@ -324,6 +325,12 @@ namespace tools
{
template <>
+inline concepts::real_concept make_big_value<concepts::real_concept>(long double val, const char* , mpl::false_ const&, mpl::false_ const&)
+{
+ return val; // Can't use lexical_cast here, sometimes it fails....
+}
+
+template <>
inline concepts::real_concept max_value<concepts::real_concept>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(concepts::real_concept))
{
return max_value<concepts::real_concept_base_type>();
diff --git a/boost/math/concepts/real_type_concept.hpp b/boost/math/concepts/real_type_concept.hpp
index f6ec016211..97da780129 100644
--- a/boost/math/concepts/real_type_concept.hpp
+++ b/boost/math/concepts/real_type_concept.hpp
@@ -6,6 +6,7 @@
#ifndef BOOST_MATH_REAL_TYPE_CONCEPT_HPP
#define BOOST_MATH_REAL_TYPE_CONCEPT_HPP
+#include <boost/config.hpp>
#ifdef BOOST_MSVC
#pragma warning(push)
#pragma warning(disable: 4100)
diff --git a/boost/math/concepts/std_real_concept.hpp b/boost/math/concepts/std_real_concept.hpp
index 645579573b..4c4eb6ac32 100644
--- a/boost/math/concepts/std_real_concept.hpp
+++ b/boost/math/concepts/std_real_concept.hpp
@@ -323,12 +323,19 @@ inline std::basic_istream<charT, traits>& operator>>(std::basic_istream<charT, t
}}
#include <boost/math/tools/precision.hpp>
+#include <boost/math/tools/big_constant.hpp>
namespace boost{ namespace math{
namespace tools
{
template <>
+inline concepts::std_real_concept make_big_value<concepts::std_real_concept>(long double val, const char* , mpl::false_ const&, mpl::false_ const&)
+{
+ return val; // Can't use lexical_cast here, sometimes it fails....
+}
+
+template <>
inline concepts::std_real_concept max_value<concepts::std_real_concept>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(concepts::std_real_concept))
{
return max_value<concepts::std_real_concept_base_type>();
diff --git a/boost/math/constants/calculate_constants.hpp b/boost/math/constants/calculate_constants.hpp
new file mode 100644
index 0000000000..0b78929e71
--- /dev/null
+++ b/boost/math/constants/calculate_constants.hpp
@@ -0,0 +1,959 @@
+// Copyright John Maddock 2010, 2012.
+// Copyright Paul A. Bristow 2011, 2012.
+
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_MATH_CALCULATE_CONSTANTS_CONSTANTS_INCLUDED
+#define BOOST_MATH_CALCULATE_CONSTANTS_CONSTANTS_INCLUDED
+
+#include <boost/math/special_functions/trunc.hpp>
+
+namespace boost{ namespace math{ namespace constants{ namespace detail{
+
+template <class T>
+template<int N>
+inline T constant_pi<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+
+ return ldexp(acos(T(0)), 1);
+
+ /*
+ // Although this code works well, it's usually more accurate to just call acos
+ // and access the number types own representation of PI which is usually calculated
+ // at slightly higher precision...
+
+ T result;
+ T a = 1;
+ T b;
+ T A(a);
+ T B = 0.5f;
+ T D = 0.25f;
+
+ T lim;
+ lim = boost::math::tools::epsilon<T>();
+
+ unsigned k = 1;
+
+ do
+ {
+ result = A + B;
+ result = ldexp(result, -2);
+ b = sqrt(B);
+ a += b;
+ a = ldexp(a, -1);
+ A = a * a;
+ B = A - result;
+ B = ldexp(B, 1);
+ result = A - B;
+ bool neg = boost::math::sign(result) < 0;
+ if(neg)
+ result = -result;
+ if(result <= lim)
+ break;
+ if(neg)
+ result = -result;
+ result = ldexp(result, k - 1);
+ D -= result;
+ ++k;
+ lim = ldexp(lim, 1);
+ }
+ while(true);
+
+ result = B / D;
+ return result;
+ */
+}
+
+template <class T>
+template<int N>
+inline T constant_two_pi<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ return 2 * pi<T, policies::policy<policies::digits2<N> > >();
+}
+
+template <class T> // 2 / pi
+template<int N>
+inline T constant_two_div_pi<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ return 2 / pi<T, policies::policy<policies::digits2<N> > >();
+}
+
+template <class T> // sqrt(2/pi)
+template <int N>
+inline T constant_root_two_div_pi<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ return sqrt((2 / pi<T, policies::policy<policies::digits2<N> > >()));
+}
+
+template <class T>
+template<int N>
+inline T constant_one_div_two_pi<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ return 1 / two_pi<T, policies::policy<policies::digits2<N> > >();
+}
+
+template <class T>
+template<int N>
+inline T constant_root_pi<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return sqrt(pi<T, policies::policy<policies::digits2<N> > >());
+}
+
+template <class T>
+template<int N>
+inline T constant_root_half_pi<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return sqrt(pi<T, policies::policy<policies::digits2<N> > >() / 2);
+}
+
+template <class T>
+template<int N>
+inline T constant_root_two_pi<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return sqrt(two_pi<T, policies::policy<policies::digits2<N> > >());
+}
+
+template <class T>
+template<int N>
+inline T constant_root_ln_four<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return sqrt(log(static_cast<T>(4)));
+}
+
+template <class T>
+template<int N>
+inline T constant_e<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ //
+ // Although we can clearly calculate this from first principles, this hooks into
+ // T's own notion of e, which hopefully will more accurate than one calculated to
+ // a few epsilon:
+ //
+ BOOST_MATH_STD_USING
+ return exp(static_cast<T>(1));
+}
+
+template <class T>
+template<int N>
+inline T constant_half<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ return static_cast<T>(1) / static_cast<T>(2);
+}
+
+template <class T>
+template<int M>
+inline T constant_euler<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<M>))
+{
+ BOOST_MATH_STD_USING
+ //
+ // This is the method described in:
+ // "Some New Algorithms for High-Precision Computation of Euler's Constant"
+ // Richard P Brent and Edwin M McMillan.
+ // Mathematics of Comnputation, Volume 34, Number 149, Jan 1980, pages 305-312.
+ // See equation 17 with p = 2.
+ //
+ T n = 3 + (M ? (std::min)(M, tools::digits<T>()) : tools::digits<T>()) / 4;
+ T lim = M ? ldexp(T(1), (std::min)(M, tools::digits<T>())) : tools::epsilon<T>();
+ T lnn = log(n);
+ T term = 1;
+ T N = -lnn;
+ T D = 1;
+ T Hk = 0;
+ T one = 1;
+
+ for(unsigned k = 1;; ++k)
+ {
+ term *= n * n;
+ term /= k * k;
+ Hk += one / k;
+ N += term * (Hk - lnn);
+ D += term;
+
+ if(term < D * lim)
+ break;
+ }
+ return N / D;
+}
+
+template <class T>
+template<int N>
+inline T constant_euler_sqr<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return euler<T, policies::policy<policies::digits2<N> > >()
+ * euler<T, policies::policy<policies::digits2<N> > >();
+}
+
+template <class T>
+template<int N>
+inline T constant_one_div_euler<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return static_cast<T>(1)
+ / euler<T, policies::policy<policies::digits2<N> > >();
+}
+
+
+template <class T>
+template<int N>
+inline T constant_root_two<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return sqrt(static_cast<T>(2));
+}
+
+
+template <class T>
+template<int N>
+inline T constant_root_three<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return sqrt(static_cast<T>(3));
+}
+
+template <class T>
+template<int N>
+inline T constant_half_root_two<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return sqrt(static_cast<T>(2)) / 2;
+}
+
+template <class T>
+template<int N>
+inline T constant_ln_two<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ //
+ // Although there are good ways to calculate this from scratch, this hooks into
+ // T's own notion of log(2) which will hopefully be accurate to the full precision
+ // of T:
+ //
+ BOOST_MATH_STD_USING
+ return log(static_cast<T>(2));
+}
+
+template <class T>
+template<int N>
+inline T constant_ln_ten<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return log(static_cast<T>(10));
+}
+
+template <class T>
+template<int N>
+inline T constant_ln_ln_two<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return log(log(static_cast<T>(2)));
+}
+
+template <class T>
+template<int N>
+inline T constant_third<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return static_cast<T>(1) / static_cast<T>(3);
+}
+
+template <class T>
+template<int N>
+inline T constant_twothirds<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return static_cast<T>(2) / static_cast<T>(3);
+}
+
+template <class T>
+template<int N>
+inline T constant_two_thirds<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return static_cast<T>(2) / static_cast<T>(3);
+}
+
+template <class T>
+template<int N>
+inline T constant_three_quarters<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return static_cast<T>(3) / static_cast<T>(4);
+}
+
+template <class T>
+template<int N>
+inline T constant_pi_minus_three<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ return pi<T, policies::policy<policies::digits2<N> > >() - static_cast<T>(3);
+}
+
+template <class T>
+template<int N>
+inline T constant_four_minus_pi<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ return static_cast<T>(4) - pi<T, policies::policy<policies::digits2<N> > >();
+}
+
+template <class T>
+template<int N>
+inline T constant_pow23_four_minus_pi<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return pow(four_minus_pi<T, policies::policy<policies::digits2<N> > >(), static_cast<T>(1.5));
+}
+
+template <class T>
+template<int N>
+inline T constant_exp_minus_half<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return exp(static_cast<T>(-0.5));
+}
+
+// Pi
+template <class T>
+template<int N>
+inline T constant_one_div_root_two<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ return static_cast<T>(1) / root_two<T, policies::policy<policies::digits2<N> > >();
+}
+
+template <class T>
+template<int N>
+inline T constant_one_div_root_pi<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ return static_cast<T>(1) / root_pi<T, policies::policy<policies::digits2<N> > >();
+}
+
+template <class T>
+template<int N>
+inline T constant_one_div_root_two_pi<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ return static_cast<T>(1) / root_two_pi<T, policies::policy<policies::digits2<N> > >();
+}
+
+template <class T>
+template<int N>
+inline T constant_root_one_div_pi<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return sqrt(static_cast<T>(1) / pi<T, policies::policy<policies::digits2<N> > >());
+}
+
+
+template <class T>
+template<int N>
+inline T constant_four_thirds_pi<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return pi<T, policies::policy<policies::digits2<N> > >() * static_cast<T>(4) / static_cast<T>(3);
+}
+
+template <class T>
+template<int N>
+inline T constant_half_pi<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return pi<T, policies::policy<policies::digits2<N> > >() / static_cast<T>(2);
+}
+
+
+template <class T>
+template<int N>
+inline T constant_third_pi<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return pi<T, policies::policy<policies::digits2<N> > >() / static_cast<T>(3);
+}
+
+template <class T>
+template<int N>
+inline T constant_sixth_pi<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return pi<T, policies::policy<policies::digits2<N> > >() / static_cast<T>(6);
+}
+
+template <class T>
+template<int N>
+inline T constant_two_thirds_pi<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return pi<T, policies::policy<policies::digits2<N> > >() * static_cast<T>(2) / static_cast<T>(3);
+}
+
+template <class T>
+template<int N>
+inline T constant_three_quarters_pi<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return pi<T, policies::policy<policies::digits2<N> > >() * static_cast<T>(3) / static_cast<T>(4);
+}
+
+template <class T>
+template<int N>
+inline T constant_pi_pow_e<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return pow(pi<T, policies::policy<policies::digits2<N> > >(), e<T, policies::policy<policies::digits2<N> > >()); //
+}
+
+template <class T>
+template<int N>
+inline T constant_pi_sqr<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return pi<T, policies::policy<policies::digits2<N> > >()
+ * pi<T, policies::policy<policies::digits2<N> > >() ; //
+}
+
+template <class T>
+template<int N>
+inline T constant_pi_sqr_div_six<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return pi<T, policies::policy<policies::digits2<N> > >()
+ * pi<T, policies::policy<policies::digits2<N> > >()
+ / static_cast<T>(6); //
+}
+
+
+template <class T>
+template<int N>
+inline T constant_pi_cubed<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return pi<T, policies::policy<policies::digits2<N> > >()
+ * pi<T, policies::policy<policies::digits2<N> > >()
+ * pi<T, policies::policy<policies::digits2<N> > >()
+ ; //
+}
+
+template <class T>
+template<int N>
+inline T constant_cbrt_pi<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return pow(pi<T, policies::policy<policies::digits2<N> > >(), static_cast<T>(1)/ static_cast<T>(3));
+}
+
+template <class T>
+template<int N>
+inline T constant_one_div_cbrt_pi<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return static_cast<T>(1)
+ / pow(pi<T, policies::policy<policies::digits2<N> > >(), static_cast<T>(1)/ static_cast<T>(3));
+}
+
+// Euler's e
+
+template <class T>
+template<int N>
+inline T constant_e_pow_pi<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return pow(e<T, policies::policy<policies::digits2<N> > >(), pi<T, policies::policy<policies::digits2<N> > >()); //
+}
+
+template <class T>
+template<int N>
+inline T constant_root_e<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return sqrt(e<T, policies::policy<policies::digits2<N> > >());
+}
+
+template <class T>
+template<int N>
+inline T constant_log10_e<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return log10(e<T, policies::policy<policies::digits2<N> > >());
+}
+
+template <class T>
+template<int N>
+inline T constant_one_div_log10_e<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return static_cast<T>(1) /
+ log10(e<T, policies::policy<policies::digits2<N> > >());
+}
+
+// Trigonometric
+
+template <class T>
+template<int N>
+inline T constant_degree<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return pi<T, policies::policy<policies::digits2<N> > >()
+ / static_cast<T>(180)
+ ; //
+}
+
+template <class T>
+template<int N>
+inline T constant_radian<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return static_cast<T>(180)
+ / pi<T, policies::policy<policies::digits2<N> > >()
+ ; //
+}
+
+template <class T>
+template<int N>
+inline T constant_sin_one<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return sin(static_cast<T>(1)) ; //
+}
+
+template <class T>
+template<int N>
+inline T constant_cos_one<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return cos(static_cast<T>(1)) ; //
+}
+
+template <class T>
+template<int N>
+inline T constant_sinh_one<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return sinh(static_cast<T>(1)) ; //
+}
+
+template <class T>
+template<int N>
+inline T constant_cosh_one<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return cosh(static_cast<T>(1)) ; //
+}
+
+template <class T>
+template<int N>
+inline T constant_phi<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return (static_cast<T>(1) + sqrt(static_cast<T>(5)) )/static_cast<T>(2) ; //
+}
+
+template <class T>
+template<int N>
+inline T constant_ln_phi<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ //return log(phi<T, policies::policy<policies::digits2<N> > >()); // ???
+ return log((static_cast<T>(1) + sqrt(static_cast<T>(5)) )/static_cast<T>(2) );
+}
+template <class T>
+template<int N>
+inline T constant_one_div_ln_phi<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+ return static_cast<T>(1) /
+ log((static_cast<T>(1) + sqrt(static_cast<T>(5)) )/static_cast<T>(2) );
+}
+
+// Zeta
+
+template <class T>
+template<int N>
+inline T constant_zeta_two<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ BOOST_MATH_STD_USING
+
+ return pi<T, policies::policy<policies::digits2<N> > >()
+ * pi<T, policies::policy<policies::digits2<N> > >()
+ /static_cast<T>(6);
+}
+
+template <class T>
+template<int N>
+inline T constant_zeta_three<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ // http://mathworld.wolfram.com/AperysConstant.html
+ // http://en.wikipedia.org/wiki/Mathematical_constant
+
+ // http://oeis.org/A002117/constant
+ //T zeta3("1.20205690315959428539973816151144999076"
+ // "4986292340498881792271555341838205786313"
+ // "09018645587360933525814619915");
+
+ //"1.202056903159594285399738161511449990, 76498629234049888179227155534183820578631309018645587360933525814619915" A002117
+ // 1.202056903159594285399738161511449990, 76498629234049888179227155534183820578631309018645587360933525814619915780, +00);
+ //"1.2020569031595942 double
+ // http://www.spaennare.se/SSPROG/ssnum.pdf // section 11, Algorithmfor Apery’s constant zeta(3).
+ // Programs to Calculate some Mathematical Constants to Large Precision, Document Version 1.50
+
+ // by Stefan Spannare September 19, 2007
+ // zeta(3) = 1/64 * sum
+ BOOST_MATH_STD_USING
+ T n_fact=static_cast<T>(1); // build n! for n = 0.
+ T sum = static_cast<double>(77); // Start with n = 0 case.
+ // for n = 0, (77/1) /64 = 1.203125
+ //double lim = std::numeric_limits<double>::epsilon();
+ T lim = N ? ldexp(T(1), 1 - (std::min)(N, tools::digits<T>())) : tools::epsilon<T>();
+ for(unsigned int n = 1; n < 40; ++n)
+ { // three to five decimal digits per term, so 40 should be plenty for 100 decimal digits.
+ //cout << "n = " << n << endl;
+ n_fact *= n; // n!
+ T n_fact_p10 = n_fact * n_fact * n_fact * n_fact * n_fact * n_fact * n_fact * n_fact * n_fact * n_fact; // (n!)^10
+ T num = ((205 * n * n) + (250 * n) + 77) * n_fact_p10; // 205n^2 + 250n + 77
+ // int nn = (2 * n + 1);
+ // T d = factorial(nn); // inline factorial.
+ T d = 1;
+ for(unsigned int i = 1; i <= (n+n + 1); ++i) // (2n + 1)
+ {
+ d *= i;
+ }
+ T den = d * d * d * d * d; // [(2n+1)!]^5
+ //cout << "den = " << den << endl;
+ T term = num/den;
+ if (n % 2 != 0)
+ { //term *= -1;
+ sum -= term;
+ }
+ else
+ {
+ sum += term;
+ }
+ //cout << "term = " << term << endl;
+ //cout << "sum/64 = " << sum/64 << endl;
+ if(abs(term) < lim)
+ {
+ break;
+ }
+ }
+ return sum / 64;
+}
+
+template <class T>
+template<int N>
+inline T constant_catalan<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{ // http://oeis.org/A006752/constant
+ //T c("0.915965594177219015054603514932384110774"
+ //"149374281672134266498119621763019776254769479356512926115106248574");
+
+ // 9.159655941772190150546035149323841107, 74149374281672134266498119621763019776254769479356512926115106248574422619, -01);
+
+ // This is equation (entry) 31 from
+ // http://www-2.cs.cmu.edu/~adamchik/articles/catalan/catalan.htm
+ // See also http://www.mpfr.org/algorithms.pdf
+ BOOST_MATH_STD_USING
+ T k_fact = 1;
+ T tk_fact = 1;
+ T sum = 1;
+ T term;
+ T lim = N ? ldexp(T(1), 1 - (std::min)(N, tools::digits<T>())) : tools::epsilon<T>();
+
+ for(unsigned k = 1;; ++k)
+ {
+ k_fact *= k;
+ tk_fact *= (2 * k) * (2 * k - 1);
+ term = k_fact * k_fact / (tk_fact * (2 * k + 1) * (2 * k + 1));
+ sum += term;
+ if(term < lim)
+ {
+ break;
+ }
+ }
+ return boost::math::constants::pi<T, boost::math::policies::policy<> >()
+ * log(2 + boost::math::constants::root_three<T, boost::math::policies::policy<> >())
+ / 8
+ + 3 * sum / 8;
+}
+
+namespace khinchin_detail{
+
+template <class T>
+T zeta_polynomial_series(T s, T sc, int digits)
+{
+ BOOST_MATH_STD_USING
+ //
+ // This is algorithm 3 from:
+ //
+ // "An Efficient Algorithm for the Riemann Zeta Function", P. Borwein,
+ // Canadian Mathematical Society, Conference Proceedings, 2000.
+ // See: http://www.cecm.sfu.ca/personal/pborwein/PAPERS/P155.pdf
+ //
+ BOOST_MATH_STD_USING
+ int n = (digits * 19) / 53;
+ T sum = 0;
+ T two_n = ldexp(T(1), n);
+ int ej_sign = 1;
+ for(int j = 0; j < n; ++j)
+ {
+ sum += ej_sign * -two_n / pow(T(j + 1), s);
+ ej_sign = -ej_sign;
+ }
+ T ej_sum = 1;
+ T ej_term = 1;
+ for(int j = n; j <= 2 * n - 1; ++j)
+ {
+ sum += ej_sign * (ej_sum - two_n) / pow(T(j + 1), s);
+ ej_sign = -ej_sign;
+ ej_term *= 2 * n - j;
+ ej_term /= j - n + 1;
+ ej_sum += ej_term;
+ }
+ return -sum / (two_n * (1 - pow(T(2), sc)));
+}
+
+template <class T>
+T khinchin(int digits)
+{
+ BOOST_MATH_STD_USING
+ T sum = 0;
+ T term;
+ T lim = ldexp(T(1), 1-digits);
+ T factor = 0;
+ unsigned last_k = 1;
+ T num = 1;
+ for(unsigned n = 1;; ++n)
+ {
+ for(unsigned k = last_k; k <= 2 * n - 1; ++k)
+ {
+ factor += num / k;
+ num = -num;
+ }
+ last_k = 2 * n;
+ term = (zeta_polynomial_series(T(2 * n), T(1 - T(2 * n)), digits) - 1) * factor / n;
+ sum += term;
+ if(term < lim)
+ break;
+ }
+ return exp(sum / boost::math::constants::ln_two<T, boost::math::policies::policy<> >());
+}
+
+}
+
+template <class T>
+template<int N>
+inline T constant_khinchin<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ int n = N ? (std::min)(N, tools::digits<T>()) : tools::digits<T>();
+ return khinchin_detail::khinchin<T>(n);
+}
+
+template <class T>
+template<int N>
+inline T constant_extreme_value_skewness<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{ // from e_float constants.cpp
+ // Mathematica: N[12 Sqrt[6] Zeta[3]/Pi^3, 1101]
+ BOOST_MATH_STD_USING
+ T ev(12 * sqrt(static_cast<T>(6)) * zeta_three<T, policies::policy<policies::digits2<N> > >()
+ / pi_cubed<T, policies::policy<policies::digits2<N> > >() );
+
+//T ev(
+//"1.1395470994046486574927930193898461120875997958365518247216557100852480077060706857071875468869385150"
+//"1894272048688553376986765366075828644841024041679714157616857834895702411080704529137366329462558680"
+//"2015498788776135705587959418756809080074611906006528647805347822929577145038743873949415294942796280"
+//"0895597703063466053535550338267721294164578901640163603544404938283861127819804918174973533694090594"
+//"3094963822672055237678432023017824416203652657301470473548274848068762500300316769691474974950757965"
+//"8640779777748741897542093874605477776538884083378029488863880220988107155275203245233994097178778984"
+//"3488995668362387892097897322246698071290011857605809901090220903955815127463328974447572119951192970"
+//"3684453635456559086126406960279692862247058250100678008419431185138019869693206366891639436908462809"
+//"9756051372711251054914491837034685476095423926553367264355374652153595857163724698198860485357368964"
+//"3807049634423621246870868566707915720704996296083373077647528285782964567312903914752617978405994377"
+//"9064157147206717895272199736902453130842229559980076472936976287378945035706933650987259357729800315");
+
+ return ev;
+}
+
+namespace detail{
+//
+// Calculation of the Glaisher constant depends upon calculating the
+// derivative of the zeta function at 2, we can then use the relation:
+// zeta'(2) = 1/6 pi^2 [euler + ln(2pi)-12ln(A)]
+// To get the constant A.
+// See equation 45 at http://mathworld.wolfram.com/RiemannZetaFunction.html.
+//
+// The derivative of the zeta function is computed by direct differentiation
+// of the relation:
+// (1-2^(1-s))zeta(s) = SUM(n=0, INF){ (-n)^n / (n+1)^s }
+// Which gives us 2 slowly converging but alternating sums to compute,
+// for this we use Algorithm 1 from "Convergent Acceleration of Alternating Series",
+// Henri Cohen, Fernando Rodriguez Villegas and Don Zagier, Experimental Mathematics 9:1 (1999).
+// See http://www.math.utexas.edu/users/villegas/publications/conv-accel.pdf
+//
+template <class T>
+T zeta_series_derivative_2(unsigned digits)
+{
+ // Derivative of the series part, evaluated at 2:
+ BOOST_MATH_STD_USING
+ int n = digits * 301 * 13 / 10000;
+ boost::math::itrunc((std::numeric_limits<T>::digits10 + 1) * 1.3);
+ T d = pow(3 + sqrt(T(8)), n);
+ d = (d + 1 / d) / 2;
+ T b = -1;
+ T c = -d;
+ T s = 0;
+ for(int k = 0; k < n; ++k)
+ {
+ T a = -log(T(k+1)) / ((k+1) * (k+1));
+ c = b - c;
+ s = s + c * a;
+ b = (k + n) * (k - n) * b / ((k + T(0.5f)) * (k + 1));
+ }
+ return s / d;
+}
+
+template <class T>
+T zeta_series_2(unsigned digits)
+{
+ // Series part of zeta at 2:
+ BOOST_MATH_STD_USING
+ int n = digits * 301 * 13 / 10000;
+ T d = pow(3 + sqrt(T(8)), n);
+ d = (d + 1 / d) / 2;
+ T b = -1;
+ T c = -d;
+ T s = 0;
+ for(int k = 0; k < n; ++k)
+ {
+ T a = T(1) / ((k + 1) * (k + 1));
+ c = b - c;
+ s = s + c * a;
+ b = (k + n) * (k - n) * b / ((k + T(0.5f)) * (k + 1));
+ }
+ return s / d;
+}
+
+template <class T>
+inline T zeta_series_lead_2()
+{
+ // lead part at 2:
+ return 2;
+}
+
+template <class T>
+inline T zeta_series_derivative_lead_2()
+{
+ // derivative of lead part at 2:
+ return -2 * boost::math::constants::ln_two<T>();
+}
+
+template <class T>
+inline T zeta_derivative_2(unsigned n)
+{
+ // zeta derivative at 2:
+ return zeta_series_derivative_2<T>(n) * zeta_series_lead_2<T>()
+ + zeta_series_derivative_lead_2<T>() * zeta_series_2<T>(n);
+}
+
+} // namespace detail
+
+template <class T>
+template<int N>
+inline T constant_glaisher<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+
+ BOOST_MATH_STD_USING
+ typedef policies::policy<policies::digits2<N> > forwarding_policy;
+ int n = N ? (std::min)(N, tools::digits<T>()) : tools::digits<T>();
+ T v = detail::zeta_derivative_2<T>(n);
+ v *= 6;
+ v /= boost::math::constants::pi<T, forwarding_policy>() * boost::math::constants::pi<T, forwarding_policy>();
+ v -= boost::math::constants::euler<T, forwarding_policy>();
+ v -= log(2 * boost::math::constants::pi<T, forwarding_policy>());
+ v /= -12;
+ return exp(v);
+
+ /*
+ // from http://mpmath.googlecode.com/svn/data/glaisher.txt
+ // 20,000 digits of the Glaisher-Kinkelin constant A = exp(1/2 - zeta'(-1))
+ // Computed using A = exp((6 (-zeta'(2))/pi^2 + log 2 pi + gamma)/12)
+ // with Euler-Maclaurin summation for zeta'(2).
+ T g(
+ "1.282427129100622636875342568869791727767688927325001192063740021740406308858826"
+ "46112973649195820237439420646120399000748933157791362775280404159072573861727522"
+ "14334327143439787335067915257366856907876561146686449997784962754518174312394652"
+ "76128213808180219264516851546143919901083573730703504903888123418813674978133050"
+ "93770833682222494115874837348064399978830070125567001286994157705432053927585405"
+ "81731588155481762970384743250467775147374600031616023046613296342991558095879293"
+ "36343887288701988953460725233184702489001091776941712153569193674967261270398013"
+ "52652668868978218897401729375840750167472114895288815996668743164513890306962645"
+ "59870469543740253099606800842447417554061490189444139386196089129682173528798629"
+ "88434220366989900606980888785849587494085307347117090132667567503310523405221054"
+ "14176776156308191919997185237047761312315374135304725819814797451761027540834943"
+ "14384965234139453373065832325673954957601692256427736926358821692159870775858274"
+ "69575162841550648585890834128227556209547002918593263079373376942077522290940187");
+
+ return g;
+ */
+}
+
+template <class T>
+template<int N>
+inline T constant_rayleigh_skewness<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{ // From e_float
+ // 1100 digits of the Rayleigh distribution skewness
+ // Mathematica: N[2 Sqrt[Pi] (Pi - 3)/((4 - Pi)^(3/2)), 1100]
+
+ BOOST_MATH_STD_USING
+ T rs(2 * root_pi<T, policies::policy<policies::digits2<N> > >()
+ * pi_minus_three<T, policies::policy<policies::digits2<N> > >()
+ / pow(four_minus_pi<T, policies::policy<policies::digits2<N> > >(), static_cast<T>(3./2))
+ );
+ // 6.31110657818937138191899351544227779844042203134719497658094585692926819617473725459905027032537306794400047264,
+
+ //"0.6311106578189371381918993515442277798440422031347194976580945856929268196174737254599050270325373067"
+ //"9440004726436754739597525250317640394102954301685809920213808351450851396781817932734836994829371322"
+ //"5797376021347531983451654130317032832308462278373358624120822253764532674177325950686466133508511968"
+ //"2389168716630349407238090652663422922072397393006683401992961569208109477307776249225072042971818671"
+ //"4058887072693437217879039875871765635655476241624825389439481561152126886932506682176611183750503553"
+ //"1218982627032068396407180216351425758181396562859085306247387212297187006230007438534686340210168288"
+ //"8956816965453815849613622117088096547521391672977226658826566757207615552041767516828171274858145957"
+ //"6137539156656005855905288420585194082284972984285863898582313048515484073396332610565441264220790791"
+ //"0194897267890422924599776483890102027823328602965235306539844007677157873140562950510028206251529523"
+ //"7428049693650605954398446899724157486062545281504433364675815915402937209673727753199567661561209251"
+ //"4695589950526053470201635372590001578503476490223746511106018091907936826431407434894024396366284848"); ;
+ return rs;
+}
+
+template <class T>
+template<int N>
+inline T constant_rayleigh_kurtosis_excess<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{ // - (6 Pi^2 - 24 Pi + 16)/((Pi - 4)^2)
+ // Might provide provide and calculate this using pi_minus_four.
+ BOOST_MATH_STD_USING
+ return - (((static_cast<T>(6) * pi<T, policies::policy<policies::digits2<N> > >()
+ * pi<T, policies::policy<policies::digits2<N> > >())
+ - (static_cast<T>(24) * pi<T, policies::policy<policies::digits2<N> > >()) + static_cast<T>(16) )
+ /
+ ((pi<T, policies::policy<policies::digits2<N> > >() - static_cast<T>(4))
+ * (pi<T, policies::policy<policies::digits2<N> > >() - static_cast<T>(4)))
+ );
+}
+
+template <class T>
+template<int N>
+inline T constant_rayleigh_kurtosis<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{ // 3 - (6 Pi^2 - 24 Pi + 16)/((Pi - 4)^2)
+ // Might provide provide and calculate this using pi_minus_four.
+ BOOST_MATH_STD_USING
+ return static_cast<T>(3) - (((static_cast<T>(6) * pi<T, policies::policy<policies::digits2<N> > >()
+ * pi<T, policies::policy<policies::digits2<N> > >())
+ - (static_cast<T>(24) * pi<T, policies::policy<policies::digits2<N> > >()) + static_cast<T>(16) )
+ /
+ ((pi<T, policies::policy<policies::digits2<N> > >() - static_cast<T>(4))
+ * (pi<T, policies::policy<policies::digits2<N> > >() - static_cast<T>(4)))
+ );
+}
+
+}}}} // namespaces
+
+#endif // BOOST_MATH_CALCULATE_CONSTANTS_CONSTANTS_INCLUDED
diff --git a/boost/math/constants/constants.hpp b/boost/math/constants/constants.hpp
index 78aa42eff9..bb2260e7a7 100644
--- a/boost/math/constants/constants.hpp
+++ b/boost/math/constants/constants.hpp
@@ -1,5 +1,5 @@
-// Copyright John Maddock 2005-2006.
-// Copyright Paul A. Bristow 2006-2010.
+// Copyright John Maddock 2005-2006, 2011.
+// Copyright Paul A. Bristow 2006-2011.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -8,6 +8,8 @@
#define BOOST_MATH_CONSTANTS_CONSTANTS_INCLUDED
#include <boost/math/tools/config.hpp>
+#include <boost/math/policies/policy.hpp>
+#include <boost/math/tools/precision.hpp>
#ifdef BOOST_MSVC
#pragma warning(push)
#pragma warning(disable: 4127 4701)
@@ -16,6 +18,10 @@
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/int.hpp>
+#include <boost/type_traits/is_convertible.hpp>
namespace boost{ namespace math
{
@@ -35,43 +41,252 @@ namespace boost{ namespace math
// (This is necessary because you can't use a numeric constant
// since even a long double might not have enough digits).
+ enum construction_method
+ {
+ construct_from_float = 1,
+ construct_from_double = 2,
+ construct_from_long_double = 3,
+ construct_from_string = 4
+ };
- #define BOOST_DEFINE_MATH_CONSTANT(name, x, y, exp)\
- template <class T> inline T name(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T))\
+ //
+ // Max number of binary digits in the string representations
+ // of our constants:
+ //
+ BOOST_STATIC_CONSTANT(int, max_string_digits = (101 * 1000L) / 301L);
+
+ template <class Real, class Policy>
+ struct construction_traits
+ {
+ private:
+ typedef typename policies::precision<Real, Policy>::type t1;
+ typedef typename policies::precision<float, Policy>::type t2;
+ typedef typename policies::precision<double, Policy>::type t3;
+ typedef typename policies::precision<long double, Policy>::type t4;
+ public:
+ typedef typename mpl::if_<
+ mpl::and_<boost::is_convertible<float, Real>, mpl::bool_< t1::value <= t2::value>, mpl::bool_<0 != t1::value> >,
+ mpl::int_<construct_from_float>,
+ typename mpl::if_<
+ mpl::and_<boost::is_convertible<double, Real>, mpl::bool_< t1::value <= t3::value>, mpl::bool_<0 != t1::value> >,
+ mpl::int_<construct_from_double>,
+ typename mpl::if_<
+ mpl::and_<boost::is_convertible<long double, Real>, mpl::bool_< t1::value <= t4::value>, mpl::bool_<0 != t1::value> >,
+ mpl::int_<construct_from_long_double>,
+ typename mpl::if_<
+ mpl::and_<mpl::bool_< t1::value <= max_string_digits>, mpl::bool_<0 != t1::value> >,
+ mpl::int_<construct_from_string>,
+ mpl::int_<t1::value>
+ >::type
+ >::type
+ >::type
+ >::type type;
+ };
+
+#ifdef BOOST_HAS_THREADS
+#define BOOST_MATH_CONSTANT_THREAD_HELPER(name, prefix) \
+ boost::once_flag f = BOOST_ONCE_INIT;\
+ boost::call_once(f, &BOOST_JOIN(BOOST_JOIN(string_, get_), name)<T>);
+#else
+#define BOOST_MATH_CONSTANT_THREAD_HELPER(name, prefix)
+#endif
+
+ namespace detail{
+
+ template <class Real>
+ Real convert_from_string(const char* p, const mpl::false_&)
+ {
+ return boost::lexical_cast<Real>(p);
+ }
+ template <class Real>
+ const char* convert_from_string(const char* p, const mpl::true_&)
+ {
+ return p;
+ }
+
+ template <class T, T (*F)(BOOST_EXPLICIT_TEMPLATE_TYPE_SPEC(T))>
+ struct constant_initializer
+ {
+ static void force_instantiate()
+ {
+ init.force_instantiate();
+ }
+ private:
+ struct initializer
+ {
+ initializer()
+ {
+ F(
+ #ifdef BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
+ 0
+ #endif
+ );
+ }
+ void force_instantiate()const{}
+ };
+ static const initializer init;
+ };
+
+ template <class T, T (*F)(BOOST_EXPLICIT_TEMPLATE_TYPE_SPEC(T))>
+ typename constant_initializer<T, F>::initializer const constant_initializer<T, F>::init;
+
+ template <class T, int N, T (*F)(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>) BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))>
+ struct constant_initializer2
+ {
+ static void force_instantiate()
+ {
+ init.force_instantiate();
+ }
+ private:
+ struct initializer
+ {
+ initializer()
+ {
+ F(
+ #ifdef BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
+ mpl::int_<N>() , 0
+ #endif
+ );
+ }
+ void force_instantiate()const{}
+ };
+ static const initializer init;
+ };
+
+ template <class T, int N, T (*F)(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>) BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))>
+ typename constant_initializer2<T, N, F>::initializer const constant_initializer2<T, N, F>::init;
+
+ }
+
+ #define BOOST_DEFINE_MATH_CONSTANT(name, x, y)\
+ namespace detail{\
+ template <class T> struct BOOST_JOIN(constant_, name){\
+ private:\
+ /* The default implementations come next: */ \
+ static inline T get_from_string()\
{\
- static const T result = ::boost::lexical_cast<T>(BOOST_STRINGIZE(BOOST_JOIN(BOOST_JOIN(x, y), BOOST_JOIN(e, exp))));\
+ static const T result = convert_from_string<T>(y, boost::is_convertible<const char*, T>());\
return result;\
}\
- template <> inline float name<float>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(float))\
- { return BOOST_JOIN(BOOST_JOIN(x, BOOST_JOIN(e, exp)), F); }\
- template <> inline double name<double>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(double))\
- { return BOOST_JOIN(x, BOOST_JOIN(e, exp)); }\
- template <> inline long double name<long double>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(long double))\
- { return BOOST_JOIN(BOOST_JOIN(x, BOOST_JOIN(e, exp)), L); }
-
- BOOST_DEFINE_MATH_CONSTANT(pi, 3.141592653589793238462643383279502884197169399375105820974944, 59230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196, 0)
- BOOST_DEFINE_MATH_CONSTANT(two_pi, 6.2831853071795864769252867665590057683943388015061, 0, 0)
- BOOST_DEFINE_MATH_CONSTANT(root_pi, 1.7724538509055160272981674833411451827975, 0, 0)
- BOOST_DEFINE_MATH_CONSTANT(root_half_pi, 1.253314137315500251207882642405522626503, 0, 0)
- BOOST_DEFINE_MATH_CONSTANT(root_two_pi, 2.506628274631000502415765284811045253007, 0, 0)
- BOOST_DEFINE_MATH_CONSTANT(root_ln_four, 1.1774100225154746910115693264596996377473856893858205385225257565000, 2658854698492680841813836877081, 0)
- BOOST_DEFINE_MATH_CONSTANT(e, 2.7182818284590452353602874713526624977572470936999595749669676, 27724076630353547594571382178525166427427466391932003059921817413596629043572900334295260595630738132328627943490763233829880753195251019011, 0)
- BOOST_DEFINE_MATH_CONSTANT(half, 0.5, 0, 0)
- BOOST_DEFINE_MATH_CONSTANT(euler, 0.577215664901532860606512090082402431042159335939923598805, 76723488486, 0)
- BOOST_DEFINE_MATH_CONSTANT(root_two, 1.414213562373095048801688724209698078569671875376948073, 17667973799073247846210703885038753432764157273501384623091229702492483605585073721264412149709993583141322266592750559275579995050115278206, 0)
- BOOST_DEFINE_MATH_CONSTANT(half_root_two, 0.70710678118654752440084436210484903928483593756084, 0, 0)
- BOOST_DEFINE_MATH_CONSTANT(ln_two, 0.693147180559945309417232121458176568075500134360255254, 120680009493393621969694715605863326996418687, 0)
- BOOST_DEFINE_MATH_CONSTANT(ln_ln_two, -0.36651292058166432701243915823266946945426344783710526305367771367056, 16153193527385494558228566989083583025230453648347655663425171940646634, 0)
- BOOST_DEFINE_MATH_CONSTANT(third, 0.3333333333333333333333333333333333333333333333333333333333333333333333, 3333333333333333333333333333333333333333333333333333333333333333333333333, 0)
- BOOST_DEFINE_MATH_CONSTANT(twothirds, 0.66666666666666666666666666666666666666666666666666666666666666666666, 66666666666666666666666666666666666666666666666666666666666666666666667, 0) //deprecated, use two_thirds.
- BOOST_DEFINE_MATH_CONSTANT(two_thirds, 0.66666666666666666666666666666666666666666666666666666666666666666666, 66666666666666666666666666666666666666666666666666666666666666666666667, 0)
- BOOST_DEFINE_MATH_CONSTANT(pi_minus_three, 0.141592653589793238462643383279502884197169399375105820974944, 59230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196, 0)
- BOOST_DEFINE_MATH_CONSTANT(four_minus_pi, 0.85840734641020676153735661672049711580283060062489417902505540769218359, 0, 0)
- BOOST_DEFINE_MATH_CONSTANT(pow23_four_minus_pi, 0.79531676737159754434839533505680658072763917332771320544530223438582161, 0, 0)
- BOOST_DEFINE_MATH_CONSTANT(exp_minus_half, 0.6065306597126334236037995349911804534419181354871869556828921587350565194137, 484239986476115079894560, 0)
- } // namespace constants
+ /* This one is for very high precision that is none the less known at compile time: */ \
+ template <int N> static T compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>));\
+ /* public getters come next */\
+ public:\
+ static inline T get(const mpl::int_<construct_from_string>&)\
+ {\
+ constant_initializer<T, & BOOST_JOIN(constant_, name)<T>::get_from_string >::force_instantiate();\
+ return get_from_string();\
+ }\
+ static inline BOOST_CONSTEXPR T get(const mpl::int_<construct_from_float>)\
+ { return BOOST_JOIN(x, F); }\
+ static inline BOOST_CONSTEXPR T get(const mpl::int_<construct_from_double>&)\
+ { return x; }\
+ static inline BOOST_CONSTEXPR T get(const mpl::int_<construct_from_long_double>&)\
+ { return BOOST_JOIN(x, L); }\
+ template <int N> static inline T get(const mpl::int_<N>& n)\
+ {\
+ constant_initializer2<T, N, & BOOST_JOIN(constant_, name)<T>::template compute<N> >::force_instantiate();\
+ return compute<N>(); \
+ }\
+ /* This one is for true arbitary precision, which may well vary at runtime: */ \
+ static inline T get(const mpl::int_<0>&)\
+ { return tools::digits<T>() > max_string_digits ? compute<0>() : get(mpl::int_<construct_from_string>()); }\
+ }; /* end of struct */\
+ } /* namespace detail */ \
+ \
+ \
+ /* The actual forwarding function: */ \
+ template <class T, class Policy> inline BOOST_CONSTEXPR T name(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(T) BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(Policy))\
+ { return detail:: BOOST_JOIN(constant_, name)<T>::get(typename construction_traits<T, Policy>::type()); }\
+ template <class T> inline BOOST_CONSTEXPR T name(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(T))\
+ { return name<T, boost::math::policies::policy<> >(); }\
+ \
+ \
+ /* Now the namespace specific versions: */ \
+ } namespace float_constants{ static const float name = BOOST_JOIN(x, F); }\
+ namespace double_constants{ static const double name = x; } \
+ namespace long_double_constants{ static const long double name = BOOST_JOIN(x, L); }\
+ namespace constants{
+
+ BOOST_DEFINE_MATH_CONSTANT(half, 5.000000000000000000000000000000000000e-01, "5.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e-01")
+ BOOST_DEFINE_MATH_CONSTANT(third, 3.333333333333333333333333333333333333e-01, "3.33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333e-01")
+ BOOST_DEFINE_MATH_CONSTANT(twothirds, 6.666666666666666666666666666666666666e-01, "6.66666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666667e-01")
+ BOOST_DEFINE_MATH_CONSTANT(two_thirds, 6.666666666666666666666666666666666666e-01, "6.66666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666667e-01")
+ BOOST_DEFINE_MATH_CONSTANT(three_quarters, 7.500000000000000000000000000000000000e-01, "7.50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e-01")
+ BOOST_DEFINE_MATH_CONSTANT(root_two, 1.414213562373095048801688724209698078e+00, "1.41421356237309504880168872420969807856967187537694807317667973799073247846210703885038753432764157273501384623e+00")
+ BOOST_DEFINE_MATH_CONSTANT(root_three, 1.732050807568877293527446341505872366e+00, "1.73205080756887729352744634150587236694280525381038062805580697945193301690880003708114618675724857567562614142e+00")
+ BOOST_DEFINE_MATH_CONSTANT(half_root_two, 7.071067811865475244008443621048490392e-01, "7.07106781186547524400844362104849039284835937688474036588339868995366239231053519425193767163820786367506923115e-01")
+ BOOST_DEFINE_MATH_CONSTANT(ln_two, 6.931471805599453094172321214581765680e-01, "6.93147180559945309417232121458176568075500134360255254120680009493393621969694715605863326996418687542001481021e-01")
+ BOOST_DEFINE_MATH_CONSTANT(ln_ln_two, -3.665129205816643270124391582326694694e-01, "-3.66512920581664327012439158232669469454263447837105263053677713670561615319352738549455822856698908358302523045e-01")
+ BOOST_DEFINE_MATH_CONSTANT(root_ln_four, 1.177410022515474691011569326459699637e+00, "1.17741002251547469101156932645969963774738568938582053852252575650002658854698492680841813836877081106747157858e+00")
+ BOOST_DEFINE_MATH_CONSTANT(one_div_root_two, 7.071067811865475244008443621048490392e-01, "7.07106781186547524400844362104849039284835937688474036588339868995366239231053519425193767163820786367506923115e-01")
+ BOOST_DEFINE_MATH_CONSTANT(pi, 3.141592653589793238462643383279502884e+00, "3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651e+00")
+ BOOST_DEFINE_MATH_CONSTANT(half_pi, 1.570796326794896619231321691639751442e+00, "1.57079632679489661923132169163975144209858469968755291048747229615390820314310449931401741267105853399107404326e+00")
+ BOOST_DEFINE_MATH_CONSTANT(third_pi, 1.047197551196597746154214461093167628e+00, "1.04719755119659774615421446109316762806572313312503527365831486410260546876206966620934494178070568932738269550e+00")
+ BOOST_DEFINE_MATH_CONSTANT(sixth_pi, 5.235987755982988730771072305465838140e-01, "5.23598775598298873077107230546583814032861566562517636829157432051302734381034833104672470890352844663691347752e-01")
+ BOOST_DEFINE_MATH_CONSTANT(two_pi, 6.283185307179586476925286766559005768e+00, "6.28318530717958647692528676655900576839433879875021164194988918461563281257241799725606965068423413596429617303e+00")
+ BOOST_DEFINE_MATH_CONSTANT(two_thirds_pi, 2.094395102393195492308428922186335256e+00, "2.09439510239319549230842892218633525613144626625007054731662972820521093752413933241868988356141137865476539101e+00")
+ BOOST_DEFINE_MATH_CONSTANT(three_quarters_pi, 2.356194490192344928846982537459627163e+00, "2.35619449019234492884698253745962716314787704953132936573120844423086230471465674897102611900658780098661106488e+00")
+ BOOST_DEFINE_MATH_CONSTANT(four_thirds_pi, 4.188790204786390984616857844372670512e+00, "4.18879020478639098461685784437267051226289253250014109463325945641042187504827866483737976712282275730953078202e+00")
+ BOOST_DEFINE_MATH_CONSTANT(one_div_two_pi, 1.591549430918953357688837633725143620e-01, "1.59154943091895335768883763372514362034459645740456448747667344058896797634226535090113802766253085956072842727e-01")
+ BOOST_DEFINE_MATH_CONSTANT(one_div_root_two_pi, 3.989422804014326779399460599343818684e-01, "3.98942280401432677939946059934381868475858631164934657665925829670657925899301838501252333907306936430302558863e-01")
+ BOOST_DEFINE_MATH_CONSTANT(root_pi, 1.772453850905516027298167483341145182e+00, "1.77245385090551602729816748334114518279754945612238712821380778985291128459103218137495065673854466541622682362e+00")
+ BOOST_DEFINE_MATH_CONSTANT(root_half_pi, 1.253314137315500251207882642405522626e+00, "1.25331413731550025120788264240552262650349337030496915831496178817114682730392098747329791918902863305800498633e+00")
+ BOOST_DEFINE_MATH_CONSTANT(root_two_pi, 2.506628274631000502415765284811045253e+00, "2.50662827463100050241576528481104525300698674060993831662992357634229365460784197494659583837805726611600997267e+00")
+ BOOST_DEFINE_MATH_CONSTANT(one_div_root_pi, 5.641895835477562869480794515607725858e-01, "5.64189583547756286948079451560772585844050629328998856844085721710642468441493414486743660202107363443028347906e-01")
+ BOOST_DEFINE_MATH_CONSTANT(root_one_div_pi, 5.641895835477562869480794515607725858e-01, "5.64189583547756286948079451560772585844050629328998856844085721710642468441493414486743660202107363443028347906e-01")
+ BOOST_DEFINE_MATH_CONSTANT(pi_minus_three, 1.415926535897932384626433832795028841e-01, "1.41592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513e-01")
+ BOOST_DEFINE_MATH_CONSTANT(four_minus_pi, 8.584073464102067615373566167204971158e-01, "8.58407346410206761537356616720497115802830600624894179025055407692183593713791001371965174657882932017851913487e-01")
+ BOOST_DEFINE_MATH_CONSTANT(pow23_four_minus_pi, 7.953167673715975443483953350568065807e-01, "7.95316767371597544348395335056806580727639173327713205445302234388856268267518187590758006888600828436839800178e-01")
+ BOOST_DEFINE_MATH_CONSTANT(pi_pow_e, 2.245915771836104547342715220454373502e+01, "2.24591577183610454734271522045437350275893151339966922492030025540669260403991179123185197527271430315314500731e+01")
+ BOOST_DEFINE_MATH_CONSTANT(pi_sqr, 9.869604401089358618834490999876151135e+00, "9.86960440108935861883449099987615113531369940724079062641334937622004482241920524300177340371855223182402591377e+00")
+ BOOST_DEFINE_MATH_CONSTANT(pi_sqr_div_six, 1.644934066848226436472415166646025189e+00, "1.64493406684822643647241516664602518921894990120679843773555822937000747040320087383362890061975870530400431896e+00")
+ BOOST_DEFINE_MATH_CONSTANT(pi_cubed, 3.100627668029982017547631506710139520e+01, "3.10062766802998201754763150671013952022252885658851076941445381038063949174657060375667010326028861930301219616e+01")
+ BOOST_DEFINE_MATH_CONSTANT(cbrt_pi, 1.464591887561523263020142527263790391e+00, "1.46459188756152326302014252726379039173859685562793717435725593713839364979828626614568206782035382089750397002e+00")
+ BOOST_DEFINE_MATH_CONSTANT(one_div_cbrt_pi, 6.827840632552956814670208331581645981e-01, "6.82784063255295681467020833158164598108367515632448804042681583118899226433403918237673501922595519865685577274e-01")
+ BOOST_DEFINE_MATH_CONSTANT(e, 2.718281828459045235360287471352662497e+00, "2.71828182845904523536028747135266249775724709369995957496696762772407663035354759457138217852516642742746639193e+00")
+ BOOST_DEFINE_MATH_CONSTANT(exp_minus_half, 6.065306597126334236037995349911804534e-01, "6.06530659712633423603799534991180453441918135487186955682892158735056519413748423998647611507989456026423789794e-01")
+ BOOST_DEFINE_MATH_CONSTANT(e_pow_pi, 2.314069263277926900572908636794854738e+01, "2.31406926327792690057290863679485473802661062426002119934450464095243423506904527835169719970675492196759527048e+01")
+ BOOST_DEFINE_MATH_CONSTANT(root_e, 1.648721270700128146848650787814163571e+00, "1.64872127070012814684865078781416357165377610071014801157507931164066102119421560863277652005636664300286663776e+00")
+ BOOST_DEFINE_MATH_CONSTANT(log10_e, 4.342944819032518276511289189166050822e-01, "4.34294481903251827651128918916605082294397005803666566114453783165864649208870774729224949338431748318706106745e-01")
+ BOOST_DEFINE_MATH_CONSTANT(one_div_log10_e, 2.302585092994045684017991454684364207e+00, "2.30258509299404568401799145468436420760110148862877297603332790096757260967735248023599720508959829834196778404e+00")
+ BOOST_DEFINE_MATH_CONSTANT(ln_ten, 2.302585092994045684017991454684364207e+00, "2.30258509299404568401799145468436420760110148862877297603332790096757260967735248023599720508959829834196778404e+00")
+ BOOST_DEFINE_MATH_CONSTANT(degree, 1.745329251994329576923690768488612713e-02, "1.74532925199432957692369076848861271344287188854172545609719144017100911460344944368224156963450948221230449251e-02")
+ BOOST_DEFINE_MATH_CONSTANT(radian, 5.729577951308232087679815481410517033e+01, "5.72957795130823208767981548141051703324054724665643215491602438612028471483215526324409689958511109441862233816e+01")
+ BOOST_DEFINE_MATH_CONSTANT(sin_one, 8.414709848078965066525023216302989996e-01, "8.41470984807896506652502321630298999622563060798371065672751709991910404391239668948639743543052695854349037908e-01")
+ BOOST_DEFINE_MATH_CONSTANT(cos_one, 5.403023058681397174009366074429766037e-01, "5.40302305868139717400936607442976603732310420617922227670097255381100394774471764517951856087183089343571731160e-01")
+ BOOST_DEFINE_MATH_CONSTANT(sinh_one, 1.175201193643801456882381850595600815e+00, "1.17520119364380145688238185059560081515571798133409587022956541301330756730432389560711745208962339184041953333e+00")
+ BOOST_DEFINE_MATH_CONSTANT(cosh_one, 1.543080634815243778477905620757061682e+00, "1.54308063481524377847790562075706168260152911236586370473740221471076906304922369896426472643554303558704685860e+00")
+ BOOST_DEFINE_MATH_CONSTANT(phi, 1.618033988749894848204586834365638117e+00, "1.61803398874989484820458683436563811772030917980576286213544862270526046281890244970720720418939113748475408808e+00")
+ BOOST_DEFINE_MATH_CONSTANT(ln_phi, 4.812118250596034474977589134243684231e-01, "4.81211825059603447497758913424368423135184334385660519661018168840163867608221774412009429122723474997231839958e-01")
+ BOOST_DEFINE_MATH_CONSTANT(one_div_ln_phi, 2.078086921235027537601322606117795767e+00, "2.07808692123502753760132260611779576774219226778328348027813992191974386928553540901445615414453604821933918634e+00")
+ BOOST_DEFINE_MATH_CONSTANT(euler, 5.772156649015328606065120900824024310e-01, "5.77215664901532860606512090082402431042159335939923598805767234884867726777664670936947063291746749514631447250e-01")
+ BOOST_DEFINE_MATH_CONSTANT(one_div_euler, 1.732454714600633473583025315860829681e+00, "1.73245471460063347358302531586082968115577655226680502204843613287065531408655243008832840219409928068072365714e+00")
+ BOOST_DEFINE_MATH_CONSTANT(euler_sqr, 3.331779238077186743183761363552442266e-01, "3.33177923807718674318376136355244226659417140249629743150833338002265793695756669661263268631715977303039565603e-01")
+ BOOST_DEFINE_MATH_CONSTANT(zeta_two, 1.644934066848226436472415166646025189e+00, "1.64493406684822643647241516664602518921894990120679843773555822937000747040320087383362890061975870530400431896e+00")
+ BOOST_DEFINE_MATH_CONSTANT(zeta_three, 1.202056903159594285399738161511449990e+00, "1.20205690315959428539973816151144999076498629234049888179227155534183820578631309018645587360933525814619915780e+00")
+ BOOST_DEFINE_MATH_CONSTANT(catalan, 9.159655941772190150546035149323841107e-01, "9.15965594177219015054603514932384110774149374281672134266498119621763019776254769479356512926115106248574422619e-01")
+ BOOST_DEFINE_MATH_CONSTANT(glaisher, 1.282427129100622636875342568869791727e+00, "1.28242712910062263687534256886979172776768892732500119206374002174040630885882646112973649195820237439420646120e+00")
+ BOOST_DEFINE_MATH_CONSTANT(khinchin, 2.685452001065306445309714835481795693e+00, "2.68545200106530644530971483548179569382038229399446295305115234555721885953715200280114117493184769799515346591e+00")
+ BOOST_DEFINE_MATH_CONSTANT(extreme_value_skewness, 1.139547099404648657492793019389846112e+00, "1.13954709940464865749279301938984611208759979583655182472165571008524800770607068570718754688693851501894272049e+00")
+ BOOST_DEFINE_MATH_CONSTANT(rayleigh_skewness, 6.311106578189371381918993515442277798e-01, "6.31110657818937138191899351544227779844042203134719497658094585692926819617473725459905027032537306794400047264e-01")
+ BOOST_DEFINE_MATH_CONSTANT(rayleigh_kurtosis, 3.245089300687638062848660410619754415e+00, "3.24508930068763806284866041061975441541706673178920936177133764493367904540874159051490619368679348977426462633e+00")
+ BOOST_DEFINE_MATH_CONSTANT(rayleigh_kurtosis_excess, 2.450893006876380628486604106197544154e-01, "2.45089300687638062848660410619754415417066731789209361771337644933679045408741590514906193686793489774264626328e-01")
+
+ BOOST_DEFINE_MATH_CONSTANT(two_div_pi, 6.366197723675813430755350534900574481e-01, "6.36619772367581343075535053490057448137838582961825794990669376235587190536906140360455211065012343824291370907e-01")
+ BOOST_DEFINE_MATH_CONSTANT(root_two_div_pi, 7.978845608028653558798921198687637369e-01, "7.97884560802865355879892119868763736951717262329869315331851659341315851798603677002504667814613872860605117725e-01")
+
+
+} // namespace constants
} // namespace math
} // namespace boost
+//
+// We deliberately include this *after* all the declarations above,
+// that way the calculation routines can call on other constants above:
+//
+#include <boost/math/constants/calculate_constants.hpp>
+
#endif // BOOST_MATH_CONSTANTS_CONSTANTS_INCLUDED
+
diff --git a/boost/math/constants/generate.hpp b/boost/math/constants/generate.hpp
new file mode 100644
index 0000000000..dfb15633a5
--- /dev/null
+++ b/boost/math/constants/generate.hpp
@@ -0,0 +1,76 @@
+// Copyright John Maddock 2010.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_MATH_CONSTANTS_GENERATE_INCLUDED
+#define BOOST_MATH_CONSTANTS_GENERATE_INCLUDED
+
+#include <boost/math/constants/constants.hpp>
+#include <boost/regex.hpp>
+#include <iostream>
+#include <iomanip>
+#include <sstream>
+
+#ifdef USE_MPFR
+#include <boost/math/bindings/mpfr.hpp>
+#elif defined(USE_MPREAL)
+#include <boost/math/bindings/mpreal.hpp>
+#elif defined(USE_CPP_FLOAT)
+#include <boost/multiprecision/cpp_float.hpp>
+#else
+#include <boost/math/bindings/rr.hpp>
+#endif
+
+namespace boost{ namespace math{ namespace constants{
+
+#ifdef USE_MPFR
+typedef mpfr_class generator_type;
+#elif defined(USE_MPREAL)
+typedef mpfr::mpreal generator_type;
+#elif defined(USE_CPP_FLOAT)
+typedef boost::multiprecision::mp_number<boost::multiprecision::cpp_float<500> > generator_type;
+#else
+typedef ntl::RR generator_type;
+#endif
+
+inline void print_constant(const char* name, generator_type(*f)(const mpl::int_<0>&))
+{
+#ifdef USE_MPFR
+ mpfr_class::set_dprec(((200 + 1) * 1000L) / 301L);
+#elif defined(USE_MPREAL)
+ mpfr::mpreal::set_default_prec(((200 + 1) * 1000L) / 301L);
+#elif defined(USE_CPP_FLOAT)
+ // Nothing to do, precision is already set.
+#else
+ ntl::RR::SetPrecision(((200 + 1) * 1000L) / 301L);
+ ntl::RR::SetOutputPrecision(102);
+#endif
+ generator_type value = f(boost::mpl::int_<0>());
+ std::stringstream os;
+ os << std::setprecision(110) << std::scientific;
+ os << value;
+ std::string s = os.str();
+ static const regex e("([+-]?\\d+(?:\\.\\d{0,36})?)(\\d*)(?:e([+-]?\\d+))?");
+ smatch what;
+ if(regex_match(s, what, e))
+ {
+ std::cout <<
+ "BOOST_DEFINE_MATH_CONSTANT(" << name << ", "
+ << what[1] << "e" << (what[3].length() ? what[3].str() : std::string("0")) << ", "
+ << "\"" << what[1] << what[2] << "e" << (what[3].length() ? what[3].str() : std::string("0"))
+ << "\");" << std::endl;
+ }
+ else
+ {
+ std::cout << "Format of numeric constant was not recognised!!" << std::endl;
+ }
+}
+
+#define BOOST_CONSTANTS_GENERATE(name) \
+ boost::math::constants::print_constant(#name, \
+ & boost::math::constants::detail::BOOST_JOIN(constant_, name)<boost::math::constants::generator_type>::get)
+
+}}} // namespaces
+
+#endif // BOOST_MATH_CONSTANTS_GENERATE_INCLUDED
diff --git a/boost/math/constants/info.hpp b/boost/math/constants/info.hpp
new file mode 100644
index 0000000000..e3e6a517d4
--- /dev/null
+++ b/boost/math/constants/info.hpp
@@ -0,0 +1,163 @@
+// Copyright John Maddock 2010.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#ifdef _MSC_VER
+# pragma once
+#endif
+
+#ifndef BOOST_MATH_CONSTANTS_INFO_INCLUDED
+#define BOOST_MATH_CONSTANTS_INFO_INCLUDED
+
+#include <boost/math/constants/constants.hpp>
+#include <iostream>
+#include <iomanip>
+#include <typeinfo>
+
+namespace boost{ namespace math{ namespace constants{
+
+ namespace detail{
+
+ template <class T>
+ const char* nameof(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+ {
+ return typeid(T).name();
+ }
+ template <>
+ const char* nameof<float>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(float))
+ {
+ return "float";
+ }
+ template <>
+ const char* nameof<double>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(double))
+ {
+ return "double";
+ }
+ template <>
+ const char* nameof<long double>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(long double))
+ {
+ return "long double";
+ }
+
+ }
+
+template <class T, class Policy>
+void print_info_on_type(std::ostream& os = std::cout BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T) BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(Policy))
+{
+ using detail::nameof;
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
+ os <<
+ "Information on the Implementation and Handling of \n"
+ "Mathematical Constants for Type " << nameof<T>() <<
+ "\n\n"
+ "Checking for std::numeric_limits<" << nameof<T>() << "> specialisation: " <<
+ (std::numeric_limits<T>::is_specialized ? "yes" : "no") << std::endl;
+ if(std::numeric_limits<T>::is_specialized)
+ {
+ os <<
+ "std::numeric_limits<" << nameof<T>() << ">::digits reports that the radix is " << std::numeric_limits<T>::radix << ".\n";
+ if (std::numeric_limits<T>::radix == 2)
+ {
+ os <<
+ "std::numeric_limits<" << nameof<T>() << ">::digits reports that the precision is \n" << std::numeric_limits<T>::digits << " binary digits.\n";
+ }
+ else if (std::numeric_limits<T>::radix == 10)
+ {
+ os <<
+ "std::numeric_limits<" << nameof<T>() << ">::digits reports that the precision is \n" << std::numeric_limits<T>::digits10 << " decimal digits.\n";
+ os <<
+ "std::numeric_limits<" << nameof<T>() << ">::digits reports that the precision is \n"
+ << std::numeric_limits<T>::digits * 1000L /301L << " binary digits.\n"; // divide by log2(10) - about 3 bits per decimal digit.
+ }
+ else
+ {
+ os << "Unknown radix = " << std::numeric_limits<T>::radix << "\n";
+ }
+ }
+ typedef typename boost::math::policies::precision<T, Policy>::type precision_type;
+ if(precision_type::value)
+ {
+ if (std::numeric_limits<T>::radix == 2)
+ {
+ os <<
+ "boost::math::policies::precision<" << nameof<T>() << ", " << nameof<Policy>() << " reports that the compile time precision is \n" << precision_type::value << " binary digits.\n";
+ }
+ else if (std::numeric_limits<T>::radix == 10)
+ {
+ os <<
+ "boost::math::policies::precision<" << nameof<T>() << ", " << nameof<Policy>() << " reports that the compile time precision is \n" << precision_type::value << " binary digits.\n";
+ }
+ else
+ {
+ os << "Unknown radix = " << std::numeric_limits<T>::radix << "\n";
+ }
+ }
+ else
+ {
+ os <<
+ "boost::math::policies::precision<" << nameof<T>() << ", Policy> \n"
+ "reports that there is no compile type precision available.\n"
+ "boost::math::tools::digits<" << nameof<T>() << ">() \n"
+ "reports that the current runtime precision is \n" <<
+ boost::math::tools::digits<T>() << " binary digits.\n";
+ }
+
+ typedef typename construction_traits<T, Policy>::type construction_type;
+
+ switch(construction_type::value)
+ {
+ case 0:
+ os <<
+ "No compile time precision is available, the construction method \n"
+ "will be decided at runtime and results will not be cached \n"
+ "- this may lead to poor runtime performance.\n"
+ "Current runtime precision indicates that\n";
+ if(boost::math::tools::digits<T>() > max_string_digits)
+ {
+ os << "the constant will be recalculated on each call.\n";
+ }
+ else
+ {
+ os << "the constant will be constructed from a string on each call.\n";
+ }
+ break;
+ case 1:
+ os <<
+ "The constant will be constructed from a float.\n";
+ break;
+ case 2:
+ os <<
+ "The constant will be constructed from a double.\n";
+ break;
+ case 3:
+ os <<
+ "The constant will be constructed from a long double.\n";
+ break;
+ case 4:
+ os <<
+ "The constant will be constructed from a string (and the result cached).\n";
+ break;
+ default:
+ os <<
+ "The constant will be calculated (and the result cached).\n";
+ break;
+ }
+ os << std::endl;
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+}
+
+template <class T>
+void print_info_on_type(std::ostream& os = std::cout BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ print_info_on_type<T, boost::math::policies::policy<> >(os);
+}
+
+}}} // namespaces
+
+#endif // BOOST_MATH_CONSTANTS_INFO_INCLUDED
diff --git a/boost/math/distributions/detail/inv_discrete_quantile.hpp b/boost/math/distributions/detail/inv_discrete_quantile.hpp
index 4d28e52936..9397e7c7c2 100644
--- a/boost/math/distributions/detail/inv_discrete_quantile.hpp
+++ b/boost/math/distributions/detail/inv_discrete_quantile.hpp
@@ -124,6 +124,8 @@ typename Dist::value_type
--count;
if(fb == 0)
return b;
+ if(a == b)
+ return b; // can't go any higher!
}
else
{
@@ -135,6 +137,8 @@ typename Dist::value_type
--count;
if(fa == 0)
return a;
+ if(a == b)
+ return a; // We can't go any lower than this!
}
}
}
@@ -208,7 +212,7 @@ typename Dist::value_type
// Zero is to the right of x2, so walk upwards
// until we find it:
//
- while((boost::math::sign)(fb) == (boost::math::sign)(fa))
+ while(((boost::math::sign)(fb) == (boost::math::sign)(fa)) && (a != b))
{
if(count == 0)
policies::raise_evaluation_error(function, "Unable to bracket root, last nearest value was %1%", b, policy_type());
@@ -228,7 +232,7 @@ typename Dist::value_type
// Zero is to the left of a, so walk downwards
// until we find it:
//
- while((boost::math::sign)(fb) == (boost::math::sign)(fa))
+ while(((boost::math::sign)(fb) == (boost::math::sign)(fa)) && (a != b))
{
if(fabs(a) < tools::min_value<value_type>())
{
@@ -255,6 +259,8 @@ typename Dist::value_type
return a;
if(fb == 0)
return b;
+ if(a == b)
+ return b; // Ran out of bounds trying to bracket - there is no answer!
//
// Adjust bounds so that if we're looking for an integer
// result, then both ends round the same way:
diff --git a/boost/math/distributions/skew_normal.hpp b/boost/math/distributions/skew_normal.hpp
new file mode 100644
index 0000000000..58526defdb
--- /dev/null
+++ b/boost/math/distributions/skew_normal.hpp
@@ -0,0 +1,716 @@
+// (C) Benjamin Sobotta 2012
+
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_STATS_SKEW_NORMAL_HPP
+#define BOOST_STATS_SKEW_NORMAL_HPP
+
+// http://en.wikipedia.org/wiki/Skew_normal_distribution
+// http://azzalini.stat.unipd.it/SN/
+// Also:
+// Azzalini, A. (1985). "A class of distributions which includes the normal ones".
+// Scand. J. Statist. 12: 171-178.
+
+#include <boost/math/distributions/fwd.hpp> // TODO add skew_normal distribution to fwd.hpp!
+#include <boost/math/special_functions/owens_t.hpp> // Owen's T function
+#include <boost/math/distributions/complement.hpp>
+#include <boost/math/distributions/normal.hpp>
+#include <boost/math/distributions/detail/common_error_handling.hpp>
+#include <boost/math/constants/constants.hpp>
+#include <boost/math/tools/tuple.hpp>
+#include <boost/math/tools/roots.hpp> // Newton-Raphson
+#include <boost/assert.hpp>
+#include <boost/math/distributions/detail/generic_mode.hpp> // pdf max finder.
+
+#include <utility>
+#include <algorithm> // std::lower_bound, std::distance
+
+namespace boost{ namespace math{
+
+ namespace detail
+ {
+ template <class RealType, class Policy>
+ inline bool check_skew_normal_shape(
+ const char* function,
+ RealType shape,
+ RealType* result,
+ const Policy& pol)
+ {
+ if(!(boost::math::isfinite)(shape))
+ {
+ *result =
+ policies::raise_domain_error<RealType>(function,
+ "Shape parameter is %1%, but must be finite!",
+ shape, pol);
+ return false;
+ }
+ return true;
+ }
+
+ } // namespace detail
+
+ template <class RealType = double, class Policy = policies::policy<> >
+ class skew_normal_distribution
+ {
+ public:
+ typedef RealType value_type;
+ typedef Policy policy_type;
+
+ skew_normal_distribution(RealType location = 0, RealType scale = 1, RealType shape = 0)
+ : location_(location), scale_(scale), shape_(shape)
+ { // Default is a 'standard' normal distribution N01. (shape=0 results in the normal distribution with no skew)
+ static const char* function = "boost::math::skew_normal_distribution<%1%>::skew_normal_distribution";
+
+ RealType result;
+ detail::check_scale(function, scale, &result, Policy());
+ detail::check_location(function, location, &result, Policy());
+ detail::check_skew_normal_shape(function, shape, &result, Policy());
+ }
+
+ RealType location()const
+ {
+ return location_;
+ }
+
+ RealType scale()const
+ {
+ return scale_;
+ }
+
+ RealType shape()const
+ {
+ return shape_;
+ }
+
+
+ private:
+ //
+ // Data members:
+ //
+ RealType location_; // distribution location.
+ RealType scale_; // distribution scale.
+ RealType shape_; // distribution shape.
+ }; // class skew_normal_distribution
+
+ typedef skew_normal_distribution<double> skew_normal;
+
+ template <class RealType, class Policy>
+ inline const std::pair<RealType, RealType> range(const skew_normal_distribution<RealType, Policy>& /*dist*/)
+ { // Range of permissible values for random variable x.
+ using boost::math::tools::max_value;
+ return std::pair<RealType, RealType>(-max_value<RealType>(), max_value<RealType>()); // - to + max value.
+ }
+
+ template <class RealType, class Policy>
+ inline const std::pair<RealType, RealType> support(const skew_normal_distribution<RealType, Policy>& /*dist*/)
+ { // Range of supported values for random variable x.
+ // This is range where cdf rises from 0 to 1, and outside it, the pdf is zero.
+
+ using boost::math::tools::max_value;
+ return std::pair<RealType, RealType>(-max_value<RealType>(), max_value<RealType>()); // - to + max value.
+ }
+
+ template <class RealType, class Policy>
+ inline RealType pdf(const skew_normal_distribution<RealType, Policy>& dist, const RealType& x)
+ {
+ const RealType scale = dist.scale();
+ const RealType location = dist.location();
+ const RealType shape = dist.shape();
+
+ static const char* function = "boost::math::pdf(const skew_normal_distribution<%1%>&, %1%)";
+ if((boost::math::isinf)(x))
+ {
+ return 0; // pdf + and - infinity is zero.
+ }
+ // Below produces MSVC 4127 warnings, so the above used instead.
+ //if(std::numeric_limits<RealType>::has_infinity && abs(x) == std::numeric_limits<RealType>::infinity())
+ //{ // pdf + and - infinity is zero.
+ // return 0;
+ //}
+
+ RealType result = 0;
+ if(false == detail::check_scale(function, scale, &result, Policy()))
+ {
+ return result;
+ }
+ if(false == detail::check_location(function, location, &result, Policy()))
+ {
+ return result;
+ }
+ if(false == detail::check_skew_normal_shape(function, shape, &result, Policy()))
+ {
+ return result;
+ }
+ if(false == detail::check_x(function, x, &result, Policy()))
+ {
+ return result;
+ }
+
+ const RealType transformed_x = (x-location)/scale;
+
+ normal_distribution<RealType, Policy> std_normal;
+
+ result = pdf(std_normal, transformed_x) * cdf(std_normal, shape*transformed_x) * 2 / scale;
+
+ return result;
+ } // pdf
+
+ template <class RealType, class Policy>
+ inline RealType cdf(const skew_normal_distribution<RealType, Policy>& dist, const RealType& x)
+ {
+ const RealType scale = dist.scale();
+ const RealType location = dist.location();
+ const RealType shape = dist.shape();
+
+ static const char* function = "boost::math::cdf(const skew_normal_distribution<%1%>&, %1%)";
+ RealType result = 0;
+ if(false == detail::check_scale(function, scale, &result, Policy()))
+ {
+ return result;
+ }
+ if(false == detail::check_location(function, location, &result, Policy()))
+ {
+ return result;
+ }
+ if(false == detail::check_skew_normal_shape(function, shape, &result, Policy()))
+ {
+ return result;
+ }
+ if((boost::math::isinf)(x))
+ {
+ if(x < 0) return 0; // -infinity
+ return 1; // + infinity
+ }
+ // These produce MSVC 4127 warnings, so the above used instead.
+ //if(std::numeric_limits<RealType>::has_infinity && x == std::numeric_limits<RealType>::infinity())
+ //{ // cdf +infinity is unity.
+ // return 1;
+ //}
+ //if(std::numeric_limits<RealType>::has_infinity && x == -std::numeric_limits<RealType>::infinity())
+ //{ // cdf -infinity is zero.
+ // return 0;
+ //}
+ if(false == detail::check_x(function, x, &result, Policy()))
+ {
+ return result;
+ }
+
+ const RealType transformed_x = (x-location)/scale;
+
+ normal_distribution<RealType, Policy> std_normal;
+
+ result = cdf(std_normal, transformed_x) - owens_t(transformed_x, shape)*static_cast<RealType>(2);
+
+ return result;
+ } // cdf
+
+ template <class RealType, class Policy>
+ inline RealType cdf(const complemented2_type<skew_normal_distribution<RealType, Policy>, RealType>& c)
+ {
+ const RealType scale = c.dist.scale();
+ const RealType location = c.dist.location();
+ const RealType shape = c.dist.shape();
+ const RealType x = c.param;
+
+ static const char* function = "boost::math::cdf(const complement(skew_normal_distribution<%1%>&), %1%)";
+
+ if((boost::math::isinf)(x))
+ {
+ if(x < 0) return 1; // cdf complement -infinity is unity.
+ return 0; // cdf complement +infinity is zero
+ }
+ // These produce MSVC 4127 warnings, so the above used instead.
+ //if(std::numeric_limits<RealType>::has_infinity && x == std::numeric_limits<RealType>::infinity())
+ //{ // cdf complement +infinity is zero.
+ // return 0;
+ //}
+ //if(std::numeric_limits<RealType>::has_infinity && x == -std::numeric_limits<RealType>::infinity())
+ //{ // cdf complement -infinity is unity.
+ // return 1;
+ //}
+ RealType result = 0;
+ if(false == detail::check_scale(function, scale, &result, Policy()))
+ return result;
+ if(false == detail::check_location(function, location, &result, Policy()))
+ return result;
+ if(false == detail::check_skew_normal_shape(function, shape, &result, Policy()))
+ return result;
+ if(false == detail::check_x(function, x, &result, Policy()))
+ return result;
+
+ const RealType transformed_x = (x-location)/scale;
+
+ normal_distribution<RealType, Policy> std_normal;
+
+ result = cdf(complement(std_normal, transformed_x)) + owens_t(transformed_x, shape)*static_cast<RealType>(2);
+ return result;
+ } // cdf complement
+
+ template <class RealType, class Policy>
+ inline RealType location(const skew_normal_distribution<RealType, Policy>& dist)
+ {
+ return dist.location();
+ }
+
+ template <class RealType, class Policy>
+ inline RealType scale(const skew_normal_distribution<RealType, Policy>& dist)
+ {
+ return dist.scale();
+ }
+
+ template <class RealType, class Policy>
+ inline RealType shape(const skew_normal_distribution<RealType, Policy>& dist)
+ {
+ return dist.shape();
+ }
+
+ template <class RealType, class Policy>
+ inline RealType mean(const skew_normal_distribution<RealType, Policy>& dist)
+ {
+ BOOST_MATH_STD_USING // for ADL of std functions
+
+ using namespace boost::math::constants;
+
+ //const RealType delta = dist.shape() / sqrt(static_cast<RealType>(1)+dist.shape()*dist.shape());
+
+ //return dist.location() + dist.scale() * delta * root_two_div_pi<RealType>();
+
+ return dist.location() + dist.scale() * dist.shape() / sqrt(pi<RealType>()+pi<RealType>()*dist.shape()*dist.shape()) * root_two<RealType>();
+ }
+
+ template <class RealType, class Policy>
+ inline RealType variance(const skew_normal_distribution<RealType, Policy>& dist)
+ {
+ using namespace boost::math::constants;
+
+ const RealType delta2 = static_cast<RealType>(1) / (static_cast<RealType>(1)+static_cast<RealType>(1)/(dist.shape()*dist.shape()));
+ //const RealType inv_delta2 = static_cast<RealType>(1)+static_cast<RealType>(1)/(dist.shape()*dist.shape());
+
+ RealType variance = dist.scale()*dist.scale()*(static_cast<RealType>(1)-two_div_pi<RealType>()*delta2);
+ //RealType variance = dist.scale()*dist.scale()*(static_cast<RealType>(1)-two_div_pi<RealType>()/inv_delta2);
+
+ return variance;
+ }
+
+ namespace detail
+ {
+ /*
+ TODO No closed expression for mode, so use max of pdf.
+ */
+
+ template <class RealType, class Policy>
+ inline RealType mode_fallback(const skew_normal_distribution<RealType, Policy>& dist)
+ { // mode.
+ static const char* function = "mode(skew_normal_distribution<%1%> const&)";
+ const RealType scale = dist.scale();
+ const RealType location = dist.location();
+ const RealType shape = dist.shape();
+
+ RealType result;
+ if(!detail::check_scale(
+ function,
+ scale, &result, Policy())
+ ||
+ !detail::check_skew_normal_shape(
+ function,
+ shape,
+ &result,
+ Policy()))
+ return result;
+
+ if( shape == 0 )
+ {
+ return location;
+ }
+
+ if( shape < 0 )
+ {
+ skew_normal_distribution<RealType, Policy> D(0, 1, -shape);
+ result = mode_fallback(D);
+ result = location-scale*result;
+ return result;
+ }
+
+ BOOST_MATH_STD_USING
+
+ // 21 elements
+ static const RealType shapes[] = {
+ 0.0,
+ 1.000000000000000e-004,
+ 2.069138081114790e-004,
+ 4.281332398719396e-004,
+ 8.858667904100824e-004,
+ 1.832980710832436e-003,
+ 3.792690190732250e-003,
+ 7.847599703514606e-003,
+ 1.623776739188722e-002,
+ 3.359818286283781e-002,
+ 6.951927961775606e-002,
+ 1.438449888287663e-001,
+ 2.976351441631319e-001,
+ 6.158482110660261e-001,
+ 1.274274985703135e+000,
+ 2.636650898730361e+000,
+ 5.455594781168514e+000,
+ 1.128837891684688e+001,
+ 2.335721469090121e+001,
+ 4.832930238571753e+001,
+ 1.000000000000000e+002};
+
+ // 21 elements
+ static const RealType guess[] = {
+ 0.0,
+ 5.000050000525391e-005,
+ 1.500015000148736e-004,
+ 3.500035000350010e-004,
+ 7.500075000752560e-004,
+ 1.450014500145258e-003,
+ 3.050030500305390e-003,
+ 6.250062500624765e-003,
+ 1.295012950129504e-002,
+ 2.675026750267495e-002,
+ 5.525055250552491e-002,
+ 1.132511325113255e-001,
+ 2.249522495224952e-001,
+ 3.992539925399257e-001,
+ 5.353553535535358e-001,
+ 4.954549545495457e-001,
+ 3.524535245352451e-001,
+ 2.182521825218249e-001,
+ 1.256512565125654e-001,
+ 6.945069450694508e-002,
+ 3.735037350373460e-002
+ };
+
+ const RealType* result_ptr = std::lower_bound(shapes, shapes+21, shape);
+
+ typedef typename std::iterator_traits<RealType*>::difference_type diff_type;
+
+ const diff_type d = std::distance(shapes, result_ptr);
+
+ BOOST_ASSERT(d > static_cast<diff_type>(0));
+
+ // refine
+ if(d < static_cast<diff_type>(21)) // shape smaller 100
+ {
+ result = guess[d-static_cast<diff_type>(1)]
+ + (guess[d]-guess[d-static_cast<diff_type>(1)])/(shapes[d]-shapes[d-static_cast<diff_type>(1)])
+ * (shape-shapes[d-static_cast<diff_type>(1)]);
+ }
+ else // shape greater 100
+ {
+ result = 1e-4;
+ }
+
+ skew_normal_distribution<RealType, Policy> helper(0, 1, shape);
+
+ result = detail::generic_find_mode_01(helper, result, function);
+
+ result = result*scale + location;
+
+ return result;
+ } // mode_fallback
+
+
+ /*
+ * TODO No closed expression for mode, so use f'(x) = 0
+ */
+ template <class RealType, class Policy>
+ struct skew_normal_mode_functor
+ {
+ skew_normal_mode_functor(const boost::math::skew_normal_distribution<RealType, Policy> dist)
+ : distribution(dist)
+ {
+ }
+
+ boost::math::tuple<RealType, RealType> operator()(RealType const& x)
+ {
+ normal_distribution<RealType, Policy> std_normal;
+ const RealType shape = distribution.shape();
+ const RealType pdf_x = pdf(distribution, x);
+ const RealType normpdf_x = pdf(std_normal, x);
+ const RealType normpdf_ax = pdf(std_normal, x*shape);
+ RealType fx = static_cast<RealType>(2)*shape*normpdf_ax*normpdf_x - x*pdf_x;
+ RealType dx = static_cast<RealType>(2)*shape*x*normpdf_x*normpdf_ax*(static_cast<RealType>(1) + shape*shape) + pdf_x + x*fx;
+ // return both function evaluation difference f(x) and 1st derivative f'(x).
+ return boost::math::make_tuple(fx, -dx);
+ }
+ private:
+ const boost::math::skew_normal_distribution<RealType, Policy> distribution;
+ };
+
+ } // namespace detail
+
+ template <class RealType, class Policy>
+ inline RealType mode(const skew_normal_distribution<RealType, Policy>& dist)
+ {
+ const RealType scale = dist.scale();
+ const RealType location = dist.location();
+ const RealType shape = dist.shape();
+
+ static const char* function = "boost::math::mode(const skew_normal_distribution<%1%>&, %1%)";
+
+ RealType result = 0;
+ if(false == detail::check_scale(function, scale, &result, Policy()))
+ return result;
+ if(false == detail::check_location(function, location, &result, Policy()))
+ return result;
+ if(false == detail::check_skew_normal_shape(function, shape, &result, Policy()))
+ return result;
+
+ if( shape == 0 )
+ {
+ return location;
+ }
+
+ if( shape < 0 )
+ {
+ skew_normal_distribution<RealType, Policy> D(0, 1, -shape);
+ result = mode(D);
+ result = location-scale*result;
+ return result;
+ }
+
+ // 21 elements
+ static const RealType shapes[] = {
+ 0.0,
+ 1.000000000000000e-004,
+ 2.069138081114790e-004,
+ 4.281332398719396e-004,
+ 8.858667904100824e-004,
+ 1.832980710832436e-003,
+ 3.792690190732250e-003,
+ 7.847599703514606e-003,
+ 1.623776739188722e-002,
+ 3.359818286283781e-002,
+ 6.951927961775606e-002,
+ 1.438449888287663e-001,
+ 2.976351441631319e-001,
+ 6.158482110660261e-001,
+ 1.274274985703135e+000,
+ 2.636650898730361e+000,
+ 5.455594781168514e+000,
+ 1.128837891684688e+001,
+ 2.335721469090121e+001,
+ 4.832930238571753e+001,
+ 1.000000000000000e+002};
+
+ // 21 elements
+ static const RealType guess[] = {
+ 0.0,
+ 5.000050000525391e-005,
+ 1.500015000148736e-004,
+ 3.500035000350010e-004,
+ 7.500075000752560e-004,
+ 1.450014500145258e-003,
+ 3.050030500305390e-003,
+ 6.250062500624765e-003,
+ 1.295012950129504e-002,
+ 2.675026750267495e-002,
+ 5.525055250552491e-002,
+ 1.132511325113255e-001,
+ 2.249522495224952e-001,
+ 3.992539925399257e-001,
+ 5.353553535535358e-001,
+ 4.954549545495457e-001,
+ 3.524535245352451e-001,
+ 2.182521825218249e-001,
+ 1.256512565125654e-001,
+ 6.945069450694508e-002,
+ 3.735037350373460e-002
+ };
+
+ const RealType* result_ptr = std::lower_bound(shapes, shapes+21, shape);
+
+ typedef typename std::iterator_traits<RealType*>::difference_type diff_type;
+
+ const diff_type d = std::distance(shapes, result_ptr);
+
+ BOOST_ASSERT(d > static_cast<diff_type>(0));
+
+ // TODO: make the search bounds smarter, depending on the shape parameter
+ RealType search_min = 0; // below zero was caught above
+ RealType search_max = 0.55; // will never go above 0.55
+
+ // refine
+ if(d < static_cast<diff_type>(21)) // shape smaller 100
+ {
+ // it is safe to assume that d > 0, because shape==0.0 is caught earlier
+ result = guess[d-static_cast<diff_type>(1)]
+ + (guess[d]-guess[d-static_cast<diff_type>(1)])/(shapes[d]-shapes[d-static_cast<diff_type>(1)])
+ * (shape-shapes[d-static_cast<diff_type>(1)]);
+ }
+ else // shape greater 100
+ {
+ result = 1e-4;
+ search_max = guess[19]; // set 19 instead of 20 to have a safety margin because the table may not be exact @ shape=100
+ }
+
+ const int get_digits = policies::digits<RealType, Policy>();// get digits from policy,
+ boost::uintmax_t m = policies::get_max_root_iterations<Policy>(); // and max iterations.
+
+ skew_normal_distribution<RealType, Policy> helper(0, 1, shape);
+
+ result = tools::newton_raphson_iterate(detail::skew_normal_mode_functor<RealType, Policy>(helper), result,
+ search_min, search_max, get_digits, m);
+
+ result = result*scale + location;
+
+ return result;
+ }
+
+
+
+ template <class RealType, class Policy>
+ inline RealType skewness(const skew_normal_distribution<RealType, Policy>& dist)
+ {
+ BOOST_MATH_STD_USING // for ADL of std functions
+ using namespace boost::math::constants;
+
+ static const RealType factor = four_minus_pi<RealType>()/static_cast<RealType>(2);
+ const RealType delta = dist.shape() / sqrt(static_cast<RealType>(1)+dist.shape()*dist.shape());
+
+ return factor * pow(root_two_div_pi<RealType>() * delta, 3) /
+ pow(static_cast<RealType>(1)-two_div_pi<RealType>()*delta*delta, static_cast<RealType>(1.5));
+ }
+
+ template <class RealType, class Policy>
+ inline RealType kurtosis(const skew_normal_distribution<RealType, Policy>& dist)
+ {
+ return kurtosis_excess(dist)+static_cast<RealType>(3);
+ }
+
+ template <class RealType, class Policy>
+ inline RealType kurtosis_excess(const skew_normal_distribution<RealType, Policy>& dist)
+ {
+ using namespace boost::math::constants;
+
+ static const RealType factor = pi_minus_three<RealType>()*static_cast<RealType>(2);
+
+ const RealType delta2 = static_cast<RealType>(1) / (static_cast<RealType>(1)+static_cast<RealType>(1)/(dist.shape()*dist.shape()));
+
+ const RealType x = static_cast<RealType>(1)-two_div_pi<RealType>()*delta2;
+ const RealType y = two_div_pi<RealType>() * delta2;
+
+ return factor * y*y / (x*x);
+ }
+
+ namespace detail
+ {
+
+ template <class RealType, class Policy>
+ struct skew_normal_quantile_functor
+ {
+ skew_normal_quantile_functor(const boost::math::skew_normal_distribution<RealType, Policy> dist, RealType const& p)
+ : distribution(dist), prob(p)
+ {
+ }
+
+ boost::math::tuple<RealType, RealType> operator()(RealType const& x)
+ {
+ RealType c = cdf(distribution, x);
+ RealType fx = c - prob; // Difference cdf - value - to minimize.
+ RealType dx = pdf(distribution, x); // pdf is 1st derivative.
+ // return both function evaluation difference f(x) and 1st derivative f'(x).
+ return boost::math::make_tuple(fx, dx);
+ }
+ private:
+ const boost::math::skew_normal_distribution<RealType, Policy> distribution;
+ RealType prob;
+ };
+
+ } // namespace detail
+
+ template <class RealType, class Policy>
+ inline RealType quantile(const skew_normal_distribution<RealType, Policy>& dist, const RealType& p)
+ {
+ const RealType scale = dist.scale();
+ const RealType location = dist.location();
+ const RealType shape = dist.shape();
+
+ static const char* function = "boost::math::quantile(const skew_normal_distribution<%1%>&, %1%)";
+
+ RealType result = 0;
+ if(false == detail::check_scale(function, scale, &result, Policy()))
+ return result;
+ if(false == detail::check_location(function, location, &result, Policy()))
+ return result;
+ if(false == detail::check_skew_normal_shape(function, shape, &result, Policy()))
+ return result;
+ if(false == detail::check_probability(function, p, &result, Policy()))
+ return result;
+
+ // compute initial guess via Cornish-Fisher expansion
+ RealType x = -boost::math::erfc_inv(2 * p, Policy()) * constants::root_two<RealType>();
+
+ // avoid unnecessary computations if there is no skew
+ if(shape != 0)
+ {
+ const RealType skew = skewness(dist);
+ const RealType exk = kurtosis_excess(dist);
+
+ x = x + (x*x-static_cast<RealType>(1))*skew/static_cast<RealType>(6)
+ + x*(x*x-static_cast<RealType>(3))*exk/static_cast<RealType>(24)
+ - x*(static_cast<RealType>(2)*x*x-static_cast<RealType>(5))*skew*skew/static_cast<RealType>(36);
+ } // if(shape != 0)
+
+ result = standard_deviation(dist)*x+mean(dist);
+
+ // handle special case of non-skew normal distribution
+ if(shape == 0)
+ return result;
+
+ // refine the result by numerically searching the root of (p-cdf)
+
+ const RealType search_min = range(dist).first;
+ const RealType search_max = range(dist).second;
+
+ const int get_digits = policies::digits<RealType, Policy>();// get digits from policy,
+ boost::uintmax_t m = policies::get_max_root_iterations<Policy>(); // and max iterations.
+
+ result = tools::newton_raphson_iterate(detail::skew_normal_quantile_functor<RealType, Policy>(dist, p), result,
+ search_min, search_max, get_digits, m);
+
+ return result;
+ } // quantile
+
+ template <class RealType, class Policy>
+ inline RealType quantile(const complemented2_type<skew_normal_distribution<RealType, Policy>, RealType>& c)
+ {
+ const RealType scale = c.dist.scale();
+ const RealType location = c.dist.location();
+ const RealType shape = c.dist.shape();
+
+ static const char* function = "boost::math::quantile(const complement(skew_normal_distribution<%1%>&), %1%)";
+ RealType result = 0;
+ if(false == detail::check_scale(function, scale, &result, Policy()))
+ return result;
+ if(false == detail::check_location(function, location, &result, Policy()))
+ return result;
+ if(false == detail::check_skew_normal_shape(function, shape, &result, Policy()))
+ return result;
+ RealType q = c.param;
+ if(false == detail::check_probability(function, q, &result, Policy()))
+ return result;
+
+ skew_normal_distribution<RealType, Policy> D(-location, scale, -shape);
+
+ result = -quantile(D, q);
+
+ return result;
+ } // quantile
+
+
+} // namespace math
+} // namespace boost
+
+// This include must be at the end, *after* the accessors
+// for this distribution have been defined, in order to
+// keep compilers that support two-phase lookup happy.
+#include <boost/math/distributions/detail/derived_accessors.hpp>
+
+#endif // BOOST_STATS_SKEW_NORMAL_HPP
+
+
diff --git a/boost/math/distributions/triangular.hpp b/boost/math/distributions/triangular.hpp
index ee607e1776..735d20235c 100644
--- a/boost/math/distributions/triangular.hpp
+++ b/boost/math/distributions/triangular.hpp
@@ -470,7 +470,7 @@ namespace boost{ namespace math
RealType mode = dist.mode();
RealType upper = dist.upper();
RealType result = 0; // of checks.
- if(false == detail::check_triangular(function,lower, mode, upper, &result, Policy()))
+ if(false == boost::math::detail::check_triangular(function,lower, mode, upper, &result, Policy()))
{
return result;
}
diff --git a/boost/math/policies/error_handling.hpp b/boost/math/policies/error_handling.hpp
index 8e1b96d6f5..d4306c6006 100644
--- a/boost/math/policies/error_handling.hpp
+++ b/boost/math/policies/error_handling.hpp
@@ -12,6 +12,7 @@
#include <iomanip>
#include <string>
#include <cerrno>
+#include <complex>
#include <boost/config/no_tr1/cmath.hpp>
#include <stdexcept>
#include <boost/math/tools/config.hpp>
@@ -576,6 +577,15 @@ inline bool check_overflow(T val, R* result, const char* function, const Policy&
return false;
}
template <class R, class T, class Policy>
+inline bool check_overflow(std::complex<T> val, R* result, const char* function, const Policy& pol)
+{
+ typedef typename R::value_type r_type;
+ r_type re, im;
+ bool r = check_overflow<r_type>(val.real(), &re, function, pol) || check_overflow<r_type>(val.imag(), &im, function, pol);
+ *result = R(re, im);
+ return r;
+}
+template <class R, class T, class Policy>
inline bool check_underflow(T val, R* result, const char* function, const Policy& pol)
{
if((val != 0) && (static_cast<R>(val) == 0))
@@ -586,6 +596,15 @@ inline bool check_underflow(T val, R* result, const char* function, const Policy
return false;
}
template <class R, class T, class Policy>
+inline bool check_underflow(std::complex<T> val, R* result, const char* function, const Policy& pol)
+{
+ typedef typename R::value_type r_type;
+ r_type re, im;
+ bool r = check_underflow<r_type>(val.real(), &re, function, pol) || check_underflow<r_type>(val.imag(), &im, function, pol);
+ *result = R(re, im);
+ return r;
+}
+template <class R, class T, class Policy>
inline bool check_denorm(T val, R* result, const char* function, const Policy& pol)
{
BOOST_MATH_STD_USING
@@ -596,14 +615,29 @@ inline bool check_denorm(T val, R* result, const char* function, const Policy& p
}
return false;
}
+template <class R, class T, class Policy>
+inline bool check_denorm(std::complex<T> val, R* result, const char* function, const Policy& pol)
+{
+ typedef typename R::value_type r_type;
+ r_type re, im;
+ bool r = check_denorm<r_type>(val.real(), &re, function, pol) || check_denorm<r_type>(val.imag(), &im, function, pol);
+ *result = R(re, im);
+ return r;
+}
// Default instantiations with ignore_error policy.
template <class R, class T>
inline bool check_overflow(T /* val */, R* /* result */, const char* /* function */, const overflow_error<ignore_error>&){ return false; }
template <class R, class T>
+inline bool check_overflow(std::complex<T> /* val */, R* /* result */, const char* /* function */, const overflow_error<ignore_error>&){ return false; }
+template <class R, class T>
inline bool check_underflow(T /* val */, R* /* result */, const char* /* function */, const underflow_error<ignore_error>&){ return false; }
template <class R, class T>
+inline bool check_underflow(std::complex<T> /* val */, R* /* result */, const char* /* function */, const underflow_error<ignore_error>&){ return false; }
+template <class R, class T>
inline bool check_denorm(T /* val */, R* /* result*/, const char* /* function */, const denorm_error<ignore_error>&){ return false; }
+template <class R, class T>
+inline bool check_denorm(std::complex<T> /* val */, R* /* result*/, const char* /* function */, const denorm_error<ignore_error>&){ return false; }
} // namespace detail
diff --git a/boost/math/special_functions.hpp b/boost/math/special_functions.hpp
index f31a0694c9..00fe866f4a 100644
--- a/boost/math/special_functions.hpp
+++ b/boost/math/special_functions.hpp
@@ -55,5 +55,7 @@
#include <boost/math/special_functions/trunc.hpp>
#include <boost/math/special_functions/pow.hpp>
#include <boost/math/special_functions/next.hpp>
+#include <boost/math/special_functions/owens_t.hpp>
+#include <boost/math/special_functions/hankel.hpp>
#endif // BOOST_MATH_SPECIAL_FUNCTIONS_HPP
diff --git a/boost/math/special_functions/detail/bessel_i0.hpp b/boost/math/special_functions/detail/bessel_i0.hpp
index 2c129facc7..7dc65d1a1b 100644
--- a/boost/math/special_functions/detail/bessel_i0.hpp
+++ b/boost/math/special_functions/detail/bessel_i0.hpp
@@ -21,8 +21,38 @@
namespace boost { namespace math { namespace detail{
template <typename T>
+T bessel_i0(T x);
+
+template <class T>
+struct bessel_i0_initializer
+{
+ struct init
+ {
+ init()
+ {
+ do_init();
+ }
+ static void do_init()
+ {
+ bessel_i0(T(1));
+ }
+ void force_instantiate()const{}
+ };
+ static const init initializer;
+ static void force_instantiate()
+ {
+ initializer.force_instantiate();
+ }
+};
+
+template <class T>
+const typename bessel_i0_initializer<T>::init bessel_i0_initializer<T>::initializer;
+
+template <typename T>
T bessel_i0(T x)
{
+ bessel_i0_initializer<T>::force_instantiate();
+
static const T P1[] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 64, -2.2335582639474375249e+15)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 64, -5.5050369673018427753e+14)),
diff --git a/boost/math/special_functions/detail/bessel_i1.hpp b/boost/math/special_functions/detail/bessel_i1.hpp
index aa4596cfd4..47f1b79883 100644
--- a/boost/math/special_functions/detail/bessel_i1.hpp
+++ b/boost/math/special_functions/detail/bessel_i1.hpp
@@ -21,8 +21,39 @@
namespace boost { namespace math { namespace detail{
template <typename T>
+T bessel_i1(T x);
+
+template <class T>
+struct bessel_i1_initializer
+{
+ struct init
+ {
+ init()
+ {
+ do_init();
+ }
+ static void do_init()
+ {
+ bessel_i1(T(1));
+ }
+ void force_instantiate()const{}
+ };
+ static const init initializer;
+ static void force_instantiate()
+ {
+ initializer.force_instantiate();
+ }
+};
+
+template <class T>
+const typename bessel_i1_initializer<T>::init bessel_i1_initializer<T>::initializer;
+
+template <typename T>
T bessel_i1(T x)
{
+
+ bessel_i1_initializer<T>::force_instantiate();
+
static const T P1[] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 64, -1.4577180278143463643e+15)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 64, -1.7732037840791591320e+14)),
diff --git a/boost/math/special_functions/detail/bessel_j0.hpp b/boost/math/special_functions/detail/bessel_j0.hpp
index ee25d46f61..a07052d73e 100644
--- a/boost/math/special_functions/detail/bessel_j0.hpp
+++ b/boost/math/special_functions/detail/bessel_j0.hpp
@@ -22,8 +22,38 @@
namespace boost { namespace math { namespace detail{
template <typename T>
+T bessel_j0(T x);
+
+template <class T>
+struct bessel_j0_initializer
+{
+ struct init
+ {
+ init()
+ {
+ do_init();
+ }
+ static void do_init()
+ {
+ bessel_j0(T(1));
+ }
+ void force_instantiate()const{}
+ };
+ static const init initializer;
+ static void force_instantiate()
+ {
+ initializer.force_instantiate();
+ }
+};
+
+template <class T>
+const typename bessel_j0_initializer<T>::init bessel_j0_initializer<T>::initializer;
+
+template <typename T>
T bessel_j0(T x)
{
+ bessel_j0_initializer<T>::force_instantiate();
+
static const T P1[] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 64, -4.1298668500990866786e+11)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 64, 2.7282507878605942706e+10)),
diff --git a/boost/math/special_functions/detail/bessel_j1.hpp b/boost/math/special_functions/detail/bessel_j1.hpp
index 3db2503ff6..09d862c240 100644
--- a/boost/math/special_functions/detail/bessel_j1.hpp
+++ b/boost/math/special_functions/detail/bessel_j1.hpp
@@ -22,8 +22,38 @@
namespace boost { namespace math{ namespace detail{
template <typename T>
+T bessel_j1(T x);
+
+template <class T>
+struct bessel_j1_initializer
+{
+ struct init
+ {
+ init()
+ {
+ do_init();
+ }
+ static void do_init()
+ {
+ bessel_j1(T(1));
+ }
+ void force_instantiate()const{}
+ };
+ static const init initializer;
+ static void force_instantiate()
+ {
+ initializer.force_instantiate();
+ }
+};
+
+template <class T>
+const typename bessel_j1_initializer<T>::init bessel_j1_initializer<T>::initializer;
+
+template <typename T>
T bessel_j1(T x)
{
+ bessel_j1_initializer<T>::force_instantiate();
+
static const T P1[] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 64, -1.4258509801366645672e+11)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 64, 6.6781041261492395835e+09)),
diff --git a/boost/math/special_functions/detail/bessel_jy.hpp b/boost/math/special_functions/detail/bessel_jy.hpp
index 19f951ab70..d60dda2d41 100644
--- a/boost/math/special_functions/detail/bessel_jy.hpp
+++ b/boost/math/special_functions/detail/bessel_jy.hpp
@@ -215,8 +215,6 @@ int CF2_jy(T v, T x, T* p, T* q, const Policy& pol)
Cr = br + a / temp;
Dr = br;
Di = bi;
- //std::cout << "C = " << Cr << " " << Ci << std::endl;
- //std::cout << "D = " << Dr << " " << Di << std::endl;
if (fabs(Cr) + fabs(Ci) < tiny) { Cr = tiny; }
if (fabs(Dr) + fabs(Di) < tiny) { Dr = tiny; }
temp = Dr * Dr + Di * Di;
@@ -227,7 +225,6 @@ int CF2_jy(T v, T x, T* p, T* q, const Policy& pol)
temp = fr;
fr = temp * delta_r - fi * delta_i;
fi = temp * delta_i + fi * delta_r;
- //std::cout << fr << " " << fi << std::endl;
for (k = 2; k < policies::get_max_series_iterations<Policy>(); k++)
{
a = k - 0.5f;
@@ -239,8 +236,6 @@ int CF2_jy(T v, T x, T* p, T* q, const Policy& pol)
Ci = bi - a * Ci / temp;
Dr = br + a * Dr;
Di = bi + a * Di;
- //std::cout << "C = " << Cr << " " << Ci << std::endl;
- //std::cout << "D = " << Dr << " " << Di << std::endl;
if (fabs(Cr) + fabs(Ci) < tiny) { Cr = tiny; }
if (fabs(Dr) + fabs(Di) < tiny) { Dr = tiny; }
temp = Dr * Dr + Di * Di;
@@ -253,7 +248,6 @@ int CF2_jy(T v, T x, T* p, T* q, const Policy& pol)
fi = temp * delta_i + fi * delta_r;
if (fabs(delta_r - 1) + fabs(delta_i) < tolerance)
break;
- //std::cout << fr << " " << fi << std::endl;
}
policies::check_series_iterations<T>("boost::math::bessel_jy<%1%>(%1%,%1%) in CF2_jy", k, pol);
*p = fr;
@@ -491,6 +485,16 @@ int bessel_jy(T v, T x, T* J, T* Y, int kind, const Policy& pol)
CF2_jy(u, x, &p, &q, pol); // continued fraction CF2_jy
T t = u / x - fu; // t = J'/J
gamma = (p - t) / q;
+ //
+ // We can't allow gamma to cancel out to zero competely as it messes up
+ // the subsequent logic. So pretend that one bit didn't cancel out
+ // and set to a suitably small value. The only test case we've been able to
+ // find for this, is when v = 8.5 and x = 4*PI.
+ //
+ if(gamma == 0)
+ {
+ gamma = u * tools::epsilon<T>() / x;
+ }
Ju = sign(current) * sqrt(W / (q + gamma * (p - t)));
Jv = Ju * ratio; // normalization
diff --git a/boost/math/special_functions/detail/bessel_k0.hpp b/boost/math/special_functions/detail/bessel_k0.hpp
index 81407dab10..e209168e87 100644
--- a/boost/math/special_functions/detail/bessel_k0.hpp
+++ b/boost/math/special_functions/detail/bessel_k0.hpp
@@ -22,10 +22,40 @@
namespace boost { namespace math { namespace detail{
template <typename T, typename Policy>
+T bessel_k0(T x, const Policy&);
+
+template <class T, class Policy>
+struct bessel_k0_initializer
+{
+ struct init
+ {
+ init()
+ {
+ do_init();
+ }
+ static void do_init()
+ {
+ bessel_k0(T(1), Policy());
+ }
+ void force_instantiate()const{}
+ };
+ static const init initializer;
+ static void force_instantiate()
+ {
+ initializer.force_instantiate();
+ }
+};
+
+template <class T, class Policy>
+const typename bessel_k0_initializer<T, Policy>::init bessel_k0_initializer<T, Policy>::initializer;
+
+template <typename T, typename Policy>
T bessel_k0(T x, const Policy& pol)
{
BOOST_MATH_INSTRUMENT_CODE(x);
+ bessel_k0_initializer<T, Policy>::force_instantiate();
+
static const T P1[] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 64, 2.4708152720399552679e+03)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 64, 5.9169059852270512312e+03)),
diff --git a/boost/math/special_functions/detail/bessel_k1.hpp b/boost/math/special_functions/detail/bessel_k1.hpp
index 225209f7ba..0d17cd3057 100644
--- a/boost/math/special_functions/detail/bessel_k1.hpp
+++ b/boost/math/special_functions/detail/bessel_k1.hpp
@@ -22,8 +22,38 @@
namespace boost { namespace math { namespace detail{
template <typename T, typename Policy>
+T bessel_k1(T x, const Policy&);
+
+template <class T, class Policy>
+struct bessel_k1_initializer
+{
+ struct init
+ {
+ init()
+ {
+ do_init();
+ }
+ static void do_init()
+ {
+ bessel_k1(T(1), Policy());
+ }
+ void force_instantiate()const{}
+ };
+ static const init initializer;
+ static void force_instantiate()
+ {
+ initializer.force_instantiate();
+ }
+};
+
+template <class T, class Policy>
+const typename bessel_k1_initializer<T, Policy>::init bessel_k1_initializer<T, Policy>::initializer;
+
+template <typename T, typename Policy>
T bessel_k1(T x, const Policy& pol)
{
+ bessel_k1_initializer<T, Policy>::force_instantiate();
+
static const T P1[] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 64, -2.2149374878243304548e+06)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 64, 7.1938920065420586101e+05)),
diff --git a/boost/math/special_functions/detail/bessel_y0.hpp b/boost/math/special_functions/detail/bessel_y0.hpp
index e23f861bf0..289bda5f18 100644
--- a/boost/math/special_functions/detail/bessel_y0.hpp
+++ b/boost/math/special_functions/detail/bessel_y0.hpp
@@ -24,8 +24,38 @@
namespace boost { namespace math { namespace detail{
template <typename T, typename Policy>
+T bessel_y0(T x, const Policy&);
+
+template <class T, class Policy>
+struct bessel_y0_initializer
+{
+ struct init
+ {
+ init()
+ {
+ do_init();
+ }
+ static void do_init()
+ {
+ bessel_y0(T(1), Policy());
+ }
+ void force_instantiate()const{}
+ };
+ static const init initializer;
+ static void force_instantiate()
+ {
+ initializer.force_instantiate();
+ }
+};
+
+template <class T, class Policy>
+const typename bessel_y0_initializer<T, Policy>::init bessel_y0_initializer<T, Policy>::initializer;
+
+template <typename T, typename Policy>
T bessel_y0(T x, const Policy& pol)
{
+ bessel_y0_initializer<T, Policy>::force_instantiate();
+
static const T P1[] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 64, 1.0723538782003176831e+11)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 64, -8.3716255451260504098e+09)),
diff --git a/boost/math/special_functions/detail/bessel_y1.hpp b/boost/math/special_functions/detail/bessel_y1.hpp
index b85e7011ea..caf09ffd26 100644
--- a/boost/math/special_functions/detail/bessel_y1.hpp
+++ b/boost/math/special_functions/detail/bessel_y1.hpp
@@ -24,8 +24,38 @@
namespace boost { namespace math { namespace detail{
template <typename T, typename Policy>
+T bessel_y1(T x, const Policy&);
+
+template <class T, class Policy>
+struct bessel_y1_initializer
+{
+ struct init
+ {
+ init()
+ {
+ do_init();
+ }
+ static void do_init()
+ {
+ bessel_y1(T(1), Policy());
+ }
+ void force_instantiate()const{}
+ };
+ static const init initializer;
+ static void force_instantiate()
+ {
+ initializer.force_instantiate();
+ }
+};
+
+template <class T, class Policy>
+const typename bessel_y1_initializer<T, Policy>::init bessel_y1_initializer<T, Policy>::initializer;
+
+template <typename T, typename Policy>
T bessel_y1(T x, const Policy& pol)
{
+ bessel_y1_initializer<T, Policy>::force_instantiate();
+
static const T P1[] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 64, 4.0535726612579544093e+13)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 64, 5.4708611716525426053e+12)),
diff --git a/boost/math/special_functions/detail/erf_inv.hpp b/boost/math/special_functions/detail/erf_inv.hpp
index f2f625f991..d51db9d52f 100644
--- a/boost/math/special_functions/detail/erf_inv.hpp
+++ b/boost/math/special_functions/detail/erf_inv.hpp
@@ -322,12 +322,47 @@ T erf_inv_imp(const T& p, const T& q, const Policy& pol, const boost::mpl::int_<
return result;
}
+template <class T, class Policy>
+struct erf_inv_initializer
+{
+ struct init
+ {
+ init()
+ {
+ do_init();
+ }
+ static void do_init()
+ {
+ boost::math::erf_inv(static_cast<T>(0.25), Policy());
+ boost::math::erf_inv(static_cast<T>(0.55), Policy());
+ boost::math::erf_inv(static_cast<T>(0.95), Policy());
+ boost::math::erfc_inv(static_cast<T>(1e-15), Policy());
+ if(static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 64, 1e-130)) != 0)
+ boost::math::erfc_inv(static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 64, 1e-130)), Policy());
+ if(static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 64, 1e-800)) != 0)
+ boost::math::erfc_inv(static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 64, 1e-800)), Policy());
+ if(static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 64, 1e-900)) != 0)
+ boost::math::erfc_inv(static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 64, 1e-900)), Policy());
+ }
+ void force_instantiate()const{}
+ };
+ static const init initializer;
+ static void force_instantiate()
+ {
+ initializer.force_instantiate();
+ }
+};
+
+template <class T, class Policy>
+const typename erf_inv_initializer<T, Policy>::init erf_inv_initializer<T, Policy>::initializer;
+
} // namespace detail
template <class T, class Policy>
typename tools::promote_args<T>::type erfc_inv(T z, const Policy& pol)
{
typedef typename tools::promote_args<T>::type result_type;
+
//
// Begin by testing for domain errors, and other special cases:
//
@@ -378,6 +413,8 @@ typename tools::promote_args<T>::type erfc_inv(T z, const Policy& pol)
policies::discrete_quantile<>,
policies::assert_undefined<> >::type forwarding_policy;
+ detail::erf_inv_initializer<eval_type, forwarding_policy>::force_instantiate();
+
//
// And get the result, negating where required:
//
@@ -389,6 +426,7 @@ template <class T, class Policy>
typename tools::promote_args<T>::type erf_inv(T z, const Policy& pol)
{
typedef typename tools::promote_args<T>::type result_type;
+
//
// Begin by testing for domain errors, and other special cases:
//
@@ -445,6 +483,8 @@ typename tools::promote_args<T>::type erf_inv(T z, const Policy& pol)
// precision internally if it's appropriate:
//
typedef typename policies::evaluation<result_type, Policy>::type eval_type;
+
+ detail::erf_inv_initializer<eval_type, forwarding_policy>::force_instantiate();
//
// And get the result, negating where required:
//
diff --git a/boost/math/special_functions/detail/iconv.hpp b/boost/math/special_functions/detail/iconv.hpp
index 8916eaed1d..4256ffcc88 100644
--- a/boost/math/special_functions/detail/iconv.hpp
+++ b/boost/math/special_functions/detail/iconv.hpp
@@ -25,7 +25,7 @@ template <class T, class Policy>
inline int iconv_imp(T v, Policy const& pol, mpl::false_ const&)
{
BOOST_MATH_STD_USING
- return iround(v);
+ return iround(v, pol);
}
template <class T, class Policy>
diff --git a/boost/math/special_functions/detail/igamma_large.hpp b/boost/math/special_functions/detail/igamma_large.hpp
index f9a810c489..eb3d4ba93e 100644
--- a/boost/math/special_functions/detail/igamma_large.hpp
+++ b/boost/math/special_functions/detail/igamma_large.hpp
@@ -759,7 +759,6 @@ T igamma_temme_large(T a, T x, const Policy& pol, mpl::int_<113> const *)
return result;
}
-
} // namespace detail
} // namespace math
} // namespace math
diff --git a/boost/math/special_functions/detail/lanczos_sse2.hpp b/boost/math/special_functions/detail/lanczos_sse2.hpp
index 6a3f3e5347..f8846bf376 100644
--- a/boost/math/special_functions/detail/lanczos_sse2.hpp
+++ b/boost/math/special_functions/detail/lanczos_sse2.hpp
@@ -13,7 +13,7 @@
#include <emmintrin.h>
#if defined(__GNUC__) || defined(__PGI)
-#define ALIGN16 __attribute__((aligned(16)))
+#define ALIGN16 __attribute__((__aligned__(16)))
#else
#define ALIGN16 __declspec(align(16))
#endif
@@ -194,8 +194,11 @@ inline double lanczos13m53::lanczos_sum_expG_scaled<double>(const double& x)
} // namespace math
} // namespace boost
+#undef ALIGN16
+
#endif // BOOST_MATH_SPECIAL_FUNCTIONS_LANCZOS
+
diff --git a/boost/math/special_functions/detail/lgamma_small.hpp b/boost/math/special_functions/detail/lgamma_small.hpp
index 526a573583..ec28ed2adf 100644
--- a/boost/math/special_functions/detail/lgamma_small.hpp
+++ b/boost/math/special_functions/detail/lgamma_small.hpp
@@ -15,6 +15,14 @@
namespace boost{ namespace math{ namespace detail{
//
+// These need forward declaring to keep GCC happy:
+//
+template <class T, class Policy, class Lanczos>
+T gamma_imp(T z, const Policy& pol, const Lanczos& l);
+template <class T, class Policy>
+T gamma_imp(T z, const Policy& pol, const lanczos::undefined_lanczos& l);
+
+//
// lgamma for small arguments:
//
template <class T, class Policy, class Lanczos>
diff --git a/boost/math/special_functions/digamma.hpp b/boost/math/special_functions/digamma.hpp
index 0dbddc77e2..1268b64dc9 100644
--- a/boost/math/special_functions/digamma.hpp
+++ b/boost/math/special_functions/digamma.hpp
@@ -407,6 +407,31 @@ T digamma_imp(T x, const Tag* t, const Policy& pol)
return result;
}
+//
+// Initializer: ensure all our constants are initialized prior to the first call of main:
+//
+template <class T, class Policy>
+struct digamma_initializer
+{
+ struct init
+ {
+ init()
+ {
+ boost::math::digamma(T(1.5), Policy());
+ boost::math::digamma(T(500), Policy());
+ }
+ void force_instantiate()const{}
+ };
+ static const init initializer;
+ static void force_instantiate()
+ {
+ initializer.force_instantiate();
+ }
+};
+
+template <class T, class Policy>
+const typename digamma_initializer<T, Policy>::init digamma_initializer<T, Policy>::initializer;
+
} // namespace detail
template <class T, class Policy>
@@ -433,6 +458,9 @@ inline typename tools::promote_args<T>::type
>::type
>::type tag_type;
+ // Force initialization of constants:
+ detail::digamma_initializer<result_type, Policy>::force_instantiate();
+
return policies::checked_narrowing_cast<result_type, Policy>(detail::digamma_imp(
static_cast<value_type>(x),
static_cast<const tag_type*>(0), pol), "boost::math::digamma<%1%>(%1%)");
diff --git a/boost/math/special_functions/erf.hpp b/boost/math/special_functions/erf.hpp
index 1abb59177f..e67332a61a 100644
--- a/boost/math/special_functions/erf.hpp
+++ b/boost/math/special_functions/erf.hpp
@@ -978,6 +978,59 @@ T erf_imp(T z, bool invert, const Policy& pol, const mpl::int_<113>& t)
return result;
} // template <class T, class Lanczos>T erf_imp(T z, bool invert, const Lanczos& l, const mpl::int_<113>& t)
+template <class T, class Policy, class tag>
+struct erf_initializer
+{
+ struct init
+ {
+ init()
+ {
+ do_init(tag());
+ }
+ static void do_init(const mpl::int_<0>&){}
+ static void do_init(const mpl::int_<53>&)
+ {
+ boost::math::erf(static_cast<T>(1e-12), Policy());
+ boost::math::erf(static_cast<T>(0.25), Policy());
+ boost::math::erf(static_cast<T>(1.25), Policy());
+ boost::math::erf(static_cast<T>(2.25), Policy());
+ boost::math::erf(static_cast<T>(4.25), Policy());
+ boost::math::erf(static_cast<T>(5.25), Policy());
+ }
+ static void do_init(const mpl::int_<64>&)
+ {
+ boost::math::erf(static_cast<T>(1e-12), Policy());
+ boost::math::erf(static_cast<T>(0.25), Policy());
+ boost::math::erf(static_cast<T>(1.25), Policy());
+ boost::math::erf(static_cast<T>(2.25), Policy());
+ boost::math::erf(static_cast<T>(4.25), Policy());
+ boost::math::erf(static_cast<T>(5.25), Policy());
+ }
+ static void do_init(const mpl::int_<113>&)
+ {
+ boost::math::erf(static_cast<T>(1e-22), Policy());
+ boost::math::erf(static_cast<T>(0.25), Policy());
+ boost::math::erf(static_cast<T>(1.25), Policy());
+ boost::math::erf(static_cast<T>(2.125), Policy());
+ boost::math::erf(static_cast<T>(2.75), Policy());
+ boost::math::erf(static_cast<T>(3.25), Policy());
+ boost::math::erf(static_cast<T>(5.25), Policy());
+ boost::math::erf(static_cast<T>(7.25), Policy());
+ boost::math::erf(static_cast<T>(11.25), Policy());
+ boost::math::erf(static_cast<T>(12.5), Policy());
+ }
+ void force_instantiate()const{}
+ };
+ static const init initializer;
+ static void force_instantiate()
+ {
+ initializer.force_instantiate();
+ }
+};
+
+template <class T, class Policy, class tag>
+const typename erf_initializer<T, Policy, tag>::init erf_initializer<T, Policy, tag>::initializer;
+
} // namespace detail
template <class T, class Policy>
@@ -1017,6 +1070,8 @@ inline typename tools::promote_args<T>::type erf(T z, const Policy& /* pol */)
BOOST_MATH_INSTRUMENT_CODE("tag_type = " << typeid(tag_type).name());
+ detail::erf_initializer<value_type, forwarding_policy, tag_type>::force_instantiate(); // Force constants to be initialized before main
+
return policies::checked_narrowing_cast<result_type, forwarding_policy>(detail::erf_imp(
static_cast<value_type>(z),
false,
@@ -1061,6 +1116,8 @@ inline typename tools::promote_args<T>::type erfc(T z, const Policy& /* pol */)
BOOST_MATH_INSTRUMENT_CODE("tag_type = " << typeid(tag_type).name());
+ detail::erf_initializer<value_type, forwarding_policy, tag_type>::force_instantiate(); // Force constants to be initialized before main
+
return policies::checked_narrowing_cast<result_type, forwarding_policy>(detail::erf_imp(
static_cast<value_type>(z),
true,
diff --git a/boost/math/special_functions/expint.hpp b/boost/math/special_functions/expint.hpp
index 06bd78ff48..1c86d282fa 100644
--- a/boost/math/special_functions/expint.hpp
+++ b/boost/math/special_functions/expint.hpp
@@ -1473,6 +1473,94 @@ T expint_i_imp(T z, const Policy& pol, const mpl::int_<113>& tag)
return result;
}
+template <class T, class Policy, class tag>
+struct expint_i_initializer
+{
+ struct init
+ {
+ init()
+ {
+ do_init(tag());
+ }
+ static void do_init(const mpl::int_<0>&){}
+ static void do_init(const mpl::int_<53>&)
+ {
+ boost::math::expint(T(5));
+ boost::math::expint(T(7));
+ boost::math::expint(T(18));
+ boost::math::expint(T(38));
+ boost::math::expint(T(45));
+ }
+ static void do_init(const mpl::int_<64>&)
+ {
+ boost::math::expint(T(5));
+ boost::math::expint(T(7));
+ boost::math::expint(T(18));
+ boost::math::expint(T(38));
+ boost::math::expint(T(45));
+ }
+ static void do_init(const mpl::int_<113>&)
+ {
+ boost::math::expint(T(5));
+ boost::math::expint(T(7));
+ boost::math::expint(T(17));
+ boost::math::expint(T(25));
+ boost::math::expint(T(40));
+ boost::math::expint(T(50));
+ boost::math::expint(T(80));
+ boost::math::expint(T(200));
+ boost::math::expint(T(220));
+ }
+ void force_instantiate()const{}
+ };
+ static const init initializer;
+ static void force_instantiate()
+ {
+ initializer.force_instantiate();
+ }
+};
+
+template <class T, class Policy, class tag>
+const typename expint_i_initializer<T, Policy, tag>::init expint_i_initializer<T, Policy, tag>::initializer;
+
+template <class T, class Policy, class tag>
+struct expint_1_initializer
+{
+ struct init
+ {
+ init()
+ {
+ do_init(tag());
+ }
+ static void do_init(const mpl::int_<0>&){}
+ static void do_init(const mpl::int_<53>&)
+ {
+ boost::math::expint(1, T(0.5));
+ boost::math::expint(1, T(2));
+ }
+ static void do_init(const mpl::int_<64>&)
+ {
+ boost::math::expint(1, T(0.5));
+ boost::math::expint(1, T(2));
+ }
+ static void do_init(const mpl::int_<113>&)
+ {
+ boost::math::expint(1, T(0.5));
+ boost::math::expint(1, T(2));
+ boost::math::expint(1, T(6));
+ }
+ void force_instantiate()const{}
+ };
+ static const init initializer;
+ static void force_instantiate()
+ {
+ initializer.force_instantiate();
+ }
+};
+
+template <class T, class Policy, class tag>
+const typename expint_1_initializer<T, Policy, tag>::init expint_1_initializer<T, Policy, tag>::initializer;
+
template <class T, class Policy>
inline typename tools::promote_args<T>::type
expint_forwarder(T z, const Policy& /*pol*/, mpl::true_ const&)
@@ -1504,6 +1592,8 @@ inline typename tools::promote_args<T>::type
>::type
>::type tag_type;
+ expint_i_initializer<value_type, forwarding_policy, tag_type>::force_instantiate();
+
return policies::checked_narrowing_cast<result_type, forwarding_policy>(detail::expint_i_imp(
static_cast<value_type>(z),
forwarding_policy(),
@@ -1550,6 +1640,8 @@ inline typename tools::promote_args<T>::type
>::type
>::type tag_type;
+ detail::expint_1_initializer<value_type, forwarding_policy, tag_type>::force_instantiate();
+
return policies::checked_narrowing_cast<result_type, forwarding_policy>(detail::expint_imp(
n,
static_cast<value_type>(z),
diff --git a/boost/math/special_functions/expm1.hpp b/boost/math/special_functions/expm1.hpp
index 345220fcee..9ff2541fb1 100644
--- a/boost/math/special_functions/expm1.hpp
+++ b/boost/math/special_functions/expm1.hpp
@@ -65,34 +65,37 @@ namespace detail
expm1_series& operator=(const expm1_series&);
};
-template <class T, bool b = boost::is_pod<T>::value>
-struct expm1_init_on_startup
+template <class T, class Policy, class tag>
+struct expm1_initializer
{
struct init
{
init()
{
- boost::math::expm1(T(0.5f));
+ do_init(tag());
}
- void do_nothing()const{}
+ template <int N>
+ static void do_init(const mpl::int_<N>&){}
+ static void do_init(const mpl::int_<64>&)
+ {
+ expm1(T(0.5));
+ }
+ static void do_init(const mpl::int_<113>&)
+ {
+ expm1(T(0.5));
+ }
+ void force_instantiate()const{}
};
-
- static void do_nothing()
+ static const init initializer;
+ static void force_instantiate()
{
- initializer.do_nothing();
+ initializer.force_instantiate();
}
-
- static const init initializer;
};
-template <class T, bool b>
-const typename expm1_init_on_startup<T, b>::init expm1_init_on_startup<T, b>::initializer;
+template <class T, class Policy, class tag>
+const typename expm1_initializer<T, Policy, tag>::init expm1_initializer<T, Policy, tag>::initializer;
-template <class T>
-struct expm1_init_on_startup<T, true>
-{
- static void do_nothing(){}
-};
//
// Algorithm expm1 is part of C99, but is not yet provided by many compilers.
//
@@ -133,8 +136,6 @@ T expm1_imp(T x, const mpl::int_<53>&, const P& pol)
{
BOOST_MATH_STD_USING
- expm1_init_on_startup<T>::do_nothing();
-
T a = fabs(x);
if(a > T(0.5L))
{
@@ -162,8 +163,6 @@ T expm1_imp(T x, const mpl::int_<64>&, const P& pol)
{
BOOST_MATH_STD_USING
- expm1_init_on_startup<T>::do_nothing();
-
T a = fabs(x);
if(a > T(0.5L))
{
@@ -207,8 +206,6 @@ T expm1_imp(T x, const mpl::int_<113>&, const P& pol)
{
BOOST_MATH_STD_USING
- expm1_init_on_startup<T>::do_nothing();
-
T a = fabs(x);
if(a > T(0.5L))
{
@@ -287,6 +284,8 @@ inline typename tools::promote_args<T>::type expm1(T x, const Policy& /* pol */)
>::type
>::type tag_type;
+ detail::expm1_initializer<value_type, forwarding_policy, tag_type>::force_instantiate();
+
return policies::checked_narrowing_cast<result_type, forwarding_policy>(detail::expm1_imp(
static_cast<value_type>(x),
tag_type(), forwarding_policy()), "boost::math::expm1<%1%>(%1%)");
diff --git a/boost/math/special_functions/gamma.hpp b/boost/math/special_functions/gamma.hpp
index 1ae965f18c..86d15b7f2a 100644
--- a/boost/math/special_functions/gamma.hpp
+++ b/boost/math/special_functions/gamma.hpp
@@ -1258,6 +1258,101 @@ inline typename tools::promote_args<T>::type
return policies::checked_narrowing_cast<result_type, forwarding_policy>(detail::gamma_imp(static_cast<value_type>(z), forwarding_policy(), evaluation_type()), "boost::math::tgamma<%1%>(%1%)");
}
+template <class T, class Policy>
+struct igamma_initializer
+{
+ struct init
+ {
+ init()
+ {
+ typedef typename policies::precision<T, Policy>::type precision_type;
+
+ typedef typename mpl::if_<
+ mpl::or_<mpl::equal_to<precision_type, mpl::int_<0> >,
+ mpl::greater<precision_type, mpl::int_<113> > >,
+ mpl::int_<0>,
+ typename mpl::if_<
+ mpl::less_equal<precision_type, mpl::int_<53> >,
+ mpl::int_<53>,
+ typename mpl::if_<
+ mpl::less_equal<precision_type, mpl::int_<64> >,
+ mpl::int_<64>,
+ mpl::int_<113>
+ >::type
+ >::type
+ >::type tag_type;
+
+ do_init(tag_type());
+ }
+ template <int N>
+ static void do_init(const mpl::int_<N>&)
+ {
+ boost::math::gamma_p(static_cast<T>(400), static_cast<T>(400), Policy());
+ }
+ static void do_init(const mpl::int_<53>&){}
+ void force_instantiate()const{}
+ };
+ static const init initializer;
+ static void force_instantiate()
+ {
+ initializer.force_instantiate();
+ }
+};
+
+template <class T, class Policy>
+const typename igamma_initializer<T, Policy>::init igamma_initializer<T, Policy>::initializer;
+
+template <class T, class Policy>
+struct lgamma_initializer
+{
+ struct init
+ {
+ init()
+ {
+ typedef typename policies::precision<T, Policy>::type precision_type;
+ typedef typename mpl::if_<
+ mpl::and_<
+ mpl::less_equal<precision_type, mpl::int_<64> >,
+ mpl::greater<precision_type, mpl::int_<0> >
+ >,
+ mpl::int_<64>,
+ typename mpl::if_<
+ mpl::and_<
+ mpl::less_equal<precision_type, mpl::int_<113> >,
+ mpl::greater<precision_type, mpl::int_<0> >
+ >,
+ mpl::int_<113>, mpl::int_<0> >::type
+ >::type tag_type;
+ do_init(tag_type());
+ }
+ static void do_init(const mpl::int_<64>&)
+ {
+ boost::math::lgamma(static_cast<T>(2.5), Policy());
+ boost::math::lgamma(static_cast<T>(1.25), Policy());
+ boost::math::lgamma(static_cast<T>(1.75), Policy());
+ }
+ static void do_init(const mpl::int_<113>&)
+ {
+ boost::math::lgamma(static_cast<T>(2.5), Policy());
+ boost::math::lgamma(static_cast<T>(1.25), Policy());
+ boost::math::lgamma(static_cast<T>(1.5), Policy());
+ boost::math::lgamma(static_cast<T>(1.75), Policy());
+ }
+ static void do_init(const mpl::int_<0>&)
+ {
+ }
+ void force_instantiate()const{}
+ };
+ static const init initializer;
+ static void force_instantiate()
+ {
+ initializer.force_instantiate();
+ }
+};
+
+template <class T, class Policy>
+const typename lgamma_initializer<T, Policy>::init lgamma_initializer<T, Policy>::initializer;
+
template <class T1, class T2, class Policy>
inline typename tools::promote_args<T1, T2>::type
tgamma(T1 a, T2 z, const Policy&, const mpl::false_)
@@ -1272,6 +1367,9 @@ inline typename tools::promote_args<T1, T2>::type
policies::promote_double<false>,
policies::discrete_quantile<>,
policies::assert_undefined<> >::type forwarding_policy;
+
+ igamma_initializer<value_type, forwarding_policy>::force_instantiate();
+
return policies::checked_narrowing_cast<result_type, forwarding_policy>(
detail::gamma_incomplete_imp(static_cast<value_type>(a),
static_cast<value_type>(z), false, true,
@@ -1285,6 +1383,7 @@ inline typename tools::promote_args<T1, T2>::type
return tgamma(a, z, policies::policy<>(), tag);
}
+
} // namespace detail
template <class T>
@@ -1308,6 +1407,9 @@ inline typename tools::promote_args<T>::type
policies::promote_double<false>,
policies::discrete_quantile<>,
policies::assert_undefined<> >::type forwarding_policy;
+
+ detail::lgamma_initializer<value_type, forwarding_policy>::force_instantiate();
+
return policies::checked_narrowing_cast<result_type, forwarding_policy>(detail::lgamma_imp(static_cast<value_type>(z), forwarding_policy(), evaluation_type(), sign), "boost::math::lgamma<%1%>(%1%)");
}
@@ -1395,6 +1497,8 @@ inline typename tools::promote_args<T1, T2>::type
policies::discrete_quantile<>,
policies::assert_undefined<> >::type forwarding_policy;
+ detail::igamma_initializer<value_type, forwarding_policy>::force_instantiate();
+
return policies::checked_narrowing_cast<result_type, forwarding_policy>(
detail::gamma_incomplete_imp(static_cast<value_type>(a),
static_cast<value_type>(z), false, false,
@@ -1424,6 +1528,8 @@ inline typename tools::promote_args<T1, T2>::type
policies::discrete_quantile<>,
policies::assert_undefined<> >::type forwarding_policy;
+ detail::igamma_initializer<value_type, forwarding_policy>::force_instantiate();
+
return policies::checked_narrowing_cast<result_type, forwarding_policy>(
detail::gamma_incomplete_imp(static_cast<value_type>(a),
static_cast<value_type>(z), true, true,
@@ -1453,6 +1559,8 @@ inline typename tools::promote_args<T1, T2>::type
policies::discrete_quantile<>,
policies::assert_undefined<> >::type forwarding_policy;
+ detail::igamma_initializer<value_type, forwarding_policy>::force_instantiate();
+
return policies::checked_narrowing_cast<result_type, forwarding_policy>(
detail::gamma_incomplete_imp(static_cast<value_type>(a),
static_cast<value_type>(z), true, false,
diff --git a/boost/math/special_functions/hankel.hpp b/boost/math/special_functions/hankel.hpp
new file mode 100644
index 0000000000..bc3fc2d742
--- /dev/null
+++ b/boost/math/special_functions/hankel.hpp
@@ -0,0 +1,178 @@
+// Copyright John Maddock 2012.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt
+// or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_MATH_HANKEL_HPP
+#define BOOST_MATH_HANKEL_HPP
+
+#include <boost/math/special_functions/bessel.hpp>
+
+namespace boost{ namespace math{
+
+namespace detail{
+
+template <class T, class Policy>
+std::complex<T> hankel_imp(T v, T x, const bessel_no_int_tag&, const Policy& pol, int sign)
+{
+ BOOST_MATH_STD_USING
+ static const char* function = "boost::math::cyl_hankel_1<%1%>(%1%,%1%)";
+
+ if(x < 0)
+ {
+ bool isint_v = floor(v) == v;
+ T j, y;
+ bessel_jy(v, -x, &j, &y, need_j | need_y, pol);
+ std::complex<T> cx(x), cv(v);
+ std::complex<T> j_result, y_result;
+ if(isint_v)
+ {
+ int s = (iround(j) & 1) ? -1 : 1;
+ j_result = j * s;
+ y_result = T(s) * (y - (2 / constants::pi<T>()) * (log(-x) - log(cx)) * j);
+ }
+ else
+ {
+ j_result = pow(cx, v) * pow(-cx, -v) * j;
+ T p1 = pow(-x, v);
+ std::complex<T> p2 = pow(cx, v);
+ y_result = p1 * y / p2
+ + (p2 / p1 - p1 / p2) * j / tan(constants::pi<T>() * v);
+ }
+ // multiply y_result by i:
+ y_result = std::complex<T>(-sign * y_result.imag(), sign * y_result.real());
+ return j_result + y_result;
+ }
+
+ if(x == 0)
+ {
+ if(v == 0)
+ {
+ // J is 1, Y is -INF
+ return std::complex<T>(1, sign * -policies::raise_overflow_error<T>(function, 0, pol));
+ }
+ else
+ {
+ // At least one of J and Y is complex infinity:
+ return std::complex<T>(policies::raise_overflow_error<T>(function, 0, pol), sign * policies::raise_overflow_error<T>(function, 0, pol));
+ }
+ }
+
+ T j, y;
+ bessel_jy(v, x, &j, &y, need_j | need_y, pol);
+ return std::complex<T>(j, sign * y);
+}
+
+template <class T, class Policy>
+std::complex<T> hankel_imp(int v, T x, const bessel_int_tag&, const Policy& pol, int sign);
+
+template <class T, class Policy>
+inline std::complex<T> hankel_imp(T v, T x, const bessel_maybe_int_tag&, const Policy& pol, int sign)
+{
+ BOOST_MATH_STD_USING // ADL of std names.
+ int ival = detail::iconv(v, pol);
+ if(0 == v - ival)
+ {
+ return hankel_imp(ival, x, bessel_int_tag(), pol, sign);
+ }
+ return hankel_imp(v, x, bessel_no_int_tag(), pol, sign);
+}
+
+template <class T, class Policy>
+inline std::complex<T> hankel_imp(int v, T x, const bessel_int_tag&, const Policy& pol, int sign)
+{
+ BOOST_MATH_STD_USING
+ if((std::abs(v < 200)) && (x > 0))
+ return std::complex<T>(bessel_jn(v, x, pol), sign * bessel_yn(v, x, pol));
+ return hankel_imp(static_cast<T>(v), x, bessel_no_int_tag(), pol, sign);
+}
+
+template <class T, class Policy>
+inline std::complex<T> sph_hankel_imp(T v, T x, const Policy& pol, int sign)
+{
+ BOOST_MATH_STD_USING
+ return constants::root_half_pi<T>() * hankel_imp(v + 0.5f, x, bessel_no_int_tag(), pol, sign) / sqrt(std::complex<T>(x));
+}
+
+} // namespace detail
+
+template <class T1, class T2, class Policy>
+inline std::complex<typename detail::bessel_traits<T1, T2, Policy>::result_type> cyl_hankel_1(T1 v, T2 x, const Policy& pol)
+{
+ BOOST_FPU_EXCEPTION_GUARD
+ typedef typename detail::bessel_traits<T1, T2, Policy>::result_type result_type;
+ typedef typename detail::bessel_traits<T1, T2, Policy>::optimisation_tag tag_type;
+ typedef typename policies::evaluation<result_type, Policy>::type value_type;
+ return policies::checked_narrowing_cast<std::complex<result_type>, Policy>(detail::hankel_imp<value_type>(v, static_cast<value_type>(x), tag_type(), pol, 1), "boost::math::cyl_hankel_1<%1%>(%1%,%1%)");
+}
+
+template <class T1, class T2>
+inline std::complex<typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type> cyl_hankel_1(T1 v, T2 x)
+{
+ return cyl_hankel_1(v, x, policies::policy<>());
+}
+
+template <class T1, class T2, class Policy>
+inline std::complex<typename detail::bessel_traits<T1, T2, Policy>::result_type> cyl_hankel_2(T1 v, T2 x, const Policy& pol)
+{
+ BOOST_FPU_EXCEPTION_GUARD
+ typedef typename detail::bessel_traits<T1, T2, Policy>::result_type result_type;
+ typedef typename detail::bessel_traits<T1, T2, Policy>::optimisation_tag tag_type;
+ typedef typename policies::evaluation<result_type, Policy>::type value_type;
+ return policies::checked_narrowing_cast<std::complex<result_type>, Policy>(detail::hankel_imp<value_type>(v, static_cast<value_type>(x), tag_type(), pol, -1), "boost::math::cyl_hankel_1<%1%>(%1%,%1%)");
+}
+
+template <class T1, class T2>
+inline std::complex<typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type> cyl_hankel_2(T1 v, T2 x)
+{
+ return cyl_hankel_2(v, x, policies::policy<>());
+}
+
+template <class T1, class T2, class Policy>
+inline std::complex<typename detail::bessel_traits<T1, T2, Policy>::result_type> sph_hankel_1(T1 v, T2 x, const Policy& pol)
+{
+ BOOST_FPU_EXCEPTION_GUARD
+ typedef typename detail::bessel_traits<T1, T2, Policy>::result_type result_type;
+ typedef typename policies::evaluation<result_type, Policy>::type value_type;
+ typedef typename policies::normalise<
+ Policy,
+ policies::promote_float<false>,
+ policies::promote_double<false>,
+ policies::discrete_quantile<>,
+ policies::assert_undefined<> >::type forwarding_policy;
+
+ return policies::checked_narrowing_cast<std::complex<result_type>, Policy>(detail::sph_hankel_imp<value_type>(static_cast<value_type>(v), static_cast<value_type>(x), forwarding_policy(), 1), "boost::math::sph_hankel_1<%1%>(%1%,%1%)");
+}
+
+template <class T1, class T2>
+inline std::complex<typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type> sph_hankel_1(T1 v, T2 x)
+{
+ return sph_hankel_1(v, x, policies::policy<>());
+}
+
+template <class T1, class T2, class Policy>
+inline std::complex<typename detail::bessel_traits<T1, T2, Policy>::result_type> sph_hankel_2(T1 v, T2 x, const Policy& pol)
+{
+ BOOST_FPU_EXCEPTION_GUARD
+ typedef typename detail::bessel_traits<T1, T2, Policy>::result_type result_type;
+ typedef typename policies::evaluation<result_type, Policy>::type value_type;
+ typedef typename policies::normalise<
+ Policy,
+ policies::promote_float<false>,
+ policies::promote_double<false>,
+ policies::discrete_quantile<>,
+ policies::assert_undefined<> >::type forwarding_policy;
+
+ return policies::checked_narrowing_cast<std::complex<result_type>, Policy>(detail::sph_hankel_imp<value_type>(static_cast<value_type>(v), static_cast<value_type>(x), forwarding_policy(), -1), "boost::math::sph_hankel_1<%1%>(%1%,%1%)");
+}
+
+template <class T1, class T2>
+inline std::complex<typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type> sph_hankel_2(T1 v, T2 x)
+{
+ return sph_hankel_2(v, x, policies::policy<>());
+}
+
+}} // namespaces
+
+#endif // BOOST_MATH_HANKEL_HPP \ No newline at end of file
diff --git a/boost/math/special_functions/lanczos.hpp b/boost/math/special_functions/lanczos.hpp
index 20ff969359..ed891549f1 100644
--- a/boost/math/special_functions/lanczos.hpp
+++ b/boost/math/special_functions/lanczos.hpp
@@ -34,6 +34,35 @@ namespace boost{ namespace math{ namespace lanczos{
// http://my.fit.edu/~gabdo/gamma.txt and elaborated by Toth at
// http://www.rskey.org/gamma.htm using NTL::RR at 1000 bit precision.
//
+// Begin with a small helper to force initialization of constants prior
+// to main. This makes the constant initialization thread safe, even
+// when called with a user-defined number type.
+//
+template <class Lanczos, class T>
+struct lanczos_initializer
+{
+ struct init
+ {
+ init()
+ {
+ T t(1);
+ Lanczos::lanczos_sum(t);
+ Lanczos::lanczos_sum_expG_scaled(t);
+ Lanczos::lanczos_sum_near_1(t);
+ Lanczos::lanczos_sum_near_2(t);
+ Lanczos::g();
+ }
+ void force_instantiate()const{}
+ };
+ static const init initializer;
+ static void force_instantiate()
+ {
+ initializer.force_instantiate();
+ }
+};
+template <class Lanczos, class T>
+typename lanczos_initializer<Lanczos, T>::init const lanczos_initializer<Lanczos, T>::initializer;
+//
// Lanczos Coefficients for N=6 G=5.581
// Max experimental error (with arbitary precision arithmetic) 9.516e-12
// Generated with compiler: Microsoft Visual C++ version 8.0 on Win32 at Mar 23 2006
@@ -47,6 +76,7 @@ struct lanczos6 : public mpl::int_<35>
template <class T>
static T lanczos_sum(const T& z)
{
+ lanczos_initializer<lanczos6, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T num[6] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 35, 8706.349592549009182288174442774377925882)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 35, 8523.650341121874633477483696775067709735)),
@@ -69,6 +99,7 @@ struct lanczos6 : public mpl::int_<35>
template <class T>
static T lanczos_sum_expG_scaled(const T& z)
{
+ lanczos_initializer<lanczos6, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T num[6] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 35, 32.81244541029783471623665933780748627823)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 35, 32.12388941444332003446077108933558534361)),
@@ -92,6 +123,7 @@ struct lanczos6 : public mpl::int_<35>
template<class T>
static T lanczos_sum_near_1(const T& dz)
{
+ lanczos_initializer<lanczos6, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T d[5] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 35, 2.044879010930422922760429926121241330235)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 35, -2.751366405578505366591317846728753993668)),
@@ -110,6 +142,7 @@ struct lanczos6 : public mpl::int_<35>
template<class T>
static T lanczos_sum_near_2(const T& dz)
{
+ lanczos_initializer<lanczos6, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T d[5] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 35, 5.748142489536043490764289256167080091892)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 35, -7.734074268282457156081021756682138251825)),
@@ -143,6 +176,7 @@ struct lanczos11 : public mpl::int_<60>
template <class T>
static T lanczos_sum(const T& z)
{
+ lanczos_initializer<lanczos11, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T num[11] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 60, 38474670393.31776828316099004518914832218)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 60, 36857665043.51950660081971227404959150474)),
@@ -175,6 +209,7 @@ struct lanczos11 : public mpl::int_<60>
template <class T>
static T lanczos_sum_expG_scaled(const T& z)
{
+ lanczos_initializer<lanczos11, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T num[11] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 60, 709811.662581657956893540610814842699825)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 60, 679979.847415722640161734319823103390728)),
@@ -208,6 +243,7 @@ struct lanczos11 : public mpl::int_<60>
template<class T>
static T lanczos_sum_near_1(const T& dz)
{
+ lanczos_initializer<lanczos11, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T d[10] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 60, 4.005853070677940377969080796551266387954)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 60, -13.17044315127646469834125159673527183164)),
@@ -231,6 +267,7 @@ struct lanczos11 : public mpl::int_<60>
template<class T>
static T lanczos_sum_near_2(const T& dz)
{
+ lanczos_initializer<lanczos11, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T d[10] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 60, 19.05889633808148715159575716844556056056)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 60, -62.66183664701721716960978577959655644762)),
@@ -269,6 +306,7 @@ struct lanczos13 : public mpl::int_<72>
template <class T>
static T lanczos_sum(const T& z)
{
+ lanczos_initializer<lanczos13, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T num[13] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 72, 44012138428004.60895436261759919070125699)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 72, 41590453358593.20051581730723108131357995)),
@@ -305,6 +343,7 @@ struct lanczos13 : public mpl::int_<72>
template <class T>
static T lanczos_sum_expG_scaled(const T& z)
{
+ lanczos_initializer<lanczos13, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T num[13] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 72, 86091529.53418537217994842267760536134841)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 72, 81354505.17858011242874285785316135398567)),
@@ -342,6 +381,7 @@ struct lanczos13 : public mpl::int_<72>
template<class T>
static T lanczos_sum_near_1(const T& dz)
{
+ lanczos_initializer<lanczos13, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T d[12] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 72, 4.832115561461656947793029596285626840312)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 72, -19.86441536140337740383120735104359034688)),
@@ -367,6 +407,7 @@ struct lanczos13 : public mpl::int_<72>
template<class T>
static T lanczos_sum_near_2(const T& dz)
{
+ lanczos_initializer<lanczos13, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T d[12] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 72, 26.96979819614830698367887026728396466395)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 72, -110.8705424709385114023884328797900204863)),
@@ -382,7 +423,7 @@ struct lanczos13 : public mpl::int_<72>
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 72, -0.9685385411006641478305219367315965391289e-9)),
};
T result = 0;
- T z = z = 2;
+ T z = dz + 2;
for(unsigned k = 1; k <= sizeof(d)/sizeof(d[0]); ++k)
{
result += (-d[k-1]*dz)/(z + k*z + k*k - 1);
@@ -407,6 +448,7 @@ struct lanczos22 : public mpl::int_<120>
template <class T>
static T lanczos_sum(const T& z)
{
+ lanczos_initializer<lanczos22, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T num[22] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 46198410803245094237463011094.12173081986)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 43735859291852324413622037436.321513777)),
@@ -461,6 +503,7 @@ struct lanczos22 : public mpl::int_<120>
template <class T>
static T lanczos_sum_expG_scaled(const T& z)
{
+ lanczos_initializer<lanczos22, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T num[22] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 6939996264376682180.277485395074954356211)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 6570067992110214451.87201438870245659384)),
@@ -516,6 +559,7 @@ struct lanczos22 : public mpl::int_<120>
template<class T>
static T lanczos_sum_near_1(const T& dz)
{
+ lanczos_initializer<lanczos22, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T d[21] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 8.318998691953337183034781139546384476554)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, -63.15415991415959158214140353299240638675)),
@@ -550,6 +594,7 @@ struct lanczos22 : public mpl::int_<120>
template<class T>
static T lanczos_sum_near_2(const T& dz)
{
+ lanczos_initializer<lanczos22, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T d[21] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, 75.39272007105208086018421070699575462226)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 120, -572.3481967049935412452681346759966390319)),
@@ -830,6 +875,7 @@ struct lanczos17m64 : public mpl::int_<64>
template <class T>
static T lanczos_sum(const T& z)
{
+ lanczos_initializer<lanczos17m64, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T num[17] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 64, 553681095419291969.2230556393350368550504)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 64, 731918863887667017.2511276782146694632234)),
@@ -874,6 +920,7 @@ struct lanczos17m64 : public mpl::int_<64>
template <class T>
static T lanczos_sum_expG_scaled(const T& z)
{
+ lanczos_initializer<lanczos17m64, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T num[17] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 64, 2715894658327.717377557655133124376674911)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 64, 3590179526097.912105038525528721129550434)),
@@ -919,6 +966,7 @@ struct lanczos17m64 : public mpl::int_<64>
template<class T>
static T lanczos_sum_near_1(const T& dz)
{
+ lanczos_initializer<lanczos17m64, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T d[16] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 64, 4.493645054286536365763334986866616581265)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 64, -16.95716370392468543800733966378143997694)),
@@ -948,6 +996,7 @@ struct lanczos17m64 : public mpl::int_<64>
template<class T>
static T lanczos_sum_near_2(const T& dz)
{
+ lanczos_initializer<lanczos17m64, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T d[16] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 64, 23.56409085052261327114594781581930373708)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 64, -88.92116338946308797946237246006238652361)),
@@ -991,6 +1040,7 @@ struct lanczos24m113 : public mpl::int_<113>
template <class T>
static T lanczos_sum(const T& z)
{
+ lanczos_initializer<lanczos24m113, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T num[24] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 113, 2029889364934367661624137213253.22102954656825019111612712252027267955023987678816620961507)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 113, 2338599599286656537526273232565.2727349714338768161421882478417543004440597874814359063158)),
@@ -1049,6 +1099,7 @@ struct lanczos24m113 : public mpl::int_<113>
template <class T>
static T lanczos_sum_expG_scaled(const T& z)
{
+ lanczos_initializer<lanczos24m113, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T num[24] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 113, 3035162425359883494754.02878223286972654682199012688209026810841953293372712802258398358538)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 113, 3496756894406430103600.16057175075063458536101374170860226963245118484234495645518505519827)),
@@ -1108,6 +1159,7 @@ struct lanczos24m113 : public mpl::int_<113>
template<class T>
static T lanczos_sum_near_1(const T& dz)
{
+ lanczos_initializer<lanczos24m113, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T d[23] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 113, 7.4734083002469026177867421609938203388868806387315406134072298925733950040583068760685908)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 113, -50.4225805042247530267317342133388132970816607563062253708655085754357843064134941138154171)),
@@ -1144,6 +1196,7 @@ struct lanczos24m113 : public mpl::int_<113>
template<class T>
static T lanczos_sum_near_2(const T& dz)
{
+ lanczos_initializer<lanczos24m113, T>::force_instantiate(); // Ensure our constants get initialized before main()
static const T d[23] = {
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 113, 61.4165001061101455341808888883960361969557848005400286332291451422461117307237198559485365)),
static_cast<T>(BOOST_MATH_BIG_CONSTANT(T, 113, -414.372973678657049667308134761613915623353625332248315105320470271523320700386200587519147)),
diff --git a/boost/math/special_functions/log1p.hpp b/boost/math/special_functions/log1p.hpp
index 9bae7165e4..989bdc21b6 100644
--- a/boost/math/special_functions/log1p.hpp
+++ b/boost/math/special_functions/log1p.hpp
@@ -258,6 +258,34 @@ T log1p_imp(T const& x, const Policy& pol, const mpl::int_<24>&)
return result;
}
+template <class T, class Policy, class tag>
+struct log1p_initializer
+{
+ struct init
+ {
+ init()
+ {
+ do_init(tag());
+ }
+ template <int N>
+ static void do_init(const mpl::int_<N>&){}
+ static void do_init(const mpl::int_<64>&)
+ {
+ boost::math::log1p(static_cast<T>(0.25), Policy());
+ }
+ void force_instantiate()const{}
+ };
+ static const init initializer;
+ static void force_instantiate()
+ {
+ initializer.force_instantiate();
+ }
+};
+
+template <class T, class Policy, class tag>
+const typename log1p_initializer<T, Policy, tag>::init log1p_initializer<T, Policy, tag>::initializer;
+
+
} // namespace detail
template <class T, class Policy>
@@ -286,6 +314,9 @@ inline typename tools::promote_args<T>::type log1p(T x, const Policy&)
>::type
>::type
>::type tag_type;
+
+ detail::log1p_initializer<value_type, forwarding_policy, tag_type>::force_instantiate();
+
return policies::checked_narrowing_cast<result_type, forwarding_policy>(
detail::log1p_imp(static_cast<value_type>(x), forwarding_policy(), tag_type()), "boost::math::log1p<%1%>(%1%)");
}
diff --git a/boost/math/special_functions/math_fwd.hpp b/boost/math/special_functions/math_fwd.hpp
index 14364a3d5c..982cdf7ca3 100644
--- a/boost/math/special_functions/math_fwd.hpp
+++ b/boost/math/special_functions/math_fwd.hpp
@@ -28,6 +28,7 @@
#include <boost/math/policies/policy.hpp>
#include <boost/mpl/comparison.hpp>
#include <boost/config/no_tr1/complex.hpp>
+#include <complex>
#define BOOST_NO_MACRO_EXPAND /**/
@@ -614,6 +615,30 @@ namespace boost
template <class T>
typename detail::bessel_traits<T, T, policies::policy<> >::result_type sph_neumann(unsigned v, T x);
+ template <class T1, class T2, class Policy>
+ std::complex<typename detail::bessel_traits<T1, T2, Policy>::result_type> cyl_hankel_1(T1 v, T2 x, const Policy& pol);
+
+ template <class T1, class T2>
+ std::complex<typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type> cyl_hankel_1(T1 v, T2 x);
+
+ template <class T1, class T2, class Policy>
+ std::complex<typename detail::bessel_traits<T1, T2, Policy>::result_type> cyl_hankel_2(T1 v, T2 x, const Policy& pol);
+
+ template <class T1, class T2>
+ std::complex<typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type> cyl_hankel_2(T1 v, T2 x);
+
+ template <class T1, class T2, class Policy>
+ std::complex<typename detail::bessel_traits<T1, T2, Policy>::result_type> sph_hankel_1(T1 v, T2 x, const Policy& pol);
+
+ template <class T1, class T2>
+ std::complex<typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type> sph_hankel_1(T1 v, T2 x);
+
+ template <class T1, class T2, class Policy>
+ std::complex<typename detail::bessel_traits<T1, T2, Policy>::result_type> sph_hankel_2(T1 v, T2 x, const Policy& pol);
+
+ template <class T1, class T2>
+ std::complex<typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type> sph_hankel_2(T1 v, T2 x);
+
template <class T, class Policy>
typename tools::promote_args<T>::type sin_pi(T x, const Policy&);
@@ -681,6 +706,13 @@ namespace boost
template <class T, class Policy>
typename tools::promote_args<T>::type zeta(T s, const Policy&);
+ // Owen's T function:
+ template <class T1, class T2, class Policy>
+ typename tools::promote_args<T1, T2>::type owens_t(T1 h, T2 a, const Policy& pol);
+
+ template <class T1, class T2>
+ typename tools::promote_args<T1, T2>::type owens_t(T1 h, T2 a);
+
template <class T>
typename tools::promote_args<T>::type zeta(T s);
@@ -1063,6 +1095,26 @@ namespace boost
template <class T> T float_next(const T& a){ return boost::math::float_next(a, Policy()); }\
template <class T> T float_prior(const T& a){ return boost::math::float_prior(a, Policy()); }\
template <class T> T float_distance(const T& a, const T& b){ return boost::math::float_distance(a, b, Policy()); }\
+ \
+ template <class RT1, class RT2>\
+ inline typename boost::math::tools::promote_args<RT1, RT2>::type owens_t(RT1 a, RT2 z){ return boost::math::owens_t(a, z, Policy()); }\
+ \
+ template <class T1, class T2>\
+ inline std::complex<typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type> cyl_hankel_1(T1 v, T2 x)\
+ { return boost::math::cyl_hankel_1(v, x, Policy()); }\
+ \
+ template <class T1, class T2>\
+ inline std::complex<typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type> cyl_hankel_2(T1 v, T2 x)\
+ { return boost::math::cyl_hankel_2(v, x, Policy()); }\
+ \
+ template <class T1, class T2>\
+ inline std::complex<typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type> sph_hankel_1(T1 v, T2 x)\
+ { return boost::math::sph_hankel_1(v, x, Policy()); }\
+ \
+ template <class T1, class T2>\
+ inline std::complex<typename boost::math::detail::bessel_traits<T1, T2, Policy >::result_type> sph_hankel_2(T1 v, T2 x)\
+ { return boost::math::sph_hankel_2(v, x, Policy()); }\
+
#endif // BOOST_MATH_SPECIAL_MATH_FWD_HPP
diff --git a/boost/math/special_functions/nonfinite_num_facets.hpp b/boost/math/special_functions/nonfinite_num_facets.hpp
index 9fa61481b5..84d3f1070a 100644
--- a/boost/math/special_functions/nonfinite_num_facets.hpp
+++ b/boost/math/special_functions/nonfinite_num_facets.hpp
@@ -1,8 +1,9 @@
#ifndef BOOST_MATH_NONFINITE_NUM_FACETS_HPP
#define BOOST_MATH_NONFINITE_NUM_FACETS_HPP
-// Copyright (c) 2006 Johan Rade
-// Copyright 2011 Paul A. Bristow (comments)
+// Copyright 2006 Johan Rade
+// Copyright 2012 K R Walker
+// Copyright 2011, 2012 Paul A. Bristow
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt
@@ -28,10 +29,9 @@
#include <boost/math/special_functions/sign.hpp>
#ifdef _MSC_VER
-# pragma warning(push)
-# pragma warning(disable : 4127) // conditional expression is constant.
-# pragma warning(disable : 4706) // assignment within conditional expression.
-# pragma warning(disable : 4224) // formal parameter 'version' was previously defined as a type.
+# pragma warning(push)
+# pragma warning(disable : 4127) // conditional expression is constant.
+# pragma warning(disable : 4706) // assignment within conditional expression.
#endif
namespace boost {
@@ -65,16 +65,14 @@ namespace boost {
protected:
virtual OutputIterator do_put(
- OutputIterator it, std::ios_base& iosb,
- CharType fill, double val) const
+ OutputIterator it, std::ios_base& iosb, CharType fill, double val) const
{
put_and_reset_width(it, iosb, fill, val);
return it;
}
virtual OutputIterator do_put(
- OutputIterator it, std::ios_base& iosb,
- CharType fill, long double val) const
+ OutputIterator it, std::ios_base& iosb, CharType fill, long double val) const
{
put_and_reset_width(it, iosb, fill, val);
return it;
@@ -93,86 +91,136 @@ namespace boost {
OutputIterator& it, std::ios_base& iosb,
CharType fill, ValType val) const
{
- switch((boost::math::fpclassify)(val)) {
+ static const CharType prefix_plus[2] = { '+', '\0' };
+ static const CharType prefix_minus[2] = { '-', '\0' };
+ static const CharType body_inf[4] = { 'i', 'n', 'f', '\0' };
+ static const CharType body_nan[4] = { 'n', 'a', 'n', '\0' };
+ static const CharType* null_string = 0;
+
+ switch((boost::math::fpclassify)(val))
+ {
case FP_INFINITE:
if(flags_ & trap_infinity)
+ {
throw std::ios_base::failure("Infinity");
+ }
else if((boost::math::signbit)(val))
- put_num_and_fill(it, iosb, "-", "inf", fill);
+ { // negative infinity.
+ put_num_and_fill(it, iosb, prefix_minus, body_inf, fill, val);
+ }
else if(iosb.flags() & std::ios_base::showpos)
- put_num_and_fill(it, iosb, "+", "inf", fill);
+ { // Explicit "+inf" wanted.
+ put_num_and_fill(it, iosb, prefix_plus, body_inf, fill, val);
+ }
else
- put_num_and_fill(it, iosb, "", "inf", fill);
+ { // just "inf" wanted.
+ put_num_and_fill(it, iosb, null_string, body_inf, fill, val);
+ }
break;
case FP_NAN:
if(flags_ & trap_nan)
+ {
throw std::ios_base::failure("NaN");
+ }
else if((boost::math::signbit)(val))
- put_num_and_fill(it, iosb, "-", "nan", fill);
+ { // negative so "-nan".
+ put_num_and_fill(it, iosb, prefix_minus, body_nan, fill, val);
+ }
else if(iosb.flags() & std::ios_base::showpos)
- put_num_and_fill(it, iosb, "+", "nan", fill);
+ { // explicit "+nan" wanted.
+ put_num_and_fill(it, iosb, prefix_plus, body_nan, fill, val);
+ }
else
- put_num_and_fill(it, iosb, "", "nan", fill);
+ { // Just "nan".
+ put_num_and_fill(it, iosb, null_string, body_nan, fill, val);
+ }
break;
case FP_ZERO:
- if(flags_ & signed_zero) {
- if((boost::math::signbit)(val))
- put_num_and_fill(it, iosb, "-", "0", fill);
- else if(iosb.flags() & std::ios_base::showpos)
- put_num_and_fill(it, iosb, "+", "0", fill);
- else
- put_num_and_fill(it, iosb, "", "0", fill);
+ if((flags_ & signed_zero) && ((boost::math::signbit)(val)))
+ { // Flag set to distinguish between positive and negative zero.
+ // But string "0" should have stuff after decimal point if setprecision and/or exp format.
+
+ std::basic_ostringstream<CharType> zeros; // Needs to be CharType version.
+
+ // Copy flags, fill, width and precision.
+ zeros.flags(iosb.flags());
+ zeros.unsetf(std::ios::showpos); // Ignore showpos because must be negative.
+ zeros.precision(iosb.precision());
+ //zeros.width is set by put_num_and_fill
+ zeros.fill(static_cast<char>(fill));
+ zeros << ValType(0);
+ put_num_and_fill(it, iosb, prefix_minus, zeros.str().c_str(), fill, val);
}
else
- put_num_and_fill(it, iosb, "", "0", fill);
+ { // Output the platform default for positive and negative zero.
+ put_num_and_fill(it, iosb, null_string, null_string, fill, val);
+ }
break;
- default:
- it = std::num_put<CharType, OutputIterator>::do_put(
- it, iosb, fill, val);
+ default: // Normal non-zero finite value.
+ it = std::num_put<CharType, OutputIterator>::do_put(it, iosb, fill, val);
break;
}
}
+ template<class ValType>
void put_num_and_fill(
- OutputIterator& it, std::ios_base& iosb, const char* prefix,
- const char* body, CharType fill) const
+ OutputIterator& it, std::ios_base& iosb, const CharType* prefix,
+ const CharType* body, CharType fill, ValType val) const
{
- int width = (int)std::strlen(prefix) + (int)std::strlen(body);
- std::ios_base::fmtflags adjust
- = iosb.flags() & std::ios_base::adjustfield;
+ int prefix_length = prefix ? (int)std::char_traits<CharType>::length(prefix) : 0;
+ int body_length = body ? (int)std::char_traits<CharType>::length(body) : 0;
+ int width = prefix_length + body_length;
+ std::ios_base::fmtflags adjust = iosb.flags() & std::ios_base::adjustfield;
const std::ctype<CharType>& ct
= std::use_facet<std::ctype<CharType> >(iosb.getloc());
- if(adjust != std::ios_base::internal && adjust != std::ios_base::left)
- put_fill(it, iosb, fill, width);
+ if(body || prefix)
+ { // adjust == std::ios_base::right, so leading fill needed.
+ if(adjust != std::ios_base::internal && adjust != std::ios_base::left)
+ put_fill(it, iosb, fill, width);
+ }
- while(*prefix)
- *it = ct.widen(*(prefix++));
+ if(prefix)
+ { // Adjust width for prefix.
+ while(*prefix)
+ *it = *(prefix++);
+ iosb.width( iosb.width() - prefix_length );
+ width -= prefix_length;
+ }
- if(adjust == std::ios_base::internal)
- put_fill(it, iosb, fill, width);
+ if(body)
+ { //
+ if(adjust == std::ios_base::internal)
+ { // Put fill between sign and digits.
+ put_fill(it, iosb, fill, width);
+ }
+ if(iosb.flags() & std::ios_base::uppercase)
+ {
+ while(*body)
+ *it = ct.toupper(*(body++));
+ }
+ else
+ {
+ while(*body)
+ *it = *(body++);
+ }
- if(iosb.flags() & std::ios_base::uppercase) {
- while(*body)
- *it = ct.toupper(ct.widen(*(body++)));
+ if(adjust == std::ios_base::left)
+ put_fill(it, iosb, fill, width);
}
- else {
- while(*body)
- *it = ct.widen(*(body++));
+ else
+ {
+ it = std::num_put<CharType, OutputIterator>::do_put(it, iosb, fill, val);
}
-
- if(adjust == std::ios_base::left)
- put_fill(it, iosb, fill, width);
}
void put_fill(
- OutputIterator& it, std::ios_base& iosb,
- CharType fill, int width) const
- {
+ OutputIterator& it, std::ios_base& iosb, CharType fill, int width) const
+ { // Insert fill chars.
for(std::streamsize i = iosb.width() - static_cast<std::streamsize>(width); i > 0; --i)
*it = fill;
}
@@ -540,4 +588,5 @@ namespace boost {
# pragma warning(pop)
#endif
-#endif
+#endif // BOOST_MATH_NONFINITE_NUM_FACETS_HPP
+
diff --git a/boost/math/special_functions/owens_t.hpp b/boost/math/special_functions/owens_t.hpp
new file mode 100644
index 0000000000..98d6380c39
--- /dev/null
+++ b/boost/math/special_functions/owens_t.hpp
@@ -0,0 +1,1061 @@
+// (C) Benjamin Sobotta 2012
+
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_OWENS_T_HPP
+#define BOOST_OWENS_T_HPP
+
+// Reference:
+// Mike Patefield, David Tandy
+// FAST AND ACCURATE CALCULATION OF OWEN'S T-FUNCTION
+// Journal of Statistical Software, 5 (5), 1-25
+
+#ifdef _MSC_VER
+# pragma once
+#endif
+
+#include <boost/config/no_tr1/cmath.hpp>
+#include <boost/math/special_functions/erf.hpp>
+#include <boost/math/special_functions/expm1.hpp>
+#include <boost/throw_exception.hpp>
+#include <boost/assert.hpp>
+#include <boost/math/constants/constants.hpp>
+#include <boost/math/tools/big_constant.hpp>
+
+#include <stdexcept>
+
+namespace boost
+{
+ namespace math
+ {
+ namespace detail
+ {
+ // owens_t_znorm1(x) = P(-oo<Z<=x)-0.5 with Z being normally distributed.
+ template<typename RealType>
+ inline RealType owens_t_znorm1(const RealType x)
+ {
+ using namespace boost::math::constants;
+ return erf(x*one_div_root_two<RealType>())*half<RealType>();
+ } // RealType owens_t_znorm1(const RealType x)
+
+ // owens_t_znorm2(x) = P(x<=Z<oo) with Z being normally distributed.
+ template<typename RealType>
+ inline RealType owens_t_znorm2(const RealType x)
+ {
+ using namespace boost::math::constants;
+ return erfc(x*one_div_root_two<RealType>())*half<RealType>();
+ } // RealType owens_t_znorm2(const RealType x)
+
+ // Auxiliary function, it computes an array key that is used to determine
+ // the specific computation method for Owen's T and the order thereof
+ // used in owens_t_dispatch.
+ template<typename RealType>
+ inline unsigned short owens_t_compute_code(const RealType h, const RealType a)
+ {
+ static const RealType hrange[] =
+ {0.02, 0.06, 0.09, 0.125, 0.26, 0.4, 0.6, 1.6, 1.7, 2.33, 2.4, 3.36, 3.4, 4.8};
+
+ static const RealType arange[] = {0.025, 0.09, 0.15, 0.36, 0.5, 0.9, 0.99999};
+ /*
+ original select array from paper:
+ 1, 1, 2,13,13,13,13,13,13,13,13,16,16,16, 9
+ 1, 2, 2, 3, 3, 5, 5,14,14,15,15,16,16,16, 9
+ 2, 2, 3, 3, 3, 5, 5,15,15,15,15,16,16,16,10
+ 2, 2, 3, 5, 5, 5, 5, 7, 7,16,16,16,16,16,10
+ 2, 3, 3, 5, 5, 6, 6, 8, 8,17,17,17,12,12,11
+ 2, 3, 5, 5, 5, 6, 6, 8, 8,17,17,17,12,12,12
+ 2, 3, 4, 4, 6, 6, 8, 8,17,17,17,17,17,12,12
+ 2, 3, 4, 4, 6, 6,18,18,18,18,17,17,17,12,12
+ */
+ // subtract one because the array is written in FORTRAN in mind - in C arrays start @ zero
+ static const unsigned short select[] =
+ {
+ 0, 0 , 1 , 12 ,12 , 12 , 12 , 12 , 12 , 12 , 12 , 15 , 15 , 15 , 8,
+ 0 , 1 , 1 , 2 , 2 , 4 , 4 , 13 , 13 , 14 , 14 , 15 , 15 , 15 , 8,
+ 1 , 1 , 2 , 2 , 2 , 4 , 4 , 14 , 14 , 14 , 14 , 15 , 15 , 15 , 9,
+ 1 , 1 , 2 , 4 , 4 , 4 , 4 , 6 , 6 , 15 , 15 , 15 , 15 , 15 , 9,
+ 1 , 2 , 2 , 4 , 4 , 5 , 5 , 7 , 7 , 16 ,16 , 16 , 11 , 11 , 10,
+ 1 , 2 , 4 , 4 , 4 , 5 , 5 , 7 , 7 , 16 , 16 , 16 , 11 , 11 , 11,
+ 1 , 2 , 3 , 3 , 5 , 5 , 7 , 7 , 16 , 16 , 16 , 16 , 16 , 11 , 11,
+ 1 , 2 , 3 , 3 , 5 , 5 , 17 , 17 , 17 , 17 , 16 , 16 , 16 , 11 , 11
+ };
+
+ unsigned short ihint = 14, iaint = 7;
+ for(unsigned short i = 0; i != 14; i++)
+ {
+ if( h <= hrange[i] )
+ {
+ ihint = i;
+ break;
+ }
+ } // for(unsigned short i = 0; i != 14; i++)
+
+ for(unsigned short i = 0; i != 7; i++)
+ {
+ if( a <= arange[i] )
+ {
+ iaint = i;
+ break;
+ }
+ } // for(unsigned short i = 0; i != 7; i++)
+
+ // interprete select array as 8x15 matrix
+ return select[iaint*15 + ihint];
+
+ } // unsigned short owens_t_compute_code(const RealType h, const RealType a)
+
+ template<typename RealType>
+ inline unsigned short owens_t_get_order_imp(const unsigned short icode, RealType, const mpl::int_<53>&)
+ {
+ static const unsigned short ord[] = {2, 3, 4, 5, 7, 10, 12, 18, 10, 20, 30, 0, 4, 7, 8, 20, 0, 0}; // 18 entries
+
+ BOOST_ASSERT(icode<18);
+
+ return ord[icode];
+ } // unsigned short owens_t_get_order(const unsigned short icode, RealType, mpl::int<53> const&)
+
+ template<typename RealType>
+ inline unsigned short owens_t_get_order_imp(const unsigned short icode, RealType, const mpl::int_<64>&)
+ {
+ // method ================>>> {1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 4, 4, 4, 4, 5, 6}
+ static const unsigned short ord[] = {3, 4, 5, 6, 8, 11, 13, 19, 10, 20, 30, 0, 7, 10, 11, 23, 0, 0}; // 18 entries
+
+ BOOST_ASSERT(icode<18);
+
+ return ord[icode];
+ } // unsigned short owens_t_get_order(const unsigned short icode, RealType, mpl::int<64> const&)
+
+ template<typename RealType, typename Policy>
+ inline unsigned short owens_t_get_order(const unsigned short icode, RealType r, const Policy&)
+ {
+ typedef typename policies::precision<RealType, Policy>::type precision_type;
+ typedef typename mpl::if_<
+ mpl::or_<
+ mpl::less_equal<precision_type, mpl::int_<0> >,
+ mpl::greater<precision_type, mpl::int_<53> >
+ >,
+ mpl::int_<64>,
+ mpl::int_<53>
+ >::type tag_type;
+
+ return owens_t_get_order_imp(icode, r, tag_type());
+ }
+
+ // compute the value of Owen's T function with method T1 from the reference paper
+ template<typename RealType>
+ inline RealType owens_t_T1(const RealType h, const RealType a, const unsigned short m)
+ {
+ BOOST_MATH_STD_USING
+ using namespace boost::math::constants;
+
+ const RealType hs = -h*h*half<RealType>();
+ const RealType dhs = exp( hs );
+ const RealType as = a*a;
+
+ unsigned short j=1;
+ RealType jj = 1;
+ RealType aj = a * one_div_two_pi<RealType>();
+ RealType dj = expm1( hs );
+ RealType gj = hs*dhs;
+
+ RealType val = atan( a ) * one_div_two_pi<RealType>();
+
+ while( true )
+ {
+ val += dj*aj/jj;
+
+ if( m <= j )
+ break;
+
+ j++;
+ jj += static_cast<RealType>(2);
+ aj *= as;
+ dj = gj - dj;
+ gj *= hs / static_cast<RealType>(j);
+ } // while( true )
+
+ return val;
+ } // RealType owens_t_T1(const RealType h, const RealType a, const unsigned short m)
+
+ // compute the value of Owen's T function with method T2 from the reference paper
+ template<typename RealType, class Policy>
+ inline RealType owens_t_T2(const RealType h, const RealType a, const unsigned short m, const RealType ah, const Policy&, const mpl::false_&)
+ {
+ BOOST_MATH_STD_USING
+ using namespace boost::math::constants;
+
+ const unsigned short maxii = m+m+1;
+ const RealType hs = h*h;
+ const RealType as = -a*a;
+ const RealType y = static_cast<RealType>(1) / hs;
+
+ unsigned short ii = 1;
+ RealType val = 0;
+ RealType vi = a * exp( -ah*ah*half<RealType>() ) * one_div_root_two_pi<RealType>();
+ RealType z = owens_t_znorm1(ah)/h;
+
+ while( true )
+ {
+ val += z;
+ if( maxii <= ii )
+ {
+ val *= exp( -hs*half<RealType>() ) * one_div_root_two_pi<RealType>();
+ break;
+ } // if( maxii <= ii )
+ z = y * ( vi - static_cast<RealType>(ii) * z );
+ vi *= as;
+ ii += 2;
+ } // while( true )
+
+ return val;
+ } // RealType owens_t_T2(const RealType h, const RealType a, const unsigned short m, const RealType ah)
+
+ // compute the value of Owen's T function with method T3 from the reference paper
+ template<typename RealType>
+ inline RealType owens_t_T3_imp(const RealType h, const RealType a, const RealType ah, const mpl::int_<53>&)
+ {
+ BOOST_MATH_STD_USING
+ using namespace boost::math::constants;
+
+ const unsigned short m = 20;
+
+ static const RealType c2[] =
+ {
+ 0.99999999999999987510,
+ -0.99999999999988796462, 0.99999999998290743652,
+ -0.99999999896282500134, 0.99999996660459362918,
+ -0.99999933986272476760, 0.99999125611136965852,
+ -0.99991777624463387686, 0.99942835555870132569,
+ -0.99697311720723000295, 0.98751448037275303682,
+ -0.95915857980572882813, 0.89246305511006708555,
+ -0.76893425990463999675, 0.58893528468484693250,
+ -0.38380345160440256652, 0.20317601701045299653,
+ -0.82813631607004984866E-01, 0.24167984735759576523E-01,
+ -0.44676566663971825242E-02, 0.39141169402373836468E-03
+ };
+
+ const RealType as = a*a;
+ const RealType hs = h*h;
+ const RealType y = static_cast<RealType>(1)/hs;
+
+ RealType ii = 1;
+ unsigned short i = 0;
+ RealType vi = a * exp( -ah*ah*half<RealType>() ) * one_div_root_two_pi<RealType>();
+ RealType zi = owens_t_znorm1(ah)/h;
+ RealType val = 0;
+
+ while( true )
+ {
+ BOOST_ASSERT(i < 21);
+ val += zi*c2[i];
+ if( m <= i ) // if( m < i+1 )
+ {
+ val *= exp( -hs*half<RealType>() ) * one_div_root_two_pi<RealType>();
+ break;
+ } // if( m < i )
+ zi = y * (ii*zi - vi);
+ vi *= as;
+ ii += 2;
+ i++;
+ } // while( true )
+
+ return val;
+ } // RealType owens_t_T3(const RealType h, const RealType a, const RealType ah)
+
+ // compute the value of Owen's T function with method T3 from the reference paper
+ template<class RealType>
+ inline RealType owens_t_T3_imp(const RealType h, const RealType a, const RealType ah, const mpl::int_<64>&)
+ {
+ BOOST_MATH_STD_USING
+ using namespace boost::math::constants;
+
+ const unsigned short m = 30;
+
+ static const RealType c2[] =
+ {
+ BOOST_MATH_BIG_CONSTANT(RealType, 260, 0.99999999999999999999999729978162447266851932041876728736094298092917625009873),
+ BOOST_MATH_BIG_CONSTANT(RealType, 260, -0.99999999999999999999467056379678391810626533251885323416799874878563998732905968),
+ BOOST_MATH_BIG_CONSTANT(RealType, 260, 0.99999999999999999824849349313270659391127814689133077036298754586814091034842536),
+ BOOST_MATH_BIG_CONSTANT(RealType, 260, -0.9999999999999997703859616213643405880166422891953033591551179153879839440241685),
+ BOOST_MATH_BIG_CONSTANT(RealType, 260, 0.99999999999998394883415238173334565554173013941245103172035286759201504179038147),
+ BOOST_MATH_BIG_CONSTANT(RealType, 260, -0.9999999999993063616095509371081203145247992197457263066869044528823599399470977),
+ BOOST_MATH_BIG_CONSTANT(RealType, 260, 0.9999999999797336340409464429599229870590160411238245275855903767652432017766116267),
+ BOOST_MATH_BIG_CONSTANT(RealType, 260, -0.999999999574958412069046680119051639753412378037565521359444170241346845522403274),
+ BOOST_MATH_BIG_CONSTANT(RealType, 260, 0.9999999933226234193375324943920160947158239076786103108097456617750134812033362048),
+ BOOST_MATH_BIG_CONSTANT(RealType, 260, -0.9999999188923242461073033481053037468263536806742737922476636768006622772762168467),
+ BOOST_MATH_BIG_CONSTANT(RealType, 260, 0.9999992195143483674402853783549420883055129680082932629160081128947764415749728967),
+ BOOST_MATH_BIG_CONSTANT(RealType, 260, -0.999993935137206712830997921913316971472227199741857386575097250553105958772041501),
+ BOOST_MATH_BIG_CONSTANT(RealType, 260, 0.99996135597690552745362392866517133091672395614263398912807169603795088421057688716),
+ BOOST_MATH_BIG_CONSTANT(RealType, 260, -0.99979556366513946026406788969630293820987757758641211293079784585126692672425362469),
+ BOOST_MATH_BIG_CONSTANT(RealType, 260, 0.999092789629617100153486251423850590051366661947344315423226082520411961968929483),
+ BOOST_MATH_BIG_CONSTANT(RealType, 260, -0.996593837411918202119308620432614600338157335862888580671450938858935084316004769854),
+ BOOST_MATH_BIG_CONSTANT(RealType, 260, 0.98910017138386127038463510314625339359073956513420458166238478926511821146316469589567),
+ BOOST_MATH_BIG_CONSTANT(RealType, 260, -0.970078558040693314521331982203762771512160168582494513347846407314584943870399016019),
+ BOOST_MATH_BIG_CONSTANT(RealType, 260, 0.92911438683263187495758525500033707204091967947532160289872782771388170647150321633673),
+ BOOST_MATH_BIG_CONSTANT(RealType, 260, -0.8542058695956156057286980736842905011429254735181323743367879525470479126968822863),
+ BOOST_MATH_BIG_CONSTANT(RealType, 260, 0.73796526033030091233118357742803709382964420335559408722681794195743240930748630755),
+ BOOST_MATH_BIG_CONSTANT(RealType, 260, -0.58523469882837394570128599003785154144164680587615878645171632791404210655891158),
+ BOOST_MATH_BIG_CONSTANT(RealType, 260, 0.415997776145676306165661663581868460503874205343014196580122174949645271353372263),
+ BOOST_MATH_BIG_CONSTANT(RealType, 260, -0.2588210875241943574388730510317252236407805082485246378222935376279663808416534365),
+ BOOST_MATH_BIG_CONSTANT(RealType, 260, 0.1375535825163892648504646951500265585055789019410617565727090346559210218472356689),
+ BOOST_MATH_BIG_CONSTANT(RealType, 260, -0.0607952766325955730493900985022020434830339794955745989150270485056436844239206648),
+ BOOST_MATH_BIG_CONSTANT(RealType, 260, 0.0216337683299871528059836483840390514275488679530797294557060229266785853764115),
+ BOOST_MATH_BIG_CONSTANT(RealType, 260, -0.00593405693455186729876995814181203900550014220428843483927218267309209471516256),
+ BOOST_MATH_BIG_CONSTANT(RealType, 260, 0.0011743414818332946510474576182739210553333860106811865963485870668929503649964142),
+ BOOST_MATH_BIG_CONSTANT(RealType, 260, -1.489155613350368934073453260689881330166342484405529981510694514036264969925132e-4),
+ BOOST_MATH_BIG_CONSTANT(RealType, 260, 9.072354320794357587710929507988814669454281514268844884841547607134260303118208e-6)
+ };
+
+ const RealType as = a*a;
+ const RealType hs = h*h;
+ const RealType y = 1 / hs;
+
+ RealType ii = 1;
+ unsigned short i = 0;
+ RealType vi = a * exp( -ah*ah*half<RealType>() ) * one_div_root_two_pi<RealType>();
+ RealType zi = owens_t_znorm1(ah)/h;
+ RealType val = 0;
+
+ while( true )
+ {
+ BOOST_ASSERT(i < 31);
+ val += zi*c2[i];
+ if( m <= i ) // if( m < i+1 )
+ {
+ val *= exp( -hs*half<RealType>() ) * one_div_root_two_pi<RealType>();
+ break;
+ } // if( m < i )
+ zi = y * (ii*zi - vi);
+ vi *= as;
+ ii += 2;
+ i++;
+ } // while( true )
+
+ return val;
+ } // RealType owens_t_T3(const RealType h, const RealType a, const RealType ah)
+
+ template<class RealType, class Policy>
+ inline RealType owens_t_T3(const RealType h, const RealType a, const RealType ah, const Policy&)
+ {
+ typedef typename policies::precision<RealType, Policy>::type precision_type;
+ typedef typename mpl::if_<
+ mpl::or_<
+ mpl::less_equal<precision_type, mpl::int_<0> >,
+ mpl::greater<precision_type, mpl::int_<53> >
+ >,
+ mpl::int_<64>,
+ mpl::int_<53>
+ >::type tag_type;
+
+ return owens_t_T3_imp(h, a, ah, tag_type());
+ }
+
+ // compute the value of Owen's T function with method T4 from the reference paper
+ template<typename RealType>
+ inline RealType owens_t_T4(const RealType h, const RealType a, const unsigned short m)
+ {
+ BOOST_MATH_STD_USING
+ using namespace boost::math::constants;
+
+ const unsigned short maxii = m+m+1;
+ const RealType hs = h*h;
+ const RealType as = -a*a;
+
+ unsigned short ii = 1;
+ RealType ai = a * exp( -hs*(static_cast<RealType>(1)-as)*half<RealType>() ) * one_div_two_pi<RealType>();
+ RealType yi = 1;
+ RealType val = 0;
+
+ while( true )
+ {
+ val += ai*yi;
+ if( maxii <= ii )
+ break;
+ ii += 2;
+ yi = (static_cast<RealType>(1)-hs*yi) / static_cast<RealType>(ii);
+ ai *= as;
+ } // while( true )
+
+ return val;
+ } // RealType owens_t_T4(const RealType h, const RealType a, const unsigned short m)
+
+ // compute the value of Owen's T function with method T5 from the reference paper
+ template<typename RealType>
+ inline RealType owens_t_T5_imp(const RealType h, const RealType a, const mpl::int_<53>&)
+ {
+ BOOST_MATH_STD_USING
+ /*
+ NOTICE:
+ - The pts[] array contains the squares (!) of the abscissas, i.e. the roots of the Legendre
+ polynomial P_n(x), instead of the plain roots as required in Gauss-Legendre
+ quadrature, because T5(h,a,m) contains only x^2 terms.
+ - The wts[] array contains the weights for Gauss-Legendre quadrature scaled with a factor
+ of 1/(2*pi) according to T5(h,a,m).
+ */
+
+ const unsigned short m = 13;
+ static const RealType pts[] = {0.35082039676451715489E-02,
+ 0.31279042338030753740E-01, 0.85266826283219451090E-01,
+ 0.16245071730812277011, 0.25851196049125434828,
+ 0.36807553840697533536, 0.48501092905604697475,
+ 0.60277514152618576821, 0.71477884217753226516,
+ 0.81475510988760098605, 0.89711029755948965867,
+ 0.95723808085944261843, 0.99178832974629703586};
+ static const RealType wts[] = { 0.18831438115323502887E-01,
+ 0.18567086243977649478E-01, 0.18042093461223385584E-01,
+ 0.17263829606398753364E-01, 0.16243219975989856730E-01,
+ 0.14994592034116704829E-01, 0.13535474469662088392E-01,
+ 0.11886351605820165233E-01, 0.10070377242777431897E-01,
+ 0.81130545742299586629E-02, 0.60419009528470238773E-02,
+ 0.38862217010742057883E-02, 0.16793031084546090448E-02};
+
+ const RealType as = a*a;
+ const RealType hs = -h*h*boost::math::constants::half<RealType>();
+
+ RealType val = 0;
+ for(unsigned short i = 0; i < m; ++i)
+ {
+ BOOST_ASSERT(i < 13);
+ const RealType r = static_cast<RealType>(1) + as*pts[i];
+ val += wts[i] * exp( hs*r ) / r;
+ } // for(unsigned short i = 0; i < m; ++i)
+
+ return val*a;
+ } // RealType owens_t_T5(const RealType h, const RealType a)
+
+ // compute the value of Owen's T function with method T5 from the reference paper
+ template<typename RealType>
+ inline RealType owens_t_T5_imp(const RealType h, const RealType a, const mpl::int_<64>&)
+ {
+ BOOST_MATH_STD_USING
+ /*
+ NOTICE:
+ - The pts[] array contains the squares (!) of the abscissas, i.e. the roots of the Legendre
+ polynomial P_n(x), instead of the plain roots as required in Gauss-Legendre
+ quadrature, because T5(h,a,m) contains only x^2 terms.
+ - The wts[] array contains the weights for Gauss-Legendre quadrature scaled with a factor
+ of 1/(2*pi) according to T5(h,a,m).
+ */
+
+ const unsigned short m = 19;
+ static const RealType pts[] = {
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0016634282895983227941),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.014904509242697054183),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.04103478879005817919),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.079359853513391511008),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.1288612130237615133),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.18822336642448518856),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.25586876186122962384),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.32999972011807857222),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.40864620815774761438),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.48971819306044782365),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.57106118513245543894),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.6505134942981533829),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.72596367859928091618),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.79540665919549865924),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.85699701386308739244),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.90909804422384697594),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.95032536436570154409),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.97958418733152273717),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.99610366384229088321)
+ };
+ static const RealType wts[] = {
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012975111395684900835),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012888764187499150078),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012716644398857307844),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012459897461364705691),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.012120231988292330388),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.011699908404856841158),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.011201723906897224448),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.010628993848522759853),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0099855296835573320047),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0092756136096132857933),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0085039700881139589055),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0076757344408814561254),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0067964187616556459109),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.005871875456524750363),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0049082589542498110071),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0039119870792519721409),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0028897090921170700834),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.0018483371329504443947),
+ BOOST_MATH_BIG_CONSTANT(RealType, 64, 0.00079623320100438873578)
+ };
+
+ const RealType as = a*a;
+ const RealType hs = -h*h*boost::math::constants::half<RealType>();
+
+ RealType val = 0;
+ for(unsigned short i = 0; i < m; ++i)
+ {
+ BOOST_ASSERT(i < 19);
+ const RealType r = 1 + as*pts[i];
+ val += wts[i] * exp( hs*r ) / r;
+ } // for(unsigned short i = 0; i < m; ++i)
+
+ return val*a;
+ } // RealType owens_t_T5(const RealType h, const RealType a)
+
+ template<class RealType, class Policy>
+ inline RealType owens_t_T5(const RealType h, const RealType a, const Policy&)
+ {
+ typedef typename policies::precision<RealType, Policy>::type precision_type;
+ typedef typename mpl::if_<
+ mpl::or_<
+ mpl::less_equal<precision_type, mpl::int_<0> >,
+ mpl::greater<precision_type, mpl::int_<53> >
+ >,
+ mpl::int_<64>,
+ mpl::int_<53>
+ >::type tag_type;
+
+ return owens_t_T5_imp(h, a, tag_type());
+ }
+
+
+ // compute the value of Owen's T function with method T6 from the reference paper
+ template<typename RealType>
+ inline RealType owens_t_T6(const RealType h, const RealType a)
+ {
+ BOOST_MATH_STD_USING
+ using namespace boost::math::constants;
+
+ const RealType normh = owens_t_znorm2( h );
+ const RealType y = static_cast<RealType>(1) - a;
+ const RealType r = atan2(y, static_cast<RealType>(1 + a) );
+
+ RealType val = normh * ( static_cast<RealType>(1) - normh ) * half<RealType>();
+
+ if( r != 0 )
+ val -= r * exp( -y*h*h*half<RealType>()/r ) * one_div_two_pi<RealType>();
+
+ return val;
+ } // RealType owens_t_T6(const RealType h, const RealType a, const unsigned short m)
+
+ template <class T, class Policy>
+ std::pair<T, T> owens_t_T1_accelerated(T h, T a, const Policy& pol)
+ {
+ //
+ // This is the same series as T1, but:
+ // * The Taylor series for atan has been combined with that for T1,
+ // reducing but not eliminating cancellation error.
+ // * The resulting alternating series is then accelerated using method 1
+ // from H. Cohen, F. Rodriguez Villegas, D. Zagier,
+ // "Convergence acceleration of alternating series", Bonn, (1991).
+ //
+ BOOST_MATH_STD_USING
+ static const char* function = "boost::math::owens_t<%1%>(%1%, %1%)";
+ T half_h_h = h * h / 2;
+ T a_pow = a;
+ T aa = a * a;
+ T exp_term = exp(-h * h / 2);
+ T one_minus_dj_sum = exp_term;
+ T sum = a_pow * exp_term;
+ T dj_pow = exp_term;
+ T term = sum;
+ T abs_err;
+ int j = 1;
+
+ //
+ // Normally with this form of series acceleration we can calculate
+ // up front how many terms will be required - based on the assumption
+ // that each term decreases in size by a factor of 3. However,
+ // that assumption does not apply here, as the underlying T1 series can
+ // go quite strongly divergent in the early terms, before strongly
+ // converging later. Various "guestimates" have been tried to take account
+ // of this, but they don't always work.... so instead set "n" to the
+ // largest value that won't cause overflow later, and abort iteration
+ // when the last accelerated term was small enough...
+ //
+ int n;
+ try
+ {
+ n = itrunc(T(tools::log_max_value<T>() / 6));
+ }
+ catch(...)
+ {
+ n = (std::numeric_limits<int>::max)();
+ }
+ n = (std::min)(n, 1500);
+ T d = pow(3 + sqrt(T(8)), n);
+ d = (d + 1 / d) / 2;
+ T b = -1;
+ T c = -d;
+ c = b - c;
+ sum *= c;
+ b = -n * n * b * 2;
+ abs_err = ldexp(fabs(sum), -tools::digits<T>());
+
+ while(j < n)
+ {
+ a_pow *= aa;
+ dj_pow *= half_h_h / j;
+ one_minus_dj_sum += dj_pow;
+ term = one_minus_dj_sum * a_pow / (2 * j + 1);
+ c = b - c;
+ sum += c * term;
+ abs_err += ldexp(std::max(T(fabs(sum)), T(fabs(c*term))), -tools::digits<T>());
+ b = (j + n) * (j - n) * b / ((j + T(0.5)) * (j + 1));
+ ++j;
+ //
+ // Include an escape route to prevent calculating too many terms:
+ //
+ if((j > 10) && (fabs(sum * tools::epsilon<T>()) > fabs(c * term)))
+ break;
+ }
+ abs_err += fabs(c * term);
+ if(sum < 0) // sum must always be positive, if it's negative something really bad has happend:
+ policies::raise_evaluation_error(function, 0, T(0), pol);
+ return std::pair<T, T>((sum / d) / boost::math::constants::two_pi<T>(), abs_err / sum);
+ }
+
+ template<typename RealType, class Policy>
+ inline RealType owens_t_T2(const RealType h, const RealType a, const unsigned short m, const RealType ah, const Policy&, const mpl::true_&)
+ {
+ BOOST_MATH_STD_USING
+ using namespace boost::math::constants;
+
+ const unsigned short maxii = m+m+1;
+ const RealType hs = h*h;
+ const RealType as = -a*a;
+ const RealType y = static_cast<RealType>(1) / hs;
+
+ unsigned short ii = 1;
+ RealType val = 0;
+ RealType vi = a * exp( -ah*ah*half<RealType>() ) / root_two_pi<RealType>();
+ RealType z = owens_t_znorm1(ah)/h;
+ RealType last_z = fabs(z);
+ RealType lim = policies::get_epsilon<RealType, Policy>();
+
+ while( true )
+ {
+ val += z;
+ //
+ // This series stops converging after a while, so put a limit
+ // on how far we go before returning our best guess:
+ //
+ if((fabs(lim * val) > fabs(z)) || ((ii > maxii) && (fabs(z) > last_z)) || (z == 0))
+ {
+ val *= exp( -hs*half<RealType>() ) / root_two_pi<RealType>();
+ break;
+ } // if( maxii <= ii )
+ last_z = fabs(z);
+ z = y * ( vi - static_cast<RealType>(ii) * z );
+ vi *= as;
+ ii += 2;
+ } // while( true )
+
+ return val;
+ } // RealType owens_t_T2(const RealType h, const RealType a, const unsigned short m, const RealType ah)
+
+ template<typename RealType, class Policy>
+ inline std::pair<RealType, RealType> owens_t_T2_accelerated(const RealType h, const RealType a, const RealType ah, const Policy&)
+ {
+ //
+ // This is the same series as T2, but with acceleration applied.
+ // Note that we have to be *very* careful to check that nothing bad
+ // has happened during evaluation - this series will go divergent
+ // and/or fail to alternate at a drop of a hat! :-(
+ //
+ BOOST_MATH_STD_USING
+ using namespace boost::math::constants;
+
+ const RealType hs = h*h;
+ const RealType as = -a*a;
+ const RealType y = static_cast<RealType>(1) / hs;
+
+ unsigned short ii = 1;
+ RealType val = 0;
+ RealType vi = a * exp( -ah*ah*half<RealType>() ) / root_two_pi<RealType>();
+ RealType z = boost::math::detail::owens_t_znorm1(ah)/h;
+ RealType last_z = fabs(z);
+
+ //
+ // Normally with this form of series acceleration we can calculate
+ // up front how many terms will be required - based on the assumption
+ // that each term decreases in size by a factor of 3. However,
+ // that assumption does not apply here, as the underlying T1 series can
+ // go quite strongly divergent in the early terms, before strongly
+ // converging later. Various "guestimates" have been tried to take account
+ // of this, but they don't always work.... so instead set "n" to the
+ // largest value that won't cause overflow later, and abort iteration
+ // when the last accelerated term was small enough...
+ //
+ int n;
+ try
+ {
+ n = itrunc(RealType(tools::log_max_value<RealType>() / 6));
+ }
+ catch(...)
+ {
+ n = (std::numeric_limits<int>::max)();
+ }
+ n = (std::min)(n, 1500);
+ RealType d = pow(3 + sqrt(RealType(8)), n);
+ d = (d + 1 / d) / 2;
+ RealType b = -1;
+ RealType c = -d;
+ int s = 1;
+
+ for(int k = 0; k < n; ++k)
+ {
+ //
+ // Check for both convergence and whether the series has gone bad:
+ //
+ if(
+ (fabs(z) > last_z) // Series has gone divergent, abort
+ || (fabs(val) * tools::epsilon<RealType>() > fabs(c * s * z)) // Convergence!
+ || (z * s < 0) // Series has stopped alternating - all bets are off - abort.
+ )
+ {
+ break;
+ }
+ c = b - c;
+ val += c * s * z;
+ b = (k + n) * (k - n) * b / ((k + RealType(0.5)) * (k + 1));
+ last_z = fabs(z);
+ s = -s;
+ z = y * ( vi - static_cast<RealType>(ii) * z );
+ vi *= as;
+ ii += 2;
+ } // while( true )
+ RealType err = fabs(c * z) / val;
+ return std::pair<RealType, RealType>(val * exp( -hs*half<RealType>() ) / (d * root_two_pi<RealType>()), err);
+ } // RealType owens_t_T2_accelerated(const RealType h, const RealType a, const RealType ah, const Policy&)
+
+ template<typename RealType, typename Policy>
+ inline RealType T4_mp(const RealType h, const RealType a, const Policy& pol)
+ {
+ BOOST_MATH_STD_USING
+
+ const RealType hs = h*h;
+ const RealType as = -a*a;
+
+ unsigned short ii = 1;
+ RealType ai = constants::one_div_two_pi<RealType>() * a * exp( -0.5*hs*(1.0-as) );
+ RealType yi = 1.0;
+ RealType val = 0.0;
+
+ RealType lim = boost::math::policies::get_epsilon<RealType, Policy>();
+
+ while( true )
+ {
+ RealType term = ai*yi;
+ val += term;
+ if((yi != 0) && (fabs(val * lim) > fabs(term)))
+ break;
+ ii += 2;
+ yi = (1.0-hs*yi) / static_cast<RealType>(ii);
+ ai *= as;
+ if(ii > (std::min)(1500, (int)policies::get_max_series_iterations<Policy>()))
+ policies::raise_evaluation_error("boost::math::owens_t<%1%>", 0, val, pol);
+ } // while( true )
+
+ return val;
+ } // arg_type owens_t_T4(const arg_type h, const arg_type a, const unsigned short m)
+
+
+ // This routine dispatches the call to one of six subroutines, depending on the values
+ // of h and a.
+ // preconditions: h >= 0, 0<=a<=1, ah=a*h
+ //
+ // Note there are different versions for different precisions....
+ template<typename RealType, typename Policy>
+ inline RealType owens_t_dispatch(const RealType h, const RealType a, const RealType ah, const Policy& pol, mpl::int_<64> const&)
+ {
+ // Simple main case for 64-bit precision or less, this is as per the Patefield-Tandy paper:
+ BOOST_MATH_STD_USING
+ //
+ // Handle some special cases first, these are from
+ // page 1077 of Owen's original paper:
+ //
+ if(h == 0)
+ {
+ return atan(a) * constants::one_div_two_pi<RealType>();
+ }
+ if(a == 0)
+ {
+ return 0;
+ }
+ if(a == 1)
+ {
+ return owens_t_znorm2(RealType(-h)) * owens_t_znorm2(h) / 2;
+ }
+ if(a >= tools::max_value<RealType>())
+ {
+ return owens_t_znorm2(RealType(fabs(h)));
+ }
+ RealType val = 0; // avoid compiler warnings, 0 will be overwritten in any case
+ const unsigned short icode = owens_t_compute_code(h, a);
+ const unsigned short m = owens_t_get_order(icode, val /* just a dummy for the type */, pol);
+ static const unsigned short meth[] = {1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 4, 4, 4, 4, 5, 6}; // 18 entries
+
+ // determine the appropriate method, T1 ... T6
+ switch( meth[icode] )
+ {
+ case 1: // T1
+ val = owens_t_T1(h,a,m);
+ break;
+ case 2: // T2
+ typedef typename policies::precision<RealType, Policy>::type precision_type;
+ typedef mpl::bool_<(precision_type::value == 0) || (precision_type::value > 64)> tag_type;
+ val = owens_t_T2(h, a, m, ah, pol, tag_type());
+ break;
+ case 3: // T3
+ val = owens_t_T3(h,a,ah, pol);
+ break;
+ case 4: // T4
+ val = owens_t_T4(h,a,m);
+ break;
+ case 5: // T5
+ val = owens_t_T5(h,a, pol);
+ break;
+ case 6: // T6
+ val = owens_t_T6(h,a);
+ break;
+ default:
+ BOOST_THROW_EXCEPTION(std::logic_error("selection routine in Owen's T function failed"));
+ }
+ return val;
+ }
+
+ template<typename RealType, typename Policy>
+ inline RealType owens_t_dispatch(const RealType h, const RealType a, const RealType ah, const Policy& pol, const mpl::int_<65>&)
+ {
+ // Arbitrary precision version:
+ BOOST_MATH_STD_USING
+ //
+ // Handle some special cases first, these are from
+ // page 1077 of Owen's original paper:
+ //
+ if(h == 0)
+ {
+ return atan(a) * constants::one_div_two_pi<RealType>();
+ }
+ if(a == 0)
+ {
+ return 0;
+ }
+ if(a == 1)
+ {
+ return owens_t_znorm2(RealType(-h)) * owens_t_znorm2(h) / 2;
+ }
+ if(a >= tools::max_value<RealType>())
+ {
+ return owens_t_znorm2(RealType(fabs(h)));
+ }
+ // Attempt arbitrary precision code, this will throw if it goes wrong:
+ typedef typename boost::math::policies::normalise<Policy, boost::math::policies::evaluation_error<> >::type forwarding_policy;
+ std::pair<RealType, RealType> p1(0, tools::max_value<RealType>()), p2(0, tools::max_value<RealType>());
+ RealType target_precision = policies::get_epsilon<RealType, Policy>() * 1000;
+ bool have_t1(false), have_t2(false);
+ if(ah < 3)
+ {
+ try
+ {
+ have_t1 = true;
+ p1 = owens_t_T1_accelerated(h, a, forwarding_policy());
+ if(p1.second < target_precision)
+ return p1.first;
+ }
+ catch(const boost::math::evaluation_error&){} // T1 may fail and throw, that's OK
+ }
+ if(ah > 1)
+ {
+ try
+ {
+ have_t2 = true;
+ p2 = owens_t_T2_accelerated(h, a, ah, forwarding_policy());
+ if(p2.second < target_precision)
+ return p2.first;
+ }
+ catch(const boost::math::evaluation_error&){} // T2 may fail and throw, that's OK
+ }
+ //
+ // If we haven't tried T1 yet, do it now - sometimes it succeeds and the number of iterations
+ // is fairly low compared to T4.
+ //
+ if(!have_t1)
+ {
+ try
+ {
+ have_t1 = true;
+ p1 = owens_t_T1_accelerated(h, a, forwarding_policy());
+ if(p1.second < target_precision)
+ return p1.first;
+ }
+ catch(const boost::math::evaluation_error&){} // T1 may fail and throw, that's OK
+ }
+ //
+ // If we haven't tried T2 yet, do it now - sometimes it succeeds and the number of iterations
+ // is fairly low compared to T4.
+ //
+ if(!have_t2)
+ {
+ try
+ {
+ have_t2 = true;
+ p2 = owens_t_T2_accelerated(h, a, ah, forwarding_policy());
+ if(p2.second < target_precision)
+ return p2.first;
+ }
+ catch(const boost::math::evaluation_error&){} // T2 may fail and throw, that's OK
+ }
+ //
+ // OK, nothing left to do but try the most expensive option which is T4,
+ // this is often slow to converge, but when it does converge it tends to
+ // be accurate:
+ try
+ {
+ return T4_mp(h, a, pol);
+ }
+ catch(const boost::math::evaluation_error&){} // T4 may fail and throw, that's OK
+ //
+ // Now look back at the results from T1 and T2 and see if either gave better
+ // results than we could get from the 64-bit precision versions.
+ //
+ if((std::min)(p1.second, p2.second) < 1e-20)
+ {
+ return p1.second < p2.second ? p1.first : p2.first;
+ }
+ //
+ // We give up - no arbitrary precision versions succeeded!
+ //
+ return owens_t_dispatch(h, a, ah, pol, mpl::int_<64>());
+ } // RealType owens_t_dispatch(RealType h, RealType a, RealType ah)
+ template<typename RealType, typename Policy>
+ inline RealType owens_t_dispatch(const RealType h, const RealType a, const RealType ah, const Policy& pol, const mpl::int_<0>&)
+ {
+ // We don't know what the precision is until runtime:
+ if(tools::digits<RealType>() <= 64)
+ return owens_t_dispatch(h, a, ah, pol, mpl::int_<64>());
+ return owens_t_dispatch(h, a, ah, pol, mpl::int_<65>());
+ }
+ template<typename RealType, typename Policy>
+ inline RealType owens_t_dispatch(const RealType h, const RealType a, const RealType ah, const Policy& pol)
+ {
+ // Figure out the precision and forward to the correct version:
+ typedef typename policies::precision<RealType, Policy>::type precision_type;
+ typedef typename mpl::if_c<
+ precision_type::value == 0,
+ mpl::int_<0>,
+ typename mpl::if_c<
+ precision_type::value <= 64,
+ mpl::int_<64>,
+ mpl::int_<65>
+ >::type
+ >::type tag_type;
+ return owens_t_dispatch(h, a, ah, pol, tag_type());
+ }
+ // compute Owen's T function, T(h,a), for arbitrary values of h and a
+ template<typename RealType, class Policy>
+ inline RealType owens_t(RealType h, RealType a, const Policy& pol)
+ {
+ BOOST_MATH_STD_USING
+ // exploit that T(-h,a) == T(h,a)
+ h = fabs(h);
+
+ // Use equation (2) in the paper to remap the arguments
+ // such that h>=0 and 0<=a<=1 for the call of the actual
+ // computation routine.
+
+ const RealType fabs_a = fabs(a);
+ const RealType fabs_ah = fabs_a*h;
+
+ RealType val = 0.0; // avoid compiler warnings, 0.0 will be overwritten in any case
+
+ if(fabs_a <= 1)
+ {
+ val = owens_t_dispatch(h, fabs_a, fabs_ah, pol);
+ } // if(fabs_a <= 1.0)
+ else
+ {
+ if( h <= 0.67 )
+ {
+ const RealType normh = owens_t_znorm1(h);
+ const RealType normah = owens_t_znorm1(fabs_ah);
+ val = static_cast<RealType>(1)/static_cast<RealType>(4) - normh*normah -
+ owens_t_dispatch(fabs_ah, static_cast<RealType>(1 / fabs_a), h, pol);
+ } // if( h <= 0.67 )
+ else
+ {
+ const RealType normh = detail::owens_t_znorm2(h);
+ const RealType normah = detail::owens_t_znorm2(fabs_ah);
+ val = constants::half<RealType>()*(normh+normah) - normh*normah -
+ owens_t_dispatch(fabs_ah, static_cast<RealType>(1 / fabs_a), h, pol);
+ } // else [if( h <= 0.67 )]
+ } // else [if(fabs_a <= 1)]
+
+ // exploit that T(h,-a) == -T(h,a)
+ if(a < 0)
+ {
+ return -val;
+ } // if(a < 0)
+
+ return val;
+ } // RealType owens_t(RealType h, RealType a)
+
+ template <class T, class Policy, class tag>
+ struct owens_t_initializer
+ {
+ struct init
+ {
+ init()
+ {
+ do_init(tag());
+ }
+ template <int N>
+ static void do_init(const mpl::int_<N>&){}
+ static void do_init(const mpl::int_<64>&)
+ {
+ boost::math::owens_t(static_cast<T>(7), static_cast<T>(0.96875), Policy());
+ boost::math::owens_t(static_cast<T>(2), static_cast<T>(0.5), Policy());
+ }
+ void force_instantiate()const{}
+ };
+ static const init initializer;
+ static void force_instantiate()
+ {
+ initializer.force_instantiate();
+ }
+ };
+
+ template <class T, class Policy, class tag>
+ const typename owens_t_initializer<T, Policy, tag>::init owens_t_initializer<T, Policy, tag>::initializer;
+
+ } // namespace detail
+
+ template <class T1, class T2, class Policy>
+ inline typename tools::promote_args<T1, T2>::type owens_t(T1 h, T2 a, const Policy& pol)
+ {
+ typedef typename tools::promote_args<T1, T2>::type result_type;
+ typedef typename policies::evaluation<result_type, Policy>::type value_type;
+ typedef typename policies::precision<value_type, Policy>::type precision_type;
+ typedef typename mpl::if_c<
+ precision_type::value == 0,
+ mpl::int_<0>,
+ typename mpl::if_c<
+ precision_type::value <= 64,
+ mpl::int_<64>,
+ mpl::int_<65>
+ >::type
+ >::type tag_type;
+
+ detail::owens_t_initializer<result_type, Policy, tag_type>::force_instantiate();
+
+ return policies::checked_narrowing_cast<result_type, Policy>(detail::owens_t(static_cast<value_type>(h), static_cast<value_type>(a), pol), "boost::math::owens_t<%1%>(%1%,%1%)");
+ }
+
+ template <class T1, class T2>
+ inline typename tools::promote_args<T1, T2>::type owens_t(T1 h, T2 a)
+ {
+ return owens_t(h, a, policies::policy<>());
+ }
+
+
+ } // namespace math
+} // namespace boost
+
+#endif
+// EOF
diff --git a/boost/math/special_functions/round.hpp b/boost/math/special_functions/round.hpp
index f11c6aeb1d..2b4497e198 100644
--- a/boost/math/special_functions/round.hpp
+++ b/boost/math/special_functions/round.hpp
@@ -76,7 +76,7 @@ inline boost::long_long_type llround(const T& v, const Policy& pol)
BOOST_MATH_STD_USING
T r = boost::math::round(v, pol);
if((r > (std::numeric_limits<boost::long_long_type>::max)()) || (r < (std::numeric_limits<boost::long_long_type>::min)()))
- return static_cast<boost::long_long_type>(policies::raise_rounding_error("boost::math::llround<%1%>(%1%)", 0, v, 0LL, pol));
+ return static_cast<boost::long_long_type>(policies::raise_rounding_error("boost::math::llround<%1%>(%1%)", 0, v, static_cast<boost::long_long_type>(0), pol));
return static_cast<boost::long_long_type>(r);
}
template <class T>
diff --git a/boost/math/special_functions/trunc.hpp b/boost/math/special_functions/trunc.hpp
index 520ae89f5d..7346afe6d1 100644
--- a/boost/math/special_functions/trunc.hpp
+++ b/boost/math/special_functions/trunc.hpp
@@ -76,7 +76,7 @@ inline boost::long_long_type lltrunc(const T& v, const Policy& pol)
BOOST_MATH_STD_USING
T r = boost::math::trunc(v, pol);
if((r > (std::numeric_limits<boost::long_long_type>::max)()) || (r < (std::numeric_limits<boost::long_long_type>::min)()))
- return static_cast<boost::long_long_type>(policies::raise_rounding_error("boost::math::lltrunc<%1%>(%1%)", 0, v, 0LL, pol));
+ return static_cast<boost::long_long_type>(policies::raise_rounding_error("boost::math::lltrunc<%1%>(%1%)", 0, v, static_cast<boost::long_long_type>(0), pol));
return static_cast<boost::long_long_type>(r);
}
template <class T>
diff --git a/boost/math/special_functions/zeta.hpp b/boost/math/special_functions/zeta.hpp
index 4ed5f6a705..011182718e 100644
--- a/boost/math/special_functions/zeta.hpp
+++ b/boost/math/special_functions/zeta.hpp
@@ -542,7 +542,7 @@ T zeta_imp_prec(T s, T sc, const Policy&, const mpl::int_<64>&)
}
template <class T, class Policy>
-T zeta_imp_prec(T s, T sc, const Policy& pol, const mpl::int_<113>&)
+T zeta_imp_prec(T s, T sc, const Policy&, const mpl::int_<113>&)
{
BOOST_MATH_STD_USING
T result;
@@ -896,6 +896,49 @@ T zeta_imp(T s, T sc, const Policy& pol, const Tag& tag)
return result;
}
+template <class T, class Policy, class tag>
+struct zeta_initializer
+{
+ struct init
+ {
+ init()
+ {
+ do_init(tag());
+ }
+ static void do_init(const mpl::int_<0>&){}
+ static void do_init(const mpl::int_<53>&){}
+ static void do_init(const mpl::int_<64>&)
+ {
+ boost::math::zeta(static_cast<T>(0.5), Policy());
+ boost::math::zeta(static_cast<T>(1.5), Policy());
+ boost::math::zeta(static_cast<T>(3.5), Policy());
+ boost::math::zeta(static_cast<T>(6.5), Policy());
+ boost::math::zeta(static_cast<T>(14.5), Policy());
+ boost::math::zeta(static_cast<T>(40.5), Policy());
+ }
+ static void do_init(const mpl::int_<113>&)
+ {
+ boost::math::zeta(static_cast<T>(0.5), Policy());
+ boost::math::zeta(static_cast<T>(1.5), Policy());
+ boost::math::zeta(static_cast<T>(3.5), Policy());
+ boost::math::zeta(static_cast<T>(5.5), Policy());
+ boost::math::zeta(static_cast<T>(9.5), Policy());
+ boost::math::zeta(static_cast<T>(16.5), Policy());
+ boost::math::zeta(static_cast<T>(25), Policy());
+ boost::math::zeta(static_cast<T>(70), Policy());
+ }
+ void force_instantiate()const{}
+ };
+ static const init initializer;
+ static void force_instantiate()
+ {
+ initializer.force_instantiate();
+ }
+};
+
+template <class T, class Policy, class tag>
+const typename zeta_initializer<T, Policy, tag>::init zeta_initializer<T, Policy, tag>::initializer;
+
} // detail
template <class T, class Policy>
@@ -929,6 +972,8 @@ inline typename tools::promote_args<T>::type zeta(T s, const Policy&)
>::type tag_type;
//typedef mpl::int_<0> tag_type;
+ detail::zeta_initializer<value_type, forwarding_policy, tag_type>::force_instantiate();
+
return policies::checked_narrowing_cast<result_type, forwarding_policy>(detail::zeta_imp(
static_cast<value_type>(s),
static_cast<value_type>(1 - static_cast<value_type>(s)),
diff --git a/boost/math/tools/big_constant.hpp b/boost/math/tools/big_constant.hpp
index 45f13ceef9..119063164a 100644
--- a/boost/math/tools/big_constant.hpp
+++ b/boost/math/tools/big_constant.hpp
@@ -11,15 +11,17 @@
#include <boost/lexical_cast.hpp>
#include <boost/type_traits/is_convertible.hpp>
-namespace boost{ namespace math{ namespace tools{
+namespace boost{ namespace math{
+
+namespace tools{
template <class T>
-inline T make_big_value(long double v, const char*, mpl::true_ const&, mpl::false_ const&)
+inline BOOST_CONSTEXPR_OR_CONST T make_big_value(long double v, const char*, mpl::true_ const&, mpl::false_ const&)
{
return static_cast<T>(v);
}
template <class T>
-inline T make_big_value(long double v, const char*, mpl::true_ const&, mpl::true_ const&)
+inline BOOST_CONSTEXPR_OR_CONST T make_big_value(long double v, const char*, mpl::true_ const&, mpl::true_ const&)
{
return static_cast<T>(v);
}
@@ -29,7 +31,7 @@ inline T make_big_value(long double, const char* s, mpl::false_ const&, mpl::fal
return boost::lexical_cast<T>(s);
}
template <class T>
-inline const char* make_big_value(long double, const char* s, mpl::false_ const&, mpl::true_ const&)
+inline BOOST_CONSTEXPR const char* make_big_value(long double, const char* s, mpl::false_ const&, mpl::true_ const&)
{
return s;
}
@@ -38,7 +40,15 @@ inline const char* make_big_value(long double, const char* s, mpl::false_ const&
// For constants which might fit in a long double (if it's big enough):
//
#define BOOST_MATH_BIG_CONSTANT(T, D, x)\
- boost::math::tools::make_big_value<T>(BOOST_JOIN(x, L), BOOST_STRINGIZE(x), mpl::bool_<D <= std::numeric_limits<long double>::digits>(), boost::is_convertible<const char*, T>())
+ boost::math::tools::make_big_value<T>(\
+ BOOST_JOIN(x, L), \
+ BOOST_STRINGIZE(x), \
+ mpl::bool_< (is_convertible<long double, T>::value) && \
+ ((D <= std::numeric_limits<long double>::digits) \
+ || is_floating_point<T>::value \
+ || (std::numeric_limits<T>::is_specialized && \
+ (std::numeric_limits<T>::digits10 <= std::numeric_limits<long double>::digits10))) >(), \
+ boost::is_convertible<const char*, T>())
//
// For constants too huge for any conceivable long double (and which generate compiler errors if we try and declare them as such):
//
diff --git a/boost/math/tools/config.hpp b/boost/math/tools/config.hpp
index 96f5d81a43..b1fcd13856 100644
--- a/boost/math/tools/config.hpp
+++ b/boost/math/tools/config.hpp
@@ -16,6 +16,7 @@
#include <algorithm> // for min and max
#include <boost/config/no_tr1/cmath.hpp>
#include <climits>
+#include <cfloat>
#if (defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__))
# include <math.h>
#endif
@@ -24,7 +25,8 @@
#include <boost/math/special_functions/detail/round_fwd.hpp>
#if (defined(__CYGWIN__) || defined(__FreeBSD__) || defined(__NetBSD__) \
- || (defined(__hppa) && !defined(__OpenBSD__)) || defined(__NO_LONG_DOUBLE_MATH)) && !defined(BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS)
+ || (defined(__hppa) && !defined(__OpenBSD__)) || (defined(__NO_LONG_DOUBLE_MATH) && (DBL_MANT_DIG != LDBL_MANT_DIG))) \
+ && !defined(BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS)
# define BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
#endif
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
@@ -38,6 +40,13 @@
# define BOOST_MATH_CONTROL_FP _control87(MCW_EM,MCW_EM)
# include <float.h>
#endif
+#ifdef __IBMCPP__
+//
+// For reasons I don't unserstand, the tests with IMB's compiler all
+// pass at long double precision, but fail with real_concept, those tests
+// are disabled for now. (JM 2012).
+# define BOOST_MATH_NO_REAL_CONCEPT_TESTS
+#endif
#if (defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)) && ((LDBL_MANT_DIG == 106) || (__LDBL_MANT_DIG__ == 106)) && !defined(BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS)
//
// Darwin's rather strange "double double" is rather hard to
diff --git a/boost/math/tools/precision.hpp b/boost/math/tools/precision.hpp
index 73c969a862..8cdcd4eb87 100644
--- a/boost/math/tools/precision.hpp
+++ b/boost/math/tools/precision.hpp
@@ -195,7 +195,7 @@ inline T log_max_value(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T))
(std::numeric_limits<T>::max_exponent == 128
|| std::numeric_limits<T>::max_exponent == 1024
|| std::numeric_limits<T>::max_exponent == 16384),
- mpl::int_<std::numeric_limits<T>::max_exponent>,
+ mpl::int_<(std::numeric_limits<T>::max_exponent > INT_MAX ? INT_MAX : static_cast<int>(std::numeric_limits<T>::max_exponent))>,
mpl::int_<0>
>::type tag_type;
BOOST_STATIC_ASSERT( ::std::numeric_limits<T>::is_specialized);
@@ -217,7 +217,7 @@ inline T log_min_value(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T))
(std::numeric_limits<T>::max_exponent == 128
|| std::numeric_limits<T>::max_exponent == 1024
|| std::numeric_limits<T>::max_exponent == 16384),
- mpl::int_<std::numeric_limits<T>::max_exponent>,
+ mpl::int_<(std::numeric_limits<T>::max_exponent > INT_MAX ? INT_MAX : static_cast<int>(std::numeric_limits<T>::max_exponent))>,
mpl::int_<0>
>::type tag_type;
diff --git a/boost/math/tools/test.hpp b/boost/math/tools/test.hpp
index 90c46e6997..af51d9e3e1 100644
--- a/boost/math/tools/test.hpp
+++ b/boost/math/tools/test.hpp
@@ -255,6 +255,74 @@ test_result<typename calculate_result_type<A>::value_type> test(const A& a, F1 t
return result;
}
+template <class Real, class A, class F1, class F2>
+test_result<Real> test_hetero(const A& a, F1 test_func, F2 expect_func)
+{
+ typedef typename A::value_type row_type;
+ typedef Real value_type;
+
+ test_result<value_type> result;
+
+ for(unsigned i = 0; i < a.size(); ++i)
+ {
+ const row_type& row = a[i];
+ value_type point;
+ try
+ {
+ point = test_func(row);
+ }
+ catch(const std::underflow_error&)
+ {
+ point = 0;
+ }
+ catch(const std::overflow_error&)
+ {
+ point = std::numeric_limits<value_type>::has_infinity ?
+ std::numeric_limits<value_type>::infinity()
+ : tools::max_value<value_type>();
+ }
+ catch(const std::exception& e)
+ {
+ std::cerr << e.what() << std::endl;
+ print_row(row);
+ BOOST_ERROR("Unexpected exception.");
+ // so we don't get further errors:
+ point = expect_func(row);
+ }
+ value_type expected = expect_func(row);
+ value_type err = relative_error(point, expected);
+#ifdef BOOST_INSTRUMENT
+ if(err != 0)
+ {
+ std::cout << row[0] << " " << err;
+ if(std::numeric_limits<value_type>::is_specialized)
+ {
+ std::cout << " (" << err / std::numeric_limits<value_type>::epsilon() << "eps)";
+ }
+ std::cout << std::endl;
+ }
+#endif
+ if(!(boost::math::isfinite)(point) && (boost::math::isfinite)(expected))
+ {
+ std::cout << "CAUTION: Found non-finite result, when a finite value was expected at entry " << i << "\n";
+ std::cout << "Found: " << point << " Expected " << expected << " Error: " << err << std::endl;
+ print_row(row);
+ BOOST_ERROR("Unexpected non-finite result");
+ }
+ if(err > 0.5)
+ {
+ std::cout << "CAUTION: Gross error found at entry " << i << ".\n";
+ std::cout << "Found: " << point << " Expected " << expected << " Error: " << err << std::endl;
+ print_row(row);
+ BOOST_ERROR("Gross error");
+ }
+ result.add(err);
+ if((result.max)() == err)
+ result.set_worst(i);
+ }
+ return result;
+}
+
} // namespace tools
} // namespace math
} // namespace boost
diff --git a/boost/math/tools/test_data.hpp b/boost/math/tools/test_data.hpp
index 4c28d7569d..56bae051b4 100644
--- a/boost/math/tools/test_data.hpp
+++ b/boost/math/tools/test_data.hpp
@@ -726,7 +726,7 @@ std::ostream& write_code(std::ostream& os,
if(a == b)
return os;
- os << "#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))\n"
+ os << "#ifndef SC_\n# define SC_(x) static_cast<T>(BOOST_JOIN(x, L))\n#endif\n"
" static const boost::array<boost::array<T, "
<< a->size() << ">, " << data.size() << "> " << name << " = {{\n";
@@ -749,7 +749,7 @@ std::ostream& write_code(std::ostream& os,
os << " }";
++a;
}
- os << "\n }};\n#undef SC_\n\n";
+ os << "\n }};\n//#undef SC_\n\n";
return os;
}
diff --git a/boost/math/tools/tuple.hpp b/boost/math/tools/tuple.hpp
index f61f3e0594..2f297360a2 100644
--- a/boost/math/tools/tuple.hpp
+++ b/boost/math/tools/tuple.hpp
@@ -9,7 +9,7 @@
#include <boost/tr1/detail/config.hpp> // for BOOST_HAS_TR1_TUPLE
-#ifndef BOOST_NO_0X_HDR_TUPLE
+#ifndef BOOST_NO_CXX11_HDR_TUPLE
#include <tuple>
diff --git a/boost/math/tr1.hpp b/boost/math/tr1.hpp
index 6a3d078d8a..df8ab0ef47 100644
--- a/boost/math/tr1.hpp
+++ b/boost/math/tr1.hpp
@@ -104,6 +104,7 @@ namespace boost{ namespace math{ namespace tr1{ extern "C"{
# include <boost/config/auto_link.hpp>
#endif
+#if !(defined(BOOST_INTEL) && defined(__APPLE__)) && !(defined(__FLT_EVAL_METHOD__) && !defined(__cplusplus))
#ifndef FLT_EVAL_METHOD
typedef float float_t;
typedef double double_t;
@@ -117,6 +118,7 @@ typedef double double_t;
typedef long double float_t;
typedef long double double_t;
#endif
+#endif
// C99 Functions:
double BOOST_MATH_TR1_DECL boost_acosh BOOST_PREVENT_MACRO_SUBSTITUTION(double x) BOOST_MATH_C99_THROW_SPEC;
diff --git a/boost/move/move.hpp b/boost/move/move.hpp
index 1f89d03c6a..6029d6d578 100644
--- a/boost/move/move.hpp
+++ b/boost/move/move.hpp
@@ -217,9 +217,9 @@
#if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
//Move emulation rv breaks standard aliasing rules so add workarounds for some compilers
- #ifdef __GNUC__
- #define BOOST_MOVE_ATTRIBUTE_MAY_ALIAS __attribute__((__may_alias__))
- #else
+ #if defined(__GNUC__) && (__GNUC__ >= 4)
+ #define BOOST_MOVE_ATTRIBUTE_MAY_ALIAS __attribute__((__may_alias__))
+ #else
#define BOOST_MOVE_ATTRIBUTE_MAY_ALIAS
#endif
@@ -306,10 +306,10 @@
{};
template <class T>
- struct has_move_emulation_enabled_aux
+ struct has_move_emulation_enabled_aux
: has_move_emulation_enabled<T> {};
-
- template <class T>
+
+ template <class T>
struct has_nothrow_move
: public BOOST_MOVE_BOOST_NS::integral_constant<bool, false>
{};
@@ -319,7 +319,7 @@
// move()
//
//////////////////////////////////////////////////////////////////////////////
-
+
template <class T>
inline typename BOOST_MOVE_BOOST_NS::disable_if<has_move_emulation_enabled_aux<T>, T&>::type move(T& x)
{
@@ -350,6 +350,15 @@
::boost::rv< TYPE<ARG1, ARG2, ARG3> >& \
//
+ #define BOOST_RV_REF_BEG\
+ ::boost::rv< \
+ //
+
+ #define BOOST_RV_REF_END\
+ >& \
+ //
+
+
#define BOOST_FWD_REF(TYPE)\
const TYPE & \
@@ -363,6 +372,14 @@
const ::boost::rv< TYPE >& \
//
+ #define BOOST_COPY_ASSIGN_REF_BEG \
+ const ::boost::rv< \
+ //
+
+ #define BOOST_COPY_ASSIGN_REF_END \
+ >& \
+ //
+
#define BOOST_MOVE_COPY_ASSIGN_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\
const ::boost::rv< TYPE<ARG1, ARG2> >& \
//
@@ -443,7 +460,7 @@
//! By default this traits returns false. Classes with non-throwing move constructor
//! and assignment should specialize this trait to obtain some performance improvements.
- template <class T>
+ template <class T>
struct has_nothrow_move
: public BOOST_MOVE_MPL_NS::integral_constant<bool, false>
{};
@@ -477,7 +494,7 @@
//! This function provides a way to convert a reference into a rvalue reference
//! in compilers with rvalue references. For other compilers converts T & into
//! <i>::boost::rv<T> &</i> so that move emulation is activated.
- template <class T>
+ template <class T>
rvalue_reference move (input_reference);
#elif defined(BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES)
@@ -491,7 +508,7 @@
template <class T>
inline typename remove_reference<T>::type && move(T&& t)
- { return static_cast<typename remove_reference<T>::type &&>(t); }
+ { return static_cast<typename remove_reference<T>::type &&>(t); }
#endif //Old move
@@ -569,6 +586,25 @@
TYPE && \
//
+ //!This macro is used to achieve portable syntax in move
+ //!constructors and assignments for template classes marked as
+ //!BOOST_COPYABLE_AND_MOVABLE or BOOST_MOVABLE_BUT_NOT_COPYABLE.
+ //!As macros have problem with comma-separatd template arguments,
+ //!the template argument must be preceded with BOOST_RV_REF_START
+ //!and ended with BOOST_RV_REF_END
+ #define BOOST_RV_REF_BEG\
+ \
+ //
+
+ //!This macro is used to achieve portable syntax in move
+ //!constructors and assignments for template classes marked as
+ //!BOOST_COPYABLE_AND_MOVABLE or BOOST_MOVABLE_BUT_NOT_COPYABLE.
+ //!As macros have problem with comma-separatd template arguments,
+ //!the template argument must be preceded with BOOST_RV_REF_START
+ //!and ended with BOOST_RV_REF_END
+ #define BOOST_RV_REF_END\
+ && \
+
//!This macro is used to achieve portable syntax in copy
//!assignment for classes marked as BOOST_COPYABLE_AND_MOVABLE.
#define BOOST_COPY_ASSIGN_REF(TYPE)\
@@ -776,13 +812,18 @@ class back_move_insert_iterator
C* container_m;
public:
- typedef C container_type;
+ typedef C container_type;
+ typedef typename C::value_type value_type;
+ typedef typename C::reference reference;
explicit back_move_insert_iterator(C& x) : container_m(&x) { }
- back_move_insert_iterator& operator=(typename C::reference x)
+ back_move_insert_iterator& operator=(reference x)
{ container_m->push_back(boost::move(x)); return *this; }
+ back_move_insert_iterator& operator=(BOOST_RV_REF(value_type) x)
+ { reference rx = x; return this->operator=(rx); }
+
back_move_insert_iterator& operator*() { return *this; }
back_move_insert_iterator& operator++() { return *this; }
back_move_insert_iterator& operator++(int) { return *this; }
@@ -811,13 +852,18 @@ class front_move_insert_iterator
C* container_m;
public:
- typedef C container_type;
+ typedef C container_type;
+ typedef typename C::value_type value_type;
+ typedef typename C::reference reference;
explicit front_move_insert_iterator(C& x) : container_m(&x) { }
- front_move_insert_iterator& operator=(typename C::reference x)
+ front_move_insert_iterator& operator=(reference x)
{ container_m->push_front(boost::move(x)); return *this; }
+ front_move_insert_iterator& operator=(BOOST_RV_REF(value_type) x)
+ { reference rx = x; return this->operator=(rx); }
+
front_move_insert_iterator& operator*() { return *this; }
front_move_insert_iterator& operator++() { return *this; }
front_move_insert_iterator& operator++(int) { return *this; }
@@ -844,19 +890,24 @@ class move_insert_iterator
typename C::iterator pos_;
public:
- typedef C container_type;
+ typedef C container_type;
+ typedef typename C::value_type value_type;
+ typedef typename C::reference reference;
explicit move_insert_iterator(C& x, typename C::iterator pos)
: container_m(&x), pos_(pos)
{}
- move_insert_iterator& operator=(typename C::reference x)
+ move_insert_iterator& operator=(reference x)
{
pos_ = container_m->insert(pos_, ::boost::move(x));
++pos_;
return *this;
}
+ move_insert_iterator& operator=(BOOST_RV_REF(value_type) x)
+ { reference rx = x; return this->operator=(rx); }
+
move_insert_iterator& operator*() { return *this; }
move_insert_iterator& operator++() { return *this; }
move_insert_iterator& operator++(int) { return *this; }
@@ -1186,7 +1237,7 @@ template< class T > struct remove_rvalue_reference { typedef T type; };
template< class T > struct remove_rvalue_reference< const rv<T>& > { typedef T type; };
template< class T > struct remove_rvalue_reference< volatile rv<T>& > { typedef T type; };
template< class T > struct remove_rvalue_reference< const volatile rv<T>& >{ typedef T type; };
-#endif // #ifndef BOOST_NO_RVALUE_REFERENCES
+#endif // #ifndef BOOST_NO_RVALUE_REFERENCES
template <typename T>
typename boost::move_detail::add_rvalue_reference<T>::type declval();
@@ -1194,7 +1245,7 @@ typename boost::move_detail::add_rvalue_reference<T>::type declval();
}
// Ideas from Boost.Move review, Jeffrey Lee Hellrung:
//
-//- TypeTraits metafunctions is_lvalue_reference, add_lvalue_reference, and remove_lvalue_reference ?
+//- TypeTraits metafunctions is_lvalue_reference, add_lvalue_reference, and remove_lvalue_reference ?
// Perhaps add_reference and remove_reference can be modified so that they behave wrt emulated rvalue
// references the same as wrt real rvalue references, i.e., add_reference< rv<T>& > -> T& rather than
// rv<T>& (since T&& & -> T&).
@@ -1202,7 +1253,7 @@ typename boost::move_detail::add_rvalue_reference<T>::type declval();
//- Add'l TypeTraits has_[trivial_]move_{constructor,assign}...?
//
//- An as_lvalue(T& x) function, which amounts to an identity operation in C++0x, but strips emulated
-// rvalue references in C++03. This may be necessary to prevent "accidental moves".
+// rvalue references in C++03. This may be necessary to prevent "accidental moves".
} //namespace boost {
diff --git a/boost/mpl/O1_size.hpp b/boost/mpl/O1_size.hpp
index 84ba5215e0..8baaa79be3 100644
--- a/boost/mpl/O1_size.hpp
+++ b/boost/mpl/O1_size.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: O1_size.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/O1_size_fwd.hpp>
diff --git a/boost/mpl/O1_size_fwd.hpp b/boost/mpl/O1_size_fwd.hpp
index 281fcafa86..d97538277d 100644
--- a/boost/mpl/O1_size_fwd.hpp
+++ b/boost/mpl/O1_size_fwd.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: O1_size_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
diff --git a/boost/mpl/accumulate.hpp b/boost/mpl/accumulate.hpp
index dba85717c7..23b76c806b 100644
--- a/boost/mpl/accumulate.hpp
+++ b/boost/mpl/accumulate.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: accumulate.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/fold.hpp>
diff --git a/boost/mpl/advance.hpp b/boost/mpl/advance.hpp
index c8b5ae8cb3..d811a80918 100644
--- a/boost/mpl/advance.hpp
+++ b/boost/mpl/advance.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: advance.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/advance_fwd.hpp>
diff --git a/boost/mpl/advance_fwd.hpp b/boost/mpl/advance_fwd.hpp
index daf0c910a0..08ba5fc40c 100644
--- a/boost/mpl/advance_fwd.hpp
+++ b/boost/mpl/advance_fwd.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: advance_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/common_name_wknd.hpp>
diff --git a/boost/mpl/alias.hpp b/boost/mpl/alias.hpp
index 247a635ef4..ff7b7bd10e 100644
--- a/boost/mpl/alias.hpp
+++ b/boost/mpl/alias.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: alias.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
namespace {
diff --git a/boost/mpl/always.hpp b/boost/mpl/always.hpp
index f98423138c..5094b3ee93 100644
--- a/boost/mpl/always.hpp
+++ b/boost/mpl/always.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: always.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/preprocessor/def_params_tail.hpp>
diff --git a/boost/mpl/and.hpp b/boost/mpl/and.hpp
index 1b3ede2299..da257c8fc2 100644
--- a/boost/mpl/and.hpp
+++ b/boost/mpl/and.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: and.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/use_preprocessed.hpp>
diff --git a/boost/mpl/apply.hpp b/boost/mpl/apply.hpp
index 944619e60c..b0455bc06e 100644
--- a/boost/mpl/apply.hpp
+++ b/boost/mpl/apply.hpp
@@ -15,7 +15,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: apply.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/apply_fwd.hpp b/boost/mpl/apply_fwd.hpp
index a78ae8b45a..8cbdfaf97d 100644
--- a/boost/mpl/apply_fwd.hpp
+++ b/boost/mpl/apply_fwd.hpp
@@ -15,7 +15,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: apply_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/apply_wrap.hpp b/boost/mpl/apply_wrap.hpp
index b3cb12b426..5c5c6df601 100644
--- a/boost/mpl/apply_wrap.hpp
+++ b/boost/mpl/apply_wrap.hpp
@@ -15,7 +15,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: apply_wrap.hpp 49272 2008-10-11 06:50:46Z agurtovoy $
-// $Date: 2008-10-11 02:50:46 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:50:46 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49272 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/arg.hpp b/boost/mpl/arg.hpp
index c1c7072686..c323a1a6e7 100644
--- a/boost/mpl/arg.hpp
+++ b/boost/mpl/arg.hpp
@@ -16,7 +16,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: arg.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/arg_fwd.hpp b/boost/mpl/arg_fwd.hpp
index c96b48f068..f79e0561cb 100644
--- a/boost/mpl/arg_fwd.hpp
+++ b/boost/mpl/arg_fwd.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: arg_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/adl_barrier.hpp>
diff --git a/boost/mpl/arithmetic.hpp b/boost/mpl/arithmetic.hpp
index b0b392d72a..0384042d54 100644
--- a/boost/mpl/arithmetic.hpp
+++ b/boost/mpl/arithmetic.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: arithmetic.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/plus.hpp>
diff --git a/boost/mpl/as_sequence.hpp b/boost/mpl/as_sequence.hpp
index 2e83a3011d..9fb5af3d43 100644
--- a/boost/mpl/as_sequence.hpp
+++ b/boost/mpl/as_sequence.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: as_sequence.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/is_sequence.hpp>
diff --git a/boost/mpl/assert.hpp b/boost/mpl/assert.hpp
index 33b82f3ffa..acc3954f0f 100644
--- a/boost/mpl/assert.hpp
+++ b/boost/mpl/assert.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: assert.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/not.hpp>
diff --git a/boost/mpl/at.hpp b/boost/mpl/at.hpp
index caa3462384..d247d71ad4 100644
--- a/boost/mpl/at.hpp
+++ b/boost/mpl/at.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: at.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/at_fwd.hpp>
diff --git a/boost/mpl/at_fwd.hpp b/boost/mpl/at_fwd.hpp
index 6bce275198..a4825f0d56 100644
--- a/boost/mpl/at_fwd.hpp
+++ b/boost/mpl/at_fwd.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: at_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
diff --git a/boost/mpl/aux_/O1_size_impl.hpp b/boost/mpl/aux_/O1_size_impl.hpp
index df408f0899..614730dff9 100644
--- a/boost/mpl/aux_/O1_size_impl.hpp
+++ b/boost/mpl/aux_/O1_size_impl.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: O1_size_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/O1_size_fwd.hpp>
diff --git a/boost/mpl/aux_/adl_barrier.hpp b/boost/mpl/aux_/adl_barrier.hpp
index 7d9eaea58d..077f46fc0f 100644
--- a/boost/mpl/aux_/adl_barrier.hpp
+++ b/boost/mpl/aux_/adl_barrier.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: adl_barrier.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/adl.hpp>
diff --git a/boost/mpl/aux_/advance_backward.hpp b/boost/mpl/aux_/advance_backward.hpp
index 169202a3fb..d44c59f8ef 100644
--- a/boost/mpl/aux_/advance_backward.hpp
+++ b/boost/mpl/aux_/advance_backward.hpp
@@ -15,7 +15,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: advance_backward.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/aux_/advance_forward.hpp b/boost/mpl/aux_/advance_forward.hpp
index 058f765d2f..4edd3ead79 100644
--- a/boost/mpl/aux_/advance_forward.hpp
+++ b/boost/mpl/aux_/advance_forward.hpp
@@ -15,7 +15,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: advance_forward.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/aux_/apply_1st.hpp b/boost/mpl/aux_/apply_1st.hpp
index dd8373a946..0620215ae4 100644
--- a/boost/mpl/aux_/apply_1st.hpp
+++ b/boost/mpl/aux_/apply_1st.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: apply_1st.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/apply.hpp>
diff --git a/boost/mpl/aux_/arg_typedef.hpp b/boost/mpl/aux_/arg_typedef.hpp
index e4737b9ac9..ed5e5bd723 100644
--- a/boost/mpl/aux_/arg_typedef.hpp
+++ b/boost/mpl/aux_/arg_typedef.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: arg_typedef.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/lambda.hpp>
diff --git a/boost/mpl/aux_/arithmetic_op.hpp b/boost/mpl/aux_/arithmetic_op.hpp
index 9546e8eb8d..0a310b7ced 100644
--- a/boost/mpl/aux_/arithmetic_op.hpp
+++ b/boost/mpl/aux_/arithmetic_op.hpp
@@ -10,7 +10,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: arithmetic_op.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/aux_/arity.hpp b/boost/mpl/aux_/arity.hpp
index f639a1034f..adedcc6b5c 100644
--- a/boost/mpl/aux_/arity.hpp
+++ b/boost/mpl/aux_/arity.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: arity.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/dtp.hpp>
diff --git a/boost/mpl/aux_/arity_spec.hpp b/boost/mpl/aux_/arity_spec.hpp
index ea164a62e5..6ae5cc72bd 100644
--- a/boost/mpl/aux_/arity_spec.hpp
+++ b/boost/mpl/aux_/arity_spec.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: arity_spec.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/int.hpp>
diff --git a/boost/mpl/aux_/at_impl.hpp b/boost/mpl/aux_/at_impl.hpp
index 120738f6ca..4af7cfed87 100644
--- a/boost/mpl/aux_/at_impl.hpp
+++ b/boost/mpl/aux_/at_impl.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: at_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/begin_end.hpp>
diff --git a/boost/mpl/aux_/back_impl.hpp b/boost/mpl/aux_/back_impl.hpp
index d151625b71..3b7e4a9e53 100644
--- a/boost/mpl/aux_/back_impl.hpp
+++ b/boost/mpl/aux_/back_impl.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: back_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/begin_end.hpp>
diff --git a/boost/mpl/aux_/basic_bind.hpp b/boost/mpl/aux_/basic_bind.hpp
index e825f09b32..90cac01e85 100644
--- a/boost/mpl/aux_/basic_bind.hpp
+++ b/boost/mpl/aux_/basic_bind.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: basic_bind.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#define BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT
diff --git a/boost/mpl/aux_/begin_end_impl.hpp b/boost/mpl/aux_/begin_end_impl.hpp
index d3b9682ac1..1a220a24ad 100644
--- a/boost/mpl/aux_/begin_end_impl.hpp
+++ b/boost/mpl/aux_/begin_end_impl.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: begin_end_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/begin_end_fwd.hpp>
diff --git a/boost/mpl/aux_/clear_impl.hpp b/boost/mpl/aux_/clear_impl.hpp
index 84da54b122..3850086ca5 100644
--- a/boost/mpl/aux_/clear_impl.hpp
+++ b/boost/mpl/aux_/clear_impl.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: clear_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/clear_fwd.hpp>
diff --git a/boost/mpl/aux_/common_name_wknd.hpp b/boost/mpl/aux_/common_name_wknd.hpp
index 9d0b4b4001..a6c7898b22 100644
--- a/boost/mpl/aux_/common_name_wknd.hpp
+++ b/boost/mpl/aux_/common_name_wknd.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: common_name_wknd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/workaround.hpp>
diff --git a/boost/mpl/aux_/comparison_op.hpp b/boost/mpl/aux_/comparison_op.hpp
index 7d0fa201ac..f0850a4d03 100644
--- a/boost/mpl/aux_/comparison_op.hpp
+++ b/boost/mpl/aux_/comparison_op.hpp
@@ -10,7 +10,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: comparison_op.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/aux_/config/adl.hpp b/boost/mpl/aux_/config/adl.hpp
index 130ee9f49d..d6ead717ea 100644
--- a/boost/mpl/aux_/config/adl.hpp
+++ b/boost/mpl/aux_/config/adl.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: adl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/msvc.hpp>
diff --git a/boost/mpl/aux_/config/arrays.hpp b/boost/mpl/aux_/config/arrays.hpp
index 56ee0a3be8..d801cf7c3d 100644
--- a/boost/mpl/aux_/config/arrays.hpp
+++ b/boost/mpl/aux_/config/arrays.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: arrays.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/msvc.hpp>
diff --git a/boost/mpl/aux_/config/bind.hpp b/boost/mpl/aux_/config/bind.hpp
index d0450e6f3f..02a7814201 100644
--- a/boost/mpl/aux_/config/bind.hpp
+++ b/boost/mpl/aux_/config/bind.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: bind.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/msvc.hpp>
diff --git a/boost/mpl/aux_/config/compiler.hpp b/boost/mpl/aux_/config/compiler.hpp
index 3238963c0c..e80ccde7f0 100644
--- a/boost/mpl/aux_/config/compiler.hpp
+++ b/boost/mpl/aux_/config/compiler.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: compiler.hpp 53189 2009-05-22 20:07:55Z hkaiser $
-// $Date: 2009-05-22 16:07:55 -0400 (Fri, 22 May 2009) $
+// $Date: 2009-05-22 13:07:55 -0700 (Fri, 22 May 2009) $
// $Revision: 53189 $
#if !defined(BOOST_MPL_CFG_COMPILER_DIR)
diff --git a/boost/mpl/aux_/config/ctps.hpp b/boost/mpl/aux_/config/ctps.hpp
index b908cee9ff..9a4aaf724e 100644
--- a/boost/mpl/aux_/config/ctps.hpp
+++ b/boost/mpl/aux_/config/ctps.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: ctps.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/workaround.hpp>
diff --git a/boost/mpl/aux_/config/dependent_nttp.hpp b/boost/mpl/aux_/config/dependent_nttp.hpp
index 5a3f2b8978..3b5a2882ac 100644
--- a/boost/mpl/aux_/config/dependent_nttp.hpp
+++ b/boost/mpl/aux_/config/dependent_nttp.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: dependent_nttp.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/gcc.hpp>
diff --git a/boost/mpl/aux_/config/dmc_ambiguous_ctps.hpp b/boost/mpl/aux_/config/dmc_ambiguous_ctps.hpp
index 682770ee45..f5f53f7c5a 100644
--- a/boost/mpl/aux_/config/dmc_ambiguous_ctps.hpp
+++ b/boost/mpl/aux_/config/dmc_ambiguous_ctps.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: dmc_ambiguous_ctps.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/workaround.hpp>
diff --git a/boost/mpl/aux_/config/dtp.hpp b/boost/mpl/aux_/config/dtp.hpp
index 8f03a83001..e53929bb84 100644
--- a/boost/mpl/aux_/config/dtp.hpp
+++ b/boost/mpl/aux_/config/dtp.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: dtp.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/workaround.hpp>
diff --git a/boost/mpl/aux_/config/eti.hpp b/boost/mpl/aux_/config/eti.hpp
index 7328b6d1ff..c3fd1c60c9 100644
--- a/boost/mpl/aux_/config/eti.hpp
+++ b/boost/mpl/aux_/config/eti.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: eti.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/msvc.hpp>
diff --git a/boost/mpl/aux_/config/forwarding.hpp b/boost/mpl/aux_/config/forwarding.hpp
index 2390bd7431..0919d07268 100644
--- a/boost/mpl/aux_/config/forwarding.hpp
+++ b/boost/mpl/aux_/config/forwarding.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: forwarding.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/workaround.hpp>
diff --git a/boost/mpl/aux_/config/gcc.hpp b/boost/mpl/aux_/config/gcc.hpp
index 3380d613ce..b9d8f7d32f 100644
--- a/boost/mpl/aux_/config/gcc.hpp
+++ b/boost/mpl/aux_/config/gcc.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: gcc.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if defined(__GNUC__) && !defined(__EDG_VERSION__)
diff --git a/boost/mpl/aux_/config/has_apply.hpp b/boost/mpl/aux_/config/has_apply.hpp
index fc9176ffe7..cc52ebac50 100644
--- a/boost/mpl/aux_/config/has_apply.hpp
+++ b/boost/mpl/aux_/config/has_apply.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: has_apply.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/has_xxx.hpp>
diff --git a/boost/mpl/aux_/config/has_xxx.hpp b/boost/mpl/aux_/config/has_xxx.hpp
index e03fe11dfd..1139b684ca 100644
--- a/boost/mpl/aux_/config/has_xxx.hpp
+++ b/boost/mpl/aux_/config/has_xxx.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: has_xxx.hpp 63518 2010-07-02 08:32:03Z agurtovoy $
-// $Date: 2010-07-02 04:32:03 -0400 (Fri, 02 Jul 2010) $
+// $Date: 2010-07-02 01:32:03 -0700 (Fri, 02 Jul 2010) $
// $Revision: 63518 $
#include <boost/mpl/aux_/config/overload_resolution.hpp>
diff --git a/boost/mpl/aux_/config/integral.hpp b/boost/mpl/aux_/config/integral.hpp
index 4dec725b61..6a891604e3 100644
--- a/boost/mpl/aux_/config/integral.hpp
+++ b/boost/mpl/aux_/config/integral.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: integral.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/msvc.hpp>
diff --git a/boost/mpl/aux_/config/intel.hpp b/boost/mpl/aux_/config/intel.hpp
index 8f1de7613b..141a95233e 100644
--- a/boost/mpl/aux_/config/intel.hpp
+++ b/boost/mpl/aux_/config/intel.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: intel.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
diff --git a/boost/mpl/aux_/config/lambda.hpp b/boost/mpl/aux_/config/lambda.hpp
index a46b46a7f4..7be16bf7c6 100644
--- a/boost/mpl/aux_/config/lambda.hpp
+++ b/boost/mpl/aux_/config/lambda.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: lambda.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/ttp.hpp>
diff --git a/boost/mpl/aux_/config/msvc.hpp b/boost/mpl/aux_/config/msvc.hpp
index 18bed83464..fe89cda30b 100644
--- a/boost/mpl/aux_/config/msvc.hpp
+++ b/boost/mpl/aux_/config/msvc.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: msvc.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
diff --git a/boost/mpl/aux_/config/msvc_typename.hpp b/boost/mpl/aux_/config/msvc_typename.hpp
index 042c8040f8..603e2755ea 100644
--- a/boost/mpl/aux_/config/msvc_typename.hpp
+++ b/boost/mpl/aux_/config/msvc_typename.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: msvc_typename.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/msvc.hpp>
diff --git a/boost/mpl/aux_/config/nttp.hpp b/boost/mpl/aux_/config/nttp.hpp
index 4873e20d9e..f8bd39efab 100644
--- a/boost/mpl/aux_/config/nttp.hpp
+++ b/boost/mpl/aux_/config/nttp.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: nttp.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/msvc.hpp>
diff --git a/boost/mpl/aux_/config/operators.hpp b/boost/mpl/aux_/config/operators.hpp
index 2a38a3d5cc..a6af5b1672 100644
--- a/boost/mpl/aux_/config/operators.hpp
+++ b/boost/mpl/aux_/config/operators.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: operators.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/gcc.hpp>
diff --git a/boost/mpl/aux_/config/overload_resolution.hpp b/boost/mpl/aux_/config/overload_resolution.hpp
index 88c3d53f2d..9de579ff5b 100644
--- a/boost/mpl/aux_/config/overload_resolution.hpp
+++ b/boost/mpl/aux_/config/overload_resolution.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: overload_resolution.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/workaround.hpp>
diff --git a/boost/mpl/aux_/config/pp_counter.hpp b/boost/mpl/aux_/config/pp_counter.hpp
index a4d07157b3..4592272f8b 100644
--- a/boost/mpl/aux_/config/pp_counter.hpp
+++ b/boost/mpl/aux_/config/pp_counter.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: pp_counter.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_AUX_PP_COUNTER)
diff --git a/boost/mpl/aux_/config/preprocessor.hpp b/boost/mpl/aux_/config/preprocessor.hpp
index 52229cd863..39190c4fdd 100644
--- a/boost/mpl/aux_/config/preprocessor.hpp
+++ b/boost/mpl/aux_/config/preprocessor.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: preprocessor.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/workaround.hpp>
diff --git a/boost/mpl/aux_/config/static_constant.hpp b/boost/mpl/aux_/config/static_constant.hpp
index 855d22f3ab..02cf9c4ed4 100644
--- a/boost/mpl/aux_/config/static_constant.hpp
+++ b/boost/mpl/aux_/config/static_constant.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: static_constant.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/aux_/config/ttp.hpp b/boost/mpl/aux_/config/ttp.hpp
index a5a0c2cbdf..879ec1ddca 100644
--- a/boost/mpl/aux_/config/ttp.hpp
+++ b/boost/mpl/aux_/config/ttp.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: ttp.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/msvc.hpp>
diff --git a/boost/mpl/aux_/config/typeof.hpp b/boost/mpl/aux_/config/typeof.hpp
index aeff9c1093..2244d2cd14 100644
--- a/boost/mpl/aux_/config/typeof.hpp
+++ b/boost/mpl/aux_/config/typeof.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: typeof.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/gcc.hpp>
diff --git a/boost/mpl/aux_/config/use_preprocessed.hpp b/boost/mpl/aux_/config/use_preprocessed.hpp
index 3bbc2296d8..4494366d8d 100644
--- a/boost/mpl/aux_/config/use_preprocessed.hpp
+++ b/boost/mpl/aux_/config/use_preprocessed.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: use_preprocessed.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
// #define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
diff --git a/boost/mpl/aux_/config/workaround.hpp b/boost/mpl/aux_/config/workaround.hpp
index 337bcf7c6b..8ec172f672 100644
--- a/boost/mpl/aux_/config/workaround.hpp
+++ b/boost/mpl/aux_/config/workaround.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: workaround.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/detail/workaround.hpp>
diff --git a/boost/mpl/aux_/contains_impl.hpp b/boost/mpl/aux_/contains_impl.hpp
index 2ee405694b..2dcb609c95 100644
--- a/boost/mpl/aux_/contains_impl.hpp
+++ b/boost/mpl/aux_/contains_impl.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: contains_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/contains_fwd.hpp>
diff --git a/boost/mpl/aux_/count_args.hpp b/boost/mpl/aux_/count_args.hpp
index 85107ddbd2..1ab000db14 100644
--- a/boost/mpl/aux_/count_args.hpp
+++ b/boost/mpl/aux_/count_args.hpp
@@ -10,7 +10,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: count_args.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/preprocessor/expr_if.hpp>
diff --git a/boost/mpl/aux_/count_impl.hpp b/boost/mpl/aux_/count_impl.hpp
index 22e2cf5fb5..8b80c02fd4 100644
--- a/boost/mpl/aux_/count_impl.hpp
+++ b/boost/mpl/aux_/count_impl.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: count_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/count_fwd.hpp>
diff --git a/boost/mpl/aux_/empty_impl.hpp b/boost/mpl/aux_/empty_impl.hpp
index 9a553a77fe..0b4b979873 100644
--- a/boost/mpl/aux_/empty_impl.hpp
+++ b/boost/mpl/aux_/empty_impl.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: empty_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/empty_fwd.hpp>
diff --git a/boost/mpl/aux_/erase_impl.hpp b/boost/mpl/aux_/erase_impl.hpp
index dc8a22f1de..5fc1712f11 100644
--- a/boost/mpl/aux_/erase_impl.hpp
+++ b/boost/mpl/aux_/erase_impl.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: erase_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/clear.hpp>
diff --git a/boost/mpl/aux_/erase_key_impl.hpp b/boost/mpl/aux_/erase_key_impl.hpp
index ffc6c1f33e..e479c66ce8 100644
--- a/boost/mpl/aux_/erase_key_impl.hpp
+++ b/boost/mpl/aux_/erase_key_impl.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: erase_key_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/erase_key_fwd.hpp>
diff --git a/boost/mpl/aux_/filter_iter.hpp b/boost/mpl/aux_/filter_iter.hpp
index ab9c9baf38..6fb1411771 100644
--- a/boost/mpl/aux_/filter_iter.hpp
+++ b/boost/mpl/aux_/filter_iter.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: filter_iter.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/find_if.hpp>
diff --git a/boost/mpl/aux_/fold_impl.hpp b/boost/mpl/aux_/fold_impl.hpp
index 89e42f8b55..cc640224da 100644
--- a/boost/mpl/aux_/fold_impl.hpp
+++ b/boost/mpl/aux_/fold_impl.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: fold_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/aux_/fold_impl_body.hpp b/boost/mpl/aux_/fold_impl_body.hpp
index 41f80b4b0d..0750990ae3 100644
--- a/boost/mpl/aux_/fold_impl_body.hpp
+++ b/boost/mpl/aux_/fold_impl_body.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: fold_impl_body.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
# include <boost/mpl/limits/unrolling.hpp>
diff --git a/boost/mpl/aux_/fold_op.hpp b/boost/mpl/aux_/fold_op.hpp
index bfd5b43b35..3fc6ce94d5 100644
--- a/boost/mpl/aux_/fold_op.hpp
+++ b/boost/mpl/aux_/fold_op.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: fold_op.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/apply.hpp>
diff --git a/boost/mpl/aux_/fold_pred.hpp b/boost/mpl/aux_/fold_pred.hpp
index a172de811b..f645464eaf 100644
--- a/boost/mpl/aux_/fold_pred.hpp
+++ b/boost/mpl/aux_/fold_pred.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: fold_pred.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/same_as.hpp>
diff --git a/boost/mpl/aux_/front_impl.hpp b/boost/mpl/aux_/front_impl.hpp
index 9bfa643f0f..a666e6797c 100644
--- a/boost/mpl/aux_/front_impl.hpp
+++ b/boost/mpl/aux_/front_impl.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: front_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/front_fwd.hpp>
diff --git a/boost/mpl/aux_/full_lambda.hpp b/boost/mpl/aux_/full_lambda.hpp
index dfaaedbe6e..e931199915 100644
--- a/boost/mpl/aux_/full_lambda.hpp
+++ b/boost/mpl/aux_/full_lambda.hpp
@@ -15,7 +15,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: full_lambda.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/aux_/has_apply.hpp b/boost/mpl/aux_/has_apply.hpp
index b77b56170f..cfb496e3bb 100644
--- a/boost/mpl/aux_/has_apply.hpp
+++ b/boost/mpl/aux_/has_apply.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: has_apply.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/has_xxx.hpp>
diff --git a/boost/mpl/aux_/has_begin.hpp b/boost/mpl/aux_/has_begin.hpp
index e7403d2412..c2b3bdbb5b 100644
--- a/boost/mpl/aux_/has_begin.hpp
+++ b/boost/mpl/aux_/has_begin.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: has_begin.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/has_xxx.hpp>
diff --git a/boost/mpl/aux_/has_key_impl.hpp b/boost/mpl/aux_/has_key_impl.hpp
index 3a12a22d9f..e7c7fc4d8a 100644
--- a/boost/mpl/aux_/has_key_impl.hpp
+++ b/boost/mpl/aux_/has_key_impl.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: has_key_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/has_key_fwd.hpp>
diff --git a/boost/mpl/aux_/has_rebind.hpp b/boost/mpl/aux_/has_rebind.hpp
index 32cdb83570..f07e79e567 100644
--- a/boost/mpl/aux_/has_rebind.hpp
+++ b/boost/mpl/aux_/has_rebind.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: has_rebind.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/msvc.hpp>
diff --git a/boost/mpl/aux_/has_size.hpp b/boost/mpl/aux_/has_size.hpp
index 3f72c44db6..23588af0be 100644
--- a/boost/mpl/aux_/has_size.hpp
+++ b/boost/mpl/aux_/has_size.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: has_size.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/has_xxx.hpp>
diff --git a/boost/mpl/aux_/has_tag.hpp b/boost/mpl/aux_/has_tag.hpp
index c016ec5200..915a8b6221 100644
--- a/boost/mpl/aux_/has_tag.hpp
+++ b/boost/mpl/aux_/has_tag.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: has_tag.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/has_xxx.hpp>
diff --git a/boost/mpl/aux_/has_type.hpp b/boost/mpl/aux_/has_type.hpp
index 1d301a2f5d..4f05072b5f 100644
--- a/boost/mpl/aux_/has_type.hpp
+++ b/boost/mpl/aux_/has_type.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: has_type.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/has_xxx.hpp>
diff --git a/boost/mpl/aux_/include_preprocessed.hpp b/boost/mpl/aux_/include_preprocessed.hpp
index b214eebc25..162b05cc0d 100644
--- a/boost/mpl/aux_/include_preprocessed.hpp
+++ b/boost/mpl/aux_/include_preprocessed.hpp
@@ -10,7 +10,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: include_preprocessed.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/compiler.hpp>
diff --git a/boost/mpl/aux_/insert_impl.hpp b/boost/mpl/aux_/insert_impl.hpp
index 1858a9aeeb..a0de6e9079 100644
--- a/boost/mpl/aux_/insert_impl.hpp
+++ b/boost/mpl/aux_/insert_impl.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: insert_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/reverse_fold.hpp>
diff --git a/boost/mpl/aux_/insert_range_impl.hpp b/boost/mpl/aux_/insert_range_impl.hpp
index c1a2f5434c..d7357b46a0 100644
--- a/boost/mpl/aux_/insert_range_impl.hpp
+++ b/boost/mpl/aux_/insert_range_impl.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: insert_range_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/copy.hpp>
diff --git a/boost/mpl/aux_/inserter_algorithm.hpp b/boost/mpl/aux_/inserter_algorithm.hpp
index a6f340c782..2d7e1d928a 100644
--- a/boost/mpl/aux_/inserter_algorithm.hpp
+++ b/boost/mpl/aux_/inserter_algorithm.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: inserter_algorithm.hpp 55648 2009-08-18 05:16:53Z agurtovoy $
-// $Date: 2009-08-18 01:16:53 -0400 (Tue, 18 Aug 2009) $
+// $Date: 2009-08-17 22:16:53 -0700 (Mon, 17 Aug 2009) $
// $Revision: 55648 $
#include <boost/mpl/back_inserter.hpp>
diff --git a/boost/mpl/aux_/integral_wrapper.hpp b/boost/mpl/aux_/integral_wrapper.hpp
index 963a738abb..d36e7cbb2d 100644
--- a/boost/mpl/aux_/integral_wrapper.hpp
+++ b/boost/mpl/aux_/integral_wrapper.hpp
@@ -8,7 +8,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: integral_wrapper.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION!
diff --git a/boost/mpl/aux_/is_msvc_eti_arg.hpp b/boost/mpl/aux_/is_msvc_eti_arg.hpp
index 322a22e0e1..917b57cbc3 100644
--- a/boost/mpl/aux_/is_msvc_eti_arg.hpp
+++ b/boost/mpl/aux_/is_msvc_eti_arg.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: is_msvc_eti_arg.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/yes_no.hpp>
diff --git a/boost/mpl/aux_/iter_apply.hpp b/boost/mpl/aux_/iter_apply.hpp
index fc21f7355f..fee4d811c1 100644
--- a/boost/mpl/aux_/iter_apply.hpp
+++ b/boost/mpl/aux_/iter_apply.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: iter_apply.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/apply.hpp>
diff --git a/boost/mpl/aux_/iter_fold_if_impl.hpp b/boost/mpl/aux_/iter_fold_if_impl.hpp
index e7c47eac1e..ad80250d0b 100644
--- a/boost/mpl/aux_/iter_fold_if_impl.hpp
+++ b/boost/mpl/aux_/iter_fold_if_impl.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: iter_fold_if_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/aux_/iter_fold_impl.hpp b/boost/mpl/aux_/iter_fold_impl.hpp
index 0ea86c3c0e..7bc572078d 100644
--- a/boost/mpl/aux_/iter_fold_impl.hpp
+++ b/boost/mpl/aux_/iter_fold_impl.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: iter_fold_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/aux_/iter_push_front.hpp b/boost/mpl/aux_/iter_push_front.hpp
index 2fa4f94ea8..3a01b0360c 100644
--- a/boost/mpl/aux_/iter_push_front.hpp
+++ b/boost/mpl/aux_/iter_push_front.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: iter_push_front.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/push_front.hpp>
diff --git a/boost/mpl/aux_/joint_iter.hpp b/boost/mpl/aux_/joint_iter.hpp
index e2589dc19a..e78028d644 100644
--- a/boost/mpl/aux_/joint_iter.hpp
+++ b/boost/mpl/aux_/joint_iter.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: joint_iter.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/next_prior.hpp>
diff --git a/boost/mpl/aux_/lambda_arity_param.hpp b/boost/mpl/aux_/lambda_arity_param.hpp
index 720918eabb..5418f2c904 100644
--- a/boost/mpl/aux_/lambda_arity_param.hpp
+++ b/boost/mpl/aux_/lambda_arity_param.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: lambda_arity_param.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/ttp.hpp>
diff --git a/boost/mpl/aux_/lambda_no_ctps.hpp b/boost/mpl/aux_/lambda_no_ctps.hpp
index cd55fc7bef..1c383b4279 100644
--- a/boost/mpl/aux_/lambda_no_ctps.hpp
+++ b/boost/mpl/aux_/lambda_no_ctps.hpp
@@ -15,7 +15,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: lambda_no_ctps.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/aux_/lambda_spec.hpp b/boost/mpl/aux_/lambda_spec.hpp
index f167479945..52b1dcd55c 100644
--- a/boost/mpl/aux_/lambda_spec.hpp
+++ b/boost/mpl/aux_/lambda_spec.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: lambda_spec.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/void.hpp>
diff --git a/boost/mpl/aux_/lambda_support.hpp b/boost/mpl/aux_/lambda_support.hpp
index fa000d8999..2d25348ff6 100644
--- a/boost/mpl/aux_/lambda_support.hpp
+++ b/boost/mpl/aux_/lambda_support.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: lambda_support.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/lambda.hpp>
diff --git a/boost/mpl/aux_/largest_int.hpp b/boost/mpl/aux_/largest_int.hpp
index 89e987a5a7..1b9f1cf985 100644
--- a/boost/mpl/aux_/largest_int.hpp
+++ b/boost/mpl/aux_/largest_int.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: largest_int.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/if.hpp>
diff --git a/boost/mpl/aux_/logical_op.hpp b/boost/mpl/aux_/logical_op.hpp
index e4689c9d9e..d964049343 100644
--- a/boost/mpl/aux_/logical_op.hpp
+++ b/boost/mpl/aux_/logical_op.hpp
@@ -8,7 +8,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: logical_op.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION!
diff --git a/boost/mpl/aux_/msvc_dtw.hpp b/boost/mpl/aux_/msvc_dtw.hpp
index 222c47708a..b8953f59db 100644
--- a/boost/mpl/aux_/msvc_dtw.hpp
+++ b/boost/mpl/aux_/msvc_dtw.hpp
@@ -8,7 +8,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: msvc_dtw.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION!
diff --git a/boost/mpl/aux_/msvc_eti_base.hpp b/boost/mpl/aux_/msvc_eti_base.hpp
index 2c1ada5b37..61bd38ab5b 100644
--- a/boost/mpl/aux_/msvc_eti_base.hpp
+++ b/boost/mpl/aux_/msvc_eti_base.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: msvc_eti_base.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/is_msvc_eti_arg.hpp>
diff --git a/boost/mpl/aux_/msvc_is_class.hpp b/boost/mpl/aux_/msvc_is_class.hpp
index e0ccb38876..54a2c5766c 100644
--- a/boost/mpl/aux_/msvc_is_class.hpp
+++ b/boost/mpl/aux_/msvc_is_class.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: msvc_is_class.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/if.hpp>
diff --git a/boost/mpl/aux_/msvc_never_true.hpp b/boost/mpl/aux_/msvc_never_true.hpp
index 93da72e2a3..ca35adca9c 100644
--- a/boost/mpl/aux_/msvc_never_true.hpp
+++ b/boost/mpl/aux_/msvc_never_true.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: msvc_never_true.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/msvc.hpp>
diff --git a/boost/mpl/aux_/msvc_type.hpp b/boost/mpl/aux_/msvc_type.hpp
index ab662dbc2c..643fd83e99 100644
--- a/boost/mpl/aux_/msvc_type.hpp
+++ b/boost/mpl/aux_/msvc_type.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: msvc_type.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/eti.hpp>
diff --git a/boost/mpl/aux_/na.hpp b/boost/mpl/aux_/na.hpp
index 314250c643..b75fcdd28d 100644
--- a/boost/mpl/aux_/na.hpp
+++ b/boost/mpl/aux_/na.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: na.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/bool.hpp>
diff --git a/boost/mpl/aux_/na_assert.hpp b/boost/mpl/aux_/na_assert.hpp
index ece7f4cb1c..df88ba3e56 100644
--- a/boost/mpl/aux_/na_assert.hpp
+++ b/boost/mpl/aux_/na_assert.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: na_assert.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/na.hpp>
diff --git a/boost/mpl/aux_/na_fwd.hpp b/boost/mpl/aux_/na_fwd.hpp
index dd64fc19f2..2409fc8a13 100644
--- a/boost/mpl/aux_/na_fwd.hpp
+++ b/boost/mpl/aux_/na_fwd.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: na_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/adl_barrier.hpp>
diff --git a/boost/mpl/aux_/na_spec.hpp b/boost/mpl/aux_/na_spec.hpp
index 92b2e5a00a..6cd7721ca8 100644
--- a/boost/mpl/aux_/na_spec.hpp
+++ b/boost/mpl/aux_/na_spec.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: na_spec.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/aux_/nested_type_wknd.hpp b/boost/mpl/aux_/nested_type_wknd.hpp
index cee38314be..cc4628672a 100644
--- a/boost/mpl/aux_/nested_type_wknd.hpp
+++ b/boost/mpl/aux_/nested_type_wknd.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: nested_type_wknd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/gcc.hpp>
diff --git a/boost/mpl/aux_/nttp_decl.hpp b/boost/mpl/aux_/nttp_decl.hpp
index 0fa254df0c..65e2929130 100644
--- a/boost/mpl/aux_/nttp_decl.hpp
+++ b/boost/mpl/aux_/nttp_decl.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: nttp_decl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/nttp.hpp>
diff --git a/boost/mpl/aux_/numeric_cast_utils.hpp b/boost/mpl/aux_/numeric_cast_utils.hpp
index cc5ea91eae..11f04edd7b 100644
--- a/boost/mpl/aux_/numeric_cast_utils.hpp
+++ b/boost/mpl/aux_/numeric_cast_utils.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: numeric_cast_utils.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/numeric_cast.hpp>
diff --git a/boost/mpl/aux_/numeric_op.hpp b/boost/mpl/aux_/numeric_op.hpp
index 2b0d6eb267..896935cc44 100644
--- a/boost/mpl/aux_/numeric_op.hpp
+++ b/boost/mpl/aux_/numeric_op.hpp
@@ -14,7 +14,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: numeric_op.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/aux_/order_impl.hpp b/boost/mpl/aux_/order_impl.hpp
index 7129d82259..9d8b04c74e 100644
--- a/boost/mpl/aux_/order_impl.hpp
+++ b/boost/mpl/aux_/order_impl.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: order_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/order_fwd.hpp>
diff --git a/boost/mpl/aux_/overload_names.hpp b/boost/mpl/aux_/overload_names.hpp
index 0fa4a983d3..27e86424d2 100644
--- a/boost/mpl/aux_/overload_names.hpp
+++ b/boost/mpl/aux_/overload_names.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: overload_names.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/ptr_to_ref.hpp>
diff --git a/boost/mpl/aux_/partition_op.hpp b/boost/mpl/aux_/partition_op.hpp
index 95ae2fb5f4..1844d09dbe 100644
--- a/boost/mpl/aux_/partition_op.hpp
+++ b/boost/mpl/aux_/partition_op.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: partition_op.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/apply.hpp>
diff --git a/boost/mpl/aux_/pop_back_impl.hpp b/boost/mpl/aux_/pop_back_impl.hpp
index b8b4a9b72c..05613e59fd 100644
--- a/boost/mpl/aux_/pop_back_impl.hpp
+++ b/boost/mpl/aux_/pop_back_impl.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: pop_back_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/pop_back_fwd.hpp>
diff --git a/boost/mpl/aux_/pop_front_impl.hpp b/boost/mpl/aux_/pop_front_impl.hpp
index c28db20f39..21a76f32c3 100644
--- a/boost/mpl/aux_/pop_front_impl.hpp
+++ b/boost/mpl/aux_/pop_front_impl.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: pop_front_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/pop_front_fwd.hpp>
diff --git a/boost/mpl/aux_/preprocessor/add.hpp b/boost/mpl/aux_/preprocessor/add.hpp
index 9cf4a9a82e..26a70e7563 100644
--- a/boost/mpl/aux_/preprocessor/add.hpp
+++ b/boost/mpl/aux_/preprocessor/add.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: add.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/preprocessor.hpp>
diff --git a/boost/mpl/aux_/preprocessor/def_params_tail.hpp b/boost/mpl/aux_/preprocessor/def_params_tail.hpp
index 7b0b0afb35..c51636e68f 100644
--- a/boost/mpl/aux_/preprocessor/def_params_tail.hpp
+++ b/boost/mpl/aux_/preprocessor/def_params_tail.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: def_params_tail.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/limits/arity.hpp>
diff --git a/boost/mpl/aux_/preprocessor/default_params.hpp b/boost/mpl/aux_/preprocessor/default_params.hpp
index 63cf92e3dd..66d6d0397a 100644
--- a/boost/mpl/aux_/preprocessor/default_params.hpp
+++ b/boost/mpl/aux_/preprocessor/default_params.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: default_params.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/preprocessor.hpp>
diff --git a/boost/mpl/aux_/preprocessor/enum.hpp b/boost/mpl/aux_/preprocessor/enum.hpp
index a7f95e34be..11541a050c 100644
--- a/boost/mpl/aux_/preprocessor/enum.hpp
+++ b/boost/mpl/aux_/preprocessor/enum.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: enum.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/preprocessor.hpp>
diff --git a/boost/mpl/aux_/preprocessor/ext_params.hpp b/boost/mpl/aux_/preprocessor/ext_params.hpp
index 6bbb1113e1..a89535d6b2 100644
--- a/boost/mpl/aux_/preprocessor/ext_params.hpp
+++ b/boost/mpl/aux_/preprocessor/ext_params.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: ext_params.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/preprocessor.hpp>
diff --git a/boost/mpl/aux_/preprocessor/filter_params.hpp b/boost/mpl/aux_/preprocessor/filter_params.hpp
index 38f3cbfd71..fefd984778 100644
--- a/boost/mpl/aux_/preprocessor/filter_params.hpp
+++ b/boost/mpl/aux_/preprocessor/filter_params.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: filter_params.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#define BOOST_MPL_PP_FILTER_PARAMS_0(p1,p2,p3,p4,p5,p6,p7,p8,p9)
diff --git a/boost/mpl/aux_/preprocessor/is_seq.hpp b/boost/mpl/aux_/preprocessor/is_seq.hpp
index 5d8acf590e..db7eaa40b3 100644
--- a/boost/mpl/aux_/preprocessor/is_seq.hpp
+++ b/boost/mpl/aux_/preprocessor/is_seq.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: is_seq.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/preprocessor/seq/size.hpp>
diff --git a/boost/mpl/aux_/preprocessor/params.hpp b/boost/mpl/aux_/preprocessor/params.hpp
index 410a8d0d0a..ac861ecc40 100644
--- a/boost/mpl/aux_/preprocessor/params.hpp
+++ b/boost/mpl/aux_/preprocessor/params.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: params.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/preprocessor.hpp>
diff --git a/boost/mpl/aux_/preprocessor/partial_spec_params.hpp b/boost/mpl/aux_/preprocessor/partial_spec_params.hpp
index 346d9cdc09..e2e1fa900d 100644
--- a/boost/mpl/aux_/preprocessor/partial_spec_params.hpp
+++ b/boost/mpl/aux_/preprocessor/partial_spec_params.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: partial_spec_params.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/limits/arity.hpp>
diff --git a/boost/mpl/aux_/preprocessor/range.hpp b/boost/mpl/aux_/preprocessor/range.hpp
index cd4c5113c9..e69a9e1945 100644
--- a/boost/mpl/aux_/preprocessor/range.hpp
+++ b/boost/mpl/aux_/preprocessor/range.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: range.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/preprocessor/seq/subseq.hpp>
diff --git a/boost/mpl/aux_/preprocessor/repeat.hpp b/boost/mpl/aux_/preprocessor/repeat.hpp
index cfebe043b5..2c314eca17 100644
--- a/boost/mpl/aux_/preprocessor/repeat.hpp
+++ b/boost/mpl/aux_/preprocessor/repeat.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: repeat.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/preprocessor.hpp>
diff --git a/boost/mpl/aux_/preprocessor/sub.hpp b/boost/mpl/aux_/preprocessor/sub.hpp
index 8ba8132e9c..7f5e2913a8 100644
--- a/boost/mpl/aux_/preprocessor/sub.hpp
+++ b/boost/mpl/aux_/preprocessor/sub.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: sub.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/preprocessor.hpp>
diff --git a/boost/mpl/aux_/preprocessor/token_equal.hpp b/boost/mpl/aux_/preprocessor/token_equal.hpp
index 0df58b7525..b65f3d8bf4 100644
--- a/boost/mpl/aux_/preprocessor/token_equal.hpp
+++ b/boost/mpl/aux_/preprocessor/token_equal.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: token_equal.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/preprocessor/is_seq.hpp>
diff --git a/boost/mpl/aux_/preprocessor/tuple.hpp b/boost/mpl/aux_/preprocessor/tuple.hpp
index f46d0e9651..ed59407c5e 100644
--- a/boost/mpl/aux_/preprocessor/tuple.hpp
+++ b/boost/mpl/aux_/preprocessor/tuple.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: tuple.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#define BOOST_MPL_PP_TUPLE_11_ELEM_0(e0,e1,e2,e3,e4,e5,e6,e7,e8,e9,e10) e0
diff --git a/boost/mpl/aux_/ptr_to_ref.hpp b/boost/mpl/aux_/ptr_to_ref.hpp
index 3b5415c26e..e81ebe8cff 100644
--- a/boost/mpl/aux_/ptr_to_ref.hpp
+++ b/boost/mpl/aux_/ptr_to_ref.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: ptr_to_ref.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/static_cast.hpp>
diff --git a/boost/mpl/aux_/push_back_impl.hpp b/boost/mpl/aux_/push_back_impl.hpp
index 2f839cb88a..732c43c802 100644
--- a/boost/mpl/aux_/push_back_impl.hpp
+++ b/boost/mpl/aux_/push_back_impl.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: push_back_impl.hpp 55679 2009-08-20 07:50:16Z agurtovoy $
-// $Date: 2009-08-20 03:50:16 -0400 (Thu, 20 Aug 2009) $
+// $Date: 2009-08-20 00:50:16 -0700 (Thu, 20 Aug 2009) $
// $Revision: 55679 $
#include <boost/mpl/push_back_fwd.hpp>
diff --git a/boost/mpl/aux_/push_front_impl.hpp b/boost/mpl/aux_/push_front_impl.hpp
index 6723ea3894..ae1bc22d33 100644
--- a/boost/mpl/aux_/push_front_impl.hpp
+++ b/boost/mpl/aux_/push_front_impl.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: push_front_impl.hpp 55679 2009-08-20 07:50:16Z agurtovoy $
-// $Date: 2009-08-20 03:50:16 -0400 (Thu, 20 Aug 2009) $
+// $Date: 2009-08-20 00:50:16 -0700 (Thu, 20 Aug 2009) $
// $Revision: 55679 $
#include <boost/mpl/push_front_fwd.hpp>
diff --git a/boost/mpl/aux_/range_c/O1_size.hpp b/boost/mpl/aux_/range_c/O1_size.hpp
index 2aa05cd75b..69452858da 100644
--- a/boost/mpl/aux_/range_c/O1_size.hpp
+++ b/boost/mpl/aux_/range_c/O1_size.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: O1_size.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/O1_size_fwd.hpp>
diff --git a/boost/mpl/aux_/range_c/back.hpp b/boost/mpl/aux_/range_c/back.hpp
index 84f6e9d59c..0d6cc6e7f5 100644
--- a/boost/mpl/aux_/range_c/back.hpp
+++ b/boost/mpl/aux_/range_c/back.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: back.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/back_fwd.hpp>
diff --git a/boost/mpl/aux_/range_c/empty.hpp b/boost/mpl/aux_/range_c/empty.hpp
index 076447d26a..d78e5b3d41 100644
--- a/boost/mpl/aux_/range_c/empty.hpp
+++ b/boost/mpl/aux_/range_c/empty.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: empty.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/empty_fwd.hpp>
diff --git a/boost/mpl/aux_/range_c/front.hpp b/boost/mpl/aux_/range_c/front.hpp
index 0a5f41186e..e3265ab3c9 100644
--- a/boost/mpl/aux_/range_c/front.hpp
+++ b/boost/mpl/aux_/range_c/front.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: front.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/front_fwd.hpp>
diff --git a/boost/mpl/aux_/range_c/iterator.hpp b/boost/mpl/aux_/range_c/iterator.hpp
index e19946b24d..5d5b1d02c6 100644
--- a/boost/mpl/aux_/range_c/iterator.hpp
+++ b/boost/mpl/aux_/range_c/iterator.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: iterator.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/iterator_tags.hpp>
diff --git a/boost/mpl/aux_/range_c/size.hpp b/boost/mpl/aux_/range_c/size.hpp
index 384243cc58..dbd8adef70 100644
--- a/boost/mpl/aux_/range_c/size.hpp
+++ b/boost/mpl/aux_/range_c/size.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: size.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/size_fwd.hpp>
diff --git a/boost/mpl/aux_/range_c/tag.hpp b/boost/mpl/aux_/range_c/tag.hpp
index 895793b3ef..f56d86f94e 100644
--- a/boost/mpl/aux_/range_c/tag.hpp
+++ b/boost/mpl/aux_/range_c/tag.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: tag.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl { namespace aux {
diff --git a/boost/mpl/aux_/reverse_fold_impl.hpp b/boost/mpl/aux_/reverse_fold_impl.hpp
index b8e2308e84..9c17c01295 100644
--- a/boost/mpl/aux_/reverse_fold_impl.hpp
+++ b/boost/mpl/aux_/reverse_fold_impl.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: reverse_fold_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/aux_/reverse_fold_impl_body.hpp b/boost/mpl/aux_/reverse_fold_impl_body.hpp
index 7bd561874b..c815e0aed9 100644
--- a/boost/mpl/aux_/reverse_fold_impl_body.hpp
+++ b/boost/mpl/aux_/reverse_fold_impl_body.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: reverse_fold_impl_body.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
# include <boost/mpl/limits/unrolling.hpp>
diff --git a/boost/mpl/aux_/reverse_iter_fold_impl.hpp b/boost/mpl/aux_/reverse_iter_fold_impl.hpp
index ce9257fb0e..63557ce8ee 100644
--- a/boost/mpl/aux_/reverse_iter_fold_impl.hpp
+++ b/boost/mpl/aux_/reverse_iter_fold_impl.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: reverse_iter_fold_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/aux_/sequence_wrapper.hpp b/boost/mpl/aux_/sequence_wrapper.hpp
index 3f9f8cad25..8b49c74ed0 100644
--- a/boost/mpl/aux_/sequence_wrapper.hpp
+++ b/boost/mpl/aux_/sequence_wrapper.hpp
@@ -14,7 +14,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: sequence_wrapper.hpp 49271 2008-10-11 06:46:00Z agurtovoy $
-// $Date: 2008-10-11 02:46:00 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:46:00 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49271 $
# include <boost/mpl/aux_/config/ctps.hpp>
diff --git a/boost/mpl/aux_/shift_op.hpp b/boost/mpl/aux_/shift_op.hpp
index fbfd46f0b1..982d66aec4 100644
--- a/boost/mpl/aux_/shift_op.hpp
+++ b/boost/mpl/aux_/shift_op.hpp
@@ -10,7 +10,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: shift_op.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/aux_/single_element_iter.hpp b/boost/mpl/aux_/single_element_iter.hpp
index ab20d97fe0..e17abb9479 100644
--- a/boost/mpl/aux_/single_element_iter.hpp
+++ b/boost/mpl/aux_/single_element_iter.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: single_element_iter.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/iterator_tags.hpp>
diff --git a/boost/mpl/aux_/size_impl.hpp b/boost/mpl/aux_/size_impl.hpp
index 0e4885d7fc..73dc50d19b 100644
--- a/boost/mpl/aux_/size_impl.hpp
+++ b/boost/mpl/aux_/size_impl.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: size_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/size_fwd.hpp>
diff --git a/boost/mpl/aux_/sort_impl.hpp b/boost/mpl/aux_/sort_impl.hpp
index 24f219400b..76bc311475 100644
--- a/boost/mpl/aux_/sort_impl.hpp
+++ b/boost/mpl/aux_/sort_impl.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: sort_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/partition.hpp>
diff --git a/boost/mpl/aux_/static_cast.hpp b/boost/mpl/aux_/static_cast.hpp
index 133730d3ba..8c12128e30 100644
--- a/boost/mpl/aux_/static_cast.hpp
+++ b/boost/mpl/aux_/static_cast.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: static_cast.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/workaround.hpp>
diff --git a/boost/mpl/aux_/template_arity.hpp b/boost/mpl/aux_/template_arity.hpp
index ed26ea24bb..5e3f6e012a 100644
--- a/boost/mpl/aux_/template_arity.hpp
+++ b/boost/mpl/aux_/template_arity.hpp
@@ -15,7 +15,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: template_arity.hpp 61584 2010-04-26 18:48:26Z agurtovoy $
-// $Date: 2010-04-26 14:48:26 -0400 (Mon, 26 Apr 2010) $
+// $Date: 2010-04-26 11:48:26 -0700 (Mon, 26 Apr 2010) $
// $Revision: 61584 $
#include <boost/mpl/aux_/config/ttp.hpp>
diff --git a/boost/mpl/aux_/template_arity_fwd.hpp b/boost/mpl/aux_/template_arity_fwd.hpp
index 4b7c8b819e..44bc9d2146 100644
--- a/boost/mpl/aux_/template_arity_fwd.hpp
+++ b/boost/mpl/aux_/template_arity_fwd.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: template_arity_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl { namespace aux {
diff --git a/boost/mpl/aux_/test.hpp b/boost/mpl/aux_/test.hpp
index 853556f50b..f676a31e99 100644
--- a/boost/mpl/aux_/test.hpp
+++ b/boost/mpl/aux_/test.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: test.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/test/test_case.hpp>
diff --git a/boost/mpl/aux_/test/assert.hpp b/boost/mpl/aux_/test/assert.hpp
index 97cbe9687b..0d107dfc74 100644
--- a/boost/mpl/aux_/test/assert.hpp
+++ b/boost/mpl/aux_/test/assert.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: assert.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/assert.hpp>
diff --git a/boost/mpl/aux_/test/data.hpp b/boost/mpl/aux_/test/data.hpp
index 0a11571720..6eee8239a7 100644
--- a/boost/mpl/aux_/test/data.hpp
+++ b/boost/mpl/aux_/test/data.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: data.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/noncopyable.hpp>
diff --git a/boost/mpl/aux_/test/test_case.hpp b/boost/mpl/aux_/test/test_case.hpp
index 48038128d5..a23330cafc 100644
--- a/boost/mpl/aux_/test/test_case.hpp
+++ b/boost/mpl/aux_/test/test_case.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: test_case.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/preprocessor/cat.hpp>
diff --git a/boost/mpl/aux_/traits_lambda_spec.hpp b/boost/mpl/aux_/traits_lambda_spec.hpp
index f312f6d39d..c9b60fe78f 100644
--- a/boost/mpl/aux_/traits_lambda_spec.hpp
+++ b/boost/mpl/aux_/traits_lambda_spec.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: traits_lambda_spec.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/sequence_tag_fwd.hpp>
diff --git a/boost/mpl/aux_/transform_iter.hpp b/boost/mpl/aux_/transform_iter.hpp
index 2d678935d4..3faee5f42f 100644
--- a/boost/mpl/aux_/transform_iter.hpp
+++ b/boost/mpl/aux_/transform_iter.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: transform_iter.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/apply.hpp>
diff --git a/boost/mpl/aux_/type_wrapper.hpp b/boost/mpl/aux_/type_wrapper.hpp
index 0583f72c03..6d6091bd35 100644
--- a/boost/mpl/aux_/type_wrapper.hpp
+++ b/boost/mpl/aux_/type_wrapper.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: type_wrapper.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/ctps.hpp>
diff --git a/boost/mpl/aux_/unwrap.hpp b/boost/mpl/aux_/unwrap.hpp
index dd710a7e8e..bc734f031b 100644
--- a/boost/mpl/aux_/unwrap.hpp
+++ b/boost/mpl/aux_/unwrap.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: unwrap.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/ref.hpp>
diff --git a/boost/mpl/aux_/value_wknd.hpp b/boost/mpl/aux_/value_wknd.hpp
index 9de1103b1c..7baa8bf7eb 100644
--- a/boost/mpl/aux_/value_wknd.hpp
+++ b/boost/mpl/aux_/value_wknd.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: value_wknd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/static_cast.hpp>
diff --git a/boost/mpl/aux_/yes_no.hpp b/boost/mpl/aux_/yes_no.hpp
index c3f567d88a..ebcb00dbbd 100644
--- a/boost/mpl/aux_/yes_no.hpp
+++ b/boost/mpl/aux_/yes_no.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: yes_no.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/nttp_decl.hpp>
diff --git a/boost/mpl/back.hpp b/boost/mpl/back.hpp
index fe2158f1e2..ff6b5d601a 100644
--- a/boost/mpl/back.hpp
+++ b/boost/mpl/back.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: back.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/back_fwd.hpp>
diff --git a/boost/mpl/back_fwd.hpp b/boost/mpl/back_fwd.hpp
index cc01e33c64..c8b1fe9db4 100644
--- a/boost/mpl/back_fwd.hpp
+++ b/boost/mpl/back_fwd.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: back_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
diff --git a/boost/mpl/back_inserter.hpp b/boost/mpl/back_inserter.hpp
index fa4ede802d..ce2a2849a4 100644
--- a/boost/mpl/back_inserter.hpp
+++ b/boost/mpl/back_inserter.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: back_inserter.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/push_back.hpp>
diff --git a/boost/mpl/base.hpp b/boost/mpl/base.hpp
index 3f7e8a4ed3..0dcd712ec6 100644
--- a/boost/mpl/base.hpp
+++ b/boost/mpl/base.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: base.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/na_spec.hpp>
diff --git a/boost/mpl/begin.hpp b/boost/mpl/begin.hpp
index 74ae3b90fe..9dab265056 100644
--- a/boost/mpl/begin.hpp
+++ b/boost/mpl/begin.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: begin.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/begin_end.hpp>
diff --git a/boost/mpl/begin_end.hpp b/boost/mpl/begin_end.hpp
index 7d8d9eb25a..6c3accc77c 100644
--- a/boost/mpl/begin_end.hpp
+++ b/boost/mpl/begin_end.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: begin_end.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/begin_end_fwd.hpp>
diff --git a/boost/mpl/begin_end_fwd.hpp b/boost/mpl/begin_end_fwd.hpp
index 1ac62c6d0a..d1edaca7c8 100644
--- a/boost/mpl/begin_end_fwd.hpp
+++ b/boost/mpl/begin_end_fwd.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: begin_end_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
diff --git a/boost/mpl/bind.hpp b/boost/mpl/bind.hpp
index 5d851ef5ad..25e46b4ff8 100644
--- a/boost/mpl/bind.hpp
+++ b/boost/mpl/bind.hpp
@@ -16,7 +16,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: bind.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/bind_fwd.hpp b/boost/mpl/bind_fwd.hpp
index 18ac881221..35795ac00e 100644
--- a/boost/mpl/bind_fwd.hpp
+++ b/boost/mpl/bind_fwd.hpp
@@ -15,7 +15,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: bind_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/bitand.hpp b/boost/mpl/bitand.hpp
index 80066174d8..7292569f01 100644
--- a/boost/mpl/bitand.hpp
+++ b/boost/mpl/bitand.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: bitand.hpp 63520 2010-07-02 08:59:55Z agurtovoy $
-// $Date: 2010-07-02 04:59:55 -0400 (Fri, 02 Jul 2010) $
+// $Date: 2010-07-02 01:59:55 -0700 (Fri, 02 Jul 2010) $
// $Revision: 63520 $
// agurt, 23/jan/10: workaround a conflict with <iso646.h> header's
diff --git a/boost/mpl/bitor.hpp b/boost/mpl/bitor.hpp
index d724f35e27..11f092c8ef 100644
--- a/boost/mpl/bitor.hpp
+++ b/boost/mpl/bitor.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: bitor.hpp 63520 2010-07-02 08:59:55Z agurtovoy $
-// $Date: 2010-07-02 04:59:55 -0400 (Fri, 02 Jul 2010) $
+// $Date: 2010-07-02 01:59:55 -0700 (Fri, 02 Jul 2010) $
// $Revision: 63520 $
// agurt, 23/jan/10: workaround a conflict with <iso646.h> header's
diff --git a/boost/mpl/bitwise.hpp b/boost/mpl/bitwise.hpp
index 740fff1e8b..fdaa0c5659 100644
--- a/boost/mpl/bitwise.hpp
+++ b/boost/mpl/bitwise.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: bitwise.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/bitand.hpp>
diff --git a/boost/mpl/bitxor.hpp b/boost/mpl/bitxor.hpp
index bbbc3dd5bc..1d1ec6e5d6 100644
--- a/boost/mpl/bitxor.hpp
+++ b/boost/mpl/bitxor.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: bitxor.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#define AUX778076_OP_NAME bitxor_
diff --git a/boost/mpl/bool.hpp b/boost/mpl/bool.hpp
index a815ac5f4d..cabf22f2ce 100644
--- a/boost/mpl/bool.hpp
+++ b/boost/mpl/bool.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: bool.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/bool_fwd.hpp>
diff --git a/boost/mpl/bool_fwd.hpp b/boost/mpl/bool_fwd.hpp
index 080d876218..e71ab9cc78 100644
--- a/boost/mpl/bool_fwd.hpp
+++ b/boost/mpl/bool_fwd.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: bool_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/adl_barrier.hpp>
diff --git a/boost/mpl/clear.hpp b/boost/mpl/clear.hpp
index c27f4b36ee..9cf16fab46 100644
--- a/boost/mpl/clear.hpp
+++ b/boost/mpl/clear.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: clear.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/clear_fwd.hpp>
diff --git a/boost/mpl/clear_fwd.hpp b/boost/mpl/clear_fwd.hpp
index da5a6eb4c7..e660bc26e9 100644
--- a/boost/mpl/clear_fwd.hpp
+++ b/boost/mpl/clear_fwd.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: clear_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
diff --git a/boost/mpl/comparison.hpp b/boost/mpl/comparison.hpp
index 005d280b46..223b9efe17 100644
--- a/boost/mpl/comparison.hpp
+++ b/boost/mpl/comparison.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: comparison.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/equal_to.hpp>
diff --git a/boost/mpl/contains.hpp b/boost/mpl/contains.hpp
index 68e50bb8ea..620fe41e73 100644
--- a/boost/mpl/contains.hpp
+++ b/boost/mpl/contains.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: contains.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/contains_fwd.hpp>
diff --git a/boost/mpl/contains_fwd.hpp b/boost/mpl/contains_fwd.hpp
index 57ae63f28f..af7721a594 100644
--- a/boost/mpl/contains_fwd.hpp
+++ b/boost/mpl/contains_fwd.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: contains_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
diff --git a/boost/mpl/copy.hpp b/boost/mpl/copy.hpp
index 77376d064a..6849ec87ab 100644
--- a/boost/mpl/copy.hpp
+++ b/boost/mpl/copy.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: copy.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/fold.hpp>
diff --git a/boost/mpl/copy_if.hpp b/boost/mpl/copy_if.hpp
index 937812e3b6..c7eb283aa3 100644
--- a/boost/mpl/copy_if.hpp
+++ b/boost/mpl/copy_if.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: copy_if.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/fold.hpp>
diff --git a/boost/mpl/count.hpp b/boost/mpl/count.hpp
index 8fc054a0cf..04fdb5f309 100644
--- a/boost/mpl/count.hpp
+++ b/boost/mpl/count.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: count.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/count_fwd.hpp>
diff --git a/boost/mpl/count_fwd.hpp b/boost/mpl/count_fwd.hpp
index d94ff0d6bc..4a0b4efa12 100644
--- a/boost/mpl/count_fwd.hpp
+++ b/boost/mpl/count_fwd.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: count_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
diff --git a/boost/mpl/count_if.hpp b/boost/mpl/count_if.hpp
index 1bc8f9bf87..d800ad015e 100644
--- a/boost/mpl/count_if.hpp
+++ b/boost/mpl/count_if.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: count_if.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/fold.hpp>
diff --git a/boost/mpl/deque.hpp b/boost/mpl/deque.hpp
index 0e59316df7..0fa2fcf7fa 100644
--- a/boost/mpl/deque.hpp
+++ b/boost/mpl/deque.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: deque.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/deref.hpp b/boost/mpl/deref.hpp
index fedf79e46f..15479e17c5 100644
--- a/boost/mpl/deref.hpp
+++ b/boost/mpl/deref.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: deref.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/msvc_type.hpp>
diff --git a/boost/mpl/distance.hpp b/boost/mpl/distance.hpp
index 9a180ab8d5..8ecd3c1b26 100644
--- a/boost/mpl/distance.hpp
+++ b/boost/mpl/distance.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: distance.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/distance_fwd.hpp>
diff --git a/boost/mpl/distance_fwd.hpp b/boost/mpl/distance_fwd.hpp
index ddd8698011..766ceb4290 100644
--- a/boost/mpl/distance_fwd.hpp
+++ b/boost/mpl/distance_fwd.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: distance_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/common_name_wknd.hpp>
diff --git a/boost/mpl/divides.hpp b/boost/mpl/divides.hpp
index bef224bf2a..6f544966e3 100644
--- a/boost/mpl/divides.hpp
+++ b/boost/mpl/divides.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: divides.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#define AUX778076_OP_NAME divides
diff --git a/boost/mpl/empty.hpp b/boost/mpl/empty.hpp
index adb3c76c44..e25c04c3ba 100644
--- a/boost/mpl/empty.hpp
+++ b/boost/mpl/empty.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: empty.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/empty_fwd.hpp>
diff --git a/boost/mpl/empty_base.hpp b/boost/mpl/empty_base.hpp
index ace1bdf56a..095003eba4 100644
--- a/boost/mpl/empty_base.hpp
+++ b/boost/mpl/empty_base.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: empty_base.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/bool.hpp>
diff --git a/boost/mpl/empty_fwd.hpp b/boost/mpl/empty_fwd.hpp
index 28b226352e..4bf68681e5 100644
--- a/boost/mpl/empty_fwd.hpp
+++ b/boost/mpl/empty_fwd.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: empty_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
diff --git a/boost/mpl/empty_sequence.hpp b/boost/mpl/empty_sequence.hpp
index eefb6d805c..fe505ea30a 100644
--- a/boost/mpl/empty_sequence.hpp
+++ b/boost/mpl/empty_sequence.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: empty_sequence.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/size_fwd.hpp>
diff --git a/boost/mpl/end.hpp b/boost/mpl/end.hpp
index 3b7f33d0a9..ddee55670b 100644
--- a/boost/mpl/end.hpp
+++ b/boost/mpl/end.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: end.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/begin_end.hpp>
diff --git a/boost/mpl/equal.hpp b/boost/mpl/equal.hpp
index 741e9109b5..09e26dbbab 100644
--- a/boost/mpl/equal.hpp
+++ b/boost/mpl/equal.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: equal.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/iter_fold_if_impl.hpp>
diff --git a/boost/mpl/equal_to.hpp b/boost/mpl/equal_to.hpp
index dee5f59efe..359031c5c5 100644
--- a/boost/mpl/equal_to.hpp
+++ b/boost/mpl/equal_to.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: equal_to.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#define AUX778076_OP_NAME equal_to
diff --git a/boost/mpl/erase.hpp b/boost/mpl/erase.hpp
index 6595309767..2bc09ad117 100644
--- a/boost/mpl/erase.hpp
+++ b/boost/mpl/erase.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: erase.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/erase_fwd.hpp>
diff --git a/boost/mpl/erase_fwd.hpp b/boost/mpl/erase_fwd.hpp
index 0626ecbfe6..1f833ca02b 100644
--- a/boost/mpl/erase_fwd.hpp
+++ b/boost/mpl/erase_fwd.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: erase_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
diff --git a/boost/mpl/erase_key.hpp b/boost/mpl/erase_key.hpp
index 84b486634f..9dcca4b408 100644
--- a/boost/mpl/erase_key.hpp
+++ b/boost/mpl/erase_key.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: erase_key.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/erase_key_fwd.hpp>
diff --git a/boost/mpl/erase_key_fwd.hpp b/boost/mpl/erase_key_fwd.hpp
index 4844893213..cebe5c662b 100644
--- a/boost/mpl/erase_key_fwd.hpp
+++ b/boost/mpl/erase_key_fwd.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: erase_key_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
diff --git a/boost/mpl/eval_if.hpp b/boost/mpl/eval_if.hpp
index d483c724d3..f1a5b7002f 100644
--- a/boost/mpl/eval_if.hpp
+++ b/boost/mpl/eval_if.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: eval_if.hpp 61921 2010-05-11 21:33:24Z neilgroves $
-// $Date: 2010-05-11 17:33:24 -0400 (Tue, 11 May 2010) $
+// $Date: 2010-05-11 14:33:24 -0700 (Tue, 11 May 2010) $
// $Revision: 61921 $
#include <boost/mpl/if.hpp>
diff --git a/boost/mpl/filter_view.hpp b/boost/mpl/filter_view.hpp
index c605f7fe50..c56b2157c2 100644
--- a/boost/mpl/filter_view.hpp
+++ b/boost/mpl/filter_view.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: filter_view.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/begin_end.hpp>
diff --git a/boost/mpl/find.hpp b/boost/mpl/find.hpp
index 6d71a88f0a..7b094239b8 100644
--- a/boost/mpl/find.hpp
+++ b/boost/mpl/find.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: find.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/find_if.hpp>
diff --git a/boost/mpl/find_if.hpp b/boost/mpl/find_if.hpp
index b1d41b789d..a066e7120b 100644
--- a/boost/mpl/find_if.hpp
+++ b/boost/mpl/find_if.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: find_if.hpp 49274 2008-10-11 07:22:05Z agurtovoy $
-// $Date: 2008-10-11 03:22:05 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-11 00:22:05 -0700 (Sat, 11 Oct 2008) $
// $Revision: 49274 $
#include <boost/mpl/aux_/find_if_pred.hpp>
diff --git a/boost/mpl/fold.hpp b/boost/mpl/fold.hpp
index 9645681f8e..e5e02bd712 100644
--- a/boost/mpl/fold.hpp
+++ b/boost/mpl/fold.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: fold.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/begin_end.hpp>
diff --git a/boost/mpl/for_each.hpp b/boost/mpl/for_each.hpp
index 89abc85d5e..016d99010a 100644
--- a/boost/mpl/for_each.hpp
+++ b/boost/mpl/for_each.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: for_each.hpp 55648 2009-08-18 05:16:53Z agurtovoy $
-// $Date: 2009-08-18 01:16:53 -0400 (Tue, 18 Aug 2009) $
+// $Date: 2009-08-17 22:16:53 -0700 (Mon, 17 Aug 2009) $
// $Revision: 55648 $
#include <boost/mpl/is_sequence.hpp>
diff --git a/boost/mpl/front.hpp b/boost/mpl/front.hpp
index 3ad64e4b9c..b2c5678c18 100644
--- a/boost/mpl/front.hpp
+++ b/boost/mpl/front.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: front.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/front_fwd.hpp>
diff --git a/boost/mpl/front_fwd.hpp b/boost/mpl/front_fwd.hpp
index 65ffcf2e4a..62750010eb 100644
--- a/boost/mpl/front_fwd.hpp
+++ b/boost/mpl/front_fwd.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: front_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
diff --git a/boost/mpl/front_inserter.hpp b/boost/mpl/front_inserter.hpp
index ee754cf433..7220f768bb 100644
--- a/boost/mpl/front_inserter.hpp
+++ b/boost/mpl/front_inserter.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: front_inserter.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/push_front.hpp>
diff --git a/boost/mpl/greater.hpp b/boost/mpl/greater.hpp
index e33ae487d5..c73276b2b3 100644
--- a/boost/mpl/greater.hpp
+++ b/boost/mpl/greater.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: greater.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#define AUX778076_OP_NAME greater
diff --git a/boost/mpl/greater_equal.hpp b/boost/mpl/greater_equal.hpp
index 91ccf83ece..119710f87c 100644
--- a/boost/mpl/greater_equal.hpp
+++ b/boost/mpl/greater_equal.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: greater_equal.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#define AUX778076_OP_NAME greater_equal
diff --git a/boost/mpl/has_key.hpp b/boost/mpl/has_key.hpp
index 85102edb9f..bdb96b4e42 100644
--- a/boost/mpl/has_key.hpp
+++ b/boost/mpl/has_key.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: has_key.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/has_key_fwd.hpp>
diff --git a/boost/mpl/has_key_fwd.hpp b/boost/mpl/has_key_fwd.hpp
index 49b0fb5191..9c784a16a3 100644
--- a/boost/mpl/has_key_fwd.hpp
+++ b/boost/mpl/has_key_fwd.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: has_key_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
diff --git a/boost/mpl/has_xxx.hpp b/boost/mpl/has_xxx.hpp
index 925875952a..121bc4853f 100644
--- a/boost/mpl/has_xxx.hpp
+++ b/boost/mpl/has_xxx.hpp
@@ -13,7 +13,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: has_xxx.hpp 64146 2010-07-19 00:46:31Z djwalker $
-// $Date: 2010-07-18 20:46:31 -0400 (Sun, 18 Jul 2010) $
+// $Date: 2010-07-18 17:46:31 -0700 (Sun, 18 Jul 2010) $
// $Revision: 64146 $
#include <boost/mpl/bool.hpp>
diff --git a/boost/mpl/identity.hpp b/boost/mpl/identity.hpp
index d72540bbf4..5424f7103b 100644
--- a/boost/mpl/identity.hpp
+++ b/boost/mpl/identity.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: identity.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/na_spec.hpp>
diff --git a/boost/mpl/if.hpp b/boost/mpl/if.hpp
index aa14d88017..245c993d98 100644
--- a/boost/mpl/if.hpp
+++ b/boost/mpl/if.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: if.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/value_wknd.hpp>
diff --git a/boost/mpl/index_if.hpp b/boost/mpl/index_if.hpp
index 75bd9bbdc5..3df5763c42 100644
--- a/boost/mpl/index_if.hpp
+++ b/boost/mpl/index_if.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: index_if.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/find_if_pred.hpp>
diff --git a/boost/mpl/index_of.hpp b/boost/mpl/index_of.hpp
index 19b1ac41de..0f49f04f8d 100644
--- a/boost/mpl/index_of.hpp
+++ b/boost/mpl/index_of.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: index_of.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/index_if.hpp>
diff --git a/boost/mpl/inherit.hpp b/boost/mpl/inherit.hpp
index 39e8ae1e28..59715ed1ad 100644
--- a/boost/mpl/inherit.hpp
+++ b/boost/mpl/inherit.hpp
@@ -15,7 +15,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: inherit.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/inherit_linearly.hpp b/boost/mpl/inherit_linearly.hpp
index 567d7d9e29..5bc2d7fab6 100644
--- a/boost/mpl/inherit_linearly.hpp
+++ b/boost/mpl/inherit_linearly.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: inherit_linearly.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/fold.hpp>
diff --git a/boost/mpl/insert.hpp b/boost/mpl/insert.hpp
index ebc52bcd70..ff03de62cd 100644
--- a/boost/mpl/insert.hpp
+++ b/boost/mpl/insert.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: insert.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/insert_fwd.hpp>
diff --git a/boost/mpl/insert_fwd.hpp b/boost/mpl/insert_fwd.hpp
index 9c6ff6437a..8e3208ed24 100644
--- a/boost/mpl/insert_fwd.hpp
+++ b/boost/mpl/insert_fwd.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: insert_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
diff --git a/boost/mpl/insert_range.hpp b/boost/mpl/insert_range.hpp
index 9332b9e9fd..30baf1d910 100644
--- a/boost/mpl/insert_range.hpp
+++ b/boost/mpl/insert_range.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: insert_range.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/insert_range_fwd.hpp>
diff --git a/boost/mpl/insert_range_fwd.hpp b/boost/mpl/insert_range_fwd.hpp
index 256d2a2f80..de85c0e646 100644
--- a/boost/mpl/insert_range_fwd.hpp
+++ b/boost/mpl/insert_range_fwd.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: insert_range_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
diff --git a/boost/mpl/inserter.hpp b/boost/mpl/inserter.hpp
index 8e2c676f73..0c014d17b8 100644
--- a/boost/mpl/inserter.hpp
+++ b/boost/mpl/inserter.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: inserter.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
diff --git a/boost/mpl/int.hpp b/boost/mpl/int.hpp
index 971ca90002..14db5482ec 100644
--- a/boost/mpl/int.hpp
+++ b/boost/mpl/int.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: int.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/int_fwd.hpp>
diff --git a/boost/mpl/int_fwd.hpp b/boost/mpl/int_fwd.hpp
index 0a0140ff49..87b043c104 100644
--- a/boost/mpl/int_fwd.hpp
+++ b/boost/mpl/int_fwd.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: int_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/adl_barrier.hpp>
diff --git a/boost/mpl/integral_c.hpp b/boost/mpl/integral_c.hpp
index 6c4d2bcdda..e270dc500a 100644
--- a/boost/mpl/integral_c.hpp
+++ b/boost/mpl/integral_c.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: integral_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/integral_c_fwd.hpp>
diff --git a/boost/mpl/integral_c_fwd.hpp b/boost/mpl/integral_c_fwd.hpp
index 46da935c2c..7fcbfd59d8 100644
--- a/boost/mpl/integral_c_fwd.hpp
+++ b/boost/mpl/integral_c_fwd.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: integral_c_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/workaround.hpp>
diff --git a/boost/mpl/integral_c_tag.hpp b/boost/mpl/integral_c_tag.hpp
index 2b43e79247..27da563c7d 100644
--- a/boost/mpl/integral_c_tag.hpp
+++ b/boost/mpl/integral_c_tag.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: integral_c_tag.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
diff --git a/boost/mpl/is_placeholder.hpp b/boost/mpl/is_placeholder.hpp
index 5b28b472f5..565df89cb2 100644
--- a/boost/mpl/is_placeholder.hpp
+++ b/boost/mpl/is_placeholder.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: is_placeholder.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/arg_fwd.hpp>
diff --git a/boost/mpl/is_sequence.hpp b/boost/mpl/is_sequence.hpp
index 0c1f67baaf..4e61fcfe43 100644
--- a/boost/mpl/is_sequence.hpp
+++ b/boost/mpl/is_sequence.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: is_sequence.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/not.hpp>
diff --git a/boost/mpl/iter_fold.hpp b/boost/mpl/iter_fold.hpp
index cb24707619..1b52dd43c2 100644
--- a/boost/mpl/iter_fold.hpp
+++ b/boost/mpl/iter_fold.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: iter_fold.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/begin_end.hpp>
diff --git a/boost/mpl/iter_fold_if.hpp b/boost/mpl/iter_fold_if.hpp
index da80564adc..01847ef541 100644
--- a/boost/mpl/iter_fold_if.hpp
+++ b/boost/mpl/iter_fold_if.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: iter_fold_if.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/begin_end.hpp>
diff --git a/boost/mpl/iterator_category.hpp b/boost/mpl/iterator_category.hpp
index 084c32f305..6ccc1b1d91 100644
--- a/boost/mpl/iterator_category.hpp
+++ b/boost/mpl/iterator_category.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: iterator_category.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/na_spec.hpp>
diff --git a/boost/mpl/iterator_range.hpp b/boost/mpl/iterator_range.hpp
index d3fd43b537..995ddc0334 100644
--- a/boost/mpl/iterator_range.hpp
+++ b/boost/mpl/iterator_range.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: iterator_range.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/na_spec.hpp>
diff --git a/boost/mpl/iterator_tags.hpp b/boost/mpl/iterator_tags.hpp
index 46431a3231..fce273446b 100644
--- a/boost/mpl/iterator_tags.hpp
+++ b/boost/mpl/iterator_tags.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: iterator_tags.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/int.hpp>
diff --git a/boost/mpl/joint_view.hpp b/boost/mpl/joint_view.hpp
index dd8d91f646..2672fad348 100644
--- a/boost/mpl/joint_view.hpp
+++ b/boost/mpl/joint_view.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: joint_view.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/joint_iter.hpp>
diff --git a/boost/mpl/key_type.hpp b/boost/mpl/key_type.hpp
index f32a886d0b..e1e0cd93f9 100644
--- a/boost/mpl/key_type.hpp
+++ b/boost/mpl/key_type.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: key_type.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/key_type_fwd.hpp>
diff --git a/boost/mpl/key_type_fwd.hpp b/boost/mpl/key_type_fwd.hpp
index 95f84451c1..e59b395b30 100644
--- a/boost/mpl/key_type_fwd.hpp
+++ b/boost/mpl/key_type_fwd.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: key_type_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
diff --git a/boost/mpl/lambda.hpp b/boost/mpl/lambda.hpp
index 165135f5e7..05c27167e8 100644
--- a/boost/mpl/lambda.hpp
+++ b/boost/mpl/lambda.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: lambda.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/lambda_fwd.hpp>
diff --git a/boost/mpl/lambda_fwd.hpp b/boost/mpl/lambda_fwd.hpp
index f02837bd7f..16c73e4ad8 100644
--- a/boost/mpl/lambda_fwd.hpp
+++ b/boost/mpl/lambda_fwd.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: lambda_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/void_fwd.hpp>
diff --git a/boost/mpl/less.hpp b/boost/mpl/less.hpp
index 11d860d1c5..33a570c2c8 100644
--- a/boost/mpl/less.hpp
+++ b/boost/mpl/less.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: less.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#define AUX778076_OP_NAME less
diff --git a/boost/mpl/less_equal.hpp b/boost/mpl/less_equal.hpp
index 2284d1d0c2..8b9a4ffe89 100644
--- a/boost/mpl/less_equal.hpp
+++ b/boost/mpl/less_equal.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: less_equal.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#define AUX778076_OP_NAME less_equal
diff --git a/boost/mpl/limits/arity.hpp b/boost/mpl/limits/arity.hpp
index 91e4606392..9da70ab34d 100644
--- a/boost/mpl/limits/arity.hpp
+++ b/boost/mpl/limits/arity.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: arity.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_LIMIT_METAFUNCTION_ARITY)
diff --git a/boost/mpl/limits/list.hpp b/boost/mpl/limits/list.hpp
index ee9c7aa187..6ae7387dca 100644
--- a/boost/mpl/limits/list.hpp
+++ b/boost/mpl/limits/list.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: list.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_LIMIT_LIST_SIZE)
diff --git a/boost/mpl/limits/map.hpp b/boost/mpl/limits/map.hpp
index 1c24890f96..92c4a24b12 100644
--- a/boost/mpl/limits/map.hpp
+++ b/boost/mpl/limits/map.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: map.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_LIMIT_MAP_SIZE)
diff --git a/boost/mpl/limits/set.hpp b/boost/mpl/limits/set.hpp
index 01edbcdb73..a4473b0fa2 100644
--- a/boost/mpl/limits/set.hpp
+++ b/boost/mpl/limits/set.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: set.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_LIMIT_SET_SIZE)
diff --git a/boost/mpl/limits/unrolling.hpp b/boost/mpl/limits/unrolling.hpp
index 4ba3efb94f..3914f0aaab 100644
--- a/boost/mpl/limits/unrolling.hpp
+++ b/boost/mpl/limits/unrolling.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: unrolling.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_LIMIT_UNROLLING)
diff --git a/boost/mpl/limits/vector.hpp b/boost/mpl/limits/vector.hpp
index 9a0accfa1b..5de3811c40 100644
--- a/boost/mpl/limits/vector.hpp
+++ b/boost/mpl/limits/vector.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: vector.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_LIMIT_VECTOR_SIZE)
diff --git a/boost/mpl/list.hpp b/boost/mpl/list.hpp
index 838b8f4b12..6d968314a8 100644
--- a/boost/mpl/list.hpp
+++ b/boost/mpl/list.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: list.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/list/aux_/O1_size.hpp b/boost/mpl/list/aux_/O1_size.hpp
index 6ef2cf7fa0..0d93dabe28 100644
--- a/boost/mpl/list/aux_/O1_size.hpp
+++ b/boost/mpl/list/aux_/O1_size.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: O1_size.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/O1_size_fwd.hpp>
diff --git a/boost/mpl/list/aux_/begin_end.hpp b/boost/mpl/list/aux_/begin_end.hpp
index dab60f318c..7fbddad59e 100644
--- a/boost/mpl/list/aux_/begin_end.hpp
+++ b/boost/mpl/list/aux_/begin_end.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: begin_end.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/begin_end_fwd.hpp>
diff --git a/boost/mpl/list/aux_/clear.hpp b/boost/mpl/list/aux_/clear.hpp
index 247a4de536..3deafe7a0b 100644
--- a/boost/mpl/list/aux_/clear.hpp
+++ b/boost/mpl/list/aux_/clear.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: clear.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/clear_fwd.hpp>
diff --git a/boost/mpl/list/aux_/empty.hpp b/boost/mpl/list/aux_/empty.hpp
index 6ab60cfee0..c282cfe3db 100644
--- a/boost/mpl/list/aux_/empty.hpp
+++ b/boost/mpl/list/aux_/empty.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: empty.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/empty_fwd.hpp>
diff --git a/boost/mpl/list/aux_/front.hpp b/boost/mpl/list/aux_/front.hpp
index 8defa99450..eb0b689e4b 100644
--- a/boost/mpl/list/aux_/front.hpp
+++ b/boost/mpl/list/aux_/front.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: front.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/front_fwd.hpp>
diff --git a/boost/mpl/list/aux_/include_preprocessed.hpp b/boost/mpl/list/aux_/include_preprocessed.hpp
index 431b51f5d9..4e7f6e4501 100644
--- a/boost/mpl/list/aux_/include_preprocessed.hpp
+++ b/boost/mpl/list/aux_/include_preprocessed.hpp
@@ -8,7 +8,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: include_preprocessed.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION!
diff --git a/boost/mpl/list/aux_/item.hpp b/boost/mpl/list/aux_/item.hpp
index 37ddff75e4..24b5e40602 100644
--- a/boost/mpl/list/aux_/item.hpp
+++ b/boost/mpl/list/aux_/item.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: item.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/long.hpp>
diff --git a/boost/mpl/list/aux_/iterator.hpp b/boost/mpl/list/aux_/iterator.hpp
index b94126cf72..4d0431fd79 100644
--- a/boost/mpl/list/aux_/iterator.hpp
+++ b/boost/mpl/list/aux_/iterator.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: iterator.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/iterator_tags.hpp>
diff --git a/boost/mpl/list/aux_/numbered.hpp b/boost/mpl/list/aux_/numbered.hpp
index de8d4041d3..7b661e51e2 100644
--- a/boost/mpl/list/aux_/numbered.hpp
+++ b/boost/mpl/list/aux_/numbered.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: numbered.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if defined(BOOST_PP_IS_ITERATING)
diff --git a/boost/mpl/list/aux_/numbered_c.hpp b/boost/mpl/list/aux_/numbered_c.hpp
index f3043827b1..0c8e9f6d11 100644
--- a/boost/mpl/list/aux_/numbered_c.hpp
+++ b/boost/mpl/list/aux_/numbered_c.hpp
@@ -10,7 +10,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: numbered_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if defined(BOOST_PP_IS_ITERATING)
diff --git a/boost/mpl/list/aux_/pop_front.hpp b/boost/mpl/list/aux_/pop_front.hpp
index e053391c84..9c72228971 100644
--- a/boost/mpl/list/aux_/pop_front.hpp
+++ b/boost/mpl/list/aux_/pop_front.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: pop_front.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/pop_front_fwd.hpp>
diff --git a/boost/mpl/list/aux_/push_back.hpp b/boost/mpl/list/aux_/push_back.hpp
index 6adb7db762..8e9c34ba1c 100644
--- a/boost/mpl/list/aux_/push_back.hpp
+++ b/boost/mpl/list/aux_/push_back.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: push_back.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/push_back_fwd.hpp>
diff --git a/boost/mpl/list/aux_/push_front.hpp b/boost/mpl/list/aux_/push_front.hpp
index a601fea169..942508b7a7 100644
--- a/boost/mpl/list/aux_/push_front.hpp
+++ b/boost/mpl/list/aux_/push_front.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: push_front.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/push_front_fwd.hpp>
diff --git a/boost/mpl/list/aux_/size.hpp b/boost/mpl/list/aux_/size.hpp
index 4ecbab83ca..9d7191f2e1 100644
--- a/boost/mpl/list/aux_/size.hpp
+++ b/boost/mpl/list/aux_/size.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: size.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/size_fwd.hpp>
diff --git a/boost/mpl/list/aux_/tag.hpp b/boost/mpl/list/aux_/tag.hpp
index d44bfe40e8..e1a75337ad 100644
--- a/boost/mpl/list/aux_/tag.hpp
+++ b/boost/mpl/list/aux_/tag.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: tag.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl { namespace aux {
diff --git a/boost/mpl/list/list0.hpp b/boost/mpl/list/list0.hpp
index 58e93cff56..3ecdac34c8 100644
--- a/boost/mpl/list/list0.hpp
+++ b/boost/mpl/list/list0.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: list0.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/long.hpp>
diff --git a/boost/mpl/list/list0_c.hpp b/boost/mpl/list/list0_c.hpp
index ed9bca5f43..066661faa5 100644
--- a/boost/mpl/list/list0_c.hpp
+++ b/boost/mpl/list/list0_c.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: list0_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/list/list0.hpp>
diff --git a/boost/mpl/list/list10.hpp b/boost/mpl/list/list10.hpp
index 4a4ee19954..23546948c3 100644
--- a/boost/mpl/list/list10.hpp
+++ b/boost/mpl/list/list10.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: list10.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/list/list10_c.hpp b/boost/mpl/list/list10_c.hpp
index e05ef87530..b1c8e1b274 100644
--- a/boost/mpl/list/list10_c.hpp
+++ b/boost/mpl/list/list10_c.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: list10_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/list/list20.hpp b/boost/mpl/list/list20.hpp
index 9321192a49..29f7d5dde3 100644
--- a/boost/mpl/list/list20.hpp
+++ b/boost/mpl/list/list20.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: list20.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/list/list20_c.hpp b/boost/mpl/list/list20_c.hpp
index bc807e664d..d7f772ce9c 100644
--- a/boost/mpl/list/list20_c.hpp
+++ b/boost/mpl/list/list20_c.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: list20_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/list/list30.hpp b/boost/mpl/list/list30.hpp
index f736f8c590..704cbdf6f6 100644
--- a/boost/mpl/list/list30.hpp
+++ b/boost/mpl/list/list30.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: list30.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/list/list30_c.hpp b/boost/mpl/list/list30_c.hpp
index e682086d99..54fd22f925 100644
--- a/boost/mpl/list/list30_c.hpp
+++ b/boost/mpl/list/list30_c.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: list30_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/list/list40.hpp b/boost/mpl/list/list40.hpp
index 8560d8fa37..11d12e36aa 100644
--- a/boost/mpl/list/list40.hpp
+++ b/boost/mpl/list/list40.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: list40.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/list/list40_c.hpp b/boost/mpl/list/list40_c.hpp
index 5c5bfdfa4d..0ae99fc08c 100644
--- a/boost/mpl/list/list40_c.hpp
+++ b/boost/mpl/list/list40_c.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: list40_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/list/list50.hpp b/boost/mpl/list/list50.hpp
index dcaf18ebfd..4050a81cb0 100644
--- a/boost/mpl/list/list50.hpp
+++ b/boost/mpl/list/list50.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: list50.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/list/list50_c.hpp b/boost/mpl/list/list50_c.hpp
index 0f38e07d13..4b5b654038 100644
--- a/boost/mpl/list/list50_c.hpp
+++ b/boost/mpl/list/list50_c.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: list50_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/list_c.hpp b/boost/mpl/list_c.hpp
index eb46db108a..984f6c3b27 100644
--- a/boost/mpl/list_c.hpp
+++ b/boost/mpl/list_c.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: list_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/logical.hpp b/boost/mpl/logical.hpp
index 256ea32b18..f8b8fc3dba 100644
--- a/boost/mpl/logical.hpp
+++ b/boost/mpl/logical.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: logical.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/or.hpp>
diff --git a/boost/mpl/long.hpp b/boost/mpl/long.hpp
index a3e35b16bb..1c79afd3d6 100644
--- a/boost/mpl/long.hpp
+++ b/boost/mpl/long.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: long.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/long_fwd.hpp>
diff --git a/boost/mpl/long_fwd.hpp b/boost/mpl/long_fwd.hpp
index 4c1b604603..17accd3976 100644
--- a/boost/mpl/long_fwd.hpp
+++ b/boost/mpl/long_fwd.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: long_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/adl_barrier.hpp>
diff --git a/boost/mpl/lower_bound.hpp b/boost/mpl/lower_bound.hpp
index 21dca16ccd..058e0ba043 100644
--- a/boost/mpl/lower_bound.hpp
+++ b/boost/mpl/lower_bound.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: lower_bound.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/less.hpp>
diff --git a/boost/mpl/map.hpp b/boost/mpl/map.hpp
index ceecbf17fe..3355f000d3 100644
--- a/boost/mpl/map.hpp
+++ b/boost/mpl/map.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: map.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/map/aux_/at_impl.hpp b/boost/mpl/map/aux_/at_impl.hpp
index dcec6b2c34..e531a704cc 100644
--- a/boost/mpl/map/aux_/at_impl.hpp
+++ b/boost/mpl/map/aux_/at_impl.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: at_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/at_fwd.hpp>
diff --git a/boost/mpl/map/aux_/begin_end_impl.hpp b/boost/mpl/map/aux_/begin_end_impl.hpp
index 7e5afb9b9c..b450ecf713 100644
--- a/boost/mpl/map/aux_/begin_end_impl.hpp
+++ b/boost/mpl/map/aux_/begin_end_impl.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: begin_end_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/begin_end_fwd.hpp>
diff --git a/boost/mpl/map/aux_/clear_impl.hpp b/boost/mpl/map/aux_/clear_impl.hpp
index eb5ac9b3b5..d2020a2e41 100644
--- a/boost/mpl/map/aux_/clear_impl.hpp
+++ b/boost/mpl/map/aux_/clear_impl.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: clear_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/clear_fwd.hpp>
diff --git a/boost/mpl/map/aux_/contains_impl.hpp b/boost/mpl/map/aux_/contains_impl.hpp
index 73a832ec15..67402334ad 100644
--- a/boost/mpl/map/aux_/contains_impl.hpp
+++ b/boost/mpl/map/aux_/contains_impl.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: contains_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/contains_fwd.hpp>
diff --git a/boost/mpl/map/aux_/empty_impl.hpp b/boost/mpl/map/aux_/empty_impl.hpp
index 99dde3e268..b4f3511ea0 100644
--- a/boost/mpl/map/aux_/empty_impl.hpp
+++ b/boost/mpl/map/aux_/empty_impl.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: empty_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/empty_fwd.hpp>
diff --git a/boost/mpl/map/aux_/erase_impl.hpp b/boost/mpl/map/aux_/erase_impl.hpp
index 1eae144262..8328e80183 100644
--- a/boost/mpl/map/aux_/erase_impl.hpp
+++ b/boost/mpl/map/aux_/erase_impl.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: erase_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/erase_fwd.hpp>
diff --git a/boost/mpl/map/aux_/erase_key_impl.hpp b/boost/mpl/map/aux_/erase_key_impl.hpp
index d1dbd7c6fa..9a8a715f83 100644
--- a/boost/mpl/map/aux_/erase_key_impl.hpp
+++ b/boost/mpl/map/aux_/erase_key_impl.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: erase_key_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/erase_key_fwd.hpp>
diff --git a/boost/mpl/map/aux_/has_key_impl.hpp b/boost/mpl/map/aux_/has_key_impl.hpp
index 70278ac97b..3ff49c2492 100644
--- a/boost/mpl/map/aux_/has_key_impl.hpp
+++ b/boost/mpl/map/aux_/has_key_impl.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: has_key_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/has_key_fwd.hpp>
diff --git a/boost/mpl/map/aux_/include_preprocessed.hpp b/boost/mpl/map/aux_/include_preprocessed.hpp
index bff33965a6..89e4b16462 100644
--- a/boost/mpl/map/aux_/include_preprocessed.hpp
+++ b/boost/mpl/map/aux_/include_preprocessed.hpp
@@ -8,7 +8,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: include_preprocessed.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION!
diff --git a/boost/mpl/map/aux_/insert_impl.hpp b/boost/mpl/map/aux_/insert_impl.hpp
index 411909f8f2..ab0aad388a 100644
--- a/boost/mpl/map/aux_/insert_impl.hpp
+++ b/boost/mpl/map/aux_/insert_impl.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: insert_impl.hpp 55751 2009-08-24 04:11:00Z agurtovoy $
-// $Date: 2009-08-24 00:11:00 -0400 (Mon, 24 Aug 2009) $
+// $Date: 2009-08-23 21:11:00 -0700 (Sun, 23 Aug 2009) $
// $Revision: 55751 $
#include <boost/mpl/insert_fwd.hpp>
diff --git a/boost/mpl/map/aux_/item.hpp b/boost/mpl/map/aux_/item.hpp
index e9b5eccbfb..8ff86b39cb 100644
--- a/boost/mpl/map/aux_/item.hpp
+++ b/boost/mpl/map/aux_/item.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: item.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/void.hpp>
diff --git a/boost/mpl/map/aux_/iterator.hpp b/boost/mpl/map/aux_/iterator.hpp
index 403170751d..ecae6f8a22 100644
--- a/boost/mpl/map/aux_/iterator.hpp
+++ b/boost/mpl/map/aux_/iterator.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: iterator.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/map/aux_/map0.hpp>
diff --git a/boost/mpl/map/aux_/key_type_impl.hpp b/boost/mpl/map/aux_/key_type_impl.hpp
index e8750eb377..df883fc332 100644
--- a/boost/mpl/map/aux_/key_type_impl.hpp
+++ b/boost/mpl/map/aux_/key_type_impl.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: key_type_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/key_type_fwd.hpp>
diff --git a/boost/mpl/map/aux_/map0.hpp b/boost/mpl/map/aux_/map0.hpp
index 9646cf8fb1..acba1a4b1e 100644
--- a/boost/mpl/map/aux_/map0.hpp
+++ b/boost/mpl/map/aux_/map0.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: map0.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/long.hpp>
diff --git a/boost/mpl/map/aux_/numbered.hpp b/boost/mpl/map/aux_/numbered.hpp
index b092839b86..453fe87834 100644
--- a/boost/mpl/map/aux_/numbered.hpp
+++ b/boost/mpl/map/aux_/numbered.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: numbered.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#else
diff --git a/boost/mpl/map/aux_/size_impl.hpp b/boost/mpl/map/aux_/size_impl.hpp
index 70febc57cd..786e169cfb 100644
--- a/boost/mpl/map/aux_/size_impl.hpp
+++ b/boost/mpl/map/aux_/size_impl.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: size_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/size_fwd.hpp>
diff --git a/boost/mpl/map/aux_/tag.hpp b/boost/mpl/map/aux_/tag.hpp
index a698ddcf9c..05bb3ab0a1 100644
--- a/boost/mpl/map/aux_/tag.hpp
+++ b/boost/mpl/map/aux_/tag.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: tag.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl { namespace aux {
diff --git a/boost/mpl/map/aux_/value_type_impl.hpp b/boost/mpl/map/aux_/value_type_impl.hpp
index ca779677d0..edf3d892e7 100644
--- a/boost/mpl/map/aux_/value_type_impl.hpp
+++ b/boost/mpl/map/aux_/value_type_impl.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: value_type_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/value_type_fwd.hpp>
diff --git a/boost/mpl/map/map0.hpp b/boost/mpl/map/map0.hpp
index a130844ec7..c1082ffbf2 100644
--- a/boost/mpl/map/map0.hpp
+++ b/boost/mpl/map/map0.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: map0.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/map/aux_/contains_impl.hpp>
diff --git a/boost/mpl/map/map10.hpp b/boost/mpl/map/map10.hpp
index bc9ab754a0..efe0e6a036 100644
--- a/boost/mpl/map/map10.hpp
+++ b/boost/mpl/map/map10.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: map10.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/map/map20.hpp b/boost/mpl/map/map20.hpp
index f63571e3c9..24500830c0 100644
--- a/boost/mpl/map/map20.hpp
+++ b/boost/mpl/map/map20.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: map20.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/map/map30.hpp b/boost/mpl/map/map30.hpp
index c08b89d67d..3480ebe0e5 100644
--- a/boost/mpl/map/map30.hpp
+++ b/boost/mpl/map/map30.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: map30.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/map/map40.hpp b/boost/mpl/map/map40.hpp
index 426c31b540..ef928faf23 100644
--- a/boost/mpl/map/map40.hpp
+++ b/boost/mpl/map/map40.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: map40.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/map/map50.hpp b/boost/mpl/map/map50.hpp
index 2058e54a71..8eae6403d8 100644
--- a/boost/mpl/map/map50.hpp
+++ b/boost/mpl/map/map50.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: map50.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/math/fixed_c.hpp b/boost/mpl/math/fixed_c.hpp
index 25e775dd52..15b6b3ddf3 100644
--- a/boost/mpl/math/fixed_c.hpp
+++ b/boost/mpl/math/fixed_c.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: fixed_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/static_constant.hpp>
diff --git a/boost/mpl/math/is_even.hpp b/boost/mpl/math/is_even.hpp
index 46a5711e0b..eb8aada7c4 100644
--- a/boost/mpl/math/is_even.hpp
+++ b/boost/mpl/math/is_even.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: is_even.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/bool.hpp>
diff --git a/boost/mpl/math/rational_c.hpp b/boost/mpl/math/rational_c.hpp
index 44eb755d4d..37429207a1 100644
--- a/boost/mpl/math/rational_c.hpp
+++ b/boost/mpl/math/rational_c.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: rational_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/static_constant.hpp>
diff --git a/boost/mpl/max.hpp b/boost/mpl/max.hpp
index c3c9bb68be..dec4bc1faf 100644
--- a/boost/mpl/max.hpp
+++ b/boost/mpl/max.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: max.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/min_max.hpp>
diff --git a/boost/mpl/max_element.hpp b/boost/mpl/max_element.hpp
index 6d16dfcb81..cbfb711281 100644
--- a/boost/mpl/max_element.hpp
+++ b/boost/mpl/max_element.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: max_element.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/less.hpp>
diff --git a/boost/mpl/min.hpp b/boost/mpl/min.hpp
index 23d093dba5..b39461e880 100644
--- a/boost/mpl/min.hpp
+++ b/boost/mpl/min.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: min.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/min_max.hpp>
diff --git a/boost/mpl/min_element.hpp b/boost/mpl/min_element.hpp
index 88c1cc48ec..45c0681eef 100644
--- a/boost/mpl/min_element.hpp
+++ b/boost/mpl/min_element.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: min_element.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/max_element.hpp>
diff --git a/boost/mpl/min_max.hpp b/boost/mpl/min_max.hpp
index 944b776d61..97261bb940 100644
--- a/boost/mpl/min_max.hpp
+++ b/boost/mpl/min_max.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: min_max.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/less.hpp>
diff --git a/boost/mpl/minus.hpp b/boost/mpl/minus.hpp
index a737185a78..123b8afecb 100644
--- a/boost/mpl/minus.hpp
+++ b/boost/mpl/minus.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: minus.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#define AUX778076_OP_NAME minus
diff --git a/boost/mpl/modulus.hpp b/boost/mpl/modulus.hpp
index b3777b6ed9..99338b1496 100644
--- a/boost/mpl/modulus.hpp
+++ b/boost/mpl/modulus.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: modulus.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#define AUX778076_OP_NAME modulus
diff --git a/boost/mpl/multiplies.hpp b/boost/mpl/multiplies.hpp
index 772b7bd869..1c0ec9f54e 100644
--- a/boost/mpl/multiplies.hpp
+++ b/boost/mpl/multiplies.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: multiplies.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/times.hpp>
diff --git a/boost/mpl/multiset/aux_/count_impl.hpp b/boost/mpl/multiset/aux_/count_impl.hpp
index a1a6215a2d..e2fb634451 100644
--- a/boost/mpl/multiset/aux_/count_impl.hpp
+++ b/boost/mpl/multiset/aux_/count_impl.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: count_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/multiset/aux_/tag.hpp>
diff --git a/boost/mpl/multiset/aux_/insert_impl.hpp b/boost/mpl/multiset/aux_/insert_impl.hpp
index db5e7761e8..8fd694e1d9 100644
--- a/boost/mpl/multiset/aux_/insert_impl.hpp
+++ b/boost/mpl/multiset/aux_/insert_impl.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: insert_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/multiset/aux_/item.hpp>
diff --git a/boost/mpl/multiset/aux_/item.hpp b/boost/mpl/multiset/aux_/item.hpp
index 9512930af9..86499d14d1 100644
--- a/boost/mpl/multiset/aux_/item.hpp
+++ b/boost/mpl/multiset/aux_/item.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: item.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/multiset/aux_/tag.hpp>
diff --git a/boost/mpl/multiset/aux_/multiset0.hpp b/boost/mpl/multiset/aux_/multiset0.hpp
index b4b325a759..e29799e617 100644
--- a/boost/mpl/multiset/aux_/multiset0.hpp
+++ b/boost/mpl/multiset/aux_/multiset0.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: multiset0.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/multiset/aux_/tag.hpp>
diff --git a/boost/mpl/multiset/aux_/tag.hpp b/boost/mpl/multiset/aux_/tag.hpp
index 5f3a8c0015..d8fc9db8a1 100644
--- a/boost/mpl/multiset/aux_/tag.hpp
+++ b/boost/mpl/multiset/aux_/tag.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: tag.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl { namespace aux {
diff --git a/boost/mpl/multiset/multiset0.hpp b/boost/mpl/multiset/multiset0.hpp
index d01d938937..3b05121c16 100644
--- a/boost/mpl/multiset/multiset0.hpp
+++ b/boost/mpl/multiset/multiset0.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: multiset0.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
//#include <boost/mpl/multiset/aux_/at.hpp>
diff --git a/boost/mpl/negate.hpp b/boost/mpl/negate.hpp
index bb8bcdd2aa..3d51caf38c 100644
--- a/boost/mpl/negate.hpp
+++ b/boost/mpl/negate.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: negate.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/integral_c.hpp>
diff --git a/boost/mpl/next.hpp b/boost/mpl/next.hpp
index 3d4e7119b8..fcfb01bb11 100644
--- a/boost/mpl/next.hpp
+++ b/boost/mpl/next.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: next.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/next_prior.hpp>
diff --git a/boost/mpl/next_prior.hpp b/boost/mpl/next_prior.hpp
index 4a9655b040..c65d4c4d10 100644
--- a/boost/mpl/next_prior.hpp
+++ b/boost/mpl/next_prior.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: next_prior.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/common_name_wknd.hpp>
diff --git a/boost/mpl/not.hpp b/boost/mpl/not.hpp
index 2abc0db049..9886d7d8b2 100644
--- a/boost/mpl/not.hpp
+++ b/boost/mpl/not.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: not.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/bool.hpp>
diff --git a/boost/mpl/not_equal_to.hpp b/boost/mpl/not_equal_to.hpp
index 00132b1eaa..b6997dffdf 100644
--- a/boost/mpl/not_equal_to.hpp
+++ b/boost/mpl/not_equal_to.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: not_equal_to.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#define AUX778076_OP_NAME not_equal_to
diff --git a/boost/mpl/numeric_cast.hpp b/boost/mpl/numeric_cast.hpp
index 808ede0687..f890e44ee8 100644
--- a/boost/mpl/numeric_cast.hpp
+++ b/boost/mpl/numeric_cast.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: numeric_cast.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/msvc.hpp>
diff --git a/boost/mpl/or.hpp b/boost/mpl/or.hpp
index 470644905d..16b42c1439 100644
--- a/boost/mpl/or.hpp
+++ b/boost/mpl/or.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: or.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/use_preprocessed.hpp>
diff --git a/boost/mpl/order.hpp b/boost/mpl/order.hpp
index 25dab66df5..e37da0e783 100644
--- a/boost/mpl/order.hpp
+++ b/boost/mpl/order.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: order.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/order_fwd.hpp>
diff --git a/boost/mpl/order_fwd.hpp b/boost/mpl/order_fwd.hpp
index 313a2c3f2c..bce09fa0bd 100644
--- a/boost/mpl/order_fwd.hpp
+++ b/boost/mpl/order_fwd.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: order_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
diff --git a/boost/mpl/pair.hpp b/boost/mpl/pair.hpp
index b3fb02658d..9336ca19ea 100644
--- a/boost/mpl/pair.hpp
+++ b/boost/mpl/pair.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: pair.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/msvc_eti_base.hpp>
diff --git a/boost/mpl/pair_view.hpp b/boost/mpl/pair_view.hpp
index 43430f53a5..06f6bacd2f 100644
--- a/boost/mpl/pair_view.hpp
+++ b/boost/mpl/pair_view.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: pair_view.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/begin_end.hpp>
diff --git a/boost/mpl/partition.hpp b/boost/mpl/partition.hpp
index 97a569a146..888653ec26 100644
--- a/boost/mpl/partition.hpp
+++ b/boost/mpl/partition.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: partition.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/stable_partition.hpp>
diff --git a/boost/mpl/placeholders.hpp b/boost/mpl/placeholders.hpp
index c1a38d9f4a..891a81851a 100644
--- a/boost/mpl/placeholders.hpp
+++ b/boost/mpl/placeholders.hpp
@@ -16,7 +16,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: placeholders.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
diff --git a/boost/mpl/plus.hpp b/boost/mpl/plus.hpp
index 79642eb840..9f68c49bdc 100644
--- a/boost/mpl/plus.hpp
+++ b/boost/mpl/plus.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: plus.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#define AUX778076_OP_NAME plus
diff --git a/boost/mpl/pop_back.hpp b/boost/mpl/pop_back.hpp
index 429fb87432..e4affcaca2 100644
--- a/boost/mpl/pop_back.hpp
+++ b/boost/mpl/pop_back.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: pop_back.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/pop_back_fwd.hpp>
diff --git a/boost/mpl/pop_back_fwd.hpp b/boost/mpl/pop_back_fwd.hpp
index 4fba829fa8..c8209a790a 100644
--- a/boost/mpl/pop_back_fwd.hpp
+++ b/boost/mpl/pop_back_fwd.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: pop_back_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
diff --git a/boost/mpl/pop_front.hpp b/boost/mpl/pop_front.hpp
index 6f6c3b990c..dead80fb0b 100644
--- a/boost/mpl/pop_front.hpp
+++ b/boost/mpl/pop_front.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: pop_front.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/pop_front_fwd.hpp>
diff --git a/boost/mpl/pop_front_fwd.hpp b/boost/mpl/pop_front_fwd.hpp
index 64d4c58e8e..eb78347b98 100644
--- a/boost/mpl/pop_front_fwd.hpp
+++ b/boost/mpl/pop_front_fwd.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: pop_front_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
diff --git a/boost/mpl/print.hpp b/boost/mpl/print.hpp
index a8528500cc..c726fac0eb 100644
--- a/boost/mpl/print.hpp
+++ b/boost/mpl/print.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: print.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/msvc.hpp>
diff --git a/boost/mpl/prior.hpp b/boost/mpl/prior.hpp
index e08d967004..b8f0dff2d5 100644
--- a/boost/mpl/prior.hpp
+++ b/boost/mpl/prior.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: prior.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/next_prior.hpp>
diff --git a/boost/mpl/protect.hpp b/boost/mpl/protect.hpp
index 4fad8352b6..e3daa4feef 100644
--- a/boost/mpl/protect.hpp
+++ b/boost/mpl/protect.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: protect.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/arity.hpp>
diff --git a/boost/mpl/push_back.hpp b/boost/mpl/push_back.hpp
index 96389a37dd..2e8ad068ec 100644
--- a/boost/mpl/push_back.hpp
+++ b/boost/mpl/push_back.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: push_back.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/push_back_fwd.hpp>
diff --git a/boost/mpl/push_back_fwd.hpp b/boost/mpl/push_back_fwd.hpp
index 381aa299b2..ef04ff537f 100644
--- a/boost/mpl/push_back_fwd.hpp
+++ b/boost/mpl/push_back_fwd.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: push_back_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
diff --git a/boost/mpl/push_front.hpp b/boost/mpl/push_front.hpp
index 3c4283cc3e..ca943bbee5 100644
--- a/boost/mpl/push_front.hpp
+++ b/boost/mpl/push_front.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: push_front.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/push_front_fwd.hpp>
diff --git a/boost/mpl/push_front_fwd.hpp b/boost/mpl/push_front_fwd.hpp
index 11123bf4a6..fa3667ca56 100644
--- a/boost/mpl/push_front_fwd.hpp
+++ b/boost/mpl/push_front_fwd.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: push_front_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
diff --git a/boost/mpl/quote.hpp b/boost/mpl/quote.hpp
index 52f67bf62b..53b57124af 100644
--- a/boost/mpl/quote.hpp
+++ b/boost/mpl/quote.hpp
@@ -15,7 +15,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: quote.hpp 49272 2008-10-11 06:50:46Z agurtovoy $
-// $Date: 2008-10-11 02:50:46 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:50:46 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49272 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/range_c.hpp b/boost/mpl/range_c.hpp
index d3e07a82cc..7072ad36fe 100644
--- a/boost/mpl/range_c.hpp
+++ b/boost/mpl/range_c.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: range_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/integral_c.hpp>
diff --git a/boost/mpl/remove.hpp b/boost/mpl/remove.hpp
index 61f42a9e71..7ed621fe9b 100644
--- a/boost/mpl/remove.hpp
+++ b/boost/mpl/remove.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: remove.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/remove_if.hpp>
diff --git a/boost/mpl/remove_if.hpp b/boost/mpl/remove_if.hpp
index f707abd423..1275bd43dc 100644
--- a/boost/mpl/remove_if.hpp
+++ b/boost/mpl/remove_if.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: remove_if.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/fold.hpp>
diff --git a/boost/mpl/replace.hpp b/boost/mpl/replace.hpp
index 6bc12b2fc2..3fab34600b 100644
--- a/boost/mpl/replace.hpp
+++ b/boost/mpl/replace.hpp
@@ -13,7 +13,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: replace.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/replace_if.hpp>
diff --git a/boost/mpl/replace_if.hpp b/boost/mpl/replace_if.hpp
index 64ccb14a1a..349480e62f 100644
--- a/boost/mpl/replace_if.hpp
+++ b/boost/mpl/replace_if.hpp
@@ -13,7 +13,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: replace_if.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/transform.hpp>
diff --git a/boost/mpl/reverse.hpp b/boost/mpl/reverse.hpp
index fc3383778c..3221ecbd01 100644
--- a/boost/mpl/reverse.hpp
+++ b/boost/mpl/reverse.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: reverse.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/copy.hpp>
diff --git a/boost/mpl/reverse_fold.hpp b/boost/mpl/reverse_fold.hpp
index 79b6ec7756..bcf3157d18 100644
--- a/boost/mpl/reverse_fold.hpp
+++ b/boost/mpl/reverse_fold.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: reverse_fold.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/begin_end.hpp>
diff --git a/boost/mpl/reverse_iter_fold.hpp b/boost/mpl/reverse_iter_fold.hpp
index e6b3ed3ac2..9965c272ab 100644
--- a/boost/mpl/reverse_iter_fold.hpp
+++ b/boost/mpl/reverse_iter_fold.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: reverse_iter_fold.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/begin_end.hpp>
diff --git a/boost/mpl/same_as.hpp b/boost/mpl/same_as.hpp
index e95d55f0a1..c82cfd7caa 100644
--- a/boost/mpl/same_as.hpp
+++ b/boost/mpl/same_as.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: same_as.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/not.hpp>
diff --git a/boost/mpl/sequence_tag.hpp b/boost/mpl/sequence_tag.hpp
index 41450ed36b..479175e3cb 100644
--- a/boost/mpl/sequence_tag.hpp
+++ b/boost/mpl/sequence_tag.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: sequence_tag.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/sequence_tag_fwd.hpp>
diff --git a/boost/mpl/sequence_tag_fwd.hpp b/boost/mpl/sequence_tag_fwd.hpp
index 07d54a4ace..07a6707e00 100644
--- a/boost/mpl/sequence_tag_fwd.hpp
+++ b/boost/mpl/sequence_tag_fwd.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: sequence_tag_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
diff --git a/boost/mpl/set.hpp b/boost/mpl/set.hpp
index 5d16e5a837..5392d5f218 100644
--- a/boost/mpl/set.hpp
+++ b/boost/mpl/set.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: set.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/set/aux_/at_impl.hpp b/boost/mpl/set/aux_/at_impl.hpp
index ad7447749b..feed3d3b9c 100644
--- a/boost/mpl/set/aux_/at_impl.hpp
+++ b/boost/mpl/set/aux_/at_impl.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: at_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/at_fwd.hpp>
diff --git a/boost/mpl/set/aux_/begin_end_impl.hpp b/boost/mpl/set/aux_/begin_end_impl.hpp
index f012c2ac19..09d270229c 100644
--- a/boost/mpl/set/aux_/begin_end_impl.hpp
+++ b/boost/mpl/set/aux_/begin_end_impl.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: begin_end_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/begin_end_fwd.hpp>
diff --git a/boost/mpl/set/aux_/clear_impl.hpp b/boost/mpl/set/aux_/clear_impl.hpp
index 4c965f672f..c0b1450ac8 100644
--- a/boost/mpl/set/aux_/clear_impl.hpp
+++ b/boost/mpl/set/aux_/clear_impl.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: clear_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/clear_fwd.hpp>
diff --git a/boost/mpl/set/aux_/empty_impl.hpp b/boost/mpl/set/aux_/empty_impl.hpp
index d40a9c48f7..1940c55a53 100644
--- a/boost/mpl/set/aux_/empty_impl.hpp
+++ b/boost/mpl/set/aux_/empty_impl.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: empty_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/empty_fwd.hpp>
diff --git a/boost/mpl/set/aux_/erase_impl.hpp b/boost/mpl/set/aux_/erase_impl.hpp
index 954a70c6fc..541c785e81 100644
--- a/boost/mpl/set/aux_/erase_impl.hpp
+++ b/boost/mpl/set/aux_/erase_impl.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: erase_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/erase_fwd.hpp>
diff --git a/boost/mpl/set/aux_/erase_key_impl.hpp b/boost/mpl/set/aux_/erase_key_impl.hpp
index 9885196fc0..3cee21dd16 100644
--- a/boost/mpl/set/aux_/erase_key_impl.hpp
+++ b/boost/mpl/set/aux_/erase_key_impl.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: erase_key_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/erase_key_fwd.hpp>
diff --git a/boost/mpl/set/aux_/has_key_impl.hpp b/boost/mpl/set/aux_/has_key_impl.hpp
index d3cae504b3..e76019579a 100644
--- a/boost/mpl/set/aux_/has_key_impl.hpp
+++ b/boost/mpl/set/aux_/has_key_impl.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: has_key_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/set/aux_/tag.hpp>
diff --git a/boost/mpl/set/aux_/include_preprocessed.hpp b/boost/mpl/set/aux_/include_preprocessed.hpp
index 5016aed209..08cb73404c 100644
--- a/boost/mpl/set/aux_/include_preprocessed.hpp
+++ b/boost/mpl/set/aux_/include_preprocessed.hpp
@@ -10,7 +10,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: include_preprocessed.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/preprocessor.hpp>
diff --git a/boost/mpl/set/aux_/insert_impl.hpp b/boost/mpl/set/aux_/insert_impl.hpp
index f1d72ec0f8..3d3d41d939 100644
--- a/boost/mpl/set/aux_/insert_impl.hpp
+++ b/boost/mpl/set/aux_/insert_impl.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: insert_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/insert_fwd.hpp>
diff --git a/boost/mpl/set/aux_/item.hpp b/boost/mpl/set/aux_/item.hpp
index b9ca19ebdf..bc39662871 100644
--- a/boost/mpl/set/aux_/item.hpp
+++ b/boost/mpl/set/aux_/item.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: item.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/long.hpp>
diff --git a/boost/mpl/set/aux_/iterator.hpp b/boost/mpl/set/aux_/iterator.hpp
index 90666a6892..c855b3e240 100644
--- a/boost/mpl/set/aux_/iterator.hpp
+++ b/boost/mpl/set/aux_/iterator.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: iterator.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/set/aux_/set0.hpp>
diff --git a/boost/mpl/set/aux_/key_type_impl.hpp b/boost/mpl/set/aux_/key_type_impl.hpp
index 23b1a1823f..1a221680b9 100644
--- a/boost/mpl/set/aux_/key_type_impl.hpp
+++ b/boost/mpl/set/aux_/key_type_impl.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: key_type_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/key_type_fwd.hpp>
diff --git a/boost/mpl/set/aux_/numbered.hpp b/boost/mpl/set/aux_/numbered.hpp
index 09d9849c44..95cea0c866 100644
--- a/boost/mpl/set/aux_/numbered.hpp
+++ b/boost/mpl/set/aux_/numbered.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: numbered.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/preprocessor/enum_params.hpp>
diff --git a/boost/mpl/set/aux_/numbered_c.hpp b/boost/mpl/set/aux_/numbered_c.hpp
index 179172be10..6365d2a869 100644
--- a/boost/mpl/set/aux_/numbered_c.hpp
+++ b/boost/mpl/set/aux_/numbered_c.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: numbered_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/preprocessor/repetition/enum_params.hpp>
diff --git a/boost/mpl/set/aux_/set0.hpp b/boost/mpl/set/aux_/set0.hpp
index 58f1d7d778..82719b893f 100644
--- a/boost/mpl/set/aux_/set0.hpp
+++ b/boost/mpl/set/aux_/set0.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: set0.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/long.hpp>
diff --git a/boost/mpl/set/aux_/size_impl.hpp b/boost/mpl/set/aux_/size_impl.hpp
index 04437766c5..2e35bdbe5a 100644
--- a/boost/mpl/set/aux_/size_impl.hpp
+++ b/boost/mpl/set/aux_/size_impl.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: size_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/size_fwd.hpp>
diff --git a/boost/mpl/set/aux_/tag.hpp b/boost/mpl/set/aux_/tag.hpp
index 651ed44bb5..b3e76a15a0 100644
--- a/boost/mpl/set/aux_/tag.hpp
+++ b/boost/mpl/set/aux_/tag.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: tag.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl { namespace aux {
diff --git a/boost/mpl/set/aux_/value_type_impl.hpp b/boost/mpl/set/aux_/value_type_impl.hpp
index 7166dae0ed..19cea4e380 100644
--- a/boost/mpl/set/aux_/value_type_impl.hpp
+++ b/boost/mpl/set/aux_/value_type_impl.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: value_type_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/value_type_fwd.hpp>
diff --git a/boost/mpl/set/set0.hpp b/boost/mpl/set/set0.hpp
index f6e5b6089e..9fd195071c 100644
--- a/boost/mpl/set/set0.hpp
+++ b/boost/mpl/set/set0.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: set0.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/set/aux_/at_impl.hpp>
diff --git a/boost/mpl/set/set0_c.hpp b/boost/mpl/set/set0_c.hpp
index ed9c9acd78..cf548890f2 100644
--- a/boost/mpl/set/set0_c.hpp
+++ b/boost/mpl/set/set0_c.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: set0_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/set/set0.hpp>
diff --git a/boost/mpl/set/set10.hpp b/boost/mpl/set/set10.hpp
index d474245b04..5cf0add71f 100644
--- a/boost/mpl/set/set10.hpp
+++ b/boost/mpl/set/set10.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: set10.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/set/set10_c.hpp b/boost/mpl/set/set10_c.hpp
index cfb5d76d33..e40fd55335 100644
--- a/boost/mpl/set/set10_c.hpp
+++ b/boost/mpl/set/set10_c.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: set10_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/set/set20.hpp b/boost/mpl/set/set20.hpp
index c7367b802e..c4928bfb88 100644
--- a/boost/mpl/set/set20.hpp
+++ b/boost/mpl/set/set20.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: set20.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/set/set20_c.hpp b/boost/mpl/set/set20_c.hpp
index 822dc2f2db..669420e02b 100644
--- a/boost/mpl/set/set20_c.hpp
+++ b/boost/mpl/set/set20_c.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: set20_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/set/set30.hpp b/boost/mpl/set/set30.hpp
index 64b1646db2..401cc2314d 100644
--- a/boost/mpl/set/set30.hpp
+++ b/boost/mpl/set/set30.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: set30.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/set/set30_c.hpp b/boost/mpl/set/set30_c.hpp
index 458755922b..ba5ce1cdfa 100644
--- a/boost/mpl/set/set30_c.hpp
+++ b/boost/mpl/set/set30_c.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: set30_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/set/set40.hpp b/boost/mpl/set/set40.hpp
index 8ac37528d6..a22d54c365 100644
--- a/boost/mpl/set/set40.hpp
+++ b/boost/mpl/set/set40.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: set40.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/set/set40_c.hpp b/boost/mpl/set/set40_c.hpp
index 12bd0fadf6..d593bd565e 100644
--- a/boost/mpl/set/set40_c.hpp
+++ b/boost/mpl/set/set40_c.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: set40_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/set/set50.hpp b/boost/mpl/set/set50.hpp
index bf459b1349..4f425372ba 100644
--- a/boost/mpl/set/set50.hpp
+++ b/boost/mpl/set/set50.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: set50.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/set/set50_c.hpp b/boost/mpl/set/set50_c.hpp
index 6e24792ba8..f64c8ee730 100644
--- a/boost/mpl/set/set50_c.hpp
+++ b/boost/mpl/set/set50_c.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: set50_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/set_c.hpp b/boost/mpl/set_c.hpp
index 43cffcb2d5..c7bf8497e6 100644
--- a/boost/mpl/set_c.hpp
+++ b/boost/mpl/set_c.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: set_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/shift_left.hpp b/boost/mpl/shift_left.hpp
index 8a7e248cbb..a20bf05de4 100644
--- a/boost/mpl/shift_left.hpp
+++ b/boost/mpl/shift_left.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: shift_left.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#define AUX778076_OP_NAME shift_left
diff --git a/boost/mpl/shift_right.hpp b/boost/mpl/shift_right.hpp
index 114d972a52..a03444c04b 100644
--- a/boost/mpl/shift_right.hpp
+++ b/boost/mpl/shift_right.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: shift_right.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#define AUX778076_OP_NAME shift_right
diff --git a/boost/mpl/single_view.hpp b/boost/mpl/single_view.hpp
index 8bd72c38fe..132121fbfb 100644
--- a/boost/mpl/single_view.hpp
+++ b/boost/mpl/single_view.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: single_view.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/single_element_iter.hpp>
diff --git a/boost/mpl/size.hpp b/boost/mpl/size.hpp
index 6ff2e65cbc..54b13cbb27 100644
--- a/boost/mpl/size.hpp
+++ b/boost/mpl/size.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: size.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/size_fwd.hpp>
diff --git a/boost/mpl/size_fwd.hpp b/boost/mpl/size_fwd.hpp
index 2bab81663d..8702da7f88 100644
--- a/boost/mpl/size_fwd.hpp
+++ b/boost/mpl/size_fwd.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: size_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
diff --git a/boost/mpl/size_t.hpp b/boost/mpl/size_t.hpp
index e72d77f8cd..54a05c6a22 100644
--- a/boost/mpl/size_t.hpp
+++ b/boost/mpl/size_t.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: size_t.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/size_t_fwd.hpp>
diff --git a/boost/mpl/size_t_fwd.hpp b/boost/mpl/size_t_fwd.hpp
index 84e903b041..396a521ffe 100644
--- a/boost/mpl/size_t_fwd.hpp
+++ b/boost/mpl/size_t_fwd.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: size_t_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/adl_barrier.hpp>
diff --git a/boost/mpl/sizeof.hpp b/boost/mpl/sizeof.hpp
index 8ad9d24d3f..018f826008 100644
--- a/boost/mpl/sizeof.hpp
+++ b/boost/mpl/sizeof.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: sizeof.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/size_t.hpp>
diff --git a/boost/mpl/sort.hpp b/boost/mpl/sort.hpp
index 0136d4c56e..04bdad6fac 100644
--- a/boost/mpl/sort.hpp
+++ b/boost/mpl/sort.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: sort.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/sort_impl.hpp>
diff --git a/boost/mpl/stable_partition.hpp b/boost/mpl/stable_partition.hpp
index 6dc4eeadb4..93066bb038 100644
--- a/boost/mpl/stable_partition.hpp
+++ b/boost/mpl/stable_partition.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: stable_partition.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/fold.hpp>
diff --git a/boost/mpl/switch.hpp b/boost/mpl/switch.hpp
index bfba5b0972..b5cba77fa3 100644
--- a/boost/mpl/switch.hpp
+++ b/boost/mpl/switch.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: switch.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/find_if.hpp>
diff --git a/boost/mpl/tag.hpp b/boost/mpl/tag.hpp
index 747646ccca..fc0aee233b 100644
--- a/boost/mpl/tag.hpp
+++ b/boost/mpl/tag.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: tag.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/eval_if.hpp>
diff --git a/boost/mpl/times.hpp b/boost/mpl/times.hpp
index ea61eaff49..c73256df79 100644
--- a/boost/mpl/times.hpp
+++ b/boost/mpl/times.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: times.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#define AUX778076_OP_NAME times
diff --git a/boost/mpl/transform.hpp b/boost/mpl/transform.hpp
index f36720786c..cb2b64ed9f 100644
--- a/boost/mpl/transform.hpp
+++ b/boost/mpl/transform.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: transform.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/fold.hpp>
diff --git a/boost/mpl/transform_view.hpp b/boost/mpl/transform_view.hpp
index 3448d7a7ae..88b46b1182 100644
--- a/boost/mpl/transform_view.hpp
+++ b/boost/mpl/transform_view.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: transform_view.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/begin_end.hpp>
diff --git a/boost/mpl/unique.hpp b/boost/mpl/unique.hpp
index e1ef8f5075..7e9c1e9de6 100644
--- a/boost/mpl/unique.hpp
+++ b/boost/mpl/unique.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: unique.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/fold.hpp>
diff --git a/boost/mpl/unpack_args.hpp b/boost/mpl/unpack_args.hpp
index c5949939b6..1e4d48c948 100644
--- a/boost/mpl/unpack_args.hpp
+++ b/boost/mpl/unpack_args.hpp
@@ -15,7 +15,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: unpack_args.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/upper_bound.hpp b/boost/mpl/upper_bound.hpp
index 527e74dff0..caf5cdff1a 100644
--- a/boost/mpl/upper_bound.hpp
+++ b/boost/mpl/upper_bound.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: upper_bound.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/less.hpp>
diff --git a/boost/mpl/value_type.hpp b/boost/mpl/value_type.hpp
index 6286d21f04..ad34393a75 100644
--- a/boost/mpl/value_type.hpp
+++ b/boost/mpl/value_type.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: value_type.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/value_type_fwd.hpp>
diff --git a/boost/mpl/value_type_fwd.hpp b/boost/mpl/value_type_fwd.hpp
index 96de3ad333..e9f0b28497 100644
--- a/boost/mpl/value_type_fwd.hpp
+++ b/boost/mpl/value_type_fwd.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: value_type_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
diff --git a/boost/mpl/vector.hpp b/boost/mpl/vector.hpp
index 94858ff7c1..833f193150 100644
--- a/boost/mpl/vector.hpp
+++ b/boost/mpl/vector.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: vector.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/vector/aux_/O1_size.hpp b/boost/mpl/vector/aux_/O1_size.hpp
index 7697a24fff..3ca8d214cf 100644
--- a/boost/mpl/vector/aux_/O1_size.hpp
+++ b/boost/mpl/vector/aux_/O1_size.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: O1_size.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/O1_size_fwd.hpp>
diff --git a/boost/mpl/vector/aux_/at.hpp b/boost/mpl/vector/aux_/at.hpp
index c859f2d001..9da05956c9 100644
--- a/boost/mpl/vector/aux_/at.hpp
+++ b/boost/mpl/vector/aux_/at.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: at.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/at_fwd.hpp>
diff --git a/boost/mpl/vector/aux_/back.hpp b/boost/mpl/vector/aux_/back.hpp
index 4969e622d0..ce84c7a019 100644
--- a/boost/mpl/vector/aux_/back.hpp
+++ b/boost/mpl/vector/aux_/back.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: back.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/back_fwd.hpp>
diff --git a/boost/mpl/vector/aux_/begin_end.hpp b/boost/mpl/vector/aux_/begin_end.hpp
index f2bedf3219..d79ef9a072 100644
--- a/boost/mpl/vector/aux_/begin_end.hpp
+++ b/boost/mpl/vector/aux_/begin_end.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: begin_end.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/typeof.hpp>
diff --git a/boost/mpl/vector/aux_/clear.hpp b/boost/mpl/vector/aux_/clear.hpp
index 5a5d2d03d8..3308518a2a 100644
--- a/boost/mpl/vector/aux_/clear.hpp
+++ b/boost/mpl/vector/aux_/clear.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: clear.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/clear_fwd.hpp>
diff --git a/boost/mpl/vector/aux_/empty.hpp b/boost/mpl/vector/aux_/empty.hpp
index 8e76c3e4ca..84c879222f 100644
--- a/boost/mpl/vector/aux_/empty.hpp
+++ b/boost/mpl/vector/aux_/empty.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: empty.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/empty_fwd.hpp>
diff --git a/boost/mpl/vector/aux_/front.hpp b/boost/mpl/vector/aux_/front.hpp
index 74b4c50084..ff2414eeb6 100644
--- a/boost/mpl/vector/aux_/front.hpp
+++ b/boost/mpl/vector/aux_/front.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: front.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/front_fwd.hpp>
diff --git a/boost/mpl/vector/aux_/include_preprocessed.hpp b/boost/mpl/vector/aux_/include_preprocessed.hpp
index 247b6edd87..5c16008218 100644
--- a/boost/mpl/vector/aux_/include_preprocessed.hpp
+++ b/boost/mpl/vector/aux_/include_preprocessed.hpp
@@ -10,7 +10,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: include_preprocessed.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/typeof.hpp>
diff --git a/boost/mpl/vector/aux_/item.hpp b/boost/mpl/vector/aux_/item.hpp
index 96002b9484..da2b01ba93 100644
--- a/boost/mpl/vector/aux_/item.hpp
+++ b/boost/mpl/vector/aux_/item.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: item.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/long.hpp>
diff --git a/boost/mpl/vector/aux_/iterator.hpp b/boost/mpl/vector/aux_/iterator.hpp
index 5864affb8b..770ed15d0e 100644
--- a/boost/mpl/vector/aux_/iterator.hpp
+++ b/boost/mpl/vector/aux_/iterator.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: iterator.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/vector/aux_/at.hpp>
diff --git a/boost/mpl/vector/aux_/numbered.hpp b/boost/mpl/vector/aux_/numbered.hpp
index 0e5acc016d..04265a39a4 100644
--- a/boost/mpl/vector/aux_/numbered.hpp
+++ b/boost/mpl/vector/aux_/numbered.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: numbered.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/preprocessor/enum_params.hpp>
diff --git a/boost/mpl/vector/aux_/numbered_c.hpp b/boost/mpl/vector/aux_/numbered_c.hpp
index dc1349784b..6a7cf40e5d 100644
--- a/boost/mpl/vector/aux_/numbered_c.hpp
+++ b/boost/mpl/vector/aux_/numbered_c.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: numbered_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/preprocessor/enum_params.hpp>
diff --git a/boost/mpl/vector/aux_/pop_back.hpp b/boost/mpl/vector/aux_/pop_back.hpp
index aa902169de..a43a3a6b7d 100644
--- a/boost/mpl/vector/aux_/pop_back.hpp
+++ b/boost/mpl/vector/aux_/pop_back.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: pop_back.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/pop_back_fwd.hpp>
diff --git a/boost/mpl/vector/aux_/pop_front.hpp b/boost/mpl/vector/aux_/pop_front.hpp
index 854d1e7700..a448d25bf3 100644
--- a/boost/mpl/vector/aux_/pop_front.hpp
+++ b/boost/mpl/vector/aux_/pop_front.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: pop_front.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/pop_front_fwd.hpp>
diff --git a/boost/mpl/vector/aux_/push_back.hpp b/boost/mpl/vector/aux_/push_back.hpp
index b51c770f64..d8783ccb48 100644
--- a/boost/mpl/vector/aux_/push_back.hpp
+++ b/boost/mpl/vector/aux_/push_back.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: push_back.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/push_back_fwd.hpp>
diff --git a/boost/mpl/vector/aux_/push_front.hpp b/boost/mpl/vector/aux_/push_front.hpp
index efa2aae841..26b5f0002c 100644
--- a/boost/mpl/vector/aux_/push_front.hpp
+++ b/boost/mpl/vector/aux_/push_front.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: push_front.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/push_front_fwd.hpp>
diff --git a/boost/mpl/vector/aux_/size.hpp b/boost/mpl/vector/aux_/size.hpp
index bd40b549c9..41b7be635b 100644
--- a/boost/mpl/vector/aux_/size.hpp
+++ b/boost/mpl/vector/aux_/size.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: size.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/size_fwd.hpp>
diff --git a/boost/mpl/vector/aux_/tag.hpp b/boost/mpl/vector/aux_/tag.hpp
index 77d627b25f..0f37e92adb 100644
--- a/boost/mpl/vector/aux_/tag.hpp
+++ b/boost/mpl/vector/aux_/tag.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: tag.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/typeof.hpp>
diff --git a/boost/mpl/vector/aux_/vector0.hpp b/boost/mpl/vector/aux_/vector0.hpp
index 65c5544e0b..b3bb13bbaa 100644
--- a/boost/mpl/vector/aux_/vector0.hpp
+++ b/boost/mpl/vector/aux_/vector0.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: vector0.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/long.hpp>
diff --git a/boost/mpl/vector/vector0.hpp b/boost/mpl/vector/vector0.hpp
index 249ecbb8c9..9d18104eb7 100644
--- a/boost/mpl/vector/vector0.hpp
+++ b/boost/mpl/vector/vector0.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: vector0.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/vector/aux_/at.hpp>
diff --git a/boost/mpl/vector/vector0_c.hpp b/boost/mpl/vector/vector0_c.hpp
index 630af92a8f..eb1dcf98b1 100644
--- a/boost/mpl/vector/vector0_c.hpp
+++ b/boost/mpl/vector/vector0_c.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: vector0_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/vector/vector0.hpp>
diff --git a/boost/mpl/vector/vector10.hpp b/boost/mpl/vector/vector10.hpp
index 344c92cfcc..848dd82c0b 100644
--- a/boost/mpl/vector/vector10.hpp
+++ b/boost/mpl/vector/vector10.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: vector10.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/vector/vector10_c.hpp b/boost/mpl/vector/vector10_c.hpp
index 05e97ad7c3..4e6cf3b6e4 100644
--- a/boost/mpl/vector/vector10_c.hpp
+++ b/boost/mpl/vector/vector10_c.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: vector10_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/vector/vector20.hpp b/boost/mpl/vector/vector20.hpp
index ffa867e036..173eacfffe 100644
--- a/boost/mpl/vector/vector20.hpp
+++ b/boost/mpl/vector/vector20.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: vector20.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/vector/vector20_c.hpp b/boost/mpl/vector/vector20_c.hpp
index cc13d517dc..c6b7187c26 100644
--- a/boost/mpl/vector/vector20_c.hpp
+++ b/boost/mpl/vector/vector20_c.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: vector20_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/vector/vector30.hpp b/boost/mpl/vector/vector30.hpp
index f54c61cf1b..476ec354b9 100644
--- a/boost/mpl/vector/vector30.hpp
+++ b/boost/mpl/vector/vector30.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: vector30.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/vector/vector30_c.hpp b/boost/mpl/vector/vector30_c.hpp
index a8e3e60d98..c20d8f980e 100644
--- a/boost/mpl/vector/vector30_c.hpp
+++ b/boost/mpl/vector/vector30_c.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: vector30_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/vector/vector40.hpp b/boost/mpl/vector/vector40.hpp
index 2d24b6d87a..69203d0cb4 100644
--- a/boost/mpl/vector/vector40.hpp
+++ b/boost/mpl/vector/vector40.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: vector40.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/vector/vector40_c.hpp b/boost/mpl/vector/vector40_c.hpp
index 9179b263e9..bd7310c148 100644
--- a/boost/mpl/vector/vector40_c.hpp
+++ b/boost/mpl/vector/vector40_c.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: vector40_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/vector/vector50.hpp b/boost/mpl/vector/vector50.hpp
index 0050483b21..4c3e23181f 100644
--- a/boost/mpl/vector/vector50.hpp
+++ b/boost/mpl/vector/vector50.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: vector50.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/vector/vector50_c.hpp b/boost/mpl/vector/vector50_c.hpp
index 04967421fb..2d2e705601 100644
--- a/boost/mpl/vector/vector50_c.hpp
+++ b/boost/mpl/vector/vector50_c.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: vector50_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/vector_c.hpp b/boost/mpl/vector_c.hpp
index 44da446034..d9f35d0b57 100644
--- a/boost/mpl/vector_c.hpp
+++ b/boost/mpl/vector_c.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: vector_c.hpp 49271 2008-10-11 06:46:00Z agurtovoy $
-// $Date: 2008-10-11 02:46:00 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:46:00 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49271 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
diff --git a/boost/mpl/void.hpp b/boost/mpl/void.hpp
index f464acb551..ad5aa56460 100644
--- a/boost/mpl/void.hpp
+++ b/boost/mpl/void.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: void.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/void_fwd.hpp>
diff --git a/boost/mpl/void_fwd.hpp b/boost/mpl/void_fwd.hpp
index 0dcd6392a7..9643dec302 100644
--- a/boost/mpl/void_fwd.hpp
+++ b/boost/mpl/void_fwd.hpp
@@ -11,7 +11,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: void_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/adl_barrier.hpp>
diff --git a/boost/mpl/zip_view.hpp b/boost/mpl/zip_view.hpp
index fc5225f5f6..4bc26c1eec 100644
--- a/boost/mpl/zip_view.hpp
+++ b/boost/mpl/zip_view.hpp
@@ -12,7 +12,7 @@
// See http://www.boost.org/libs/mpl for documentation.
// $Id: zip_view.hpp 61591 2010-04-26 21:31:09Z agurtovoy $
-// $Date: 2010-04-26 17:31:09 -0400 (Mon, 26 Apr 2010) $
+// $Date: 2010-04-26 14:31:09 -0700 (Mon, 26 Apr 2010) $
// $Revision: 61591 $
#include <boost/mpl/transform.hpp>
diff --git a/boost/msm/back/dispatch_table.hpp b/boost/msm/back/dispatch_table.hpp
index d233ff61db..caa830efc1 100644
--- a/boost/msm/back/dispatch_table.hpp
+++ b/boost/msm/back/dispatch_table.hpp
@@ -21,7 +21,9 @@
#include <boost/mpl/advance.hpp>
#include <boost/type_traits/is_base_of.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/msm/event_traits.hpp>
#include <boost/msm/back/metafunctions.hpp>
#include <boost/msm/back/common_types.hpp>
@@ -146,6 +148,16 @@ struct dispatch_table
typedef typename generate_state_set<Stt>::type state_list;
BOOST_STATIC_CONSTANT(int, max_state = ( ::boost::mpl::size<state_list>::value));
+ template <class Transition>
+ struct convert_event_and_forward
+ {
+ static HandledEnum execute(Fsm& fsm, int region_index, int state, Event const& evt)
+ {
+ typename Transition::transition_event forwarded(evt);
+ return Transition::execute(fsm,region_index,state,forwarded);
+ }
+ };
+
// A function object for use with mpl::for_each that stuffs
// transitions into cells.
struct init_cell
@@ -159,7 +171,7 @@ struct dispatch_table
typename ::boost::disable_if<
typename ::boost::is_same<typename Transition::current_state_type,Fsm>::type
,void>::type
- init_event_base_case(Transition const&, ::boost::mpl::true_ const &) const
+ init_event_base_case(Transition const&, ::boost::mpl::true_ const &, ::boost::mpl::false_ const &) const
{
typedef typename create_stt<Fsm>::type stt;
BOOST_STATIC_CONSTANT(int, state_id =
@@ -170,18 +182,40 @@ struct dispatch_table
typename ::boost::enable_if<
typename ::boost::is_same<typename Transition::current_state_type,Fsm>::type
,void>::type
- init_event_base_case(Transition const&, ::boost::mpl::true_ const &) const
+ init_event_base_case(Transition const&, ::boost::mpl::true_ const &, ::boost::mpl::false_ const &) const
{
self->entries[0] = reinterpret_cast<cell>(&Transition::execute);
}
+ // version for transition event is boost::any
+ // first for all transitions, then for internal ones of a fsm
+ template <class Transition>
+ typename ::boost::disable_if<
+ typename ::boost::is_same<typename Transition::current_state_type,Fsm>::type
+ ,void>::type
+ init_event_base_case(Transition const&, ::boost::mpl::false_ const &, ::boost::mpl::true_ const &) const
+ {
+ typedef typename create_stt<Fsm>::type stt;
+ BOOST_STATIC_CONSTANT(int, state_id =
+ (get_state_id<stt,typename Transition::current_state_type>::value));
+ self->entries[state_id+1] = &convert_event_and_forward<Transition>::execute;
+ }
+ template <class Transition>
+ typename ::boost::enable_if<
+ typename ::boost::is_same<typename Transition::current_state_type,Fsm>::type
+ ,void>::type
+ init_event_base_case(Transition const&, ::boost::mpl::false_ const &, ::boost::mpl::true_ const &) const
+ {
+ self->entries[0] = &convert_event_and_forward<Transition>::execute;
+ }
+
// version for transition event base of our event
// first for all transitions, then for internal ones of a fsm
template <class Transition>
typename ::boost::disable_if<
typename ::boost::is_same<typename Transition::current_state_type,Fsm>::type
,void>::type
- init_event_base_case(Transition const&, ::boost::mpl::false_ const &) const
+ init_event_base_case(Transition const&, ::boost::mpl::false_ const &, ::boost::mpl::false_ const &) const
{
typedef typename create_stt<Fsm>::type stt;
BOOST_STATIC_CONSTANT(int, state_id =
@@ -192,7 +226,7 @@ struct dispatch_table
typename ::boost::enable_if<
typename ::boost::is_same<typename Transition::current_state_type,Fsm>::type
,void>::type
- init_event_base_case(Transition const&, ::boost::mpl::false_ const &) const
+ init_event_base_case(Transition const&, ::boost::mpl::false_ const &, ::boost::mpl::false_ const &) const
{
self->entries[0] = &Transition::execute;
}
@@ -210,7 +244,9 @@ struct dispatch_table
//only if the transition event is a base of our event is the reinterpret_case safe
init_event_base_case(tr,
::boost::mpl::bool_<
- ::boost::is_base_of<typename Transition::transition_event,Event>::type::value>() );
+ ::boost::is_base_of<typename Transition::transition_event,Event>::type::value>(),
+ ::boost::mpl::bool_<
+ ::boost::msm::is_kleene_event<typename Transition::transition_event>::type::value>());
}
dispatch_table* self;
@@ -277,8 +313,12 @@ struct dispatch_table
// this event is a compound one (not a real one, just one for use in event-less transitions)
// Note this event cannot be used as deferred!
+ // case for internal transitions of this fsm
template <class State>
- void operator()(boost::msm::wrap<State> const&)
+ typename ::boost::disable_if<
+ typename ::boost::is_same<State,Fsm>::type
+ ,void>::type
+ operator()(boost::msm::wrap<State> const&,boost::msm::back::dummy<0> = 0)
{
typedef typename create_stt<Fsm>::type stt;
BOOST_STATIC_CONSTANT(int, state_id = (get_state_id<stt,State>::value));
@@ -286,6 +326,15 @@ struct dispatch_table
tofill_entries[state_id+1] = call_no_transition;
}
+ template <class State>
+ typename ::boost::enable_if<
+ typename ::boost::is_same<State,Fsm>::type
+ ,void>::type
+ operator()(boost::msm::wrap<State> const&,boost::msm::back::dummy<1> = 0)
+ {
+ cell call_no_transition = &Fsm::default_eventless_transition;
+ tofill_entries[0] = call_no_transition;
+ }
dispatch_table* self;
cell* tofill_entries;
};
@@ -305,7 +354,11 @@ struct dispatch_table
typedef typename ::boost::mpl::reverse_fold<
// filter on event
::boost::mpl::filter_view
- <Stt, ::boost::is_base_of<transition_event< ::boost::mpl::placeholders::_>, Event> >,
+ <Stt, boost::mpl::or_<
+ ::boost::is_base_of<transition_event< ::boost::mpl::placeholders::_>, Event>,
+ ::boost::msm::is_kleene_event<transition_event< ::boost::mpl::placeholders::_> >
+ >
+ >,
// build a map
::boost::mpl::map<>,
::boost::mpl::if_<
diff --git a/boost/msm/back/favor_compile_time.hpp b/boost/msm/back/favor_compile_time.hpp
index bda97d198d..74f40019bd 100644
--- a/boost/msm/back/favor_compile_time.hpp
+++ b/boost/msm/back/favor_compile_time.hpp
@@ -108,7 +108,7 @@ struct dispatch_table < Fsm, Stt, Event, ::boost::msm::back::favor_compile_time>
std::deque<cell> one_state;
};
template <class TransitionState>
- static HandledEnum call_submachine(Fsm& fsm, int region, int state, Event const& evt)
+ static HandledEnum call_submachine(Fsm& fsm, int , int , Event const& evt)
{
return (fsm.template get_state<TransitionState&>()).process_any_event( ::boost::any(evt));
}
diff --git a/boost/msm/back/metafunctions.hpp b/boost/msm/back/metafunctions.hpp
index da1a421ca0..a1ffc35616 100644
--- a/boost/msm/back/metafunctions.hpp
+++ b/boost/msm/back/metafunctions.hpp
@@ -632,11 +632,22 @@ struct has_exit_pseudo_states
::boost::mpl::bool_<false> >::type type;
};
+// builds flags (add internal_flag_list and flag_list). internal_flag_list is used for terminate/interrupt states
+template <class StateType>
+struct get_flag_list
+{
+ typedef typename ::boost::mpl::insert_range<
+ typename StateType::flag_list,
+ typename ::boost::mpl::end< typename StateType::flag_list >::type,
+ typename StateType::internal_flag_list
+ >::type type;
+};
+
template <class StateType>
struct is_state_blocking
{
typedef typename ::boost::mpl::fold<
- typename StateType::flag_list, ::boost::mpl::set<>,
+ typename get_flag_list<StateType>::type, ::boost::mpl::set<>,
::boost::mpl::if_<
has_event_blocking_flag< ::boost::mpl::placeholders::_2>,
::boost::mpl::insert< ::boost::mpl::placeholders::_1, ::boost::mpl::placeholders::_2 >,
diff --git a/boost/msm/back/state_machine.hpp b/boost/msm/back/state_machine.hpp
index e840a86d52..b6181cd252 100644
--- a/boost/msm/back/state_machine.hpp
+++ b/boost/msm/back/state_machine.hpp
@@ -52,6 +52,7 @@
#include <boost/msm/active_state_switching_policies.hpp>
#include <boost/msm/row_tags.hpp>
+#include <boost/msm/msm_grammar.hpp>
#include <boost/msm/back/fold_to_list.hpp>
#include <boost/msm/back/metafunctions.hpp>
#include <boost/msm/back/history_policies.hpp>
@@ -73,6 +74,7 @@ BOOST_MPL_HAS_XXX_TRAIT_DEF(history_policy)
BOOST_MPL_HAS_XXX_TRAIT_DEF(fsm_check)
BOOST_MPL_HAS_XXX_TRAIT_DEF(compile_policy)
BOOST_MPL_HAS_XXX_TRAIT_DEF(queue_container_policy)
+BOOST_MPL_HAS_XXX_TRAIT_DEF(using_declared_table)
#ifndef BOOST_MSM_CONSTRUCTOR_ARG_SIZE
#define BOOST_MSM_CONSTRUCTOR_ARG_SIZE 5 // default max number of arguments for constructors
@@ -120,7 +122,16 @@ typedef ::boost::parameter::parameters<
>
> state_machine_signature;
-
+// just here to disable use of proto when not needed
+template <class T, class F,class Enable=void>
+struct make_euml_terminal;
+template <class T,class F>
+struct make_euml_terminal<T,F,typename ::boost::disable_if<has_using_declared_table<F> >::type>
+{};
+template <class T,class F>
+struct make_euml_terminal<T,F,typename ::boost::enable_if<has_using_declared_table<F> >::type>
+ : public proto::extends<typename proto::terminal< boost::msm::state_tag>::type, T, boost::msm::state_domain>
+{};
// library-containing class for state machines. Pass the actual FSM class as
// the Concrete parameter.
@@ -136,6 +147,11 @@ class state_machine : //public Derived
public ::boost::parameter::binding<
typename state_machine_signature::bind<A0,A1,A2,A3,A4>::type, ::boost::msm::back::tag::front_end
>::type
+ , public make_euml_terminal<state_machine<A0,A1,A2,A3,A4>,
+ typename ::boost::parameter::binding<
+ typename state_machine_signature::bind<A0,A1,A2,A3,A4>::type, ::boost::msm::back::tag::front_end
+ >::type
+ >
{
public:
// Create ArgumentPack
@@ -170,7 +186,8 @@ private:
typedef ::boost::function<
execute_return () > deferred_fct;
typedef typename QueueContainerPolicy::
- template In<deferred_fct>::type deferred_events_queue_t;
+ template In<
+ std::pair<deferred_fct,bool> >::type deferred_events_queue_t;
typedef typename QueueContainerPolicy::
template In<transition_fct>::type events_queue_t;
@@ -255,7 +272,7 @@ private:
{
public:
deferred_msg_queue_helper():m_deferred_events_queue(){}
- deferred_events_queue_t m_deferred_events_queue;
+ deferred_events_queue_t m_deferred_events_queue;
};
public:
@@ -996,10 +1013,11 @@ private:
// Take the transition action and return the next state.
static HandledEnum execute(library_sm& fsm, int region_index, int , transition_event const& evt)
{
- execute_return res =
- (::boost::fusion::at_key<current_state_type>(fsm.m_substate_list)).process_event(evt);
- fsm.m_states[region_index]=get_state_id<stt,T1>::type::value;
- return res;
+ // false as second parameter because this event is forwarded from outer fsm
+ execute_return res =
+ (::boost::fusion::at_key<current_state_type>(fsm.m_substate_list)).process_event_internal(evt,false);
+ fsm.m_states[region_index]=get_state_id<stt,T1>::type::value;
+ return res;
}
// helper metafunctions used by dispatch table and give the frow a new event
// (used to avoid double entries in a table because of base events)
@@ -1232,50 +1250,11 @@ private:
do_exit(finalEvent,*this);
}
- // Main function used by clients of the derived FSM to make
- // transitions. Can also be called for internally (for example in an action method) generated events.
+ // Main function used by clients of the derived FSM to make transitions.
template<class Event>
execute_return process_event(Event const& evt)
{
- HandledEnum ret_handled=HANDLED_FALSE;
- // if the state machine has terminate or interrupt flags, check them, otherwise skip
- if (is_event_handling_blocked_helper<Event>
- ( ::boost::mpl::bool_<has_fsm_blocking_states<library_sm>::type::value>() ) )
- return HANDLED_TRUE;
- // if a message queue is needed and processing is on the way
- if (!do_pre_msg_queue_helper<Event>
- (evt,::boost::mpl::bool_<is_no_message_queue<library_sm>::type::value>()) )
- {
- // wait for the end of current processing
- return HANDLED_TRUE;
- }
- else
- {
- // prepare the next deferred event for handling
- // if one defer is found in the SM, otherwise skip
- handle_defer_helper<library_sm> defer_helper(m_deferred_events_queue);
- defer_helper.do_pre_handle_deferred();
- // process event
- HandledEnum handled = this->do_process_helper<Event>
- (evt,::boost::mpl::bool_<is_no_exception_thrown<library_sm>::type::value>());
- if (handled)
- {
- ret_handled = handled;
- }
-
- // process completion transitions BEFORE any other event in the pool (UML Standard 2.3 §15.3.14)
- handle_eventless_transitions_helper<library_sm> eventless_helper(this,(handled == HANDLED_TRUE));
- eventless_helper.process_completion_event();
-
- // after handling, take care of the deferred events
- defer_helper.do_post_handle_deferred(handled);
-
- // now check if some events were generated in a transition and was not handled
- // because of another processing, and if yes, start handling them
- do_post_msg_queue_helper(::boost::mpl::bool_<is_no_message_queue<library_sm>::type::value>());
-
- return ret_handled;
- }
+ return process_event_internal(evt,true);
}
template <class EventType>
@@ -1748,16 +1727,16 @@ private:
}
// the following 2 functions handle the processing either with a try/catch protection or without
template <class StateType,class EventType>
- HandledEnum do_process_helper(EventType const& evt, ::boost::mpl::true_ const &)
+ HandledEnum do_process_helper(EventType const& evt, ::boost::mpl::true_ const &, bool is_direct_call)
{
- return this->do_process_event(evt);
+ return this->do_process_event(evt,is_direct_call);
}
template <class StateType,class EventType>
- HandledEnum do_process_helper(EventType const& evt, ::boost::mpl::false_ const &)
+ HandledEnum do_process_helper(EventType const& evt, ::boost::mpl::false_ const &, bool is_direct_call)
{
try
{
- return this->do_process_event(evt);
+ return this->do_process_event(evt,is_direct_call);
}
catch (std::exception& e)
{
@@ -1789,24 +1768,40 @@ private:
events_queue(a_queue),next_deferred_event(){}
void do_pre_handle_deferred()
{
- if (!events_queue.m_deferred_events_queue.empty())
- {
- next_deferred_event = events_queue.m_deferred_events_queue.back();
- events_queue.m_deferred_events_queue.pop_back();
- }
}
void do_post_handle_deferred(HandledEnum handled)
{
- if (((handled & HANDLED_DEFERRED) == HANDLED_DEFERRED) && next_deferred_event )
+ if (handled == HANDLED_TRUE)
{
- // the event was already deferred, no reason to process another deferred event
- events_queue.m_deferred_events_queue.push_back(next_deferred_event);
- return;
+ // a transition has been taken, it makes sense again to try processing waiting deferred events
+ // reset all events to not tested
+ for (std::size_t i = 0; i < events_queue.m_deferred_events_queue.size(); ++i)
+ {
+ events_queue.m_deferred_events_queue[i].second=false;
+ }
+ // test first event
+ if (!events_queue.m_deferred_events_queue.empty())
+ {
+ deferred_fct next = events_queue.m_deferred_events_queue.front().first;
+ events_queue.m_deferred_events_queue.pop_front();
+ next();
+ }
}
- else if (next_deferred_event)
+ else
{
- next_deferred_event();
+ // look for next deferred event, if any
+ typename deferred_events_queue_t::iterator it =
+ std::find_if(events_queue.m_deferred_events_queue.begin(),
+ events_queue.m_deferred_events_queue.end(),
+ boost::bind(&std::pair<deferred_fct,bool>::second, _1) == false);
+ if (it != events_queue.m_deferred_events_queue.end())
+ {
+ (*it).second = true;
+ deferred_fct next = (*it).first;
+ events_queue.m_deferred_events_queue.erase(it);
+ next();
+ }
}
}
@@ -1945,9 +1940,55 @@ private:
HandledEnum& result;
};
+ // Main function used internally to make transitions
+ // Can only be called for internally (for example in an action method) generated events.
+ template<class Event>
+ execute_return process_event_internal(Event const& evt, bool is_direct_call)
+ {
+ HandledEnum ret_handled=HANDLED_FALSE;
+ // if the state machine has terminate or interrupt flags, check them, otherwise skip
+ if (is_event_handling_blocked_helper<Event>
+ ( ::boost::mpl::bool_<has_fsm_blocking_states<library_sm>::type::value>() ) )
+ return HANDLED_TRUE;
+ // if a message queue is needed and processing is on the way
+ if (!do_pre_msg_queue_helper<Event>
+ (evt,::boost::mpl::bool_<is_no_message_queue<library_sm>::type::value>()) )
+ {
+ // wait for the end of current processing
+ return HANDLED_TRUE;
+ }
+ else
+ {
+ // prepare the next deferred event for handling
+ // if one defer is found in the SM, otherwise skip
+ handle_defer_helper<library_sm> defer_helper(m_deferred_events_queue);
+ defer_helper.do_pre_handle_deferred();
+ // process event
+ HandledEnum handled = this->do_process_helper<Event>
+ (evt,::boost::mpl::bool_<is_no_exception_thrown<library_sm>::type::value>(),is_direct_call);
+ if (handled)
+ {
+ ret_handled = handled;
+ }
+
+ // process completion transitions BEFORE any other event in the pool (UML Standard 2.3 §15.3.14)
+ handle_eventless_transitions_helper<library_sm> eventless_helper(this,(handled == HANDLED_TRUE));
+ eventless_helper.process_completion_event();
+
+ // after handling, take care of the deferred events
+ defer_helper.do_post_handle_deferred(handled);
+
+ // now check if some events were generated in a transition and was not handled
+ // because of another processing, and if yes, start handling them
+ do_post_msg_queue_helper(::boost::mpl::bool_<is_no_message_queue<library_sm>::type::value>());
+
+ return ret_handled;
+ }
+ }
+
// minimum event processing without exceptions, queues, etc.
template<class Event>
- HandledEnum do_process_event(Event const& evt)
+ HandledEnum do_process_event(Event const& evt, bool is_direct_call)
{
HandledEnum handled = HANDLED_FALSE;
// dispatch the event to every region
@@ -1957,9 +1998,10 @@ private:
// if the event has not been handled and we have orthogonal zones, then
// generate an error on every active state
// for state machine states contained in other state machines, do not handle
- // but let the containing sm handle the error
+ // but let the containing sm handle the error, unless the event was generated in this fsm
+ // (by calling process_event on this fsm object, is_direct_call == true)
// completion events do not produce an error
- if (!handled && !is_contained() && !is_completion_event<Event>::type::value)
+ if ( (!is_contained() || is_direct_call) && !handled && !is_completion_event<Event>::type::value)
{
for (int i=0; i<nr_regions::value;++i)
{
@@ -1988,16 +2030,18 @@ private:
}
#define MSM_COMPOSITE_ACCEPT_SUB(z, n, unused) ARG ## n vis ## n
+#define MSM_COMPOSITE_ACCEPT_SUB2(z, n, unused) boost::ref( vis ## n )
#define MSM_COMPOSITE_ACCEPT_EXECUTE(z, n, unused) \
template <BOOST_PP_ENUM_PARAMS(n, class ARG)> \
void composite_accept(BOOST_PP_ENUM(n, MSM_COMPOSITE_ACCEPT_SUB, ~ ) ) \
{ \
this->accept(BOOST_PP_ENUM_PARAMS(n,vis)); \
- this->visit_current_states(BOOST_PP_ENUM_PARAMS(n,vis)); \
+ this->visit_current_states(BOOST_PP_ENUM(n,MSM_COMPOSITE_ACCEPT_SUB2, ~)); \
}
BOOST_PP_REPEAT_FROM_TO(1,BOOST_PP_ADD(BOOST_MSM_VISITOR_ARG_SIZE,1), MSM_COMPOSITE_ACCEPT_EXECUTE, ~)
#undef MSM_COMPOSITE_ACCEPT_EXECUTE
#undef MSM_COMPOSITE_ACCEPT_SUB
+#undef MSM_COMPOSITE_ACCEPT_SUB2
// helper used to call the init states at the start of the state machine
template <class Event>
@@ -2080,7 +2124,7 @@ private:
template <class StateType>
void operator()( ::boost::msm::wrap<StateType> const& )
{
- typedef typename StateType::flag_list flags;
+ typedef typename get_flag_list<StateType>::type flags;
typedef typename ::boost::mpl::contains<flags,Flag >::type found;
typedef typename is_composite_state<StateType>::type composite;
@@ -2405,7 +2449,7 @@ BOOST_PP_REPEAT(BOOST_PP_ADD(BOOST_MSM_VISITOR_ARG_SIZE,1), MSM_VISITOR_ARGS_EXE
{
typedef typename build_orthogonal_regions<
library_sm,
- typename Derived::initial_state
+ initial_states
>::type all_regions;
enum {region_index= find_region_index<all_regions,StateType>::value };
};
@@ -2477,6 +2521,8 @@ BOOST_PP_REPEAT(BOOST_PP_ADD(BOOST_MSM_VISITOR_ARG_SIZE,1), MSM_VISITOR_ARGS_EXE
// entry on the FSM
(static_cast<Derived*>(self))->on_entry(evt,fsm);
int state_id = get_state_id<stt,typename EventType::active_state::wrapped_entry>::value;
+ BOOST_STATIC_ASSERT(find_region_id<typename EventType::active_state::wrapped_entry>::region_index >= 0);
+ BOOST_STATIC_ASSERT(find_region_id<typename EventType::active_state::wrapped_entry>::region_index < nr_regions::value);
// given region starts with the entry pseudo state as active state
self->m_states[find_region_id<typename EventType::active_state::wrapped_entry>::region_index] = state_id;
self->internal_start(evt.m_event);
@@ -2600,7 +2646,7 @@ BOOST_PP_REPEAT(BOOST_PP_ADD(BOOST_MSM_VISITOR_ARG_SIZE,1), MSM_VISITOR_ARGS_EXE
// puts a deferred event in the queue
void post_deferred_event(deferred_fct& deferred)
{
- m_deferred_events_queue.m_deferred_events_queue.push_front(deferred);
+ m_deferred_events_queue.m_deferred_events_queue.push_back(std::make_pair(deferred,true));
}
// removes one event from the message queue and processes it
template <class StateType>
diff --git a/boost/msm/common.hpp b/boost/msm/common.hpp
index b0335814fa..6a80b82275 100644
--- a/boost/msm/common.hpp
+++ b/boost/msm/common.hpp
@@ -11,8 +11,6 @@
#ifndef BOOST_MSM_COMMON_H
#define BOOST_MSM_COMMON_H
-
-
namespace boost { namespace msm
{
// wrapper for mpl::for_each as showed in the C++ Template Metaprogramming ch. 9
diff --git a/boost/msm/event_traits.hpp b/boost/msm/event_traits.hpp
new file mode 100644
index 0000000000..4b2350594f
--- /dev/null
+++ b/boost/msm/event_traits.hpp
@@ -0,0 +1,36 @@
+// Copyright 2008 Christophe Henry
+// henry UNDERSCORE christophe AT hotmail DOT com
+// This is an extended version of the state machine available in the boost::mpl library
+// Distributed under the same license as the original.
+// Copyright for the original version:
+// Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed
+// under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_MSM_EVENT_TRAITS_H
+#define BOOST_MSM_EVENT_TRAITS_H
+
+#include <boost/any.hpp>
+#include <boost/mpl/bool.hpp>
+
+namespace boost { namespace msm
+{
+
+template< typename Event >
+struct is_kleene_event
+{
+ // default: no event is a kleene event (kleene: matches any event in a transitions)
+ typedef ::boost::mpl::false_ type;
+};
+
+// add this way in this namespace specializations for events which you want to use as kleene
+// requirement: a copy-constructor matching the events which will be converted to this kleene
+template<>
+struct is_kleene_event< boost::any >
+{
+ typedef ::boost::mpl::true_ type;
+};
+
+} } // boost::msm
+#endif //BOOST_MSM_EVENT_TRAITS_H
diff --git a/boost/msm/front/euml/common.hpp b/boost/msm/front/euml/common.hpp
index 91864a275f..f9a9cc46fa 100644
--- a/boost/msm/front/euml/common.hpp
+++ b/boost/msm/front/euml/common.hpp
@@ -59,6 +59,7 @@
#include <boost/msm/msm_grammar.hpp>
#include <boost/msm/active_state_switching_policies.hpp>
+#include <boost/msm/event_traits.hpp>
#include <boost/msm/front/functor_row.hpp>
namespace proto = boost::proto;
@@ -183,51 +184,12 @@ struct get_event_name
typedef typename T::event_name type;
};
-// grammar forbidding address of for terminals
-struct terminal_grammar : proto::not_<proto::address_of<proto::_> >
-{};
-
-// Forward-declare an expression wrapper
-template<typename Expr>
-struct euml_terminal;
-
-struct sm_domain
- : proto::domain< proto::generator<euml_terminal>, terminal_grammar, boost::msm::msm_domain >
-{};
-
-struct state_grammar :
- proto::and_<
- proto::not_<proto::address_of<proto::_> >,
- proto::not_<proto::shift_right<proto::_,proto::_> >,
- proto::not_<proto::shift_left<proto::_,proto::_> >,
- proto::not_<proto::bitwise_and<proto::_,proto::_> >
- >
-{};
-struct state_domain
- : proto::domain< proto::generator<euml_terminal>, state_grammar,sm_domain >
-{};
-
-template<typename Expr>
-struct euml_terminal
- : proto::extends<Expr, euml_terminal<Expr>, sm_domain>
-{
- typedef
- proto::extends<Expr, euml_terminal<Expr>, sm_domain>
- base_type;
- // Needs a constructor
- euml_terminal(Expr const &e = Expr())
- : base_type(e)
- {}
- // Unhide Proto's overloaded assignment operator
- using base_type::operator=;
-};
-
template <class EVT>
-struct euml_event: proto::extends<typename proto::terminal<event_tag>::type, EVT, sm_domain>
+struct euml_event: proto::extends<typename proto::terminal<event_tag>::type, EVT, boost::msm::sm_domain>
{
typedef event_tag euml_tag_type;
typedef EVT event_name;
- using proto::extends<typename proto::terminal<event_tag>::type, EVT, sm_domain>::operator=;
+ using proto::extends<typename proto::terminal<event_tag>::type, EVT, boost::msm::sm_domain>::operator=;
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
#ifdef BOOST_MSVC
,class Arg6
@@ -238,11 +200,12 @@ struct euml_event: proto::extends<typename proto::terminal<event_tag>::type, EVT
typedef EVT type;
};
};
+
template <class STATE>
-struct euml_state_intern: proto::extends<typename proto::terminal< boost::msm::state_tag>::type, STATE, state_domain>
+struct euml_state_intern: proto::extends<typename proto::terminal< boost::msm::state_tag>::type, STATE, boost::msm::state_domain>
{
typedef state_tag euml_tag_type;
- using proto::extends<typename proto::terminal<state_tag>::type, STATE, state_domain>::operator=;
+ using proto::extends<typename proto::terminal<state_tag>::type, STATE, boost::msm::state_domain>::operator=;
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
#ifdef BOOST_MSVC
,class Arg6
@@ -254,22 +217,22 @@ struct euml_state_intern: proto::extends<typename proto::terminal< boost::msm::s
};
};
template <class STATE>
-struct euml_state: proto::extends<typename proto::terminal< boost::msm::state_tag>::type, STATE, state_domain>
+struct euml_state: proto::extends<typename proto::terminal< boost::msm::state_tag>::type, STATE, boost::msm::state_domain>
{
typedef state_tag euml_tag_type;
typedef int not_intern_euml_state;
- using proto::extends<typename proto::terminal<state_tag>::type, STATE, state_domain>::operator=;
+ using proto::extends<typename proto::terminal<state_tag>::type, STATE, boost::msm::state_domain>::operator=;
struct In
{
typedef STATE type;
};
};
template <class ACTION>
-struct euml_action: proto::extends<typename proto::terminal<action_tag>::type, ACTION, sm_domain>
+struct euml_action: proto::extends<typename proto::terminal<action_tag>::type, ACTION, boost::msm::sm_domain>
{
typedef action_tag euml_tag_type;
typedef ACTION action_name;
- using proto::extends<typename proto::terminal<action_tag>::type, ACTION, sm_domain>::operator=;
+ using proto::extends<typename proto::terminal<action_tag>::type, ACTION, boost::msm::sm_domain>::operator=;
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
#ifdef BOOST_MSVC
,class Arg6
@@ -281,10 +244,10 @@ struct euml_action: proto::extends<typename proto::terminal<action_tag>::type, A
};
};
template <class FLAG>
-struct euml_flag: proto::extends<typename proto::terminal<flag_tag>::type, FLAG, sm_domain>
+struct euml_flag: proto::extends<typename proto::terminal<flag_tag>::type, FLAG, boost::msm::sm_domain>
{
typedef flag_tag euml_tag_type;
- using proto::extends<typename proto::terminal<flag_tag>::type, FLAG, sm_domain>::operator=;
+ using proto::extends<typename proto::terminal<flag_tag>::type, FLAG, boost::msm::sm_domain>::operator=;
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
#ifdef BOOST_MSVC
,class Arg6
@@ -297,10 +260,10 @@ struct euml_flag: proto::extends<typename proto::terminal<flag_tag>::type, FLAG,
};
template <class CONFIG>
-struct euml_config: proto::extends<typename proto::terminal<config_tag>::type, CONFIG, sm_domain>
+struct euml_config: proto::extends<typename proto::terminal<config_tag>::type, CONFIG, boost::msm::sm_domain>
{
typedef config_tag euml_tag_type;
- using proto::extends<typename proto::terminal<config_tag>::type, CONFIG, sm_domain>::operator=;
+ using proto::extends<typename proto::terminal<config_tag>::type, CONFIG, boost::msm::sm_domain>::operator=;
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
#ifdef BOOST_MSVC
,class Arg6
@@ -441,7 +404,7 @@ struct GetSource_<void> : euml_action<GetSource_<void> >
return src;
}
};
-struct GetSource_Helper: proto::extends< proto::terminal<fsm_artefact_tag>::type, GetSource_Helper, sm_domain>
+struct GetSource_Helper: proto::extends< proto::terminal<fsm_artefact_tag>::type, GetSource_Helper, boost::msm::sm_domain>
{
GetSource_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -491,7 +454,7 @@ struct GetTarget_<void> : euml_action<GetTarget_<void> >
return tgt;
}
};
-struct GetTarget_Helper: proto::extends< proto::terminal<fsm_artefact_tag>::type, GetTarget_Helper, sm_domain>
+struct GetTarget_Helper: proto::extends< proto::terminal<fsm_artefact_tag>::type, GetTarget_Helper, boost::msm::sm_domain>
{
GetTarget_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -543,7 +506,7 @@ struct GetState_<void> : euml_action<GetState_<void> >
return state;
}
};
-struct GetState_Helper: proto::extends< proto::terminal<fsm_artefact_tag>::type, GetState_Helper, sm_domain>
+struct GetState_Helper: proto::extends< proto::terminal<fsm_artefact_tag>::type, GetState_Helper, boost::msm::sm_domain>
{
GetState_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -618,7 +581,7 @@ struct GetEvent_<void> : euml_action<GetEvent_<void> >
return evt;
}
};
-struct GetEvent_Helper: proto::extends< proto::terminal<fsm_artefact_tag>::type, GetEvent_Helper, sm_domain>
+struct GetEvent_Helper: proto::extends< proto::terminal<fsm_artefact_tag>::type, GetEvent_Helper, boost::msm::sm_domain>
{
GetEvent_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -688,12 +651,12 @@ struct GetFsm_<void> : euml_action<GetFsm_<void> >
}
template <class EVT,class FSM,class SourceState,class TargetState>
typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
- operator()(EVT const& evt ,FSM& fsm,SourceState& ,TargetState&)const
+ operator()(EVT const& ,FSM& fsm,SourceState& ,TargetState&)const
{
return fsm;
}
};
-struct GetFsm_Helper: proto::extends< proto::terminal<fsm_artefact_tag>::type, GetFsm_Helper, sm_domain>
+struct GetFsm_Helper: proto::extends< proto::terminal<fsm_artefact_tag>::type, GetFsm_Helper, boost::msm::sm_domain>
{
GetFsm_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -764,10 +727,10 @@ struct SubState_ <StateName,void>
}
};
-struct SubState_Helper: proto::extends< proto::terminal<fsm_artefact_tag>::type, SubState_Helper, sm_domain>
+struct SubState_Helper: proto::extends< proto::terminal<fsm_artefact_tag>::type, SubState_Helper, boost::msm::sm_domain>
{
SubState_Helper(){}
- using proto::extends< proto::terminal<fsm_artefact_tag>::type, SubState_Helper, sm_domain>::operator=;
+ using proto::extends< proto::terminal<fsm_artefact_tag>::type, SubState_Helper, boost::msm::sm_domain>::operator=;
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
#ifdef BOOST_MSVC
,class Arg6
@@ -827,7 +790,7 @@ struct GetAttribute_ : euml_action<GetAttribute_<Target, Index> >
}
};
-struct GetAttribute_Helper: proto::extends< proto::terminal<fsm_artefact_tag>::type, GetAttribute_Helper, sm_domain>
+struct GetAttribute_Helper: proto::extends< proto::terminal<fsm_artefact_tag>::type, GetAttribute_Helper, boost::msm::sm_domain>
{
GetAttribute_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -1391,10 +1354,10 @@ struct Process_ <GetEvent_<void>,void,void,void,void>
};
struct process_tag {};
-struct Process_Helper: proto::extends< proto::terminal<process_tag>::type, Process_Helper, sm_domain>
+struct Process_Helper: proto::extends< proto::terminal<process_tag>::type, Process_Helper, boost::msm::sm_domain>
{
Process_Helper(){}
- using proto::extends< proto::terminal<process_tag>::type, Process_Helper, sm_domain>::operator=;
+ using proto::extends< proto::terminal<process_tag>::type, Process_Helper, boost::msm::sm_domain>::operator=;
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
#ifdef BOOST_MSVC
,class Arg6
@@ -1562,10 +1525,10 @@ struct Reprocess_ <Param1,Param2,Param3,void>
}
};
struct reprocess_tag {};
-struct Reprocess_Helper: proto::extends< proto::terminal<reprocess_tag>::type, Reprocess_Helper, sm_domain>
+struct Reprocess_Helper: proto::extends< proto::terminal<reprocess_tag>::type, Reprocess_Helper, boost::msm::sm_domain>
{
Reprocess_Helper(){}
- using proto::extends< proto::terminal<reprocess_tag>::type, Reprocess_Helper, sm_domain>::operator=;
+ using proto::extends< proto::terminal<reprocess_tag>::type, Reprocess_Helper, boost::msm::sm_domain>::operator=;
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
#ifdef BOOST_MSVC
,class Arg6
@@ -1700,10 +1663,10 @@ struct Process2_ <ToProcessEvt,Value,Param1,Param2,void>
};
struct process2_tag {};
-struct Process2_Helper : proto::extends< proto::terminal<process2_tag>::type, Process2_Helper, sm_domain>
+struct Process2_Helper : proto::extends< proto::terminal<process2_tag>::type, Process2_Helper, boost::msm::sm_domain>
{
Process2_Helper(){}
- using proto::extends< proto::terminal<process2_tag>::type, Process2_Helper, sm_domain>::operator=;
+ using proto::extends< proto::terminal<process2_tag>::type, Process2_Helper, boost::msm::sm_domain>::operator=;
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
#ifdef BOOST_MSVC
,class Arg6
@@ -1781,7 +1744,7 @@ struct Get_Flag_ <Flag,Param1
}
};
-struct Get_Flag_Helper: proto::extends< proto::terminal<fsm_artefact_tag>::type, Get_Flag_Helper, sm_domain>
+struct Get_Flag_Helper: proto::extends< proto::terminal<fsm_artefact_tag>::type, Get_Flag_Helper, boost::msm::sm_domain>
{
Get_Flag_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -1800,16 +1763,18 @@ Get_Flag_Helper const is_flag_ = Get_Flag_Helper();
struct DeferEvent_ : euml_action< DeferEvent_ >
{
typedef ::boost::mpl::set<action_tag> tag_type;
+ // mark as deferring to avoid stack overflows in certain conditions
+ typedef int deferring_action;
template <class EVT,class FSM,class SourceState,class TargetState>
void operator()(EVT const& evt,FSM& fsm,SourceState& ,TargetState& ) const
{
fsm.defer_event(evt);
}
};
-struct Defer_Helper : proto::extends< proto::terminal<fsm_artefact_tag>::type, Defer_Helper, sm_domain>
+struct Defer_Helper : proto::extends< proto::terminal<fsm_artefact_tag>::type, Defer_Helper, boost::msm::sm_domain>
{
Defer_Helper(){}
- using proto::extends< proto::terminal<fsm_artefact_tag>::type, Defer_Helper, sm_domain>::operator=;
+ using proto::extends< proto::terminal<fsm_artefact_tag>::type, Defer_Helper, boost::msm::sm_domain>::operator=;
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
#ifdef BOOST_MSVC
,class Arg6
@@ -1823,10 +1788,10 @@ struct Defer_Helper : proto::extends< proto::terminal<fsm_artefact_tag>::type, D
Defer_Helper const defer_ = Defer_Helper();
struct explicit_tag {};
-struct Explicit_Helper : proto::extends< proto::terminal<explicit_tag>::type, Explicit_Helper, sm_domain>
+struct Explicit_Helper : proto::extends< proto::terminal<explicit_tag>::type, Explicit_Helper, boost::msm::sm_domain>
{
Explicit_Helper(){}
- using proto::extends< proto::terminal<explicit_tag>::type, Explicit_Helper, sm_domain>::operator=;
+ using proto::extends< proto::terminal<explicit_tag>::type, Explicit_Helper, boost::msm::sm_domain>::operator=;
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
#ifdef BOOST_MSVC
,class Arg6
@@ -1840,10 +1805,10 @@ struct Explicit_Helper : proto::extends< proto::terminal<explicit_tag>::type, Ex
Explicit_Helper const explicit_ = Explicit_Helper();
struct entry_pt_tag {};
-struct Entry_Pt_Helper : proto::extends< proto::terminal<entry_pt_tag>::type, Entry_Pt_Helper, sm_domain>
+struct Entry_Pt_Helper : proto::extends< proto::terminal<entry_pt_tag>::type, Entry_Pt_Helper, boost::msm::sm_domain>
{
Entry_Pt_Helper(){}
- using proto::extends< proto::terminal<entry_pt_tag>::type, Entry_Pt_Helper, sm_domain>::operator=;
+ using proto::extends< proto::terminal<entry_pt_tag>::type, Entry_Pt_Helper, boost::msm::sm_domain>::operator=;
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
#ifdef BOOST_MSVC
,class Arg6
@@ -1857,10 +1822,10 @@ struct Entry_Pt_Helper : proto::extends< proto::terminal<entry_pt_tag>::type, En
Entry_Pt_Helper const entry_pt_ = Entry_Pt_Helper();
struct exit_pt_tag {};
-struct Exit_Pt_Helper : proto::extends< proto::terminal<exit_pt_tag>::type, Exit_Pt_Helper, sm_domain>
+struct Exit_Pt_Helper : proto::extends< proto::terminal<exit_pt_tag>::type, Exit_Pt_Helper, boost::msm::sm_domain>
{
Exit_Pt_Helper(){}
- using proto::extends< proto::terminal<exit_pt_tag>::type, Exit_Pt_Helper, sm_domain>::operator=;
+ using proto::extends< proto::terminal<exit_pt_tag>::type, Exit_Pt_Helper, boost::msm::sm_domain>::operator=;
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
#ifdef BOOST_MSVC
,class Arg6
@@ -2039,7 +2004,7 @@ Exit_Pt_Helper const exit_pt_ = Exit_Pt_Helper();
,Param4()(evt,fsm,state),Param5()(evt,fsm,state),Param6()(evt,fsm,state));} }; \
struct function_name ## tag{}; \
struct functor ## Helper : proto::extends< proto::terminal< function_name ## tag >::type, \
- functor ## Helper , sm_domain> { functor ## Helper(){} \
+ functor ## Helper , boost::msm::sm_domain> { functor ## Helper(){} \
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5,class Arg6> \
struct In {typedef functor <Arg1,Arg2,Arg3,Arg4,Arg5,Arg6> type;}; }; \
functor ## Helper const function_name = functor ## Helper ();
@@ -2183,14 +2148,14 @@ Exit_Pt_Helper const exit_pt_ = Exit_Pt_Helper();
,Param4()(evt,fsm,src,tgt),Param5()(evt,fsm,src,tgt),Param6()(evt,fsm,src,tgt));} \
template <class Event,class FSM,class STATE> \
typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
+ typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
typename state_action_result<Event,FSM,STATE>::type >::type \
operator()(Event const& evt,FSM& fsm,STATE& state )const { \
return (Param1()(evt,fsm,state)).function(Param2()(evt,fsm,state),Param3()(evt,fsm,state) \
,Param4()(evt,fsm,state),Param5()(evt,fsm,state),Param6()(evt,fsm,state));} }; \
struct function_name ## tag{}; \
struct functor ## Helper : proto::extends< proto::terminal< function_name ## tag >::type, \
- functor ## Helper , sm_domain> { functor ## Helper(){} \
+ functor ## Helper , boost::msm::sm_domain> { functor ## Helper(){} \
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5,class Arg6> \
struct In {typedef functor <Arg1,Arg2,Arg3,Arg4,Arg5,Arg6> type;}; }; \
functor ## Helper const function_name = functor ## Helper ();
@@ -2320,7 +2285,7 @@ Exit_Pt_Helper const exit_pt_ = Exit_Pt_Helper();
,Param4()(evt,fsm,state),Param5()(evt,fsm,state));} }; \
struct function_name ## tag{}; \
struct functor ## Helper : proto::extends< proto::terminal< function_name ## tag >::type, \
- functor ## Helper , sm_domain> { functor ## Helper(){} \
+ functor ## Helper , boost::msm::sm_domain> { functor ## Helper(){} \
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5> \
struct In {typedef functor <Arg1,Arg2,Arg3,Arg4,Arg5> type;}; }; \
functor ## Helper const function_name = functor ## Helper ();
@@ -2446,7 +2411,7 @@ Exit_Pt_Helper const exit_pt_ = Exit_Pt_Helper();
,Param4()(evt,fsm,state),Param5()(evt,fsm,state));} }; \
struct function_name ## tag{}; \
struct functor ## Helper : proto::extends< proto::terminal< function_name ## tag >::type, \
- functor ## Helper , sm_domain> { functor ## Helper(){} \
+ functor ## Helper , boost::msm::sm_domain> { functor ## Helper(){} \
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5> \
struct In {typedef functor <Arg1,Arg2,Arg3,Arg4,Arg5> type;}; }; \
functor ## Helper const function_name = functor ## Helper ();
@@ -2514,6 +2479,15 @@ Exit_Pt_Helper const exit_pt_ = Exit_Pt_Helper();
instance_name ## _helper const& operator()() const {return *this;} }; \
static instance_name ## _helper instance_name;
+// an event matching any event
+struct kleene_ : msm::front::euml::euml_event<kleene_>, public boost::any
+{
+ kleene_() : boost::any(){}
+ template<typename ValueType>
+ kleene_(const ValueType & v) : boost::any(v){}
+};
+static kleene_ kleene;
+
#define BOOST_MSM_EUML_DECLARE_EVENT(instance_name) \
struct instance_name : msm::front::euml::euml_event<instance_name >{ \
instance_name(){} \
@@ -2630,6 +2604,7 @@ Exit_Pt_Helper const exit_pt_ = Exit_Pt_Helper();
typedef BOOST_TYPEOF(build_sm<instance_name ## tag> expr) instance_name;
#define BOOST_MSM_EUML_DECLARE_TRANSITION_TABLE(expr,instance_name) \
+ typedef int using_declared_table; \
typedef BOOST_TYPEOF(BOOST_MSM_EUML_BUILD_STT_HELPER BOOST_MSM_EUML_BUILD_STT_HELPER2(expr)) instance_name;
#define BOOST_MSM_EUML_DECLARE_INTERNAL_TRANSITION_TABLE(expr) \
@@ -2698,4 +2673,12 @@ Exit_Pt_Helper const exit_pt_ = Exit_Pt_Helper();
}}}} // boost::msm::front::euml
+namespace boost { namespace msm{
+ template<>
+ struct is_kleene_event< boost::msm::front::euml::kleene_ >
+ {
+ typedef ::boost::mpl::true_ type;
+ };
+}}
+
#endif // BOOST_MSM_FRONT_EUML_COMMON_H
diff --git a/boost/msm/front/euml/container.hpp b/boost/msm/front/euml/container.hpp
index 15a9750dd7..56546cff84 100644
--- a/boost/msm/front/euml/container.hpp
+++ b/boost/msm/front/euml/container.hpp
@@ -65,7 +65,7 @@ struct Front_ : euml_action<Front_<T> >
};
struct front_tag {};
-struct Front_Helper: proto::extends< proto::terminal<front_tag>::type, Front_Helper, sm_domain>
+struct Front_Helper: proto::extends< proto::terminal<front_tag>::type, Front_Helper, boost::msm::sm_domain>
{
Front_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -120,7 +120,7 @@ struct Back_ : euml_action<Back_<T> >
};
struct back_tag {};
-struct Back_Helper: proto::extends< proto::terminal<back_tag>::type, Back_Helper, sm_domain>
+struct Back_Helper: proto::extends< proto::terminal<back_tag>::type, Back_Helper, boost::msm::sm_domain>
{
Back_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -175,7 +175,7 @@ struct Begin_ : euml_action<Begin_<T> >
};
struct begin_tag {};
-struct Begin_Helper: proto::extends< proto::terminal<begin_tag>::type, Begin_Helper, sm_domain>
+struct Begin_Helper: proto::extends< proto::terminal<begin_tag>::type, Begin_Helper, boost::msm::sm_domain>
{
Begin_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -229,7 +229,7 @@ struct End_ : euml_action<End_<T> >
}
};
struct end_tag {};
-struct End_Helper: proto::extends< proto::terminal<end_tag>::type, End_Helper, sm_domain>
+struct End_Helper: proto::extends< proto::terminal<end_tag>::type, End_Helper, boost::msm::sm_domain>
{
End_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -284,7 +284,7 @@ struct RBegin_ : euml_action<RBegin_<T> >
};
struct rbegin_tag {};
-struct RBegin_Helper: proto::extends< proto::terminal<rbegin_tag>::type, RBegin_Helper, sm_domain>
+struct RBegin_Helper: proto::extends< proto::terminal<rbegin_tag>::type, RBegin_Helper, boost::msm::sm_domain>
{
RBegin_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -338,7 +338,7 @@ struct REnd_ : euml_action<REnd_<T> >
}
};
struct rend_tag {};
-struct REnd_Helper: proto::extends< proto::terminal<rend_tag>::type, REnd_Helper, sm_domain>
+struct REnd_Helper: proto::extends< proto::terminal<rend_tag>::type, REnd_Helper, boost::msm::sm_domain>
{
REnd_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -380,7 +380,7 @@ struct Push_Back_ : euml_action<Push_Back_<Container,Element> >
}
};
struct push_back_tag {};
-struct Push_Back_Helper: proto::extends< proto::terminal<push_back_tag>::type, Push_Back_Helper, sm_domain>
+struct Push_Back_Helper: proto::extends< proto::terminal<push_back_tag>::type, Push_Back_Helper, boost::msm::sm_domain>
{
Push_Back_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -422,7 +422,7 @@ struct Pop_Back_ : euml_action<Pop_Back_<Container> >
}
};
struct pop_back_tag {};
-struct Pop_Back_Helper: proto::extends< proto::terminal<pop_back_tag>::type, Pop_Back_Helper, sm_domain>
+struct Pop_Back_Helper: proto::extends< proto::terminal<pop_back_tag>::type, Pop_Back_Helper, boost::msm::sm_domain>
{
Pop_Back_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -464,7 +464,7 @@ struct Push_Front_ : euml_action<Push_Front_<Container,Element> >
}
};
struct push_front_tag {};
-struct Push_Front_Helper: proto::extends< proto::terminal<push_front_tag>::type, Push_Front_Helper, sm_domain>
+struct Push_Front_Helper: proto::extends< proto::terminal<push_front_tag>::type, Push_Front_Helper, boost::msm::sm_domain>
{
Push_Front_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -506,7 +506,7 @@ struct Pop_Front_ : euml_action<Pop_Front_<Container> >
}
};
struct pop_front_tag {};
-struct Pop_Front_Helper: proto::extends< proto::terminal<pop_front_tag>::type, Pop_Front_Helper, sm_domain>
+struct Pop_Front_Helper: proto::extends< proto::terminal<pop_front_tag>::type, Pop_Front_Helper, boost::msm::sm_domain>
{
Pop_Front_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -548,7 +548,7 @@ struct Clear_ : euml_action<Clear_<Container> >
}
};
struct clear_tag {};
-struct Clear_Helper: proto::extends< proto::terminal<clear_tag>::type, Clear_Helper, sm_domain>
+struct Clear_Helper: proto::extends< proto::terminal<clear_tag>::type, Clear_Helper, boost::msm::sm_domain>
{
Clear_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -590,7 +590,7 @@ struct ListReverse_ : euml_action<ListReverse_<Container> >
}
};
struct list_reverse_tag {};
-struct ListReverse_Helper: proto::extends< proto::terminal<list_reverse_tag>::type, ListReverse_Helper, sm_domain>
+struct ListReverse_Helper: proto::extends< proto::terminal<list_reverse_tag>::type, ListReverse_Helper, boost::msm::sm_domain>
{
ListReverse_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -660,7 +660,7 @@ struct ListUnique_<Container,Predicate,
}
};
struct list_unique_tag {};
-struct ListUnique_Helper: proto::extends< proto::terminal<list_unique_tag>::type, ListUnique_Helper, sm_domain>
+struct ListUnique_Helper: proto::extends< proto::terminal<list_unique_tag>::type, ListUnique_Helper, boost::msm::sm_domain>
{
ListUnique_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -730,7 +730,7 @@ struct ListSort_<Container,Predicate,
}
};
struct list_sort_tag {};
-struct ListSort_Helper: proto::extends< proto::terminal<list_sort_tag>::type, ListSort_Helper, sm_domain>
+struct ListSort_Helper: proto::extends< proto::terminal<list_sort_tag>::type, ListSort_Helper, boost::msm::sm_domain>
{
ListSort_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -784,7 +784,7 @@ struct Capacity_ : euml_action<Capacity_<Container> >
}
};
struct capacity_tag {};
-struct Capacity_Helper: proto::extends< proto::terminal<capacity_tag>::type, Capacity_Helper, sm_domain>
+struct Capacity_Helper: proto::extends< proto::terminal<capacity_tag>::type, Capacity_Helper, boost::msm::sm_domain>
{
Capacity_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -838,7 +838,7 @@ struct Size_ : euml_action<Size_<Container> >
}
};
struct size_tag {};
-struct Size_Helper: proto::extends< proto::terminal<size_tag>::type, Size_Helper, sm_domain>
+struct Size_Helper: proto::extends< proto::terminal<size_tag>::type, Size_Helper, boost::msm::sm_domain>
{
Size_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -892,7 +892,7 @@ struct Max_Size_ : euml_action<Max_Size_<Container> >
}
};
struct max_size_tag {};
-struct Max_Size_Helper: proto::extends< proto::terminal<max_size_tag>::type, Max_Size_Helper, sm_domain>
+struct Max_Size_Helper: proto::extends< proto::terminal<max_size_tag>::type, Max_Size_Helper, boost::msm::sm_domain>
{
Max_Size_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -934,7 +934,7 @@ struct Reserve_ : euml_action<Reserve_<Container,Value> >
}
};
struct reserve_tag {};
-struct Reserve_Helper: proto::extends< proto::terminal<reserve_tag>::type, Reserve_Helper, sm_domain>
+struct Reserve_Helper: proto::extends< proto::terminal<reserve_tag>::type, Reserve_Helper, boost::msm::sm_domain>
{
Reserve_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -1003,7 +1003,7 @@ struct Resize_<Container,Num,Value,typename ::boost::disable_if<typename ::boost
}
};
struct resize_tag {};
-struct Resize_Helper: proto::extends< proto::terminal<resize_tag>::type, Resize_Helper, sm_domain>
+struct Resize_Helper: proto::extends< proto::terminal<resize_tag>::type, Resize_Helper, boost::msm::sm_domain>
{
Resize_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -1186,7 +1186,7 @@ struct Insert_ < Container,Param1,void,void>
}
};
struct insert_tag {};
-struct Insert_Helper: proto::extends< proto::terminal<insert_tag>::type, Insert_Helper, sm_domain>
+struct Insert_Helper: proto::extends< proto::terminal<insert_tag>::type, Insert_Helper, boost::msm::sm_domain>
{
Insert_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -1228,7 +1228,7 @@ struct Swap_ : euml_action<Swap_<Container1,Container2> >
}
};
struct swap_tag {};
-struct Swap_Helper: proto::extends< proto::terminal<swap_tag>::type, Swap_Helper, sm_domain>
+struct Swap_Helper: proto::extends< proto::terminal<swap_tag>::type, Swap_Helper, boost::msm::sm_domain>
{
Swap_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -1314,7 +1314,7 @@ struct Erase_<Container,Iterator1,Iterator2,
}
};
struct erase_tag {};
-struct Erase_Helper: proto::extends< proto::terminal<erase_tag>::type, Erase_Helper, sm_domain>
+struct Erase_Helper: proto::extends< proto::terminal<erase_tag>::type, Erase_Helper, boost::msm::sm_domain>
{
Erase_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -1356,7 +1356,7 @@ struct Empty_ : euml_action<Empty_<Container> >
}
};
struct empty_tag {};
-struct Empty_Helper: proto::extends< proto::terminal<empty_tag>::type, Empty_Helper, sm_domain>
+struct Empty_Helper: proto::extends< proto::terminal<empty_tag>::type, Empty_Helper, boost::msm::sm_domain>
{
Empty_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -1398,7 +1398,7 @@ struct ListRemove_ : euml_action<ListRemove_<Container,Element> >
}
};
struct list_remove_tag {};
-struct ListRemove_Helper: proto::extends< proto::terminal<list_remove_tag>::type, ListRemove_Helper, sm_domain>
+struct ListRemove_Helper: proto::extends< proto::terminal<list_remove_tag>::type, ListRemove_Helper, boost::msm::sm_domain>
{
ListRemove_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -1440,7 +1440,7 @@ struct ListRemove_If_ : euml_action<ListRemove_If_<Container,Element> >
}
};
struct list_remove_if_tag {};
-struct ListRemove_If_Helper: proto::extends< proto::terminal<list_remove_if_tag>::type, ListRemove_If_Helper, sm_domain>
+struct ListRemove_If_Helper: proto::extends< proto::terminal<list_remove_if_tag>::type, ListRemove_If_Helper, boost::msm::sm_domain>
{
ListRemove_If_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -1510,7 +1510,7 @@ struct ListMerge_<Container,ToMerge,Predicate,
}
};
struct list_merge_tag {};
-struct ListMerge_Helper: proto::extends< proto::terminal<list_merge_tag>::type, ListMerge_Helper, sm_domain>
+struct ListMerge_Helper: proto::extends< proto::terminal<list_merge_tag>::type, ListMerge_Helper, boost::msm::sm_domain>
{
ListMerge_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -1623,7 +1623,7 @@ struct Splice_<Container,Param1,Param2,Param3,Param4,
}
};
struct splice_tag {};
-struct Splice_Helper: proto::extends< proto::terminal<splice_tag>::type, Splice_Helper, sm_domain>
+struct Splice_Helper: proto::extends< proto::terminal<splice_tag>::type, Splice_Helper, boost::msm::sm_domain>
{
Splice_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -1741,7 +1741,7 @@ struct StringFind_ <Container,Param1,Param2,void>
};
struct string_find_tag {};
-struct StringFind_Helper: proto::extends< proto::terminal<string_find_tag>::type, StringFind_Helper, sm_domain>
+struct StringFind_Helper: proto::extends< proto::terminal<string_find_tag>::type, StringFind_Helper, boost::msm::sm_domain>
{
StringFind_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -1881,7 +1881,7 @@ struct StringRFind_<
};
struct string_rfind_tag {};
-struct StringRFind_Helper: proto::extends< proto::terminal<string_rfind_tag>::type, StringRFind_Helper, sm_domain>
+struct StringRFind_Helper: proto::extends< proto::terminal<string_rfind_tag>::type, StringRFind_Helper, boost::msm::sm_domain>
{
StringRFind_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -1994,7 +1994,7 @@ struct StringFindFirstOf_ <Container,Param1,Param2,void>
struct string_find_first_of_tag {};
struct StringFindFirstOf_Helper:
- proto::extends< proto::terminal<string_find_first_of_tag>::type, StringFindFirstOf_Helper, sm_domain>
+ proto::extends< proto::terminal<string_find_first_of_tag>::type, StringFindFirstOf_Helper, boost::msm::sm_domain>
{
StringFindFirstOf_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -2135,7 +2135,7 @@ struct StringFindFirstNotOf_<
struct string_find_first_not_of_tag {};
struct StringFindFirstNotOf_Helper:
- proto::extends< proto::terminal<string_find_first_not_of_tag>::type, StringFindFirstNotOf_Helper, sm_domain>
+ proto::extends< proto::terminal<string_find_first_not_of_tag>::type, StringFindFirstNotOf_Helper, boost::msm::sm_domain>
{
StringFindFirstNotOf_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -2276,7 +2276,7 @@ struct StringFindLastOf_<
struct string_find_last_of_tag {};
struct StringFindLastOf_Helper:
- proto::extends< proto::terminal<string_find_last_of_tag>::type, StringFindLastOf_Helper, sm_domain>
+ proto::extends< proto::terminal<string_find_last_of_tag>::type, StringFindLastOf_Helper, boost::msm::sm_domain>
{
StringFindLastOf_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -2417,7 +2417,7 @@ struct StringFindLastNotOf_<
struct string_find_last_not_of_tag {};
struct StringFindLastNotOf_Helper:
- proto::extends< proto::terminal<string_find_last_of_tag>::type, StringFindLastNotOf_Helper, sm_domain>
+ proto::extends< proto::terminal<string_find_last_of_tag>::type, StringFindLastNotOf_Helper, boost::msm::sm_domain>
{
StringFindLastNotOf_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -2594,7 +2594,7 @@ struct Associative_Erase_ < Container,Param1,void>
};
struct associative_erase_tag {};
-struct Associative_Erase_Helper: proto::extends< proto::terminal<associative_erase_tag>::type, Associative_Erase_Helper, sm_domain>
+struct Associative_Erase_Helper: proto::extends< proto::terminal<associative_erase_tag>::type, Associative_Erase_Helper, boost::msm::sm_domain>
{
Associative_Erase_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -2650,7 +2650,7 @@ struct Associative_Find_ : euml_action<Associative_Find_<T,Param> >
};
struct associative_find_tag {};
-struct Associative_Find_Helper: proto::extends< proto::terminal<associative_find_tag>::type, Associative_Find_Helper, sm_domain>
+struct Associative_Find_Helper: proto::extends< proto::terminal<associative_find_tag>::type, Associative_Find_Helper, boost::msm::sm_domain>
{
Associative_Find_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -2704,7 +2704,7 @@ struct AssociativeCount_ : euml_action<AssociativeCount_<Container,Param> >
}
};
struct associative_count_tag {};
-struct AssociativeCount_Helper: proto::extends< proto::terminal<associative_count_tag>::type, AssociativeCount_Helper, sm_domain>
+struct AssociativeCount_Helper: proto::extends< proto::terminal<associative_count_tag>::type, AssociativeCount_Helper, boost::msm::sm_domain>
{
AssociativeCount_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -2760,7 +2760,7 @@ struct Associative_Lower_Bound_ : euml_action<Associative_Lower_Bound_<T,Param>
struct associative_lower_bound_tag {};
struct Associative_Lower_Bound_Helper: proto::extends< proto::terminal<associative_lower_bound_tag>::type,
- Associative_Lower_Bound_Helper, sm_domain>
+ Associative_Lower_Bound_Helper, boost::msm::sm_domain>
{
Associative_Lower_Bound_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -2816,7 +2816,7 @@ struct Associative_Upper_Bound_ : euml_action<Associative_Upper_Bound_<T,Param>
struct associative_upper_bound_tag {};
struct Associative_Upper_Bound_Helper: proto::extends< proto::terminal<associative_upper_bound_tag>::type,
- Associative_Upper_Bound_Helper, sm_domain>
+ Associative_Upper_Bound_Helper, boost::msm::sm_domain>
{
Associative_Upper_Bound_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -2871,7 +2871,7 @@ struct First_ : euml_action<First_<T> >
};
struct first_tag {};
-struct First_Helper: proto::extends< proto::terminal<first_tag>::type, First_Helper, sm_domain>
+struct First_Helper: proto::extends< proto::terminal<first_tag>::type, First_Helper, boost::msm::sm_domain>
{
First_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -2926,7 +2926,7 @@ struct Second_ : euml_action<Second_<T> >
};
struct second_tag {};
-struct Second_Helper: proto::extends< proto::terminal<second_tag>::type, Second_Helper, sm_domain>
+struct Second_Helper: proto::extends< proto::terminal<second_tag>::type, Second_Helper, boost::msm::sm_domain>
{
Second_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -2990,7 +2990,7 @@ struct Associative_Equal_Range_ : euml_action<Associative_Equal_Range_<T,Param>
struct associative_equal_range_tag {};
struct Associative_Equal_Range_Helper: proto::extends< proto::terminal<associative_equal_range_tag>::type,
- Associative_Equal_Range_Helper, sm_domain>
+ Associative_Equal_Range_Helper, boost::msm::sm_domain>
{
Associative_Equal_Range_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -3102,7 +3102,7 @@ struct Substr_ < Container,Param1,void>
}
};
struct substr_tag {};
-struct Substr_Helper: proto::extends< proto::terminal<substr_tag>::type, Substr_Helper, sm_domain>
+struct Substr_Helper: proto::extends< proto::terminal<substr_tag>::type, Substr_Helper, boost::msm::sm_domain>
{
Substr_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -3264,7 +3264,7 @@ struct StringCompare_<Container,Param1,Param2,Param3,void>
};
struct string_compare_tag {};
-struct StringCompare_Helper: proto::extends< proto::terminal<string_compare_tag>::type, StringCompare_Helper, sm_domain>
+struct StringCompare_Helper: proto::extends< proto::terminal<string_compare_tag>::type, StringCompare_Helper, boost::msm::sm_domain>
{
StringCompare_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -3388,7 +3388,7 @@ struct Append_<Container,Param1,Param2,void>
};
struct append_tag {};
-struct Append_Helper: proto::extends< proto::terminal<append_tag>::type, Append_Helper, sm_domain>
+struct Append_Helper: proto::extends< proto::terminal<append_tag>::type, Append_Helper, boost::msm::sm_domain>
{
Append_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -3513,7 +3513,7 @@ struct StringInsert_<Container,Param1,Param2,Param3,void>
};
struct string_insert_tag {};
-struct StringInsert_Helper: proto::extends< proto::terminal<string_insert_tag>::type, StringInsert_Helper, sm_domain>
+struct StringInsert_Helper: proto::extends< proto::terminal<string_insert_tag>::type, StringInsert_Helper, boost::msm::sm_domain>
{
StringInsert_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -3620,7 +3620,7 @@ struct StringErase_ <Container,Param1,void>
};
struct string_erase_tag {};
-struct StringErase_Helper: proto::extends< proto::terminal<string_erase_tag>::type, StringErase_Helper, sm_domain>
+struct StringErase_Helper: proto::extends< proto::terminal<string_erase_tag>::type, StringErase_Helper, boost::msm::sm_domain>
{
StringErase_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -3744,7 +3744,7 @@ struct StringAssign_<Container,Param1,Param2,void>
}
};
struct assign_tag {};
-struct StringAssign_Helper: proto::extends< proto::terminal<assign_tag>::type, StringAssign_Helper, sm_domain>
+struct StringAssign_Helper: proto::extends< proto::terminal<assign_tag>::type, StringAssign_Helper, boost::msm::sm_domain>
{
StringAssign_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -3835,7 +3835,7 @@ struct StringReplace_<Container,Param1,Param2,Param3,void>
};
struct string_replace_tag {};
-struct StringReplace_Helper: proto::extends< proto::terminal<string_replace_tag>::type, StringReplace_Helper, sm_domain>
+struct StringReplace_Helper: proto::extends< proto::terminal<string_replace_tag>::type, StringReplace_Helper, boost::msm::sm_domain>
{
StringReplace_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -3891,7 +3891,7 @@ struct CStr_ : euml_action<CStr_<Container> >
}
};
struct c_str_tag {};
-struct CStr_Helper: proto::extends< proto::terminal<c_str_tag>::type, CStr_Helper, sm_domain>
+struct CStr_Helper: proto::extends< proto::terminal<c_str_tag>::type, CStr_Helper, boost::msm::sm_domain>
{
CStr_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -3947,7 +3947,7 @@ struct StringData_ : euml_action<StringData_<Container> >
}
};
struct string_data_tag {};
-struct StringData_Helper: proto::extends< proto::terminal<string_data_tag>::type, StringData_Helper, sm_domain>
+struct StringData_Helper: proto::extends< proto::terminal<string_data_tag>::type, StringData_Helper, boost::msm::sm_domain>
{
StringData_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -4048,7 +4048,7 @@ struct StringCopy_<
};
struct string_copy_tag {};
-struct StringCopy_Helper: proto::extends< proto::terminal<string_copy_tag>::type, StringCopy_Helper, sm_domain>
+struct StringCopy_Helper: proto::extends< proto::terminal<string_copy_tag>::type, StringCopy_Helper, boost::msm::sm_domain>
{
StringCopy_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
diff --git a/boost/msm/front/euml/operator.hpp b/boost/msm/front/euml/operator.hpp
index c5ec5d0e88..d976df7a6c 100644
--- a/boost/msm/front/euml/operator.hpp
+++ b/boost/msm/front/euml/operator.hpp
@@ -157,10 +157,10 @@ struct If_Else_<Condition,Action1,Action2
struct if_tag
{
};
-struct If : proto::extends<proto::terminal<if_tag>::type, If, sm_domain>
+struct If : proto::extends<proto::terminal<if_tag>::type, If, boost::msm::sm_domain>
{
If(){}
- using proto::extends< proto::terminal<if_tag>::type, If, sm_domain>::operator=;
+ using proto::extends< proto::terminal<if_tag>::type, If, boost::msm::sm_domain>::operator=;
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
#ifdef BOOST_MSVC
,class Arg6
@@ -256,10 +256,10 @@ struct If_Then_<Condition,Action1
struct if_then_tag
{
};
-struct If_Then : proto::extends< proto::terminal<if_then_tag>::type, If_Then, sm_domain>
+struct If_Then : proto::extends< proto::terminal<if_then_tag>::type, If_Then, boost::msm::sm_domain>
{
If_Then(){}
- using proto::extends< proto::terminal<if_then_tag>::type, If_Then, sm_domain>::operator=;
+ using proto::extends< proto::terminal<if_then_tag>::type, If_Then, boost::msm::sm_domain>::operator=;
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
#ifdef BOOST_MSVC
,class Arg6
@@ -312,10 +312,10 @@ struct While_Do_ : euml_action<While_Do_<Condition,Body> >
struct while_do_tag
{
};
-struct While_Do_Helper : proto::extends< proto::terminal<while_do_tag>::type, While_Do_Helper, sm_domain>
+struct While_Do_Helper : proto::extends< proto::terminal<while_do_tag>::type, While_Do_Helper, boost::msm::sm_domain>
{
While_Do_Helper(){}
- using proto::extends< proto::terminal<while_do_tag>::type, While_Do_Helper, sm_domain>::operator=;
+ using proto::extends< proto::terminal<while_do_tag>::type, While_Do_Helper, boost::msm::sm_domain>::operator=;
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
#ifdef BOOST_MSVC
,class Arg6
@@ -368,10 +368,10 @@ struct Do_While_ : euml_action<Do_While_<Condition,Body> >
struct do_while_tag
{
};
-struct Do_While_Helper : proto::extends< proto::terminal<do_while_tag>::type, Do_While_Helper, sm_domain>
+struct Do_While_Helper : proto::extends< proto::terminal<do_while_tag>::type, Do_While_Helper, boost::msm::sm_domain>
{
Do_While_Helper(){}
- using proto::extends< proto::terminal<do_while_tag>::type, Do_While_Helper, sm_domain>::operator=;
+ using proto::extends< proto::terminal<do_while_tag>::type, Do_While_Helper, boost::msm::sm_domain>::operator=;
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
#ifdef BOOST_MSVC
,class Arg6
@@ -426,10 +426,10 @@ struct For_Loop_ : euml_action<For_Loop_<Begin,End,EndLoop,Body> >
struct for_loop_tag
{
};
-struct For_Loop_Helper : proto::extends< proto::terminal<for_loop_tag>::type, For_Loop_Helper, sm_domain>
+struct For_Loop_Helper : proto::extends< proto::terminal<for_loop_tag>::type, For_Loop_Helper, boost::msm::sm_domain>
{
For_Loop_Helper(){}
- using proto::extends< proto::terminal<for_loop_tag>::type, For_Loop_Helper, sm_domain>::operator=;
+ using proto::extends< proto::terminal<for_loop_tag>::type, For_Loop_Helper, boost::msm::sm_domain>::operator=;
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
#ifdef BOOST_MSVC
,class Arg6
diff --git a/boost/msm/front/euml/state_grammar.hpp b/boost/msm/front/euml/state_grammar.hpp
index 17baa03912..a9bea10fec 100644
--- a/boost/msm/front/euml/state_grammar.hpp
+++ b/boost/msm/front/euml/state_grammar.hpp
@@ -59,6 +59,7 @@ struct func_state : public ::boost::msm::front::detail::state_base<BASE,Attribu
typedef StateNameTag state_name_tag;
// flags
typedef Flags flag_list;
+ typedef ::boost::mpl::vector0<> internal_flag_list;
// deferred events
typedef Defer deferred_events;
@@ -99,6 +100,7 @@ struct entry_func_state : public ::boost::msm::front::detail::state_base<BASE,A
// flags
typedef Flags flag_list;
+ typedef ::boost::mpl::vector0<> internal_flag_list;
// deferred events
typedef Defer deferred_events;
@@ -135,6 +137,7 @@ struct explicit_entry_func_state : public ::boost::msm::front::detail::state_ba
typedef StateNameTag state_name_tag;
// flags
typedef Flags flag_list;
+ typedef ::boost::mpl::vector0<> internal_flag_list;
// deferred events
typedef Defer deferred_events;
@@ -175,6 +178,7 @@ struct exit_func_state : public ::boost::msm::front::detail::state_base<BASE,A
// flags
typedef Flags flag_list;
+ typedef ::boost::mpl::vector0<> internal_flag_list;
// deferred events
typedef Defer deferred_events;
@@ -562,13 +566,13 @@ struct BuildActions
{};
// attributes building
-#define BOOST_MSM_EUML_DECLARE_ATTRIBUTE(attr_type,attr_name) \
-struct attr_name ## _ \
- : proto::extends< proto::terminal<msm::front::action_tag>::type, attr_name ## _, sm_domain> \
- {typedef attr_name ## _ action_name; \
- typedef ::boost::fusion::pair<attr_name ## _,attr_type> attribute_type; \
- attr_name ## _ (){} \
- }; \
+#define BOOST_MSM_EUML_DECLARE_ATTRIBUTE(attr_type,attr_name) \
+struct attr_name ## _ \
+ : proto::extends< proto::terminal< ::boost::msm::front::action_tag>::type, attr_name ## _, boost::msm::sm_domain> \
+ {typedef attr_name ## _ action_name; \
+ typedef ::boost::fusion::pair<attr_name ## _,attr_type> attribute_type; \
+ attr_name ## _ (){} \
+ }; \
attr_name ## _ const attr_name = attr_name ## _();
struct make_attributes_tag
@@ -597,7 +601,7 @@ struct attribute
BOOST_PROTO_BASIC_EXTENDS(
proto::terminal<make_attributes_tag>::type
, attribute
- , sm_domain
+ , boost::msm::sm_domain
)
typedef ::boost::fusion::pair<int,int> attribute_type;
};
@@ -668,7 +672,7 @@ struct configure
BOOST_PROTO_BASIC_EXTENDS(
proto::terminal<make_configure_tag>::type
, configure
- , sm_domain
+ , boost::msm::sm_domain
)
};
@@ -700,7 +704,7 @@ struct define_init
BOOST_PROTO_BASIC_EXTENDS(
proto::terminal<state_tag>::type
, define_init
- , sm_domain
+ , boost::msm::sm_domain
)
};
@@ -867,6 +871,7 @@ struct func_state_machine : public ::boost::msm::front::detail::state_base<BASE
// flags
typedef StateNameTag state_name_tag;
typedef Flags flag_list;
+ typedef ::boost::mpl::vector0<> internal_flag_list;
// deferred events
typedef Defer deferred_events;
// customization (message queue, exceptions)
diff --git a/boost/msm/front/euml/transformation.hpp b/boost/msm/front/euml/transformation.hpp
index 8ea7c5edc8..2fb4bc01c8 100644
--- a/boost/msm/front/euml/transformation.hpp
+++ b/boost/msm/front/euml/transformation.hpp
@@ -107,7 +107,7 @@ struct BackInserter_ : euml_action<BackInserter_<T> >
};
struct back_inserter_tag {};
-struct BackInserter_Helper: proto::extends< proto::terminal<back_inserter_tag>::type, BackInserter_Helper, sm_domain>
+struct BackInserter_Helper: proto::extends< proto::terminal<back_inserter_tag>::type, BackInserter_Helper, boost::msm::sm_domain>
{
BackInserter_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -162,7 +162,7 @@ struct FrontInserter_ : euml_action<FrontInserter_<T> >
};
struct front_inserter_tag {};
-struct FrontInserter_Helper: proto::extends< proto::terminal<front_inserter_tag>::type, FrontInserter_Helper, sm_domain>
+struct FrontInserter_Helper: proto::extends< proto::terminal<front_inserter_tag>::type, FrontInserter_Helper, boost::msm::sm_domain>
{
FrontInserter_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -217,7 +217,7 @@ struct Inserter_ : euml_action<Inserter_<T,Pos> >
};
struct inserter_tag {};
-struct Inserter_Helper: proto::extends< proto::terminal<inserter_tag>::type, Inserter_Helper, sm_domain>
+struct Inserter_Helper: proto::extends< proto::terminal<inserter_tag>::type, Inserter_Helper, boost::msm::sm_domain>
{
Inserter_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
@@ -315,7 +315,7 @@ struct Transform_<Param1,Param2,Param3,Param4,Param5,
}
};
struct transform_tag {};
-struct Transform_Helper: proto::extends< proto::terminal<transform_tag>::type, Transform_Helper, sm_domain>
+struct Transform_Helper: proto::extends< proto::terminal<transform_tag>::type, Transform_Helper, boost::msm::sm_domain>
{
Transform_Helper(){}
template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
diff --git a/boost/msm/front/functor_row.hpp b/boost/msm/front/functor_row.hpp
index 0600881dfa..e542451f4f 100644
--- a/boost/msm/front/functor_row.hpp
+++ b/boost/msm/front/functor_row.hpp
@@ -14,6 +14,7 @@
#include <boost/mpl/set.hpp>
#include <boost/mpl/for_each.hpp>
#include <boost/mpl/has_xxx.hpp>
+#include <boost/mpl/count_if.hpp>
#include <boost/typeof/typeof.hpp>
@@ -25,7 +26,8 @@
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
BOOST_MPL_HAS_XXX_TRAIT_DEF(deferring_action)
-
+BOOST_MPL_HAS_XXX_TRAIT_DEF(some_deferring_actions)
+
namespace boost { namespace msm { namespace front
{
template <class Func,class Enable=void>
@@ -42,7 +44,17 @@ namespace boost { namespace msm { namespace front
{
static const ::boost::msm::back::HandledEnum value = ::boost::msm::back::HANDLED_DEFERRED;
};
-
+ // for sequences
+ template <class Func>
+ struct get_functor_return_value<Func,
+ typename ::boost::enable_if<
+ typename has_some_deferring_actions<Func>::type
+ >::type
+ >
+ {
+ static const ::boost::msm::back::HandledEnum value =
+ (Func::some_deferring_actions::value ? ::boost::msm::back::HANDLED_DEFERRED : ::boost::msm::back::HANDLED_TRUE );
+ };
template <class SOURCE,class EVENT,class TARGET,class ACTION=none,class GUARD=none>
struct Row
{
@@ -265,6 +277,12 @@ namespace boost { namespace msm { namespace front
struct ActionSequence_
{
typedef Sequence sequence;
+ // if one functor of the sequence defers events, the complete sequence does
+ typedef ::boost::mpl::bool_<
+ ::boost::mpl::count_if<sequence,
+ has_deferring_action< ::boost::mpl::placeholders::_1 >
+ >::value != 0> some_deferring_actions;
+
template <class Event,class FSM,class STATE >
struct state_action_result
{
diff --git a/boost/msm/front/state_machine_def.hpp b/boost/msm/front/state_machine_def.hpp
index ca72dd09ff..f890a983a3 100644
--- a/boost/msm/front/state_machine_def.hpp
+++ b/boost/msm/front/state_machine_def.hpp
@@ -31,6 +31,7 @@ struct state_machine_def : public boost::msm::front::detail::state_base<BaseSta
// tags
// default: no flag
typedef ::boost::mpl::vector0<> flag_list;
+ typedef ::boost::mpl::vector0<> internal_flag_list;
//default: no deferred events
typedef ::boost::mpl::vector0<> deferred_events;
// customization (message queue, exceptions)
@@ -197,7 +198,7 @@ struct state_machine_def : public boost::msm::front::detail::state_base<BaseSta
protected:
// Default no-transition handler. Can be replaced in the Derived SM class.
template <class FSM,class Event>
- void no_transition(Event const& ,FSM&, int state)
+ void no_transition(Event const& ,FSM&, int )
{
BOOST_ASSERT(false);
}
diff --git a/boost/msm/front/states.hpp b/boost/msm/front/states.hpp
index 9d192c458f..a909f63f7b 100644
--- a/boost/msm/front/states.hpp
+++ b/boost/msm/front/states.hpp
@@ -49,6 +49,7 @@ struct state : public boost::msm::front::detail::state_base<BASE>, SMPtrPolicy
// tags
// default: no flag
typedef ::boost::mpl::vector0<> flag_list;
+ typedef ::boost::mpl::vector0<> internal_flag_list;
//default: no deferred events
typedef ::boost::mpl::vector0<> deferred_events;
};
@@ -59,7 +60,8 @@ template<class BASE = default_base_state,class SMPtrPolicy = no_sm_ptr>
struct terminate_state : public boost::msm::front::detail::state_base<BASE>, SMPtrPolicy
{
// tags
- typedef ::boost::mpl::vector<boost::msm::TerminateFlag> flag_list;
+ typedef ::boost::mpl::vector0<> flag_list;
+ typedef ::boost::mpl::vector< boost::msm::TerminateFlag> internal_flag_list;
//default: no deferred events
typedef ::boost::mpl::vector0<> deferred_events;
};
@@ -71,9 +73,10 @@ template <class EndInterruptEvent,class BASE = default_base_state,class SMPtrPol
struct interrupt_state : public boost::msm::front::detail::state_base<BASE>, SMPtrPolicy
{
// tags
+ typedef ::boost::mpl::vector0<> flag_list;
typedef ::boost::mpl::vector<boost::msm::InterruptedFlag,
boost::msm::EndInterruptFlag<EndInterruptEvent> >
- flag_list;
+ internal_flag_list;
//default: no deferred events
typedef ::boost::mpl::vector0<> deferred_events;
};
@@ -101,6 +104,7 @@ struct entry_pseudo_state
typedef int explicit_entry_state;
// default: no flag
typedef ::boost::mpl::vector0<> flag_list;
+ typedef ::boost::mpl::vector0<> internal_flag_list;
//default: no deferred events
typedef ::boost::mpl::vector0<> deferred_events;
};
@@ -117,7 +121,8 @@ struct exit_pseudo_state : public boost::msm::front::detail::state_base<BASE> ,
typedef int pseudo_exit;
// default: no flag
- typedef ::boost::mpl::vector< > flag_list;
+ typedef ::boost::mpl::vector0<> flag_list;
+ typedef ::boost::mpl::vector0<> internal_flag_list;
//default: no deferred events
typedef ::boost::mpl::vector0<> deferred_events;
};
diff --git a/boost/msm/msm_grammar.hpp b/boost/msm/msm_grammar.hpp
index 27f885468d..8f95e98684 100644
--- a/boost/msm/msm_grammar.hpp
+++ b/boost/msm/msm_grammar.hpp
@@ -11,6 +11,7 @@
#ifndef BOOST_MSM_GRAMMAR_H
#define BOOST_MSM_GRAMMAR_H
+#include <boost/proto/core.hpp>
#include <boost/msm/common.hpp>
@@ -41,6 +42,45 @@ struct msm_terminal
{}
};
+// grammar forbidding address of for terminals
+struct terminal_grammar : proto::not_<proto::address_of<proto::_> >
+{};
+
+// Forward-declare an expression wrapper
+template<typename Expr>
+struct euml_terminal;
+
+struct sm_domain
+ : proto::domain< proto::generator<euml_terminal>, terminal_grammar, boost::msm::msm_domain >
+{};
+
+struct state_grammar :
+ proto::and_<
+ proto::not_<proto::address_of<proto::_> >,
+ proto::not_<proto::shift_right<proto::_,proto::_> >,
+ proto::not_<proto::shift_left<proto::_,proto::_> >,
+ proto::not_<proto::bitwise_and<proto::_,proto::_> >
+ >
+{};
+struct state_domain
+ : proto::domain< proto::generator<euml_terminal>, boost::msm::state_grammar,boost::msm::sm_domain >
+{};
+
+template<typename Expr>
+struct euml_terminal
+ : proto::extends<Expr, euml_terminal<Expr>, boost::msm::sm_domain>
+{
+ typedef
+ proto::extends<Expr, euml_terminal<Expr>, boost::msm::sm_domain>
+ base_type;
+ // Needs a constructor
+ euml_terminal(Expr const &e = Expr())
+ : base_type(e)
+ {}
+ // Unhide Proto's overloaded assignment operator
+ using base_type::operator=;
+};
+
} } // boost::msm
#endif //BOOST_MSM_GRAMMAR_H
diff --git a/boost/multi_array/base.hpp b/boost/multi_array/base.hpp
index ecbe09708a..0189831a89 100644
--- a/boost/multi_array/base.hpp
+++ b/boost/multi_array/base.hpp
@@ -81,7 +81,8 @@ class sub_array;
template <typename T, std::size_t NumDims, typename TPtr = const T*>
class const_sub_array;
-template <typename T, typename TPtr, typename NumDims, typename Reference>
+ template <typename T, typename TPtr, typename NumDims, typename Reference,
+ typename IteratorCategory>
class array_iterator;
template <typename T, std::size_t NumDims, typename TPtr = const T*>
@@ -251,7 +252,19 @@ struct associated_types
// choose value accessor ends
/////////////////////////////////////////////////////////////////////////
-
+// Due to some imprecision in the C++ Standard,
+// MSVC 2010 is broken in debug mode: it requires
+// that an Output Iterator have output_iterator_tag in its iterator_category if
+// that iterator is not bidirectional_iterator or random_access_iterator.
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1600)
+struct mutable_iterator_tag
+ : boost::random_access_traversal_tag, std::input_iterator_tag
+{
+ operator std::output_iterator_tag() const {
+ return std::output_iterator_tag();
+ }
+};
+#endif
////////////////////////////////////////////////////////////////////////
// multi_array_base
@@ -301,8 +314,16 @@ public:
//
// iterator support
//
- typedef array_iterator<T,T*,mpl::size_t<NumDims>,reference> iterator;
- typedef array_iterator<T,T const*,mpl::size_t<NumDims>,const_reference> const_iterator;
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1600)
+ // Deal with VC 2010 output_iterator_tag requirement
+ typedef array_iterator<T,T*,mpl::size_t<NumDims>,reference,
+ mutable_iterator_tag> iterator;
+#else
+ typedef array_iterator<T,T*,mpl::size_t<NumDims>,reference,
+ boost::random_access_traversal_tag> iterator;
+#endif
+ typedef array_iterator<T,T const*,mpl::size_t<NumDims>,const_reference,
+ boost::random_access_traversal_tag> const_iterator;
typedef ::boost::reverse_iterator<iterator> reverse_iterator;
typedef ::boost::reverse_iterator<const_iterator> const_reverse_iterator;
@@ -321,7 +342,8 @@ protected:
const size_type* extents,
const index* strides,
const index* index_bases) const {
-
+ boost::function_requires<
+ CollectionConcept<IndexList> >();
ignore_unused_variable_warning(index_bases);
ignore_unused_variable_warning(extents);
#if !defined(NDEBUG) && !defined(BOOST_DISABLE_ASSERTS)
@@ -332,9 +354,15 @@ protected:
#endif
index offset = 0;
- for (size_type n = 0; n != NumDims; ++n)
- offset += indices[n] * strides[n];
-
+ {
+ typename IndexList::const_iterator i = indices.begin();
+ size_type n = 0;
+ while (n != NumDims) {
+ offset += (*i) * strides[n];
+ ++n;
+ ++i;
+ }
+ }
return base[offset];
}
diff --git a/boost/multi_array/concept_checks.hpp b/boost/multi_array/concept_checks.hpp
index 8b9d465144..3a53df8393 100644
--- a/boost/multi_array/concept_checks.hpp
+++ b/boost/multi_array/concept_checks.hpp
@@ -131,6 +131,7 @@ namespace detail {
function_requires< boost_concepts::WritableIteratorConcept<iterator> >();
function_requires< boost_concepts::ForwardTraversalConcept<const_iterator> >();
function_requires< boost_concepts::ReadableIteratorConcept<const_iterator> >();
+ function_requires< boost::OutputIterator<iterator,value_type> >();
// RG - a( CollectionArchetype) when available...
value_type vt = a[ id ];
diff --git a/boost/multi_array/iterator.hpp b/boost/multi_array/iterator.hpp
index 59e7724f55..c77d34ef96 100644
--- a/boost/multi_array/iterator.hpp
+++ b/boost/multi_array/iterator.hpp
@@ -44,16 +44,18 @@ struct operator_arrow_proxy
mutable T value_;
};
-template <typename T, typename TPtr, typename NumDims, typename Reference>
+template <typename T, typename TPtr, typename NumDims, typename Reference,
+ typename IteratorCategory>
class array_iterator;
-template <typename T, typename TPtr, typename NumDims, typename Reference>
+template <typename T, typename TPtr, typename NumDims, typename Reference,
+ typename IteratorCategory>
class array_iterator
: public
iterator_facade<
- array_iterator<T,TPtr,NumDims,Reference>
+ array_iterator<T,TPtr,NumDims,Reference,IteratorCategory>
, typename associated_types<T,NumDims>::value_type
- , boost::random_access_traversal_tag
+ , IteratorCategory
, Reference
>
, private
@@ -69,7 +71,7 @@ class array_iterator
typedef detail::multi_array::associated_types<T,NumDims> access_t;
typedef iterator_facade<
- array_iterator<T,TPtr,NumDims,Reference>
+ array_iterator<T,TPtr,NumDims,Reference,IteratorCategory>
, typename detail::multi_array::associated_types<T,NumDims>::value_type
, boost::random_access_traversal_tag
, Reference
@@ -79,7 +81,7 @@ class array_iterator
typedef typename access_t::size_type size_type;
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
- template <typename, typename, typename, typename>
+ template <typename, typename, typename, typename, typename>
friend class array_iterator;
#else
public:
@@ -105,9 +107,9 @@ public:
idx_(idx), base_(base), extents_(extents),
strides_(strides), index_base_(index_base) { }
- template <typename OPtr, typename ORef>
+ template <typename OPtr, typename ORef, typename Cat>
array_iterator(
- const array_iterator<T,OPtr,NumDims,ORef>& rhs
+ const array_iterator<T,OPtr,NumDims,ORef,Cat>& rhs
, typename boost::enable_if_convertible<OPtr,TPtr>::type* = 0
)
: idx_(rhs.idx_), base_(rhs.base_), extents_(rhs.extents_),
diff --git a/boost/multi_array/multi_array_ref.hpp b/boost/multi_array/multi_array_ref.hpp
index 7015e23591..92e8fb4154 100644
--- a/boost/multi_array/multi_array_ref.hpp
+++ b/boost/multi_array/multi_array_ref.hpp
@@ -26,6 +26,7 @@
#include "boost/multi_array/view.hpp"
#include "boost/multi_array/algorithm.hpp"
#include "boost/type_traits/is_integral.hpp"
+#include "boost/utility/enable_if.hpp"
#include "boost/array.hpp"
#include "boost/concept_check.hpp"
#include "boost/functional.hpp"
diff --git a/boost/multi_array/view.hpp b/boost/multi_array/view.hpp
index cd3e44bf71..d11e2604a2 100644
--- a/boost/multi_array/view.hpp
+++ b/boost/multi_array/view.hpp
@@ -24,6 +24,7 @@
#include "boost/multi_array/subarray.hpp"
#include "boost/multi_array/algorithm.hpp"
#include "boost/type_traits/is_integral.hpp"
+#include "boost/utility/enable_if.hpp"
#include "boost/array.hpp"
#include "boost/limits.hpp"
#include <algorithm>
diff --git a/boost/numeric/conversion/converter_policies.hpp b/boost/numeric/conversion/converter_policies.hpp
index b0d741b8e3..e7a5e67ce9 100644
--- a/boost/numeric/conversion/converter_policies.hpp
+++ b/boost/numeric/conversion/converter_policies.hpp
@@ -13,6 +13,7 @@
#include <typeinfo> // for std::bad_cast
#include <boost/config/no_tr1/cmath.hpp> // for std::floor and std::ceil
+#include <boost/throw_exception.hpp>
#include <functional>
@@ -158,10 +159,17 @@ struct def_overflow_handler
{
void operator() ( range_check_result r ) // throw(negative_overflow,positive_overflow)
{
+#ifndef BOOST_NO_EXCEPTIONS
if ( r == cNegOverflow )
throw negative_overflow() ;
else if ( r == cPosOverflow )
throw positive_overflow() ;
+#else
+ if ( r == cNegOverflow )
+ ::boost::throw_exception(negative_overflow()) ;
+ else if ( r == cPosOverflow )
+ ::boost::throw_exception(positive_overflow()) ;
+#endif
}
} ;
diff --git a/boost/numeric/interval/detail/msvc_rounding_control.hpp b/boost/numeric/interval/detail/msvc_rounding_control.hpp
index 95c790fe72..d36e802429 100644
--- a/boost/numeric/interval/detail/msvc_rounding_control.hpp
+++ b/boost/numeric/interval/detail/msvc_rounding_control.hpp
@@ -25,7 +25,7 @@ namespace numeric {
namespace interval_lib {
namespace detail {
-#if BOOST_MSVC < 1400 || defined(WIN64)
+#if BOOST_MSVC < 1400 || defined(_WIN64)
extern "C" { double rint(double); }
#else
inline double rint(double x)
diff --git a/boost/parameter/aux_/cast.hpp b/boost/parameter/aux_/cast.hpp
index c9d290d9c4..b94c764e03 100644
--- a/boost/parameter/aux_/cast.hpp
+++ b/boost/parameter/aux_/cast.hpp
@@ -40,11 +40,11 @@ struct use_default_tag {};
// X(something, *(predicate))
// X(something, (int))
-template <class T>
+template <class T, class Args>
struct cast;
-template <>
-struct cast<void*>
+template <class Args>
+struct cast<void*, Args>
{
static use_default_tag execute(use_default_tag)
{
@@ -73,27 +73,39 @@ struct cast<void*>
typedef void* voidstar;
-template <class T>
-struct cast<voidstar(T)>
- : cast<void*>
+template <class T, class Args>
+struct cast<voidstar(T), Args>
+ : cast<void*, Args>
{
};
#else
-template <class T>
-struct cast<void*(T)>
- : cast<void*>
+template <class T, class Args>
+struct cast<void*(T), Args>
+ : cast<void*, Args>
{
};
#endif
-template <class T>
-struct cast<void(T)>
+// This is a hack used in cast<> to turn the user supplied type,
+// which may or may not be a placeholder expression into one, so
+// that it will be properly evaluated by mpl::apply.
+template <class T, class Dummy = mpl::_1>
+struct as_placeholder_expr
{
+ typedef T type;
+};
+
+template <class T, class Args>
+struct cast<void(T), Args>
+{
+ typedef typename mpl::apply2<
+ as_placeholder_expr<T>, Args, Args>::type type0;
+
typedef typename boost::add_reference<
- typename boost::remove_const<T>::type
+ typename boost::remove_const<type0>::type
>::type reference;
static use_default_tag execute(use_default_tag)
@@ -106,7 +118,7 @@ struct cast<void(T)>
return use_default_tag();
}
- static T execute(T value)
+ static type0 execute(type0 value)
{
return value;
}
@@ -118,9 +130,9 @@ struct cast<void(T)>
}
};
-# define BOOST_PARAMETER_FUNCTION_CAST(value, predicate) \
- boost::parameter::aux::cast<void predicate>::remove_const( \
- boost::parameter::aux::cast<void predicate>::execute(value) \
+# define BOOST_PARAMETER_FUNCTION_CAST(value, predicate, args) \
+ boost::parameter::aux::cast<void predicate, args>::remove_const( \
+ boost::parameter::aux::cast<void predicate, args>::execute(value) \
)
# endif
diff --git a/boost/parameter/preprocessor.hpp b/boost/parameter/preprocessor.hpp
index 3c39619455..f1bda87cdd 100644
--- a/boost/parameter/preprocessor.hpp
+++ b/boost/parameter/preprocessor.hpp
@@ -701,6 +701,7 @@ struct funptr_predicate<void**>
) \
] \
, BOOST_PARAMETER_FN_ARG_PRED(arg) \
+ , Args \
)
# define BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_BODY(name, n, split_args, tag_namespace) \
@@ -728,6 +729,7 @@ struct funptr_predicate<void**>
BOOST_PARAMETER_FUNCTION_CAST( \
boost::parameter::aux::as_lvalue(BOOST_PARAMETER_FN_ARG_DEFAULT(arg), 0L) \
, BOOST_PARAMETER_FN_ARG_PRED(arg) \
+ , Args \
)
# define BOOST_PARAMETER_FUNCTION_DEFAULT_EVAL_DEFAULT_BODY(name, n, split_args, tag_ns, const_) \
@@ -843,6 +845,7 @@ struct funptr_predicate<void**>
boost::parameter::keyword<tag_ns::BOOST_PARAMETER_FN_ARG_KEYWORD(arg)>::instance \
] \
, BOOST_PARAMETER_FN_ARG_PRED(arg) \
+ , Args \
)
// Generates the function template that recives a ArgumentPack, and then
diff --git a/boost/pending/detail/property.hpp b/boost/pending/detail/property.hpp
index 09e8866cf6..42c7ce07dc 100644
--- a/boost/pending/detail/property.hpp
+++ b/boost/pending/detail/property.hpp
@@ -13,147 +13,8 @@ namespace boost {
namespace detail {
- template <class PropertyTag1, class PropertyTag2>
- struct same_property {
- enum { value = is_same<PropertyTag1,PropertyTag2>::value };
- };
-
struct error_property_not_found { };
- template <int TagMatched>
- struct property_value_dispatch {
- template <class PropertyTag, class T, class Tag>
- inline static T& get_value(PropertyTag& p, T*, Tag) {
- return p.m_value;
- }
- template <class PropertyTag, class T, class Tag>
- inline static const T& const_get_value(const PropertyTag& p, T*, Tag) {
- return p.m_value;
- }
- };
-
- template <class PropertyList>
- struct property_value_end {
- template <class T> struct result { typedef T type; };
-
- template <class T, class Tag>
- inline static T& get_value(PropertyList& p, T* t, Tag tag) {
- typedef typename PropertyList::next_type Next;
- typedef typename Next::tag_type Next_tag;
- enum { match = same_property<Next_tag,Tag>::value };
- return property_value_dispatch<match>
- ::get_value(static_cast<Next&>(p), t, tag);
- }
- template <class T, class Tag>
- inline static const T& const_get_value(const PropertyList& p, T* t, Tag tag) {
- typedef typename PropertyList::next_type Next;
- typedef typename Next::tag_type Next_tag;
- enum { match = same_property<Next_tag,Tag>::value };
- return property_value_dispatch<match>
- ::const_get_value(static_cast<const Next&>(p), t, tag);
- }
- };
- template <>
- struct property_value_end<no_property> {
- template <class T> struct result {
- typedef detail::error_property_not_found type;
- };
-
- // Stop the recursion and return error
- template <class T, class Tag>
- inline static detail::error_property_not_found&
- get_value(no_property&, T*, Tag) {
- static error_property_not_found s_prop_not_found;
- return s_prop_not_found;
- }
- template <class T, class Tag>
- inline static const detail::error_property_not_found&
- const_get_value(const no_property&, T*, Tag) {
- static error_property_not_found s_prop_not_found;
- return s_prop_not_found;
- }
- };
-
- template <>
- struct property_value_dispatch<0> {
- template <class PropertyList, class T, class Tag>
- inline static typename property_value_end<PropertyList>::template result<T>::type&
- get_value(PropertyList& p, T* t, Tag tag) {
- return property_value_end<PropertyList>::get_value(p, t, tag);
- }
- template <class PropertyList, class T, class Tag>
- inline static const typename property_value_end<PropertyList>::template result<T>::type&
- const_get_value(const PropertyList& p, T* t, Tag tag) {
- return property_value_end<PropertyList>::const_get_value(p, t, tag);
- }
- };
-
- template <class PropertyList>
- struct build_property_tag_value_alist
- {
- typedef typename PropertyList::next_type NextProperty;
- typedef typename PropertyList::value_type Value;
- typedef typename PropertyList::tag_type Tag;
- typedef typename build_property_tag_value_alist<NextProperty>::type Next;
- typedef std::pair< std::pair<Tag,Value>, Next> type;
- };
- template <>
- struct build_property_tag_value_alist<no_property>
- {
- typedef no_property type;
- };
-
-#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
- template <class TagValueAList, class Tag>
- struct extract_value {
- typedef error_property_not_found type;
- };
- template <class Value, class Tag1, class Tag2, class Rest>
- struct extract_value< std::pair<std::pair<Tag1,Value>,Rest>, Tag2> {
- typedef typename extract_value<Rest,Tag2>::type type;
- };
- template <class Value, class Tag, class Rest>
- struct extract_value< std::pair<std::pair<Tag,Value>,Rest>, Tag> {
- typedef Value type;
- };
-#else
- // VC++ workaround:
- // The main idea here is to replace partial specialization with
- // nested template member classes. Of course there is the
- // further complication that the outer class of the nested
- // template class cannot itself be a template class.
- // Hence the need for the ev_selector. -JGS
-
- struct recursive_extract;
- struct end_extract;
-
- template <class TagValueAList>
- struct ev_selector { typedef recursive_extract type; };
- template <>
- struct ev_selector<no_property> { typedef end_extract type; };
-
- struct recursive_extract {
- template <class TagValueAList, class Tag1>
- struct bind_ {
- typedef typename TagValueAList::first_type AListFirst;
- typedef typename AListFirst::first_type Tag2;
- typedef typename AListFirst::second_type Value;
- enum { match = same_property<Tag1,Tag2>::value };
- typedef typename TagValueAList::second_type Next;
- typedef typename ev_selector<Next>::type Extractor;
- typedef typename boost::ct_if< match, Value,
- typename Extractor::template bind_<Next,Tag1>::type
- >::type type;
- };
- };
- struct end_extract {
- template <class AList, class Tag1>
- struct bind_ {
- typedef error_property_not_found type;
- };
- };
-#endif //!defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-
} // namespace detail
} // namespace boost
diff --git a/boost/pending/property.hpp b/boost/pending/property.hpp
index c9880458cb..93ebffbf3b 100644
--- a/boost/pending/property.hpp
+++ b/boost/pending/property.hpp
@@ -7,32 +7,156 @@
#define BOOST_PROPERTY_HPP
#include <boost/mpl/bool.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/has_xxx.hpp>
+#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits.hpp>
namespace boost {
- struct no_property {
- typedef no_property tag_type;
- typedef no_property next_type;
- typedef no_property value_type;
- enum { num = 0 };
- typedef void kind;
- };
+ struct no_property {};
template <class Tag, class T, class Base = no_property>
- struct property : public Base {
+ struct property {
typedef Base next_type;
typedef Tag tag_type;
typedef T value_type;
-#if BOOST_WORKAROUND (__GNUC__, < 3)
- property() { }
-#else
- property() : m_value() { }
-#endif
- property(const T& v) : m_value(v) { }
- property(const T& v, const Base& b) : Base(b), m_value(v) { }
+ property(const T& v = T()) : m_value(v) { }
+ property(const T& v, const Base& b) : m_value(v), m_base(b) { }
// copy constructor and assignment operator will be generated by compiler
T m_value;
+ Base m_base;
+ };
+
+ // Kinds of properties
+ namespace graph_introspect_detail {
+ BOOST_MPL_HAS_XXX_TRAIT_DEF(kind)
+ template <typename T, bool Cond> struct get_kind {typedef void type;};
+ template <typename T> struct get_kind<T, true> {typedef typename T::kind type;};
+ }
+
+ // Having a default is to make this trait work for any type, not just valid
+ // properties, to work around VC++ <= 10 bugs related to SFINAE in
+ // compressed_sparse_row_graph's get functions and similar
+ template <class PropertyTag>
+ struct property_kind:
+ graph_introspect_detail::get_kind<PropertyTag, graph_introspect_detail::has_kind<PropertyTag>::value>
+ {};
+
+ // Some standard properties defined independently of Boost.Graph:
+ enum vertex_all_t {vertex_all};
+ enum edge_all_t {edge_all};
+ enum graph_all_t {graph_all};
+ enum vertex_bundle_t {vertex_bundle};
+ enum edge_bundle_t {edge_bundle};
+ enum graph_bundle_t {graph_bundle};
+
+ // Code to look up one property in a property list:
+ template <typename PList, typename PropName>
+ struct lookup_one_property_internal {BOOST_STATIC_CONSTANT(bool, found = false);};
+
+ // Special-case properties (vertex_all, edge_all, graph_all)
+#define BGL_ALL_PROP(tag) \
+ template <typename T> \
+ struct lookup_one_property_internal<T, tag> { \
+ BOOST_STATIC_CONSTANT(bool, found = true); \
+ typedef T type; \
+ static T& lookup(T& x, tag) {return x;} \
+ static const T& lookup(const T& x, tag) {return x;} \
+ }; \
+ template <typename Tag, typename T, typename Base> \
+ struct lookup_one_property_internal<property<Tag, T, Base>, tag> { /* Avoid ambiguity */ \
+ BOOST_STATIC_CONSTANT(bool, found = true); \
+ typedef property<Tag, T, Base> type; \
+ static type& lookup(type& x, tag) {return x;} \
+ static const type& lookup(const type& x, tag) {return x;} \
+ };
+
+ BGL_ALL_PROP(vertex_all_t)
+ BGL_ALL_PROP(edge_all_t)
+ BGL_ALL_PROP(graph_all_t)
+#undef BGL_ALL_PROP
+
+ // *_bundled; these need to be macros rather than inheritance to resolve ambiguities
+ #define BGL_DO_ONE_BUNDLE_TYPE(kind) \
+ template <typename T> \
+ struct lookup_one_property_internal<T, BOOST_JOIN(kind, _bundle_t)> { \
+ BOOST_STATIC_CONSTANT(bool, found = true); \
+ typedef T type; \
+ static T& lookup(T& x, BOOST_JOIN(kind, _bundle_t)) {return x;} \
+ static const T& lookup(const T& x, BOOST_JOIN(kind, _bundle_t)) {return x;} \
+ }; \
+ \
+ template <typename Tag, typename T, typename Base> \
+ struct lookup_one_property_internal<property<Tag, T, Base>, BOOST_JOIN(kind, _bundle_t)>: lookup_one_property_internal<Base, BOOST_JOIN(kind, _bundle_t)> { \
+ private: \
+ typedef lookup_one_property_internal<Base, BOOST_JOIN(kind, _bundle_t)> base_type; \
+ public: \
+ static typename base_type::type& lookup(property<Tag, T, Base>& p, BOOST_JOIN(kind, _bundle_t)) {return base_type::lookup(p.m_base, BOOST_JOIN(kind, _bundle_t)());} \
+ static const typename base_type::type& lookup(const property<Tag, T, Base>& p, BOOST_JOIN(kind, _bundle_t)) {return base_type::lookup(p.m_base, BOOST_JOIN(kind, _bundle_t)());} \
+ }; \
+
+ BGL_DO_ONE_BUNDLE_TYPE(vertex)
+ BGL_DO_ONE_BUNDLE_TYPE(edge)
+ BGL_DO_ONE_BUNDLE_TYPE(graph)
+#undef BGL_DO_ONE_BUNDLE_TYPE
+
+ // Normal old-style properties; second case also handles chaining of bundled property accesses
+ template <typename Tag, typename T, typename Base>
+ struct lookup_one_property_internal<boost::property<Tag, T, Base>, Tag> {
+ BOOST_STATIC_CONSTANT(bool, found = true);
+ typedef property<Tag, T, Base> prop;
+ typedef T type;
+ template <typename U>
+ static typename enable_if<is_same<prop, U>, T&>::type
+ lookup(U& prop, const Tag&) {return prop.m_value;}
+ template <typename U>
+ static typename enable_if<is_same<prop, U>, const T&>::type
+ lookup(const U& prop, const Tag&) {return prop.m_value;}
+ };
+
+ template <typename Tag, typename T, typename Base, typename PropName>
+ struct lookup_one_property_internal<boost::property<Tag, T, Base>, PropName>: lookup_one_property_internal<Base, PropName> {
+ private:
+ typedef lookup_one_property_internal<Base, PropName> base_type;
+ public:
+ template <typename PL>
+ static typename enable_if<is_same<PL, boost::property<Tag, T, Base> >, typename base_type::type&>::type
+ lookup(PL& prop, const PropName& tag) {
+ return base_type::lookup(prop.m_base, tag);
+ }
+ template <typename PL>
+ static typename enable_if<is_same<PL, boost::property<Tag, T, Base> >, const typename base_type::type&>::type
+ lookup(const PL& prop, const PropName& tag) {
+ return base_type::lookup(prop.m_base, tag);
+ }
+ };
+
+ // Pointer-to-member access to bundled properties
+#ifndef BOOST_GRAPH_NO_BUNDLED_PROPERTIES
+ template <typename T, typename R>
+ struct lookup_one_property_internal<T, R T::*> {
+ BOOST_STATIC_CONSTANT(bool, found = true);
+ typedef R type;
+ static R& lookup(T& x, R T::*ptr) {return x.*ptr;}
+ static const R& lookup(const T& x, R T::*ptr) {return x.*ptr;}
+ };
+#endif
+
+ // Version of above handling const property lists properly
+ template <typename T, typename Tag>
+ struct lookup_one_property: lookup_one_property_internal<T, Tag> {};
+
+ template <typename T, typename Tag>
+ struct lookup_one_property<const T, Tag> {
+ BOOST_STATIC_CONSTANT(bool, found = (lookup_one_property_internal<T, Tag>::found));
+ typedef const typename lookup_one_property_internal<T, Tag>::type type;
+ template <typename U>
+ static typename enable_if<is_same<T, U>, const typename lookup_one_property_internal<T, Tag>::type&>::type
+ lookup(const U& p, Tag tag) {
+ return lookup_one_property_internal<T, Tag>::lookup(p, tag);
+ }
};
// The BGL properties specialize property_kind and
@@ -41,11 +165,6 @@ namespace boost {
// instead with a nested kind type and num. Also, we may want to
// switch BGL back to using class types for properties at some point.
- template <class PropertyTag>
- struct property_kind {
- typedef typename PropertyTag::kind type;
- };
-
template <class P>
struct has_property : boost::mpl::true_ {};
template <>
@@ -58,45 +177,18 @@ namespace boost {
namespace boost {
template <class PropertyList, class Tag>
- struct property_value {
-#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
- typedef typename detail::build_property_tag_value_alist<PropertyList>::type AList;
- typedef typename detail::extract_value<AList,Tag>::type type;
-#else
- typedef typename detail::build_property_tag_value_alist<PropertyList>::type AList;
- typedef typename detail::ev_selector<AList>::type Extractor;
- typedef typename Extractor::template bind_<AList,Tag>::type type;
-#endif
- };
+ struct property_value: lookup_one_property<PropertyList, Tag> {};
- template <class Tag2>
- inline detail::error_property_not_found
- get_property_value(const no_property&, Tag2) {
- return detail::error_property_not_found();
+ template <class PropertyList, class Tag>
+ inline typename lookup_one_property<PropertyList, Tag>::type&
+ get_property_value(PropertyList& p, Tag tag) {
+ return lookup_one_property<PropertyList, Tag>::lookup(p, tag);
}
- template <class Tag1, class Tag2, class T1, class Base>
- inline typename property_value<property<Tag1,T1,Base>, Tag2>::type&
- get_property_value(property<Tag1,T1,Base>& p, Tag2 tag2) {
- BOOST_STATIC_CONSTANT(bool,
- match = (detail::same_property<Tag1,Tag2>::value));
- typedef property<Tag1,T1,Base> Prop;
- typedef typename property_value<Prop, Tag2>::type T2;
- T2* t2 = 0;
- typedef detail::property_value_dispatch<match> Dispatcher;
- return Dispatcher::get_value(p, t2, tag2);
- }
- template <class Tag1, class Tag2, class T1, class Base>
- inline
- const typename property_value<property<Tag1,T1,Base>, Tag2>::type&
- get_property_value(const property<Tag1,T1,Base>& p, Tag2 tag2) {
- BOOST_STATIC_CONSTANT(bool,
- match = (detail::same_property<Tag1,Tag2>::value));
- typedef property<Tag1,T1,Base> Prop;
- typedef typename property_value<Prop, Tag2>::type T2;
- T2* t2 = 0;
- typedef detail::property_value_dispatch<match> Dispatcher;
- return Dispatcher::const_get_value(p, t2, tag2);
+ template <class PropertyList, class Tag>
+ inline const typename lookup_one_property<PropertyList, Tag>::type&
+ get_property_value(const PropertyList& p, Tag tag) {
+ return lookup_one_property<PropertyList, Tag>::lookup(p, tag);
}
namespace detail {
@@ -107,7 +199,6 @@ namespace boost {
: mpl::bool_<is_same<T, no_property>::value>
{ };
-#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
/** @internal @name Retag Property List
* This metafunction is used internally to normalize a property if it is
* actually modeling a property. Specifically this is used in Boost.Graph
@@ -159,7 +250,40 @@ namespace boost {
typedef no_property retagged;
};
//@}
-#endif
+
+ template <typename PList, typename Tag>
+ class lookup_one_property_f;
+
+ template <typename PList, typename Tag, typename F> struct lookup_one_property_f_result;
+
+ template <typename PList, typename Tag>
+ struct lookup_one_property_f_result<PList, Tag, const lookup_one_property_f<PList, Tag>(PList)> {
+ typedef typename lookup_one_property<PList, Tag>::type type;
+ };
+
+ template <typename PList, typename Tag>
+ struct lookup_one_property_f_result<PList, Tag, const lookup_one_property_f<PList, Tag>(PList&)> {
+ typedef typename lookup_one_property<PList, Tag>::type& type;
+ };
+
+ template <typename PList, typename Tag>
+ struct lookup_one_property_f_result<PList, Tag, const lookup_one_property_f<PList, Tag>(const PList&)> {
+ typedef const typename lookup_one_property<PList, Tag>::type& type;
+ };
+
+ template <typename PList, typename Tag>
+ class lookup_one_property_f {
+ Tag tag;
+ public:
+ lookup_one_property_f(Tag tag): tag(tag) {}
+ template <typename F> struct result: lookup_one_property_f_result<PList, Tag, F> {};
+
+ typename lookup_one_property_f_result<PList, Tag, const lookup_one_property_f(PList&)>::type
+ operator()(PList& pl) const {
+ return lookup_one_property<PList, Tag>::lookup(pl, tag);
+ }
+ };
+
} // namespace detail
} // namesapce boost
diff --git a/boost/pending/property_serialize.hpp b/boost/pending/property_serialize.hpp
index 21f9653b7b..a3cf9f6c3b 100644
--- a/boost/pending/property_serialize.hpp
+++ b/boost/pending/property_serialize.hpp
@@ -24,8 +24,8 @@ namespace boost {
serialize(Archive& ar, property<Tag, T, Base>& prop,
const unsigned int /*version*/)
{
- ar & serialization::make_nvp( "property_base" , boost::serialization::base_object<Base>(prop) );
ar & serialization::make_nvp( "property_value" , prop.m_value );
+ ar & serialization::make_nvp( "property_base" , prop.m_base );
}
#ifdef BOOST_GRAPH_USE_MPI
diff --git a/boost/program_options/detail/cmdline.hpp b/boost/program_options/detail/cmdline.hpp
index 7c431525f4..8e3bcc6dc6 100644
--- a/boost/program_options/detail/cmdline.hpp
+++ b/boost/program_options/detail/cmdline.hpp
@@ -81,6 +81,18 @@ namespace boost { namespace program_options { namespace detail {
cmdline(int argc, const char*const * argv);
void style(int style);
+
+ /** returns the canonical option prefix associated with the command_line_style
+ * In order of precedence:
+ * allow_long : allow_long
+ * allow_long_disguise : allow_long_disguise
+ * allow_dash_for_short : allow_short | allow_dash_for_short
+ * allow_slash_for_short: allow_short | allow_slash_for_short
+ *
+ * This is mainly used for the diagnostic messages in exceptions
+ */
+ int get_canonical_option_prefix();
+
void allow_unregistered();
void set_options_description(const options_description& desc);
diff --git a/boost/program_options/detail/config_file.hpp b/boost/program_options/detail/config_file.hpp
index 91caac754d..4c2c15b934 100644
--- a/boost/program_options/detail/config_file.hpp
+++ b/boost/program_options/detail/config_file.hpp
@@ -17,9 +17,7 @@
#include <boost/program_options/eof_iterator.hpp>
#include <boost/detail/workaround.hpp>
-#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3202))
#include <boost/program_options/detail/convert.hpp>
-#endif
#if BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042))
#include <istream> // std::getline
diff --git a/boost/program_options/detail/parsers.hpp b/boost/program_options/detail/parsers.hpp
index a1124b277f..af240c6861 100644
--- a/boost/program_options/detail/parsers.hpp
+++ b/boost/program_options/detail/parsers.hpp
@@ -100,7 +100,11 @@ namespace boost { namespace program_options {
basic_parsed_options<charT>
basic_command_line_parser<charT>::run()
{
- parsed_options result(m_desc);
+ // save the canonical prefixes which were used by this cmdline parser
+ // eventually inside the parsed results
+ // This will be handy to format recognisable options
+ // for diagnostic messages if everything blows up much later on
+ parsed_options result(m_desc, detail::cmdline::get_canonical_option_prefix());
result.options = detail::cmdline::run();
// Presense of parsed_options -> wparsed_options conversion
diff --git a/boost/program_options/detail/value_semantic.hpp b/boost/program_options/detail/value_semantic.hpp
index e4b15d7621..814a3db2c6 100644
--- a/boost/program_options/detail/value_semantic.hpp
+++ b/boost/program_options/detail/value_semantic.hpp
@@ -16,16 +16,17 @@ namespace boost { namespace program_options {
std::string
typed_value<T, charT>::name() const
{
+ std::string const& var = (m_value_name.empty() ? arg : m_value_name);
if (!m_implicit_value.empty() && !m_implicit_value_as_text.empty()) {
- std::string msg = "[=arg(=" + m_implicit_value_as_text + ")]";
+ std::string msg = "[=" + var + "(=" + m_implicit_value_as_text + ")]";
if (!m_default_value.empty() && !m_default_value_as_text.empty())
msg += " (=" + m_default_value_as_text + ")";
return msg;
}
else if (!m_default_value.empty() && !m_default_value_as_text.empty()) {
- return arg + " (=" + m_default_value_as_text + ")";
+ return var + " (=" + m_default_value_as_text + ")";
} else {
- return arg;
+ return var;
}
}
diff --git a/boost/program_options/errors.hpp b/boost/program_options/errors.hpp
index ff6bc7f0e8..addb8d6d59 100644
--- a/boost/program_options/errors.hpp
+++ b/boost/program_options/errors.hpp
@@ -12,6 +12,8 @@
#include <string>
#include <stdexcept>
#include <vector>
+#include <map>
+
#if defined(BOOST_MSVC)
# pragma warning (push)
@@ -21,126 +23,338 @@
namespace boost { namespace program_options {
+ inline std::string strip_prefixes(const std::string& text)
+ {
+ return text.substr(text.find_last_of("-/") + 1);
+ }
+
/** Base class for all errors in the library. */
class BOOST_PROGRAM_OPTIONS_DECL error : public std::logic_error {
public:
error(const std::string& xwhat) : std::logic_error(xwhat) {}
};
- class BOOST_PROGRAM_OPTIONS_DECL invalid_syntax : public error {
+
+ /** Class thrown when there are too many positional options.
+ This is a programming error.
+ */
+ class BOOST_PROGRAM_OPTIONS_DECL too_many_positional_options_error : public error {
public:
- enum kind_t {
- long_not_allowed = 30,
- long_adjacent_not_allowed,
- short_adjacent_not_allowed,
- empty_adjacent_parameter,
- missing_parameter,
- extra_parameter,
- unrecognized_line
- };
-
- invalid_syntax(const std::string& tokens, kind_t kind);
+ too_many_positional_options_error()
+ : error("too many positional options have been specified on the command line")
+ {}
+ };
+
+ /** Class thrown when there are programming error related to style */
+ class BOOST_PROGRAM_OPTIONS_DECL invalid_command_line_style : public error {
+ public:
+ invalid_command_line_style(const std::string& msg)
+ : error(msg)
+ {}
+ };
+
+ /** Class thrown if config file can not be read */
+ class BOOST_PROGRAM_OPTIONS_DECL reading_file : public error {
+ public:
+ reading_file(const char* filename)
+ : error(std::string("can not read options configuration file '").append(filename).append("'"))
+ {}
+ };
+
+
+ /** Base class for most exceptions in the library.
+ *
+ * Substitutes the values for the parameter name
+ * placeholders in the template to create the human
+ * readable error message
+ *
+ * Placeholders are surrounded by % signs: %example%
+ * Poor man's version of boost::format
+ *
+ * If a parameter name is absent, perform default substitutions
+ * instead so ugly placeholders are never left in-place.
+ *
+ * Options are displayed in "canonical" form
+ * This is the most unambiguous form of the
+ * *parsed* option name and would correspond to
+ * option_description::format_name()
+ * i.e. what is shown by print_usage()
+ *
+ * The "canonical" form depends on whether the option is
+ * specified in short or long form, using dashes or slashes
+ * or without a prefix (from a configuration file)
+ *
+ * */
+ class BOOST_PROGRAM_OPTIONS_DECL error_with_option_name : public error {
- // gcc says that throw specification on dtor is loosened
- // without this line
- ~invalid_syntax() throw() {}
-
- kind_t kind() const;
-
- const std::string& tokens() const;
-
protected:
- /** Used to convert kind_t to a related error text */
- static std::string error_message(kind_t kind);
+ /** can be
+ * 0 = no prefix (config file options)
+ * allow_long
+ * allow_dash_for_short
+ * allow_slash_for_short
+ * allow_long_disguise */
+ int m_option_style;
- private:
- // TODO: copy ctor might throw
- std::string m_tokens;
- kind_t m_kind;
+ /** substitutions
+ * from placeholders to values */
+ std::map<std::string, std::string> m_substitutions;
+ typedef std::pair<std::string, std::string> string_pair;
+ std::map<std::string, string_pair > m_substitution_defaults;
+
+ public:
+ /** template with placeholders */
+ std::string m_error_template;
+
+ error_with_option_name(const std::string& template_,
+ const std::string& option_name = "",
+ const std::string& original_token = "",
+ int option_style = 0);
+
+ /** gcc says that throw specification on dtor is loosened
+ * without this line
+ * */
+ ~error_with_option_name() throw() {}
+
+
+ //void dump() const
+ //{
+ // std::cerr << "m_substitution_defaults:\n";
+ // for (std::map<std::string, string_pair>::const_iterator iter = m_substitution_defaults.begin();
+ // iter != m_substitution_defaults.end(); ++iter)
+ // std::cerr << "\t" << iter->first << ":" << iter->second.first << "=" << iter->second.second << "\n";
+ // std::cerr << "m_substitutions:\n";
+ // for (std::map<std::string, std::string>::const_iterator iter = m_substitutions.begin();
+ // iter != m_substitutions.end(); ++iter)
+ // std::cerr << "\t" << iter->first << "=" << iter->second << "\n";
+ // std::cerr << "m_error_template:\n";
+ // std::cerr << "\t" << m_error_template << "\n";
+ // std::cerr << "canonical_option_prefix:[" << get_canonical_option_prefix() << "]\n";
+ // std::cerr << "canonical_option_name:[" << get_canonical_option_name() <<"]\n";
+ // std::cerr << "what:[" << what() << "]\n";
+ //}
+
+ /** Substitute
+ * parameter_name->value to create the error message from
+ * the error template */
+ void set_substitute(const std::string& parameter_name, const std::string& value)
+ { m_substitutions[parameter_name] = value; }
+
+ /** If the parameter is missing, then make the
+ * from->to substitution instead */
+ void set_substitute_default(const std::string& parameter_name,
+ const std::string& from,
+ const std::string& to)
+ {
+ m_substitution_defaults[parameter_name] = std::make_pair(from, to);
+ }
+
+
+ /** Add context to an exception */
+ void add_context(const std::string& option_name,
+ const std::string& original_token,
+ int option_style)
+ {
+ set_option_name(option_name);
+ set_original_token(original_token);
+ set_prefix(option_style);
+ }
+
+ void set_prefix(int option_style)
+ { m_option_style = option_style;}
+
+ /** Overridden in error_with_no_option_name */
+ virtual void set_option_name(const std::string& option_name)
+ { set_substitute("option", option_name);}
+
+ std::string get_option_name() const throw()
+ { return get_canonical_option_name(); }
+
+ void set_original_token(const std::string& original_token)
+ { set_substitute("original_token", original_token);}
+
+
+ /** Creates the error_message on the fly
+ * Currently a thin wrapper for substitute_placeholders() */
+ virtual const char* what() const throw();
+
+ protected:
+ /** Used to hold the error text returned by what() */
+ mutable std::string m_message; // For on-demand formatting in 'what'
+
+ /** Makes all substitutions using the template */
+ virtual void substitute_placeholders(const std::string& error_template) const;
+
+ // helper function for substitute_placeholders
+ void replace_token(const std::string& from, const std::string& to) const;
+
+ /** Construct option name in accordance with the appropriate
+ * prefix style: i.e. long dash or short slash etc */
+ std::string get_canonical_option_name() const;
+ std::string get_canonical_option_prefix() const;
+ };
+
+
+ /** Class thrown when there are several option values, but
+ user called a method which cannot return them all. */
+ class BOOST_PROGRAM_OPTIONS_DECL multiple_values : public error_with_option_name {
+ public:
+ multiple_values()
+ : error_with_option_name("option '%canonical_option%' only takes a single argument"){}
+
+ ~multiple_values() throw() {}
+ };
+
+ /** Class thrown when there are several occurrences of an
+ option, but user called a method which cannot return
+ them all. */
+ class BOOST_PROGRAM_OPTIONS_DECL multiple_occurrences : public error_with_option_name {
+ public:
+ multiple_occurrences()
+ : error_with_option_name("option '%canonical_option%' cannot be specified more than once"){}
+
+ ~multiple_occurrences() throw() {}
+
+ };
+
+ /** Class thrown when a required/mandatory option is missing */
+ class BOOST_PROGRAM_OPTIONS_DECL required_option : public error_with_option_name {
+ public:
+ // option name is constructed by the option_descriptor and never on the fly
+ required_option(const std::string& option_name)
+ : error_with_option_name("the option '%canonical_option%' is required but missing", "", option_name)
+ {
+ }
+
+ ~required_option() throw() {}
+ };
+
+ /** Base class of unparsable options,
+ * when the desired option cannot be identified.
+ *
+ *
+ * It makes no sense to have an option name, when we can't match an option to the
+ * parameter
+ *
+ * Having this a part of the error_with_option_name hierachy makes error handling
+ * a lot easier, even if the name indicates some sort of conceptual dissonance!
+ *
+ * */
+ class BOOST_PROGRAM_OPTIONS_DECL error_with_no_option_name : public error_with_option_name {
+ public:
+ error_with_no_option_name(const std::string& template_,
+ const std::string& original_token = "")
+ : error_with_option_name(template_, "", original_token)
+ {
+ }
+
+ /** Does NOT set option name, because no option name makes sense */
+ virtual void set_option_name(const std::string& option_name){}
+
+ ~error_with_no_option_name() throw() {}
};
+
/** Class thrown when option name is not recognized. */
- class BOOST_PROGRAM_OPTIONS_DECL unknown_option : public error {
+ class BOOST_PROGRAM_OPTIONS_DECL unknown_option : public error_with_no_option_name {
public:
- unknown_option(const std::string& name)
- : error(std::string("unknown option ").append(name)),
- m_option_name(name)
- {}
+ unknown_option(const std::string& original_token = "")
+ : error_with_no_option_name("unrecognised option '%canonical_option%'", original_token)
+ {
+ }
- // gcc says that throw specification on dtor is loosened
- // without this line
~unknown_option() throw() {}
-
- const std::string& get_option_name() const throw();
-
- private:
- std::string m_option_name;
};
+
+
/** Class thrown when there's ambiguity amoung several possible options. */
- class BOOST_PROGRAM_OPTIONS_DECL ambiguous_option : public error {
+ class BOOST_PROGRAM_OPTIONS_DECL ambiguous_option : public error_with_no_option_name {
public:
- ambiguous_option(const std::string& name,
- const std::vector<std::string>& xalternatives)
- : error(std::string("ambiguous option ").append(name))
- , m_alternatives(xalternatives)
- , m_option_name(name)
+ ambiguous_option(const std::vector<std::string>& xalternatives)
+ : error_with_no_option_name("option '%canonical_option%' is ambiguous"),
+ m_alternatives(xalternatives)
{}
~ambiguous_option() throw() {}
-
- const std::string& get_option_name() const throw();
-
- const std::vector<std::string>& alternatives() const throw();
+ const std::vector<std::string>& alternatives() const throw() {return m_alternatives;}
+
+ protected:
+ /** Makes all substitutions using the template */
+ virtual void substitute_placeholders(const std::string& error_template) const;
private:
// TODO: copy ctor might throw
std::vector<std::string> m_alternatives;
- std::string m_option_name;
};
- /** Class thrown when there are several option values, but
- user called a method which cannot return them all. */
- class BOOST_PROGRAM_OPTIONS_DECL multiple_values : public error {
+
+ /** Class thrown when there's syntax error either for command
+ * line or config file options. See derived children for
+ * concrete classes. */
+ class BOOST_PROGRAM_OPTIONS_DECL invalid_syntax : public error_with_option_name {
public:
- multiple_values()
- : error("multiple values")
- , m_option_name() {}
-
- ~multiple_values() throw() {}
-
- void set_option_name(const std::string& option);
-
- const std::string& get_option_name() const throw();
-
- private:
- std::string m_option_name; // The name of the option which
- // caused the exception.
+ enum kind_t {
+ long_not_allowed = 30,
+ long_adjacent_not_allowed,
+ short_adjacent_not_allowed,
+ empty_adjacent_parameter,
+ missing_parameter,
+ extra_parameter,
+ unrecognized_line
+ };
+
+ invalid_syntax(kind_t kind,
+ const std::string& option_name = "",
+ const std::string& original_token = "",
+ int option_style = 0):
+ error_with_option_name(get_template(kind), option_name, original_token, option_style),
+ m_kind(kind)
+ {
+ }
+
+ ~invalid_syntax() throw() {}
+
+ kind_t kind() const {return m_kind;}
+
+ /** Convenience functions for backwards compatibility */
+ virtual std::string tokens() const {return get_option_name(); }
+ protected:
+ /** Used to convert kind_t to a related error text */
+ std::string get_template(kind_t kind);
+ kind_t m_kind;
};
- /** Class thrown when there are several occurrences of an
- option, but user called a method which cannot return
- them all. */
- class BOOST_PROGRAM_OPTIONS_DECL multiple_occurrences : public error {
+ class BOOST_PROGRAM_OPTIONS_DECL invalid_config_file_syntax : public invalid_syntax {
public:
- multiple_occurrences()
- : error("multiple occurrences")
- , m_option_name() {}
-
- ~multiple_occurrences() throw() {}
-
- void set_option_name(const std::string& option);
-
- const std::string& get_option_name() const throw();
+ invalid_config_file_syntax(const std::string& invalid_line, kind_t kind):
+ invalid_syntax(kind)
+ {
+ m_substitutions["invalid_line"] = invalid_line;
+ }
+
+ ~invalid_config_file_syntax() throw() {}
+
+ /** Convenience functions for backwards compatibility */
+ virtual std::string tokens() const {return m_substitutions.find("invalid_line")->second; }
+ };
+
- private:
- std::string m_option_name; // The name of the option which
- // caused the exception.
+ /** Class thrown when there are syntax errors in given command line */
+ class BOOST_PROGRAM_OPTIONS_DECL invalid_command_line_syntax : public invalid_syntax {
+ public:
+ invalid_command_line_syntax(kind_t kind,
+ const std::string& option_name = "",
+ const std::string& original_token = "",
+ int option_style = 0):
+ invalid_syntax(kind, option_name, original_token, option_style) {}
+ ~invalid_command_line_syntax() throw() {}
};
+
/** Class thrown when value of option is incorrect. */
- class BOOST_PROGRAM_OPTIONS_DECL validation_error : public error {
+ class BOOST_PROGRAM_OPTIONS_DECL validation_error : public error_with_option_name {
public:
enum kind_t {
multiple_values_not_allowed = 30,
@@ -150,32 +364,24 @@ namespace boost { namespace program_options {
invalid_option
};
+ public:
validation_error(kind_t kind,
- const std::string& option_value = "",
- const std::string& option_name = "");
-
+ const std::string& option_name = "",
+ const std::string& original_token = "",
+ int option_style = 0):
+ error_with_option_name(get_template(kind), option_name, original_token, option_style)
+ {
+ }
+
~validation_error() throw() {}
- void set_option_name(const std::string& option);
-
- const std::string& get_option_name() const throw();
-
- const char* what() const throw();
-
protected:
/** Used to convert kind_t to a related error text */
- static std::string error_message(kind_t kind);
-
- private:
+ std::string get_template(kind_t kind);
kind_t m_kind;
- std::string m_option_name; // The name of the option which
- // caused the exception.
- std::string m_option_value; // Optional: value of the option m_options_name
- mutable std::string m_message; // For on-demand formatting in 'what'
-
};
- /** Class thrown if there is an invalid option value givenn */
+ /** Class thrown if there is an invalid option value given */
class BOOST_PROGRAM_OPTIONS_DECL invalid_option_value
: public validation_error
{
@@ -186,54 +392,20 @@ namespace boost { namespace program_options {
#endif
};
- /** Class thrown when there are too many positional options.
- This is a programming error.
- */
- class BOOST_PROGRAM_OPTIONS_DECL too_many_positional_options_error : public error {
+ /** Class thrown if there is an invalid bool value given */
+ class BOOST_PROGRAM_OPTIONS_DECL invalid_bool_value
+ : public validation_error
+ {
public:
- too_many_positional_options_error()
- : error("too many positional options")
- {}
+ invalid_bool_value(const std::string& value);
};
- /** Class thrown when there are syntax errors in given command line */
- class BOOST_PROGRAM_OPTIONS_DECL invalid_command_line_syntax : public invalid_syntax {
- public:
- invalid_command_line_syntax(const std::string& tokens, kind_t kind);
- };
- /** Class thrown when there are programming error related to style */
- class BOOST_PROGRAM_OPTIONS_DECL invalid_command_line_style : public error {
- public:
- invalid_command_line_style(const std::string& msg)
- : error(msg)
- {}
- };
- /** Class thrown if config file can not be read */
- class BOOST_PROGRAM_OPTIONS_DECL reading_file : public error {
- public:
- reading_file(const char* filename)
- : error(std::string("can not read file ").append(filename))
- {}
- };
+
+
- /** Class thrown when a required/mandatory option is missing */
- class BOOST_PROGRAM_OPTIONS_DECL required_option : public error {
- public:
- required_option(const std::string& name)
- : error(std::string("missing required option ").append(name))
- , m_option_name(name)
- {}
-
- ~required_option() throw() {}
- const std::string& get_option_name() const throw();
-
- private:
- std::string m_option_name; // The name of the option which
- // caused the exception.
- };
}}
#if defined(BOOST_MSVC)
diff --git a/boost/program_options/options_description.hpp b/boost/program_options/options_description.hpp
index eff1f90d8e..62530b2dc1 100644
--- a/boost/program_options/options_description.hpp
+++ b/boost/program_options/options_description.hpp
@@ -102,6 +102,16 @@ namespace program_options {
*/
const std::string& key(const std::string& option) const;
+
+ /** Returns the canonical name for the option description to enable the user to
+ recognised a matching option.
+ 1) For short options ('-', '/'), returns the short name prefixed.
+ 2) For long options ('--' / '-') returns the long name prefixed
+ 3) All other cases, returns the long name (if present) or the short name,
+ unprefixed.
+ */
+ std::string canonical_display_name(int canonical_option_style = 0) const;
+
const std::string& long_name() const;
/// Explanation of this option
diff --git a/boost/program_options/parsers.hpp b/boost/program_options/parsers.hpp
index c57b971575..96f38f25af 100644
--- a/boost/program_options/parsers.hpp
+++ b/boost/program_options/parsers.hpp
@@ -36,8 +36,8 @@ namespace boost { namespace program_options {
template<class charT>
class basic_parsed_options {
public:
- explicit basic_parsed_options(const options_description* xdescription)
- : description(xdescription) {}
+ explicit basic_parsed_options(const options_description* xdescription, int options_prefix = 0)
+ : description(xdescription), m_options_prefix(options_prefix) {}
/** Options found in the source. */
std::vector< basic_option<charT> > options;
/** Options description that was used for parsing.
@@ -46,6 +46,17 @@ namespace boost { namespace program_options {
up to the caller. Can be NULL.
*/
const options_description* description;
+
+ /** Mainly used for the diagnostic messages in exceptions.
+ * The canonical option prefix for the parser which generated these results,
+ * depending on the settings for basic_command_line_parser::style() or
+ * cmdline::style(). In order of precedence of command_line_style enums:
+ * allow_long
+ * allow_long_disguise
+ * allow_dash_for_short
+ * allow_slash_for_short
+ */
+ int m_options_prefix;
};
/** Specialization of basic_parsed_options which:
@@ -64,6 +75,17 @@ namespace boost { namespace program_options {
/** Stores UTF8 encoded options that were passed to constructor,
to avoid reverse conversion in some cases. */
basic_parsed_options<char> utf8_encoded_options;
+
+ /** Mainly used for the diagnostic messages in exceptions.
+ * The canonical option prefix for the parser which generated these results,
+ * depending on the settings for basic_command_line_parser::style() or
+ * cmdline::style(). In order of precedence of command_line_style enums:
+ * allow_long
+ * allow_long_disguise
+ * allow_dash_for_short
+ * allow_slash_for_short
+ */
+ int m_options_prefix;
};
typedef basic_parsed_options<char> parsed_options;
@@ -260,6 +282,10 @@ namespace boost { namespace program_options {
}}
+#if defined(BOOST_MSVC)
+# pragma warning (pop)
+#endif
+
#undef DECL
#include "boost/program_options/detail/parsers.hpp"
diff --git a/boost/program_options/value_semantic.hpp b/boost/program_options/value_semantic.hpp
index 033009e095..081e997bb3 100644
--- a/boost/program_options/value_semantic.hpp
+++ b/boost/program_options/value_semantic.hpp
@@ -227,6 +227,13 @@ namespace boost { namespace program_options {
return this;
}
+ /** Specifies the name used to to the value in help message. */
+ typed_value* value_name(const std::string& name)
+ {
+ m_value_name = name;
+ return this;
+ }
+
/** Specifies an implicit value, which will be used
if the option is given, but without an adjacent value.
Using this implies that an explicit value is optional, but if
@@ -261,13 +268,21 @@ namespace boost { namespace program_options {
return this;
}
- /** Specifies that the value can span multiple tokens. */
+ /** Specifies that the value can span multiple tokens.
+ */
typed_value* multitoken()
{
m_multitoken = true;
return this;
}
+ /** Specifies that no tokens may be provided as the value of
+ this option, which means that only presense of the option
+ is significant. For such option to be useful, either the
+ 'validate' function should be specialized, or the
+ 'implicit_value' method should be also used. In most
+ cases, you can use the 'bool_switch' function instead of
+ using this method. */
typed_value* zero_tokens()
{
m_zero_tokens = true;
@@ -346,6 +361,7 @@ namespace boost { namespace program_options {
// Default value is stored as boost::any and not
// as boost::optional to avoid unnecessary instantiations.
+ std::string m_value_name;
boost::any m_default_value;
std::string m_default_value_as_text;
boost::any m_implicit_value;
diff --git a/boost/program_options/variables_map.hpp b/boost/program_options/variables_map.hpp
index 9621e05245..be0a4b64e3 100644
--- a/boost/program_options/variables_map.hpp
+++ b/boost/program_options/variables_map.hpp
@@ -153,6 +153,9 @@ namespace boost { namespace program_options {
// Resolve conflict between inherited operators.
const variable_value& operator[](const std::string& name) const
{ return abstract_variables_map::operator[](name); }
+
+ // Override to clear some extra fields.
+ void clear();
void notify();
@@ -171,8 +174,10 @@ namespace boost { namespace program_options {
bool utf8);
/** Names of required options, filled by parser which has
- access to options_description. */
- std::set<std::string> m_required;
+ access to options_description.
+ The map values are the "canonical" names for each corresponding option.
+ This is useful in creating diagnostic messages when the option is absent. */
+ std::map<std::string, std::string> m_required;
};
@@ -208,4 +213,8 @@ namespace boost { namespace program_options {
}}
+#if defined(BOOST_MSVC)
+# pragma warning (pop)
+#endif
+
#endif
diff --git a/boost/property_map/dynamic_property_map.hpp b/boost/property_map/dynamic_property_map.hpp
index f1fde81fb5..f5f4230e22 100644
--- a/boost/property_map/dynamic_property_map.hpp
+++ b/boost/property_map/dynamic_property_map.hpp
@@ -117,6 +117,15 @@ struct dynamic_const_put_error : public dynamic_property_exception {
namespace detail {
+// Trying to work around VC++ problem that seems to relate to having too many
+// functions named "get"
+template <typename PMap, typename Key>
+typename boost::property_traits<PMap>::reference
+get_wrapper_xxx(const PMap& pmap, const Key& key) {
+ using boost::get;
+ return get(pmap, key);
+}
+
//
// dynamic_property_map_adaptor -
// property-map adaptor to support runtime polymorphism.
@@ -135,32 +144,18 @@ class dynamic_property_map_adaptor : public dynamic_property_map
// can be converted to value_type via iostreams.
void do_put(const any& in_key, const any& in_value, mpl::bool_<true>)
{
-#if !(defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ == 95))
using boost::put;
-#endif
key_type key = any_cast<key_type>(in_key);
if (in_value.type() == typeid(value_type)) {
-#if defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ == 95)
- boost::put(property_map, key, any_cast<value_type>(in_value));
-#else
- put(property_map, key, any_cast<value_type>(in_value));
-#endif
+ put(property_map_, key, any_cast<value_type>(in_value));
} else {
// if in_value is an empty string, put a default constructed value_type.
std::string v = any_cast<std::string>(in_value);
if (v.empty()) {
-#if defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ == 95)
- boost::put(property_map, key, value_type());
-#else
- put(property_map, key, value_type());
-#endif
+ put(property_map_, key, value_type());
} else {
-#if defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ == 95)
- boost::put(property_map, key, detail::read_value<value_type>(v));
-#else
- put(property_map, key, detail::read_value<value_type>(v));
-#endif
+ put(property_map_, key, detail::read_value<value_type>(v));
}
}
}
@@ -171,33 +166,19 @@ class dynamic_property_map_adaptor : public dynamic_property_map
}
public:
- explicit dynamic_property_map_adaptor(const PropertyMap& property_map)
- : property_map(property_map) { }
+ explicit dynamic_property_map_adaptor(const PropertyMap& property_map_)
+ : property_map_(property_map_) { }
virtual boost::any get(const any& key)
{
-#if defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ == 95)
- return boost::get(property_map, any_cast<key_type>(key));
-#else
- using boost::get;
-
- return get(property_map, any_cast<key_type>(key));
-#endif
+ return get_wrapper_xxx(property_map_, any_cast<typename boost::property_traits<PropertyMap>::key_type>(key));
}
virtual std::string get_string(const any& key)
{
-#if defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ == 95)
- std::ostringstream out;
- out << boost::get(property_map, any_cast<key_type>(key));
- return out.str();
-#else
- using boost::get;
-
std::ostringstream out;
- out << get(property_map, any_cast<key_type>(key));
+ out << get_wrapper_xxx(property_map_, any_cast<typename boost::property_traits<PropertyMap>::key_type>(key));
return out.str();
-#endif
}
virtual void put(const any& in_key, const any& in_value)
@@ -210,11 +191,11 @@ public:
virtual const std::type_info& key() const { return typeid(key_type); }
virtual const std::type_info& value() const { return typeid(value_type); }
- PropertyMap& base() { return property_map; }
- const PropertyMap& base() const { return property_map; }
+ PropertyMap& base() { return property_map_; }
+ const PropertyMap& base() const { return property_map_; }
private:
- PropertyMap property_map;
+ PropertyMap property_map_;
};
} // namespace detail
@@ -243,11 +224,11 @@ public:
template<typename PropertyMap>
dynamic_properties&
- property(const std::string& name, PropertyMap property_map)
+ property(const std::string& name, PropertyMap property_map_)
{
- // Tbd: exception safety
boost::shared_ptr<dynamic_property_map> pm(
- new detail::dynamic_property_map_adaptor<PropertyMap>(property_map));
+ boost::static_pointer_cast<dynamic_property_map>(
+ boost::make_shared<detail::dynamic_property_map_adaptor<PropertyMap> >(property_map_)));
property_maps.insert(property_maps_type::value_type(name, pm));
return *this;
diff --git a/boost/property_map/function_property_map.hpp b/boost/property_map/function_property_map.hpp
new file mode 100644
index 0000000000..c8c295f4c3
--- /dev/null
+++ b/boost/property_map/function_property_map.hpp
@@ -0,0 +1,66 @@
+//
+//=======================================================================
+// Author: Philipp Moeller
+//
+// Copyright 2012, Philipp Moeller
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//=======================================================================
+//
+
+#ifndef BOOST_PROPERTY_MAP_FUNCTION_PROPERTY_MAP_HPP
+#define BOOST_PROPERTY_MAP_FUNCTION_PROPERTY_MAP_HPP
+
+#include <boost/config.hpp>
+#include <boost/property_map/property_map.hpp>
+#include <boost/type_traits.hpp>
+#include <boost/utility/result_of.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/not.hpp>
+#include <utility>
+
+namespace boost {
+
+template<typename Func, typename Key, typename Ret = typename boost::result_of<const Func(const Key&)>::type>
+class function_property_map: public put_get_helper<Ret, function_property_map<Func, Key, Ret> > {
+ public:
+ typedef Key key_type;
+ typedef Ret reference;
+ typedef typename boost::remove_cv<typename boost::remove_reference<Ret>::type>::type value_type;
+
+ typedef typename boost::mpl::if_<
+ boost::mpl::and_<
+ boost::is_reference<Ret>,
+ boost::mpl::not_<boost::is_const<Ret> >
+ >,
+ boost::lvalue_property_map_tag,
+ boost::readable_property_map_tag>::type
+ category;
+
+ function_property_map(Func f = Func()) : f(f) {}
+
+ reference operator[](const Key& k) const {
+ return f(k);
+ }
+
+ private:
+ Func f;
+};
+
+template<typename Key, typename Func>
+function_property_map<Func, Key>
+make_function_property_map(const Func& f) {
+ return function_property_map<Func, Key>(f);
+}
+
+template<typename Key, typename Ret, typename Func>
+function_property_map<Func, Key, Ret>
+make_function_property_map(const Func& f) {
+ return function_property_map<Func, Key, Ret>(f);
+}
+
+} // boost
+
+#endif /* BOOST_PROPERTY_MAP_FUNCTION_PROPERTY_MAP_HPP */
diff --git a/boost/property_map/parallel/impl/distributed_property_map.ipp b/boost/property_map/parallel/impl/distributed_property_map.ipp
index fa95a5bd43..ef20817f0d 100644
--- a/boost/property_map/parallel/impl/distributed_property_map.ipp
+++ b/boost/property_map/parallel/impl/distributed_property_map.ipp
@@ -296,14 +296,10 @@ PBGL_DISTRIB_PMAP::set_consistency_model(int model)
{
data->model = model;
- int stages = 1;
bool need_on_synchronize = (model != cm_forward);
// Backward consistency is a two-stage process.
if (model & cm_backward) {
- if (model & cm_flush) stages = 3;
- else stages = 2;
-
// For backward consistency to work, we absolutely cannot throw
// away any ghost cells.
data->max_ghost_cells = 0;
diff --git a/boost/property_map/transform_value_property_map.hpp b/boost/property_map/transform_value_property_map.hpp
new file mode 100644
index 0000000000..6a7b574a2d
--- /dev/null
+++ b/boost/property_map/transform_value_property_map.hpp
@@ -0,0 +1,67 @@
+//
+//=======================================================================
+// Author: Philipp Moeller
+//
+// Copyright 2012, Philipp Moeller
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//=======================================================================
+//
+
+#ifndef BOOST_PROPERTY_MAP_TRANSFORM_VALUE_PROPERTY_MAP_HPP
+#define BOOST_PROPERTY_MAP_TRANSFORM_VALUE_PROPERTY_MAP_HPP
+
+#include <boost/config.hpp>
+#include <boost/property_map/property_map.hpp>
+#include <boost/type_traits.hpp>
+#include <boost/utility/result_of.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/not.hpp>
+#include <utility>
+
+namespace boost {
+
+template<typename Func, typename PM, typename Ret = typename boost::result_of<const Func(typename property_traits<PM>::reference)>::type>
+class transform_value_property_map: public put_get_helper<Ret, transform_value_property_map<Func, PM, Ret> > {
+ public:
+ typedef typename property_traits<PM>::key_type key_type;
+ typedef Ret reference;
+ typedef typename boost::remove_cv<typename boost::remove_reference<Ret>::type>::type value_type;
+
+ typedef typename boost::mpl::if_<
+ boost::mpl::and_<
+ boost::is_reference<Ret>,
+ boost::mpl::not_<boost::is_const<Ret> >
+ >,
+ boost::lvalue_property_map_tag,
+ boost::readable_property_map_tag>::type
+ category;
+
+ transform_value_property_map(Func f, PM pm) : f(f), pm(pm) {}
+
+ reference operator[](const key_type& k) const {
+ return f(get(pm, k));
+ }
+
+ private:
+ Func f;
+ PM pm;
+};
+
+template<typename PM, typename Func>
+transform_value_property_map<Func, PM>
+make_transform_value_property_map(const Func& f, const PM& pm) {
+ return transform_value_property_map<Func, PM>(f, pm);
+}
+
+template<typename Ret, typename PM, typename Func>
+transform_value_property_map<Func, PM, Ret>
+make_transform_value_property_map(const Func& f, const PM& pm) {
+ return transform_value_property_map<Func, PM, Ret>(f, pm);
+}
+
+} // boost
+
+#endif /* BOOST_PROPERTY_MAP_TRANSFORM_VALUE_PROPERTY_MAP_HPP */
diff --git a/boost/property_tree/detail/json_parser_read.hpp b/boost/property_tree/detail/json_parser_read.hpp
index 3849450975..9638ac9748 100644
--- a/boost/property_tree/detail/json_parser_read.hpp
+++ b/boost/property_tree/detail/json_parser_read.hpp
@@ -102,7 +102,8 @@ namespace boost { namespace property_tree { namespace json_parser
void operator()(It b, It e) const
{
BOOST_ASSERT(c.stack.size() >= 1);
- c.stack.back()->push_back(std::make_pair(c.name, Str(b, e)));
+ c.stack.back()->push_back(std::make_pair(c.name,
+ Ptree(Str(b, e))));
c.name.clear();
c.string.clear();
}
diff --git a/boost/property_tree/detail/ptree_implementation.hpp b/boost/property_tree/detail/ptree_implementation.hpp
index e1839ffb6d..31d60e3ee2 100644
--- a/boost/property_tree/detail/ptree_implementation.hpp
+++ b/boost/property_tree/detail/ptree_implementation.hpp
@@ -389,7 +389,7 @@ namespace boost { namespace property_tree
template <typename P>
bool operator ()(const P& lhs, const P& rhs) const {
return lhs.first < rhs.first;
- };
+ }
};
}
diff --git a/boost/proto/context/default.hpp b/boost/proto/context/default.hpp
index 5dd7e4e651..6aeb596289 100644
--- a/boost/proto/context/default.hpp
+++ b/boost/proto/context/default.hpp
@@ -366,7 +366,7 @@ namespace boost { namespace proto
BOOST_PROTO_USE_GET_POINTER();
typedef typename detail::classtypeof<function_type>::type class_type;
return (
- BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, expr)) ->*
+ BOOST_PROTO_GET_POINTER(class_type, (BOOST_PROTO_DEFAULT_EVAL(~, 1, expr))) ->*
BOOST_PROTO_DEFAULT_EVAL(~, 0, expr)
)();
}
@@ -376,7 +376,7 @@ namespace boost { namespace proto
BOOST_PROTO_USE_GET_POINTER();
typedef typename detail::classtypeof<function_type>::type class_type;
return (
- BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, expr)) ->*
+ BOOST_PROTO_GET_POINTER(class_type, (BOOST_PROTO_DEFAULT_EVAL(~, 1, expr))) ->*
BOOST_PROTO_DEFAULT_EVAL(~, 0, expr)
);
}
diff --git a/boost/proto/context/detail/default_eval.hpp b/boost/proto/context/detail/default_eval.hpp
index b875c9f62c..4114f92943 100644
--- a/boost/proto/context/detail/default_eval.hpp
+++ b/boost/proto/context/detail/default_eval.hpp
@@ -71,7 +71,7 @@
BOOST_PROTO_USE_GET_POINTER();
typedef typename detail::classtypeof<function_type>::type class_type;
return (
- BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, expr)) ->*
+ BOOST_PROTO_GET_POINTER(class_type, (BOOST_PROTO_DEFAULT_EVAL(~, 1, expr))) ->*
BOOST_PROTO_DEFAULT_EVAL(~, 0, expr)
)(BOOST_PP_ENUM(BOOST_PP_SUB(N, 2), BOOST_PROTO_DEFAULT_EVAL_SHIFTED, expr));
}
diff --git a/boost/proto/context/detail/preprocessed/default_eval.hpp b/boost/proto/context/detail/preprocessed/default_eval.hpp
index 8b7d249924..4efde73d5d 100644
--- a/boost/proto/context/detail/preprocessed/default_eval.hpp
+++ b/boost/proto/context/detail/preprocessed/default_eval.hpp
@@ -34,7 +34,7 @@
BOOST_PROTO_USE_GET_POINTER();
typedef typename detail::classtypeof<function_type>::type class_type;
return (
- BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, expr)) ->*
+ BOOST_PROTO_GET_POINTER(class_type, (proto::eval(proto::child_c< 1>( expr), context))) ->*
proto::eval(proto::child_c< 0>( expr), context)
)(proto::eval(proto::child_c< 2>( expr), context));
}
@@ -68,7 +68,7 @@
BOOST_PROTO_USE_GET_POINTER();
typedef typename detail::classtypeof<function_type>::type class_type;
return (
- BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, expr)) ->*
+ BOOST_PROTO_GET_POINTER(class_type, (proto::eval(proto::child_c< 1>( expr), context))) ->*
proto::eval(proto::child_c< 0>( expr), context)
)(proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context));
}
@@ -102,7 +102,7 @@
BOOST_PROTO_USE_GET_POINTER();
typedef typename detail::classtypeof<function_type>::type class_type;
return (
- BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, expr)) ->*
+ BOOST_PROTO_GET_POINTER(class_type, (proto::eval(proto::child_c< 1>( expr), context))) ->*
proto::eval(proto::child_c< 0>( expr), context)
)(proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context) , proto::eval(proto::child_c< 4>( expr), context));
}
@@ -136,7 +136,7 @@
BOOST_PROTO_USE_GET_POINTER();
typedef typename detail::classtypeof<function_type>::type class_type;
return (
- BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, expr)) ->*
+ BOOST_PROTO_GET_POINTER(class_type, (proto::eval(proto::child_c< 1>( expr), context))) ->*
proto::eval(proto::child_c< 0>( expr), context)
)(proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context) , proto::eval(proto::child_c< 4>( expr), context) , proto::eval(proto::child_c< 5>( expr), context));
}
@@ -170,7 +170,7 @@
BOOST_PROTO_USE_GET_POINTER();
typedef typename detail::classtypeof<function_type>::type class_type;
return (
- BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, expr)) ->*
+ BOOST_PROTO_GET_POINTER(class_type, (proto::eval(proto::child_c< 1>( expr), context))) ->*
proto::eval(proto::child_c< 0>( expr), context)
)(proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context) , proto::eval(proto::child_c< 4>( expr), context) , proto::eval(proto::child_c< 5>( expr), context) , proto::eval(proto::child_c< 6>( expr), context));
}
@@ -204,7 +204,7 @@
BOOST_PROTO_USE_GET_POINTER();
typedef typename detail::classtypeof<function_type>::type class_type;
return (
- BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, expr)) ->*
+ BOOST_PROTO_GET_POINTER(class_type, (proto::eval(proto::child_c< 1>( expr), context))) ->*
proto::eval(proto::child_c< 0>( expr), context)
)(proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context) , proto::eval(proto::child_c< 4>( expr), context) , proto::eval(proto::child_c< 5>( expr), context) , proto::eval(proto::child_c< 6>( expr), context) , proto::eval(proto::child_c< 7>( expr), context));
}
@@ -238,7 +238,7 @@
BOOST_PROTO_USE_GET_POINTER();
typedef typename detail::classtypeof<function_type>::type class_type;
return (
- BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, expr)) ->*
+ BOOST_PROTO_GET_POINTER(class_type, (proto::eval(proto::child_c< 1>( expr), context))) ->*
proto::eval(proto::child_c< 0>( expr), context)
)(proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context) , proto::eval(proto::child_c< 4>( expr), context) , proto::eval(proto::child_c< 5>( expr), context) , proto::eval(proto::child_c< 6>( expr), context) , proto::eval(proto::child_c< 7>( expr), context) , proto::eval(proto::child_c< 8>( expr), context));
}
@@ -272,7 +272,7 @@
BOOST_PROTO_USE_GET_POINTER();
typedef typename detail::classtypeof<function_type>::type class_type;
return (
- BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, expr)) ->*
+ BOOST_PROTO_GET_POINTER(class_type, (proto::eval(proto::child_c< 1>( expr), context))) ->*
proto::eval(proto::child_c< 0>( expr), context)
)(proto::eval(proto::child_c< 2>( expr), context) , proto::eval(proto::child_c< 3>( expr), context) , proto::eval(proto::child_c< 4>( expr), context) , proto::eval(proto::child_c< 5>( expr), context) , proto::eval(proto::child_c< 6>( expr), context) , proto::eval(proto::child_c< 7>( expr), context) , proto::eval(proto::child_c< 8>( expr), context) , proto::eval(proto::child_c< 9>( expr), context));
}
diff --git a/boost/proto/debug.hpp b/boost/proto/debug.hpp
index 02b2c7b49a..f732bc2a99 100644
--- a/boost/proto/debug.hpp
+++ b/boost/proto/debug.hpp
@@ -91,6 +91,9 @@ namespace boost { namespace proto
{}
std::ostream &sout_;
+
+ private:
+ ostream_wrapper &operator =(ostream_wrapper const &);
};
struct named_any
diff --git a/boost/proto/detail/as_expr.hpp b/boost/proto/detail/as_expr.hpp
index 83769f20ba..fb46576b89 100644
--- a/boost/proto/detail/as_expr.hpp
+++ b/boost/proto/detail/as_expr.hpp
@@ -17,6 +17,11 @@
#include <boost/proto/proto_fwd.hpp>
#include <boost/proto/args.hpp>
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(push)
+# pragma warning(disable : 4714) // function 'xxx' marked as __forceinline not inlined
+#endif
+
namespace boost { namespace proto { namespace detail
{
@@ -175,4 +180,8 @@ namespace boost { namespace proto { namespace detail
}}}
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(pop)
+#endif
+
#endif
diff --git a/boost/proto/detail/as_lvalue.hpp b/boost/proto/detail/as_lvalue.hpp
index 4ef375c407..8ff9091b28 100644
--- a/boost/proto/detail/as_lvalue.hpp
+++ b/boost/proto/detail/as_lvalue.hpp
@@ -11,6 +11,11 @@
#include <boost/proto/proto_fwd.hpp>
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(push)
+# pragma warning(disable : 4714) // function 'xxx' marked as __forceinline not inlined
+#endif
+
namespace boost { namespace proto
{
namespace detail
@@ -31,4 +36,8 @@ namespace boost { namespace proto
}
}}
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(pop)
+#endif
+
#endif
diff --git a/boost/proto/detail/decltype.hpp b/boost/proto/detail/decltype.hpp
index 6b7416b1b1..92679ab274 100644
--- a/boost/proto/detail/decltype.hpp
+++ b/boost/proto/detail/decltype.hpp
@@ -34,6 +34,11 @@
#include <boost/utility/result_of.hpp>
#include <boost/utility/enable_if.hpp>
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(push)
+# pragma warning(disable : 4714) // function 'xxx' marked as __forceinline not inlined
+#endif
+
#ifndef BOOST_NO_DECLTYPE
# define BOOST_PROTO_DECLTYPE_(EXPR, TYPE) typedef decltype(EXPR) TYPE;
#else
@@ -498,4 +503,8 @@ namespace boost { namespace proto
} // namespace detail
}}
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(pop)
+#endif
+
#endif
diff --git a/boost/proto/detail/deduce_domain.hpp b/boost/proto/detail/deduce_domain.hpp
index 5b56ee2bf3..630304f842 100644
--- a/boost/proto/detail/deduce_domain.hpp
+++ b/boost/proto/detail/deduce_domain.hpp
@@ -19,6 +19,7 @@
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/facilities/intercept.hpp>
#include <boost/preprocessor/iteration/local.hpp>
+#include <boost/preprocessor/iteration/iterate.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
diff --git a/boost/proto/detail/dont_care.hpp b/boost/proto/detail/dont_care.hpp
index 44f9371f91..262340e2b4 100644
--- a/boost/proto/detail/dont_care.hpp
+++ b/boost/proto/detail/dont_care.hpp
@@ -11,6 +11,11 @@
#include <boost/config.hpp>
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(push)
+# pragma warning(disable : 4714) // function 'xxx' marked as __forceinline not inlined
+#endif
+
namespace boost { namespace proto
{
namespace detail
@@ -22,4 +27,8 @@ namespace boost { namespace proto
}
}}
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(pop)
+#endif
+
#endif
diff --git a/boost/proto/detail/ignore_unused.hpp b/boost/proto/detail/ignore_unused.hpp
index dda1ca0fe2..6004b83d98 100644
--- a/boost/proto/detail/ignore_unused.hpp
+++ b/boost/proto/detail/ignore_unused.hpp
@@ -12,6 +12,11 @@
#include <boost/config.hpp>
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(push)
+# pragma warning(disable : 4714) // function 'xxx' marked as __forceinline not inlined
+#endif
+
namespace boost { namespace proto
{
namespace detail
@@ -22,4 +27,8 @@ namespace boost { namespace proto
}
}}
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(pop)
+#endif
+
#endif
diff --git a/boost/proto/domain.hpp b/boost/proto/domain.hpp
index 471152a068..44bc45d36b 100644
--- a/boost/proto/domain.hpp
+++ b/boost/proto/domain.hpp
@@ -18,6 +18,11 @@
#include <boost/proto/detail/as_expr.hpp>
#include <boost/proto/detail/deduce_domain.hpp>
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(push)
+# pragma warning(disable : 4714) // function 'xxx' marked as __forceinline not inlined
+#endif
+
namespace boost { namespace proto
{
@@ -325,4 +330,8 @@ namespace boost { namespace proto
}}
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(pop)
+#endif
+
#endif
diff --git a/boost/proto/expr.hpp b/boost/proto/expr.hpp
index 410b7ebea1..cb8a28f6e9 100644
--- a/boost/proto/expr.hpp
+++ b/boost/proto/expr.hpp
@@ -31,6 +31,7 @@
# pragma warning(disable : 4510) // default constructor could not be generated
# pragma warning(disable : 4512) // assignment operator could not be generated
# pragma warning(disable : 4610) // user defined constructor required
+# pragma warning(disable : 4714) // function 'xxx' marked as __forceinline not inlined
#endif
namespace boost { namespace proto
diff --git a/boost/proto/extends.hpp b/boost/proto/extends.hpp
index 7d5678a80d..3a8151964c 100644
--- a/boost/proto/extends.hpp
+++ b/boost/proto/extends.hpp
@@ -34,10 +34,9 @@
#include <boost/proto/generate.hpp>
#include <boost/proto/detail/remove_typename.hpp>
-#ifdef _MSC_VER
-#define BOOST_PROTO_DISABLE_MSVC_C4522 __pragma(warning(disable: 4522))
-#else
-#define BOOST_PROTO_DISABLE_MSVC_C4522
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(push)
+# pragma warning(disable : 4714) // function 'xxx' marked as __forceinline not inlined
#endif
namespace boost { namespace proto
@@ -75,7 +74,7 @@ namespace boost { namespace proto
///
#define BOOST_PROTO_DEFINE_FUN_OP_IMPL_(Z, N, DATA, Const) \
BOOST_PP_IF(N, BOOST_PROTO_TEMPLATE_YES_, BOOST_PROTO_TEMPLATE_NO_)(Z, N) \
- BOOST_FORCEINLINE \
+ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \
typename BOOST_PROTO_RESULT_OF< \
proto_generator( \
typename boost::proto::result_of::BOOST_PP_CAT(funop, N)< \
@@ -105,7 +104,7 @@ namespace boost { namespace proto
///
#define BOOST_PROTO_DEFINE_FUN_OP_VARIADIC_IMPL_(Const) \
template<typename... A> \
- BOOST_FORCEINLINE \
+ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \
typename BOOST_PROTO_RESULT_OF< \
proto_generator( \
typename boost::proto::result_of::funop< \
@@ -176,26 +175,26 @@ namespace boost { namespace proto
typedef boost::proto::tag::proto_expr fusion_tag; \
BOOST_PP_REPEAT(BOOST_PROTO_MAX_ARITY, BOOST_PROTO_EXTENDS_CHILD, ~) \
\
- BOOST_FORCEINLINE \
+ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \
static proto_derived_expr const make(Expr const &e) \
{ \
proto_derived_expr that = {e}; \
return that; \
} \
\
- BOOST_FORCEINLINE \
+ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \
proto_base_expr &proto_base() \
{ \
return this->proto_expr_.proto_base(); \
} \
\
- BOOST_FORCEINLINE \
+ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \
proto_base_expr const &proto_base() const \
{ \
return this->proto_expr_.proto_base(); \
} \
\
- BOOST_FORCEINLINE \
+ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \
operator proto_address_of_hack_type_() const \
{ \
return boost::addressof(this->proto_base().child0); \
@@ -209,7 +208,7 @@ namespace boost { namespace proto
#define BOOST_PROTO_EXTENDS_COPY_ASSIGN_IMPL_(This, Const, Typename) \
BOOST_PROTO_DISABLE_MSVC_C4522 \
- BOOST_FORCEINLINE \
+ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \
Typename() BOOST_PROTO_RESULT_OF< \
Typename() This::proto_generator( \
Typename() boost::proto::base_expr< \
@@ -259,7 +258,7 @@ namespace boost { namespace proto
///
#define BOOST_PROTO_EXTENDS_ASSIGN_IMPL_(ThisConst, ThatConst) \
template<typename A> \
- BOOST_FORCEINLINE \
+ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \
typename BOOST_PROTO_RESULT_OF< \
proto_generator( \
typename boost::proto::base_expr< \
@@ -326,7 +325,7 @@ namespace boost { namespace proto
///
#define BOOST_PROTO_EXTENDS_SUBSCRIPT_IMPL_(ThisConst, ThatConst) \
template<typename A> \
- BOOST_FORCEINLINE \
+ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \
typename BOOST_PROTO_RESULT_OF< \
proto_generator( \
typename boost::proto::base_expr< \
@@ -641,4 +640,8 @@ namespace boost { namespace proto
}}
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(pop)
+#endif
+
#endif
diff --git a/boost/proto/fusion.hpp b/boost/proto/fusion.hpp
index c35a0741a6..198a34503d 100644
--- a/boost/proto/fusion.hpp
+++ b/boost/proto/fusion.hpp
@@ -44,12 +44,11 @@ namespace boost { namespace proto
: fusion::iterator_base<expr_iterator<Expr, Pos> >
{
typedef Expr expr_type;
- typedef typename Expr::proto_tag proto_tag;
static const long index = Pos;
typedef fusion::random_access_traversal_tag category;
typedef tag::proto_expr_iterator fusion_tag;
- expr_iterator(Expr &e)
+ explicit expr_iterator(Expr &e)
: expr(e)
{}
@@ -60,7 +59,6 @@ namespace boost { namespace proto
struct flat_view
{
typedef Expr expr_type;
- typedef typename Expr::proto_tag proto_tag;
typedef fusion::forward_traversal_tag category;
typedef tag::proto_flat_view fusion_tag;
@@ -373,7 +371,7 @@ namespace boost { namespace fusion
struct apply
{
typedef
- typename proto::detail::expr_iterator<
+ proto::detail::expr_iterator<
typename Iterator::expr_type
, Iterator::index + N::value
>
@@ -583,12 +581,14 @@ namespace boost { namespace fusion
template<typename Sequence>
struct apply
{
- typedef typename Sequence::proto_tag proto_tag;
+ typedef typename Sequence::expr_type::proto_tag proto_tag;
- typedef fusion::transform_view<
- typename Sequence::expr_type
- , proto::detail::as_element<proto_tag>
- > type;
+ typedef
+ fusion::transform_view<
+ typename Sequence::expr_type
+ , proto::detail::as_element<proto_tag>
+ >
+ type;
static type call(Sequence &sequence)
{
@@ -639,7 +639,6 @@ namespace boost { namespace fusion
: mpl::false_
{};
}
-
}}
namespace boost { namespace mpl
@@ -655,7 +654,7 @@ namespace boost { namespace mpl
{
typedef fusion::fusion_sequence_tag type;
};
-}}
+}}
#ifdef BOOST_MSVC
#pragma warning(pop)
diff --git a/boost/proto/generate.hpp b/boost/proto/generate.hpp
index 87f3adfb50..f6eab4d966 100644
--- a/boost/proto/generate.hpp
+++ b/boost/proto/generate.hpp
@@ -24,6 +24,11 @@
#include <boost/proto/proto_fwd.hpp>
#include <boost/proto/args.hpp>
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(push)
+# pragma warning(disable : 4714) // function 'xxx' marked as __forceinline not inlined
+#endif
+
namespace boost { namespace proto
{
@@ -440,4 +445,8 @@ namespace boost
#endif
}
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(pop)
+#endif
+
#endif // BOOST_PROTO_GENERATE_HPP_EAN_02_13_2007
diff --git a/boost/proto/make_expr.hpp b/boost/proto/make_expr.hpp
index 9080a4f4a6..08ef2f5ce1 100644
--- a/boost/proto/make_expr.hpp
+++ b/boost/proto/make_expr.hpp
@@ -45,9 +45,10 @@
#include <boost/proto/detail/poly_function.hpp>
#include <boost/proto/detail/deprecated.hpp>
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma warning(push)
-# pragma warning(disable: 4180) // qualifier applied to function type has no meaning; ignored
+# pragma warning(disable : 4180) // qualifier applied to function type has no meaning; ignored
+# pragma warning(disable : 4714) // function 'xxx' marked as __forceinline not inlined
#endif
namespace boost { namespace proto
@@ -501,7 +502,7 @@ namespace boost { namespace proto
}}
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma warning(pop)
#endif
diff --git a/boost/proto/matches.hpp b/boost/proto/matches.hpp
index 65815f3731..5136a5cc7b 100644
--- a/boost/proto/matches.hpp
+++ b/boost/proto/matches.hpp
@@ -351,18 +351,22 @@ namespace boost { namespace proto
template<typename Expr, typename Tag, typename Args, long Arity, typename If, typename Then, typename Else>
struct matches_<Expr, proto::basic_expr<Tag, Args, Arity>, proto::if_<If, Then, Else> >
: mpl::eval_if_c<
- remove_reference<
- typename when<_, If>::template impl<Expr, int, int>::result_type
- >::type::value
+ static_cast<bool>(
+ remove_reference<
+ typename when<_, If>::template impl<Expr, int, int>::result_type
+ >::type::value
+ )
, matches_<Expr, proto::basic_expr<Tag, Args, Arity>, typename Then::proto_grammar>
, matches_<Expr, proto::basic_expr<Tag, Args, Arity>, typename Else::proto_grammar>
>::type
{
typedef
typename mpl::if_c<
- remove_reference<
- typename when<_, If>::template impl<Expr, int, int>::result_type
- >::type::value
+ static_cast<bool>(
+ remove_reference<
+ typename when<_, If>::template impl<Expr, int, int>::result_type
+ >::type::value
+ )
, Then
, Else
>::type
@@ -700,7 +704,7 @@ namespace boost { namespace proto
typedef
typename mpl::if_c<
- remove_reference<condition>::type::value
+ static_cast<bool>(remove_reference<condition>::type::value)
, when<_, Then>
, when<_, Else>
>::type
diff --git a/boost/proto/operators.hpp b/boost/proto/operators.hpp
index 540e85f637..1f2bad8c2b 100644
--- a/boost/proto/operators.hpp
+++ b/boost/proto/operators.hpp
@@ -21,6 +21,11 @@
#include <boost/proto/generate.hpp>
#include <boost/proto/make_expr.hpp>
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(push)
+# pragma warning(disable : 4714) // function 'xxx' marked as __forceinline not inlined
+#endif
+
namespace boost { namespace proto
{
namespace detail
@@ -100,7 +105,7 @@ namespace boost { namespace proto
#define BOOST_PROTO_DEFINE_UNARY_OPERATOR(OP, TAG, TRAIT, DOMAIN, POST) \
template<typename Arg> \
- BOOST_FORCEINLINE \
+ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \
typename boost::proto::detail::enable_unary< \
DOMAIN \
, DOMAIN::proto_grammar \
@@ -114,7 +119,7 @@ namespace boost { namespace proto
} \
\
template<typename Arg> \
- BOOST_FORCEINLINE \
+ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \
typename boost::proto::detail::enable_unary< \
DOMAIN \
, DOMAIN::proto_grammar \
@@ -130,7 +135,7 @@ namespace boost { namespace proto
#define BOOST_PROTO_DEFINE_BINARY_OPERATOR(OP, TAG, TRAIT, DOMAIN) \
template<typename Left, typename Right> \
- BOOST_FORCEINLINE \
+ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \
typename boost::proto::detail::enable_binary< \
DOMAIN \
, DOMAIN::proto_grammar \
@@ -145,7 +150,7 @@ namespace boost { namespace proto
} \
\
template<typename Left, typename Right> \
- BOOST_FORCEINLINE \
+ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \
typename boost::proto::detail::enable_binary< \
DOMAIN \
, DOMAIN::proto_grammar \
@@ -160,7 +165,7 @@ namespace boost { namespace proto
} \
\
template<typename Left, typename Right> \
- BOOST_FORCEINLINE \
+ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \
typename boost::proto::detail::enable_binary< \
DOMAIN \
, DOMAIN::proto_grammar \
@@ -175,7 +180,7 @@ namespace boost { namespace proto
} \
\
template<typename Left, typename Right> \
- BOOST_FORCEINLINE \
+ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \
typename boost::proto::detail::enable_binary< \
DOMAIN \
, DOMAIN::proto_grammar \
@@ -194,7 +199,7 @@ namespace boost { namespace proto
#define BOOST_PROTO_DEFINE_UNARY_OPERATOR(OP, TAG, TRAIT, DOMAIN, POST) \
template<typename Arg> \
- BOOST_FORCEINLINE \
+ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \
typename boost::proto::detail::enable_unary< \
DOMAIN \
, DOMAIN::proto_grammar \
@@ -210,7 +215,7 @@ namespace boost { namespace proto
#define BOOST_PROTO_DEFINE_BINARY_OPERATOR(OP, TAG, TRAIT, DOMAIN) \
template<typename Left, typename Right> \
- BOOST_FORCEINLINE \
+ BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \
typename boost::proto::detail::enable_binary< \
DOMAIN \
, DOMAIN::proto_grammar \
@@ -366,4 +371,8 @@ namespace boost { namespace proto
}}
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(pop)
+#endif
+
#endif
diff --git a/boost/proto/proto_fwd.hpp b/boost/proto/proto_fwd.hpp
index 841cd752bb..6fb25bfcf5 100644
--- a/boost/proto/proto_fwd.hpp
+++ b/boost/proto/proto_fwd.hpp
@@ -92,6 +92,22 @@
# endif
#endif
+#ifndef BOOST_NO_DECLTYPE_N3276
+# // Proto can only use the decltype-based result_of if N3276 has been
+# // implemented by the compiler.
+# // See http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2011/n3276.pdf
+# ifndef BOOST_PROTO_USE_NORMAL_RESULT_OF
+# define BOOST_PROTO_USE_NORMAL_RESULT_OF
+# endif
+# // If we're using the decltype-based result_of, we need to be a bit
+# // stricter about the return types of some functions.
+# ifndef BOOST_PROTO_STRICT_RESULT_OF
+# define BOOST_PROTO_STRICT_RESULT_OF
+# endif
+#endif
+
+// Unless compiler support is there, use tr1_result_of instead of
+// result_of to avoid the problems addressed by N3276.
#ifdef BOOST_PROTO_USE_NORMAL_RESULT_OF
# define BOOST_PROTO_RESULT_OF boost::result_of
#else
@@ -102,6 +118,14 @@
# define BOOST_PROTO_EXTENDED_TEMPLATE_PARAMETERS_MATCHING
#endif
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# define BOOST_PROTO_DISABLE_MSVC_C4522 __pragma(warning(disable : 4522)) // 'class' : multiple assignment operators specified
+# define BOOST_PROTO_DISABLE_MSVC_C4714 __pragma(warning(disable : 4714)) // function 'xxx' marked as __forceinline not inlined
+#else
+# define BOOST_PROTO_DISABLE_MSVC_C4522
+# define BOOST_PROTO_DISABLE_MSVC_C4714
+#endif
+
namespace boost { namespace proto
{
namespace detail
@@ -380,6 +404,8 @@ namespace boost { namespace proto
template<typename Grammar>
struct vararg;
+ struct pack;
+
// Boost bug https://svn.boost.org/trac/boost/ticket/4602
//int const N = INT_MAX;
int const N = (INT_MAX >> 10);
diff --git a/boost/proto/traits.hpp b/boost/proto/traits.hpp
index 59b06ea43e..05263b14d0 100644
--- a/boost/proto/traits.hpp
+++ b/boost/proto/traits.hpp
@@ -32,9 +32,12 @@
#include <boost/proto/domain.hpp>
#include <boost/proto/transform/pass_through.hpp>
-#if BOOST_WORKAROUND( BOOST_MSVC, >= 1400 )
- #pragma warning(push)
- #pragma warning(disable: 4180) // warning C4180: qualifier applied to function type has no meaning; ignored
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(push)
+# if BOOST_WORKAROUND( BOOST_MSVC, >= 1400 )
+# pragma warning(disable: 4180) // warning C4180: qualifier applied to function type has no meaning; ignored
+# endif
+# pragma warning(disable : 4714) // function 'xxx' marked as __forceinline not inlined
#endif
namespace boost { namespace proto
@@ -1256,8 +1259,8 @@ namespace boost { namespace proto
}}
-#if BOOST_WORKAROUND( BOOST_MSVC, >= 1400 )
- #pragma warning(pop)
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(pop)
#endif
#endif
diff --git a/boost/proto/transform/call.hpp b/boost/proto/transform/call.hpp
index ecee355112..7d87c906d6 100644
--- a/boost/proto/transform/call.hpp
+++ b/boost/proto/transform/call.hpp
@@ -9,6 +9,11 @@
#ifndef BOOST_PROTO_TRANSFORM_CALL_HPP_EAN_11_02_2007
#define BOOST_PROTO_TRANSFORM_CALL_HPP_EAN_11_02_2007
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(push)
+# pragma warning(disable: 4714) // function 'xxx' marked as __forceinline not inlined
+#endif
+
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/facilities/intercept.hpp>
#include <boost/preprocessor/iteration/iterate.hpp>
@@ -24,6 +29,7 @@
#include <boost/proto/transform/impl.hpp>
#include <boost/proto/detail/as_lvalue.hpp>
#include <boost/proto/detail/poly_function.hpp>
+#include <boost/proto/transform/detail/pack.hpp>
namespace boost { namespace proto
{
@@ -79,6 +85,29 @@ namespace boost { namespace proto
: PrimitiveTransform
{};
+ /// \brief A specialization that treats function pointer Transforms as
+ /// if they were function type Transforms.
+ ///
+ /// This specialization requires that \c Fun is actually a function type.
+ ///
+ /// This specialization is required for nested transforms such as
+ /// <tt>call\<T0(T1(_))\></tt>. In C++, functions that are used as
+ /// parameters to other functions automatically decay to funtion
+ /// pointer types. In other words, the type <tt>T0(T1(_))</tt> is
+ /// indistinguishable from <tt>T0(T1(*)(_))</tt>. This specialization
+ /// is required to handle these nested function pointer type transforms
+ /// properly.
+ template<typename Fun>
+ struct call<Fun *>
+ : call<Fun>
+ {};
+
+ /// INTERNAL ONLY
+ template<typename Fun>
+ struct call<detail::msvc_fun_workaround<Fun> >
+ : call<Fun>
+ {};
+
/// \brief Either call the PolymorphicFunctionObject with 0
/// arguments, or invoke the PrimitiveTransform with 3
/// arguments.
@@ -365,4 +394,8 @@ namespace boost { namespace proto
}} // namespace boost::proto
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(pop)
+#endif
+
#endif
diff --git a/boost/proto/transform/default.hpp b/boost/proto/transform/default.hpp
index 706689d059..26a4682415 100644
--- a/boost/proto/transform/default.hpp
+++ b/boost/proto/transform/default.hpp
@@ -545,7 +545,7 @@ namespace boost { namespace proto
BOOST_PROTO_USE_GET_POINTER();
typedef typename detail::classtypeof<function_type>::type class_type;
return (
- BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, e)) ->*
+ BOOST_PROTO_GET_POINTER(class_type, (BOOST_PROTO_DEFAULT_EVAL(~, 1, e))) ->*
BOOST_PROTO_DEFAULT_EVAL(~, 0, e)
)();
}
@@ -561,7 +561,7 @@ namespace boost { namespace proto
BOOST_PROTO_USE_GET_POINTER();
typedef typename detail::classtypeof<function_type>::type class_type;
return (
- BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, e)) ->*
+ BOOST_PROTO_GET_POINTER(class_type, (BOOST_PROTO_DEFAULT_EVAL(~, 1, e))) ->*
BOOST_PROTO_DEFAULT_EVAL(~, 0, e)
);
}
diff --git a/boost/proto/transform/detail/call.hpp b/boost/proto/transform/detail/call.hpp
index d0ebca1db9..629f4de95e 100644
--- a/boost/proto/transform/detail/call.hpp
+++ b/boost/proto/transform/detail/call.hpp
@@ -31,11 +31,9 @@
#pragma wave option(preserve: 1)
#endif
- #if BOOST_PROTO_MAX_ARITY > 3
#define BOOST_PP_ITERATION_PARAMS_1 \
- (3, (4, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/detail/call.hpp>))
+ (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/detail/call.hpp>))
#include BOOST_PP_ITERATE()
- #endif
#if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
#pragma wave option(output: null)
@@ -48,6 +46,7 @@
#define N BOOST_PP_ITERATION()
+ #if N > 3
/// \brief Call the PolymorphicFunctionObject \c Fun with the
/// current expression, state and data, transformed according
/// to \c A0 through \c AN.
@@ -81,6 +80,30 @@
}
};
};
+ #endif
+
+ #if N > 0
+ /// \brief Call the PolymorphicFunctionObject \c Fun with the
+ /// current expression, state and data, transformed according
+ /// to \c A0 through \c AN.
+ template<typename Fun BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct call<Fun(BOOST_PP_ENUM_PARAMS(N, A)...)> : transform<call<Fun(BOOST_PP_ENUM_PARAMS(N, A)...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : call<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value // BUGBUG this isn't right. Could be pack(_child), should use arity of child!
+ , BOOST_PP_CAT(A, BOOST_PP_DEC(N))
+ , detail::BOOST_PP_CAT(expand_pattern_rest_, BOOST_PP_DEC(N))<
+ Fun
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_DEC(N), A)
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
+ #endif
#undef N
diff --git a/boost/proto/transform/detail/default_function_impl.hpp b/boost/proto/transform/detail/default_function_impl.hpp
index dc339aff29..e46d8368db 100644
--- a/boost/proto/transform/detail/default_function_impl.hpp
+++ b/boost/proto/transform/detail/default_function_impl.hpp
@@ -86,7 +86,7 @@
BOOST_PROTO_USE_GET_POINTER();
typedef typename detail::classtypeof<function_type>::type class_type;
return (
- BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, e)) ->*
+ BOOST_PROTO_GET_POINTER(class_type, (BOOST_PROTO_DEFAULT_EVAL(~, 1, e))) ->*
BOOST_PROTO_DEFAULT_EVAL(~, 0, e)
)(BOOST_PP_ENUM(BOOST_PP_SUB(N, 2), BOOST_PROTO_DEF_FUN_INVOKE_ARG, e));
}
diff --git a/boost/proto/transform/detail/expand_pack.hpp b/boost/proto/transform/detail/expand_pack.hpp
new file mode 100644
index 0000000000..c87e3807c4
--- /dev/null
+++ b/boost/proto/transform/detail/expand_pack.hpp
@@ -0,0 +1,46 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/transform/detail/preprocessed/expand_pack.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/expand_pack.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file expand_pack.hpp
+ /// Contains helpers for pseudo-pack expansion.
+ //
+ // Copyright 2012 Eric Niebler. Distributed under the Boost
+ // Software License, Version 1.0. (See accompanying file
+ // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (0, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/detail/expand_pack.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+#else
+ #define N BOOST_PP_ITERATION()
+ #define M0(Z, X, DATA) typename expand_pattern_helper<Tfx, BOOST_PP_CAT(A, X)>::type
+ #define M1(Z, X, DATA) expand_pattern_helper<Tfx, BOOST_PP_CAT(A, X)>::applied::value ||
+
+ template<typename Tfx, typename Ret BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct expand_pattern_helper<Tfx, Ret(BOOST_PP_ENUM_PARAMS(N, A))>
+ {
+ typedef Ret (*type)(BOOST_PP_ENUM(N, M0, ~));
+ typedef mpl::bool_<BOOST_PP_REPEAT(N, M1, ~) false> applied;
+ };
+
+ #undef M1
+ #undef M0
+ #undef N
+#endif
diff --git a/boost/proto/transform/detail/lazy.hpp b/boost/proto/transform/detail/lazy.hpp
index 26a9c5b3d0..fbd13651cf 100644
--- a/boost/proto/transform/detail/lazy.hpp
+++ b/boost/proto/transform/detail/lazy.hpp
@@ -53,6 +53,27 @@
{};
};
+ #if N > 0
+ template<typename Object BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct lazy<Object(BOOST_PP_ENUM_PARAMS(N, A)...)>
+ : transform<lazy<Object(BOOST_PP_ENUM_PARAMS(N, A)...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : lazy<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value
+ , BOOST_PP_CAT(A, BOOST_PP_DEC(N))
+ , detail::BOOST_PP_CAT(expand_pattern_rest_, BOOST_PP_DEC(N))<
+ Object
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_DEC(N), A)
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
+ #endif
+
#undef N
#endif
diff --git a/boost/proto/transform/detail/make.hpp b/boost/proto/transform/detail/make.hpp
index e03a832811..31a89cc764 100644
--- a/boost/proto/transform/detail/make.hpp
+++ b/boost/proto/transform/detail/make.hpp
@@ -173,6 +173,30 @@
};
};
+ #if N > 0
+ /// \brief A PrimitiveTransform which computes a type by evaluating any
+ /// nested transforms and then constructs an object of that type with the
+ /// current expression, state and data, transformed according
+ /// to \c A0 through \c AN.
+ template<typename Object BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct make<Object(BOOST_PP_ENUM_PARAMS(N, A)...)>
+ : transform<make<Object(BOOST_PP_ENUM_PARAMS(N, A)...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : make<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value
+ , BOOST_PP_CAT(A, BOOST_PP_DEC(N))
+ , detail::BOOST_PP_CAT(expand_pattern_rest_, BOOST_PP_DEC(N))<
+ Object
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_DEC(N), A)
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
+ #endif
#undef N
#endif
diff --git a/boost/proto/transform/detail/pack.hpp b/boost/proto/transform/detail/pack.hpp
new file mode 100644
index 0000000000..863e7a02c4
--- /dev/null
+++ b/boost/proto/transform/detail/pack.hpp
@@ -0,0 +1,97 @@
+///////////////////////////////////////////////////////////////////////////////
+/// \file pack.hpp
+/// Contains helpers for pseudo-pack expansion.
+//
+// Copyright 2012 Eric Niebler. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_PROTO_TRANSFORM_DETAIL_PACK_HPP_EAN_2012_07_11
+#define BOOST_PROTO_TRANSFORM_DETAIL_PACK_HPP_EAN_2012_07_11
+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/arithmetic/dec.hpp>
+#include <boost/preprocessor/arithmetic/sub.hpp>
+#include <boost/preprocessor/punctuation/comma_if.hpp>
+#include <boost/preprocessor/repetition/enum.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
+#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
+#include <boost/preprocessor/repetition/repeat.hpp>
+#include <boost/preprocessor/iteration/local.hpp>
+#include <boost/preprocessor/iteration/iterate.hpp>
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/proto/proto_fwd.hpp>
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(push)
+# pragma warning(disable: 4348) // redefinition of default parameter
+#endif
+
+namespace boost { namespace proto
+{
+ namespace detail
+ {
+ template<typename Fun>
+ struct msvc_fun_workaround;
+
+ template<typename Tfx, typename T>
+ struct expand_pattern_helper
+ {
+ typedef T type;
+ typedef mpl::false_ applied;
+ };
+
+ template<typename Tfx, typename Fun>
+ struct expand_pattern_helper<Tfx, Fun *>
+ : expand_pattern_helper<Tfx, Fun>
+ {};
+
+ template<typename Tfx, typename T>
+ struct expand_pattern_helper<Tfx, pack(T)>
+ {
+ // BUGBUG fix me. See comment in transform/detail/call.hpp
+ BOOST_MPL_ASSERT_MSG(
+ (is_same<T, _>::value)
+ , PACK_EXPANSIONS_OF_EXPRESSIONS_OTHER_THAN_THE_CURRENT_NOT_YET_SUPPORTED
+ , (T)
+ );
+ typedef Tfx type(T);
+ typedef mpl::true_ applied;
+ };
+
+ template<typename Tfx>
+ struct expand_pattern_helper<Tfx, pack(_)>
+ {
+ typedef Tfx type;
+ typedef mpl::true_ applied;
+ };
+
+ #include <boost/proto/transform/detail/expand_pack.hpp>
+
+ template<long Arity, typename Fun, typename Cont>
+ struct expand_pattern;
+
+ template<typename Fun, typename Cont>
+ struct expand_pattern<0, Fun, Cont>
+ : Cont::template cat<typename expand_pattern_helper<proto::_value, Fun>::type>
+ {
+ BOOST_MPL_ASSERT_MSG(
+ (expand_pattern_helper<proto::_value, Fun>::applied::value)
+ , NO_PACK_EXPRESSION_FOUND_IN_PACK_EXPANSION
+ , (Fun)
+ );
+ };
+
+ #include <boost/proto/transform/detail/pack_impl.hpp>
+ }
+}}
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(pop)
+#endif
+
+#endif
diff --git a/boost/proto/transform/detail/pack_impl.hpp b/boost/proto/transform/detail/pack_impl.hpp
new file mode 100644
index 0000000000..d5f10afd23
--- /dev/null
+++ b/boost/proto/transform/detail/pack_impl.hpp
@@ -0,0 +1,72 @@
+#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
+
+ #include <boost/proto/transform/detail/preprocessed/pack_impl.hpp>
+
+#elif !defined(BOOST_PP_IS_ITERATING)
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/pack_impl.hpp")
+ #endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file pack_impl.hpp
+ /// Contains helpers for pseudo-pack expansion.
+ //
+ // Copyright 2012 Eric Niebler. Distributed under the Boost
+ // Software License, Version 1.0. (See accompanying file
+ // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ #define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (0, BOOST_PP_DEC(BOOST_PROTO_MAX_ARITY), <boost/proto/transform/detail/pack_impl.hpp>))
+ #include BOOST_PP_ITERATE()
+
+ #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+#else
+ #if BOOST_PP_ITERATION_DEPTH() == 1
+ #define N BOOST_PP_ITERATION()
+ #define M BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N)
+ #define M0(Z, X, D) typename expand_pattern_helper<proto::_child_c<X>, Fun>::type
+
+ template<typename Fun, typename Cont>
+ struct expand_pattern<BOOST_PP_INC(N), Fun, Cont>
+ : Cont::template cat<BOOST_PP_ENUM(BOOST_PP_INC(N), M0, ~)>
+ {
+ BOOST_MPL_ASSERT_MSG(
+ (expand_pattern_helper<proto::_child_c<0>, Fun>::applied::value)
+ , NO_PACK_EXPRESSION_FOUND_IN_UNPACKING_PATTERN
+ , (Fun)
+ );
+ };
+
+ template<typename Ret BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct BOOST_PP_CAT(expand_pattern_rest_, N)
+ {
+ template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PP_INC(M), typename C, void)>
+ struct cat;
+
+ #define BOOST_PP_ITERATION_PARAMS_2 \
+ (3, (1, M, <boost/proto/transform/detail/pack_impl.hpp>))
+ #include BOOST_PP_ITERATE()
+ };
+ #undef M0
+ #undef M
+ #undef N
+ #else
+ #define I BOOST_PP_ITERATION()
+ #define J BOOST_PP_RELATIVE_ITERATION(1)
+ template<BOOST_PP_ENUM_PARAMS(I, typename C)>
+ struct cat<BOOST_PP_ENUM_PARAMS(I, C)>
+ {
+ typedef msvc_fun_workaround<Ret(BOOST_PP_ENUM_PARAMS(J, A) BOOST_PP_COMMA_IF(J) BOOST_PP_ENUM_PARAMS(I, C))> type;
+ };
+ #undef J
+ #undef I
+ #endif
+#endif
diff --git a/boost/proto/transform/detail/preprocessed/call.hpp b/boost/proto/transform/detail/preprocessed/call.hpp
index 6a3e357982..54575ccc15 100644
--- a/boost/proto/transform/detail/preprocessed/call.hpp
+++ b/boost/proto/transform/detail/preprocessed/call.hpp
@@ -8,6 +8,66 @@
+ template<typename Fun , typename A0>
+ struct call<Fun(A0...)> : transform<call<Fun(A0...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : call<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value
+ , A0
+ , detail::expand_pattern_rest_0<
+ Fun
+
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
+
+
+
+ template<typename Fun , typename A0 , typename A1>
+ struct call<Fun(A0 , A1...)> : transform<call<Fun(A0 , A1...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : call<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value
+ , A1
+ , detail::expand_pattern_rest_1<
+ Fun
+ , A0
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
+
+
+
+ template<typename Fun , typename A0 , typename A1 , typename A2>
+ struct call<Fun(A0 , A1 , A2...)> : transform<call<Fun(A0 , A1 , A2...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : call<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value
+ , A2
+ , detail::expand_pattern_rest_2<
+ Fun
+ , A0 , A1
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
+
+
+
template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3>
struct call<Fun(A0 , A1 , A2 , A3)> : transform<call<Fun(A0 , A1 , A2 , A3)> >
{
@@ -39,6 +99,26 @@
+ template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3>
+ struct call<Fun(A0 , A1 , A2 , A3...)> : transform<call<Fun(A0 , A1 , A2 , A3...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : call<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value
+ , A3
+ , detail::expand_pattern_rest_3<
+ Fun
+ , A0 , A1 , A2
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
+
+
+
template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
struct call<Fun(A0 , A1 , A2 , A3 , A4)> : transform<call<Fun(A0 , A1 , A2 , A3 , A4)> >
{
@@ -70,6 +150,26 @@
+ template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct call<Fun(A0 , A1 , A2 , A3 , A4...)> : transform<call<Fun(A0 , A1 , A2 , A3 , A4...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : call<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value
+ , A4
+ , detail::expand_pattern_rest_4<
+ Fun
+ , A0 , A1 , A2 , A3
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
+
+
+
template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
struct call<Fun(A0 , A1 , A2 , A3 , A4 , A5)> : transform<call<Fun(A0 , A1 , A2 , A3 , A4 , A5)> >
{
@@ -101,6 +201,26 @@
+ template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct call<Fun(A0 , A1 , A2 , A3 , A4 , A5...)> : transform<call<Fun(A0 , A1 , A2 , A3 , A4 , A5...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : call<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value
+ , A5
+ , detail::expand_pattern_rest_5<
+ Fun
+ , A0 , A1 , A2 , A3 , A4
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
+
+
+
template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
struct call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6)> : transform<call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6)> >
{
@@ -132,6 +252,26 @@
+ template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6...)> : transform<call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : call<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value
+ , A6
+ , detail::expand_pattern_rest_6<
+ Fun
+ , A0 , A1 , A2 , A3 , A4 , A5
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
+
+
+
template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
struct call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)> : transform<call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)> >
{
@@ -163,6 +303,26 @@
+ template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7...)> : transform<call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : call<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value
+ , A7
+ , detail::expand_pattern_rest_7<
+ Fun
+ , A0 , A1 , A2 , A3 , A4 , A5 , A6
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
+
+
+
template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
struct call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)> : transform<call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)> >
{
@@ -194,6 +354,26 @@
+ template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8...)> : transform<call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : call<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value
+ , A8
+ , detail::expand_pattern_rest_8<
+ Fun
+ , A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
+
+
+
template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
struct call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)> : transform<call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)> >
{
@@ -222,3 +402,23 @@
}
};
};
+
+
+
+ template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9...)> : transform<call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : call<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value
+ , A9
+ , detail::expand_pattern_rest_9<
+ Fun
+ , A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
diff --git a/boost/proto/transform/detail/preprocessed/default_function_impl.hpp b/boost/proto/transform/detail/preprocessed/default_function_impl.hpp
index dc13095f32..9086c9a322 100644
--- a/boost/proto/transform/detail/preprocessed/default_function_impl.hpp
+++ b/boost/proto/transform/detail/preprocessed/default_function_impl.hpp
@@ -49,7 +49,7 @@
BOOST_PROTO_USE_GET_POINTER();
typedef typename detail::classtypeof<function_type>::type class_type;
return (
- BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, e)) ->*
+ BOOST_PROTO_GET_POINTER(class_type, (typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d ))) ->*
typename Grammar::template impl<e0, State, Data>()( proto::child_c< 0>( e), s, d )
)(typename Grammar::template impl<e2, State, Data>()( proto::child_c< 2>( e), s, d ));
}
@@ -97,7 +97,7 @@
BOOST_PROTO_USE_GET_POINTER();
typedef typename detail::classtypeof<function_type>::type class_type;
return (
- BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, e)) ->*
+ BOOST_PROTO_GET_POINTER(class_type, (typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d ))) ->*
typename Grammar::template impl<e0, State, Data>()( proto::child_c< 0>( e), s, d )
)(typename Grammar::template impl<e2, State, Data>()( proto::child_c< 2>( e), s, d ) , typename Grammar::template impl<e3, State, Data>()( proto::child_c< 3>( e), s, d ));
}
@@ -145,7 +145,7 @@
BOOST_PROTO_USE_GET_POINTER();
typedef typename detail::classtypeof<function_type>::type class_type;
return (
- BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, e)) ->*
+ BOOST_PROTO_GET_POINTER(class_type, (typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d ))) ->*
typename Grammar::template impl<e0, State, Data>()( proto::child_c< 0>( e), s, d )
)(typename Grammar::template impl<e2, State, Data>()( proto::child_c< 2>( e), s, d ) , typename Grammar::template impl<e3, State, Data>()( proto::child_c< 3>( e), s, d ) , typename Grammar::template impl<e4, State, Data>()( proto::child_c< 4>( e), s, d ));
}
@@ -193,7 +193,7 @@
BOOST_PROTO_USE_GET_POINTER();
typedef typename detail::classtypeof<function_type>::type class_type;
return (
- BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, e)) ->*
+ BOOST_PROTO_GET_POINTER(class_type, (typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d ))) ->*
typename Grammar::template impl<e0, State, Data>()( proto::child_c< 0>( e), s, d )
)(typename Grammar::template impl<e2, State, Data>()( proto::child_c< 2>( e), s, d ) , typename Grammar::template impl<e3, State, Data>()( proto::child_c< 3>( e), s, d ) , typename Grammar::template impl<e4, State, Data>()( proto::child_c< 4>( e), s, d ) , typename Grammar::template impl<e5, State, Data>()( proto::child_c< 5>( e), s, d ));
}
@@ -241,7 +241,7 @@
BOOST_PROTO_USE_GET_POINTER();
typedef typename detail::classtypeof<function_type>::type class_type;
return (
- BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, e)) ->*
+ BOOST_PROTO_GET_POINTER(class_type, (typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d ))) ->*
typename Grammar::template impl<e0, State, Data>()( proto::child_c< 0>( e), s, d )
)(typename Grammar::template impl<e2, State, Data>()( proto::child_c< 2>( e), s, d ) , typename Grammar::template impl<e3, State, Data>()( proto::child_c< 3>( e), s, d ) , typename Grammar::template impl<e4, State, Data>()( proto::child_c< 4>( e), s, d ) , typename Grammar::template impl<e5, State, Data>()( proto::child_c< 5>( e), s, d ) , typename Grammar::template impl<e6, State, Data>()( proto::child_c< 6>( e), s, d ));
}
@@ -289,7 +289,7 @@
BOOST_PROTO_USE_GET_POINTER();
typedef typename detail::classtypeof<function_type>::type class_type;
return (
- BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, e)) ->*
+ BOOST_PROTO_GET_POINTER(class_type, (typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d ))) ->*
typename Grammar::template impl<e0, State, Data>()( proto::child_c< 0>( e), s, d )
)(typename Grammar::template impl<e2, State, Data>()( proto::child_c< 2>( e), s, d ) , typename Grammar::template impl<e3, State, Data>()( proto::child_c< 3>( e), s, d ) , typename Grammar::template impl<e4, State, Data>()( proto::child_c< 4>( e), s, d ) , typename Grammar::template impl<e5, State, Data>()( proto::child_c< 5>( e), s, d ) , typename Grammar::template impl<e6, State, Data>()( proto::child_c< 6>( e), s, d ) , typename Grammar::template impl<e7, State, Data>()( proto::child_c< 7>( e), s, d ));
}
@@ -337,7 +337,7 @@
BOOST_PROTO_USE_GET_POINTER();
typedef typename detail::classtypeof<function_type>::type class_type;
return (
- BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, e)) ->*
+ BOOST_PROTO_GET_POINTER(class_type, (typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d ))) ->*
typename Grammar::template impl<e0, State, Data>()( proto::child_c< 0>( e), s, d )
)(typename Grammar::template impl<e2, State, Data>()( proto::child_c< 2>( e), s, d ) , typename Grammar::template impl<e3, State, Data>()( proto::child_c< 3>( e), s, d ) , typename Grammar::template impl<e4, State, Data>()( proto::child_c< 4>( e), s, d ) , typename Grammar::template impl<e5, State, Data>()( proto::child_c< 5>( e), s, d ) , typename Grammar::template impl<e6, State, Data>()( proto::child_c< 6>( e), s, d ) , typename Grammar::template impl<e7, State, Data>()( proto::child_c< 7>( e), s, d ) , typename Grammar::template impl<e8, State, Data>()( proto::child_c< 8>( e), s, d ));
}
@@ -385,7 +385,7 @@
BOOST_PROTO_USE_GET_POINTER();
typedef typename detail::classtypeof<function_type>::type class_type;
return (
- BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, e)) ->*
+ BOOST_PROTO_GET_POINTER(class_type, (typename Grammar::template impl<e1, State, Data>()( proto::child_c< 1>( e), s, d ))) ->*
typename Grammar::template impl<e0, State, Data>()( proto::child_c< 0>( e), s, d )
)(typename Grammar::template impl<e2, State, Data>()( proto::child_c< 2>( e), s, d ) , typename Grammar::template impl<e3, State, Data>()( proto::child_c< 3>( e), s, d ) , typename Grammar::template impl<e4, State, Data>()( proto::child_c< 4>( e), s, d ) , typename Grammar::template impl<e5, State, Data>()( proto::child_c< 5>( e), s, d ) , typename Grammar::template impl<e6, State, Data>()( proto::child_c< 6>( e), s, d ) , typename Grammar::template impl<e7, State, Data>()( proto::child_c< 7>( e), s, d ) , typename Grammar::template impl<e8, State, Data>()( proto::child_c< 8>( e), s, d ) , typename Grammar::template impl<e9, State, Data>()( proto::child_c< 9>( e), s, d ));
}
diff --git a/boost/proto/transform/detail/preprocessed/expand_pack.hpp b/boost/proto/transform/detail/preprocessed/expand_pack.hpp
new file mode 100644
index 0000000000..8f758a3fa9
--- /dev/null
+++ b/boost/proto/transform/detail/preprocessed/expand_pack.hpp
@@ -0,0 +1,73 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file expand_pack.hpp
+ /// Contains helpers for pseudo-pack expansion.
+ //
+ // Copyright 2012 Eric Niebler. Distributed under the Boost
+ // Software License, Version 1.0. (See accompanying file
+ // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ template<typename Tfx, typename Ret >
+ struct expand_pattern_helper<Tfx, Ret()>
+ {
+ typedef Ret (*type)();
+ typedef mpl::bool_< false> applied;
+ };
+ template<typename Tfx, typename Ret , typename A0>
+ struct expand_pattern_helper<Tfx, Ret(A0)>
+ {
+ typedef Ret (*type)(typename expand_pattern_helper<Tfx, A0>::type);
+ typedef mpl::bool_<expand_pattern_helper<Tfx, A0>::applied::value || false> applied;
+ };
+ template<typename Tfx, typename Ret , typename A0 , typename A1>
+ struct expand_pattern_helper<Tfx, Ret(A0 , A1)>
+ {
+ typedef Ret (*type)(typename expand_pattern_helper<Tfx, A0>::type , typename expand_pattern_helper<Tfx, A1>::type);
+ typedef mpl::bool_<expand_pattern_helper<Tfx, A0>::applied::value || expand_pattern_helper<Tfx, A1>::applied::value || false> applied;
+ };
+ template<typename Tfx, typename Ret , typename A0 , typename A1 , typename A2>
+ struct expand_pattern_helper<Tfx, Ret(A0 , A1 , A2)>
+ {
+ typedef Ret (*type)(typename expand_pattern_helper<Tfx, A0>::type , typename expand_pattern_helper<Tfx, A1>::type , typename expand_pattern_helper<Tfx, A2>::type);
+ typedef mpl::bool_<expand_pattern_helper<Tfx, A0>::applied::value || expand_pattern_helper<Tfx, A1>::applied::value || expand_pattern_helper<Tfx, A2>::applied::value || false> applied;
+ };
+ template<typename Tfx, typename Ret , typename A0 , typename A1 , typename A2 , typename A3>
+ struct expand_pattern_helper<Tfx, Ret(A0 , A1 , A2 , A3)>
+ {
+ typedef Ret (*type)(typename expand_pattern_helper<Tfx, A0>::type , typename expand_pattern_helper<Tfx, A1>::type , typename expand_pattern_helper<Tfx, A2>::type , typename expand_pattern_helper<Tfx, A3>::type);
+ typedef mpl::bool_<expand_pattern_helper<Tfx, A0>::applied::value || expand_pattern_helper<Tfx, A1>::applied::value || expand_pattern_helper<Tfx, A2>::applied::value || expand_pattern_helper<Tfx, A3>::applied::value || false> applied;
+ };
+ template<typename Tfx, typename Ret , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct expand_pattern_helper<Tfx, Ret(A0 , A1 , A2 , A3 , A4)>
+ {
+ typedef Ret (*type)(typename expand_pattern_helper<Tfx, A0>::type , typename expand_pattern_helper<Tfx, A1>::type , typename expand_pattern_helper<Tfx, A2>::type , typename expand_pattern_helper<Tfx, A3>::type , typename expand_pattern_helper<Tfx, A4>::type);
+ typedef mpl::bool_<expand_pattern_helper<Tfx, A0>::applied::value || expand_pattern_helper<Tfx, A1>::applied::value || expand_pattern_helper<Tfx, A2>::applied::value || expand_pattern_helper<Tfx, A3>::applied::value || expand_pattern_helper<Tfx, A4>::applied::value || false> applied;
+ };
+ template<typename Tfx, typename Ret , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct expand_pattern_helper<Tfx, Ret(A0 , A1 , A2 , A3 , A4 , A5)>
+ {
+ typedef Ret (*type)(typename expand_pattern_helper<Tfx, A0>::type , typename expand_pattern_helper<Tfx, A1>::type , typename expand_pattern_helper<Tfx, A2>::type , typename expand_pattern_helper<Tfx, A3>::type , typename expand_pattern_helper<Tfx, A4>::type , typename expand_pattern_helper<Tfx, A5>::type);
+ typedef mpl::bool_<expand_pattern_helper<Tfx, A0>::applied::value || expand_pattern_helper<Tfx, A1>::applied::value || expand_pattern_helper<Tfx, A2>::applied::value || expand_pattern_helper<Tfx, A3>::applied::value || expand_pattern_helper<Tfx, A4>::applied::value || expand_pattern_helper<Tfx, A5>::applied::value || false> applied;
+ };
+ template<typename Tfx, typename Ret , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct expand_pattern_helper<Tfx, Ret(A0 , A1 , A2 , A3 , A4 , A5 , A6)>
+ {
+ typedef Ret (*type)(typename expand_pattern_helper<Tfx, A0>::type , typename expand_pattern_helper<Tfx, A1>::type , typename expand_pattern_helper<Tfx, A2>::type , typename expand_pattern_helper<Tfx, A3>::type , typename expand_pattern_helper<Tfx, A4>::type , typename expand_pattern_helper<Tfx, A5>::type , typename expand_pattern_helper<Tfx, A6>::type);
+ typedef mpl::bool_<expand_pattern_helper<Tfx, A0>::applied::value || expand_pattern_helper<Tfx, A1>::applied::value || expand_pattern_helper<Tfx, A2>::applied::value || expand_pattern_helper<Tfx, A3>::applied::value || expand_pattern_helper<Tfx, A4>::applied::value || expand_pattern_helper<Tfx, A5>::applied::value || expand_pattern_helper<Tfx, A6>::applied::value || false> applied;
+ };
+ template<typename Tfx, typename Ret , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct expand_pattern_helper<Tfx, Ret(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)>
+ {
+ typedef Ret (*type)(typename expand_pattern_helper<Tfx, A0>::type , typename expand_pattern_helper<Tfx, A1>::type , typename expand_pattern_helper<Tfx, A2>::type , typename expand_pattern_helper<Tfx, A3>::type , typename expand_pattern_helper<Tfx, A4>::type , typename expand_pattern_helper<Tfx, A5>::type , typename expand_pattern_helper<Tfx, A6>::type , typename expand_pattern_helper<Tfx, A7>::type);
+ typedef mpl::bool_<expand_pattern_helper<Tfx, A0>::applied::value || expand_pattern_helper<Tfx, A1>::applied::value || expand_pattern_helper<Tfx, A2>::applied::value || expand_pattern_helper<Tfx, A3>::applied::value || expand_pattern_helper<Tfx, A4>::applied::value || expand_pattern_helper<Tfx, A5>::applied::value || expand_pattern_helper<Tfx, A6>::applied::value || expand_pattern_helper<Tfx, A7>::applied::value || false> applied;
+ };
+ template<typename Tfx, typename Ret , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct expand_pattern_helper<Tfx, Ret(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)>
+ {
+ typedef Ret (*type)(typename expand_pattern_helper<Tfx, A0>::type , typename expand_pattern_helper<Tfx, A1>::type , typename expand_pattern_helper<Tfx, A2>::type , typename expand_pattern_helper<Tfx, A3>::type , typename expand_pattern_helper<Tfx, A4>::type , typename expand_pattern_helper<Tfx, A5>::type , typename expand_pattern_helper<Tfx, A6>::type , typename expand_pattern_helper<Tfx, A7>::type , typename expand_pattern_helper<Tfx, A8>::type);
+ typedef mpl::bool_<expand_pattern_helper<Tfx, A0>::applied::value || expand_pattern_helper<Tfx, A1>::applied::value || expand_pattern_helper<Tfx, A2>::applied::value || expand_pattern_helper<Tfx, A3>::applied::value || expand_pattern_helper<Tfx, A4>::applied::value || expand_pattern_helper<Tfx, A5>::applied::value || expand_pattern_helper<Tfx, A6>::applied::value || expand_pattern_helper<Tfx, A7>::applied::value || expand_pattern_helper<Tfx, A8>::applied::value || false> applied;
+ };
+ template<typename Tfx, typename Ret , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct expand_pattern_helper<Tfx, Ret(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)>
+ {
+ typedef Ret (*type)(typename expand_pattern_helper<Tfx, A0>::type , typename expand_pattern_helper<Tfx, A1>::type , typename expand_pattern_helper<Tfx, A2>::type , typename expand_pattern_helper<Tfx, A3>::type , typename expand_pattern_helper<Tfx, A4>::type , typename expand_pattern_helper<Tfx, A5>::type , typename expand_pattern_helper<Tfx, A6>::type , typename expand_pattern_helper<Tfx, A7>::type , typename expand_pattern_helper<Tfx, A8>::type , typename expand_pattern_helper<Tfx, A9>::type);
+ typedef mpl::bool_<expand_pattern_helper<Tfx, A0>::applied::value || expand_pattern_helper<Tfx, A1>::applied::value || expand_pattern_helper<Tfx, A2>::applied::value || expand_pattern_helper<Tfx, A3>::applied::value || expand_pattern_helper<Tfx, A4>::applied::value || expand_pattern_helper<Tfx, A5>::applied::value || expand_pattern_helper<Tfx, A6>::applied::value || expand_pattern_helper<Tfx, A7>::applied::value || expand_pattern_helper<Tfx, A8>::applied::value || expand_pattern_helper<Tfx, A9>::applied::value || false> applied;
+ };
diff --git a/boost/proto/transform/detail/preprocessed/lazy.hpp b/boost/proto/transform/detail/preprocessed/lazy.hpp
index af0f90651a..c32d20fa25 100644
--- a/boost/proto/transform/detail/preprocessed/lazy.hpp
+++ b/boost/proto/transform/detail/preprocessed/lazy.hpp
@@ -45,6 +45,24 @@
>::template impl<Expr, State, Data>
{};
};
+ template<typename Object , typename A0>
+ struct lazy<Object(A0...)>
+ : transform<lazy<Object(A0...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : lazy<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value
+ , A0
+ , detail::expand_pattern_rest_0<
+ Object
+
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
@@ -65,6 +83,24 @@
>::template impl<Expr, State, Data>
{};
};
+ template<typename Object , typename A0 , typename A1>
+ struct lazy<Object(A0 , A1...)>
+ : transform<lazy<Object(A0 , A1...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : lazy<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value
+ , A1
+ , detail::expand_pattern_rest_1<
+ Object
+ , A0
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
@@ -85,6 +121,24 @@
>::template impl<Expr, State, Data>
{};
};
+ template<typename Object , typename A0 , typename A1 , typename A2>
+ struct lazy<Object(A0 , A1 , A2...)>
+ : transform<lazy<Object(A0 , A1 , A2...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : lazy<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value
+ , A2
+ , detail::expand_pattern_rest_2<
+ Object
+ , A0 , A1
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
@@ -105,6 +159,24 @@
>::template impl<Expr, State, Data>
{};
};
+ template<typename Object , typename A0 , typename A1 , typename A2 , typename A3>
+ struct lazy<Object(A0 , A1 , A2 , A3...)>
+ : transform<lazy<Object(A0 , A1 , A2 , A3...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : lazy<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value
+ , A3
+ , detail::expand_pattern_rest_3<
+ Object
+ , A0 , A1 , A2
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
@@ -125,6 +197,24 @@
>::template impl<Expr, State, Data>
{};
};
+ template<typename Object , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct lazy<Object(A0 , A1 , A2 , A3 , A4...)>
+ : transform<lazy<Object(A0 , A1 , A2 , A3 , A4...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : lazy<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value
+ , A4
+ , detail::expand_pattern_rest_4<
+ Object
+ , A0 , A1 , A2 , A3
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
@@ -145,6 +235,24 @@
>::template impl<Expr, State, Data>
{};
};
+ template<typename Object , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct lazy<Object(A0 , A1 , A2 , A3 , A4 , A5...)>
+ : transform<lazy<Object(A0 , A1 , A2 , A3 , A4 , A5...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : lazy<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value
+ , A5
+ , detail::expand_pattern_rest_5<
+ Object
+ , A0 , A1 , A2 , A3 , A4
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
@@ -165,6 +273,24 @@
>::template impl<Expr, State, Data>
{};
};
+ template<typename Object , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct lazy<Object(A0 , A1 , A2 , A3 , A4 , A5 , A6...)>
+ : transform<lazy<Object(A0 , A1 , A2 , A3 , A4 , A5 , A6...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : lazy<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value
+ , A6
+ , detail::expand_pattern_rest_6<
+ Object
+ , A0 , A1 , A2 , A3 , A4 , A5
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
@@ -185,6 +311,24 @@
>::template impl<Expr, State, Data>
{};
};
+ template<typename Object , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct lazy<Object(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7...)>
+ : transform<lazy<Object(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : lazy<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value
+ , A7
+ , detail::expand_pattern_rest_7<
+ Object
+ , A0 , A1 , A2 , A3 , A4 , A5 , A6
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
@@ -205,6 +349,24 @@
>::template impl<Expr, State, Data>
{};
};
+ template<typename Object , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct lazy<Object(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8...)>
+ : transform<lazy<Object(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : lazy<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value
+ , A8
+ , detail::expand_pattern_rest_8<
+ Object
+ , A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
@@ -225,3 +387,21 @@
>::template impl<Expr, State, Data>
{};
};
+ template<typename Object , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct lazy<Object(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9...)>
+ : transform<lazy<Object(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : lazy<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value
+ , A9
+ , detail::expand_pattern_rest_9<
+ Object
+ , A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
diff --git a/boost/proto/transform/detail/preprocessed/make.hpp b/boost/proto/transform/detail/preprocessed/make.hpp
index 6ab9b38563..e5811277ed 100644
--- a/boost/proto/transform/detail/preprocessed/make.hpp
+++ b/boost/proto/transform/detail/preprocessed/make.hpp
@@ -180,6 +180,28 @@
}
};
};
+
+
+
+
+ template<typename Object , typename A0>
+ struct make<Object(A0...)>
+ : transform<make<Object(A0...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : make<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value
+ , A0
+ , detail::expand_pattern_rest_0<
+ Object
+
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
namespace detail
{
template<
@@ -282,6 +304,28 @@
}
};
};
+
+
+
+
+ template<typename Object , typename A0 , typename A1>
+ struct make<Object(A0 , A1...)>
+ : transform<make<Object(A0 , A1...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : make<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value
+ , A1
+ , detail::expand_pattern_rest_1<
+ Object
+ , A0
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
namespace detail
{
template<
@@ -384,6 +428,28 @@
}
};
};
+
+
+
+
+ template<typename Object , typename A0 , typename A1 , typename A2>
+ struct make<Object(A0 , A1 , A2...)>
+ : transform<make<Object(A0 , A1 , A2...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : make<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value
+ , A2
+ , detail::expand_pattern_rest_2<
+ Object
+ , A0 , A1
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
namespace detail
{
template<
@@ -486,6 +552,28 @@
}
};
};
+
+
+
+
+ template<typename Object , typename A0 , typename A1 , typename A2 , typename A3>
+ struct make<Object(A0 , A1 , A2 , A3...)>
+ : transform<make<Object(A0 , A1 , A2 , A3...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : make<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value
+ , A3
+ , detail::expand_pattern_rest_3<
+ Object
+ , A0 , A1 , A2
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
namespace detail
{
template<
@@ -588,6 +676,28 @@
}
};
};
+
+
+
+
+ template<typename Object , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct make<Object(A0 , A1 , A2 , A3 , A4...)>
+ : transform<make<Object(A0 , A1 , A2 , A3 , A4...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : make<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value
+ , A4
+ , detail::expand_pattern_rest_4<
+ Object
+ , A0 , A1 , A2 , A3
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
namespace detail
{
template<
@@ -690,6 +800,28 @@
}
};
};
+
+
+
+
+ template<typename Object , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct make<Object(A0 , A1 , A2 , A3 , A4 , A5...)>
+ : transform<make<Object(A0 , A1 , A2 , A3 , A4 , A5...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : make<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value
+ , A5
+ , detail::expand_pattern_rest_5<
+ Object
+ , A0 , A1 , A2 , A3 , A4
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
namespace detail
{
template<
@@ -792,6 +924,28 @@
}
};
};
+
+
+
+
+ template<typename Object , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct make<Object(A0 , A1 , A2 , A3 , A4 , A5 , A6...)>
+ : transform<make<Object(A0 , A1 , A2 , A3 , A4 , A5 , A6...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : make<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value
+ , A6
+ , detail::expand_pattern_rest_6<
+ Object
+ , A0 , A1 , A2 , A3 , A4 , A5
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
namespace detail
{
template<
@@ -894,6 +1048,28 @@
}
};
};
+
+
+
+
+ template<typename Object , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct make<Object(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7...)>
+ : transform<make<Object(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : make<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value
+ , A7
+ , detail::expand_pattern_rest_7<
+ Object
+ , A0 , A1 , A2 , A3 , A4 , A5 , A6
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
namespace detail
{
template<
@@ -996,6 +1172,28 @@
}
};
};
+
+
+
+
+ template<typename Object , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct make<Object(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8...)>
+ : transform<make<Object(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : make<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value
+ , A8
+ , detail::expand_pattern_rest_8<
+ Object
+ , A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
namespace detail
{
template<
@@ -1098,3 +1296,25 @@
}
};
};
+
+
+
+
+ template<typename Object , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct make<Object(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9...)>
+ : transform<make<Object(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9...)> >
+ {
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : make<
+ typename detail::expand_pattern<
+ proto::arity_of<Expr>::value
+ , A9
+ , detail::expand_pattern_rest_9<
+ Object
+ , A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8
+ >
+ >::type
+ >::template impl<Expr, State, Data>
+ {};
+ };
diff --git a/boost/proto/transform/detail/preprocessed/pack_impl.hpp b/boost/proto/transform/detail/preprocessed/pack_impl.hpp
new file mode 100644
index 0000000000..802bb6abc1
--- /dev/null
+++ b/boost/proto/transform/detail/preprocessed/pack_impl.hpp
@@ -0,0 +1,442 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ /// \file pack_impl.hpp
+ /// Contains helpers for pseudo-pack expansion.
+ //
+ // Copyright 2012 Eric Niebler. Distributed under the Boost
+ // Software License, Version 1.0. (See accompanying file
+ // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ template<typename Fun, typename Cont>
+ struct expand_pattern<1, Fun, Cont>
+ : Cont::template cat<typename expand_pattern_helper<proto::_child_c< 0>, Fun>::type>
+ {
+ BOOST_MPL_ASSERT_MSG(
+ (expand_pattern_helper<proto::_child_c<0>, Fun>::applied::value)
+ , NO_PACK_EXPRESSION_FOUND_IN_UNPACKING_PATTERN
+ , (Fun)
+ );
+ };
+ template<typename Ret >
+ struct expand_pattern_rest_0
+ {
+ template<typename C0 = void , typename C1 = void , typename C2 = void , typename C3 = void , typename C4 = void , typename C5 = void , typename C6 = void , typename C7 = void , typename C8 = void , typename C9 = void , typename C10 = void>
+ struct cat;
+ template<typename C0>
+ struct cat<C0>
+ {
+ typedef msvc_fun_workaround<Ret( C0)> type;
+ };
+ template<typename C0 , typename C1>
+ struct cat<C0 , C1>
+ {
+ typedef msvc_fun_workaround<Ret( C0 , C1)> type;
+ };
+ template<typename C0 , typename C1 , typename C2>
+ struct cat<C0 , C1 , C2>
+ {
+ typedef msvc_fun_workaround<Ret( C0 , C1 , C2)> type;
+ };
+ template<typename C0 , typename C1 , typename C2 , typename C3>
+ struct cat<C0 , C1 , C2 , C3>
+ {
+ typedef msvc_fun_workaround<Ret( C0 , C1 , C2 , C3)> type;
+ };
+ template<typename C0 , typename C1 , typename C2 , typename C3 , typename C4>
+ struct cat<C0 , C1 , C2 , C3 , C4>
+ {
+ typedef msvc_fun_workaround<Ret( C0 , C1 , C2 , C3 , C4)> type;
+ };
+ template<typename C0 , typename C1 , typename C2 , typename C3 , typename C4 , typename C5>
+ struct cat<C0 , C1 , C2 , C3 , C4 , C5>
+ {
+ typedef msvc_fun_workaround<Ret( C0 , C1 , C2 , C3 , C4 , C5)> type;
+ };
+ template<typename C0 , typename C1 , typename C2 , typename C3 , typename C4 , typename C5 , typename C6>
+ struct cat<C0 , C1 , C2 , C3 , C4 , C5 , C6>
+ {
+ typedef msvc_fun_workaround<Ret( C0 , C1 , C2 , C3 , C4 , C5 , C6)> type;
+ };
+ template<typename C0 , typename C1 , typename C2 , typename C3 , typename C4 , typename C5 , typename C6 , typename C7>
+ struct cat<C0 , C1 , C2 , C3 , C4 , C5 , C6 , C7>
+ {
+ typedef msvc_fun_workaround<Ret( C0 , C1 , C2 , C3 , C4 , C5 , C6 , C7)> type;
+ };
+ template<typename C0 , typename C1 , typename C2 , typename C3 , typename C4 , typename C5 , typename C6 , typename C7 , typename C8>
+ struct cat<C0 , C1 , C2 , C3 , C4 , C5 , C6 , C7 , C8>
+ {
+ typedef msvc_fun_workaround<Ret( C0 , C1 , C2 , C3 , C4 , C5 , C6 , C7 , C8)> type;
+ };
+ template<typename C0 , typename C1 , typename C2 , typename C3 , typename C4 , typename C5 , typename C6 , typename C7 , typename C8 , typename C9>
+ struct cat<C0 , C1 , C2 , C3 , C4 , C5 , C6 , C7 , C8 , C9>
+ {
+ typedef msvc_fun_workaround<Ret( C0 , C1 , C2 , C3 , C4 , C5 , C6 , C7 , C8 , C9)> type;
+ };
+ };
+ template<typename Fun, typename Cont>
+ struct expand_pattern<2, Fun, Cont>
+ : Cont::template cat<typename expand_pattern_helper<proto::_child_c< 0>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 1>, Fun>::type>
+ {
+ BOOST_MPL_ASSERT_MSG(
+ (expand_pattern_helper<proto::_child_c<0>, Fun>::applied::value)
+ , NO_PACK_EXPRESSION_FOUND_IN_UNPACKING_PATTERN
+ , (Fun)
+ );
+ };
+ template<typename Ret , typename A0>
+ struct expand_pattern_rest_1
+ {
+ template<typename C0 = void , typename C1 = void , typename C2 = void , typename C3 = void , typename C4 = void , typename C5 = void , typename C6 = void , typename C7 = void , typename C8 = void , typename C9 = void>
+ struct cat;
+ template<typename C0>
+ struct cat<C0>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , C0)> type;
+ };
+ template<typename C0 , typename C1>
+ struct cat<C0 , C1>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , C0 , C1)> type;
+ };
+ template<typename C0 , typename C1 , typename C2>
+ struct cat<C0 , C1 , C2>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , C0 , C1 , C2)> type;
+ };
+ template<typename C0 , typename C1 , typename C2 , typename C3>
+ struct cat<C0 , C1 , C2 , C3>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , C0 , C1 , C2 , C3)> type;
+ };
+ template<typename C0 , typename C1 , typename C2 , typename C3 , typename C4>
+ struct cat<C0 , C1 , C2 , C3 , C4>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , C0 , C1 , C2 , C3 , C4)> type;
+ };
+ template<typename C0 , typename C1 , typename C2 , typename C3 , typename C4 , typename C5>
+ struct cat<C0 , C1 , C2 , C3 , C4 , C5>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , C0 , C1 , C2 , C3 , C4 , C5)> type;
+ };
+ template<typename C0 , typename C1 , typename C2 , typename C3 , typename C4 , typename C5 , typename C6>
+ struct cat<C0 , C1 , C2 , C3 , C4 , C5 , C6>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , C0 , C1 , C2 , C3 , C4 , C5 , C6)> type;
+ };
+ template<typename C0 , typename C1 , typename C2 , typename C3 , typename C4 , typename C5 , typename C6 , typename C7>
+ struct cat<C0 , C1 , C2 , C3 , C4 , C5 , C6 , C7>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , C0 , C1 , C2 , C3 , C4 , C5 , C6 , C7)> type;
+ };
+ template<typename C0 , typename C1 , typename C2 , typename C3 , typename C4 , typename C5 , typename C6 , typename C7 , typename C8>
+ struct cat<C0 , C1 , C2 , C3 , C4 , C5 , C6 , C7 , C8>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , C0 , C1 , C2 , C3 , C4 , C5 , C6 , C7 , C8)> type;
+ };
+ };
+ template<typename Fun, typename Cont>
+ struct expand_pattern<3, Fun, Cont>
+ : Cont::template cat<typename expand_pattern_helper<proto::_child_c< 0>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 1>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 2>, Fun>::type>
+ {
+ BOOST_MPL_ASSERT_MSG(
+ (expand_pattern_helper<proto::_child_c<0>, Fun>::applied::value)
+ , NO_PACK_EXPRESSION_FOUND_IN_UNPACKING_PATTERN
+ , (Fun)
+ );
+ };
+ template<typename Ret , typename A0 , typename A1>
+ struct expand_pattern_rest_2
+ {
+ template<typename C0 = void , typename C1 = void , typename C2 = void , typename C3 = void , typename C4 = void , typename C5 = void , typename C6 = void , typename C7 = void , typename C8 = void>
+ struct cat;
+ template<typename C0>
+ struct cat<C0>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , C0)> type;
+ };
+ template<typename C0 , typename C1>
+ struct cat<C0 , C1>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , C0 , C1)> type;
+ };
+ template<typename C0 , typename C1 , typename C2>
+ struct cat<C0 , C1 , C2>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , C0 , C1 , C2)> type;
+ };
+ template<typename C0 , typename C1 , typename C2 , typename C3>
+ struct cat<C0 , C1 , C2 , C3>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , C0 , C1 , C2 , C3)> type;
+ };
+ template<typename C0 , typename C1 , typename C2 , typename C3 , typename C4>
+ struct cat<C0 , C1 , C2 , C3 , C4>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , C0 , C1 , C2 , C3 , C4)> type;
+ };
+ template<typename C0 , typename C1 , typename C2 , typename C3 , typename C4 , typename C5>
+ struct cat<C0 , C1 , C2 , C3 , C4 , C5>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , C0 , C1 , C2 , C3 , C4 , C5)> type;
+ };
+ template<typename C0 , typename C1 , typename C2 , typename C3 , typename C4 , typename C5 , typename C6>
+ struct cat<C0 , C1 , C2 , C3 , C4 , C5 , C6>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , C0 , C1 , C2 , C3 , C4 , C5 , C6)> type;
+ };
+ template<typename C0 , typename C1 , typename C2 , typename C3 , typename C4 , typename C5 , typename C6 , typename C7>
+ struct cat<C0 , C1 , C2 , C3 , C4 , C5 , C6 , C7>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , C0 , C1 , C2 , C3 , C4 , C5 , C6 , C7)> type;
+ };
+ };
+ template<typename Fun, typename Cont>
+ struct expand_pattern<4, Fun, Cont>
+ : Cont::template cat<typename expand_pattern_helper<proto::_child_c< 0>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 1>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 2>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 3>, Fun>::type>
+ {
+ BOOST_MPL_ASSERT_MSG(
+ (expand_pattern_helper<proto::_child_c<0>, Fun>::applied::value)
+ , NO_PACK_EXPRESSION_FOUND_IN_UNPACKING_PATTERN
+ , (Fun)
+ );
+ };
+ template<typename Ret , typename A0 , typename A1 , typename A2>
+ struct expand_pattern_rest_3
+ {
+ template<typename C0 = void , typename C1 = void , typename C2 = void , typename C3 = void , typename C4 = void , typename C5 = void , typename C6 = void , typename C7 = void>
+ struct cat;
+ template<typename C0>
+ struct cat<C0>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , A2 , C0)> type;
+ };
+ template<typename C0 , typename C1>
+ struct cat<C0 , C1>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , A2 , C0 , C1)> type;
+ };
+ template<typename C0 , typename C1 , typename C2>
+ struct cat<C0 , C1 , C2>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , A2 , C0 , C1 , C2)> type;
+ };
+ template<typename C0 , typename C1 , typename C2 , typename C3>
+ struct cat<C0 , C1 , C2 , C3>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , A2 , C0 , C1 , C2 , C3)> type;
+ };
+ template<typename C0 , typename C1 , typename C2 , typename C3 , typename C4>
+ struct cat<C0 , C1 , C2 , C3 , C4>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , A2 , C0 , C1 , C2 , C3 , C4)> type;
+ };
+ template<typename C0 , typename C1 , typename C2 , typename C3 , typename C4 , typename C5>
+ struct cat<C0 , C1 , C2 , C3 , C4 , C5>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , A2 , C0 , C1 , C2 , C3 , C4 , C5)> type;
+ };
+ template<typename C0 , typename C1 , typename C2 , typename C3 , typename C4 , typename C5 , typename C6>
+ struct cat<C0 , C1 , C2 , C3 , C4 , C5 , C6>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , A2 , C0 , C1 , C2 , C3 , C4 , C5 , C6)> type;
+ };
+ };
+ template<typename Fun, typename Cont>
+ struct expand_pattern<5, Fun, Cont>
+ : Cont::template cat<typename expand_pattern_helper<proto::_child_c< 0>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 1>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 2>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 3>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 4>, Fun>::type>
+ {
+ BOOST_MPL_ASSERT_MSG(
+ (expand_pattern_helper<proto::_child_c<0>, Fun>::applied::value)
+ , NO_PACK_EXPRESSION_FOUND_IN_UNPACKING_PATTERN
+ , (Fun)
+ );
+ };
+ template<typename Ret , typename A0 , typename A1 , typename A2 , typename A3>
+ struct expand_pattern_rest_4
+ {
+ template<typename C0 = void , typename C1 = void , typename C2 = void , typename C3 = void , typename C4 = void , typename C5 = void , typename C6 = void>
+ struct cat;
+ template<typename C0>
+ struct cat<C0>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , A2 , A3 , C0)> type;
+ };
+ template<typename C0 , typename C1>
+ struct cat<C0 , C1>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , A2 , A3 , C0 , C1)> type;
+ };
+ template<typename C0 , typename C1 , typename C2>
+ struct cat<C0 , C1 , C2>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , A2 , A3 , C0 , C1 , C2)> type;
+ };
+ template<typename C0 , typename C1 , typename C2 , typename C3>
+ struct cat<C0 , C1 , C2 , C3>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , A2 , A3 , C0 , C1 , C2 , C3)> type;
+ };
+ template<typename C0 , typename C1 , typename C2 , typename C3 , typename C4>
+ struct cat<C0 , C1 , C2 , C3 , C4>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , A2 , A3 , C0 , C1 , C2 , C3 , C4)> type;
+ };
+ template<typename C0 , typename C1 , typename C2 , typename C3 , typename C4 , typename C5>
+ struct cat<C0 , C1 , C2 , C3 , C4 , C5>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , A2 , A3 , C0 , C1 , C2 , C3 , C4 , C5)> type;
+ };
+ };
+ template<typename Fun, typename Cont>
+ struct expand_pattern<6, Fun, Cont>
+ : Cont::template cat<typename expand_pattern_helper<proto::_child_c< 0>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 1>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 2>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 3>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 4>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 5>, Fun>::type>
+ {
+ BOOST_MPL_ASSERT_MSG(
+ (expand_pattern_helper<proto::_child_c<0>, Fun>::applied::value)
+ , NO_PACK_EXPRESSION_FOUND_IN_UNPACKING_PATTERN
+ , (Fun)
+ );
+ };
+ template<typename Ret , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct expand_pattern_rest_5
+ {
+ template<typename C0 = void , typename C1 = void , typename C2 = void , typename C3 = void , typename C4 = void , typename C5 = void>
+ struct cat;
+ template<typename C0>
+ struct cat<C0>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , A2 , A3 , A4 , C0)> type;
+ };
+ template<typename C0 , typename C1>
+ struct cat<C0 , C1>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , A2 , A3 , A4 , C0 , C1)> type;
+ };
+ template<typename C0 , typename C1 , typename C2>
+ struct cat<C0 , C1 , C2>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , A2 , A3 , A4 , C0 , C1 , C2)> type;
+ };
+ template<typename C0 , typename C1 , typename C2 , typename C3>
+ struct cat<C0 , C1 , C2 , C3>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , A2 , A3 , A4 , C0 , C1 , C2 , C3)> type;
+ };
+ template<typename C0 , typename C1 , typename C2 , typename C3 , typename C4>
+ struct cat<C0 , C1 , C2 , C3 , C4>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , A2 , A3 , A4 , C0 , C1 , C2 , C3 , C4)> type;
+ };
+ };
+ template<typename Fun, typename Cont>
+ struct expand_pattern<7, Fun, Cont>
+ : Cont::template cat<typename expand_pattern_helper<proto::_child_c< 0>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 1>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 2>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 3>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 4>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 5>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 6>, Fun>::type>
+ {
+ BOOST_MPL_ASSERT_MSG(
+ (expand_pattern_helper<proto::_child_c<0>, Fun>::applied::value)
+ , NO_PACK_EXPRESSION_FOUND_IN_UNPACKING_PATTERN
+ , (Fun)
+ );
+ };
+ template<typename Ret , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct expand_pattern_rest_6
+ {
+ template<typename C0 = void , typename C1 = void , typename C2 = void , typename C3 = void , typename C4 = void>
+ struct cat;
+ template<typename C0>
+ struct cat<C0>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , A2 , A3 , A4 , A5 , C0)> type;
+ };
+ template<typename C0 , typename C1>
+ struct cat<C0 , C1>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , A2 , A3 , A4 , A5 , C0 , C1)> type;
+ };
+ template<typename C0 , typename C1 , typename C2>
+ struct cat<C0 , C1 , C2>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , A2 , A3 , A4 , A5 , C0 , C1 , C2)> type;
+ };
+ template<typename C0 , typename C1 , typename C2 , typename C3>
+ struct cat<C0 , C1 , C2 , C3>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , A2 , A3 , A4 , A5 , C0 , C1 , C2 , C3)> type;
+ };
+ };
+ template<typename Fun, typename Cont>
+ struct expand_pattern<8, Fun, Cont>
+ : Cont::template cat<typename expand_pattern_helper<proto::_child_c< 0>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 1>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 2>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 3>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 4>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 5>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 6>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 7>, Fun>::type>
+ {
+ BOOST_MPL_ASSERT_MSG(
+ (expand_pattern_helper<proto::_child_c<0>, Fun>::applied::value)
+ , NO_PACK_EXPRESSION_FOUND_IN_UNPACKING_PATTERN
+ , (Fun)
+ );
+ };
+ template<typename Ret , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct expand_pattern_rest_7
+ {
+ template<typename C0 = void , typename C1 = void , typename C2 = void , typename C3 = void>
+ struct cat;
+ template<typename C0>
+ struct cat<C0>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , A2 , A3 , A4 , A5 , A6 , C0)> type;
+ };
+ template<typename C0 , typename C1>
+ struct cat<C0 , C1>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , A2 , A3 , A4 , A5 , A6 , C0 , C1)> type;
+ };
+ template<typename C0 , typename C1 , typename C2>
+ struct cat<C0 , C1 , C2>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , A2 , A3 , A4 , A5 , A6 , C0 , C1 , C2)> type;
+ };
+ };
+ template<typename Fun, typename Cont>
+ struct expand_pattern<9, Fun, Cont>
+ : Cont::template cat<typename expand_pattern_helper<proto::_child_c< 0>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 1>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 2>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 3>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 4>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 5>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 6>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 7>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 8>, Fun>::type>
+ {
+ BOOST_MPL_ASSERT_MSG(
+ (expand_pattern_helper<proto::_child_c<0>, Fun>::applied::value)
+ , NO_PACK_EXPRESSION_FOUND_IN_UNPACKING_PATTERN
+ , (Fun)
+ );
+ };
+ template<typename Ret , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct expand_pattern_rest_8
+ {
+ template<typename C0 = void , typename C1 = void , typename C2 = void>
+ struct cat;
+ template<typename C0>
+ struct cat<C0>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , C0)> type;
+ };
+ template<typename C0 , typename C1>
+ struct cat<C0 , C1>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , C0 , C1)> type;
+ };
+ };
+ template<typename Fun, typename Cont>
+ struct expand_pattern<10, Fun, Cont>
+ : Cont::template cat<typename expand_pattern_helper<proto::_child_c< 0>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 1>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 2>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 3>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 4>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 5>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 6>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 7>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 8>, Fun>::type , typename expand_pattern_helper<proto::_child_c< 9>, Fun>::type>
+ {
+ BOOST_MPL_ASSERT_MSG(
+ (expand_pattern_helper<proto::_child_c<0>, Fun>::applied::value)
+ , NO_PACK_EXPRESSION_FOUND_IN_UNPACKING_PATTERN
+ , (Fun)
+ );
+ };
+ template<typename Ret , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct expand_pattern_rest_9
+ {
+ template<typename C0 = void , typename C1 = void>
+ struct cat;
+ template<typename C0>
+ struct cat<C0>
+ {
+ typedef msvc_fun_workaround<Ret(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , C0)> type;
+ };
+ };
diff --git a/boost/proto/transform/detail/preprocessed/when.hpp b/boost/proto/transform/detail/preprocessed/when.hpp
index 51b24ef7b2..9f5acc9f6f 100644
--- a/boost/proto/transform/detail/preprocessed/when.hpp
+++ b/boost/proto/transform/detail/preprocessed/when.hpp
@@ -33,46 +33,8 @@
template<typename Grammar, typename R >
struct when<Grammar, R()>
- : transform<when<Grammar, R()> >
- {
- typedef Grammar first;
- typedef R second();
- typedef typename Grammar::proto_grammar proto_grammar;
-
-
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
- {
-
- typedef
- typename mpl::if_c<
- is_callable<R>::value
- , call<R()>
- , make<R()>
- >::type
- which;
- typedef typename which::template impl<Expr, State, Data>::result_type result_type;
-
-
-
-
-
-
-
-
-
-
- BOOST_FORCEINLINE
- result_type operator ()(
- typename impl::expr_param e
- , typename impl::state_param s
- , typename impl::data_param d
- ) const
- {
- return typename which::template impl<Expr, State, Data>()(e, s, d);
- }
- };
- };
+ : detail::when_impl<Grammar, R, R()>
+ {};
@@ -101,46 +63,38 @@
template<typename Grammar, typename R , typename A0>
struct when<Grammar, R(A0)>
- : transform<when<Grammar, R(A0)> >
- {
- typedef Grammar first;
- typedef R second(A0);
- typedef typename Grammar::proto_grammar proto_grammar;
-
-
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
- {
-
- typedef
- typename mpl::if_c<
- is_callable<R>::value
- , call<R(A0)>
- , make<R(A0)>
- >::type
- which;
- typedef typename which::template impl<Expr, State, Data>::result_type result_type;
-
-
-
-
-
-
-
-
-
-
- BOOST_FORCEINLINE
- result_type operator ()(
- typename impl::expr_param e
- , typename impl::state_param s
- , typename impl::data_param d
- ) const
- {
- return typename which::template impl<Expr, State, Data>()(e, s, d);
- }
- };
- };
+ : detail::when_impl<Grammar, R, R(A0)>
+ {};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Grammar, typename R , typename A0>
+ struct when<Grammar, R(A0...)>
+ : detail::when_impl<Grammar, R, R(A0...)>
+ {};
@@ -169,46 +123,38 @@
template<typename Grammar, typename R , typename A0 , typename A1>
struct when<Grammar, R(A0 , A1)>
- : transform<when<Grammar, R(A0 , A1)> >
- {
- typedef Grammar first;
- typedef R second(A0 , A1);
- typedef typename Grammar::proto_grammar proto_grammar;
-
-
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
- {
-
- typedef
- typename mpl::if_c<
- is_callable<R>::value
- , call<R(A0 , A1)>
- , make<R(A0 , A1)>
- >::type
- which;
- typedef typename which::template impl<Expr, State, Data>::result_type result_type;
-
-
-
-
-
-
-
-
-
-
- BOOST_FORCEINLINE
- result_type operator ()(
- typename impl::expr_param e
- , typename impl::state_param s
- , typename impl::data_param d
- ) const
- {
- return typename which::template impl<Expr, State, Data>()(e, s, d);
- }
- };
- };
+ : detail::when_impl<Grammar, R, R(A0 , A1)>
+ {};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Grammar, typename R , typename A0 , typename A1>
+ struct when<Grammar, R(A0 , A1...)>
+ : detail::when_impl<Grammar, R, R(A0 , A1...)>
+ {};
@@ -237,46 +183,38 @@
template<typename Grammar, typename R , typename A0 , typename A1 , typename A2>
struct when<Grammar, R(A0 , A1 , A2)>
- : transform<when<Grammar, R(A0 , A1 , A2)> >
- {
- typedef Grammar first;
- typedef R second(A0 , A1 , A2);
- typedef typename Grammar::proto_grammar proto_grammar;
-
-
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
- {
-
- typedef
- typename mpl::if_c<
- is_callable<R>::value
- , call<R(A0 , A1 , A2)>
- , make<R(A0 , A1 , A2)>
- >::type
- which;
- typedef typename which::template impl<Expr, State, Data>::result_type result_type;
-
-
-
-
-
-
-
-
-
-
- BOOST_FORCEINLINE
- result_type operator ()(
- typename impl::expr_param e
- , typename impl::state_param s
- , typename impl::data_param d
- ) const
- {
- return typename which::template impl<Expr, State, Data>()(e, s, d);
- }
- };
- };
+ : detail::when_impl<Grammar, R, R(A0 , A1 , A2)>
+ {};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Grammar, typename R , typename A0 , typename A1 , typename A2>
+ struct when<Grammar, R(A0 , A1 , A2...)>
+ : detail::when_impl<Grammar, R, R(A0 , A1 , A2...)>
+ {};
@@ -305,46 +243,38 @@
template<typename Grammar, typename R , typename A0 , typename A1 , typename A2 , typename A3>
struct when<Grammar, R(A0 , A1 , A2 , A3)>
- : transform<when<Grammar, R(A0 , A1 , A2 , A3)> >
- {
- typedef Grammar first;
- typedef R second(A0 , A1 , A2 , A3);
- typedef typename Grammar::proto_grammar proto_grammar;
-
-
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
- {
-
- typedef
- typename mpl::if_c<
- is_callable<R>::value
- , call<R(A0 , A1 , A2 , A3)>
- , make<R(A0 , A1 , A2 , A3)>
- >::type
- which;
- typedef typename which::template impl<Expr, State, Data>::result_type result_type;
-
-
-
-
-
-
-
-
-
-
- BOOST_FORCEINLINE
- result_type operator ()(
- typename impl::expr_param e
- , typename impl::state_param s
- , typename impl::data_param d
- ) const
- {
- return typename which::template impl<Expr, State, Data>()(e, s, d);
- }
- };
- };
+ : detail::when_impl<Grammar, R, R(A0 , A1 , A2 , A3)>
+ {};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Grammar, typename R , typename A0 , typename A1 , typename A2 , typename A3>
+ struct when<Grammar, R(A0 , A1 , A2 , A3...)>
+ : detail::when_impl<Grammar, R, R(A0 , A1 , A2 , A3...)>
+ {};
@@ -373,46 +303,38 @@
template<typename Grammar, typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
struct when<Grammar, R(A0 , A1 , A2 , A3 , A4)>
- : transform<when<Grammar, R(A0 , A1 , A2 , A3 , A4)> >
- {
- typedef Grammar first;
- typedef R second(A0 , A1 , A2 , A3 , A4);
- typedef typename Grammar::proto_grammar proto_grammar;
-
-
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
- {
-
- typedef
- typename mpl::if_c<
- is_callable<R>::value
- , call<R(A0 , A1 , A2 , A3 , A4)>
- , make<R(A0 , A1 , A2 , A3 , A4)>
- >::type
- which;
- typedef typename which::template impl<Expr, State, Data>::result_type result_type;
-
-
-
-
-
-
-
-
-
-
- BOOST_FORCEINLINE
- result_type operator ()(
- typename impl::expr_param e
- , typename impl::state_param s
- , typename impl::data_param d
- ) const
- {
- return typename which::template impl<Expr, State, Data>()(e, s, d);
- }
- };
- };
+ : detail::when_impl<Grammar, R, R(A0 , A1 , A2 , A3 , A4)>
+ {};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Grammar, typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
+ struct when<Grammar, R(A0 , A1 , A2 , A3 , A4...)>
+ : detail::when_impl<Grammar, R, R(A0 , A1 , A2 , A3 , A4...)>
+ {};
@@ -441,46 +363,38 @@
template<typename Grammar, typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
struct when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5)>
- : transform<when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5)> >
- {
- typedef Grammar first;
- typedef R second(A0 , A1 , A2 , A3 , A4 , A5);
- typedef typename Grammar::proto_grammar proto_grammar;
-
-
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
- {
-
- typedef
- typename mpl::if_c<
- is_callable<R>::value
- , call<R(A0 , A1 , A2 , A3 , A4 , A5)>
- , make<R(A0 , A1 , A2 , A3 , A4 , A5)>
- >::type
- which;
- typedef typename which::template impl<Expr, State, Data>::result_type result_type;
-
-
-
-
-
-
-
-
-
-
- BOOST_FORCEINLINE
- result_type operator ()(
- typename impl::expr_param e
- , typename impl::state_param s
- , typename impl::data_param d
- ) const
- {
- return typename which::template impl<Expr, State, Data>()(e, s, d);
- }
- };
- };
+ : detail::when_impl<Grammar, R, R(A0 , A1 , A2 , A3 , A4 , A5)>
+ {};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Grammar, typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
+ struct when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5...)>
+ : detail::when_impl<Grammar, R, R(A0 , A1 , A2 , A3 , A4 , A5...)>
+ {};
@@ -509,46 +423,38 @@
template<typename Grammar, typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
struct when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5 , A6)>
- : transform<when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5 , A6)> >
- {
- typedef Grammar first;
- typedef R second(A0 , A1 , A2 , A3 , A4 , A5 , A6);
- typedef typename Grammar::proto_grammar proto_grammar;
-
-
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
- {
-
- typedef
- typename mpl::if_c<
- is_callable<R>::value
- , call<R(A0 , A1 , A2 , A3 , A4 , A5 , A6)>
- , make<R(A0 , A1 , A2 , A3 , A4 , A5 , A6)>
- >::type
- which;
- typedef typename which::template impl<Expr, State, Data>::result_type result_type;
-
-
-
-
-
-
-
-
-
-
- BOOST_FORCEINLINE
- result_type operator ()(
- typename impl::expr_param e
- , typename impl::state_param s
- , typename impl::data_param d
- ) const
- {
- return typename which::template impl<Expr, State, Data>()(e, s, d);
- }
- };
- };
+ : detail::when_impl<Grammar, R, R(A0 , A1 , A2 , A3 , A4 , A5 , A6)>
+ {};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Grammar, typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
+ struct when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5 , A6...)>
+ : detail::when_impl<Grammar, R, R(A0 , A1 , A2 , A3 , A4 , A5 , A6...)>
+ {};
@@ -577,46 +483,38 @@
template<typename Grammar, typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
struct when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)>
- : transform<when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)> >
- {
- typedef Grammar first;
- typedef R second(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7);
- typedef typename Grammar::proto_grammar proto_grammar;
-
-
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
- {
-
- typedef
- typename mpl::if_c<
- is_callable<R>::value
- , call<R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)>
- , make<R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)>
- >::type
- which;
- typedef typename which::template impl<Expr, State, Data>::result_type result_type;
-
-
-
-
-
-
-
-
-
-
- BOOST_FORCEINLINE
- result_type operator ()(
- typename impl::expr_param e
- , typename impl::state_param s
- , typename impl::data_param d
- ) const
- {
- return typename which::template impl<Expr, State, Data>()(e, s, d);
- }
- };
- };
+ : detail::when_impl<Grammar, R, R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)>
+ {};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Grammar, typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
+ struct when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7...)>
+ : detail::when_impl<Grammar, R, R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7...)>
+ {};
@@ -645,46 +543,38 @@
template<typename Grammar, typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
struct when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)>
- : transform<when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)> >
- {
- typedef Grammar first;
- typedef R second(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8);
- typedef typename Grammar::proto_grammar proto_grammar;
-
-
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
- {
-
- typedef
- typename mpl::if_c<
- is_callable<R>::value
- , call<R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)>
- , make<R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)>
- >::type
- which;
- typedef typename which::template impl<Expr, State, Data>::result_type result_type;
-
-
-
-
-
-
-
-
-
-
- BOOST_FORCEINLINE
- result_type operator ()(
- typename impl::expr_param e
- , typename impl::state_param s
- , typename impl::data_param d
- ) const
- {
- return typename which::template impl<Expr, State, Data>()(e, s, d);
- }
- };
- };
+ : detail::when_impl<Grammar, R, R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)>
+ {};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Grammar, typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
+ struct when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8...)>
+ : detail::when_impl<Grammar, R, R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8...)>
+ {};
@@ -713,43 +603,35 @@
template<typename Grammar, typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
struct when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)>
- : transform<when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)> >
- {
- typedef Grammar first;
- typedef R second(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9);
- typedef typename Grammar::proto_grammar proto_grammar;
-
-
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
- {
-
- typedef
- typename mpl::if_c<
- is_callable<R>::value
- , call<R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)>
- , make<R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)>
- >::type
- which;
- typedef typename which::template impl<Expr, State, Data>::result_type result_type;
-
-
-
-
-
-
-
-
-
-
- BOOST_FORCEINLINE
- result_type operator ()(
- typename impl::expr_param e
- , typename impl::state_param s
- , typename impl::data_param d
- ) const
- {
- return typename which::template impl<Expr, State, Data>()(e, s, d);
- }
- };
- };
+ : detail::when_impl<Grammar, R, R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)>
+ {};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template<typename Grammar, typename R , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
+ struct when<Grammar, R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9...)>
+ : detail::when_impl<Grammar, R, R(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9...)>
+ {};
diff --git a/boost/proto/transform/detail/when.hpp b/boost/proto/transform/detail/when.hpp
index 5977eff728..136210758b 100644
--- a/boost/proto/transform/detail/when.hpp
+++ b/boost/proto/transform/detail/when.hpp
@@ -60,50 +60,41 @@
/// ObjectTransforms.
template<typename Grammar, typename R BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
struct when<Grammar, R(BOOST_PP_ENUM_PARAMS(N, A))>
- : transform<when<Grammar, R(BOOST_PP_ENUM_PARAMS(N, A))> >
- {
- typedef Grammar first;
- typedef R second(BOOST_PP_ENUM_PARAMS(N, A));
- typedef typename Grammar::proto_grammar proto_grammar;
+ : detail::when_impl<Grammar, R, R(BOOST_PP_ENUM_PARAMS(N, A))>
+ {};
- // Note: do not evaluate is_callable<R> in this scope.
- // R may be an incomplete type at this point.
-
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
- {
- // OK to evaluate is_callable<R> here. R should be compete by now.
- typedef
- typename mpl::if_c<
- is_callable<R>::value
- , call<R(BOOST_PP_ENUM_PARAMS(N, A))> // "R" is a function to call
- , make<R(BOOST_PP_ENUM_PARAMS(N, A))> // "R" is an object to construct
- >::type
- which;
-
- typedef typename which::template impl<Expr, State, Data>::result_type result_type;
-
- /// Evaluate <tt>R(A0,A1,...)</tt> as a transform either with
- /// <tt>call\<\></tt> or with <tt>make\<\></tt> depending on
- /// whether <tt>is_callable\<R\>::value</tt> is \c true or
- /// \c false.
- ///
- /// \param e The current expression
- /// \param s The current state
- /// \param d An arbitrary data
- /// \pre <tt>matches\<Expr, Grammar\>::value</tt> is \c true
- /// \return <tt>which()(e, s, d)</tt>
- BOOST_FORCEINLINE
- result_type operator ()(
- typename impl::expr_param e
- , typename impl::state_param s
- , typename impl::data_param d
- ) const
- {
- return typename which::template impl<Expr, State, Data>()(e, s, d);
- }
- };
- };
+ #if N > 0
+ /// \brief A grammar element and a PrimitiveTransform that associates
+ /// a transform with the grammar.
+ ///
+ /// Use <tt>when\<\></tt> to override a grammar's default transform
+ /// with a custom transform. It is for used when composing larger
+ /// transforms by associating smaller transforms with individual
+ /// rules in your grammar, as in the following transform which
+ /// counts the number of terminals in an expression.
+ ///
+ /// \code
+ /// // Count the terminals in an expression tree.
+ /// // Must be invoked with initial state == mpl::int_<0>().
+ /// struct CountLeaves
+ /// : or_<
+ /// when<terminal<_>, mpl::next<_state>()>
+ /// , otherwise<fold<_, _state, CountLeaves> >
+ /// >
+ /// {};
+ /// \endcode
+ ///
+ /// The <tt>when\<G, R(A0,A1,...)\></tt> form accepts either a
+ /// CallableTransform or an ObjectTransform as its second parameter.
+ /// <tt>when\<\></tt> uses <tt>is_callable\<R\>::value</tt> to
+ /// distinguish between the two, and uses <tt>call\<\></tt> to
+ /// evaluate CallableTransforms and <tt>make\<\></tt> to evaluate
+ /// ObjectTransforms.
+ template<typename Grammar, typename R BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct when<Grammar, R(BOOST_PP_ENUM_PARAMS(N, A)...)>
+ : detail::when_impl<Grammar, R, R(BOOST_PP_ENUM_PARAMS(N, A)...)>
+ {};
+ #endif
#undef N
diff --git a/boost/proto/transform/impl.hpp b/boost/proto/transform/impl.hpp
index ecb0cc6c04..80e9a624f0 100644
--- a/boost/proto/transform/impl.hpp
+++ b/boost/proto/transform/impl.hpp
@@ -12,6 +12,11 @@
#include <boost/config.hpp>
#include <boost/proto/proto_fwd.hpp>
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(push)
+# pragma warning(disable : 4714) // function 'xxx' marked as __forceinline not inlined
+#endif
+
namespace boost { namespace proto
{
#ifdef BOOST_NO_RVALUE_REFERENCES
@@ -238,4 +243,8 @@ namespace boost { namespace proto
}} // namespace boost::proto
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(pop)
+#endif
+
#endif
diff --git a/boost/proto/transform/lazy.hpp b/boost/proto/transform/lazy.hpp
index 7cdb68f921..e2d43abad1 100644
--- a/boost/proto/transform/lazy.hpp
+++ b/boost/proto/transform/lazy.hpp
@@ -16,6 +16,7 @@
#include <boost/proto/transform/make.hpp>
#include <boost/proto/transform/call.hpp>
#include <boost/proto/transform/impl.hpp>
+#include <boost/proto/transform/detail/pack.hpp>
namespace boost { namespace proto
{
@@ -38,6 +39,12 @@ namespace boost { namespace proto
{};
};
+ /// INTERNAL ONLY
+ template<typename Fun>
+ struct lazy<detail::msvc_fun_workaround<Fun> >
+ : lazy<Fun>
+ {};
+
#include <boost/proto/transform/detail/lazy.hpp>
/// INTERNAL ONLY
diff --git a/boost/proto/transform/make.hpp b/boost/proto/transform/make.hpp
index eec3292509..1f183d9343 100644
--- a/boost/proto/transform/make.hpp
+++ b/boost/proto/transform/make.hpp
@@ -29,9 +29,15 @@
#include <boost/proto/traits.hpp>
#include <boost/proto/args.hpp>
#include <boost/proto/transform/impl.hpp>
+#include <boost/proto/transform/detail/pack.hpp>
#include <boost/proto/detail/as_lvalue.hpp>
#include <boost/proto/detail/ignore_unused.hpp>
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(push)
+# pragma warning(disable : 4714) // function 'xxx' marked as __forceinline not inlined
+#endif
+
namespace boost { namespace proto
{
namespace detail
@@ -245,6 +251,12 @@ namespace boost { namespace proto
};
};
+ /// INTERNAL ONLY
+ template<typename Fun>
+ struct make<detail::msvc_fun_workaround<Fun> >
+ : make<Fun>
+ {};
+
// Other specializations generated by the preprocessor.
#include <boost/proto/transform/detail/make.hpp>
#include <boost/proto/transform/detail/make_gcc_workaround.hpp>
@@ -265,4 +277,8 @@ namespace boost { namespace proto
}}
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(pop)
+#endif
+
#endif
diff --git a/boost/proto/transform/pass_through.hpp b/boost/proto/transform/pass_through.hpp
index ac12d97e12..d53d15a840 100644
--- a/boost/proto/transform/pass_through.hpp
+++ b/boost/proto/transform/pass_through.hpp
@@ -22,6 +22,11 @@
#include <boost/proto/transform/impl.hpp>
#include <boost/proto/detail/ignore_unused.hpp>
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(push)
+# pragma warning(disable : 4714) // function 'xxx' marked as __forceinline not inlined
+#endif
+
namespace boost { namespace proto
{
namespace detail
@@ -134,4 +139,8 @@ namespace boost { namespace proto
}} // namespace boost::proto
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(pop)
+#endif
+
#endif
diff --git a/boost/proto/transform/when.hpp b/boost/proto/transform/when.hpp
index 4bbb8a7aa8..bd4cb9fa6a 100644
--- a/boost/proto/transform/when.hpp
+++ b/boost/proto/transform/when.hpp
@@ -22,8 +22,63 @@
#include <boost/proto/transform/make.hpp>
#include <boost/proto/transform/impl.hpp>
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(push)
+# pragma warning(disable : 4714) // function 'xxx' marked as __forceinline not inlined
+#endif
+
namespace boost { namespace proto
{
+ namespace detail
+ {
+ template<typename Grammar, typename R, typename Fun>
+ struct when_impl
+ : transform<when<Grammar, Fun> >
+ {
+ typedef Grammar first;
+ typedef Fun second;
+ typedef typename Grammar::proto_grammar proto_grammar;
+
+ // Note: do not evaluate is_callable<R> in this scope.
+ // R may be an incomplete type at this point.
+
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ // OK to evaluate is_callable<R> here. R should be compete by now.
+ typedef
+ typename mpl::if_c<
+ is_callable<R>::value
+ , proto::call<Fun> // "R" is a function to call
+ , proto::make<Fun> // "R" is an object to construct
+ >::type
+ which;
+
+ typedef typename which::template impl<Expr, State, Data>::result_type result_type;
+
+ /// Evaluate <tt>R(A0,A1,...)</tt> as a transform either with
+ /// <tt>call\<\></tt> or with <tt>make\<\></tt> depending on
+ /// whether <tt>is_callable\<R\>::value</tt> is \c true or
+ /// \c false.
+ ///
+ /// \param e The current expression
+ /// \param s The current state
+ /// \param d An arbitrary data
+ /// \pre <tt>matches\<Expr, Grammar\>::value</tt> is \c true
+ /// \return <tt>which()(e, s, d)</tt>
+ BOOST_FORCEINLINE
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return typename which::template impl<Expr, State, Data>()(e, s, d);
+ }
+ };
+ };
+ }
+
/// \brief A grammar element and a PrimitiveTransform that associates
/// a transform with the grammar.
///
@@ -194,4 +249,8 @@ namespace boost { namespace proto
}} // namespace boost::proto
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(pop)
+#endif
+
#endif
diff --git a/boost/python/detail/config.hpp b/boost/python/detail/config.hpp
index acafc03747..76595ebbfc 100644
--- a/boost/python/detail/config.hpp
+++ b/boost/python/detail/config.hpp
@@ -76,13 +76,13 @@
# if BOOST_PYTHON_USE_GCC_SYMBOL_VISIBILITY
# if defined(BOOST_PYTHON_SOURCE)
-# define BOOST_PYTHON_DECL __attribute__ ((visibility("default")))
+# define BOOST_PYTHON_DECL __attribute__ ((__visibility__("default")))
# define BOOST_PYTHON_BUILD_DLL
# else
# define BOOST_PYTHON_DECL
# endif
# define BOOST_PYTHON_DECL_FORWARD
-# define BOOST_PYTHON_DECL_EXCEPTION __attribute__ ((visibility("default")))
+# define BOOST_PYTHON_DECL_EXCEPTION __attribute__ ((__visibility__("default")))
# elif (defined(_WIN32) || defined(__CYGWIN__))
# if defined(BOOST_PYTHON_SOURCE)
# define BOOST_PYTHON_DECL __declspec(dllexport)
diff --git a/boost/python/extract.hpp b/boost/python/extract.hpp
index 4e876f5009..544c61f070 100644
--- a/boost/python/extract.hpp
+++ b/boost/python/extract.hpp
@@ -19,7 +19,6 @@
# include <boost/python/detail/copy_ctor_mutates_rhs.hpp>
# include <boost/python/detail/void_ptr.hpp>
# include <boost/python/detail/void_return.hpp>
-# include <boost/utility.hpp>
# include <boost/call_traits.hpp>
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) || BOOST_WORKAROUND(BOOST_INTEL_WIN, <= 900)
diff --git a/boost/python/instance_holder.hpp b/boost/python/instance_holder.hpp
index 0916348ef6..933f50d1a1 100644
--- a/boost/python/instance_holder.hpp
+++ b/boost/python/instance_holder.hpp
@@ -7,7 +7,7 @@
# include <boost/python/detail/prefix.hpp>
-# include <boost/utility.hpp>
+# include <boost/noncopyable.hpp>
# include <boost/python/type_id.hpp>
# include <cstddef>
diff --git a/boost/python/module_init.hpp b/boost/python/module_init.hpp
index 54d87e4b41..a9536c88ee 100644
--- a/boost/python/module_init.hpp
+++ b/boost/python/module_init.hpp
@@ -76,7 +76,7 @@ extern "C" __declspec(dllexport) _BOOST_PYTHON_MODULE_INIT(name)
# define BOOST_PYTHON_MODULE_INIT(name) \
void BOOST_PP_CAT(init_module_,name)(); \
-extern "C" __attribute__ ((visibility("default"))) _BOOST_PYTHON_MODULE_INIT(name)
+extern "C" __attribute__ ((__visibility__("default"))) _BOOST_PYTHON_MODULE_INIT(name)
# else
diff --git a/boost/python/object/class.hpp b/boost/python/object/class.hpp
index 6aad45e786..f57ceda7bd 100644
--- a/boost/python/object/class.hpp
+++ b/boost/python/object/class.hpp
@@ -6,7 +6,6 @@
# define CLASS_DWA20011214_HPP
# include <boost/python/detail/prefix.hpp>
-# include <boost/utility.hpp>
# include <boost/python/object_core.hpp>
# include <boost/python/type_id.hpp>
# include <cstddef>
diff --git a/boost/python/object_core.hpp b/boost/python/object_core.hpp
index 4d81e2eae8..9c9dc10bfc 100644
--- a/boost/python/object_core.hpp
+++ b/boost/python/object_core.hpp
@@ -348,12 +348,12 @@ namespace api
// Macros for forwarding constructors in classes derived from
// object. Derived classes will usually want these as an
// implementation detail
-# define BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS_(derived, base) \
- inline explicit derived(python::detail::borrowed_reference p) \
- : base(p) {} \
- inline explicit derived(python::detail::new_reference p) \
- : base(p) {} \
- inline explicit derived(python::detail::new_non_null_reference p) \
+# define BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS_(derived, base) \
+ inline explicit derived(::boost::python::detail::borrowed_reference p) \
+ : base(p) {} \
+ inline explicit derived(::boost::python::detail::new_reference p) \
+ : base(p) {} \
+ inline explicit derived(::boost::python::detail::new_non_null_reference p) \
: base(p) {}
# if !defined(BOOST_MSVC) || BOOST_MSVC >= 1300
diff --git a/boost/python/scope.hpp b/boost/python/scope.hpp
index ae9a40a383..8be3e054e0 100644
--- a/boost/python/scope.hpp
+++ b/boost/python/scope.hpp
@@ -8,7 +8,6 @@
# include <boost/python/detail/prefix.hpp>
# include <boost/python/object.hpp>
# include <boost/python/refcount.hpp>
-# include <boost/utility.hpp>
namespace boost { namespace python {
diff --git a/boost/random/detail/signed_unsigned_tools.hpp b/boost/random/detail/signed_unsigned_tools.hpp
index 3c81cf49c1..988cfb84db 100644
--- a/boost/random/detail/signed_unsigned_tools.hpp
+++ b/boost/random/detail/signed_unsigned_tools.hpp
@@ -73,7 +73,7 @@ struct add<T1, T2, /* signed */ true>
if (y >= 0)
return T2(x) + y;
// y < 0
- if (x >= T1(-(y+1))) // result >= 0 after subtraction
+ if (x > T1(-(y+1))) // result >= 0 after subtraction
// avoid the nasty two's complement edge case for y == min()
return T2(x - T1(-(y+1)) - 1);
// abs(x) < abs(y), thus T2 able to represent x
diff --git a/boost/random/discrete_distribution.hpp b/boost/random/discrete_distribution.hpp
index d6a4ede59c..bbdc055383 100644
--- a/boost/random/discrete_distribution.hpp
+++ b/boost/random/discrete_distribution.hpp
@@ -7,7 +7,7 @@
*
* See http://www.boost.org for most recent version including documentation.
*
- * $Id: discrete_distribution.hpp 71018 2011-04-05 21:27:52Z steven_watanabe $
+ * $Id: discrete_distribution.hpp 79771 2012-07-27 18:15:55Z jewillco $
*/
#ifndef BOOST_RANDOM_DISCRETE_DISTRIBUTION_HPP_INCLUDED
@@ -25,7 +25,7 @@
#include <boost/random/detail/operators.hpp>
#include <boost/random/detail/vector_io.hpp>
-#ifndef BOOST_NO_INITIALIZER_LISTS
+#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
#include <initializer_list>
#endif
@@ -69,7 +69,7 @@ public:
{
normalize();
}
-#ifndef BOOST_NO_INITIALIZER_LISTS
+#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
/**
* If wl.size() == 0, equivalent to the default constructor.
* Otherwise, the values of the @c initializer_list represent
@@ -190,7 +190,7 @@ public:
{
init(first, last);
}
-#ifndef BOOST_NO_INITIALIZER_LISTS
+#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
/**
* Constructs a @c discrete_distribution from a @c std::initializer_list.
* If the @c initializer_list is empty, equivalent to the default
diff --git a/boost/random/piecewise_constant_distribution.hpp b/boost/random/piecewise_constant_distribution.hpp
index 30339c0d19..dbeadae3a9 100644
--- a/boost/random/piecewise_constant_distribution.hpp
+++ b/boost/random/piecewise_constant_distribution.hpp
@@ -7,7 +7,7 @@
*
* See http://www.boost.org for most recent version including documentation.
*
- * $Id: piecewise_constant_distribution.hpp 71018 2011-04-05 21:27:52Z steven_watanabe $
+ * $Id: piecewise_constant_distribution.hpp 79771 2012-07-27 18:15:55Z jewillco $
*/
#ifndef BOOST_RANDOM_PIECEWISE_CONSTANT_DISTRIBUTION_HPP_INCLUDED
@@ -22,7 +22,7 @@
#include <boost/random/detail/operators.hpp>
#include <boost/random/detail/vector_io.hpp>
-#ifndef BOOST_NO_INITIALIZER_LISTS
+#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
#include <initializer_list>
#endif
@@ -84,7 +84,7 @@ public:
}
}
}
-#ifndef BOOST_NO_INITIALIZER_LISTS
+#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
/**
* Constructs a @c param_type object from an
* initializer_list containing the interval boundaries
@@ -271,7 +271,7 @@ public:
_bins.param(bins_param);
}
}
-#ifndef BOOST_NO_INITIALIZER_LISTS
+#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
/**
* Constructs a piecewise_constant_distribution from an
* initializer_list containing the interval boundaries
diff --git a/boost/random/piecewise_linear_distribution.hpp b/boost/random/piecewise_linear_distribution.hpp
index 7e67f7dd7a..b7b6860cbc 100644
--- a/boost/random/piecewise_linear_distribution.hpp
+++ b/boost/random/piecewise_linear_distribution.hpp
@@ -7,7 +7,7 @@
*
* See http://www.boost.org for most recent version including documentation.
*
- * $Id: piecewise_linear_distribution.hpp 71018 2011-04-05 21:27:52Z steven_watanabe $
+ * $Id: piecewise_linear_distribution.hpp 79771 2012-07-27 18:15:55Z jewillco $
*/
#ifndef BOOST_RANDOM_PIECEWISE_LINEAR_DISTRIBUTION_HPP_INCLUDED
@@ -24,7 +24,7 @@
#include <boost/random/detail/operators.hpp>
#include <boost/random/detail/vector_io.hpp>
-#ifndef BOOST_NO_INITIALIZER_LISTS
+#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
#include <initializer_list>
#endif
@@ -89,7 +89,7 @@ public:
}
}
}
-#ifndef BOOST_NO_INITIALIZER_LISTS
+#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
/**
* Constructs a @c param_type object from an initializer_list
* containing the interval boundaries and a unary function
@@ -278,7 +278,7 @@ public:
init();
}
}
-#ifndef BOOST_NO_INITIALIZER_LISTS
+#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
/**
* Constructs a piecewise_linear_distribution from an
* initializer_list containing the interval boundaries
diff --git a/boost/random/seed_seq.hpp b/boost/random/seed_seq.hpp
index 557b4fa2ef..44798f21bc 100644
--- a/boost/random/seed_seq.hpp
+++ b/boost/random/seed_seq.hpp
@@ -7,7 +7,7 @@
*
* See http://www.boost.org for most recent version including documentation.
*
- * $Id: seed_seq.hpp 74867 2011-10-09 23:13:31Z steven_watanabe $
+ * $Id: seed_seq.hpp 79771 2012-07-27 18:15:55Z jewillco $
*
*/
@@ -23,7 +23,7 @@
#include <algorithm>
#include <iterator>
-#ifndef BOOST_NO_INITIALIZER_LISTS
+#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
#include <initializer_list>
#endif
@@ -42,7 +42,7 @@ public:
/** Initializes a seed_seq to hold an empty sequence. */
seed_seq() {}
-#ifndef BOOST_NO_INITIALIZER_LISTS
+#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
/** Initializes the sequence from an initializer_list. */
template<class T>
seed_seq(const std::initializer_list<T>& il) : v(il.begin(), il.end()) {}
diff --git a/boost/range/algorithm/equal.hpp b/boost/range/algorithm/equal.hpp
index a3ebc294d8..4472bb19db 100644
--- a/boost/range/algorithm/equal.hpp
+++ b/boost/range/algorithm/equal.hpp
@@ -31,7 +31,7 @@ namespace boost
IteratorCategoryTag1,
IteratorCategoryTag2 )
{
- do
+ while (true)
{
// If we have reached the end of the left range then this is
// the end of the loop. They are equal if and only if we have
@@ -46,7 +46,12 @@ namespace boost
return false;
// continue looping if and only if the values are equal
- } while(*first1++ == *first2++);
+ if (*first1 != *first2)
+ break;
+
+ ++first1;
+ ++first2;
+ }
// Reaching this line in the algorithm indicates that a value
// inequality has been detected.
@@ -66,7 +71,7 @@ namespace boost
IteratorCategoryTag1,
IteratorCategoryTag2 )
{
- do
+ while (true)
{
// If we have reached the end of the left range then this is
// the end of the loop. They are equal if and only if we have
@@ -81,7 +86,12 @@ namespace boost
return false;
// continue looping if and only if the values are equal
- } while(pred(*first1++, *first2++));
+ if (!pred(*first1, *first2))
+ break;
+
+ ++first1;
+ ++first2;
+ }
// Reaching this line in the algorithm indicates that a value
// inequality has been detected.
@@ -182,7 +192,7 @@ namespace boost
}
} // namespace range
- using range::equal;
+ using ::boost::range::equal;
} // namespace boost
#endif // include guard
diff --git a/boost/range/algorithm/for_each.hpp b/boost/range/algorithm/for_each.hpp
index 12c9d4d17e..4f5108d641 100644
--- a/boost/range/algorithm/for_each.hpp
+++ b/boost/range/algorithm/for_each.hpp
@@ -14,7 +14,6 @@
#include <boost/range/end.hpp>
#include <boost/range/concepts.hpp>
#include <boost/ref.hpp>
-#include <boost/utility.hpp>
#include <algorithm>
#if BOOST_WORKAROUND(BOOST_MSVC, == 1600)
diff --git a/boost/range/algorithm_ext/copy_n.hpp b/boost/range/algorithm_ext/copy_n.hpp
index ba7ad1cfce..f8554417c5 100644
--- a/boost/range/algorithm_ext/copy_n.hpp
+++ b/boost/range/algorithm_ext/copy_n.hpp
@@ -30,15 +30,15 @@ namespace boost
///
/// \pre SinglePassRange is a model of the SinglePassRangeConcept
/// \pre OutputIterator is a model of the OutputIteratorConcept
-/// \pre 0 <= n < distance(rng)
+/// \pre 0 <= n <= distance(rng)
template< class SinglePassRange, class Size, class OutputIterator >
inline OutputIterator copy_n(const SinglePassRange& rng, Size n, OutputIterator out)
{
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange> ));
- BOOST_ASSERT( n < static_cast<Size>(boost::distance(rng)) );
+ BOOST_ASSERT( n <= static_cast<Size>(::boost::distance(rng)) );
BOOST_ASSERT( n >= static_cast<Size>(0) );
- BOOST_DEDUCED_TYPENAME range_iterator<const SinglePassRange>::type source = boost::begin(rng);
+ BOOST_DEDUCED_TYPENAME range_iterator<const SinglePassRange>::type source = ::boost::begin(rng);
for (Size i = 0; i < n; ++i, ++out, ++source)
*out = *source;
@@ -47,7 +47,7 @@ inline OutputIterator copy_n(const SinglePassRange& rng, Size n, OutputIterator
}
} // namespace range
- using range::copy_n;
+ using ::boost::range::copy_n;
} // namespace boost
#endif // include guard
diff --git a/boost/range/as_literal.hpp b/boost/range/as_literal.hpp
index f67ead7d30..9ea144d42f 100644
--- a/boost/range/as_literal.hpp
+++ b/boost/range/as_literal.hpp
@@ -74,7 +74,7 @@ namespace boost
#endif
template< class T >
- inline long is_char_ptr( T /* r */ )
+ inline long is_char_ptr( const T& /* r */ )
{
return 0L;
}
diff --git a/boost/range/counting_range.hpp b/boost/range/counting_range.hpp
index 72733a2c54..b8e4e3a7e6 100644
--- a/boost/range/counting_range.hpp
+++ b/boost/range/counting_range.hpp
@@ -18,7 +18,6 @@
#include <boost/range/iterator_range_core.hpp>
#include <boost/range/value_type.hpp>
#include <boost/iterator/counting_iterator.hpp>
-#include <boost/utility.hpp>
namespace boost
{
diff --git a/boost/range/detail/any_iterator.hpp b/boost/range/detail/any_iterator.hpp
index 107dfd6c54..5705ff010f 100644
--- a/boost/range/detail/any_iterator.hpp
+++ b/boost/range/detail/any_iterator.hpp
@@ -11,7 +11,6 @@
#define BOOST_RANGE_DETAIL_ANY_ITERATOR_HPP_INCLUDED
#include <boost/cast.hpp>
-#include <boost/utility.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/or.hpp>
#include <boost/mpl/not.hpp>
diff --git a/boost/range/detail/any_iterator_buffer.hpp b/boost/range/detail/any_iterator_buffer.hpp
index 26c14206e9..2bb5d53a42 100644
--- a/boost/range/detail/any_iterator_buffer.hpp
+++ b/boost/range/detail/any_iterator_buffer.hpp
@@ -13,7 +13,7 @@
#include <boost/array.hpp>
#include <boost/assert.hpp>
#include <boost/static_assert.hpp>
-#include <boost/utility.hpp>
+#include <boost/noncopyable.hpp>
namespace boost
{
diff --git a/boost/range/detail/join_iterator.hpp b/boost/range/detail/join_iterator.hpp
index ce864676db..bbdeec7f11 100644
--- a/boost/range/detail/join_iterator.hpp
+++ b/boost/range/detail/join_iterator.hpp
@@ -23,7 +23,7 @@
#include <boost/range/empty.hpp>
#include <boost/range/detail/demote_iterator_traversal_tag.hpp>
#include <boost/range/value_type.hpp>
-#include <boost/utility.hpp>
+#include <boost/next_prior.hpp>
namespace boost
{
diff --git a/boost/range/detail/size_type.hpp b/boost/range/detail/size_type.hpp
index ec49f4d9ef..78a60a48e9 100644
--- a/boost/range/detail/size_type.hpp
+++ b/boost/range/detail/size_type.hpp
@@ -17,52 +17,37 @@
// missing partial specialization workaround.
//////////////////////////////////////////////////////////////////////////////
-namespace boost
+namespace boost
{
- namespace range_detail
- {
+ namespace range_detail
+ {
template< typename T >
- struct range_size_type_;
-
- template<>
- struct range_size_type_<std_container_>
+ struct range_size_type_
{
template< typename C >
struct pts
{
- typedef BOOST_RANGE_DEDUCED_TYPENAME C::size_type type;
- };
- };
-
- template<>
- struct range_size_type_<std_pair_>
- {
- template< typename P >
- struct pts
- {
typedef std::size_t type;
};
};
template<>
- struct range_size_type_<array_>
+ struct range_size_type_<std_container_>
{
- template< typename A >
+ template< typename C >
struct pts
{
- typedef std::size_t type;
+ typedef BOOST_RANGE_DEDUCED_TYPENAME C::size_type type;
};
};
+ }
-
- }
-
template< typename C >
class range_size
{
typedef typename range_detail::range<C>::type c_type;
public:
- typedef typename range_detail::range_size_type_<c_type>::BOOST_NESTED_TEMPLATE pts<C>::type type;
+ typedef typename range_detail::range_size_type_<c_type>::BOOST_NESTED_TEMPLATE pts<C>::type type;
};
}
diff --git a/boost/range/has_range_iterator.hpp b/boost/range/has_range_iterator.hpp
index 432efad75c..8046eb466d 100644
--- a/boost/range/has_range_iterator.hpp
+++ b/boost/range/has_range_iterator.hpp
@@ -13,7 +13,7 @@
#include <boost/mpl/bool.hpp>
#include <boost/mpl/has_xxx.hpp>
#include <boost/range/iterator.hpp>
-#include <boost/utility.hpp>
+#include <boost/utility/enable_if.hpp>
namespace boost
{
diff --git a/boost/range/numeric.hpp b/boost/range/numeric.hpp
index b01b73aa62..bfd1049407 100644
--- a/boost/range/numeric.hpp
+++ b/boost/range/numeric.hpp
@@ -40,7 +40,7 @@ namespace boost
template< class SinglePassRange, class Value >
inline Value accumulate( const SinglePassRange& rng, Value init )
{
- BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange> ));
+ BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange> ));
return std::accumulate( boost::begin(rng), boost::end(rng), init );
}
diff --git a/boost/range/size.hpp b/boost/range/size.hpp
index 4b4eebebd9..6ae74d1176 100644
--- a/boost/range/size.hpp
+++ b/boost/range/size.hpp
@@ -18,7 +18,7 @@
#include <boost/range/config.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
-#include <boost/range/difference_type.hpp>
+#include <boost/range/size_type.hpp>
#include <boost/assert.hpp>
namespace boost
@@ -26,7 +26,7 @@ namespace boost
namespace range_detail
{
template<class SinglePassRange>
- inline BOOST_DEDUCED_TYPENAME range_difference<SinglePassRange>::type
+ inline BOOST_DEDUCED_TYPENAME range_size<const SinglePassRange>::type
range_calculate_size(const SinglePassRange& rng)
{
BOOST_ASSERT( (boost::end(rng) - boost::begin(rng)) >= 0 &&
@@ -36,7 +36,7 @@ namespace boost
}
template<class SinglePassRange>
- inline BOOST_DEDUCED_TYPENAME range_difference<SinglePassRange>::type
+ inline BOOST_DEDUCED_TYPENAME range_size<const SinglePassRange>::type
size(const SinglePassRange& rng)
{
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \
diff --git a/boost/range/size_type.hpp b/boost/range/size_type.hpp
index 8c184f87d2..c6fb54bb15 100644
--- a/boost/range/size_type.hpp
+++ b/boost/range/size_type.hpp
@@ -16,11 +16,13 @@
#endif
#include <boost/range/config.hpp>
-
+#include <boost/range/difference_type.hpp>
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
#include <boost/range/detail/size_type.hpp>
#else
+#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits/make_unsigned.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <cstddef>
#include <utility>
@@ -33,36 +35,44 @@ namespace boost
//////////////////////////////////////////////////////////////////////////
// default
//////////////////////////////////////////////////////////////////////////
-
- template< typename C >
- struct range_size
+
+ template<typename T>
+ class has_size_type
{
- typedef BOOST_DEDUCED_TYPENAME C::size_type type;
+ typedef char no_type;
+ struct yes_type { char dummy[2]; };
+
+ template<typename C>
+ static yes_type test(BOOST_DEDUCED_TYPENAME C::size_type x);
+
+ template<typename C, typename Arg>
+ static no_type test(Arg x);
+
+ public:
+ static const bool value = sizeof(test<T>(0)) == sizeof(yes_type);
};
-
- //////////////////////////////////////////////////////////////////////////
- // pair
- //////////////////////////////////////////////////////////////////////////
-
- template< typename Iterator >
- struct range_size< std::pair<Iterator,Iterator> >
+
+ template<typename C, typename Enabler=void>
+ struct range_size
{
- typedef std::size_t type;
+ typedef BOOST_DEDUCED_TYPENAME make_unsigned<
+ BOOST_DEDUCED_TYPENAME range_difference<C>::type
+ >::type type;
};
-
- //////////////////////////////////////////////////////////////////////////
- // array
- //////////////////////////////////////////////////////////////////////////
-
- template< typename T, std::size_t sz >
- struct range_size< T[sz] >
+
+ template<typename C>
+ struct range_size<
+ C,
+ BOOST_DEDUCED_TYPENAME enable_if<has_size_type<C>, void>::type
+ >
{
- typedef std::size_t type;
+ typedef BOOST_DEDUCED_TYPENAME C::size_type type;
};
+
}
template< class T >
- struct range_size :
+ struct range_size :
detail::range_size<T>
{ };
@@ -70,7 +80,7 @@ namespace boost
struct range_size<const T >
: detail::range_size<T>
{ };
-
+
} // namespace boost
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
diff --git a/boost/ratio/detail/mpl/gcd.hpp b/boost/ratio/detail/mpl/gcd.hpp
index 59a09714cd..c8258cfe70 100644
--- a/boost/ratio/detail/mpl/gcd.hpp
+++ b/boost/ratio/detail/mpl/gcd.hpp
@@ -2,8 +2,8 @@
//
// Copyright Vicente J. Botet Escriba 2010
//
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
@@ -20,6 +20,8 @@
#include <boost/mpl/aux_/config/eti.hpp>
#include <boost/mpl/aux_/config/integral.hpp>
#include <boost/mpl/aux_/config/static_constant.hpp>
+#include <boost/mpl/aux_/config/dependent_nttp.hpp>
+#include <boost/cstdint.hpp>
#if !defined(BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC_2) \
&& !defined(BOOST_MPL_PREPROCESSING_MODE) \
@@ -66,29 +68,52 @@ struct gcd_c
};
namespace aux {
- template< typename T1, T1 n1, bool n1_is_0, typename T2, T2 n2, bool n2_is_0 >
+
+ // Workaround for error: the type of partial specialization template parameter constant "n2"
+ // depends on another template parameter
+ // Note: this solution could be wrong for n1 or n2 = [2**63 .. 2**64-1]
+#if defined(BOOST_MPL_CFG_NO_DEPENDENT_NONTYPE_PARAMETER_IN_PARTIAL_SPEC)
+
+ template< typename T1, boost::intmax_t n1, bool n1_is_0
+ , typename T2, boost::intmax_t n2, bool n2_is_0 >
+ struct gcd_aux
+ : gcd_aux<T2, n2, n2==0, T1, (n1 % n2), (n1 % n2)==0>
+ {};
+
+ template <typename T1, boost::intmax_t n1, typename T2, boost::intmax_t n2>
+ struct gcd_aux<T1, n1, false, T2, n2, true> : integral_c<T1, n1>
+ {};
+
+ template <typename T1, boost::intmax_t n1, typename T2, boost::intmax_t n2, bool C>
+ struct gcd_aux<T1, n1, true, T2, n2, C> : integral_c<T2, n2>
+ {};
+
+#else // defined(BOOST_MPL_CFG_NO_DEPENDENT_NONTYPE_PARAMETER_IN_PARTIAL_SPEC)
+
+ template< typename T1, T1 n1, bool n1_is_0, typename T2, T2 n2, bool n2_is_0 >
struct gcd_aux
-
- : gcd_aux<T2, n2, n2==0,
+
+ : gcd_aux<T2, n2, n2==0,
typename aux::largest_int<T1, T2>::type,
- //~ T1,
+ //~ T1,
(n1 % n2), (n1 % n2)==0>
{};
-
+
template <typename T1, T1 n1, typename T2, T2 n2>
- struct gcd_aux<T1, n1, false, T2, n2, true> : integral_c<T1, n1>
+ struct gcd_aux<T1, n1, false, T2, n2, true> : integral_c<T1, n1>
{};
template <typename T1, T1 n1, typename T2, T2 n2, bool C>
- struct gcd_aux<T1, n1, true, T2, n2, C> : integral_c<T2, n2>
+ struct gcd_aux<T1, n1, true, T2, n2, C> : integral_c<T2, n2>
{};
+#endif // defined(BOOST_MPL_CFG_NO_DEPENDENT_NONTYPE_PARAMETER_IN_PARTIAL_SPEC)
}
template<>
struct gcd_impl<integral_c_tag, integral_c_tag>
{
template< typename N1, typename N2 > struct apply
- : abs<aux::gcd_aux< typename N1::value_type, N1::value, N1::value==0,
+ : abs<aux::gcd_aux< typename N1::value_type, N1::value, N1::value==0,
typename N2::value_type, N2::value, N2::value==0 > >
{
};
diff --git a/boost/ratio/detail/mpl/lcm.hpp b/boost/ratio/detail/mpl/lcm.hpp
index 37b4d05785..546d0e12f2 100644
--- a/boost/ratio/detail/mpl/lcm.hpp
+++ b/boost/ratio/detail/mpl/lcm.hpp
@@ -2,8 +2,8 @@
//
// Copyright Vicente J. Botet Escriba 2010
//
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
@@ -20,6 +20,8 @@
#include <boost/mpl/aux_/config/eti.hpp>
#include <boost/mpl/aux_/config/integral.hpp>
#include <boost/mpl/aux_/config/static_constant.hpp>
+#include <boost/mpl/aux_/config/dependent_nttp.hpp>
+#include <boost/cstdint.hpp>
#if !defined(BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC_2) \
&& !defined(BOOST_MPL_PREPROCESSING_MODE) \
@@ -67,28 +69,53 @@ struct lcm_c
namespace aux {
- template< typename T1, T1 n1, bool n1_is_0, typename T2, T2 n2, bool n2_is_0 >
+ // Workaround for error: the type of partial specialization template parameter constant "n2"
+ // depends on another template parameter
+ // Note: this solution could be wrong for n1 or n2 = [2**63 .. 2**64-1]
+ #if defined(BOOST_MPL_CFG_NO_DEPENDENT_NONTYPE_PARAMETER_IN_PARTIAL_SPEC)
+ template< typename T1, boost::intmax_t n1, bool n1_is_0
+ , typename T2, boost::intmax_t n2, bool n2_is_0 >
+ struct lcm_aux
+ : abs<integral_c< typename aux::largest_int<T1, T2>::type,
+ ( n1 / gcd<integral_c<T1,n1>, integral_c<T2,n2> >::value * n2 )
+ > >
+ {};
+
+ template <typename T1, boost::intmax_t n1, typename T2, boost::intmax_t n2>
+ struct lcm_aux<T1, n1, false, T2, n2, true> : integral_c<T2, 0>
+ {};
+
+ template <typename T1, boost::intmax_t n1, typename T2, boost::intmax_t n2, bool C>
+ struct lcm_aux<T1, n1, true, T2, n2, C> : integral_c<T1, 0>
+ {};
+
+
+#else // defined(BOOST_MPL_CFG_NO_DEPENDENT_NONTYPE_PARAMETER_IN_PARTIAL_SPEC)
+
+
+ template< typename T1, T1 n1, bool n1_is_0, typename T2, T2 n2, bool n2_is_0 >
struct lcm_aux
-
+
: abs<integral_c< typename aux::largest_int<T1, T2>::type,
- ( n1 / gcd<integral_c<T1,n1>, integral_c<T2,n2> >::value * n2 )
+ ( n1 / gcd<integral_c<T1,n1>, integral_c<T2,n2> >::value * n2 )
> >
{};
-
+
template <typename T1, T1 n1, typename T2, T2 n2>
- struct lcm_aux<T1, n1, false, T2, n2, true> : integral_c<T2, 0>
+ struct lcm_aux<T1, n1, false, T2, n2, true> : integral_c<T2, 0>
{};
template <typename T1, T1 n1, typename T2, T2 n2, bool C>
- struct lcm_aux<T1, n1, true, T2, n2, C> : integral_c<T1, 0>
+ struct lcm_aux<T1, n1, true, T2, n2, C> : integral_c<T1, 0>
{};
+#endif // defined(BOOST_MPL_CFG_NO_DEPENDENT_NONTYPE_PARAMETER_IN_PARTIAL_SPEC)
}
template<>
struct lcm_impl<integral_c_tag, integral_c_tag>
{
template< typename N1, typename N2 > struct apply
- : abs<aux::lcm_aux< typename N1::value_type, N1::value, N1::value==0,
+ : abs<aux::lcm_aux< typename N1::value_type, N1::value, N1::value==0,
typename N2::value_type, N2::value, N2::value==0 > >
{
};
diff --git a/boost/ratio/detail/overflow_helpers.hpp b/boost/ratio/detail/overflow_helpers.hpp
index f7cf31f762..a95467f743 100644
--- a/boost/ratio/detail/overflow_helpers.hpp
+++ b/boost/ratio/detail/overflow_helpers.hpp
@@ -273,7 +273,7 @@ namespace ratio_detail
>
>::type type;
};
-
+
template <class R, boost::intmax_t D>
struct ratio_subtract<R, ratio<0,D> >
{
@@ -322,7 +322,7 @@ namespace ratio_detail
((R2::num / gcd_n1_n2 ==1) && (R1::den / gcd_d1_d2)==1)
> type;
};
-
+
template <class T>
struct is_ratio : public boost::false_type
{};
diff --git a/boost/ratio/include.hpp b/boost/ratio/include.hpp
index 44b7b45c80..2fc13a4889 100644
--- a/boost/ratio/include.hpp
+++ b/boost/ratio/include.hpp
@@ -10,6 +10,7 @@
#include <boost/ratio/ratio.hpp>
#include <boost/ratio/ratio_io.hpp>
+#ifdef BOOST_RATIO_EXTENSIONS
#include <boost/ratio/mpl/rational_constant.hpp>
-
+#endif
#endif // BOOST_RATIO_INCLUDE_HPP
diff --git a/boost/ratio/ratio_io.hpp b/boost/ratio/ratio_io.hpp
index 9945e6bea9..1b87788ca9 100644
--- a/boost/ratio/ratio_io.hpp
+++ b/boost/ratio/ratio_io.hpp
@@ -35,6 +35,7 @@ struct ratio_string
#include <boost/config.hpp>
#include <boost/ratio/ratio.hpp>
+#include <boost/type_traits/integral_constant.hpp>
#include <string>
#include <sstream>
@@ -51,11 +52,18 @@ struct ratio_string
namespace boost {
+template <class Ratio>
+struct ratio_string_is_localizable : false_type {};
+template <class Ratio>
+struct ratio_string_id : integral_constant<int,0> {};
+
template <class Ratio, class CharT>
struct ratio_string
{
static std::basic_string<CharT> short_name() {return long_name();}
static std::basic_string<CharT> long_name();
+ static std::basic_string<CharT> symbol() {return short_name();}
+ static std::basic_string<CharT> prefix() {return long_name();}
};
template <class Ratio, class CharT>
@@ -67,6 +75,7 @@ ratio_string<Ratio, CharT>::long_name()
<< Ratio::den << CharT(']');
return os.str();
}
+
#ifdef BOOST_RATIO_HAS_STATIC_STRING
namespace ratio_detail {
template <class Ratio, class CharT>
@@ -84,10 +93,18 @@ struct ratio_string_static
typename ratio_static_string<Ratio, CharT>::long_name
>::value);
}
+ static std::basic_string<CharT> symbol() {return short_name();}
+ static std::basic_string<CharT> prefix() {return long_name();}
};
}
#endif
// atto
+template <>
+struct ratio_string_is_localizable<atto> : true_type {};
+
+template <>
+struct ratio_string_id<atto> : integral_constant<int,-18> {};
+
#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<atto, CharT> :
@@ -100,6 +117,8 @@ struct ratio_string<atto, char>
{
static std::string short_name() {return std::string(1, 'a');}
static std::string long_name() {return std::string("atto");}
+ static std::string symbol() {return short_name();}
+ static std::string prefix() {return long_name();}
};
#if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -109,6 +128,8 @@ struct ratio_string<atto, char16_t>
{
static std::u16string short_name() {return std::u16string(1, u'a');}
static std::u16string long_name() {return std::u16string(u"atto");}
+ static std::u16string symbol() {return short_name();}
+ static std::u16string prefix() {return long_name();}
};
template <>
@@ -116,6 +137,8 @@ struct ratio_string<atto, char32_t>
{
static std::u32string short_name() {return std::u32string(1, U'a');}
static std::u32string long_name() {return std::u32string(U"atto");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
};
#endif
@@ -126,12 +149,20 @@ struct ratio_string<atto, wchar_t>
{
static std::wstring short_name() {return std::wstring(1, L'a');}
static std::wstring long_name() {return std::wstring(L"atto");}
+ static std::wstring symbol() {return short_name();}
+ static std::wstring prefix() {return long_name();}
};
#endif
#endif
// femto
+template <>
+struct ratio_string_is_localizable<femto> : true_type {};
+
+template <>
+struct ratio_string_id<femto> : integral_constant<int,-15> {};
+
#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<femto, CharT> :
@@ -139,11 +170,14 @@ struct ratio_string<femto, CharT> :
{};
#else
+
template <>
struct ratio_string<femto, char>
{
static std::string short_name() {return std::string(1, 'f');}
static std::string long_name() {return std::string("femto");}
+ static std::string symbol() {return short_name();}
+ static std::string prefix() {return long_name();}
};
#if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -153,6 +187,8 @@ struct ratio_string<femto, char16_t>
{
static std::u16string short_name() {return std::u16string(1, u'f');}
static std::u16string long_name() {return std::u16string(u"femto");}
+ static std::u16string symbol() {return short_name();}
+ static std::u16string prefix() {return long_name();}
};
template <>
@@ -160,6 +196,8 @@ struct ratio_string<femto, char32_t>
{
static std::u32string short_name() {return std::u32string(1, U'f');}
static std::u32string long_name() {return std::u32string(U"femto");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
};
#endif
@@ -170,12 +208,20 @@ struct ratio_string<femto, wchar_t>
{
static std::wstring short_name() {return std::wstring(1, L'f');}
static std::wstring long_name() {return std::wstring(L"femto");}
+ static std::wstring symbol() {return short_name();}
+ static std::wstring prefix() {return long_name();}
};
#endif
#endif
// pico
+template <>
+struct ratio_string_is_localizable<pico> : true_type {};
+
+template <>
+struct ratio_string_id<pico> : integral_constant<int,-12> {};
+
#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<pico, CharT> :
@@ -188,6 +234,8 @@ struct ratio_string<pico, char>
{
static std::string short_name() {return std::string(1, 'p');}
static std::string long_name() {return std::string("pico");}
+ static std::string symbol() {return short_name();}
+ static std::string prefix() {return long_name();}
};
#if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -197,6 +245,8 @@ struct ratio_string<pico, char16_t>
{
static std::u16string short_name() {return std::u16string(1, u'p');}
static std::u16string long_name() {return std::u16string(u"pico");}
+ static std::u16string symbol() {return short_name();}
+ static std::u16string prefix() {return long_name();}
};
template <>
@@ -204,6 +254,8 @@ struct ratio_string<pico, char32_t>
{
static std::u32string short_name() {return std::u32string(1, U'p');}
static std::u32string long_name() {return std::u32string(U"pico");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
};
#endif
@@ -214,12 +266,20 @@ struct ratio_string<pico, wchar_t>
{
static std::wstring short_name() {return std::wstring(1, L'p');}
static std::wstring long_name() {return std::wstring(L"pico");}
+ static std::wstring symbol() {return short_name();}
+ static std::wstring prefix() {return long_name();}
};
#endif
#endif
// nano
+template <>
+struct ratio_string_is_localizable<nano> : true_type {};
+
+template <>
+struct ratio_string_id<nano> : integral_constant<int,-9> {};
+
#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<nano, CharT> :
@@ -232,6 +292,8 @@ struct ratio_string<nano, char>
{
static std::string short_name() {return std::string(1, 'n');}
static std::string long_name() {return std::string("nano");}
+ static std::string symbol() {return short_name();}
+ static std::string prefix() {return long_name();}
};
#if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -241,6 +303,8 @@ struct ratio_string<nano, char16_t>
{
static std::u16string short_name() {return std::u16string(1, u'n');}
static std::u16string long_name() {return std::u16string(u"nano");}
+ static std::u16string symbol() {return short_name();}
+ static std::u16string prefix() {return long_name();}
};
template <>
@@ -248,6 +312,8 @@ struct ratio_string<nano, char32_t>
{
static std::u32string short_name() {return std::u32string(1, U'n');}
static std::u32string long_name() {return std::u32string(U"nano");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
};
#endif
@@ -258,12 +324,20 @@ struct ratio_string<nano, wchar_t>
{
static std::wstring short_name() {return std::wstring(1, L'n');}
static std::wstring long_name() {return std::wstring(L"nano");}
+ static std::wstring symbol() {return short_name();}
+ static std::wstring prefix() {return long_name();}
};
#endif
#endif
// micro
+template <>
+struct ratio_string_is_localizable<micro> : true_type {};
+
+template <>
+struct ratio_string_id<micro> : integral_constant<int,-6> {};
+
#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<micro, CharT> :
@@ -276,6 +350,8 @@ struct ratio_string<micro, char>
{
static std::string short_name() {return std::string("\xC2\xB5");}
static std::string long_name() {return std::string("micro");}
+ static std::string symbol() {return short_name();}
+ static std::string prefix() {return long_name();}
};
#if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -285,6 +361,8 @@ struct ratio_string<micro, char16_t>
{
static std::u16string short_name() {return std::u16string(1, u'\xB5');}
static std::u16string long_name() {return std::u16string(u"micro");}
+ static std::u16string symbol() {return short_name();}
+ static std::u16string prefix() {return long_name();}
};
template <>
@@ -292,6 +370,8 @@ struct ratio_string<micro, char32_t>
{
static std::u32string short_name() {return std::u32string(1, U'\xB5');}
static std::u32string long_name() {return std::u32string(U"micro");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
};
#endif
@@ -302,12 +382,20 @@ struct ratio_string<micro, wchar_t>
{
static std::wstring short_name() {return std::wstring(1, L'\xB5');}
static std::wstring long_name() {return std::wstring(L"micro");}
+ static std::wstring symbol() {return short_name();}
+ static std::wstring prefix() {return long_name();}
};
#endif
#endif
// milli
+template <>
+struct ratio_string_is_localizable<milli> : true_type {};
+
+template <>
+struct ratio_string_id<milli> : integral_constant<int,-3> {};
+
#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<milli, CharT> :
@@ -320,6 +408,8 @@ struct ratio_string<milli, char>
{
static std::string short_name() {return std::string(1, 'm');}
static std::string long_name() {return std::string("milli");}
+ static std::string symbol() {return short_name();}
+ static std::string prefix() {return long_name();}
};
#if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -329,6 +419,8 @@ struct ratio_string<milli, char16_t>
{
static std::u16string short_name() {return std::u16string(1, u'm');}
static std::u16string long_name() {return std::u16string(u"milli");}
+ static std::u16string symbol() {return short_name();}
+ static std::u16string prefix() {return long_name();}
};
template <>
@@ -336,6 +428,8 @@ struct ratio_string<milli, char32_t>
{
static std::u32string short_name() {return std::u32string(1, U'm');}
static std::u32string long_name() {return std::u32string(U"milli");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
};
#endif
@@ -346,12 +440,20 @@ struct ratio_string<milli, wchar_t>
{
static std::wstring short_name() {return std::wstring(1, L'm');}
static std::wstring long_name() {return std::wstring(L"milli");}
+ static std::wstring symbol() {return short_name();}
+ static std::wstring prefix() {return long_name();}
};
#endif
#endif
// centi
+template <>
+struct ratio_string_is_localizable<centi> : true_type {};
+
+template <>
+struct ratio_string_id<centi> : integral_constant<int,-2> {};
+
#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<centi, CharT> :
@@ -364,6 +466,8 @@ struct ratio_string<centi, char>
{
static std::string short_name() {return std::string(1, 'c');}
static std::string long_name() {return std::string("centi");}
+ static std::string symbol() {return short_name();}
+ static std::string prefix() {return long_name();}
};
#if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -373,6 +477,8 @@ struct ratio_string<centi, char16_t>
{
static std::u16string short_name() {return std::u16string(1, u'c');}
static std::u16string long_name() {return std::u16string(u"centi");}
+ static std::u16string symbol() {return short_name();}
+ static std::u16string prefix() {return long_name();}
};
template <>
@@ -380,6 +486,8 @@ struct ratio_string<centi, char32_t>
{
static std::u32string short_name() {return std::u32string(1, U'c');}
static std::u32string long_name() {return std::u32string(U"centi");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
};
#endif
@@ -390,11 +498,20 @@ struct ratio_string<centi, wchar_t>
{
static std::wstring short_name() {return std::wstring(1, L'c');}
static std::wstring long_name() {return std::wstring(L"centi");}
+ static std::wstring symbol() {return short_name();}
+ static std::wstring prefix() {return long_name();}
};
#endif
#endif
// deci
+
+template <>
+struct ratio_string_is_localizable<deci> : true_type {};
+
+template <>
+struct ratio_string_id<deci> : integral_constant<int,-1> {};
+
#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<deci, CharT> :
@@ -408,6 +525,8 @@ struct ratio_string<deci, char>
{
static std::string short_name() {return std::string(1, 'd');}
static std::string long_name() {return std::string("deci");}
+ static std::string symbol() {return short_name();}
+ static std::string prefix() {return long_name();}
};
#if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -417,6 +536,8 @@ struct ratio_string<deci, char16_t>
{
static std::u16string short_name() {return std::u16string(1, u'd');}
static std::u16string long_name() {return std::u16string(u"deci");}
+ static std::u16string symbol() {return short_name();}
+ static std::u16string prefix() {return long_name();}
};
template <>
@@ -424,6 +545,8 @@ struct ratio_string<deci, char32_t>
{
static std::u32string short_name() {return std::u32string(1, U'd');}
static std::u32string long_name() {return std::u32string(U"deci");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
};
#endif
@@ -434,12 +557,27 @@ struct ratio_string<deci, wchar_t>
{
static std::wstring short_name() {return std::wstring(1, L'd');}
static std::wstring long_name() {return std::wstring(L"deci");}
+ static std::wstring symbol() {return short_name();}
+ static std::wstring prefix() {return long_name();}
};
#endif
#endif
+// unit
+
+template <>
+struct ratio_string_is_localizable<ratio<1> > : true_type {};
+
+template <>
+struct ratio_string_id<ratio<1> > : integral_constant<int,0> {};
// deca
+template <>
+struct ratio_string_is_localizable<deca> : true_type {};
+
+template <>
+struct ratio_string_id<deca> : integral_constant<int,1> {};
+
#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<deca, CharT> :
@@ -452,6 +590,8 @@ struct ratio_string<deca, char>
{
static std::string short_name() {return std::string("da");}
static std::string long_name() {return std::string("deca");}
+ static std::string symbol() {return short_name();}
+ static std::string prefix() {return long_name();}
};
#if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -461,6 +601,8 @@ struct ratio_string<deca, char16_t>
{
static std::u16string short_name() {return std::u16string(u"da");}
static std::u16string long_name() {return std::u16string(u"deca");}
+ static std::u16string symbol() {return short_name();}
+ static std::u16string prefix() {return long_name();}
};
template <>
@@ -468,6 +610,8 @@ struct ratio_string<deca, char32_t>
{
static std::u32string short_name() {return std::u32string(U"da");}
static std::u32string long_name() {return std::u32string(U"deca");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
};
#endif
@@ -478,12 +622,21 @@ struct ratio_string<deca, wchar_t>
{
static std::wstring short_name() {return std::wstring(L"da");}
static std::wstring long_name() {return std::wstring(L"deca");}
+ static std::wstring symbol() {return short_name();}
+ static std::wstring prefix() {return long_name();}
};
#endif
#endif
// hecto
+template <>
+struct ratio_string_is_localizable<hecto> : true_type {};
+
+template <>
+struct ratio_string_id<hecto> : integral_constant<int,2> {};
+
+
#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<hecto, CharT> :
@@ -496,6 +649,8 @@ struct ratio_string<hecto, char>
{
static std::string short_name() {return std::string(1, 'h');}
static std::string long_name() {return std::string("hecto");}
+ static std::string symbol() {return short_name();}
+ static std::string prefix() {return long_name();}
};
#if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -505,6 +660,8 @@ struct ratio_string<hecto, char16_t>
{
static std::u16string short_name() {return std::u16string(1, u'h');}
static std::u16string long_name() {return std::u16string(u"hecto");}
+ static std::u16string symbol() {return short_name();}
+ static std::u16string prefix() {return long_name();}
};
template <>
@@ -512,6 +669,8 @@ struct ratio_string<hecto, char32_t>
{
static std::u32string short_name() {return std::u32string(1, U'h');}
static std::u32string long_name() {return std::u32string(U"hecto");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
};
#endif
@@ -522,12 +681,20 @@ struct ratio_string<hecto, wchar_t>
{
static std::wstring short_name() {return std::wstring(1, L'h');}
static std::wstring long_name() {return std::wstring(L"hecto");}
+ static std::wstring symbol() {return short_name();}
+ static std::wstring prefix() {return long_name();}
};
#endif
#endif
// kilo
+template <>
+struct ratio_string_is_localizable<kilo> : true_type {};
+
+template <>
+struct ratio_string_id<kilo> : integral_constant<int,3> {};
+
#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<kilo, CharT> :
@@ -540,6 +707,8 @@ struct ratio_string<kilo, char>
{
static std::string short_name() {return std::string(1, 'k');}
static std::string long_name() {return std::string("kilo");}
+ static std::string symbol() {return short_name();}
+ static std::string prefix() {return long_name();}
};
#if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -549,6 +718,8 @@ struct ratio_string<kilo, char16_t>
{
static std::u16string short_name() {return std::u16string(1, u'k');}
static std::u16string long_name() {return std::u16string(u"kilo");}
+ static std::u16string symbol() {return short_name();}
+ static std::u16string prefix() {return long_name();}
};
template <>
@@ -556,6 +727,8 @@ struct ratio_string<kilo, char32_t>
{
static std::u32string short_name() {return std::u32string(1, U'k');}
static std::u32string long_name() {return std::u32string(U"kilo");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
};
#endif
@@ -566,12 +739,20 @@ struct ratio_string<kilo, wchar_t>
{
static std::wstring short_name() {return std::wstring(1, L'k');}
static std::wstring long_name() {return std::wstring(L"kilo");}
+ static std::wstring symbol() {return short_name();}
+ static std::wstring prefix() {return long_name();}
};
#endif
#endif
// mega
+template <>
+struct ratio_string_is_localizable<mega> : true_type {};
+
+template <>
+struct ratio_string_id<mega> : integral_constant<int,6> {};
+
#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<mega, CharT> :
@@ -585,6 +766,8 @@ struct ratio_string<mega, char>
{
static std::string short_name() {return std::string(1, 'M');}
static std::string long_name() {return std::string("mega");}
+ static std::string symbol() {return short_name();}
+ static std::string prefix() {return long_name();}
};
#if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -594,6 +777,8 @@ struct ratio_string<mega, char16_t>
{
static std::u16string short_name() {return std::u16string(1, u'M');}
static std::u16string long_name() {return std::u16string(u"mega");}
+ static std::u16string symbol() {return short_name();}
+ static std::u16string prefix() {return long_name();}
};
template <>
@@ -601,6 +786,8 @@ struct ratio_string<mega, char32_t>
{
static std::u32string short_name() {return std::u32string(1, U'M');}
static std::u32string long_name() {return std::u32string(U"mega");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
};
#endif
@@ -611,11 +798,20 @@ struct ratio_string<mega, wchar_t>
{
static std::wstring short_name() {return std::wstring(1, L'M');}
static std::wstring long_name() {return std::wstring(L"mega");}
+ static std::wstring symbol() {return short_name();}
+ static std::wstring prefix() {return long_name();}
};
#endif
#endif
// giga
+
+template <>
+struct ratio_string_is_localizable<giga> : true_type {};
+
+template <>
+struct ratio_string_id<giga> : integral_constant<int,9> {};
+
#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<giga, CharT> :
@@ -629,6 +825,8 @@ struct ratio_string<giga, char>
{
static std::string short_name() {return std::string(1, 'G');}
static std::string long_name() {return std::string("giga");}
+ static std::string symbol() {return short_name();}
+ static std::string prefix() {return long_name();}
};
#if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -638,6 +836,8 @@ struct ratio_string<giga, char16_t>
{
static std::u16string short_name() {return std::u16string(1, u'G');}
static std::u16string long_name() {return std::u16string(u"giga");}
+ static std::u16string symbol() {return short_name();}
+ static std::u16string prefix() {return long_name();}
};
template <>
@@ -645,6 +845,8 @@ struct ratio_string<giga, char32_t>
{
static std::u32string short_name() {return std::u32string(1, U'G');}
static std::u32string long_name() {return std::u32string(U"giga");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
};
#endif
@@ -655,11 +857,20 @@ struct ratio_string<giga, wchar_t>
{
static std::wstring short_name() {return std::wstring(1, L'G');}
static std::wstring long_name() {return std::wstring(L"giga");}
+ static std::wstring symbol() {return short_name();}
+ static std::wstring prefix() {return long_name();}
};
#endif
#endif
// tera
+
+template <>
+struct ratio_string_is_localizable<tera> : true_type {};
+
+template <>
+struct ratio_string_id<tera> : integral_constant<int,12> {};
+
#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<tera, CharT> :
@@ -672,6 +883,8 @@ struct ratio_string<tera, char>
{
static std::string short_name() {return std::string(1, 'T');}
static std::string long_name() {return std::string("tera");}
+ static std::string symbol() {return short_name();}
+ static std::string prefix() {return long_name();}
};
#if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -681,6 +894,8 @@ struct ratio_string<tera, char16_t>
{
static std::u16string short_name() {return std::u16string(1, u'T');}
static std::u16string long_name() {return std::u16string(u"tera");}
+ static std::u16string symbol() {return short_name();}
+ static std::u16string prefix() {return long_name();}
};
template <>
@@ -688,6 +903,8 @@ struct ratio_string<tera, char32_t>
{
static std::u32string short_name() {return std::u32string(1, U'T');}
static std::u32string long_name() {return std::u32string(U"tera");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
};
#endif
@@ -698,11 +915,21 @@ struct ratio_string<tera, wchar_t>
{
static std::wstring short_name() {return std::wstring(1, L'T');}
static std::wstring long_name() {return std::wstring(L"tera");}
+ static std::wstring symbol() {return short_name();}
+ static std::wstring prefix() {return long_name();}
};
#endif
#endif
// peta
+
+template <>
+struct ratio_string_is_localizable<peta> : true_type {};
+
+template <>
+struct ratio_string_id<peta> : integral_constant<int,15> {};
+
+
#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<peta, CharT> :
@@ -715,6 +942,8 @@ struct ratio_string<peta, char>
{
static std::string short_name() {return std::string(1, 'P');}
static std::string long_name() {return std::string("peta");}
+ static std::string symbol() {return short_name();}
+ static std::string prefix() {return long_name();}
};
#if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -724,6 +953,8 @@ struct ratio_string<peta, char16_t>
{
static std::u16string short_name() {return std::u16string(1, u'P');}
static std::u16string long_name() {return std::u16string(u"peta");}
+ static std::u16string symbol() {return short_name();}
+ static std::u16string prefix() {return long_name();}
};
template <>
@@ -731,6 +962,8 @@ struct ratio_string<peta, char32_t>
{
static std::u32string short_name() {return std::u32string(1, U'P');}
static std::u32string long_name() {return std::u32string(U"peta");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
};
#endif
@@ -741,11 +974,20 @@ struct ratio_string<peta, wchar_t>
{
static std::wstring short_name() {return std::wstring(1, L'P');}
static std::wstring long_name() {return std::wstring(L"peta");}
+ static std::wstring symbol() {return short_name();}
+ static std::wstring prefix() {return long_name();}
};
#endif
#endif
// exa
+
+template <>
+struct ratio_string_is_localizable<exa> : true_type {};
+
+template <>
+struct ratio_string_id<exa> : integral_constant<int,18> {};
+
#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<exa, CharT> :
@@ -758,6 +1000,8 @@ struct ratio_string<exa, char>
{
static std::string short_name() {return std::string(1, 'E');}
static std::string long_name() {return std::string("exa");}
+ static std::string symbol() {return short_name();}
+ static std::string prefix() {return long_name();}
};
#if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -767,6 +1011,8 @@ struct ratio_string<exa, char16_t>
{
static std::u16string short_name() {return std::u16string(1, u'E');}
static std::u16string long_name() {return std::u16string(u"exa");}
+ static std::u16string symbol() {return short_name();}
+ static std::u16string prefix() {return long_name();}
};
template <>
@@ -774,6 +1020,8 @@ struct ratio_string<exa, char32_t>
{
static std::u32string short_name() {return std::u32string(1, U'E');}
static std::u32string long_name() {return std::u32string(U"exa");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
};
#endif
@@ -784,6 +1032,8 @@ struct ratio_string<exa, wchar_t>
{
static std::wstring short_name() {return std::wstring(1, L'E');}
static std::wstring long_name() {return std::wstring(L"exa");}
+ static std::wstring symbol() {return short_name();}
+ static std::wstring prefix() {return long_name();}
};
#endif
#endif
diff --git a/boost/regex/concepts.hpp b/boost/regex/concepts.hpp
index f3ca53d464..e974d69912 100644
--- a/boost/regex/concepts.hpp
+++ b/boost/regex/concepts.hpp
@@ -63,6 +63,8 @@ struct char_architype
// conversion to integral type:
operator long()const;
};
+inline long hash_value(char_architype val)
+{ return val; }
//
// char_architype can not be used with basic_string:
//
diff --git a/boost/regex/config.hpp b/boost/regex/config.hpp
index 6b7db45dc0..e8cec5b7fa 100644
--- a/boost/regex/config.hpp
+++ b/boost/regex/config.hpp
@@ -170,7 +170,10 @@
# define BOOST_REGEX_HAS_OTHER_WCHAR_T
# ifdef BOOST_MSVC
# pragma warning(push)
-# pragma warning(disable : 4251 4231 4660)
+# pragma warning(disable : 4251 4231)
+# if BOOST_MSVC < 1600
+# pragma warning(disable : 4660)
+# endif
# endif
# if defined(_DLL) && defined(BOOST_MSVC) && (BOOST_MSVC < 1600)
# include <string>
diff --git a/boost/regex/pending/object_cache.hpp b/boost/regex/pending/object_cache.hpp
index 05b6bfa24a..d47fbba9cd 100644
--- a/boost/regex/pending/object_cache.hpp
+++ b/boost/regex/pending/object_cache.hpp
@@ -151,7 +151,7 @@ boost::shared_ptr<Object const> object_cache<Key, Object>::do_get(const Key& k,
--s;
}
else
- --pos;
+ ++pos;
}
BOOST_ASSERT(s_data.index[k]->first.get() == result.get());
BOOST_ASSERT(&(s_data.index.find(k)->first) == s_data.cont.back().second);
diff --git a/boost/regex/v4/basic_regex.hpp b/boost/regex/v4/basic_regex.hpp
index 1e71877ef4..0b63e3aa37 100644
--- a/boost/regex/v4/basic_regex.hpp
+++ b/boost/regex/v4/basic_regex.hpp
@@ -36,7 +36,10 @@
namespace boost{
#ifdef BOOST_MSVC
#pragma warning(push)
-#pragma warning(disable : 4251 4231 4660 4800)
+#pragma warning(disable : 4251 4231 4800)
+#if BOOST_MSVC < 1600
+#pragma warning(disable : 4660)
+#endif
#endif
namespace re_detail{
@@ -243,11 +246,11 @@ public:
// begin, end:
const_iterator BOOST_REGEX_CALL begin()const
{
- return (!this->m_status ? 0 : this->m_expression);
+ return (this->m_status ? 0 : this->m_expression);
}
const_iterator BOOST_REGEX_CALL end()const
{
- return (!this->m_status ? 0 : this->m_expression + this->m_expression_len);
+ return (this->m_status ? 0 : this->m_expression + this->m_expression_len);
}
flag_type BOOST_REGEX_CALL flags()const
{
diff --git a/boost/regex/v4/basic_regex_creator.hpp b/boost/regex/v4/basic_regex_creator.hpp
index c4b1c048d0..efb649cd79 100644
--- a/boost/regex/v4/basic_regex_creator.hpp
+++ b/boost/regex/v4/basic_regex_creator.hpp
@@ -66,7 +66,7 @@ class basic_char_set
public:
typedef digraph<charT> digraph_type;
typedef typename traits::string_type string_type;
- typedef typename traits::char_class_type mask_type;
+ typedef typename traits::char_class_type m_type;
basic_char_set()
{
@@ -100,12 +100,12 @@ public:
}
m_empty = false;
}
- void add_class(mask_type m)
+ void add_class(m_type m)
{
m_classes |= m;
m_empty = false;
}
- void add_negated_class(mask_type m)
+ void add_negated_class(m_type m)
{
m_negated_classes |= m;
m_empty = false;
@@ -162,11 +162,11 @@ public:
{
return m_equivalents.end();
}
- mask_type classes()const
+ m_type classes()const
{
return m_classes;
}
- mask_type negated_classes()const
+ m_type negated_classes()const
{
return m_negated_classes;
}
@@ -179,8 +179,8 @@ private:
std::vector<digraph_type> m_ranges; // a list of end points of our ranges
bool m_negate; // true if the set is to be negated
bool m_has_digraphs; // true if we have digraphs present
- mask_type m_classes; // character classes to match
- mask_type m_negated_classes; // negated character classes to match
+ m_type m_classes; // character classes to match
+ m_type m_negated_classes; // negated character classes to match
bool m_empty; // whether we've added anything yet
std::vector<digraph_type> m_equivalents; // a list of equivalence classes
};
@@ -367,9 +367,9 @@ re_syntax_base* basic_regex_creator<charT, traits>::append_set(
{
typedef typename traits::string_type string_type;
typedef typename basic_char_set<charT, traits>::list_iterator item_iterator;
- typedef typename traits::char_class_type mask_type;
+ typedef typename traits::char_class_type m_type;
- re_set_long<mask_type>* result = static_cast<re_set_long<mask_type>*>(append_state(syntax_element_long_set, sizeof(re_set_long<mask_type>)));
+ re_set_long<m_type>* result = static_cast<re_set_long<m_type>*>(append_state(syntax_element_long_set, sizeof(re_set_long<m_type>)));
//
// fill in the basics:
//
@@ -513,28 +513,23 @@ re_syntax_base* basic_regex_creator<charT, traits>::append_set(
//
// finally reset the address of our last state:
//
- m_last_state = result = static_cast<re_set_long<mask_type>*>(getaddress(offset));
+ m_last_state = result = static_cast<re_set_long<m_type>*>(getaddress(offset));
return result;
}
-namespace{
-
template<class T>
inline bool char_less(T t1, T t2)
{
return t1 < t2;
}
-template<>
-inline bool char_less<char>(char t1, char t2)
+inline bool char_less(char t1, char t2)
{
return static_cast<unsigned char>(t1) < static_cast<unsigned char>(t2);
}
-template<>
-inline bool char_less<signed char>(signed char t1, signed char t2)
+inline bool char_less(signed char t1, signed char t2)
{
return static_cast<unsigned char>(t1) < static_cast<unsigned char>(t2);
}
-}
template <class charT, class traits>
re_syntax_base* basic_regex_creator<charT, traits>::append_set(
@@ -598,7 +593,7 @@ re_syntax_base* basic_regex_creator<charT, traits>::append_set(
}
else
{
- if(char_less<charT>(c2, c1))
+ if(char_less(c2, c1))
{
// Oops error:
return 0;
@@ -610,8 +605,8 @@ re_syntax_base* basic_regex_creator<charT, traits>::append_set(
//
// and now the classes:
//
- typedef typename traits::char_class_type mask_type;
- mask_type m = char_set.classes();
+ typedef typename traits::char_class_type m_type;
+ m_type m = char_set.classes();
if(flags() & regbase::icase)
{
// adjust m as needed:
@@ -982,7 +977,7 @@ void basic_regex_creator<charT, traits>::create_startmaps(re_syntax_base* state)
template <class charT, class traits>
int basic_regex_creator<charT, traits>::calculate_backstep(re_syntax_base* state)
{
- typedef typename traits::char_class_type mask_type;
+ typedef typename traits::char_class_type m_type;
int result = 0;
while(state)
{
@@ -1035,10 +1030,10 @@ int basic_regex_creator<charT, traits>::calculate_backstep(re_syntax_base* state
state = rep->alt.p;
continue;
}
- else if((state->type == syntax_element_long_set_rep))
+ else if(state->type == syntax_element_long_set_rep)
{
BOOST_ASSERT(rep->next.p->type == syntax_element_long_set);
- if(static_cast<re_set_long<mask_type>*>(rep->next.p)->singleton == 0)
+ if(static_cast<re_set_long<m_type>*>(rep->next.p)->singleton == 0)
return -1;
if(rep->max != rep->min)
return -1;
@@ -1049,7 +1044,7 @@ int basic_regex_creator<charT, traits>::calculate_backstep(re_syntax_base* state
}
return -1;
case syntax_element_long_set:
- if(static_cast<re_set_long<mask_type>*>(state)->singleton == 0)
+ if(static_cast<re_set_long<m_type>*>(state)->singleton == 0)
return -1;
result += 1;
break;
@@ -1113,9 +1108,9 @@ void basic_regex_creator<charT, traits>::create_startmap(re_syntax_base* state,
if(l_map)
{
l_map[0] |= mask_init;
- l_map['\n'] |= mask;
- l_map['\r'] |= mask;
- l_map['\f'] |= mask;
+ l_map[static_cast<unsigned>('\n')] |= mask;
+ l_map[static_cast<unsigned>('\r')] |= mask;
+ l_map[static_cast<unsigned>('\f')] |= mask;
l_map[0x85] |= mask;
}
// now figure out if we can match a NULL string at this point:
@@ -1219,14 +1214,14 @@ void basic_regex_creator<charT, traits>::create_startmap(re_syntax_base* state,
case syntax_element_long_set:
if(l_map)
{
- typedef typename traits::char_class_type mask_type;
- if(static_cast<re_set_long<mask_type>*>(state)->singleton)
+ typedef typename traits::char_class_type m_type;
+ if(static_cast<re_set_long<m_type>*>(state)->singleton)
{
l_map[0] |= mask_init;
for(unsigned int i = 0; i < (1u << CHAR_BIT); ++i)
{
charT c = static_cast<charT>(i);
- if(&c != re_is_set_member(&c, &c + 1, static_cast<re_set_long<mask_type>*>(state), *m_pdata, l_icase))
+ if(&c != re_is_set_member(&c, &c + 1, static_cast<re_set_long<m_type>*>(state), *m_pdata, l_icase))
l_map[i] |= mask;
}
}
@@ -1302,8 +1297,8 @@ void basic_regex_creator<charT, traits>::create_startmap(re_syntax_base* state,
if(l_map)
{
l_map[0] |= mask_init;
- l_map['\n'] |= mask;
- l_map['\r'] |= mask;
+ l_map[static_cast<unsigned>('\n')] |= mask;
+ l_map[static_cast<unsigned>('\r')] |= mask;
}
if(pnull)
*pnull |= mask;
@@ -1338,7 +1333,7 @@ void basic_regex_creator<charT, traits>::create_startmap(re_syntax_base* state,
re_syntax_base* p = m_pdata->m_first_state;
while(p)
{
- if((p->type == syntax_element_recurse))
+ if(p->type == syntax_element_recurse)
{
re_brace* p2 = static_cast<re_brace*>(static_cast<re_jump*>(p)->alt.p);
if((p2->type == syntax_element_startmark) && (p2->index == static_cast<re_brace*>(state)->index))
@@ -1469,7 +1464,7 @@ void basic_regex_creator<charT, traits>::set_bad_repeat(re_syntax_base* pt)
template <class charT, class traits>
syntax_element_type basic_regex_creator<charT, traits>::get_repeat_type(re_syntax_base* state)
{
- typedef typename traits::char_class_type mask_type;
+ typedef typename traits::char_class_type m_type;
if(state->type == syntax_element_rep)
{
// check to see if we are repeating a single state:
@@ -1484,7 +1479,7 @@ syntax_element_type basic_regex_creator<charT, traits>::get_repeat_type(re_synta
case re_detail::syntax_element_set:
return re_detail::syntax_element_short_set_rep;
case re_detail::syntax_element_long_set:
- if(static_cast<re_detail::re_set_long<mask_type>*>(state->next.p)->singleton)
+ if(static_cast<re_detail::re_set_long<m_type>*>(state->next.p)->singleton)
return re_detail::syntax_element_long_set_rep;
break;
default:
diff --git a/boost/regex/v4/basic_regex_parser.hpp b/boost/regex/v4/basic_regex_parser.hpp
index f524673d20..72dc4eeb4c 100644
--- a/boost/regex/v4/basic_regex_parser.hpp
+++ b/boost/regex/v4/basic_regex_parser.hpp
@@ -191,6 +191,7 @@ void basic_regex_parser<charT, traits>::fail(regex_constants::error_type error_c
this->m_pdata->m_status = error_code;
m_position = m_end; // don't bother parsing anything else
+#ifndef BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
//
// Augment error message with the regular expression text:
//
@@ -211,6 +212,7 @@ void basic_regex_parser<charT, traits>::fail(regex_constants::error_type error_c
}
message += "'.";
}
+#endif
#ifndef BOOST_NO_EXCEPTIONS
if(0 == (this->flags() & regex_constants::no_except))
@@ -660,6 +662,11 @@ template <class charT, class traits>
bool basic_regex_parser<charT, traits>::parse_extended_escape()
{
++m_position;
+ if(m_position == m_end)
+ {
+ fail(regex_constants::error_escape, m_position - m_base, "Incomplete escape sequence found.");
+ return false;
+ }
bool negate = false; // in case this is a character class escape: \w \d etc
switch(this->m_traits.escape_syntax_type(*m_position))
{
@@ -669,8 +676,8 @@ bool basic_regex_parser<charT, traits>::parse_extended_escape()
case regex_constants::escape_type_class:
{
escape_type_class_jump:
- typedef typename traits::char_class_type mask_type;
- mask_type m = this->m_traits.lookup_classname(m_position, m_position+1);
+ typedef typename traits::char_class_type m_type;
+ m_type m = this->m_traits.lookup_classname(m_position, m_position+1);
if(m != 0)
{
basic_char_set<charT, traits> char_set;
@@ -1383,8 +1390,8 @@ bool basic_regex_parser<charT, traits>::parse_inner_set(basic_char_set<charT, tr
++name_first;
negated = true;
}
- typedef typename traits::char_class_type mask_type;
- mask_type m = this->m_traits.lookup_classname(name_first, name_last);
+ typedef typename traits::char_class_type m_type;
+ m_type m = this->m_traits.lookup_classname(name_first, name_last);
if(m == 0)
{
if(char_set.empty() && (name_last - name_first == 1))
@@ -2089,6 +2096,14 @@ insert_recursion:
return false;
}
v = this->m_traits.toi(m_position, m_end, 10);
+ if(m_position == m_end)
+ {
+ // Rewind to start of (? sequence:
+ --m_position;
+ while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
+ fail(regex_constants::error_perl_extension, m_position - m_base);
+ return false;
+ }
if(*m_position == charT('R'))
{
if(++m_position == m_end)
@@ -2492,9 +2507,11 @@ option_group_jump:
this->m_pdata->m_data.align();
re_jump* jmp = static_cast<re_jump*>(this->getaddress(jump_offset));
jmp->alt.i = this->m_pdata->m_data.size() - this->getoffset(jmp);
- if(this->m_last_state == jmp)
+ if((this->m_last_state == jmp) && (markid != -2))
{
- // Oops... we didn't have anything inside the assertion:
+ // Oops... we didn't have anything inside the assertion.
+ // Note we don't get here for negated forward lookahead as (?!)
+ // does have some uses.
// Rewind to start of (? sequence:
--m_position;
while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
diff --git a/boost/regex/v4/instances.hpp b/boost/regex/v4/instances.hpp
index c62d136fff..2839c0b775 100644
--- a/boost/regex/v4/instances.hpp
+++ b/boost/regex/v4/instances.hpp
@@ -84,7 +84,10 @@ template class BOOST_REGEX_DECL ::boost::re_detail::perl_matcher<BOOST_REGEX_CHA
# ifdef BOOST_MSVC
# pragma warning(push)
-# pragma warning(disable : 4251 4231 4660)
+# pragma warning(disable : 4251 4231)
+# if BOOST_MSVC < 1600
+# pragma warning(disable : 4660)
+# endif
# endif
template class BOOST_REGEX_TEMPLATE_DECL basic_regex< BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >;
diff --git a/boost/regex/v4/match_results.hpp b/boost/regex/v4/match_results.hpp
index ca9898f4c4..63e5117592 100644
--- a/boost/regex/v4/match_results.hpp
+++ b/boost/regex/v4/match_results.hpp
@@ -33,7 +33,10 @@
namespace boost{
#ifdef BOOST_MSVC
#pragma warning(push)
-#pragma warning(disable : 4251 4231 4660)
+#pragma warning(disable : 4251 4231)
+# if BOOST_MSVC < 1600
+# pragma warning(disable : 4660)
+# endif
#endif
namespace re_detail{
diff --git a/boost/regex/v4/perl_matcher.hpp b/boost/regex/v4/perl_matcher.hpp
index 52cc55cc68..ddaafbd7e4 100644
--- a/boost/regex/v4/perl_matcher.hpp
+++ b/boost/regex/v4/perl_matcher.hpp
@@ -344,7 +344,10 @@ struct recursion_info
#ifdef BOOST_MSVC
#pragma warning(push)
-#pragma warning(disable : 4251 4231 4660)
+#pragma warning(disable : 4251 4231)
+# if BOOST_MSVC < 1600
+# pragma warning(disable : 4660)
+# endif
#endif
template <class BidiIterator, class Allocator, class traits>
diff --git a/boost/regex/v4/perl_matcher_non_recursive.hpp b/boost/regex/v4/perl_matcher_non_recursive.hpp
index 7ab678170b..0da43e309e 100644
--- a/boost/regex/v4/perl_matcher_non_recursive.hpp
+++ b/boost/regex/v4/perl_matcher_non_recursive.hpp
@@ -828,9 +828,9 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_long_set_repeat()
#ifdef __BORLANDC__
#pragma option push -w-8008 -w-8066 -w-8004
#endif
- typedef typename traits::char_class_type mask_type;
+ typedef typename traits::char_class_type m_type;
const re_repeat* rep = static_cast<const re_repeat*>(pstate);
- const re_set_long<mask_type>* set = static_cast<const re_set_long<mask_type>*>(pstate->next.p);
+ const re_set_long<m_type>* set = static_cast<const re_set_long<m_type>*>(pstate->next.p);
std::size_t count = 0;
//
// start by working out how much we can skip:
@@ -1434,7 +1434,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_short_set_repeat(bool
template <class BidiIterator, class Allocator, class traits>
bool perl_matcher<BidiIterator, Allocator, traits>::unwind_long_set_repeat(bool r)
{
- typedef typename traits::char_class_type mask_type;
+ typedef typename traits::char_class_type m_type;
saved_single_repeat<BidiIterator>* pmp = static_cast<saved_single_repeat<BidiIterator>*>(m_backup_state);
// if we have a match, just discard this state:
@@ -1447,7 +1447,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_long_set_repeat(bool
const re_repeat* rep = pmp->rep;
std::size_t count = pmp->count;
pstate = rep->next.p;
- const re_set_long<mask_type>* set = static_cast<const re_set_long<mask_type>*>(pstate);
+ const re_set_long<m_type>* set = static_cast<const re_set_long<m_type>*>(pstate);
position = pmp->last_position;
BOOST_ASSERT(rep->type == syntax_element_long_set_rep);
diff --git a/boost/regex/v4/regex_format.hpp b/boost/regex/v4/regex_format.hpp
index e05862fa60..3b1d19da2a 100644
--- a/boost/regex/v4/regex_format.hpp
+++ b/boost/regex/v4/regex_format.hpp
@@ -180,8 +180,14 @@ private:
}
inline int toi(ForwardIter& i, ForwardIter j, int base)
{
+#if defined(_MSC_VER) && defined(__INTEL_COMPILER) && ((__INTEL_COMPILER == 9999) || (__INTEL_COMPILER == 1210))
+ // Workaround for Intel support issue #656654.
+ // See also https://svn.boost.org/trac/boost/ticket/6359
+ return toi(i, j, base, mpl::false_());
+#else
typedef typename boost::is_convertible<ForwardIter, const char_type*&>::type tag_type;
return toi(i, j, base, tag_type());
+#endif
}
const traits& m_traits; // the traits class for localised formatting operations
diff --git a/boost/regex/v4/regex_iterator.hpp b/boost/regex/v4/regex_iterator.hpp
index c2f2c49f2e..09e75c697d 100644
--- a/boost/regex/v4/regex_iterator.hpp
+++ b/boost/regex/v4/regex_iterator.hpp
@@ -68,7 +68,7 @@ public:
// flags |= match_prev_avail;
BidirectionalIterator next_start = what[0].second;
match_flag_type f(flags);
- if(!what.length())
+ if(!what.length() || (f & regex_constants::match_posix))
f |= regex_constants::match_not_initial_null;
//if(base != next_start)
// f |= regex_constants::match_not_bob;
diff --git a/boost/scope_exit.hpp b/boost/scope_exit.hpp
index 17f8003a86..de502f4444 100644
--- a/boost/scope_exit.hpp
+++ b/boost/scope_exit.hpp
@@ -1,73 +1,104 @@
-// Copyright Alexander Nasonov 2006-2009
-//
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
+
+// Copyright (C) 2006-2009, 2012 Alexander Nasonov
+// Copyright (C) 2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/scope_exit
#ifndef FILE_boost_scope_exit_hpp_INCLUDED
#define FILE_boost_scope_exit_hpp_INCLUDED
-#include <boost/config.hpp>
+#ifndef DOXYGEN
+#include <boost/local_function/detail/preprocessor/line_counter.hpp>
+#include <boost/local_function/detail/preprocessor/void_list.hpp>
+#include <boost/local_function/detail/preprocessor/keyword/thisunderscore.hpp>
#include <boost/detail/workaround.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/mpl/int.hpp>
+#include <boost/utility/enable_if.hpp>
+#include <boost/function.hpp>
+#include <boost/typeof/typeof.hpp>
+#include <boost/config.hpp>
#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/control/expr_iif.hpp>
+#include <boost/preprocessor/logical/bitor.hpp>
+#include <boost/preprocessor/logical/bitand.hpp>
#include <boost/preprocessor/facilities/empty.hpp>
+#include <boost/preprocessor/facilities/is_empty.hpp>
+#include <boost/preprocessor/facilities/identity.hpp>
#include <boost/preprocessor/punctuation/comma_if.hpp>
+#include <boost/preprocessor/punctuation/paren_if.hpp>
#include <boost/preprocessor/seq/cat.hpp>
-#include <boost/preprocessor/seq/for_each_i.hpp>
#include <boost/preprocessor/tuple/elem.hpp>
-#include <boost/typeof/typeof.hpp>
+#include <boost/preprocessor/tuple/eat.hpp>
+#include <boost/preprocessor/list/append.hpp>
+#include <boost/preprocessor/list/fold_left.hpp>
+#include <boost/preprocessor/list/enum.hpp>
+#include <boost/preprocessor/list/adt.hpp>
+#include <boost/preprocessor/list/for_each_i.hpp>
+
+// PRIVATE/PROTECTED //
+
+// NOTE: AUX prefix and aux namespace mark "private" symbols that shall be used
+// only within this library; DETAIL prefix and detail namespace mark "protected"
+// symbols that can be used by other Boost libraries but not outside Boost.
+// WARNING: BOOST_SCOPE_EXIT_AUX_GCC also used by some regression test.
#if defined(__GNUC__) && !defined(BOOST_INTEL)
-# define BOOST_SCOPE_EXIT_AUX_GCC (__GNUC__ * 100 + __GNUC_MINOR__)
+# define BOOST_SCOPE_EXIT_AUX_GCC (__GNUC__ * 100 + __GNUC_MINOR__)
#else
-# define BOOST_SCOPE_EXIT_AUX_GCC 0
+# define BOOST_SCOPE_EXIT_AUX_GCC 0
#endif
#if BOOST_WORKAROUND(BOOST_SCOPE_EXIT_AUX_GCC, BOOST_TESTED_AT(413))
-#define BOOST_SCOPE_EXIT_AUX_TPL_WORKAROUND
+# define BOOST_SCOPE_EXIT_AUX_TPL_GCC_WORKAROUND_01 1
+#else
+# define BOOST_SCOPE_EXIT_AUX_TPL_GCC_WORKAROUND_01 0
#endif
-// Steven Watanabe's trick with a modification suggested by Kim Barrett
-namespace boost { namespace scope_exit { namespace aux {
+#if BOOST_MSVC
+# define BOOST_SCOPE_EXIT_AUX_TYPEOF_THIS_MSVC_WORKAROUND_01 1
+#else
+# define BOOST_SCOPE_EXIT_AUX_TYPEOF_THIS_MSVC_WORKAROUND_01 0
+#endif
- // Type of a local boost_scope_exit_args variable.
- // First use in a local scope will declare the boost_scope_exit_args
- // variable, subsequent uses will be resolved as two comparisons
- // (cmp1 with 0 and cmp2 with boost_scope_exit_args).
- template<int Dummy = 0>
- struct declared
- {
- void* value;
- static int const cmp2 = 0;
- friend void operator>(int, declared const&) {}
- };
+// Steven Watanabe's trick with a modification suggested by Kim Barrett
+namespace boost { namespace scope_exit { namespace detail {
+
+// Type of a local BOOST_SCOPE_EXIT_AUX_ARGS variable.
+// First use in a local scope will declare the BOOST_SCOPE_EXIT_AUX_ARGS
+// variable, subsequent uses will be resolved as two comparisons
+// (cmp1 with 0 and cmp2 with BOOST_SCOPE_EXIT_AUX_ARGS).
+template<int Dummy = 0>
+struct declared
+{
+ void* value;
+ static int const cmp2 = 0;
+ friend void operator>(int, declared const&) {}
+};
- struct undeclared { declared<> dummy[2]; };
+struct undeclared { declared<> dummy[2]; };
- template<int> struct resolve;
+template<int> struct resolve;
- template<>
- struct resolve<sizeof(declared<>)>
- {
- static const int cmp1 = 0;
- };
+template<>
+struct resolve<sizeof(declared<>)>
+{
+ static const int cmp1 = 0;
+};
- template<>
- struct resolve<sizeof(undeclared)>
+template<>
+struct resolve<sizeof(undeclared)>
+{
+ template<int>
+ struct cmp1
{
- template<int>
- struct cmp1
- {
- static int const cmp2 = 0;
- };
+ static int const cmp2 = 0;
};
-} } }
-
-extern boost::scope_exit::aux::undeclared boost_scope_exit_args; // undefined
-
-
-namespace boost { namespace scope_exit { namespace aux {
+};
typedef void (*ref_tag)(int&);
typedef void (*val_tag)(int );
@@ -78,7 +109,7 @@ template<class T>
struct member<T,ref_tag>
{
T& value;
-#ifndef BOOST_SCOPE_EXIT_AUX_TPL_WORKAROUND
+#if !BOOST_SCOPE_EXIT_AUX_TPL_GCC_WORKAROUND_01
member(T& ref) : value(ref) {}
#endif
};
@@ -87,7 +118,7 @@ template<class T>
struct member<T,val_tag>
{
T value;
-#ifndef BOOST_SCOPE_EXIT_AUX_TPL_WORKAROUND
+#if !BOOST_SCOPE_EXIT_AUX_TPL_GCC_WORKAROUND_01
member(T& val) : value(val) {}
#endif
};
@@ -103,165 +134,1183 @@ struct wrapper
template<class T> wrapper<T> wrap(T&);
-} } }
+} } } // namespace
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-BOOST_TYPEOF_REGISTER_TEMPLATE(boost::scope_exit::aux::wrapper, 1)
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::scope_exit::detail::wrapper, 1)
+
+#define BOOST_SCOPE_EXIT_AUX_ARGS boost_scope_exit_aux_args
+extern boost::scope_exit::detail::undeclared BOOST_SCOPE_EXIT_AUX_ARGS;
+
+#define BOOST_SCOPE_EXIT_AUX_GUARD(id) \
+ BOOST_PP_CAT(boost_se_guard_, id)
+
+#define BOOST_SCOPE_EXIT_AUX_GUARD_T(id) \
+ BOOST_PP_CAT(boost_se_guard_t_, id)
+
+#define BOOST_SCOPE_EXIT_AUX_PARAMS(id) \
+ BOOST_PP_CAT(boost_se_params_, id)
+
+#define BOOST_SCOPE_EXIT_AUX_THIS_T(id) \
+ BOOST_PP_CAT(boost_se_this_t_, id)
+
+#define BOOST_SCOPE_EXIT_AUX_THIS_CAPTURE_T(id) \
+ BOOST_PP_CAT(boost_se_this_capture_t_, id)
-#define BOOST_SCOPE_EXIT_AUX_GUARD(id) BOOST_PP_CAT(boost_se_guard_, id)
-#define BOOST_SCOPE_EXIT_AUX_GUARD_T(id) BOOST_PP_CAT(boost_se_guard_t_, id)
-#define BOOST_SCOPE_EXIT_AUX_PARAMS(id) BOOST_PP_CAT(boost_se_params_, id)
-#define BOOST_SCOPE_EXIT_AUX_PARAMS_T(id) BOOST_PP_CAT(boost_se_params_t_, id)
+#define BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id) \
+ BOOST_PP_CAT(boost_se_params_t_, id)
-#define BOOST_SCOPE_EXIT_AUX_TAG(id, i) \
+#define BOOST_SCOPE_EXIT_DETAIL_TAG(id, i) \
BOOST_PP_SEQ_CAT( (boost_se_tag_)(i)(_)(id) )
-#define BOOST_SCOPE_EXIT_AUX_PARAM(id, i, var) \
+#define BOOST_SCOPE_EXIT_DETAIL_PARAM_THIS(id) \
+ BOOST_PP_SEQ_CAT( (boost_se_param_this_)(id) )
+
+#define BOOST_SCOPE_EXIT_DETAIL_PARAM(id, i, var) \
BOOST_PP_SEQ_CAT( (boost_se_param_)(i)(_)(id) )
-#define BOOST_SCOPE_EXIT_AUX_PARAM_T(id, i, var) \
+#define BOOST_SCOPE_EXIT_DETAIL_PARAM_T(id, i, var) \
BOOST_PP_SEQ_CAT( (boost_se_param_t_)(i)(_)(id) )
-#define BOOST_SCOPE_EXIT_AUX_CAPTURE_T(id, i, var) \
+#define BOOST_SCOPE_EXIT_DETAIL_CAPTURE_T(id, i, var) \
BOOST_PP_SEQ_CAT( (boost_se_capture_t_)(i)(_)(id) )
#define BOOST_SCOPE_EXIT_AUX_WRAPPED(id, i) \
BOOST_PP_SEQ_CAT( (boost_se_wrapped_t_)(i)(_)(id) )
#define BOOST_SCOPE_EXIT_AUX_DEREF(id, i, var) \
- boost::scope_exit::aux::deref(var, (BOOST_SCOPE_EXIT_AUX_TAG(id,i))0)
+ ::boost::scope_exit::detail::deref(var, \
+ static_cast<BOOST_SCOPE_EXIT_DETAIL_TAG(id, i)>(0))
#define BOOST_SCOPE_EXIT_AUX_MEMBER(r, id, i, var) \
- boost::scope_exit::aux::member< \
- BOOST_SCOPE_EXIT_AUX_PARAM_T(id,i,var), \
- BOOST_SCOPE_EXIT_AUX_TAG(id,i) \
- > BOOST_SCOPE_EXIT_AUX_PARAM(id,i,var);
-
-// idty is (id,typename) or (id,BOOST_PP_EMPTY())
-#define BOOST_SCOPE_EXIT_AUX_ARG_DECL(r, idty, i, var) \
- BOOST_PP_COMMA_IF(i) BOOST_PP_TUPLE_ELEM(2,1,idty) \
- BOOST_SCOPE_EXIT_AUX_PARAMS_T(BOOST_PP_TUPLE_ELEM(2,0,idty)):: \
- BOOST_SCOPE_EXIT_AUX_PARAM_T(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var) var
+ ::boost::scope_exit::detail::member< \
+ BOOST_SCOPE_EXIT_DETAIL_PARAM_T(id, i, var), \
+ BOOST_SCOPE_EXIT_DETAIL_TAG(id, i) \
+ > BOOST_SCOPE_EXIT_DETAIL_PARAM(id, i, var);
+
+#define BOOST_SCOPE_EXIT_AUX_ARG_DECL(r, id_ty, i, var) \
+ BOOST_PP_COMMA_IF(i) \
+ BOOST_PP_TUPLE_ELEM(2, 1, id_ty) \
+ BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(BOOST_PP_TUPLE_ELEM(2, 0, id_ty)):: \
+ BOOST_SCOPE_EXIT_DETAIL_PARAM_T(BOOST_PP_TUPLE_ELEM(2, 0, id_ty), \
+ i, var) \
+ var
-#define BOOST_SCOPE_EXIT_AUX_ARG(r, id, i, var) BOOST_PP_COMMA_IF(i) \
- boost_se_params_->BOOST_SCOPE_EXIT_AUX_PARAM(id,i,var).value
+#define BOOST_SCOPE_EXIT_AUX_ARG(r, id, i, var) \
+ BOOST_PP_COMMA_IF(i) \
+ boost_se_params_->BOOST_SCOPE_EXIT_DETAIL_PARAM(id, i, var).value
+
+#define BOOST_SCOPE_EXIT_DETAIL_TAG_DECL(r, id, i, var) \
+ typedef void (*BOOST_SCOPE_EXIT_DETAIL_TAG(id, i))(int var);
+
+// Adam Butcher's workaround to deduce `this` type on MSVC revision < 10.
+// Boost.Typeof for VC71's typeid-based workaround does not work to determine
+// `this` type due to error C2355 being incorrectly reported. The typical
+// avoidance strategy implemented below is to make an indirect compile-time
+// constant by assigning an enum and use that as type-index-- this only works
+// with the sizeof() approach and not with the typeid() approach. Lorenzo
+// Caminiti extended this approach to work in type-of emulation mode. This code
+// is very similar (and somewhat of a duplication) of the code in
+// boost/typeof/msvc/typeof_impl.hpp). However, this code cannot be integrated
+// into Boost.Typeof because its final API has to be a `typedef ...` and it
+// cannot be a `typeof(...)`.
+#if BOOST_SCOPE_EXIT_AUX_TYPEOF_THIS_MSVC_WORKAROUND_01
+
+#include <boost/config.hpp>
+#include <boost/detail/workaround.hpp>
+#include <boost/mpl/int.hpp>
+#include <boost/type_traits/is_function.hpp>
+#include <boost/utility/enable_if.hpp>
+
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1310)
+# include <typeinfo>
+#endif
-#define BOOST_SCOPE_EXIT_AUX_TAG_DECL(r, id, i, var) \
- typedef void (*BOOST_SCOPE_EXIT_AUX_TAG(id,i))(int var);
+namespace boost { namespace scope_exit { namespace aux {
+ namespace msvc_typeof_this {
+
+// compile-time constant code
+#if BOOST_WORKAROUND(BOOST_MSVC, >=1300) && defined(_MSC_EXTENSIONS)
+
+template<int N> struct the_counter;
+
+template<typename T,int N = 5 /* for similarity */>
+struct encode_counter {
+ __if_exists(the_counter<N + 256>) {
+ BOOST_STATIC_CONSTANT(unsigned,
+ count=(encode_counter<T,N + 257>::count));
+ }
+ __if_not_exists(the_counter<N + 256>) {
+ __if_exists(the_counter<N + 64>) {
+ BOOST_STATIC_CONSTANT(unsigned,
+ count=(encode_counter<T,N + 65>::count));
+ }
+ __if_not_exists(the_counter<N + 64>) {
+ __if_exists(the_counter<N + 16>) {
+ BOOST_STATIC_CONSTANT(unsigned,
+ count=(encode_counter<T,N + 17>::count));
+ }
+ __if_not_exists(the_counter<N + 16>) {
+ __if_exists(the_counter<N + 4>) {
+ BOOST_STATIC_CONSTANT(unsigned,
+ count=(encode_counter<T,N + 5>::count));
+ }
+ __if_not_exists(the_counter<N + 4>) {
+ __if_exists(the_counter<N>) {
+ BOOST_STATIC_CONSTANT(unsigned,
+ count=(encode_counter<T,N + 1>::count));
+ }
+ __if_not_exists(the_counter<N>) {
+ BOOST_STATIC_CONSTANT(unsigned,count=N);
+ typedef the_counter<N> type;
+ }
+ }
+ }
+ }
+ }
+};
+
+#else // compile-time constant code
+
+template<int N> struct encode_counter : encode_counter<N - 1> {};
+template<> struct encode_counter<0> {};
-#ifdef BOOST_SCOPE_EXIT_AUX_TPL_WORKAROUND
+#endif // compile-time constant code
-#define BOOST_SCOPE_EXIT_AUX_PARAMS_T_CTOR(id, seq)
+#if BOOST_WORKAROUND(BOOST_MSVC, == 1300) // type-of code
-#define BOOST_SCOPE_EXIT_AUX_PARAM_INIT(r, id, i, var) \
- BOOST_PP_COMMA_IF(i) { BOOST_SCOPE_EXIT_AUX_DEREF(id,i,var) }
+template<typename ID>
+struct msvc_extract_type
+{
+ template<bool>
+ struct id2type_impl;
-#define BOOST_SCOPE_EXIT_AUX_PARAMS_INIT(id, seq) \
- = { BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_PARAM_INIT, id, seq) };
+ typedef id2type_impl<true> id2type;
+};
-#else
+template<typename T, typename ID>
+struct msvc_register_type : msvc_extract_type<ID>
+{
+ template<>
+ struct id2type_impl<true> { // VC7.0 specific bug-feature.
+ typedef T type;
+ };
+};
+
+#elif BOOST_WORKAROUND(BOOST_MSVC, >= 1400) // type-of code
+
+struct msvc_extract_type_default_param {};
+
+template<typename ID, typename T = msvc_extract_type_default_param>
+struct msvc_extract_type;
+
+template<typename ID>
+struct msvc_extract_type<ID, msvc_extract_type_default_param> {
+ template<bool>
+ struct id2type_impl;
+
+ typedef id2type_impl<true> id2type;
+};
+
+template<typename ID, typename T>
+struct msvc_extract_type
+ : msvc_extract_type<ID, msvc_extract_type_default_param> {
+ template<>
+ struct id2type_impl<true> { // VC8.0 specific bug-feature.
+ typedef T type;
+ };
+
+ template<bool>
+ struct id2type_impl;
+
+ typedef id2type_impl<true> id2type;
+};
+
+template<typename T, typename ID>
+struct msvc_register_type : msvc_extract_type<ID, T> {};
+
+#else // type-of code
+
+template<typename ID>
+struct msvc_extract_type {
+ struct id2type;
+};
+
+template<typename T, typename ID>
+struct msvc_register_type : msvc_extract_type<ID> {
+ typedef msvc_extract_type<ID> base_type;
+ struct base_type::id2type { // This uses nice VC6.5 and VC7.1 bug-features.
+ typedef T type;
+ };
+};
+
+#endif // typeof code
+
+template<int Id>
+struct msvc_typeid_wrapper {
+ typedef typename msvc_extract_type<boost::mpl::int_<Id>
+ >::id2type id2type;
+ typedef typename id2type::type type;
+};
-#define BOOST_SCOPE_EXIT_AUX_CTOR_ARG(r, id, i, var) BOOST_PP_COMMA_IF(i) \
- BOOST_SCOPE_EXIT_AUX_PARAM_T(id,i,var) & BOOST_PP_CAT(a,i)
+template<>
+struct msvc_typeid_wrapper<4> {
+ typedef msvc_typeid_wrapper<4> type;
+};
-#define BOOST_SCOPE_EXIT_AUX_MEMBER_INIT(r, id, i, var) BOOST_PP_COMMA_IF(i) \
- BOOST_SCOPE_EXIT_AUX_PARAM(id,i,var) ( BOOST_PP_CAT(a,i) )
+template<typename T>
+struct encode_type {
+ BOOST_STATIC_CONSTANT(unsigned, value = encode_counter<T>::count);
+ typedef typename msvc_register_type<T,
+ boost::mpl::int_<value> >::id2type type;
+ BOOST_STATIC_CONSTANT(unsigned, next = value + 1);
+};
-#define BOOST_SCOPE_EXIT_AUX_PARAMS_T_CTOR(id, seq) \
- BOOST_SCOPE_EXIT_AUX_PARAMS_T(id)( \
- BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_CTOR_ARG, id, seq ) ) \
- : BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_MEMBER_INIT, id, seq) {}
+template<class T>
+struct sizer {
+ typedef char(*type)[encode_type<T>::value];
+};
-#define BOOST_SCOPE_EXIT_AUX_PARAM_INIT(r, id, i, var) \
+template<typename T>
+typename boost::disable_if<
+ typename boost::is_function<T>::type
+ , typename sizer<T>::type
+>::type encode_start(T const&);
+
+template<typename T>
+typename boost::enable_if<
+ typename boost::is_function<T>::type
+ , typename sizer<T>::type
+>::type encode_start(T&);
+
+template<typename Organizer, typename T>
+msvc_register_type<T, Organizer> typeof_register_type(const T&,
+ Organizer* = 0);
+
+} } } } // namespace
+
+#define BOOST_SCOPE_EXIT_AUX_TYPEDEF_TYPEOF_THIS_INDEX_(id) \
+ BOOST_PP_CAT(boost_se_thistype_index_, id)
+
+#define BOOST_SCOPE_EXIT_DETAIL_TYPEDEF_TYPEOF_THIS(id, ty, new_type) \
+ /* unfortunately, we need to go via this enum which causes this to be */ \
+ /* a typedef construct and not a typeof (so this code cannot be */ \
+ /* integrated into Boost.Typeof) */ \
+ enum { \
+ BOOST_SCOPE_EXIT_AUX_TYPEDEF_TYPEOF_THIS_INDEX_(id) = sizeof( \
+ *::boost::scope_exit::aux::msvc_typeof_this::encode_start(this)) \
+ }; \
+ typedef \
+ ty ::boost::scope_exit::aux::msvc_typeof_this::msvc_typeid_wrapper< \
+ BOOST_SCOPE_EXIT_AUX_TYPEDEF_TYPEOF_THIS_INDEX_(id) \
+ >::type \
+ new_type \
+ ;
+
+#else // TYPEOF_THIS_MSVC_WORKAROUND
+
+#define BOOST_SCOPE_EXIT_DETAIL_TYPEDEF_TYPEOF_THIS(id, ty, new_type) \
+ typedef /* trailing `EMPTY()` handles empty `ty` */ \
+ BOOST_PP_IIF(BOOST_PP_IS_EMPTY(ty BOOST_PP_EMPTY()), \
+ BOOST_TYPEOF \
+ , \
+ BOOST_TYPEOF_TPL \
+ )(this) \
+ new_type \
+ ;
+
+#endif // TYPEOF_THIS_MSVC_WORKAROUND
+
+#if BOOST_SCOPE_EXIT_AUX_TPL_GCC_WORKAROUND_01
+
+#define BOOST_SCOPE_EXIT_AUX_PARAMS_T_CTOR(id, ty, captures, has_this) \
+ /* expand to nothing */
+
+#define BOOST_SCOPE_EXIT_DETAIL_PARAM_INIT(r, id, i, var) \
+ BOOST_PP_COMMA_IF(i) { BOOST_SCOPE_EXIT_AUX_DEREF(id, i, var) }
+
+#define BOOST_SCOPE_EXIT_AUX_PARAMS_INIT(id, captures, has_this) \
+ BOOST_PP_EXPR_IIF(BOOST_PP_BITOR(has_this, \
+ BOOST_PP_LIST_IS_CONS(captures)), \
+ = { \
+ ) \
+ BOOST_PP_LIST_FOR_EACH_I(BOOST_SCOPE_EXIT_DETAIL_PARAM_INIT, id, captures) \
+ BOOST_PP_COMMA_IF(BOOST_PP_BITAND(BOOST_PP_LIST_IS_CONS(captures), \
+ has_this)) \
+ BOOST_PP_EXPR_IIF(has_this, this) /* no extra {...} needed here */ \
+ BOOST_PP_EXPR_IIF(BOOST_PP_BITOR(has_this, \
+ BOOST_PP_LIST_IS_CONS(captures)), \
+ } /* trailing `;` will be added by the caller */ \
+ )
+
+#else // TPL_GCC_WORKAROUND
+
+#define BOOST_SCOPE_EXIT_AUX_CTOR_ARG(r, id, i, var) \
+ BOOST_PP_COMMA_IF(i) \
+ BOOST_SCOPE_EXIT_DETAIL_PARAM_T(id, i, var) & BOOST_PP_CAT(a, i)
+
+#define BOOST_SCOPE_EXIT_AUX_MEMBER_INIT(r, id, i, var) \
+ BOOST_PP_COMMA_IF(i) \
+ BOOST_SCOPE_EXIT_DETAIL_PARAM(id, i, var) ( BOOST_PP_CAT(a, i) )
+
+#define BOOST_SCOPE_EXIT_AUX_CTOR_ARG_THIS_NAME(id) \
+ BOOST_PP_CAT(boost_se_this_arg_, id)
+
+#define BOOST_SCOPE_EXIT_AUX_CTOR_ARG_THIS(id, ty, comma01) \
+ BOOST_PP_COMMA_IF(comma01) \
+ ty BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id)::BOOST_SCOPE_EXIT_AUX_THIS_T(id) \
+ BOOST_SCOPE_EXIT_AUX_CTOR_ARG_THIS_NAME(id) /* ptr so no & */
+
+#define BOOST_SCOPE_EXIT_AUX_MEMBER_THIS_INIT(id, comma01) \
+ BOOST_PP_COMMA_IF(comma01) \
+ BOOST_SCOPE_EXIT_DETAIL_PARAM_THIS(id)( \
+ BOOST_SCOPE_EXIT_AUX_CTOR_ARG_THIS_NAME(id))
+
+#define BOOST_SCOPE_EXIT_AUX_PARAMS_T_CTOR(id, ty, captures, has_this) \
+ BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id)( \
+ BOOST_PP_LIST_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_CTOR_ARG, id, captures) \
+ BOOST_PP_IIF(has_this, \
+ BOOST_SCOPE_EXIT_AUX_CTOR_ARG_THIS \
+ , \
+ BOOST_PP_TUPLE_EAT(3) \
+ )(id, ty, BOOST_PP_LIST_IS_CONS(captures)) \
+ ) \
+ BOOST_PP_EXPR_IIF(BOOST_PP_BITOR(BOOST_PP_LIST_IS_CONS(captures), \
+ has_this), \
+ : \
+ ) \
+ BOOST_PP_LIST_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_MEMBER_INIT, id, \
+ captures) \
+ BOOST_PP_IIF(has_this, \
+ BOOST_SCOPE_EXIT_AUX_MEMBER_THIS_INIT \
+ , \
+ BOOST_PP_TUPLE_EAT(2) \
+ )(id, BOOST_PP_LIST_IS_CONS(captures)) \
+ {}
+
+#define BOOST_SCOPE_EXIT_DETAIL_PARAM_INIT(r, id, i, var) \
BOOST_PP_COMMA_IF(i) BOOST_SCOPE_EXIT_AUX_DEREF(id,i,var)
-#define BOOST_SCOPE_EXIT_AUX_PARAMS_INIT(id, seq) \
- ( BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_PARAM_INIT, id, seq) );
+#define BOOST_SCOPE_EXIT_AUX_PARAMS_INIT(id, captures, has_this) \
+ BOOST_PP_LPAREN_IF(BOOST_PP_BITOR(has_this, \
+ BOOST_PP_LIST_IS_CONS(captures))) \
+ BOOST_PP_LIST_FOR_EACH_I(BOOST_SCOPE_EXIT_DETAIL_PARAM_INIT, id, captures) \
+ BOOST_PP_COMMA_IF(BOOST_PP_BITAND(BOOST_PP_LIST_IS_CONS(captures), \
+ has_this)) \
+ BOOST_PP_EXPR_IIF(has_this, this) \
+ BOOST_PP_RPAREN_IF(BOOST_PP_BITOR(has_this, \
+ BOOST_PP_LIST_IS_CONS(captures)))
-#endif
+#endif // TPL_GCC_WORKAROUND
#if defined(BOOST_TYPEOF_EMULATION)
-#define BOOST_SCOPE_EXIT_AUX_CAPTURE_DECL(r, idty, i, var) \
- struct BOOST_SCOPE_EXIT_AUX_WRAPPED(BOOST_PP_TUPLE_ELEM(2,0,idty), i) \
- : BOOST_TYPEOF(boost::scope_exit::aux::wrap( \
- BOOST_SCOPE_EXIT_AUX_DEREF(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var))) \
- {}; typedef BOOST_PP_TUPLE_ELEM(2,1,idty) \
- BOOST_SCOPE_EXIT_AUX_WRAPPED(BOOST_PP_TUPLE_ELEM(2,0,idty), i)::type \
- BOOST_SCOPE_EXIT_AUX_CAPTURE_T(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var);
+#define BOOST_SCOPE_EXIT_DETAIL_CAPTURE_DECL(r, id_ty, i, var) \
+ struct BOOST_SCOPE_EXIT_AUX_WRAPPED(BOOST_PP_TUPLE_ELEM(2, 0, id_ty), i) \
+ /* no need to use TYPEOF_TPL here because it's within inheritance */ \
+ : BOOST_TYPEOF(::boost::scope_exit::detail::wrap( \
+ BOOST_SCOPE_EXIT_AUX_DEREF(BOOST_PP_TUPLE_ELEM(2, 0, id_ty), \
+ i, var))) \
+ {}; \
+ typedef BOOST_PP_TUPLE_ELEM(2, 1, id_ty) \
+ BOOST_SCOPE_EXIT_AUX_WRAPPED(BOOST_PP_TUPLE_ELEM(2, 0, id_ty), i)::type\
+ BOOST_SCOPE_EXIT_DETAIL_CAPTURE_T(BOOST_PP_TUPLE_ELEM(2, 0, id_ty), \
+ i, var) \
+ ;
#elif defined(BOOST_INTEL)
-#define BOOST_SCOPE_EXIT_AUX_CAPTURE_DECL(r, idty, i, var) \
- typedef BOOST_TYPEOF_KEYWORD( \
- BOOST_SCOPE_EXIT_AUX_DEREF(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var)) \
- BOOST_SCOPE_EXIT_AUX_CAPTURE_T(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var);
+#define BOOST_SCOPE_EXIT_DETAIL_CAPTURE_DECL(r, id_ty, i, var) \
+ typedef \
+ /* no TYPEOF_TPL here because uses TYPEOF_KEYWORD directly */ \
+ BOOST_TYPEOF_KEYWORD(BOOST_SCOPE_EXIT_AUX_DEREF( \
+ BOOST_PP_TUPLE_ELEM(2, 0, id_ty), i, var)) \
+ BOOST_SCOPE_EXIT_DETAIL_CAPTURE_T(BOOST_PP_TUPLE_ELEM(2, 0, id_ty), \
+ i, var) \
+ ;
#else
-#define BOOST_SCOPE_EXIT_AUX_CAPTURE_DECL(r, idty, i, var) \
- typedef BOOST_TYPEOF(boost::scope_exit::aux::wrap( \
- BOOST_SCOPE_EXIT_AUX_DEREF(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var))) \
- BOOST_SCOPE_EXIT_AUX_WRAPPED(BOOST_PP_TUPLE_ELEM(2,0,idty), i); \
- typedef BOOST_PP_TUPLE_ELEM(2,1,idty) \
- BOOST_SCOPE_EXIT_AUX_WRAPPED(BOOST_PP_TUPLE_ELEM(2,0,idty), i)::type \
- BOOST_SCOPE_EXIT_AUX_CAPTURE_T(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var);
+#define BOOST_SCOPE_EXIT_DETAIL_CAPTURE_DECL(r, id_ty, i, var) \
+ typedef \
+ /* no need to use TYPEOF_TPL here because it's a typedef */ \
+ BOOST_TYPEOF(::boost::scope_exit::detail::wrap( \
+ BOOST_SCOPE_EXIT_AUX_DEREF(BOOST_PP_TUPLE_ELEM(2, 0, id_ty), \
+ i, var))) \
+ BOOST_SCOPE_EXIT_AUX_WRAPPED(BOOST_PP_TUPLE_ELEM(2, 0, id_ty), i) \
+ ; \
+ typedef BOOST_PP_TUPLE_ELEM(2, 1, id_ty) \
+ BOOST_SCOPE_EXIT_AUX_WRAPPED(BOOST_PP_TUPLE_ELEM(2, 0, id_ty), i)::type\
+ BOOST_SCOPE_EXIT_DETAIL_CAPTURE_T(BOOST_PP_TUPLE_ELEM(2, 0, id_ty), \
+ i, var) \
+ ;
#endif
-#define BOOST_SCOPE_EXIT_AUX_PARAM_DECL(r, idty, i, var) \
- typedef BOOST_SCOPE_EXIT_AUX_CAPTURE_T( \
- BOOST_PP_TUPLE_ELEM(2,0,idty), i, var) \
- BOOST_SCOPE_EXIT_AUX_PARAM_T(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var);
-
-
-#define BOOST_SCOPE_EXIT_AUX_IMPL(id, seq, ty) \
- BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_TAG_DECL, id, seq) \
- BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_CAPTURE_DECL, (id,ty), seq) \
- struct BOOST_SCOPE_EXIT_AUX_PARAMS_T(id) { \
- BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_PARAM_DECL, (id,ty), seq) \
- BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_MEMBER, id, seq) \
- BOOST_SCOPE_EXIT_AUX_PARAMS_T_CTOR(id, seq) \
- } BOOST_SCOPE_EXIT_AUX_PARAMS(id) BOOST_SCOPE_EXIT_AUX_PARAMS_INIT(id,seq) \
- boost::scope_exit::aux::declared< boost::scope_exit::aux::resolve< \
- sizeof(boost_scope_exit_args)>::cmp1<0>::cmp2 > boost_scope_exit_args; \
- boost_scope_exit_args.value = &BOOST_SCOPE_EXIT_AUX_PARAMS(id); \
- struct BOOST_SCOPE_EXIT_AUX_GUARD_T(id) { \
- BOOST_SCOPE_EXIT_AUX_PARAMS_T(id)* boost_se_params_; \
- BOOST_SCOPE_EXIT_AUX_GUARD_T(id) (void* boost_se_params) \
- : boost_se_params_( \
- (BOOST_SCOPE_EXIT_AUX_PARAMS_T(id)*)boost_se_params) \
- {} \
- ~BOOST_SCOPE_EXIT_AUX_GUARD_T(id)() { boost_se_body( \
- BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_ARG, id, seq) ); } \
- static void boost_se_body(BOOST_PP_SEQ_FOR_EACH_I( \
- BOOST_SCOPE_EXIT_AUX_ARG_DECL, (id,ty), seq) )
-
-#if defined(BOOST_MSVC)
-
-#define BOOST_SCOPE_EXIT_END } BOOST_SCOPE_EXIT_AUX_GUARD(__COUNTER__) ( \
- boost_scope_exit_args.value);
-
-#define BOOST_SCOPE_EXIT(seq) \
- BOOST_SCOPE_EXIT_AUX_IMPL(__COUNTER__, seq, BOOST_PP_EMPTY())
+#define BOOST_SCOPE_EXIT_DETAIL_PARAM_DECL(r, id_ty, i, var) \
+ typedef \
+ BOOST_SCOPE_EXIT_DETAIL_CAPTURE_T(BOOST_PP_TUPLE_ELEM(2, 0, id_ty), \
+ i, var) \
+ BOOST_SCOPE_EXIT_DETAIL_PARAM_T(BOOST_PP_TUPLE_ELEM(2, 0, id_ty), \
+ i, var) \
+ ;
-#else
+// Traits.
-#define BOOST_SCOPE_EXIT_END } BOOST_SCOPE_EXIT_AUX_GUARD(__LINE__) ( \
- boost_scope_exit_args.value);
+#define BOOST_SCOPE_EXIT_AUX_TRAITS_OP_CAPTURE(d, captures, this01, capture) \
+ (BOOST_PP_LIST_APPEND(captures, (capture, BOOST_PP_NIL)), this01)
-#define BOOST_SCOPE_EXIT(seq) \
- BOOST_SCOPE_EXIT_AUX_IMPL(__LINE__, seq, BOOST_PP_EMPTY())
+#define BOOST_SCOPE_EXIT_AUX_TRAITS_OP_THIS(d, captures, this01, this_) \
+ (captures, 1 /* has this (note, no error if multiple this_) */)
-#endif
+#define BOOST_SCOPE_EXIT_AUX_TRAITS_OP(d, captures_this, capture) \
+ BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_THISUNDERSCORE_BACK(\
+ capture), \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_OP_THIS \
+ , \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_OP_CAPTURE \
+ )(d, BOOST_PP_TUPLE_ELEM(2, 0, captures_this), \
+ BOOST_PP_TUPLE_ELEM(2, 1, captures_this), capture)
-#ifdef BOOST_SCOPE_EXIT_AUX_TPL_WORKAROUND
-#define BOOST_SCOPE_EXIT_TPL(seq) \
- BOOST_SCOPE_EXIT_AUX_IMPL(__LINE__, seq, typename)
-#else
-#define BOOST_SCOPE_EXIT_TPL(seq) BOOST_SCOPE_EXIT(seq)
-#endif
+// ref_val: & | =
+#define BOOST_SCOPE_EXIT_AUX_TRAITS_ALL_OP(ref_val, traits) \
+ ( \
+ BOOST_PP_LIST_APPEND((ref_val, BOOST_PP_NIL), \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits)) \
+ , \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits) \
+ )
+
+#define BOOST_SCOPE_EXIT_AUX_TRAITS(captures) \
+ BOOST_PP_LIST_FOLD_LEFT(BOOST_SCOPE_EXIT_AUX_TRAITS_OP, \
+ (BOOST_PP_NIL, 0), captures)
+
+#define BOOST_SCOPE_EXIT_AUX_TRAITS_ALL(captures) \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_ALL_OP(BOOST_PP_LIST_FIRST(captures), \
+ BOOST_SCOPE_EXIT_AUX_TRAITS(BOOST_PP_LIST_REST(captures)))
+
+#define BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits) \
+ BOOST_PP_TUPLE_ELEM(2, 0, traits)
+
+#define BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits) \
+ BOOST_PP_TUPLE_ELEM(2, 1, traits)
+
+#ifndef BOOST_NO_LAMBDAS
+
+namespace boost { namespace scope_exit { namespace aux {
+
+template<typename This = void>
+struct guard { // With object `this_` (for backward compatibility).
+ explicit guard(This _this) : this_(_this) {}
+ ~guard() { if(f_) f_(this_); }
+ template<typename Lambda>
+ void operator=(Lambda f) { f_ = f; }
+private:
+ This this_;
+ boost::function<void (This)> f_;
+};
+
+template<>
+struct guard<void> { // Without object `this_` (could capture `this` directly).
+ ~guard() { if(f_) f_(); }
+ template<typename Lambda>
+ void operator=(Lambda f) { f_ = f; }
+private:
+ boost::function<void (void)> f_;
+};
+
+} } } // namespace
+
+#define BOOST_SCOPE_EXIT_AUX_LAMBDA_PARAMS(id) \
+ BOOST_PP_CAT(boost_se_lambda_params_, id)
+
+#define BOOST_SCOPE_EXIT_AUX_LAMBDA_THIS_CAPTURE_TYPE(id) \
+ BOOST_PP_CAT(boost_se_lambda_this_t_, id)
+
+#define BOOST_SCOPE_EXIT_AUX_LAMBDA_THIS_PARAM_TYPE(id) \
+ BOOST_PP_CAT(boost_se_lambda_this_capture_t_, id)
+
+#define BOOST_SCOPE_EXIT_AUX_LAMBDA_THIS_TYPE(id, ty) \
+ ty BOOST_SCOPE_EXIT_AUX_LAMBDA_PARAMS(id):: \
+ BOOST_SCOPE_EXIT_AUX_LAMBDA_THIS_PARAM_TYPE(id)
+
+// Precondition: HAS_THIS(traits).
+#define BOOST_SCOPE_EXIT_AUX_LAMBDA_THIS_TYPEDEFS(id, ty, traits) \
+ BOOST_SCOPE_EXIT_DETAIL_TYPEDEF_TYPEOF_THIS(id, ty, \
+ BOOST_SCOPE_EXIT_AUX_LAMBDA_THIS_CAPTURE_TYPE(id)) \
+ /* capture type for workaround GCC internal error (even on later C++11) */ \
+ struct BOOST_SCOPE_EXIT_AUX_LAMBDA_PARAMS(id) { \
+ typedef BOOST_SCOPE_EXIT_AUX_LAMBDA_THIS_CAPTURE_TYPE(id) \
+ BOOST_SCOPE_EXIT_AUX_LAMBDA_THIS_PARAM_TYPE(id); \
+ };
+
+#define BOOST_SCOPE_EXIT_AUX_IMPL_LAMBDA(id, ty, traits) \
+ BOOST_PP_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), \
+ /* no need for TYPEDEF THIS MSVC workaround on C++11 */ \
+ BOOST_SCOPE_EXIT_AUX_LAMBDA_THIS_TYPEDEFS \
+ , \
+ BOOST_PP_TUPLE_EAT(3) \
+ )(id, ty, traits) \
+ ::boost::scope_exit::aux::guard< \
+ BOOST_PP_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), \
+ BOOST_SCOPE_EXIT_AUX_LAMBDA_THIS_TYPE \
+ , \
+ BOOST_PP_TUPLE_EAT(2) \
+ )(id, ty) \
+ > BOOST_SCOPE_EXIT_AUX_GUARD(id) \
+ BOOST_PP_EXPR_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), \
+ (this) \
+ ) \
+ ; \
+ BOOST_SCOPE_EXIT_AUX_GUARD(id) = [ \
+ BOOST_PP_LIST_ENUM(BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits)) \
+ ]( \
+ BOOST_PP_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), \
+ BOOST_SCOPE_EXIT_AUX_LAMBDA_THIS_TYPE \
+ , \
+ BOOST_PP_TUPLE_EAT(2) \
+ )(id, ty) \
+ BOOST_PP_EXPR_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), this_) \
+ ) mutable /* can change value captures (as with SCOPE_EXIT) */ -> void
+
+#endif // Lambdas.
+
+#if defined(BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS) && \
+ !defined(BOOST_NO_LAMBDAS) // Use lambda for SCOPE_EXIT (not just _ALL).
+
+#define BOOST_SCOPE_EXIT_AUX_IMPL(id, ty, traits) \
+ BOOST_SCOPE_EXIT_AUX_IMPL_LAMBDA(id, ty, traits)
+
+#else // Not using lambdas.
+
+// ty: EMPTY() | typename
+#define BOOST_SCOPE_EXIT_AUX_IMPL(id, ty, traits) \
+ BOOST_PP_LIST_FOR_EACH_I(BOOST_SCOPE_EXIT_DETAIL_TAG_DECL, id, \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits)) \
+ BOOST_PP_LIST_FOR_EACH_I(BOOST_SCOPE_EXIT_DETAIL_CAPTURE_DECL, (id, ty), \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits)) \
+ BOOST_PP_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), \
+ BOOST_SCOPE_EXIT_DETAIL_TYPEDEF_TYPEOF_THIS \
+ , \
+ BOOST_PP_TUPLE_EAT(3) \
+ )(id, ty, BOOST_SCOPE_EXIT_AUX_THIS_CAPTURE_T(id)) \
+ struct BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id) { \
+ /* interim capture types to workaround internal errors on old GCC */ \
+ BOOST_PP_LIST_FOR_EACH_I(BOOST_SCOPE_EXIT_DETAIL_PARAM_DECL, (id, ty), \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits)) \
+ BOOST_PP_EXPR_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), \
+ typedef BOOST_SCOPE_EXIT_AUX_THIS_CAPTURE_T(id) \
+ BOOST_SCOPE_EXIT_AUX_THIS_T(id) ; \
+ ) \
+ BOOST_PP_LIST_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_MEMBER, id, \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits)) \
+ BOOST_PP_EXPR_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), \
+ BOOST_SCOPE_EXIT_AUX_THIS_T(id) \
+ BOOST_SCOPE_EXIT_DETAIL_PARAM_THIS(id) ; \
+ ) \
+ BOOST_SCOPE_EXIT_AUX_PARAMS_T_CTOR(id, ty, \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits), \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits)) \
+ } BOOST_SCOPE_EXIT_AUX_PARAMS(id) \
+ BOOST_SCOPE_EXIT_AUX_PARAMS_INIT(id, \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits), \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits)) \
+ ; \
+ ::boost::scope_exit::detail::declared< \
+ ::boost::scope_exit::detail::resolve< \
+ sizeof(BOOST_SCOPE_EXIT_AUX_ARGS) \
+ >::cmp1<0>::cmp2 \
+ > BOOST_SCOPE_EXIT_AUX_ARGS; \
+ BOOST_SCOPE_EXIT_AUX_ARGS.value = &BOOST_SCOPE_EXIT_AUX_PARAMS(id); \
+ struct BOOST_SCOPE_EXIT_AUX_GUARD_T(id) { \
+ BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id)* boost_se_params_; \
+ BOOST_SCOPE_EXIT_AUX_GUARD_T(id) (void* boost_se_params) \
+ : boost_se_params_( \
+ (BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id)*)boost_se_params) \
+ {} \
+ ~BOOST_SCOPE_EXIT_AUX_GUARD_T(id)() { \
+ boost_se_body( \
+ BOOST_PP_LIST_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_ARG, id, \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits)) \
+ BOOST_PP_COMMA_IF(BOOST_PP_BITAND(BOOST_PP_LIST_IS_CONS( \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits)), \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits))) \
+ BOOST_PP_EXPR_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS( \
+ traits), \
+ boost_se_params_->BOOST_SCOPE_EXIT_DETAIL_PARAM_THIS(id) \
+ ) \
+ ); \
+ } \
+ static void boost_se_body( \
+ BOOST_PP_LIST_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_ARG_DECL, (id, ty), \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits)) \
+ BOOST_PP_COMMA_IF(BOOST_PP_BITAND(BOOST_PP_LIST_IS_CONS( \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits)), \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits))) \
+ BOOST_PP_EXPR_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), \
+ ty BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id):: \
+ BOOST_SCOPE_EXIT_AUX_THIS_T(id) this_ \
+ ) \
+ )
+
+#endif // Using lambdas.
+
+// PUBLIC //
+
+#if defined(BOOST_NO_VARIADIC_MACROS) // No variadic macros (sequences only).
+# define BOOST_SCOPE_EXIT_ID(id, void_or_seq) \
+ BOOST_SCOPE_EXIT_AUX_IMPL(id, BOOST_PP_EMPTY(), \
+ BOOST_SCOPE_EXIT_AUX_TRAITS( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST(void_or_seq)))
+# define BOOST_SCOPE_EXIT_ID_TPL(id, void_or_seq) \
+ BOOST_SCOPE_EXIT_AUX_IMPL(id, typename, \
+ BOOST_SCOPE_EXIT_AUX_TRAITS( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST(void_or_seq)))
+# define BOOST_SCOPE_EXIT(void_or_seq) \
+ BOOST_SCOPE_EXIT_ID(BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER, \
+ void_or_seq)
+# define BOOST_SCOPE_EXIT_TPL(void_or_seq) \
+ BOOST_SCOPE_EXIT_ID_TPL(BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER, \
+ void_or_seq)
+# if !defined(BOOST_NO_LAMBDAS)
+# define BOOST_SCOPE_EXIT_ALL_ID(id, seq) \
+ BOOST_SCOPE_EXIT_AUX_IMPL_LAMBDA(id, \
+ /* C++11 allows to use typename outside templates so */ \
+ /* always typename here and no need for ..._ALL_TPL */ \
+ /* (if a C++11 compiler does not implement this use of */ \
+ /* typename, always use `this` instead of `this_`) */ \
+ typename, \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_ALL( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_NON_VOID_LIST(seq)))
+# define BOOST_SCOPE_EXIT_ALL(seq) \
+ BOOST_SCOPE_EXIT_ALL_ID( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER, seq)
+# endif
+#else // Variadic macros (both sequences and variadic tuples).
+# define BOOST_SCOPE_EXIT_ID(id, ...) \
+ BOOST_SCOPE_EXIT_AUX_IMPL(id, BOOST_PP_EMPTY(), \
+ BOOST_SCOPE_EXIT_AUX_TRAITS( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST(__VA_ARGS__)))
+# define BOOST_SCOPE_EXIT_ID_TPL(id, ...) \
+ BOOST_SCOPE_EXIT_AUX_IMPL(id, typename, \
+ BOOST_SCOPE_EXIT_AUX_TRAITS( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST(__VA_ARGS__)))
+# define BOOST_SCOPE_EXIT(...) \
+ BOOST_SCOPE_EXIT_ID(BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER, \
+ __VA_ARGS__)
+# define BOOST_SCOPE_EXIT_TPL(...) \
+ BOOST_SCOPE_EXIT_ID_TPL(BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER, \
+ __VA_ARGS__)
+# if !defined(BOOST_NO_LAMBDAS)
+# define BOOST_SCOPE_EXIT_ALL_ID(id, ...) \
+ BOOST_SCOPE_EXIT_AUX_IMPL_LAMBDA(id, \
+ /* C++11 allows to use typename outside templates so */ \
+ /* always typename here and no need for ..._ALL_TPL */ \
+ /* (if a C++11 compiler does not implement this use of */ \
+ /* typename, always use `this` instead of `this_`) */ \
+ typename, \
+ BOOST_SCOPE_EXIT_AUX_TRAITS_ALL( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_NON_VOID_LIST( \
+ __VA_ARGS__)))
+# define BOOST_SCOPE_EXIT_ALL(...) \
+ BOOST_SCOPE_EXIT_ALL_ID( \
+ BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER, __VA_ARGS__)
+# endif
+#endif // Variadics.
+
+#if defined(BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS) && \
+ !defined(BOOST_NO_LAMBDAS) // Use lambdas for SCOPE_EXIT (not just ALL).
+# define BOOST_SCOPE_EXIT_END_ID(id) \
+ ; /* lambdas ended with just `;` */
+#else // Not using lambdas.
+# define BOOST_SCOPE_EXIT_END_ID(id) \
+ } BOOST_SCOPE_EXIT_AUX_GUARD(id)(BOOST_SCOPE_EXIT_AUX_ARGS.value);
+#endif // Using lambdas.
+#define BOOST_SCOPE_EXIT_END \
+ BOOST_SCOPE_EXIT_END_ID(BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER)
+
+// DOCUMENTATION //
+
+#else // DOXYGEN
+
+/** @file
+@brief Scope exits allow to execute arbitrary code when the enclosing scope
+exits.
+*/
+
+/**
+@brief This macro declares a scope exit.
+
+The scope exit declaration schedules the execution of the scope exit body at
+the exit of the enclosing scope:
+
+@code
+ { // Some local scope.
+ ...
+ BOOST_SCOPE_EXIT(capture_list) {
+ ... // Body code.
+ } BOOST_SCOPE_EXIT_END
+ ...
+ }
+@endcode
+
+The enclosing scope must be local.
+If multiple scope exits are declared within the same enclosing scope, the scope
+exit bodies are executed in the reversed order of their declarations.
+Note how the end of the scope exit body must be marked by
+@RefMacro{BOOST_SCOPE_EXIT_END}.
+
+@Params
+@Param{capture_list,
+On compilers that support variadic macros (see also Boost.Config
+<c>BOOST_NO_VARIADIC_MACROS</c>)\, the capture list syntax is defined by the
+following grammar:
+@code
+ capture_list:
+ void | capture_tuple | capture_sequence
+ capture_tuple:
+ capture\, capture\, ...
+ capture_sequence:
+ (capture) (capture) ...
+ capture:
+ [&]variable | this_
+@endcode
+On compilers that do not support variadic macros\, <c>capture_tuple</c> cannot
+be used:
+@code
+ capture_list:
+ void | capture_sequence
+@endcode
+Furthermore\, if @RefMacro{BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS} is defined on
+C++11 compilers that support lambda functions (i.e.\, Boost.Config's <c>BOOST_NO_LAMBDAS</c> is not defined) then a semicolon <c>;</c> can be used instead of
+@RefMacro{BOOST_SCOPE_EXIT_END} and <c>this</c> can be used instead of
+<c>this_</c>:
+@code
+ capture:
+ [&]variable | this_ | this
+@endcode
+
+(Lexical conventions: <c>token1 | token2</c> means either <c>token1</c> or
+<c>token2</c>; <c>[token]</c> means either <c>token</c> or nothing;
+<c>{expression}</c> means the tokens resulting from the expression.)
+}
+@EndParams
+
+Note that on compilers that support variadic macros (most of moder compliers
+and all C++11 compilers), the capture list can be specified as a
+comma-separated list of tokens (this is the preferred syntax).
+However, on all compilers the same macro @RefMacro{BOOST_SCOPE_EXIT} also
+allows to specify the capture list as a Boost.Preprocessor sequence of tokens
+(for supporting compilers without variadic macros and for backward compatibility with older versions of this library).
+
+The name <c>variable</c> of each captured variable must be a valid name in the
+enclosing scope and it must appear exactly once in the capture list.
+If a capture starts with the ampersand sign <c>&</c>, the corresponding
+variable will be available by reference within the scope exit body; otherwise,
+a copy of the variable will be made at the point of the scope exit declaration
+and that copy will be available inside the scope exit body (in this case, the
+variable's type must be <c>CopyConstructible</c>).
+
+From within a member function, the object <c>this</c> can be captured using the
+special name <c>this_</c> in both the capture list and the scope exit body
+(using <c>this</c> instead of <c>this_</c> in the scope exit body leads to
+undefined behaviour).
+
+It is possible to capture no variable by specifying the capture list as
+<c>void</c> (regardless of variadic macro support).
+
+Only variables listed in the capture list, static variables, <c>extern</c>
+variables, global variables, functions, and enumerations from the enclosing
+scope can be used inside the scope exit body.
+
+On various GCC versions the special macro @RefMacro{BOOST_SCOPE_EXIT_TPL} must
+be used instead of @RefMacro{BOOST_SCOPE_EXIT} within templates (to maximize
+portability, it is recommended to always use @RefMacro{BOOST_SCOPE_EXIT_TPL}
+within templates).
+
+On C++11, it is possible capture all variables in scope without listing their
+names one-by-one using the macro @RefMacro{BOOST_SCOPE_EXIT_ALL}.
+
+In general, the special macro @RefMacro{BOOST_SCOPE_EXIT_ID} must be used
+instead of @RefMacro{BOOST_SCOPE_EXIT} when it is necessary to expand multiple
+scope exit declarations on the same line.
+
+@Warning The implementation executes the scope exit body within a destructor
+thus the scope exit body must never throw in order to comply with STL exception
+safety requirements.
+
+@Note The implementation uses Boost.Typeof to automatically deduce the types of
+the captured variables.
+In order to compile code in type-of emulation mode, all types must be properly
+registered with Boost.Typeof (see the
+@RefSect{getting_started, Getting Started} section).
+
+@See @RefSect{tutorial, Tutorial} section,
+@RefSect{getting_started, Getting Started} section,
+@RefSect{no_variadic_macros, No Variadic Macros} section,
+@RefMacro{BOOST_SCOPE_EXIT_TPL}, @RefMacro{BOOST_SCOPE_EXIT_ALL},
+@RefMacro{BOOST_SCOPE_EXIT_END}, @RefMacro{BOOST_SCOPE_EXIT_ID}.
+*/
+#define BOOST_SCOPE_EXIT(capture_list)
+
+/**
+@brief This macro is a workaround for various versions of GCC to declare scope
+exits within templates.
+
+Various versions of the GCC compiler do not compile @RefMacro{BOOST_SCOPE_EXIT}
+inside function templates.
+As a workaround, @RefMacro{BOOST_SCOPE_EXIT_TPL} should be used instead of
+@RefMacro{BOOST_SCOPE_EXIT} in these cases:
+
+@code
+ { // Some local scope.
+ ...
+ BOOST_SCOPE_EXIT_TPL(capture_list) {
+ ... // Body code.
+ } BOOST_SCOPE_EXIT_END
+ ...
+ }
+@endcode
+
+The syntax of @RefMacro{BOOST_SCOPE_EXIT_TPL} is the exact same as the one of
+@RefMacro{BOOST_SCOPE_EXIT} (see @RefMacro{BOOST_SCOPE_EXIT} for more
+information).
+
+On C++11 compilers, @RefMacro{BOOST_SCOPE_EXIT_TPL} is not needed because
+@RefMacro{BOOST_SCOPE_EXIT} always compiles on GCC versions that support C++11.
+However, @RefMacro{BOOST_SCOPE_EXIT_TPL} is still provided on C++11 so to write code that is portable between C++03 and C++11 compilers.
+It is recommended to always use @RefMacro{BOOST_SCOPE_EXIT_TPL} within
+templates so to maximize portability.
+
+In general, the special macro @RefMacro{BOOST_SCOPE_EXIT_ID_TPL} must be used
+instead of @RefMacro{BOOST_SCOPE_EXIT_TPL} when it is necessary to expand
+multiple scope exit declarations on the same line within templates.
+
+@Note The issue in compiling scope exit declarations that some GCC versions
+have is illustrated by the following code (see also
+<a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37920">GCC bug 37920</a>):
+@code
+ template<class T>
+ void f(T const& x) {
+ int i = 0;
+ struct local {
+ typedef __typeof__(i) typeof_i;
+ typedef __typeof__(x) typeof_x;
+ };
+ typedef local::typeof_i i_type;
+ typedef local::typeof_x x_type;
+ }
+
+ int main(void) { f(0); }
+@endcode
+This can be fixed by adding <c>typename</c> in front of <c>local::typeof_i</c>
+and <c>local::typeof_x</c> (which is the approach followed by the
+implementation of the @RefMacro{BOOST_SCOPE_EXIT_TPL} macro).
+
+@Note Although @RefMacro{BOOST_SCOPE_EXIT_TPL} has the same suffix as
+<c>BOOST_TYPEOF_TPL</c>, it does not follow the Boost.Typeof convention.
+
+@See @RefSect{tutorial, Tutorial} section, @RefMacro{BOOST_SCOPE_EXIT},
+@RefMacro{BOOST_SCOPE_EXIT_END}, @RefMacro{BOOST_SCOPE_EXIT_ID_TPL}.
+*/
+#define BOOST_SCOPE_EXIT_TPL(capture_list)
+
+/**
+@brief This macro allows to expand multiple scope exit declarations on the same
+line.
+
+This macro is equivalent to @RefMacro{BOOST_SCOPE_EXIT} but it can be expanded
+multiple times on the same line if different identifiers <c>id</c> are provided
+for each expansion (see @RefMacro{BOOST_SCOPE_EXIT} for more information).
+
+@Params
+@Param{id,
+A unique identifier token which can be concatenated by the preprocessor
+(<c>__LINE__</c>\, <c>scope_exit_number_1_on_line_123</c>\, a combination of
+alphanumeric tokens\, etc).
+}
+@Param{capture_list,
+Same as the <c>capture_list</c> parameter of the @RefMacro{BOOST_SCOPE_EXIT}
+macro.
+}
+@EndParams
+
+@Note This macro can be useful when the scope exit macros are expanded
+within user-defined macros (because nested macros expand on the same line).
+On some compilers (e.g., MSVC which supports the non standard
+<c>__COUNTER__</c> macro) it might not be necessary to use this macro but
+the use of this macro is always necessary to ensure portability when expanding
+multiple scope exit declarations on the same line.
+
+@See @RefSect{tutorial, Tutorial} section, @RefMacro{BOOST_SCOPE_EXIT},
+@RefMacro{BOOST_SCOPE_EXIT_END_ID}, @RefMacro{BOOST_SCOPE_EXIT_ALL_ID},
+@RefMacro{BOOST_SCOPE_EXIT_ID_TPL}.
+*/
+#define BOOST_SCOPE_EXIT_ID(id, capture_list)
+
+/**
+@brief This macro is required to expand multiple scope exit declarations on the
+same line within templates on various versions of GCC.
+
+This macro is equivalent to @RefMacro{BOOST_SCOPE_EXIT_TPL} but it can be
+expanded multiple times on the same line if different identifiers <c>id</c> are
+provided for each expansion (see @RefMacro{BOOST_SCOPE_EXIT_TPL} for more
+information).
+As with @RefMacro{BOOST_SCOPE_EXIT_TPL}, it is recommended to always use this
+macro when expanding scope exits multiple times on the same line within
+templates.
+
+@Params
+@Param{id,
+A unique identifier token which can be concatenated by the preprocessor
+(<c>__LINE__</c>\, <c>scope_exit_number_1_on_line_123</c>\, a combination of
+alphanumeric tokens\, etc).
+}
+@Param{capture_list,
+Same as the <c>capture_list</c> parameter of the
+@RefMacro{BOOST_SCOPE_EXIT_TPL} macro.
+}
+@EndParams
+
+@Note This macro can be useful when the scope exit macros are expanded
+within user-defined macros (because nested macros expand on the same line).
+On some compilers (e.g., MSVC which supports the non standard
+<c>__COUNTER__</c> macro) it might not be necessary to use this macro but
+the use of this macro is always necessary to ensure portability when expanding
+multiple scope exit declarations on the same line.
+
+@See @RefSect{tutorial, Tutorial} section, @RefMacro{BOOST_SCOPE_EXIT_TPL},
+@RefMacro{BOOST_SCOPE_EXIT_END_ID}, @RefMacro{BOOST_SCOPE_EXIT_ID},
+@RefMacro{BOOST_SCOPE_EXIT_ALL_ID}.
+*/
+#define BOOST_SCOPE_EXIT_ID_TPL(id, capture_list)
+
+/**
+@brief This macro declares a scope exit that captures all variables in scope
+(C++11 only).
+
+This macro accepts a capture list starting with either <c>&</c> or <c>=</c> to capture all variables in scope by reference or value respectively (following the same syntax of C++11 lambdas).
+A part from that, this macro works like @RefMacro{BOOST_SCOPE_EXIT} (see @RefMacro{BOOST_SCOPE_EXIT} for more information):
+
+@code
+ { // Some local scope.
+ ...
+ BOOST_SCOPE_EXIT_ALL(capture_list) { // C++11 only.
+ ... // Body code.
+ }; // Use `;` instead of `BOOST_SCOPE_EXIT_END` (C++11 only).
+ ...
+ }
+@endcode
+
+Note how the end of the scope exit body declared by this macro must be marked
+by a semi-column <c>;</c> (and not by @RefMacro{BOOST_SCOPE_EXIT_END}).
+
+@Warning This macro is only available on C++11 compilers (specifically, on
+C++11 compilers that do not define the Boost.Config <c>BOOST_NO_LAMBDAS</c>
+macro).
+It is not defined on non-C++11 compilers so its use on non-C++11 compilers will generate a compiler error.
+
+@Params
+@Param{capture_list,
+On compilers that support variadic macros (see also Boost.Config
+<c>BOOST_NO_VARIADIC_MACROS</c>)\, the capture list syntax is defined by the
+following grammar:
+@code
+capture_list:
+ capture_tuple | capture_sequence
+capture_tuple:
+ {& | =} [\, capture\, capture\, ...]
+capture_sequence:
+ {(&) | (=)} [(capture) (capture) ...]
+capture:
+ [&]variable | this_
+@endcode
+On compilers that do not support variadic macros\, <c>capture_tuple</c> cannot
+be used:
+@code
+ capture_list:
+ void | capture_sequence
+@endcode
+Furthermore\, on C++11 compilers that support the use of <c>typename</c>
+outside templates\, also <c>this</c> can be used to capture the object at member
+function scope:
+@code
+ capture:
+ [&]variable | this_ | this
+@endcode
+
+(Lexical conventions: <c>token1 | token2</c> means either <c>token1</c> or
+<c>token2</c>; <c>[token]</c> means either <c>token</c> or nothing;
+<c>{expression}</c> means the token resulting from the expression.)
+}
+@EndParams
+
+Note that on compilers with variadic macro support (which should be all C++11
+compilers), the capture list can be specified as a comma-separated list.
+On all compilers, the same macro @RefMacro{BOOST_SCOPE_EXIT_ALL} also allows to
+specify the capture list as a Boost.Preprocessor sequence.
+
+The capture list must always contain at least the leading <c>&</c> or <c>=</c>
+so it can never be <c>void</c> (<c>BOOST_SCOPE_EXIT(void)</c> should be used
+to program scope exits with an empty capture list).
+
+In general, the special macro @RefMacro{BOOST_SCOPE_EXIT_ALL_ID} must be used
+instead of @RefMacro{BOOST_SCOPE_EXIT_ALL} when it is necessary to expand
+multiple scope exit declarations on the same line.
+
+@Warning This macro capture list follows the exact same syntax of C++11 lambda
+captures which is unfortunately different from the syntax of
+@RefMacro{BOOST_SCOPE_EXIT} captures (unless programmers define the
+@RefMacro{BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS} macro).
+For example, like C++11 lambda functions, @RefMacro{BOOST_SCOPE_EXIT_ALL}
+requires to capture data members by capturing the object <c>this</c> while
+@RefMacro{BOOST_SCOPE_EXIT} allows to capture data members directly and without
+capturing the object.
+
+@Warning The implementation executes the scope exit body within a destructor
+thus the scope exit body must never throw in order to comply with STL exception
+safety requirements.
+
+@Note This macro can always be used also within templates (so there is no need
+for a <c>BOOST_SCOPE_EXIT_ALL_TPL</c> macro).
+
+@See @RefSect{tutorial, Tutorial} section,
+@RefSect{no_variadic_macros, No Variadic Macros} section,
+@RefMacro{BOOST_SCOPE_EXIT}, @RefMacro{BOOST_SCOPE_EXIT_ALL_ID}.
+*/
+#define BOOST_SCOPE_EXIT_ALL(capture_list)
+
+/**
+@brief This macro allows to expand on the same line multiple scope exits that
+capture all variables in scope (C++11 only).
+
+This macro is equivalent to @RefMacro{BOOST_SCOPE_EXIT_ALL} but it can be
+expanded multiple times on the same line if different identifiers <c>id</c> are
+provided for each expansion (see @RefMacro{BOOST_SCOPE_EXIT_ALL} for more
+information).
+As with @RefMacro{BOOST_SCOPE_EXIT_ALL}, this macro is only available on C++11
+compilers (specifically, on C++11 compilers that do not define the
+Boost.Config <c>BOOST_NO_LAMBDAS</c> macro).
+
+@Params
+@Param{id,
+A unique identifier token which can be concatenated by the preprocessor
+(<c>__LINE__</c>\, <c>scope_exit_number_1_on_line_123</c>\, a combination of
+alphanumeric tokens\, etc).
+}
+@Param{capture_list,
+Same as the <c>capture_list</c> parameter of the
+@RefMacro{BOOST_SCOPE_EXIT_ALL} macro.
+}
+@EndParams
+
+@Note This macro can be useful when the scope exit macros are expanded
+within user-defined macros (because nested macros expand on the same line).
+On some compilers (e.g., MSVC which supports the non standard
+<c>__COUNTER__</c> macro) it might not be necessary to use this macro but
+the use of this macro is always necessary to ensure portability when expanding
+multiple scope exit declarations on the same line.
+
+@See @RefSect{tutorial, Tutorial} section, @RefMacro{BOOST_SCOPE_EXIT_ALL},
+@RefMacro{BOOST_SCOPE_EXIT_ID}.
+*/
+#define BOOST_SCOPE_EXIT_ALL_ID(id, capture_list)
+
+/**
+@brief This macro marks the end of a scope exit body.
+
+This macro must follow the closing curly bracket <c>}</c> that ends the body of
+either @RefMacro{BOOST_SCOPE_EXIT} or @RefMacro{BOOST_SCOPE_EXIT_TPL}:
+
+@code
+ { // Some local scope.
+ ...
+ BOOST_SCOPE_EXIT(capture_list) {
+ ... // Body code.
+ } BOOST_SCOPE_EXIT_END
+ ...
+ }
+@endcode
+
+In general, the special macro @RefMacro{BOOST_SCOPE_EXIT_END_ID} must be used
+instead of @RefMacro{BOOST_SCOPE_EXIT_END} when it is necessary to expand
+multiple scope exit bodies on the same line.
+
+@Note If programmers define the @RefMacro{BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS}
+macro on C++11 compilers, a semicolon <c>;</c> can be used instead of this
+macro.
+However, to maximize portability, it is recommended to always use
+@RefMacro{BOOST_SCOPE_EXIT_END}.
+
+@See @RefSect{tutorial, Tutorial} section, @RefMacro{BOOST_SCOPE_EXIT},
+@RefMacro{BOOST_SCOPE_EXIT_TPL}, @RefMacro{BOOST_SCOPE_EXIT_END_ID}.
+*/
+#define BOOST_SCOPE_EXIT_END
+
+/**
+@brief This macro allows to terminate multiple scope exit bodies on the same
+line.
+
+This macro is equivalent to @RefMacro{BOOST_SCOPE_EXIT_END} but it can be
+expanded multiple times on the same line if different identifiers <c>id</c> are
+provided for each expansion (see @RefMacro{BOOST_SCOPE_EXIT_END} for more
+information).
+
+@Params
+@Param{id,
+A unique identifier token which can be concatenated by the preprocessor
+(<c>__LINE__</c>\, <c>scope_exit_number_1_on_line_123</c>\, a combination of
+alphanumeric tokens\, etc).
+}
+@EndParams
+
+@Note This macro can be useful when the scope exit macros are expanded
+within user-defined macros (because macros all expand on the same line).
+On some compilers (e.g., MSVC which supports the non standard
+<c>__COUNTER__</c> macro) it might not be necessary to use this macro but
+the use of this macro is always necessary to ensure portability when expanding
+multiple scope exit macros on the same line (because this library can only
+portably use <c>__LINE__</c> to internally generate unique identifiers).
+
+@See @RefMacro{BOOST_SCOPE_EXIT_ID}, @RefMacro{BOOST_SCOPE_EXIT_ID_TPL},
+@RefMacro{BOOST_SCOPE_EXIT_END}.
+*/
+#define BOOST_SCOPE_EXIT_END_ID(id)
+
+/**
+@brief Force to use C++11 lambda functions to implement scope exits.
+
+If programmers define this configuration macro on a C++11 compiler for which
+the Boost.Config macro <c>BOOST_NO_LAMBDAS</c> is not defined, the
+@RefMacro{BOOST_SCOPE_EXIT} and @RefMacro{BOOST_SCOPE_EXIT_TPL} macros will use
+C++11 lambda functions to declare scope exits.
+By default this macro is not defined.
+
+@Warning When scope exits are implemented using lambda functions, the syntax of
+the capture list follows the exact same syntax of C++11 lambda captures
+which is in general different from the legacy capture syntax of this library.
+For example, C++11 lambdas require to capture data members by capturing the
+object <c>this</c> while this library always allowed to capture data members
+directly.
+Therefore, when this configuration macro is defined,
+@RefMacro{BOOST_SCOPE_EXIT} and @RefMacro{BOOST_SCOPE_EXIT_TPL} are no longer
+backward compatible (and this is why this macro is not defined by default).
+
+A semicolon <c>;</c> can be used instead of @RefMacro{BOOST_SCOPE_EXIT_END}
+when this configuration macro is defined (but it is recommended to always use
+@RefMacro{BOOST_SCOPE_EXIT_END} so to maximize portability).
+
+@Note This configuration macro does not control the definition of
+@RefMacro{BOOST_SCOPE_EXIT_ALL} which is always and automatically defined on
+compilers that support C++11 lambda functions.
+
+@See @RefMacro{BOOST_SCOPE_EXIT}, @RefMacro{BOOST_SCOPE_EXIT_TPL},
+@RefMacro{BOOST_SCOPE_EXIT_END}.
+*/
+#define BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS
+
+#endif // DOXYGEN
#endif // #ifndef FILE_boost_scope_exit_hpp_INCLUDED
diff --git a/boost/serialization/detail/get_data.hpp b/boost/serialization/detail/get_data.hpp
index 0e9c190295..3cbcb4a30c 100644
--- a/boost/serialization/detail/get_data.hpp
+++ b/boost/serialization/detail/get_data.hpp
@@ -19,11 +19,12 @@
#define STD std
#endif
-
#include <vector>
#include <valarray>
-namespace boost { namespace serialization { namespace detail {
+namespace boost {
+namespace serialization {
+namespace detail {
template <class T, class Allocator>
T* get_data(STD::vector<T,Allocator>& v)
@@ -37,7 +38,6 @@ T* get_data(STD::vector<T,Allocator> const & v)
return get_data(const_cast<STD::vector<T,Allocator>&>(v));
}
-
template <class T>
T* get_data(STD::valarray<T>& v)
{
@@ -50,6 +50,12 @@ const T* get_data(STD::valarray<T> const& v)
return get_data(const_cast<STD::valarray<T>&>(v));
}
-} } } //namespace boost::serialization::detail
+} // detail
+} // serialization
+} // boost
+
+#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
+#undef STD
+#endif
#endif // BOOST_SERIALIZATION_DETAIL_GET_DATA_HPP
diff --git a/boost/serialization/extended_type_info_no_rtti.hpp b/boost/serialization/extended_type_info_no_rtti.hpp
index 0f0b275a49..025b3f6964 100644
--- a/boost/serialization/extended_type_info_no_rtti.hpp
+++ b/boost/serialization/extended_type_info_no_rtti.hpp
@@ -147,7 +147,7 @@ public:
}
virtual void destroy(void const * const p) const{
boost::serialization::access::destroy(
- static_cast<T const * const>(p)
+ static_cast<T const *>(p)
);
//delete static_cast<T const * const>(p) ;
}
diff --git a/boost/serialization/extended_type_info_typeid.hpp b/boost/serialization/extended_type_info_typeid.hpp
index d60c369fde..9f09587d67 100644
--- a/boost/serialization/extended_type_info_typeid.hpp
+++ b/boost/serialization/extended_type_info_typeid.hpp
@@ -131,7 +131,7 @@ public:
}
virtual void destroy(void const * const p) const {
boost::serialization::access::destroy(
- static_cast<T const * const>(p)
+ static_cast<T const *>(p)
);
//delete static_cast<T const * const>(p);
}
diff --git a/boost/serialization/factory.hpp b/boost/serialization/factory.hpp
index 73f660416f..a25bf204fd 100644
--- a/boost/serialization/factory.hpp
+++ b/boost/serialization/factory.hpp
@@ -24,7 +24,7 @@
#include <boost/preprocessor/facilities/empty.hpp>
namespace std{
- #if defined(__LIBCOMO__) || defined(__QNXNTO__)
+ #if defined(__LIBCOMO__)
using ::va_list;
#endif
} // namespace std
diff --git a/boost/serialization/force_include.hpp b/boost/serialization/force_include.hpp
index a18a8a1b65..5578ee81d6 100644
--- a/boost/serialization/force_include.hpp
+++ b/boost/serialization/force_include.hpp
@@ -40,11 +40,11 @@
# if defined(__MWERKS__)
# define BOOST_DLLEXPORT __declspec(dllexport)
# elif defined(__GNUC__) && (__GNUC__ >= 3)
-# define BOOST_USED __attribute__ ((used))
+# define BOOST_USED __attribute__ ((__used__))
# elif defined(__IBMCPP__) && (__IBMCPP__ >= 1110)
-# define BOOST_USED __attribute__ ((used))
+# define BOOST_USED __attribute__ ((__used__))
# elif defined(__INTEL_COMPILER) && (BOOST_INTEL_CXX_VERSION >= 800)
-# define BOOST_USED __attribute__ ((used))
+# define BOOST_USED __attribute__ ((__used__))
# endif
#endif
diff --git a/boost/serialization/valarray.hpp b/boost/serialization/valarray.hpp
index c018279d1f..4bf722f4d3 100644
--- a/boost/serialization/valarray.hpp
+++ b/boost/serialization/valarray.hpp
@@ -31,7 +31,8 @@
#define STD std
#endif
-namespace boost { namespace serialization {
+namespace boost {
+namespace serialization {
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// valarray< T >
@@ -45,7 +46,6 @@ void save( Archive & ar, const STD::valarray<U> &t, const unsigned int /*file_ve
ar << make_array(detail::get_data(t), t.size());
}
-
template<class Archive, class U>
void load( Archive & ar, STD::valarray<U> &t, const unsigned int /*file_version*/ )
{
diff --git a/boost/serialization/vector.hpp b/boost/serialization/vector.hpp
index 0fde185a08..7520c09a00 100644
--- a/boost/serialization/vector.hpp
+++ b/boost/serialization/vector.hpp
@@ -35,6 +35,14 @@
#define BOOST_SERIALIZATION_VECTOR_VERSIONED(V) (V==4 || V==5)
#endif
+// function specializations must be defined in the appropriate
+// namespace - boost::serialization
+#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
+#define STD _STLP_STD
+#else
+#define STD std
+#endif
+
namespace boost {
namespace serialization {
@@ -207,5 +215,6 @@ inline void serialize(
#include <boost/serialization/collection_traits.hpp>
BOOST_SERIALIZATION_COLLECTION_TRAITS(std::vector)
+#undef STD
#endif // BOOST_SERIALIZATION_VECTOR_HPP
diff --git a/boost/serialization/vector_135.hpp b/boost/serialization/vector_135.hpp
index 3554a24471..2097cf641e 100644
--- a/boost/serialization/vector_135.hpp
+++ b/boost/serialization/vector_135.hpp
@@ -18,7 +18,7 @@
#error Boost.Serialization cannot be compatible with both 1.35 and 1.36-1.40 files
#endif
#else
-#define BOOST_SERIALIZATION_VECTOR_VERSIONED(V) (V==4)
+#define BOOST_SERIALIZATION_VECTOR_VERSIONED(V) (V>4)
#endif
#include <boost/serialization/vector.hpp>
diff --git a/boost/signals2/detail/foreign_ptr.hpp b/boost/signals2/detail/foreign_ptr.hpp
index 3e2357b8e8..47c5996205 100644
--- a/boost/signals2/detail/foreign_ptr.hpp
+++ b/boost/signals2/detail/foreign_ptr.hpp
@@ -18,12 +18,15 @@
#include <boost/smart_ptr/bad_weak_ptr.hpp>
#include <boost/utility/swap.hpp>
-#if !defined(BOOST_INTEL_STDCXX0X)
-namespace std
-{
- template<typename T> class shared_ptr;
- template<typename T> class weak_ptr;
-}
+//FIXME: this is a hack to deal with the fact BOOST_NO_CXX_SMART_PTR doesn't
+// exist yet in boost.config. It will fail on a library which implements
+// C++11 std::tuple but not std::shared_ptr and std::weak_ptr.
+#ifdef BOOST_NO_CXX11_HDR_TUPLE
+#define BOOST_SIGNALS2_NO_CXX11_SMART_PTR
+#endif
+
+#ifndef BOOST_SIGNALS2_NO_CXX11_SMART_PTR
+#include <memory>
#endif
namespace boost
@@ -39,10 +42,12 @@ namespace boost
{
typedef boost::shared_ptr<T> shared_type;
};
+#ifndef BOOST_SIGNALS2_NO_CXX11_SMART_PTR
template<typename T> struct weak_ptr_traits<std::weak_ptr<T> >
{
typedef std::shared_ptr<T> shared_type;
};
+#endif
template<typename SharedPtr> struct shared_ptr_traits
{};
@@ -51,10 +56,12 @@ namespace boost
{
typedef boost::weak_ptr<T> weak_type;
};
+#ifndef BOOST_SIGNALS2_NO_CXX11_SMART_PTR
template<typename T> struct shared_ptr_traits<std::shared_ptr<T> >
{
typedef std::weak_ptr<T> weak_type;
};
+#endif
namespace detail
{
diff --git a/boost/signals2/detail/variadic_slot_invoker.hpp b/boost/signals2/detail/variadic_slot_invoker.hpp
index 08059b5d0a..b7659a5668 100644
--- a/boost/signals2/detail/variadic_slot_invoker.hpp
+++ b/boost/signals2/detail/variadic_slot_invoker.hpp
@@ -16,10 +16,16 @@
#define BOOST_SIGNALS2_DETAIL_VARIADIC_SLOT_INVOKER_HPP
#include <boost/signals2/detail/variadic_arg_type.hpp>
-// if compiler has variadic template support, we assume they have
-// a variadic std::tuple implementation here. We don't use boost::tuple
-// because it does not have variadic template support at present.
+
+// if compiler has std::tuple use it instead of boost::tuple
+// because boost::tuple does not have variadic template support at present.
+#ifdef BOOST_NO_CXX11_HDR_TUPLE
+#include <boost/tuple.hpp>
+#define BOOST_SIGNALS2_TUPLE boost::tuple
+#else
#include <tuple>
+#define BOOST_SIGNALS2_TUPLE std::tuple
+#endif
namespace boost
{
@@ -65,7 +71,7 @@ namespace boost
typedef R result_type;
template<typename Func, typename ... Args>
- R operator()(Func &func, std::tuple<Args...> args) const
+ R operator()(Func &func, BOOST_SIGNALS2_TUPLE<Args...> args) const
{
typedef typename make_unsigned_meta_array<sizeof...(Args)>::type indices_type;
typename Func::result_type *resolver = 0;
@@ -73,12 +79,12 @@ namespace boost
}
private:
template<typename T, typename Func, unsigned ... indices, typename ... Args>
- R m_invoke(T *, Func &func, unsigned_meta_array<indices...>, std::tuple<Args...> args) const
+ R m_invoke(T *, Func &func, unsigned_meta_array<indices...>, BOOST_SIGNALS2_TUPLE<Args...> args) const
{
return func(std::get<indices>(args)...);
}
template<typename Func, unsigned ... indices, typename ... Args>
- R m_invoke(void *, Func &func, unsigned_meta_array<indices...>, std::tuple<Args...> args) const
+ R m_invoke(void *, Func &func, unsigned_meta_array<indices...>, BOOST_SIGNALS2_TUPLE<Args...> args) const
{
func(std::get<indices>(args)...);
return R();
@@ -113,7 +119,7 @@ namespace boost
{
return call_with_tuple_args<result_type>()(connectionBody->slot.slot_function(), _args);
}
- std::tuple<Args& ...> _args;
+ BOOST_SIGNALS2_TUPLE<Args& ...> _args;
};
} // namespace detail
} // namespace signals2
diff --git a/boost/smart_ptr/detail/sp_counted_base.hpp b/boost/smart_ptr/detail/sp_counted_base.hpp
index 8401bfecbc..24adfcc225 100644
--- a/boost/smart_ptr/detail/sp_counted_base.hpp
+++ b/boost/smart_ptr/detail/sp_counted_base.hpp
@@ -41,6 +41,9 @@
#elif defined(__HP_aCC) && defined(__ia64)
# include <boost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp>
+#elif defined( __IBMCPP__ ) && defined( __powerpc )
+# include <boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp>
+
#elif defined( __MWERKS__ ) && defined( __POWERPC__ )
# include <boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp>
@@ -59,9 +62,6 @@
#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined(__CYGWIN__)
# include <boost/smart_ptr/detail/sp_counted_base_w32.hpp>
-#elif defined( _AIX )
-# include <boost/smart_ptr/detail/sp_counted_base_aix.hpp>
-
#elif !defined( BOOST_HAS_THREADS )
# include <boost/smart_ptr/detail/sp_counted_base_nt.hpp>
diff --git a/boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp b/boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp
new file mode 100644
index 0000000000..842f58f17e
--- /dev/null
+++ b/boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp
@@ -0,0 +1,150 @@
+#ifndef BOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_VACPP_PPC_HPP_INCLUDED
+#define BOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_VACPP_PPC_HPP_INCLUDED
+
+//
+// detail/sp_counted_base_vacpp_ppc.hpp - xlC(vacpp) on POWER
+// based on: detail/sp_counted_base_w32.hpp
+//
+// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
+// Copyright 2004-2005 Peter Dimov
+// Copyright 2006 Michael van der Westhuizen
+// Copyright 2012 IBM Corp.
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+//
+// Lock-free algorithm by Alexander Terekhov
+//
+// Thanks to Ben Hitchings for the #weak + (#shared != 0)
+// formulation
+//
+
+#include <boost/detail/sp_typeinfo.hpp>
+
+extern "builtin" void __lwsync(void);
+extern "builtin" void __isync(void);
+extern "builtin" int __fetch_and_add(volatile int* addr, int val);
+extern "builtin" int __compare_and_swap(volatile int*, int*, int);
+
+namespace boost
+{
+
+namespace detail
+{
+
+inline void atomic_increment( int *pw )
+{
+ // ++*pw;
+ __lwsync();
+ __fetch_and_add(pw, 1);
+ __isync();
+}
+
+inline int atomic_decrement( int *pw )
+{
+ // return --*pw;
+ __lwsync();
+ int originalValue = __fetch_and_add(pw, -1);
+ __isync();
+
+ return (originalValue - 1);
+}
+
+inline int atomic_conditional_increment( int *pw )
+{
+ // if( *pw != 0 ) ++*pw;
+ // return *pw;
+
+ __lwsync();
+ int v = *const_cast<volatile int*>(pw);
+ for (;;)
+ // loop until state is known
+ {
+ if (v == 0) return 0;
+ if (__compare_and_swap(pw, &v, v + 1))
+ {
+ __isync(); return (v + 1);
+ }
+ }
+}
+
+class sp_counted_base
+{
+private:
+
+ sp_counted_base( sp_counted_base const & );
+ sp_counted_base & operator= ( sp_counted_base const & );
+
+ int use_count_; // #shared
+ int weak_count_; // #weak + (#shared != 0)
+ char pad[64] __attribute__((__aligned__(64)));
+ // pad to prevent false sharing
+public:
+
+ sp_counted_base(): use_count_( 1 ), weak_count_( 1 )
+ {
+ }
+
+ virtual ~sp_counted_base() // nothrow
+ {
+ }
+
+ // dispose() is called when use_count_ drops to zero, to release
+ // the resources managed by *this.
+
+ virtual void dispose() = 0; // nothrow
+
+ // destroy() is called when weak_count_ drops to zero.
+
+ virtual void destroy() // nothrow
+ {
+ delete this;
+ }
+
+ virtual void * get_deleter( sp_typeinfo const & ti ) = 0;
+
+ void add_ref_copy()
+ {
+ atomic_increment( &use_count_ );
+ }
+
+ bool add_ref_lock() // true on success
+ {
+ return atomic_conditional_increment( &use_count_ ) != 0;
+ }
+
+ void release() // nothrow
+ {
+ if( atomic_decrement( &use_count_ ) == 0 )
+ {
+ dispose();
+ weak_release();
+ }
+ }
+
+ void weak_add_ref() // nothrow
+ {
+ atomic_increment( &weak_count_ );
+ }
+
+ void weak_release() // nothrow
+ {
+ if( atomic_decrement( &weak_count_ ) == 0 )
+ {
+ destroy();
+ }
+ }
+
+ long use_count() const // nothrow
+ {
+ return *const_cast<volatile int*>(&use_count_);
+ }
+};
+
+} // namespace detail
+
+} // namespace boost
+
+#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_VACPP_PPC_HPP_INCLUDED
diff --git a/boost/smart_ptr/detail/spinlock_gcc_arm.hpp b/boost/smart_ptr/detail/spinlock_gcc_arm.hpp
index f58ea44168..f1bbaf66c6 100644
--- a/boost/smart_ptr/detail/spinlock_gcc_arm.hpp
+++ b/boost/smart_ptr/detail/spinlock_gcc_arm.hpp
@@ -43,13 +43,38 @@ public:
{
int r;
+#if defined(__ARM_ARCH_6__) \
+ || defined(__ARM_ARCH_6J__) \
+ || defined(__ARM_ARCH_6K__) \
+ || defined(__ARM_ARCH_6Z__) \
+ || defined(__ARM_ARCH_6ZK__) \
+ || defined(__ARM_ARCH_6T2__) \
+ || defined(__ARM_ARCH_7__) \
+ || defined(__ARM_ARCH_7A__) \
+ || defined(__ARM_ARCH_7R__) \
+ || defined(__ARM_ARCH_7M__) \
+ || defined(__ARM_ARCH_7EM__)
+
+ __asm__ __volatile__(
+ "ldrex %0, [%2]; \n"
+ "cmp %0, %1; \n"
+ "strexne %0, %1, [%2]; \n"
+ BOOST_SP_ARM_BARRIER :
+ "=&r"( r ): // outputs
+ "r"( 1 ), "r"( &v_ ): // inputs
+ "memory", "cc" );
+
+#else
+
__asm__ __volatile__(
- "swp %0, %1, [%2]\n\t"
- BOOST_SP_ARM_BARRIER :
+ "swp %0, %1, [%2];\n"
+ BOOST_SP_ARM_BARRIER :
"=&r"( r ): // outputs
"r"( 1 ), "r"( &v_ ): // inputs
"memory", "cc" );
+#endif
+
return r == 0;
}
diff --git a/boost/spirit/actor.hpp b/boost/spirit/actor.hpp
deleted file mode 100644
index c46777cd03..0000000000
--- a/boost/spirit/actor.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_ACTOR
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_ACTOR
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_actor.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_actor.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_actor.hpp>
-
-#endif
diff --git a/boost/spirit/actor/assign_actor.hpp b/boost/spirit/actor/assign_actor.hpp
deleted file mode 100644
index 625887dff4..0000000000
--- a/boost/spirit/actor/assign_actor.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_ASSIGN_ACTOR
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_ASSIGN_ACTOR
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_assign_actor.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_assign_actor.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_assign_actor.hpp>
-
-#endif
diff --git a/boost/spirit/actor/assign_key_actor.hpp b/boost/spirit/actor/assign_key_actor.hpp
deleted file mode 100644
index 4095d31d2c..0000000000
--- a/boost/spirit/actor/assign_key_actor.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_ASSIGN_KEY_ACTOR
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_ASSIGN_KEY_ACTOR
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_assign_key_actor.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_assign_key_actor.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_assign_key_actor.hpp>
-
-#endif
diff --git a/boost/spirit/actor/clear_actor.hpp b/boost/spirit/actor/clear_actor.hpp
deleted file mode 100644
index 03a34b21c7..0000000000
--- a/boost/spirit/actor/clear_actor.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_CLEAR_ACTOR
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_CLEAR_ACTOR
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_clear_actor.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_clear_actor.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_clear_actor.hpp>
-
-#endif
diff --git a/boost/spirit/actor/decrement_actor.hpp b/boost/spirit/actor/decrement_actor.hpp
deleted file mode 100644
index 4f9f99069d..0000000000
--- a/boost/spirit/actor/decrement_actor.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_DECREMENT_ACTOR
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_DECREMENT_ACTOR
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_decrement_actor.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_decrement_actor.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_decrement_actor.hpp>
-
-#endif
diff --git a/boost/spirit/actor/erase_actor.hpp b/boost/spirit/actor/erase_actor.hpp
deleted file mode 100644
index f2811580e0..0000000000
--- a/boost/spirit/actor/erase_actor.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_ERASE_ACTOR
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_ERASE_ACTOR
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_erase_actor.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_erase_actor.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_erase_actor.hpp>
-
-#endif
diff --git a/boost/spirit/actor/increment_actor.hpp b/boost/spirit/actor/increment_actor.hpp
deleted file mode 100644
index ef4c525e7d..0000000000
--- a/boost/spirit/actor/increment_actor.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_INCREMENT_ACTOR
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_INCREMENT_ACTOR
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_increment_actor.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_increment_actor.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_increment_actor.hpp>
-
-#endif
diff --git a/boost/spirit/actor/insert_at_actor.hpp b/boost/spirit/actor/insert_at_actor.hpp
deleted file mode 100644
index ae9e34dc29..0000000000
--- a/boost/spirit/actor/insert_at_actor.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_INSERT_AT_ACTOR
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_INSERT_AT_ACTOR
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_insert_at_actor.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_insert_at_actor.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_insert_at_actor.hpp>
-
-#endif
diff --git a/boost/spirit/actor/insert_key_actor.hpp b/boost/spirit/actor/insert_key_actor.hpp
deleted file mode 100644
index a5cb44222a..0000000000
--- a/boost/spirit/actor/insert_key_actor.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_INSERT_KEY_ACTOR
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_INSERT_KEY_ACTOR
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_insert_key_actor.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_insert_key_actor.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_insert_key_actor.hpp>
-
-#endif
diff --git a/boost/spirit/actor/push_back_actor.hpp b/boost/spirit/actor/push_back_actor.hpp
deleted file mode 100644
index 84c6bdfba9..0000000000
--- a/boost/spirit/actor/push_back_actor.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_PUSH_BACK_ACTOR
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_PUSH_BACK_ACTOR
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_push_back_actor.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_push_back_actor.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_push_back_actor.hpp>
-
-#endif
diff --git a/boost/spirit/actor/push_front_actor.hpp b/boost/spirit/actor/push_front_actor.hpp
deleted file mode 100644
index 0718ae17aa..0000000000
--- a/boost/spirit/actor/push_front_actor.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_PUSH_FRONT_ACTOR
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_PUSH_FRONT_ACTOR
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_push_front_actor.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_push_front_actor.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_push_front_actor.hpp>
-
-#endif
diff --git a/boost/spirit/actor/ref_actor.hpp b/boost/spirit/actor/ref_actor.hpp
deleted file mode 100644
index f107842310..0000000000
--- a/boost/spirit/actor/ref_actor.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_REF_ACTOR
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_REF_ACTOR
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_ref_actor.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_ref_actor.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_ref_actor.hpp>
-
-#endif
diff --git a/boost/spirit/actor/ref_const_ref_actor.hpp b/boost/spirit/actor/ref_const_ref_actor.hpp
deleted file mode 100644
index ea380b538f..0000000000
--- a/boost/spirit/actor/ref_const_ref_actor.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_REF_CONST_REF_ACTOR
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_REF_CONST_REF_ACTOR
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_ref_const_ref_actor.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_ref_const_ref_actor.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_ref_const_ref_actor.hpp>
-
-#endif
diff --git a/boost/spirit/actor/ref_const_ref_const_ref_a.hpp b/boost/spirit/actor/ref_const_ref_const_ref_a.hpp
deleted file mode 100644
index 092a25239b..0000000000
--- a/boost/spirit/actor/ref_const_ref_const_ref_a.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_REF_CONST_REF_CONST_REF_A
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_REF_CONST_REF_CONST_REF_A
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_ref_const_ref_const_ref_a.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_ref_const_ref_const_ref_a.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_ref_const_ref_const_ref_a.hpp>
-
-#endif
diff --git a/boost/spirit/actor/ref_const_ref_value_actor.hpp b/boost/spirit/actor/ref_const_ref_value_actor.hpp
deleted file mode 100644
index e94a764c1f..0000000000
--- a/boost/spirit/actor/ref_const_ref_value_actor.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_REF_CONST_REF_VALUE_ACTOR
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_REF_CONST_REF_VALUE_ACTOR
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_ref_const_ref_value_actor.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_ref_const_ref_value_actor.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_ref_const_ref_value_actor.hpp>
-
-#endif
diff --git a/boost/spirit/actor/ref_value_actor.hpp b/boost/spirit/actor/ref_value_actor.hpp
deleted file mode 100644
index cbc8b4abae..0000000000
--- a/boost/spirit/actor/ref_value_actor.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_REF_VALUE_ACTOR
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_REF_VALUE_ACTOR
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_ref_value_actor.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_ref_value_actor.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_ref_value_actor.hpp>
-
-#endif
diff --git a/boost/spirit/actor/swap_actor.hpp b/boost/spirit/actor/swap_actor.hpp
deleted file mode 100644
index 132060d35f..0000000000
--- a/boost/spirit/actor/swap_actor.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_SWAP_ACTOR
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_SWAP_ACTOR
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_swap_actor.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_swap_actor.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_swap_actor.hpp>
-
-#endif
diff --git a/boost/spirit/actor/typeof.hpp b/boost/spirit/actor/typeof.hpp
deleted file mode 100644
index bc2335fb43..0000000000
--- a/boost/spirit/actor/typeof.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_TYPEOF
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_TYPEOF
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_typeof.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_typeof.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_typeof.hpp>
-
-#endif
diff --git a/boost/spirit/attribute.hpp b/boost/spirit/attribute.hpp
deleted file mode 100644
index 3f9f31b03e..0000000000
--- a/boost/spirit/attribute.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_ATTRIBUTE
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_ATTRIBUTE
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_attribute.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_attribute.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_attribute.hpp>
-
-#endif
diff --git a/boost/spirit/attribute/closure.hpp b/boost/spirit/attribute/closure.hpp
deleted file mode 100644
index e0c9207eff..0000000000
--- a/boost/spirit/attribute/closure.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_CLOSURE
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_CLOSURE
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_closure.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_closure.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_closure.hpp>
-
-#endif
diff --git a/boost/spirit/attribute/closure_context.hpp b/boost/spirit/attribute/closure_context.hpp
deleted file mode 100644
index 266ee58663..0000000000
--- a/boost/spirit/attribute/closure_context.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_CLOSURE_CONTEXT
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_CLOSURE_CONTEXT
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_closure_context.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_closure_context.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_closure_context.hpp>
-
-#endif
diff --git a/boost/spirit/attribute/closure_fwd.hpp b/boost/spirit/attribute/closure_fwd.hpp
deleted file mode 100644
index e1d4e64eb4..0000000000
--- a/boost/spirit/attribute/closure_fwd.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_CLOSURE_FWD
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_CLOSURE_FWD
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_closure_fwd.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_closure_fwd.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_closure_fwd.hpp>
-
-#endif
diff --git a/boost/spirit/attribute/parametric.hpp b/boost/spirit/attribute/parametric.hpp
deleted file mode 100644
index c9a26d411a..0000000000
--- a/boost/spirit/attribute/parametric.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_PARAMETRIC
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_PARAMETRIC
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_parametric.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_parametric.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_parametric.hpp>
-
-#endif
diff --git a/boost/spirit/attribute/typeof.hpp b/boost/spirit/attribute/typeof.hpp
deleted file mode 100644
index 7d9176ff82..0000000000
--- a/boost/spirit/attribute/typeof.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_TYPEOF_ATTRIBUTE
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_TYPEOF_ATTRIBUTE
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_typeof.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_typeof.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_typeof.hpp>
-
-#endif
diff --git a/boost/spirit/core.hpp b/boost/spirit/core.hpp
deleted file mode 100644
index 61658b33c7..0000000000
--- a/boost/spirit/core.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_CORE
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_CORE
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_core.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_core.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_core.hpp>
-
-#endif
diff --git a/boost/spirit/core/assert.hpp b/boost/spirit/core/assert.hpp
deleted file mode 100644
index cdbd306071..0000000000
--- a/boost/spirit/core/assert.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_ASSERT
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_ASSERT
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_assert.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_assert.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_assert.hpp>
-
-#endif
diff --git a/boost/spirit/core/composite/actions.hpp b/boost/spirit/core/composite/actions.hpp
deleted file mode 100644
index d35d5e3330..0000000000
--- a/boost/spirit/core/composite/actions.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_ACTIONS
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_ACTIONS
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_actions.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_actions.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_actions.hpp>
-
-#endif
diff --git a/boost/spirit/core/composite/alternative.hpp b/boost/spirit/core/composite/alternative.hpp
deleted file mode 100644
index 7acff66ae0..0000000000
--- a/boost/spirit/core/composite/alternative.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_ALTERNATIVE
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_ALTERNATIVE
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_alternative.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_alternative.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_alternative.hpp>
-
-#endif
diff --git a/boost/spirit/core/composite/composite.hpp b/boost/spirit/core/composite/composite.hpp
deleted file mode 100644
index 3ce954d3e8..0000000000
--- a/boost/spirit/core/composite/composite.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_COMPOSITE
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_COMPOSITE
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_composite.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_composite.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_composite.hpp>
-
-#endif
diff --git a/boost/spirit/core/composite/difference.hpp b/boost/spirit/core/composite/difference.hpp
deleted file mode 100644
index d9be5c34e4..0000000000
--- a/boost/spirit/core/composite/difference.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_DIFFERENCE
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_DIFFERENCE
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_difference.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_difference.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_difference.hpp>
-
-#endif
diff --git a/boost/spirit/core/composite/directives.hpp b/boost/spirit/core/composite/directives.hpp
deleted file mode 100644
index a29e744d62..0000000000
--- a/boost/spirit/core/composite/directives.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_DIRECTIVES
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_DIRECTIVES
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_directives.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_directives.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_directives.hpp>
-
-#endif
diff --git a/boost/spirit/core/composite/epsilon.hpp b/boost/spirit/core/composite/epsilon.hpp
deleted file mode 100644
index eda988f430..0000000000
--- a/boost/spirit/core/composite/epsilon.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_EPSILON
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_EPSILON
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_epsilon.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_epsilon.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_epsilon.hpp>
-
-#endif
diff --git a/boost/spirit/core/composite/exclusive_or.hpp b/boost/spirit/core/composite/exclusive_or.hpp
deleted file mode 100644
index 0443e28a41..0000000000
--- a/boost/spirit/core/composite/exclusive_or.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_EXCLUSIVE_OR
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_EXCLUSIVE_OR
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_exclusive_or.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_exclusive_or.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_exclusive_or.hpp>
-
-#endif
diff --git a/boost/spirit/core/composite/intersection.hpp b/boost/spirit/core/composite/intersection.hpp
deleted file mode 100644
index 7007c00159..0000000000
--- a/boost/spirit/core/composite/intersection.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_INTERSECTION
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_INTERSECTION
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_intersection.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_intersection.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_intersection.hpp>
-
-#endif
diff --git a/boost/spirit/core/composite/kleene_star.hpp b/boost/spirit/core/composite/kleene_star.hpp
deleted file mode 100644
index aa00bdd293..0000000000
--- a/boost/spirit/core/composite/kleene_star.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_KLEENE_STAR
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_KLEENE_STAR
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_kleene_star.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_kleene_star.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_kleene_star.hpp>
-
-#endif
diff --git a/boost/spirit/core/composite/list.hpp b/boost/spirit/core/composite/list.hpp
deleted file mode 100644
index b01a9dc360..0000000000
--- a/boost/spirit/core/composite/list.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_LIST
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_LIST
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_list.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_list.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_list.hpp>
-
-#endif
diff --git a/boost/spirit/core/composite/no_actions.hpp b/boost/spirit/core/composite/no_actions.hpp
deleted file mode 100644
index 634a4b0a1a..0000000000
--- a/boost/spirit/core/composite/no_actions.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_NO_ACTIONS
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_NO_ACTIONS
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_no_actions.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_no_actions.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_no_actions.hpp>
-
-#endif
diff --git a/boost/spirit/core/composite/operators.hpp b/boost/spirit/core/composite/operators.hpp
deleted file mode 100644
index 5474f2a55a..0000000000
--- a/boost/spirit/core/composite/operators.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_OPERATORS
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_OPERATORS
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_operators.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_operators.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_operators.hpp>
-
-#endif
diff --git a/boost/spirit/core/composite/optional.hpp b/boost/spirit/core/composite/optional.hpp
deleted file mode 100644
index 3fee63ec9d..0000000000
--- a/boost/spirit/core/composite/optional.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_OPTIONAL
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_OPTIONAL
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_optional.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_optional.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_optional.hpp>
-
-#endif
diff --git a/boost/spirit/core/composite/positive.hpp b/boost/spirit/core/composite/positive.hpp
deleted file mode 100644
index 846638d901..0000000000
--- a/boost/spirit/core/composite/positive.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_POSITIVE
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_POSITIVE
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_positive.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_positive.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_positive.hpp>
-
-#endif
diff --git a/boost/spirit/core/composite/sequence.hpp b/boost/spirit/core/composite/sequence.hpp
deleted file mode 100644
index 9c23b0bfc6..0000000000
--- a/boost/spirit/core/composite/sequence.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_SEQUENCE
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_SEQUENCE
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_sequence.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_sequence.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_sequence.hpp>
-
-#endif
diff --git a/boost/spirit/core/composite/sequential_and.hpp b/boost/spirit/core/composite/sequential_and.hpp
deleted file mode 100644
index 174576ad0a..0000000000
--- a/boost/spirit/core/composite/sequential_and.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_SEQUENTIAL_AND
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_SEQUENTIAL_AND
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_sequential_and.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_sequential_and.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_sequential_and.hpp>
-
-#endif
diff --git a/boost/spirit/core/composite/sequential_or.hpp b/boost/spirit/core/composite/sequential_or.hpp
deleted file mode 100644
index 7de6326dd5..0000000000
--- a/boost/spirit/core/composite/sequential_or.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_SEQUENTIAL_OR
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_SEQUENTIAL_OR
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_sequential_or.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_sequential_or.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_sequential_or.hpp>
-
-#endif
diff --git a/boost/spirit/core/config.hpp b/boost/spirit/core/config.hpp
deleted file mode 100644
index ca038686a1..0000000000
--- a/boost/spirit/core/config.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_CONFIG
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_CONFIG
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_config.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_config.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_config.hpp>
-
-#endif
diff --git a/boost/spirit/core/match.hpp b/boost/spirit/core/match.hpp
deleted file mode 100644
index 37b98fea0a..0000000000
--- a/boost/spirit/core/match.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_MATCH
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_MATCH
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_match.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_match.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_match.hpp>
-
-#endif
diff --git a/boost/spirit/core/nil.hpp b/boost/spirit/core/nil.hpp
deleted file mode 100644
index a62da8f655..0000000000
--- a/boost/spirit/core/nil.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_NIL
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_NIL
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_nil.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_nil.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_nil.hpp>
-
-#endif
diff --git a/boost/spirit/core/non_terminal/grammar.hpp b/boost/spirit/core/non_terminal/grammar.hpp
deleted file mode 100644
index 81e3bb8d18..0000000000
--- a/boost/spirit/core/non_terminal/grammar.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_GRAMMAR
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_GRAMMAR
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_grammar.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_grammar.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_grammar.hpp>
-
-#endif
diff --git a/boost/spirit/core/non_terminal/parser_context.hpp b/boost/spirit/core/non_terminal/parser_context.hpp
deleted file mode 100644
index 5652a5fbf9..0000000000
--- a/boost/spirit/core/non_terminal/parser_context.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_PARSER_CONTEXT
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_PARSER_CONTEXT
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_parser_context.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_parser_context.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_parser_context.hpp>
-
-#endif
diff --git a/boost/spirit/core/non_terminal/parser_id.hpp b/boost/spirit/core/non_terminal/parser_id.hpp
deleted file mode 100644
index 1f850339ee..0000000000
--- a/boost/spirit/core/non_terminal/parser_id.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_PARSER_ID
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_PARSER_ID
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_parser_id.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_parser_id.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_parser_id.hpp>
-
-#endif
diff --git a/boost/spirit/core/non_terminal/rule.hpp b/boost/spirit/core/non_terminal/rule.hpp
deleted file mode 100644
index 47ae7c9302..0000000000
--- a/boost/spirit/core/non_terminal/rule.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_RULE
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_RULE
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_rule.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_rule.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_rule.hpp>
-
-#endif
diff --git a/boost/spirit/core/non_terminal/subrule.hpp b/boost/spirit/core/non_terminal/subrule.hpp
deleted file mode 100644
index 913b46211f..0000000000
--- a/boost/spirit/core/non_terminal/subrule.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_SUBRULE
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_SUBRULE
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_subrule.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_subrule.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_subrule.hpp>
-
-#endif
diff --git a/boost/spirit/core/non_terminal/subrule_fwd.hpp b/boost/spirit/core/non_terminal/subrule_fwd.hpp
deleted file mode 100644
index b6d1efaadc..0000000000
--- a/boost/spirit/core/non_terminal/subrule_fwd.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_SUBRULE_FWD
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_SUBRULE_FWD
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_subrule_fwd.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_subrule_fwd.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_subrule_fwd.hpp>
-
-#endif
diff --git a/boost/spirit/core/parser.hpp b/boost/spirit/core/parser.hpp
deleted file mode 100644
index aa051417f2..0000000000
--- a/boost/spirit/core/parser.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_PARSER
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_PARSER
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_parser.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_parser.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_parser.hpp>
-
-#endif
diff --git a/boost/spirit/core/primitives/numerics.hpp b/boost/spirit/core/primitives/numerics.hpp
deleted file mode 100644
index e03218f67e..0000000000
--- a/boost/spirit/core/primitives/numerics.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_NUMERICS
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_NUMERICS
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_numerics.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_numerics.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_numerics.hpp>
-
-#endif
diff --git a/boost/spirit/core/primitives/numerics_fwd.hpp b/boost/spirit/core/primitives/numerics_fwd.hpp
deleted file mode 100644
index 18916968a4..0000000000
--- a/boost/spirit/core/primitives/numerics_fwd.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_NUMERICS_FWD
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_NUMERICS_FWD
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_numerics_fwd.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_numerics_fwd.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_numerics_fwd.hpp>
-
-#endif
diff --git a/boost/spirit/core/primitives/primitives.hpp b/boost/spirit/core/primitives/primitives.hpp
deleted file mode 100644
index 316b6ceca7..0000000000
--- a/boost/spirit/core/primitives/primitives.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_PRIMITIVES
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_PRIMITIVES
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_primitives.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_primitives.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_primitives.hpp>
-
-#endif
diff --git a/boost/spirit/core/safe_bool.hpp b/boost/spirit/core/safe_bool.hpp
deleted file mode 100644
index 5dd9decd81..0000000000
--- a/boost/spirit/core/safe_bool.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_SAFE_BOOL
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_SAFE_BOOL
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_safe_bool.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_safe_bool.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_safe_bool.hpp>
-
-#endif
diff --git a/boost/spirit/core/scanner/scanner.hpp b/boost/spirit/core/scanner/scanner.hpp
deleted file mode 100644
index a6aac3c46f..0000000000
--- a/boost/spirit/core/scanner/scanner.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_SCANNER
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_SCANNER
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_scanner.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_scanner.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_scanner.hpp>
-
-#endif
diff --git a/boost/spirit/core/scanner/scanner_fwd.hpp b/boost/spirit/core/scanner/scanner_fwd.hpp
deleted file mode 100644
index 96c597ffbf..0000000000
--- a/boost/spirit/core/scanner/scanner_fwd.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_SCANNER_FWD
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_SCANNER_FWD
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_scanner_fwd.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_scanner_fwd.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_scanner_fwd.hpp>
-
-#endif
diff --git a/boost/spirit/core/scanner/skipper.hpp b/boost/spirit/core/scanner/skipper.hpp
deleted file mode 100644
index 35fe3f1e65..0000000000
--- a/boost/spirit/core/scanner/skipper.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_SKIPPER
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_SKIPPER
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_skipper.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_skipper.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_skipper.hpp>
-
-#endif
diff --git a/boost/spirit/core/scanner/skipper_fwd.hpp b/boost/spirit/core/scanner/skipper_fwd.hpp
deleted file mode 100644
index aa09e9ddbc..0000000000
--- a/boost/spirit/core/scanner/skipper_fwd.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_SKIPPER_FWD
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_SKIPPER_FWD
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_skipper_fwd.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_skipper_fwd.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_skipper_fwd.hpp>
-
-#endif
diff --git a/boost/spirit/core/typeof.hpp b/boost/spirit/core/typeof.hpp
deleted file mode 100644
index b7d5199863..0000000000
--- a/boost/spirit/core/typeof.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_TYPEOF_CORE
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_TYPEOF_CORE
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_typeof.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_typeof.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_typeof.hpp>
-
-#endif
diff --git a/boost/spirit/debug.hpp b/boost/spirit/debug.hpp
deleted file mode 100644
index 5cec6e62e4..0000000000
--- a/boost/spirit/debug.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_DEBUG
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_DEBUG
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_debug.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_debug.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_debug.hpp>
-
-#endif
diff --git a/boost/spirit/debug/debug_node.hpp b/boost/spirit/debug/debug_node.hpp
deleted file mode 100644
index b4f94ee642..0000000000
--- a/boost/spirit/debug/debug_node.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_DEBUG_NODE
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_DEBUG_NODE
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_debug_node.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_debug_node.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_debug_node.hpp>
-
-#endif
diff --git a/boost/spirit/debug/minimal.hpp b/boost/spirit/debug/minimal.hpp
deleted file mode 100644
index f8a7262afb..0000000000
--- a/boost/spirit/debug/minimal.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_MINIMAL
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_MINIMAL
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_minimal.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_minimal.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_minimal.hpp>
-
-#endif
diff --git a/boost/spirit/debug/parser_names.hpp b/boost/spirit/debug/parser_names.hpp
deleted file mode 100644
index 3d280cabe2..0000000000
--- a/boost/spirit/debug/parser_names.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_PARSER_NAMES
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_PARSER_NAMES
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_parser_names.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_parser_names.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_parser_names.hpp>
-
-#endif
diff --git a/boost/spirit/debug/typeof.hpp b/boost/spirit/debug/typeof.hpp
deleted file mode 100644
index 48c4edcbf7..0000000000
--- a/boost/spirit/debug/typeof.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_TYPEOF_DEBUG
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_TYPEOF_DEBUG
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_typeof.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_typeof.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_typeof.hpp>
-
-#endif
diff --git a/boost/spirit/dynamic.hpp b/boost/spirit/dynamic.hpp
deleted file mode 100644
index 313db18c12..0000000000
--- a/boost/spirit/dynamic.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_DYNAMIC
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_DYNAMIC
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_dynamic.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_dynamic.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_dynamic.hpp>
-
-#endif
diff --git a/boost/spirit/dynamic/for.hpp b/boost/spirit/dynamic/for.hpp
deleted file mode 100644
index 460d1588a2..0000000000
--- a/boost/spirit/dynamic/for.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_FOR
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_FOR
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_for.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_for.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_for.hpp>
-
-#endif
diff --git a/boost/spirit/dynamic/if.hpp b/boost/spirit/dynamic/if.hpp
deleted file mode 100644
index 45a571a25f..0000000000
--- a/boost/spirit/dynamic/if.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_IF
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_IF
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_if.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_if.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_if.hpp>
-
-#endif
diff --git a/boost/spirit/dynamic/lazy.hpp b/boost/spirit/dynamic/lazy.hpp
deleted file mode 100644
index 3ef13e0764..0000000000
--- a/boost/spirit/dynamic/lazy.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_LAZY
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_LAZY
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_lazy.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_lazy.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_lazy.hpp>
-
-#endif
diff --git a/boost/spirit/dynamic/rule_alias.hpp b/boost/spirit/dynamic/rule_alias.hpp
deleted file mode 100644
index 71881947c3..0000000000
--- a/boost/spirit/dynamic/rule_alias.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_RULE_ALIAS
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_RULE_ALIAS
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_rule_alias.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_rule_alias.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_rule_alias.hpp>
-
-#endif
diff --git a/boost/spirit/dynamic/select.hpp b/boost/spirit/dynamic/select.hpp
deleted file mode 100644
index b334b6fc1b..0000000000
--- a/boost/spirit/dynamic/select.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_SELECT
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_SELECT
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_select.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_select.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_select.hpp>
-
-#endif
diff --git a/boost/spirit/dynamic/stored_rule.hpp b/boost/spirit/dynamic/stored_rule.hpp
deleted file mode 100644
index e61c5c120e..0000000000
--- a/boost/spirit/dynamic/stored_rule.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_STORED_RULE
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_STORED_RULE
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_stored_rule.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_stored_rule.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_stored_rule.hpp>
-
-#endif
diff --git a/boost/spirit/dynamic/stored_rule_fwd.hpp b/boost/spirit/dynamic/stored_rule_fwd.hpp
deleted file mode 100644
index 9924af1417..0000000000
--- a/boost/spirit/dynamic/stored_rule_fwd.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_STORED_RULE_FWD
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_STORED_RULE_FWD
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_stored_rule_fwd.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_stored_rule_fwd.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_stored_rule_fwd.hpp>
-
-#endif
diff --git a/boost/spirit/dynamic/switch.hpp b/boost/spirit/dynamic/switch.hpp
deleted file mode 100644
index 78ee46b6b5..0000000000
--- a/boost/spirit/dynamic/switch.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_SWITCH
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_SWITCH
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_switch.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_switch.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_switch.hpp>
-
-#endif
diff --git a/boost/spirit/dynamic/typeof.hpp b/boost/spirit/dynamic/typeof.hpp
deleted file mode 100644
index 02374c2780..0000000000
--- a/boost/spirit/dynamic/typeof.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_TYPEOF_DYNAMIC
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_TYPEOF_DYNAMIC
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_typeof.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_typeof.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_typeof.hpp>
-
-#endif
diff --git a/boost/spirit/dynamic/while.hpp b/boost/spirit/dynamic/while.hpp
deleted file mode 100644
index f09971d809..0000000000
--- a/boost/spirit/dynamic/while.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_WHILE
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_WHILE
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_while.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_while.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_while.hpp>
-
-#endif
diff --git a/boost/spirit/error_handling.hpp b/boost/spirit/error_handling.hpp
deleted file mode 100644
index 5a434d712b..0000000000
--- a/boost/spirit/error_handling.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_ERROR_HANDLING
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_ERROR_HANDLING
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_error_handling.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_error_handling.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_error_handling.hpp>
-
-#endif
diff --git a/boost/spirit/error_handling/exceptions.hpp b/boost/spirit/error_handling/exceptions.hpp
deleted file mode 100644
index 80cd7bfcf2..0000000000
--- a/boost/spirit/error_handling/exceptions.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_EXCEPTIONS
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_EXCEPTIONS
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_exceptions.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_exceptions.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_exceptions.hpp>
-
-#endif
diff --git a/boost/spirit/error_handling/exceptions_fwd.hpp b/boost/spirit/error_handling/exceptions_fwd.hpp
deleted file mode 100644
index 27dd9ab437..0000000000
--- a/boost/spirit/error_handling/exceptions_fwd.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_EXCEPTIONS_FWD
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_EXCEPTIONS_FWD
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_exceptions_fwd.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_exceptions_fwd.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_exceptions_fwd.hpp>
-
-#endif
diff --git a/boost/spirit/error_handling/typeof.hpp b/boost/spirit/error_handling/typeof.hpp
deleted file mode 100644
index 6ce3318fc3..0000000000
--- a/boost/spirit/error_handling/typeof.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_TYPEOF_ERROR_HANDLING
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_TYPEOF_ERROR_HANDLING
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_typeof.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_typeof.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_typeof.hpp>
-
-#endif
diff --git a/boost/spirit/home/qi/detail/assign_to.hpp b/boost/spirit/home/qi/detail/assign_to.hpp
index a94010ca91..38142bf1b3 100644
--- a/boost/spirit/home/qi/detail/assign_to.hpp
+++ b/boost/spirit/home/qi/detail/assign_to.hpp
@@ -28,11 +28,25 @@ namespace boost { namespace spirit { namespace traits
// accept spirit's unused_type; all no-ops. Compiler optimization will
// easily strip these away.
///////////////////////////////////////////////////////////////////////////
+ namespace detail
+ {
+ template <typename T>
+ struct is_iter_range : mpl::false_ {};
+
+ template <typename I>
+ struct is_iter_range<boost::iterator_range<I> > : mpl::true_ {};
+
+ template <typename C>
+ struct is_container_of_ranges
+ : is_iter_range<typename C::value_type> {};
+ }
+
template <typename Attribute, typename Iterator, typename Enable>
struct assign_to_attribute_from_iterators
{
+ // Common case
static void
- call(Iterator const& first, Iterator const& last, Attribute& attr)
+ call(Iterator const& first, Iterator const& last, Attribute& attr, mpl::false_)
{
if (traits::is_empty(attr))
attr = Attribute(first, last);
@@ -41,6 +55,21 @@ namespace boost { namespace spirit { namespace traits
push_back(attr, *i);
}
}
+
+ // If Attribute is a container with value_type==iterator_range<T> just push the
+ // iterator_range into it
+ static void
+ call(Iterator const& first, Iterator const& last, Attribute& attr, mpl::true_)
+ {
+ typename Attribute::value_type rng(first, last);
+ push_back(attr, rng);
+ }
+
+ static void
+ call(Iterator const& first, Iterator const& last, Attribute& attr)
+ {
+ call(first, last, attr, detail::is_container_of_ranges<Attribute>());
+ }
};
template <typename Attribute, typename Iterator>
diff --git a/boost/spirit/home/support/detail/endian.hpp b/boost/spirit/home/support/detail/endian.hpp
index 3507aaafd5..85f13dda55 100644
--- a/boost/spirit/home/support/detail/endian.hpp
+++ b/boost/spirit/home/support/detail/endian.hpp
@@ -1,6 +1,6 @@
// Copyright (c) 2001-2011 Hartmut Kaiser
// http://spirit.sourceforge.net/
-//
+//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,12 +18,6 @@
#define BOOST_ENDIAN_FORCE_PODNESS 1
#endif
-// If Boost has the endian library, use it, otherwise use an adapted version
-// included with Spirit
-#if BOOST_VERSION >= 105000
-#include <boost/endian/integers.hpp>
-#else
#include <boost/spirit/home/support/detail/endian/endian.hpp>
-#endif
#endif
diff --git a/boost/spirit/home/support/utree/detail/utree_detail2.hpp b/boost/spirit/home/support/utree/detail/utree_detail2.hpp
index f08e199cfb..789d99d482 100644
--- a/boost/spirit/home/support/utree/detail/utree_detail2.hpp
+++ b/boost/spirit/home/support/utree/detail/utree_detail2.hpp
@@ -1043,7 +1043,7 @@ namespace boost { namespace spirit
if (!pos.node)
{
l.push_back(val);
- return utree::iterator(l.first, 0); // begin();
+ return utree::iterator(l.last, l.last->prev);
}
l.insert(val, pos);
return utree::iterator(pos.node->prev, pos.node->prev->prev);
diff --git a/boost/spirit/include/version.hpp b/boost/spirit/include/version.hpp
index 1e677a4853..90f8b53313 100644
--- a/boost/spirit/include/version.hpp
+++ b/boost/spirit/include/version.hpp
@@ -14,7 +14,7 @@
// This is the version of the current Spirit distribution
//
///////////////////////////////////////////////////////////////////////////////
-#define SPIRIT_VERSION 0x2050
-#define SPIRIT_PIZZA_VERSION DEEP_PAN_BBQ // :-O
+#define SPIRIT_VERSION 0x2053
+#define SPIRIT_PIZZA_VERSION SUPER_HOT_SPANISH_SARDINES // :-O
#endif
diff --git a/boost/spirit/iterator.hpp b/boost/spirit/iterator.hpp
deleted file mode 100644
index b79c348d04..0000000000
--- a/boost/spirit/iterator.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_ITERATOR
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_ITERATOR
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_iterator.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_iterator.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_iterator.hpp>
-
-#endif
diff --git a/boost/spirit/iterator/file_iterator.hpp b/boost/spirit/iterator/file_iterator.hpp
deleted file mode 100644
index da75045294..0000000000
--- a/boost/spirit/iterator/file_iterator.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_FILE_ITERATOR
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_FILE_ITERATOR
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_file_iterator.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_file_iterator.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_file_iterator.hpp>
-
-#endif
diff --git a/boost/spirit/iterator/file_iterator_fwd.hpp b/boost/spirit/iterator/file_iterator_fwd.hpp
deleted file mode 100644
index 7a51754e5b..0000000000
--- a/boost/spirit/iterator/file_iterator_fwd.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_FILE_ITERATOR_FWD
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_FILE_ITERATOR_FWD
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_file_iterator_fwd.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_file_iterator_fwd.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_file_iterator_fwd.hpp>
-
-#endif
diff --git a/boost/spirit/iterator/fixed_size_queue.hpp b/boost/spirit/iterator/fixed_size_queue.hpp
deleted file mode 100644
index 6e7cdbb5a0..0000000000
--- a/boost/spirit/iterator/fixed_size_queue.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_FIXED_SIZE_QUEUE
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_FIXED_SIZE_QUEUE
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_fixed_size_queue.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_fixed_size_queue.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_fixed_size_queue.hpp>
-
-#endif
diff --git a/boost/spirit/iterator/multi_pass.hpp b/boost/spirit/iterator/multi_pass.hpp
deleted file mode 100644
index 91bd91f3f9..0000000000
--- a/boost/spirit/iterator/multi_pass.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_MULTI_PASS
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_MULTI_PASS
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_multi_pass.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_multi_pass.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_multi_pass.hpp>
-
-#endif
diff --git a/boost/spirit/iterator/multi_pass_fwd.hpp b/boost/spirit/iterator/multi_pass_fwd.hpp
deleted file mode 100644
index 8a477d45de..0000000000
--- a/boost/spirit/iterator/multi_pass_fwd.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_MULTI_PASS_FWD
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_MULTI_PASS_FWD
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_multi_pass_fwd.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_multi_pass_fwd.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_multi_pass_fwd.hpp>
-
-#endif
diff --git a/boost/spirit/iterator/position_iterator.hpp b/boost/spirit/iterator/position_iterator.hpp
deleted file mode 100644
index 043ab0ff4b..0000000000
--- a/boost/spirit/iterator/position_iterator.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_POSITION_ITERATOR
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_POSITION_ITERATOR
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_position_iterator.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_position_iterator.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_position_iterator.hpp>
-
-#endif
diff --git a/boost/spirit/iterator/position_iterator_fwd.hpp b/boost/spirit/iterator/position_iterator_fwd.hpp
deleted file mode 100644
index 14d91114b0..0000000000
--- a/boost/spirit/iterator/position_iterator_fwd.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_POSITION_ITERATOR_FWD
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_POSITION_ITERATOR_FWD
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_position_iterator_fwd.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_position_iterator_fwd.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_position_iterator_fwd.hpp>
-
-#endif
diff --git a/boost/spirit/iterator/typeof.hpp b/boost/spirit/iterator/typeof.hpp
deleted file mode 100644
index 8da3962bed..0000000000
--- a/boost/spirit/iterator/typeof.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_TYPEOF_ITERATOR
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_TYPEOF_ITERATOR
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_typeof.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_typeof.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_typeof.hpp>
-
-#endif
diff --git a/boost/spirit/meta.hpp b/boost/spirit/meta.hpp
deleted file mode 100644
index 2bc004b5cb..0000000000
--- a/boost/spirit/meta.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_META
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_META
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_meta.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_meta.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_meta.hpp>
-
-#endif
diff --git a/boost/spirit/meta/as_parser.hpp b/boost/spirit/meta/as_parser.hpp
deleted file mode 100644
index 0326ef09a3..0000000000
--- a/boost/spirit/meta/as_parser.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_AS_PARSER
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_AS_PARSER
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_as_parser.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_as_parser.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_as_parser.hpp>
-
-#endif
diff --git a/boost/spirit/meta/fundamental.hpp b/boost/spirit/meta/fundamental.hpp
deleted file mode 100644
index 4753cc2d3d..0000000000
--- a/boost/spirit/meta/fundamental.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_FUNDAMENTAL
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_FUNDAMENTAL
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_fundamental.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_fundamental.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_fundamental.hpp>
-
-#endif
diff --git a/boost/spirit/meta/parser_traits.hpp b/boost/spirit/meta/parser_traits.hpp
deleted file mode 100644
index 4f0f68c82d..0000000000
--- a/boost/spirit/meta/parser_traits.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_PARSER_TRAITS
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_PARSER_TRAITS
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_parser_traits.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_parser_traits.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_parser_traits.hpp>
-
-#endif
diff --git a/boost/spirit/meta/refactoring.hpp b/boost/spirit/meta/refactoring.hpp
deleted file mode 100644
index 235d61abd3..0000000000
--- a/boost/spirit/meta/refactoring.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_REFACTORING
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_REFACTORING
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_refactoring.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_refactoring.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_refactoring.hpp>
-
-#endif
diff --git a/boost/spirit/meta/traverse.hpp b/boost/spirit/meta/traverse.hpp
deleted file mode 100644
index 594fa8360f..0000000000
--- a/boost/spirit/meta/traverse.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_TRAVERSE
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_TRAVERSE
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_traverse.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_traverse.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_traverse.hpp>
-
-#endif
diff --git a/boost/spirit/phoenix.hpp b/boost/spirit/phoenix.hpp
deleted file mode 100644
index 513b904b7f..0000000000
--- a/boost/spirit/phoenix.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_PHOENIX
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_PHOENIX
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/phoenix1.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/phoenix1.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/phoenix1.hpp>
-
-#endif
diff --git a/boost/spirit/phoenix/actor.hpp b/boost/spirit/phoenix/actor.hpp
deleted file mode 100644
index 665c4ade6c..0000000000
--- a/boost/spirit/phoenix/actor.hpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_PHOENIX_ACTOR
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_PHOENIX_ACTOR
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/phoenix1_actor.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/phoenix1_actor.hpp"
-#endif
-#endif
-
-#include <boost/spirit/include/phoenix1_actor.hpp>
-
-#endif
diff --git a/boost/spirit/phoenix/binders.hpp b/boost/spirit/phoenix/binders.hpp
deleted file mode 100644
index e5aab61004..0000000000
--- a/boost/spirit/phoenix/binders.hpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_BINDERS
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_BINDERS
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/phoenix1_binders.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/phoenix1_binders.hpp"
-#endif
-#endif
-
-#include <boost/spirit/include/phoenix1_binders.hpp>
-
-#endif
diff --git a/boost/spirit/phoenix/casts.hpp b/boost/spirit/phoenix/casts.hpp
deleted file mode 100644
index 1c583bcd51..0000000000
--- a/boost/spirit/phoenix/casts.hpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_CASTS
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_CASTS
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/phoenix1_casts.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/phoenix1_casts.hpp"
-#endif
-#endif
-
-#include <boost/spirit/include/phoenix1_casts.hpp>
-
-#endif
diff --git a/boost/spirit/phoenix/closures.hpp b/boost/spirit/phoenix/closures.hpp
deleted file mode 100644
index ecf7ea563a..0000000000
--- a/boost/spirit/phoenix/closures.hpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_CLOSURES
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_CLOSURES
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/phoenix1_closures.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/phoenix1_closures.hpp"
-#endif
-#endif
-
-#include <boost/spirit/include/phoenix1_closures.hpp>
-
-#endif
diff --git a/boost/spirit/phoenix/composite.hpp b/boost/spirit/phoenix/composite.hpp
deleted file mode 100644
index 51ebb89ae0..0000000000
--- a/boost/spirit/phoenix/composite.hpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_PHOENIX_COMPOSITE
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_PHOENIX_COMPOSITE
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/phoenix1_composite.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/phoenix1_composite.hpp"
-#endif
-#endif
-
-#include <boost/spirit/include/phoenix1_composite.hpp>
-
-#endif
diff --git a/boost/spirit/phoenix/functions.hpp b/boost/spirit/phoenix/functions.hpp
deleted file mode 100644
index 6fbf01ee25..0000000000
--- a/boost/spirit/phoenix/functions.hpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_FUNCTIONS
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_FUNCTIONS
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/phoenix1_functions.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/phoenix1_functions.hpp"
-#endif
-#endif
-
-#include <boost/spirit/include/phoenix1_functions.hpp>
-
-#endif
diff --git a/boost/spirit/phoenix/new.hpp b/boost/spirit/phoenix/new.hpp
deleted file mode 100644
index a348a31183..0000000000
--- a/boost/spirit/phoenix/new.hpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_NEW
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_NEW
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/phoenix1_new.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/phoenix1_new.hpp"
-#endif
-#endif
-
-#include <boost/spirit/include/phoenix1_new.hpp>
-
-#endif
diff --git a/boost/spirit/phoenix/operators.hpp b/boost/spirit/phoenix/operators.hpp
deleted file mode 100644
index 648874f28c..0000000000
--- a/boost/spirit/phoenix/operators.hpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_PHOENIX_OPERATORS
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_PHOENIX_OPERATORS
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/phoenix1_operators.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/phoenix1_operators.hpp"
-#endif
-#endif
-
-#include <boost/spirit/include/phoenix1_operators.hpp>
-
-#endif
diff --git a/boost/spirit/phoenix/primitives.hpp b/boost/spirit/phoenix/primitives.hpp
deleted file mode 100644
index 00a3ebfdc0..0000000000
--- a/boost/spirit/phoenix/primitives.hpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_PHOENIX_PRIMITIVES
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_PHOENIX_PRIMITIVES
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/phoenix1_primitives.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/phoenix1_primitives.hpp"
-#endif
-#endif
-
-#include <boost/spirit/include/phoenix1_primitives.hpp>
-
-#endif
diff --git a/boost/spirit/phoenix/special_ops.hpp b/boost/spirit/phoenix/special_ops.hpp
deleted file mode 100644
index 59930f4b14..0000000000
--- a/boost/spirit/phoenix/special_ops.hpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_SPECIAL_OPS
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_SPECIAL_OPS
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/phoenix1_special_ops.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/phoenix1_special_ops.hpp"
-#endif
-#endif
-
-#include <boost/spirit/include/phoenix1_special_ops.hpp>
-
-#endif
diff --git a/boost/spirit/phoenix/statements.hpp b/boost/spirit/phoenix/statements.hpp
deleted file mode 100644
index a5ae9e0b4e..0000000000
--- a/boost/spirit/phoenix/statements.hpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_STATEMENTS
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_STATEMENTS
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/phoenix1_statements.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/phoenix1_statements.hpp"
-#endif
-#endif
-
-#include <boost/spirit/include/phoenix1_statements.hpp>
-
-#endif
diff --git a/boost/spirit/phoenix/tuple_helpers.hpp b/boost/spirit/phoenix/tuple_helpers.hpp
deleted file mode 100644
index 92a4ce9743..0000000000
--- a/boost/spirit/phoenix/tuple_helpers.hpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_TUPLE_HELPERS
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_TUPLE_HELPERS
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/phoenix1_tuple_helpers.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/phoenix1_tuple_helpers.hpp"
-#endif
-#endif
-
-#include <boost/spirit/include/phoenix1_tuple_helpers.hpp>
-
-#endif
diff --git a/boost/spirit/phoenix/tuples.hpp b/boost/spirit/phoenix/tuples.hpp
deleted file mode 100644
index 1460ac025d..0000000000
--- a/boost/spirit/phoenix/tuples.hpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_TUPLES
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_TUPLES
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/phoenix1_tuples.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/phoenix1_tuples.hpp"
-#endif
-#endif
-
-#include <boost/spirit/include/phoenix1_tuples.hpp>
-
-#endif
diff --git a/boost/spirit/repository/home/qi/directive/kwd.hpp b/boost/spirit/repository/home/qi/directive/kwd.hpp
index 79fdc2f6dc..bba1a78448 100644
--- a/boost/spirit/repository/home/qi/directive/kwd.hpp
+++ b/boost/spirit/repository/home/qi/directive/kwd.hpp
@@ -35,50 +35,98 @@ namespace boost { namespace spirit
struct use_directive<qi::domain
, terminal_ex<repository::tag::kwd // enables kwd(key)[p]
, fusion::vector1<T > >
- > : traits::is_string<T> {};
+ > : mpl::true_ {};
template < typename T>
struct use_directive<qi::domain
, terminal_ex<repository::tag::ikwd // enables ikwd(key)[p]
, fusion::vector1<T > >
- > : traits::is_string<T> {};
+ > : mpl::true_ {};
+ template < typename T>
+ struct use_directive<qi::domain
+ , terminal_ex<repository::tag::dkwd // enables dkwd(key)[p]
+ , fusion::vector1<T > >
+ > : mpl::true_ {};
+ template < typename T>
+ struct use_directive<qi::domain
+ , terminal_ex<repository::tag::idkwd // enables idkwd(key)[p]
+ , fusion::vector1<T > >
+ > : mpl::true_ {};
+
+
template < typename T1, typename T2>
struct use_directive<qi::domain
, terminal_ex<repository::tag::kwd // enables kwd(key,exact)[p]
, fusion::vector2< T1, T2 > >
- > : traits::is_string<T1> {};
+ > : mpl::true_ {};
template < typename T1, typename T2>
struct use_directive<qi::domain
, terminal_ex<repository::tag::ikwd // enables ikwd(key,exact)[p]
, fusion::vector2< T1, T2 > >
- > : traits::is_string<T1> {};
+ > : mpl::true_ {};
template < typename T1, typename T2>
struct use_directive<qi::domain
+ , terminal_ex<repository::tag::dkwd // enables dkwd(key,exact)[p]
+ , fusion::vector2< T1, T2 > >
+ > : mpl::true_ {};
+
+ template < typename T1, typename T2>
+ struct use_directive<qi::domain
+ , terminal_ex<repository::tag::idkwd // enables idkwd(key,exact)[p]
+ , fusion::vector2< T1, T2 > >
+ > : mpl::true_ {};
+
+ template < typename T1, typename T2>
+ struct use_directive<qi::domain
, terminal_ex<repository::tag::kwd // enables kwd(min, max)[p]
, fusion::vector3< T1, T2, T2 > >
- > : traits::is_string<T1> {};
+ > : mpl::true_ {};
template < typename T1, typename T2>
struct use_directive<qi::domain
, terminal_ex<repository::tag::ikwd // enables ikwd(min, max)[p]
, fusion::vector3< T1, T2, T2 > >
- > : traits::is_string<T1> {};
+ > : mpl::true_ {};
+
+ template < typename T1, typename T2>
+ struct use_directive<qi::domain
+ , terminal_ex<repository::tag::dkwd // enables dkwd(min, max)[p]
+ , fusion::vector3< T1, T2, T2 > >
+ > : mpl::true_ {};
template < typename T1, typename T2>
struct use_directive<qi::domain
+ , terminal_ex<repository::tag::idkwd // enables idkwd(min, max)[p]
+ , fusion::vector3< T1, T2, T2 > >
+ > : mpl::true_ {};
+
+ template < typename T1, typename T2>
+ struct use_directive<qi::domain
, terminal_ex<repository::tag::kwd // enables kwd(min, inf)[p]
, fusion::vector3<T1, T2, inf_type > >
- > : traits::is_string<T1> {};
+ > : mpl::true_ {};
template < typename T1, typename T2>
struct use_directive<qi::domain
, terminal_ex<repository::tag::ikwd // enables ikwd(min, inf)[p]
, fusion::vector3<T1, T2, inf_type > >
- > : traits::is_string<T1> {};
+ > : mpl::true_ {};
+
+ template < typename T1, typename T2>
+ struct use_directive<qi::domain
+ , terminal_ex<repository::tag::dkwd // enables dkwd(min, inf)[p]
+ , fusion::vector3<T1, T2, inf_type > >
+ > : mpl::true_ {};
+
+ template < typename T1, typename T2>
+ struct use_directive<qi::domain
+ , terminal_ex<repository::tag::idkwd // enables idkwd(min, inf)[p]
+ , fusion::vector3<T1, T2, inf_type > >
+ > : mpl::true_ {};
/* template <> // enables *lazy* kwd(exact)[p]
@@ -102,6 +150,8 @@ namespace boost { namespace spirit { namespace repository { namespace qi
{
using repository::kwd;
using repository::ikwd;
+ using repository::dkwd;
+ using repository::idkwd;
using spirit::inf;
using spirit::inf_type;
@@ -225,13 +275,14 @@ template <typename T>
int &counter;
};
- template <typename Subject, typename KeywordType, typename LoopIter , typename NoCase >
- struct kwd_parser : spirit::qi::unary_parser<kwd_parser<Subject, KeywordType, LoopIter , NoCase > >
+ template <typename Subject, typename KeywordType, typename LoopIter , typename NoCase, typename Distinct >
+ struct kwd_parser : spirit::qi::unary_parser<kwd_parser<Subject, KeywordType, LoopIter , NoCase, Distinct > >
{
struct kwd_parser_id;
typedef Subject subject_type;
typedef NoCase no_case_keyword;
+ typedef Distinct distinct;
typedef typename
remove_const<typename traits::char_type_of<KeywordType>::type>::type
@@ -256,6 +307,13 @@ template <typename T>
, LoopIter const& iter)
: subject(subject), iter(iter), keyword(keyword) {}
+ template<typename CharEncoding>
+ kwd_parser(Subject const& subject
+ , typename add_reference<KeywordType>::type keyword
+ , LoopIter const& iter, CharEncoding encoding)
+ : subject(subject), iter(iter), keyword(keyword,encoding) {}
+
+
// Call the subject parser on a non container attribute
template <typename Iterator, typename Context
, typename Skipper, typename Attribute>
@@ -329,12 +387,14 @@ template <typename T>
, mpl::not_< traits::is_weak_substitute< subject_attribute,Attribute > >
>::type predicate;
+
// Parse the keyword
bool flag = iter.flag_init();
int counter = 0;
Iterator save = first;
spirit::qi::skip_over(first, last, skipper);
if(keyword.parse(first,last,context,skipper,unused)){
+ if((!distinct::value) || skipper.parse(first,last,unused,unused,unused)){
// Followed by the subject parser
spirit::qi::skip_over(first, last, skipper);
if(parse_impl(first,last,context,skipper,attr, predicate()))
@@ -342,6 +402,7 @@ template <typename T>
return iter.register_successful_parse(flag,counter);
}
}
+ }
first = save;
return flag;
}
@@ -350,16 +411,29 @@ template <typename T>
template <typename Context>
info what(Context& context) const
{
+ if(distinct::value){
if(no_case_keyword::value)
+ return info("idkwd", subject.what(context));
+ else
+ return info("dkwd", subject.what(context));
+ }
+ else
+ {
+ if(no_case_keyword::value)
return info("ikwd", subject.what(context));
else
return info("kwd", subject.what(context));
}
+ }
Subject subject;
LoopIter iter;
- spirit::qi::literal_string<KeywordType, true> keyword;
+ typedef typename mpl::if_<
+ no_case_keyword,
+ spirit::qi::no_case_literal_string< KeywordType, true>,
+ spirit::qi::literal_string<KeywordType, true> >::type keyword_string_type;
+ keyword_string_type keyword;
private:
// silence MSVC warning C4512: assignment operator could not be generated
kwd_parser& operator= (kwd_parser const&);
@@ -376,6 +450,151 @@ template <typename T>
};
+
+template <typename Subject, typename KeywordType, typename LoopIter, typename Distinct>
+ struct complex_kwd_parser : spirit::qi::unary_parser<complex_kwd_parser<Subject, KeywordType, LoopIter, Distinct > >
+ {
+ struct complex_kwd_parser_id;
+ typedef Subject subject_type;
+ typedef Distinct distinct;
+
+ template <typename Context, typename Iterator>
+ struct attribute
+ {
+ typedef typename
+ traits::build_std_vector<
+ typename traits::attribute_of<
+ Subject, Context, Iterator>::type
+ >::type
+ type;
+ };
+
+
+ complex_kwd_parser(Subject const& subject
+ , typename add_reference<KeywordType>::type keyword
+ , LoopIter const& iter)
+ : subject(subject), iter(iter), keyword(keyword) {}
+
+ // Call the subject parser on a non container attribute
+ template <typename Iterator, typename Context
+ , typename Skipper, typename Attribute>
+ bool parse_impl(Iterator& first, Iterator const& last
+ , Context& context, Skipper const& skipper
+ , Attribute& attr,mpl::false_) const
+ {
+ return subject.parse(first,last,context,skipper,attr);
+ }
+
+ // Call the subject parser on a container attribute
+ template <typename Iterator, typename Context
+ , typename Skipper, typename Attribute>
+ bool parse_impl(Iterator& first, Iterator const& last
+ , Context& context, Skipper const& skipper
+ , Attribute& attr,mpl::true_) const
+ {
+
+ // synthesized attribute needs to be default constructed
+ typename traits::container_value<Attribute>::type val =
+ typename traits::container_value<Attribute>::type();
+
+ Iterator save = first;
+ bool r = subject.parse(first,last,context,skipper, val);
+ if (r)
+ {
+ // push the parsed value into our attribute
+ r = traits::push_back(attr, val);
+ if (!r)
+ first = save;
+ }
+ return r;
+ }
+
+ template <typename Iterator, typename Context
+ , typename Skipper, typename Attribute,typename NoCasePass>
+ bool parse(Iterator& first, Iterator const& last
+ , Context& context, skipper_keyword_marker<Skipper,NoCasePass> const& skipper
+ , Attribute &attr) const
+ {
+
+ typedef typename traits::attribute_of<
+ Subject, Context, Iterator>::type
+ subject_attribute;
+
+ typedef typename mpl::and_<
+ traits::is_container<Attribute>
+ , mpl::not_< traits::is_weak_substitute< subject_attribute,Attribute > >
+ >::type predicate;
+
+ if(parse_impl(first,last,context,skipper.skipper,attr, predicate()))
+ return iter.register_successful_parse(skipper.flag,skipper.counter);
+ return false;
+ }
+
+ template <typename Iterator, typename Context
+ , typename Skipper, typename Attribute>
+ bool parse(Iterator& first, Iterator const& last
+ , Context& context, Skipper const& skipper
+ , Attribute& attr) const
+ {
+ typedef typename traits::attribute_of<
+ Subject, Context, Iterator>::type
+ subject_attribute;
+
+ typedef typename mpl::and_<
+ traits::is_container<Attribute>
+ , mpl::not_< traits::is_weak_substitute< subject_attribute,Attribute > >
+ >::type predicate;
+
+
+ // Parse the keyword
+ bool flag = iter.flag_init();
+ int counter = 0;
+ Iterator save = first;
+ spirit::qi::skip_over(first, last, skipper);
+ if(keyword.parse(first,last,context,skipper,unused)){
+ if( !distinct::value || skipper.parse(first,last,unused,unused,unused)){
+ // Followed by the subject parser
+ spirit::qi::skip_over(first, last, skipper);
+ if(parse_impl(first,last,context,skipper,attr, predicate()))
+ {
+ return iter.register_successful_parse(flag,counter);
+ }
+ }
+ }
+ first = save;
+ return flag;
+ }
+
+
+ template <typename Context>
+ info what(Context& context) const
+ {
+ if(distinct::value)
+ return info("dkwd", subject.what(context));
+ else
+ return info("kwd", subject.what(context));
+ }
+
+ Subject subject;
+ LoopIter iter;
+
+ KeywordType keyword;
+ private:
+ // silence MSVC warning C4512: assignment operator could not be generated
+ complex_kwd_parser& operator= (complex_kwd_parser const&);
+
+ template <typename Iterator, typename Context, typename Skipper>
+ static spirit::qi::detail::fail_function<Iterator, Context, Skipper>
+ fail_function(
+ Iterator& first, Iterator const& last
+ , Context& context, Skipper const& skipper)
+ {
+ return spirit::qi::detail::fail_function<Iterator, Context, Skipper>
+ (first, last, context, skipper);
+ }
+
+ };
+
}}}}
///////////////////////////////////////////////////////////////////////////////
@@ -386,177 +605,546 @@ namespace boost { namespace spirit { namespace qi
// Parser generators: make_xxx function (objects)
///////////////////////////////////////////////////////////////////////////
+ template <typename T1, typename T2, typename Subject, typename Modifiers, typename Distinct, typename MakeDirectiveHelper>
+ struct make_directive_internal_2_args
+ {
+
+ // is the keyword a string keyword ?
+ typedef typename traits::is_string<T1> is_string_kwd_type;
+ // make the keyword type
+ typedef typename mpl::if_< is_string_kwd_type ,
+ T1 ,
+ typename result_of::compile<qi::domain, T1>::type
+ >::type keyword_type;
+
+ typedef typename add_const<keyword_type>::type const_keyword;
+ // select the pass iterator type
+ typedef typename MakeDirectiveHelper::iterator_type iterator_type;
+ // determine if a no case modifier applies to the context
+ typedef has_modifier<Modifiers, tag::char_code_base<tag::no_case> > no_case;
+ // Determine the full type of the kwd / complex_kwd directive
+ typedef typename
+ mpl::if_<
+ is_string_kwd_type,
+ repository::qi::kwd_parser<Subject, const_keyword, iterator_type, no_case, Distinct >,
+ repository::qi::complex_kwd_parser<Subject, const_keyword, iterator_type, Distinct >
+ >::type result_type;
+
+ // Return a kwd parser object
+ template <typename Terminal>
+ result_type create_kwd_string(Terminal const &term, Subject const & subject, boost::mpl::true_ ) const
+ {
+ typename spirit::detail::get_encoding<Modifiers,
+ spirit::char_encoding::standard>::type encoding;
+ return result_type(subject
+ ,MakeDirectiveHelper::make_iterator(term.args)
+ ,encoding
+ );
+ }
+ template <typename Terminal>
+ result_type create_kwd_string(Terminal const &term, Subject const & subject, boost::mpl::false_ ) const
+ {
+ return result_type(subject
+ ,fusion::at_c<0>(term.args)
+ ,MakeDirectiveHelper::make_iterator(term.args)
+ );
+ }
+ template <typename Terminal>
+ result_type create_kwd(Terminal const &term, Subject const & subject, Modifiers const& modifiers, boost::mpl::true_ ) const
+ {
+ return create_kwd_string(term,subject,no_case());
+ }
+ // Return a complex_kwd parser object
+ template <typename Terminal>
+ result_type create_kwd(Terminal const &term , Subject const & subject, Modifiers const& modifiers, boost::mpl::false_ ) const
+ {
+ return result_type(subject
+ ,compile<qi::domain>(fusion::at_c<0>(term.args),modifiers)
+ ,MakeDirectiveHelper::make_iterator(term.args)
+ );
+ }
+ // Select which object type to return
+ template <typename Terminal>
+ result_type operator()(
+ Terminal const& term, Subject const& subject, Modifiers const& modifiers) const
+ {
+ return create_kwd(term, subject, modifiers, is_string_kwd_type());
+ }
+
+ };
+
// Directive kwd(key)[p]
+ template <typename T1, typename Subject, typename Modifiers, typename Distinct>
+ struct make_directive_internal
+ {
+ // is the keyword a string keyword ?
+ typedef typename traits::is_string<T1> is_string_kwd_type;
+ // make the keyword type
+ typedef typename mpl::if_< is_string_kwd_type ,
+ T1 ,
+ typename result_of::compile<qi::domain, T1, Modifiers>::type
+ >::type keyword_type;
+
+ typedef typename add_const<keyword_type>::type const_keyword;
+ // select the pass iterator type
+ typedef repository::qi::kwd_pass_iterator<int> iterator_type;
+ // determine if a no case modifier applies to the context
+ typedef has_modifier<Modifiers, tag::char_code_base<tag::no_case> > no_case;
+ // Determine the full type of the kwd / complex_kwd directive
+ typedef typename
+ mpl::if_<
+ is_string_kwd_type,
+ repository::qi::kwd_parser<Subject, const_keyword, iterator_type, no_case, Distinct >,
+ repository::qi::complex_kwd_parser<Subject, const_keyword, iterator_type, Distinct>
+ >::type result_type;
+
+ // Return a kwd parser object
+ template <typename Terminal>
+ result_type create_kwd_string(Terminal const &term, Subject const & subject, boost::mpl::true_) const
+ {
+ typename spirit::detail::get_encoding<Modifiers,
+ spirit::char_encoding::standard>::type encoding;
+
+ return result_type(subject
+ ,fusion::at_c<0>(term.args)
+ ,iterator_type()
+ ,encoding
+ );
+
+ }
+ template <typename Terminal>
+ result_type create_kwd_string(Terminal const &term, Subject const & subject, boost::mpl::false_) const
+ {
+ return result_type(subject
+ ,fusion::at_c<0>(term.args)
+ ,iterator_type()
+ );
+ }
+ template <typename Terminal>
+ result_type create_kwd(Terminal const &term, Subject const & subject, Modifiers const& modifiers, boost::mpl::true_ ) const
+ {
+ return create_kwd_string(term,subject,no_case());
+ }
+ // Return a complex_kwd parser object
+ template <typename Terminal>
+ result_type create_kwd(Terminal const &term , Subject const & subject, Modifiers const& modifiers, boost::mpl::false_ ) const
+ {
+ return result_type(subject
+ ,compile<qi::domain>(fusion::at_c<0>(term.args),modifiers)
+ ,iterator_type()
+ );
+ }
+ // Select which object type to return
+ template <typename Terminal>
+ result_type operator()(
+ Terminal const& term, Subject const& subject, Modifiers const& modifiers ) const
+ {
+ return create_kwd(term, subject, modifiers, is_string_kwd_type());
+ }
+ };
+
template <typename T1, typename Subject, typename Modifiers>
struct make_directive<
terminal_ex<repository::tag::kwd, fusion::vector1<T1> >, Subject, Modifiers>
{
+ typedef make_directive_internal<T1, Subject, Modifiers, mpl::false_> make_directive_type;
+ typedef typename make_directive_type::result_type result_type;
+ template <typename Terminal>
+ result_type operator()(
+ Terminal const& term, Subject const& subject, Modifiers const& modifiers) const
+ {
+
+ return make_directive_type()(term, subject, modifiers);
+ }
+
+ };
+
+ template <typename T1, typename Subject, typename Modifiers>
+ struct make_directive<
+ terminal_ex<repository::tag::dkwd, fusion::vector1<T1> >, Subject, Modifiers>
+ {
+ typedef make_directive_internal<T1, Subject, Modifiers, mpl::true_> make_directive_type;
+ typedef typename make_directive_type::result_type result_type;
+ template <typename Terminal>
+ result_type operator()(
+ Terminal const& term, Subject const& subject, Modifiers const& modifiers) const
+ {
+
+ return make_directive_type()(term, subject, modifiers);
+ }
+
+ };
+
+
+
+ // Directive ikwd(key)[p]
+ template <typename T1, typename Subject, typename Modifiers>
+ struct make_directive<
+ terminal_ex<repository::tag::ikwd, fusion::vector1<T1> >, Subject, Modifiers>
+ {
typedef typename add_const<T1>::type const_keyword;
typedef repository::qi::kwd_pass_iterator<int> iterator_type;
- typedef has_modifier<Modifiers, tag::char_code_base<tag::no_case> > no_case;
+ typedef repository::qi::kwd_parser<Subject, const_keyword, iterator_type, mpl::true_, mpl::false_ > result_type;
- typedef repository::qi::kwd_parser<Subject, const_keyword, iterator_type, no_case > result_type;
-
template <typename Terminal>
result_type operator()(
Terminal const& term, Subject const& subject, unused_type) const
{
+ typename spirit::detail::get_encoding<Modifiers,
+ spirit::char_encoding::standard>::type encoding;
+
return result_type(subject
,fusion::at_c<0>(term.args)
,iterator_type()
+ ,encoding
);
}
};
- // Directive ikwd(key)[p]
template <typename T1, typename Subject, typename Modifiers>
struct make_directive<
- terminal_ex<repository::tag::ikwd, fusion::vector1<T1> >, Subject, Modifiers>
+ terminal_ex<repository::tag::idkwd, fusion::vector1<T1> >, Subject, Modifiers>
{
typedef typename add_const<T1>::type const_keyword;
typedef repository::qi::kwd_pass_iterator<int> iterator_type;
- typedef repository::qi::kwd_parser<Subject, const_keyword, iterator_type, mpl::true_ > result_type;
+ typedef repository::qi::kwd_parser<Subject, const_keyword, iterator_type, mpl::true_, mpl::true_ > result_type;
template <typename Terminal>
result_type operator()(
Terminal const& term, Subject const& subject, unused_type) const
{
- /* typename spirit::detail::get_encoding<Modifiers,
- spirit::char_encoding::standard>::type encoding;*/
+ typename spirit::detail::get_encoding<Modifiers,
+ spirit::char_encoding::standard>::type encoding;
return result_type(subject
,fusion::at_c<0>(term.args)
,iterator_type()
+ ,encoding
);
}
};
// Directive kwd(key,exact)[p]
+ template <typename T>
+ struct make_exact_helper
+ {
+ typedef repository::qi::kwd_exact_iterator<T> iterator_type;
+ template<typename Args>
+ static iterator_type make_iterator(Args const& args)
+ {
+ return iterator_type(fusion::at_c<1>(args));
+ }
+ };
+
template <typename T1, typename T2, typename Subject, typename Modifiers>
struct make_directive<
terminal_ex<repository::tag::kwd, fusion::vector2<T1,T2> >, Subject, Modifiers>
{
+ typedef make_directive_internal_2_args< T1
+ , T2
+ , Subject
+ , Modifiers
+ , mpl::false_
+ , make_exact_helper<T2>
+ > make_directive_type;
+ typedef typename make_directive_type::result_type result_type;
+ template <typename Terminal>
+ result_type operator()(
+ Terminal const& term, Subject const& subject, Modifiers const& modifiers) const
+ {
+
+ return make_directive_type()(term,subject, modifiers);
+ }
+
+ };
+
+ template <typename T1, typename T2, typename Subject, typename Modifiers>
+ struct make_directive<
+ terminal_ex<repository::tag::dkwd, fusion::vector2<T1,T2> >, Subject, Modifiers>
+ {
+ typedef make_directive_internal_2_args< T1
+ , T2
+ , Subject
+ , Modifiers
+ , mpl::true_
+ , make_exact_helper<T2>
+ > make_directive_type;
+
+ typedef typename make_directive_type::result_type result_type;
+ template <typename Terminal>
+ result_type operator()(
+ Terminal const& term, Subject const& subject, Modifiers const& modifiers) const
+ {
+
+ return make_directive_type()(term, subject, modifiers);
+ }
+
+ };
+
+
+ // Directive ikwd(key,exact)[p]
+ template <typename T1, typename T2, typename Subject, typename Modifiers>
+ struct make_directive<
+ terminal_ex<repository::tag::ikwd, fusion::vector2<T1,T2> >, Subject, Modifiers>
+ {
typedef typename add_const<T1>::type const_keyword;
typedef repository::qi::kwd_exact_iterator<T2> iterator_type;
- typedef has_modifier<Modifiers, tag::char_code_base<tag::no_case> > no_case;
- typedef repository::qi::kwd_parser<Subject, const_keyword, iterator_type, no_case > result_type;
+ typedef repository::qi::kwd_parser<Subject, const_keyword, iterator_type, mpl::true_, mpl::false_ > result_type;
template <typename Terminal>
result_type operator()(
- Terminal const& term, Subject const& subject, unused_type) const
+ Terminal const& term, Subject const& subject, Modifiers const& modifiers) const
{
+ typename spirit::detail::get_encoding<Modifiers,
+ spirit::char_encoding::standard>::type encoding;
return result_type(subject
,fusion::at_c<0>(term.args)
,fusion::at_c<1>(term.args)
+ , encoding
);
}
};
- // Directive ikwd(key,exact)[p]
template <typename T1, typename T2, typename Subject, typename Modifiers>
struct make_directive<
- terminal_ex<repository::tag::ikwd, fusion::vector2<T1,T2> >, Subject, Modifiers>
+ terminal_ex<repository::tag::idkwd, fusion::vector2<T1,T2> >, Subject, Modifiers>
{
typedef typename add_const<T1>::type const_keyword;
typedef repository::qi::kwd_exact_iterator<T2> iterator_type;
- typedef repository::qi::kwd_parser<Subject, const_keyword, iterator_type, mpl::true_ > result_type;
+ typedef repository::qi::kwd_parser<Subject, const_keyword, iterator_type, mpl::true_, mpl::true_ > result_type;
template <typename Terminal>
result_type operator()(
- Terminal const& term, Subject const& subject, unused_type) const
+ Terminal const& term, Subject const& subject, Modifiers const& modifiers) const
{
+ typename spirit::detail::get_encoding<Modifiers,
+ spirit::char_encoding::standard>::type encoding;
return result_type(subject
, fusion::at_c<0>(term.args)
, fusion::at_c<1>(term.args)
+ , encoding
);
}
};
+
// Directive kwd(min, max)[p]
+
+ template <typename T>
+ struct make_finite_helper
+ {
+ typedef repository::qi::kwd_finite_iterator<T> iterator_type;
+ template<typename Args>
+ static iterator_type make_iterator(Args const& args)
+ {
+ return iterator_type(fusion::at_c<1>(args),fusion::at_c<2>(args));
+ }
+
+ };
+
template <typename T1, typename T2, typename Subject, typename Modifiers>
struct make_directive<
terminal_ex<repository::tag::kwd, fusion::vector3< T1, T2, T2> >, Subject, Modifiers>
{
+ typedef make_directive_internal_2_args< T1
+ , T2
+ , Subject
+ , Modifiers
+ , mpl::false_
+ , make_finite_helper<T2>
+ > make_directive_type;
+
+
+ typedef typename make_directive_type::result_type result_type;
+ template <typename Terminal>
+ result_type operator()(
+ Terminal const& term, Subject const& subject, Modifiers const& modifiers) const
+ {
+
+ return make_directive_type()(term,subject, modifiers);
+ }
+
+ };
+
+ template <typename T1, typename T2, typename Subject, typename Modifiers>
+ struct make_directive<
+ terminal_ex<repository::tag::dkwd, fusion::vector3<T1,T2,T2> >, Subject, Modifiers>
+ {
+
+ typedef make_directive_internal_2_args< T1
+ , T2
+ , Subject
+ , Modifiers
+ , mpl::true_
+ , make_finite_helper<T2>
+ > make_directive_type;
+
+ typedef typename make_directive_type::result_type result_type;
+ template <typename Terminal>
+ result_type operator()(
+ Terminal const& term, Subject const& subject, Modifiers const& modifiers) const
+ {
+
+ return make_directive_type()(term,subject, modifiers);
+ }
+
+ };
+
+ // Directive ikwd(min, max)[p]
+ template <typename T1, typename T2, typename Subject, typename Modifiers>
+ struct make_directive<
+ terminal_ex<repository::tag::ikwd, fusion::vector3< T1, T2, T2> >, Subject, Modifiers>
+ {
typedef typename add_const<T1>::type const_keyword;
typedef repository::qi::kwd_finite_iterator<T2> iterator_type;
- typedef has_modifier<Modifiers, tag::char_code_base<tag::no_case> > no_case;
- typedef repository::qi::kwd_parser<Subject, const_keyword, iterator_type, no_case > result_type;
+ typedef repository::qi::kwd_parser<Subject, const_keyword, iterator_type, mpl::true_, mpl::false_ > result_type;
template <typename Terminal>
result_type operator()(
Terminal const& term, Subject const& subject, unused_type) const
{
+
+ typename spirit::detail::get_encoding<Modifiers,
+ spirit::char_encoding::standard>::type encoding;
return result_type(subject, fusion::at_c<0>(term.args),
iterator_type(
fusion::at_c<1>(term.args)
, fusion::at_c<2>(term.args)
+ , encoding
)
);
}
};
- // Directive ikwd(min, max)[p]
template <typename T1, typename T2, typename Subject, typename Modifiers>
struct make_directive<
- terminal_ex<repository::tag::ikwd, fusion::vector3< T1, T2, T2> >, Subject, Modifiers>
+ terminal_ex<repository::tag::idkwd, fusion::vector3< T1, T2, T2> >, Subject, Modifiers>
{
typedef typename add_const<T1>::type const_keyword;
typedef repository::qi::kwd_finite_iterator<T2> iterator_type;
- typedef repository::qi::kwd_parser<Subject, const_keyword, iterator_type, mpl::true_ > result_type;
+ typedef repository::qi::kwd_parser<Subject, const_keyword, iterator_type, mpl::true_, mpl::true_ > result_type;
template <typename Terminal>
result_type operator()(
Terminal const& term, Subject const& subject, unused_type) const
{
+ typename spirit::detail::get_encoding<Modifiers,
+ spirit::char_encoding::standard>::type encoding;
return result_type(subject, fusion::at_c<0>(term.args),
iterator_type(
fusion::at_c<1>(term.args)
, fusion::at_c<2>(term.args)
+ , encoding
)
);
}
};
+
// Directive kwd(min, inf)[p]
+
+ template <typename T>
+ struct make_infinite_helper
+ {
+ typedef repository::qi::kwd_infinite_iterator<T> iterator_type;
+ template<typename Args>
+ static iterator_type make_iterator(Args const& args)
+ {
+ return iterator_type(fusion::at_c<1>(args));
+ }
+
+ };
+
+
template <typename T1, typename T2, typename Subject, typename Modifiers>
struct make_directive<
- terminal_ex<repository::tag::kwd
+ terminal_ex<repository::tag::kwd, fusion::vector3<T1,T2,inf_type> >, Subject, Modifiers>
+ {
+ typedef make_directive_internal_2_args< T1
+ , T2
+ , Subject
+ , Modifiers
+ , mpl::false_
+ , make_infinite_helper<T2>
+ > make_directive_type;
+
+ typedef typename make_directive_type::result_type result_type;
+ template <typename Terminal>
+ result_type operator()(
+ Terminal const& term, Subject const& subject, unused_type) const
+ {
+
+ return make_directive_type()(term,subject, unused_type());
+ }
+
+ };
+
+ template <typename T1, typename T2, typename Subject, typename Modifiers>
+ struct make_directive<
+ terminal_ex<repository::tag::dkwd, fusion::vector3<T1,T2,inf_type> >, Subject, Modifiers>
+ {
+ typedef make_directive_internal_2_args< T1
+ , T2
+ , Subject
+ , Modifiers
+ , mpl::false_
+ , make_infinite_helper<T2>
+ > make_directive_type;
+
+ typedef typename make_directive_type::result_type result_type;
+ template <typename Terminal>
+ result_type operator()(
+ Terminal const& term, Subject const& subject, unused_type) const
+ {
+
+ return make_directive_type()(term,subject, unused_type());
+ }
+
+ };
+
+
+ // Directive ikwd(min, inf)[p]
+ template <typename T1, typename T2, typename Subject, typename Modifiers>
+ struct make_directive<
+ terminal_ex<repository::tag::ikwd
, fusion::vector3<T1, T2, inf_type> >, Subject, Modifiers>
{
typedef typename add_const<T1>::type const_keyword;
typedef repository::qi::kwd_infinite_iterator<T2> iterator_type;
- typedef has_modifier<Modifiers, tag::char_code_base<tag::no_case> > no_case;
- typedef repository::qi::kwd_parser<Subject, const_keyword, iterator_type, no_case > result_type;
+ typedef repository::qi::kwd_parser<Subject, const_keyword, iterator_type, mpl::true_, mpl::false_ > result_type;
template <typename Terminal>
result_type operator()(
Terminal const& term, Subject const& subject, unused_type) const
{
+ typename spirit::detail::get_encoding<Modifiers,
+ spirit::char_encoding::standard>::type encoding;
+
return result_type(subject
, fusion::at_c<0>(term.args)
, fusion::at_c<1>(term.args)
+ , encoding
);
}
};
- // Directive ikwd(min, inf)[p]
template <typename T1, typename T2, typename Subject, typename Modifiers>
struct make_directive<
- terminal_ex<repository::tag::ikwd
+ terminal_ex<repository::tag::idkwd
, fusion::vector3<T1, T2, inf_type> >, Subject, Modifiers>
{
typedef typename add_const<T1>::type const_keyword;
typedef repository::qi::kwd_infinite_iterator<T2> iterator_type;
- typedef repository::qi::kwd_parser<Subject, const_keyword, iterator_type, mpl::true_ > result_type;
+ typedef repository::qi::kwd_parser<Subject, const_keyword, iterator_type, mpl::true_, mpl::true_ > result_type;
template <typename Terminal>
result_type operator()(
@@ -568,6 +1156,7 @@ namespace boost { namespace spirit { namespace qi
return result_type(subject
, fusion::at_c<0>(term.args)
, fusion::at_c<1>(term.args)
+ , encoding
);
}
};
@@ -578,10 +1167,32 @@ namespace boost { namespace spirit { namespace qi
namespace boost { namespace spirit { namespace traits
{
template <typename Subject, typename KeywordType
- , typename LoopIter, typename NoCase >
+ , typename LoopIter, typename NoCase , typename Distinct>
struct has_semantic_action<
- repository::qi::kwd_parser< Subject, KeywordType, LoopIter, NoCase > >
+ repository::qi::kwd_parser< Subject, KeywordType, LoopIter, NoCase, Distinct > >
+ : unary_has_semantic_action<Subject> {};
+
+ template <typename Subject, typename KeywordType
+ , typename LoopIter, typename Distinct >
+ struct has_semantic_action<
+ repository::qi::complex_kwd_parser< Subject, KeywordType, LoopIter, Distinct > >
: unary_has_semantic_action<Subject> {};
+
+ template <typename Subject, typename KeywordType
+ , typename LoopIter, typename NoCase, typename Attribute, typename Context
+ , typename Iterator, typename Distinct>
+ struct handles_container<repository::qi::kwd_parser<Subject, KeywordType, LoopIter, NoCase, Distinct>, Attribute
+ , Context, Iterator>
+ : unary_handles_container<Subject, Attribute, Context, Iterator> {};
+
+ template <typename Subject, typename KeywordType
+ , typename LoopIter
+ , typename Attribute, typename Context
+ , typename Iterator, typename Distinct>
+ struct handles_container<repository::qi::complex_kwd_parser<Subject, KeywordType, LoopIter, Distinct>, Attribute
+ , Context, Iterator>
+ : unary_handles_container<Subject, Attribute, Context, Iterator> {};
+
}}}
#endif
diff --git a/boost/spirit/repository/home/qi/operator/detail/keywords.hpp b/boost/spirit/repository/home/qi/operator/detail/keywords.hpp
index 81e17715df..06836f7746 100644
--- a/boost/spirit/repository/home/qi/operator/detail/keywords.hpp
+++ b/boost/spirit/repository/home/qi/operator/detail/keywords.hpp
@@ -1,6 +1,5 @@
/*=============================================================================
- Copyright (c) 2001-2011 Joel de Guzman
- Copyright (c) 2011 Thomas Bernard
+ Copyright (c) 2011-2012 Thomas Bernard
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -11,39 +10,35 @@
#if defined(_MSC_VER)
#pragma once
#endif
-
+#include <boost/fusion/include/nview.hpp>
+#include <boost/spirit/home/qi/string/lit.hpp>
+#include <boost/fusion/include/at.hpp>
namespace boost { namespace spirit { namespace repository { namespace qi { namespace detail {
-
- // This helper class enables jumping over intermediate directives
- // down the kwd parser iteration count checking policy
- struct register_successful_parse
- {
- template <typename Subject>
- static bool call(Subject const &subject,bool &flag, int &counter)
- {
- return subject.iter.register_successful_parse(flag,counter);
- }
- template <typename Subject, typename Action>
- static bool call(spirit::qi::action<Subject, Action> const &subject,bool &flag, int &counter)
- {
- return subject.subject.iter.register_successful_parse(flag,counter);
- }
- template <typename Subject>
- static bool call(spirit::qi::hold_directive<Subject> const &subject,bool &flag, int &counter)
- {
- return subject.subject.iter.register_successful_parse(flag,counter);
- }
- };
// Variant visitor class which handles dispatching the parsing to the selected parser
// This also handles passing the correct attributes and flags/counters to the subject parsers
+ template<typename T>
+ struct is_distinct : T::distinct { };
+ template<typename T, typename Action>
+ struct is_distinct< spirit::qi::action<T,Action> > : T::distinct { };
+
+ template<typename T>
+ struct is_distinct< spirit::qi::hold_directive<T> > : T::distinct { };
+
+
+
template < typename Elements, typename Iterator ,typename Context ,typename Skipper
,typename Flags ,typename Counters ,typename Attribute, typename NoCasePass>
- class parse_dispatcher
+ struct parse_dispatcher
: public boost::static_visitor<bool>
{
+
+ typedef Iterator iterator_type;
+ typedef Context context_type;
+ typedef Skipper skipper_type;
+ typedef Elements elements_type;
+
typedef typename add_reference<Attribute>::type attr_reference;
-
public:
parse_dispatcher(const Elements &elements,Iterator& first, Iterator const& last
, Context& context, Skipper const& skipper
@@ -65,7 +60,8 @@ namespace boost { namespace spirit { namespace repository { namespace qi { names
, Index& idx ) const
{
Iterator save = first;
- skipper_keyword_marker<Skipper,NoCasePass> marked_skipper(skipper,flags[Index::value],counters[Index::value]);
+ skipper_keyword_marker<Skipper,NoCasePass>
+ marked_skipper(skipper,flags[Index::value],counters[Index::value]);
if(subject.parse(first,last,context,marked_skipper,unused))
{
@@ -84,7 +80,8 @@ namespace boost { namespace spirit { namespace repository { namespace qi { names
{
Iterator save = first;
- skipper_keyword_marker<Skipper,NoCasePass> marked_skipper(skipper,flags[Index::value],counters[Index::value]);
+ skipper_keyword_marker<Skipper,NoCasePass>
+ marked_skipper(skipper,flags[Index::value],counters[Index::value]);
if(subject.parse(first,last,context,marked_skipper,fusion::at_c<Index::value>(attr)))
{
return true;
@@ -95,12 +92,28 @@ namespace boost { namespace spirit { namespace repository { namespace qi { names
// Handle unused attributes
template <typename T> bool call(T &idx, mpl::false_) const{
+
+ typedef typename mpl::at<Elements,T>::type ElementType;
+ if(
+ (!is_distinct<ElementType>::value)
+ || skipper.parse(first,last,unused,unused,unused)
+ ){
+ spirit::qi::skip_over(first, last, skipper);
return call_subject_unused(fusion::at_c<T::value>(elements), first, last, context, skipper, idx );
}
+ return false;
+ }
// Handle normal attributes
template <typename T> bool call(T &idx, mpl::true_) const{
+ typedef typename mpl::at<Elements,T>::type ElementType;
+ if(
+ (!is_distinct<ElementType>::value)
+ || skipper.parse(first,last,unused,unused,unused)
+ ){
return call_subject(fusion::at_c<T::value>(elements), first, last, context, skipper, idx);
}
+ return false;
+ }
const Elements &elements;
Iterator &first;
@@ -111,7 +124,572 @@ namespace boost { namespace spirit { namespace repository { namespace qi { names
Counters &counters;
attr_reference attr;
};
+ // string keyword loop handler
+ template <typename Elements, typename StringKeywords, typename IndexList, typename FlagsType, typename Modifiers>
+ struct string_keywords
+ {
+ // Create a variant type to be able to store parser indexes in the embedded symbols parser
+ typedef typename
+ spirit::detail::as_variant<
+ IndexList >::type parser_index_type;
+ ///////////////////////////////////////////////////////////////////////////
+ // build_char_type_sequence
+ //
+ // Build a fusion sequence from the kwd directive specified character type.
+ ///////////////////////////////////////////////////////////////////////////
+ template <typename Sequence >
+ struct build_char_type_sequence
+ {
+ struct element_char_type
+ {
+ template <typename T>
+ struct result;
+
+ template <typename F, typename Element>
+ struct result<F(Element)>
+ {
+ typedef typename Element::char_type type;
+
+ };
+ template <typename F, typename Element,typename Action>
+ struct result<F(spirit::qi::action<Element,Action>) >
+ {
+ typedef typename Element::char_type type;
+ };
+ template <typename F, typename Element>
+ struct result<F(spirit::qi::hold_directive<Element>)>
+ {
+ typedef typename Element::char_type type;
+ };
+
+ // never called, but needed for decltype-based result_of (C++0x)
+ template <typename Element>
+ typename result<element_char_type(Element)>::type
+ operator()(Element&) const;
+ };
+
+ // Compute the list of character types of the child kwd directives
+ typedef typename
+ fusion::result_of::transform<Sequence, element_char_type>::type
+ type;
+ };
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // get_keyword_char_type
+ //
+ // Collapses the character type comming from the subject kwd parsers and
+ // and checks that they are all identical (necessary in order to be able
+ // to build a tst parser to parse the keywords.
+ ///////////////////////////////////////////////////////////////////////////
+ template <typename Sequence>
+ struct get_keyword_char_type
+ {
+ // Make sure each of the types occur only once in the type list
+ typedef typename
+ mpl::fold<
+ Sequence, mpl::vector<>,
+ mpl::if_<
+ mpl::contains<mpl::_1, mpl::_2>,
+ mpl::_1, mpl::push_back<mpl::_1, mpl::_2>
+ >
+ >::type
+ no_duplicate_char_types;
+
+ // If the compiler traps here this means you mixed
+ // character type for the keywords specified in the
+ // kwd directive sequence.
+ BOOST_MPL_ASSERT_RELATION( mpl::size<no_duplicate_char_types>::value, ==, 1 );
+
+ typedef typename mpl::front<no_duplicate_char_types>::type type;
+
+ };
+
+ // Get the character type for the tst parser
+ typedef typename build_char_type_sequence< StringKeywords >::type char_types;
+ typedef typename get_keyword_char_type<
+ typename mpl::if_<
+ mpl::equal_to<
+ typename mpl::size < char_types >::type
+ , mpl::int_<0>
+ >
+ , mpl::vector< boost::spirit::standard::char_type >
+ , char_types >::type
+ >::type char_type;
+
+ // Our symbols container
+ typedef spirit::qi::tst< char_type, parser_index_type> keywords_type;
+
+ // Filter functor used for case insensitive parsing
+ template <typename CharEncoding>
+ struct no_case_filter
+ {
+ char_type operator()(char_type ch) const
+ {
+ return static_cast<char_type>(CharEncoding::tolower(ch));
+ }
+ };
+
+ ///////////////////////////////////////////////////////////////////////////
+ // build_case_type_sequence
+ //
+ // Build a fusion sequence from the kwd/ikwd directives
+ // in order to determine if case sensitive and case insensitive
+ // keywords have been mixed.
+ ///////////////////////////////////////////////////////////////////////////
+ template <typename Sequence >
+ struct build_case_type_sequence
+ {
+ struct element_case_type
+ {
+ template <typename T>
+ struct result;
+
+ template <typename F, typename Element>
+ struct result<F(Element)>
+ {
+ typedef typename Element::no_case_keyword type;
+
+ };
+ template <typename F, typename Element,typename Action>
+ struct result<F(spirit::qi::action<Element,Action>) >
+ {
+ typedef typename Element::no_case_keyword type;
+ };
+ template <typename F, typename Element>
+ struct result<F(spirit::qi::hold_directive<Element>)>
+ {
+ typedef typename Element::no_case_keyword type;
+ };
+
+ // never called, but needed for decltype-based result_of (C++0x)
+ template <typename Element>
+ typename result<element_case_type(Element)>::type
+ operator()(Element&) const;
+ };
+
+ // Compute the list of character types of the child kwd directives
+ typedef typename
+ fusion::result_of::transform<Sequence, element_case_type>::type
+ type;
+ };
+
+ ///////////////////////////////////////////////////////////////////////////
+ // get_nb_case_types
+ //
+ // Counts the number of entries in the case type sequence matching the
+ // CaseType parameter (mpl::true_ -> case insensitve
+ // , mpl::false_ -> case sensitive
+ ///////////////////////////////////////////////////////////////////////////
+ template <typename Sequence,typename CaseType>
+ struct get_nb_case_types
+ {
+ // Make sure each of the types occur only once in the type list
+ typedef typename
+ mpl::count_if<
+ Sequence, mpl::equal_to<mpl::_,CaseType>
+ >::type type;
+
+
+ };
+ // Build the case type sequence
+ typedef typename build_case_type_sequence< StringKeywords >::type case_type_sequence;
+ // Count the number of case sensitive entries and case insensitve entries
+ typedef typename get_nb_case_types<case_type_sequence,mpl::true_>::type ikwd_count;
+ typedef typename get_nb_case_types<case_type_sequence,mpl::false_>::type kwd_count;
+ // Get the size of the original sequence
+ typedef typename mpl::size<IndexList>::type nb_elements;
+ // Determine if all the kwd directive are case sensitive/insensitive
+ typedef typename mpl::and_<
+ typename mpl::greater< nb_elements, mpl::int_<0> >::type
+ , typename mpl::equal_to< ikwd_count, nb_elements>::type
+ >::type all_ikwd;
+
+ typedef typename mpl::and_<
+ typename mpl::greater< nb_elements, mpl::int_<0> >::type
+ , typename mpl::equal_to< kwd_count, nb_elements>::type
+ >::type all_kwd;
+
+ typedef typename mpl::or_< all_kwd, all_ikwd >::type all_directives_of_same_type;
+
+ // Do we have a no case modifier
+ typedef has_modifier<Modifiers, spirit::tag::char_code_base<spirit::tag::no_case> > no_case_modifier;
+
+ // Should the no_case filter always be used ?
+ typedef typename mpl::or_<
+ no_case_modifier,
+ mpl::and_<
+ all_directives_of_same_type
+ ,all_ikwd
+ >
+ >::type
+ no_case;
+
+ typedef no_case_filter<
+ typename spirit::detail::get_encoding_with_case<
+ Modifiers
+ , char_encoding::standard
+ , no_case::value>::type>
+ nc_filter;
+ // Determine the standard case filter type
+ typedef typename mpl::if_<
+ no_case
+ , nc_filter
+ , spirit::qi::tst_pass_through >::type
+ first_pass_filter_type;
+
+ typedef typename mpl::or_<
+ all_directives_of_same_type
+ , no_case_modifier
+ >::type requires_one_pass;
+
+
+ // Functor which adds all the keywords/subject parser indexes
+ // collected from the subject kwd directives to the keyword tst parser
+ struct keyword_entry_adder
+ {
+ typedef int result_type;
+
+ keyword_entry_adder(shared_ptr<keywords_type> lookup,FlagsType &flags, Elements &elements) :
+ lookup(lookup)
+ ,flags(flags)
+ ,elements(elements)
+ {}
+
+ template <typename T>
+ int operator()(const T &index) const
+ {
+ return call(fusion::at_c<T::value>(elements),index);
+ }
+
+ template <typename T, typename Position, typename Action>
+ int call(const spirit::qi::action<T,Action> &parser, const Position position ) const
+ {
+
+ // Make the keyword/parse index entry in the tst parser
+ lookup->add(
+ traits::get_begin<char_type>(parser.subject.keyword.str),
+ traits::get_end<char_type>(parser.subject.keyword.str),
+ position
+ );
+ // Get the initial state of the flags array and store it in the flags initializer
+ flags[Position::value]=parser.subject.iter.flag_init();
+ return 0;
+ }
+
+ template <typename T, typename Position>
+ int call( const T & parser, const Position position) const
+ {
+ // Make the keyword/parse index entry in the tst parser
+ lookup->add(
+ traits::get_begin<char_type>(get_string(parser.keyword)),
+ traits::get_end<char_type>(get_string(parser.keyword)),
+ position
+ );
+ // Get the initial state of the flags array and store it in the flags initializer
+ flags[Position::value]=parser.iter.flag_init();
+ return 0;
+ }
+
+ template <typename T, typename Position>
+ int call( const spirit::qi::hold_directive<T> & parser, const Position position) const
+ {
+ // Make the keyword/parse index entry in the tst parser
+ lookup->add(
+ traits::get_begin<char_type>(parser.subject.keyword.str),
+ traits::get_end<char_type>(parser.subject.keyword.str),
+ position
+ );
+ // Get the initial state of the flags array and store it in the flags initializer
+ flags[Position::value]=parser.subject.iter.flag_init();
+ return 0;
+ }
+
+ template <typename String, bool no_attribute>
+ const String & get_string(const boost::spirit::qi::literal_string<String,no_attribute> &parser) const
+ {
+ return parser.str;
+ }
+
+ template <typename String, bool no_attribute>
+ const typename boost::spirit::qi::no_case_literal_string<String,no_attribute>::string_type &
+ get_string(const boost::spirit::qi::no_case_literal_string<String,no_attribute> &parser) const
+ {
+ return parser.str_lo;
+ }
+
+
+
+ shared_ptr<keywords_type> lookup;
+ FlagsType & flags;
+ Elements &elements;
+ };
+
+ string_keywords(Elements &elements,FlagsType &flags_init) : lookup(new keywords_type())
+ {
+ // Loop through all the subject parsers to build the keyword parser symbol parser
+ IndexList indexes;
+ keyword_entry_adder f1(lookup,flags_init,elements);
+ fusion::for_each(indexes,f1);
+
+ }
+ template <typename Iterator,typename ParseVisitor, typename Skipper>
+ bool parse(
+ Iterator &first,
+ const Iterator &last,
+ const ParseVisitor &parse_visitor,
+ const Skipper &skipper) const
+ {
+ if(parser_index_type* val_ptr =
+ lookup->find(first,last,first_pass_filter_type()))
+ {
+ if(!apply_visitor(parse_visitor,*val_ptr)){
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ template <typename Iterator,typename ParseVisitor, typename NoCaseParseVisitor,typename Skipper>
+ bool parse(
+ Iterator &first,
+ const Iterator &last,
+ const ParseVisitor &parse_visitor,
+ const NoCaseParseVisitor &no_case_parse_visitor,
+ const Skipper &skipper) const
+ {
+ Iterator saved_first = first;
+ if(parser_index_type* val_ptr =
+ lookup->find(first,last,first_pass_filter_type()))
+ {
+ if(!apply_visitor(parse_visitor,*val_ptr)){
+ return false;
+ }
+ return true;
+ }
+ // Second pass case insensitive
+ else if(parser_index_type* val_ptr
+ = lookup->find(saved_first,last,nc_filter()))
+ {
+ first = saved_first;
+ if(!apply_visitor(no_case_parse_visitor,*val_ptr)){
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+ shared_ptr<keywords_type> lookup;
+
+
+ };
+
+ struct empty_keywords_list
+ {
+ typedef mpl::true_ requires_one_pass;
+
+ empty_keywords_list()
+ {}
+ template<typename Elements>
+ empty_keywords_list(const Elements &)
+ {}
+
+ template<typename Elements, typename FlagsInit>
+ empty_keywords_list(const Elements &, const FlagsInit &)
+ {}
+
+ template <typename Iterator,typename ParseVisitor, typename NoCaseParseVisitor,typename Skipper>
+ bool parse(
+ Iterator &first,
+ const Iterator &last,
+ const ParseVisitor &parse_visitor,
+ const NoCaseParseVisitor &no_case_parse_visitor,
+ const Skipper &skipper) const
+ {
+ return false;
+ }
+
+ template <typename Iterator,typename ParseVisitor, typename Skipper>
+ bool parse(
+ Iterator &first,
+ const Iterator &last,
+ const ParseVisitor &parse_visitor,
+ const Skipper &skipper) const
+ {
+ return false;
+ }
+
+ template <typename ParseFunction>
+ bool parse( ParseFunction &function ) const
+ {
+ return false;
+ }
+ };
+
+ template<typename ComplexKeywords>
+ struct complex_keywords
+ {
+ // Functor which performs the flag initialization for the complex keyword parsers
+ template <typename FlagsType, typename Elements>
+ struct flag_init_value_setter
+ {
+ typedef int result_type;
+
+ flag_init_value_setter(Elements &elements,FlagsType &flags)
+ :flags(flags)
+ ,elements(elements)
+ {}
+
+ template <typename T>
+ int operator()(const T &index) const
+ {
+ return call(fusion::at_c<T::value>(elements),index);
+ }
+
+ template <typename T, typename Position, typename Action>
+ int call(const spirit::qi::action<T,Action> &parser, const Position position ) const
+ {
+ // Get the initial state of the flags array and store it in the flags initializer
+ flags[Position::value]=parser.subject.iter.flag_init();
+ return 0;
+ }
+
+ template <typename T, typename Position>
+ int call( const T & parser, const Position position) const
+ {
+ // Get the initial state of the flags array and store it in the flags initializer
+ flags[Position::value]=parser.iter.flag_init();
+ return 0;
+ }
+
+ template <typename T, typename Position>
+ int call( const spirit::qi::hold_directive<T> & parser, const Position position) const
+ {
+ // Get the initial state of the flags array and store it in the flags initializer
+ flags[Position::value]=parser.subject.iter.flag_init();
+ return 0;
+ }
+
+ FlagsType & flags;
+ Elements &elements;
+ };
+
+ template <typename Elements, typename Flags>
+ complex_keywords(Elements &elements, Flags &flags)
+ {
+ flag_init_value_setter<Flags,Elements> flag_initializer(elements,flags);
+ fusion::for_each(complex_keywords_inst,flag_initializer);
+ }
+
+ template <typename ParseFunction>
+ bool parse( ParseFunction &function ) const
+ {
+ return fusion::any(complex_keywords_inst,function);
+ }
+
+ ComplexKeywords complex_keywords_inst;
+ };
+ // This helper class enables jumping over intermediate directives
+ // down the kwd parser iteration count checking policy
+ struct register_successful_parse
+ {
+ template <typename Subject>
+ static bool call(Subject const &subject,bool &flag, int &counter)
+ {
+ return subject.iter.register_successful_parse(flag,counter);
+ }
+ template <typename Subject, typename Action>
+ static bool call(spirit::qi::action<Subject, Action> const &subject,bool &flag, int &counter)
+ {
+ return subject.subject.iter.register_successful_parse(flag,counter);
+ }
+ template <typename Subject>
+ static bool call(spirit::qi::hold_directive<Subject> const &subject,bool &flag, int &counter)
+ {
+ return subject.subject.iter.register_successful_parse(flag,counter);
+ }
+ };
+
+ // This helper class enables jumping over intermediate directives
+ // down the kwd parser
+ struct extract_keyword
+ {
+ template <typename Subject>
+ static Subject const& call(Subject const &subject)
+ {
+ return subject;
+ }
+ template <typename Subject, typename Action>
+ static Subject const& call(spirit::qi::action<Subject, Action> const &subject)
+ {
+ return subject.subject;
+ }
+ template <typename Subject>
+ static Subject const& call(spirit::qi::hold_directive<Subject> const &subject)
+ {
+ return subject.subject;
+ }
+ };
+
+ template <typename ParseDispatcher>
+ struct complex_kwd_function
+ {
+ typedef typename ParseDispatcher::iterator_type Iterator;
+ typedef typename ParseDispatcher::context_type Context;
+ typedef typename ParseDispatcher::skipper_type Skipper;
+ complex_kwd_function(
+ Iterator& first, Iterator const& last
+ , Context& context, Skipper const& skipper, ParseDispatcher &dispatcher)
+ : first(first)
+ , last(last)
+ , context(context)
+ , skipper(skipper)
+ , dispatcher(dispatcher)
+ {
+ }
+
+ template <typename Component>
+ bool operator()(Component const& component)
+ {
+ Iterator save = first;
+ if(
+ extract_keyword::call(
+ fusion::at_c<
+ Component::value
+ ,typename ParseDispatcher::elements_type
+ >(dispatcher.elements)
+ )
+ .keyword.parse(
+ first
+ ,last
+ ,context
+ ,skipper
+ ,unused)
+ )
+ {
+ if(!dispatcher(component)){
+ first = save;
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ Iterator& first;
+ Iterator const& last;
+ Context& context;
+ Skipper const& skipper;
+ ParseDispatcher const& dispatcher;
+
+ private:
+ // silence MSVC warning C4512: assignment operator could not be generated
+ complex_kwd_function& operator= (complex_kwd_function const&);
+ };
+
+
}}}}}
#endif
diff --git a/boost/spirit/repository/home/qi/operator/keywords.hpp b/boost/spirit/repository/home/qi/operator/keywords.hpp
index c32c55c7af..f0382371fa 100644
--- a/boost/spirit/repository/home/qi/operator/keywords.hpp
+++ b/boost/spirit/repository/home/qi/operator/keywords.hpp
@@ -1,6 +1,6 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
- Copyright (c) 2011 Thomas Bernard
+ Copyright (c) 2011-2012 Thomas Bernard
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -22,6 +22,7 @@
#include <boost/fusion/include/iter_fold.hpp>
#include <boost/fusion/include/at.hpp>
#include <boost/fusion/include/value_at.hpp>
+#include <boost/fusion/include/mpl.hpp>
#include <boost/optional.hpp>
#include <boost/foreach.hpp>
#include <boost/array.hpp>
@@ -35,10 +36,14 @@
#include <boost/mpl/size.hpp>
#include <boost/mpl/equal_to.hpp>
#include <boost/mpl/back_inserter.hpp>
+#include <boost/mpl/filter_view.hpp>
+#include <boost/fusion/include/zip_view.hpp>
+#include <boost/fusion/include/as_vector.hpp>
#include <boost/variant/static_visitor.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/spirit/repository/home/qi/operator/detail/keywords.hpp>
+#include <boost/fusion/include/any.hpp>
namespace boost { namespace spirit
@@ -62,6 +67,7 @@ namespace boost { namespace spirit { namespace repository { namespace qi
namespace detail
{
BOOST_MPL_HAS_XXX_TRAIT_DEF(kwd_parser_id)
+ BOOST_MPL_HAS_XXX_TRAIT_DEF(complex_kwd_parser_id)
}
@@ -76,6 +82,16 @@ namespace boost { namespace spirit { namespace repository { namespace qi
template <typename Subject>
struct is_kwd_parser<spirit::qi::hold_directive<Subject> > : detail::has_kwd_parser_id<Subject> {};
+ template <typename T>
+ struct is_complex_kwd_parser : detail::has_complex_kwd_parser_id<T> {};
+
+ template <typename Subject, typename Action>
+ struct is_complex_kwd_parser<spirit::qi::action<Subject,Action> > : detail::has_complex_kwd_parser_id<Subject> {};
+
+ template <typename Subject>
+ struct is_complex_kwd_parser<spirit::qi::hold_directive<Subject> > : detail::has_complex_kwd_parser_id<Subject> {};
+
+
// Keywords operator
template <typename Elements, typename Modifiers>
struct keywords : spirit::qi::nary_parser<keywords<Elements,Modifiers> >
@@ -101,10 +117,15 @@ namespace boost { namespace spirit { namespace repository { namespace qi
typedef typename mpl::count_if<
Elements,
mpl::not_<
+ mpl::or_<
is_kwd_parser<
mpl::_1
+ > ,
+ is_complex_kwd_parser<
+ mpl::_1
>
>
+ >
> non_kwd_subject_count;
/// If the assertion fails here then you probably forgot to wrap a
@@ -130,208 +151,38 @@ namespace boost { namespace spirit { namespace repository { namespace qi
typedef typename mpl::range_c<int, 0, sequence_size::value>::type int_range;
// Transform the range_c to an mpl vector in order to be able to transform it into a variant
- typedef typename mpl::copy<int_range, mpl::back_inserter<mpl::vector<> > >::type int_vector;
-
- // Build the variant type containing the indexes of the parsers
- typedef typename
- spirit::detail::as_variant<
- int_vector >::type type;
- };
-
- // Create a variant type to be able to store parser indexes in the embedded symbols parser
- typedef typename build_parser_tags< Elements >::type parser_index_type;
-
- ///////////////////////////////////////////////////////////////////////////
- // build_char_type_sequence
- //
- // Build a fusion sequence from the kwd directive specified character type.
- ///////////////////////////////////////////////////////////////////////////
- template <typename Sequence >
- struct build_char_type_sequence
- {
- struct element_char_type
- {
- template <typename T>
- struct result;
-
- template <typename F, typename Element>
- struct result<F(Element)>
- {
- typedef typename Element::char_type type;
-
- };
- template <typename F, typename Element,typename Action>
- struct result<F(spirit::qi::action<Element,Action>) >
- {
- typedef typename Element::char_type type;
- };
- template <typename F, typename Element>
- struct result<F(spirit::qi::hold_directive<Element>)>
- {
- typedef typename Element::char_type type;
- };
-
- // never called, but needed for decltype-based result_of (C++0x)
- template <typename Element>
- typename result<element_char_type(Element)>::type
- operator()(Element&) const;
- };
-
- // Compute the list of character types of the child kwd directives
- typedef typename
- fusion::result_of::transform<Sequence, element_char_type>::type
- type;
- };
-
-
- ///////////////////////////////////////////////////////////////////////////
- // get_keyword_char_type
- //
- // Collapses the character type comming from the subject kwd parsers and
- // and checks that they are all identical (necessary in order to be able
- // to build a tst parser to parse the keywords.
- ///////////////////////////////////////////////////////////////////////////
- template <typename Sequence>
- struct get_keyword_char_type
- {
- // Make sure each of the types occur only once in the type list
- typedef typename
- mpl::fold<
- Sequence, mpl::vector<>,
- mpl::if_<
- mpl::contains<mpl::_1, mpl::_2>,
- mpl::_1, mpl::push_back<mpl::_1, mpl::_2>
- >
- >::type
- no_duplicate_char_types;
+ typedef typename mpl::copy<int_range, mpl::back_inserter<mpl::vector<> > >::type type;
- // If the compiler traps here this means you mixed
- // character type for the keywords specified in the
- // kwd directive sequence.
- BOOST_MPL_ASSERT_RELATION( mpl::size<no_duplicate_char_types>::value, ==, 1 );
-
- typedef typename mpl::front<no_duplicate_char_types>::type type;
-
};
-
- /// Get the character type for the tst parser
- typedef typename build_char_type_sequence< Elements >::type char_types;
- typedef typename get_keyword_char_type< char_types >::type char_type;
+ // Build an index mpl vector
+ typedef typename build_parser_tags< Elements >::type parser_index_vector;
- /// Our symbols container
- typedef spirit::qi::tst< char_type, parser_index_type> keywords_type;
+ template <typename idx>
+ struct is_complex_kwd_parser_filter : is_complex_kwd_parser< typename mpl::at<Elements, idx>::type >
+ {};
- // Filter functor used for case insensitive parsing
- template <typename CharEncoding>
- struct no_case_filter
- {
- char_type operator()(char_type ch) const
- {
- return static_cast<char_type>(CharEncoding::tolower(ch));
- }
- };
-
- ///////////////////////////////////////////////////////////////////////////
- // build_case_type_sequence
- //
- // Build a fusion sequence from the kwd/ikwd directives
- // in order to determine if case sensitive and case insensitive
- // keywords have been mixed.
- ///////////////////////////////////////////////////////////////////////////
- template <typename Sequence >
- struct build_case_type_sequence
- {
- struct element_case_type
- {
- template <typename T>
- struct result;
+ template <typename idx>
+ struct is_kwd_parser_filter : is_kwd_parser< typename mpl::at<Elements, idx>::type >
+ {};
- template <typename F, typename Element>
- struct result<F(Element)>
- {
- typedef typename Element::no_case_keyword type;
+ // filter out the string kwd directives
+ typedef typename mpl::filter_view< Elements, is_kwd_parser<mpl_::_> >::type string_keywords;
- };
- template <typename F, typename Element,typename Action>
- struct result<F(spirit::qi::action<Element,Action>) >
- {
- typedef typename Element::no_case_keyword type;
- };
- template <typename F, typename Element>
- struct result<F(spirit::qi::hold_directive<Element>)>
- {
- typedef typename Element::no_case_keyword type;
- };
+ typedef typename mpl::filter_view< parser_index_vector ,
+ is_kwd_parser_filter< mpl::_ >
+ >::type string_keyword_indexes;
+ // filter out the complex keywords
+ typedef typename mpl::filter_view< parser_index_vector ,
+ is_complex_kwd_parser_filter< mpl::_ >
+ >::type complex_keywords_indexes;
- // never called, but needed for decltype-based result_of (C++0x)
- template <typename Element>
- typename result<element_case_type(Element)>::type
- operator()(Element&) const;
- };
+ //typedef typename fusion::filter_view< Elements, is_complex_kwd_parser< mpl::_ > > complex_keywords_view;
- // Compute the list of character types of the child kwd directives
- typedef typename
- fusion::result_of::transform<Sequence, element_case_type>::type
- type;
- };
-
- ///////////////////////////////////////////////////////////////////////////
- // get_nb_case_types
- //
- // Counts the number of entries in the case type sequence matching the
- // CaseType parameter (mpl::true_ -> case insensitve
- // , mpl::false_ -> case sensitive
- ///////////////////////////////////////////////////////////////////////////
- template <typename Sequence,typename CaseType>
- struct get_nb_case_types
- {
- // Make sure each of the types occur only once in the type list
- typedef typename
- mpl::count_if<
- Sequence, mpl::equal_to<mpl::_,CaseType>
- >::type type;
-
-
- };
- // Build the case type sequence
- typedef typename build_case_type_sequence<Elements>::type case_type_sequence;
- // Count the number of case sensitive entries and case insensitve entries
- typedef typename get_nb_case_types<case_type_sequence,mpl::true_>::type ikwd_count;
- typedef typename get_nb_case_types<case_type_sequence,mpl::false_>::type kwd_count;
- // Get the size of the original sequence
- typedef typename mpl::size<Elements>::type nb_elements;
- // Determine if all the kwd directive are case sensitive/insensitive
- typedef typename mpl::equal_to< ikwd_count, nb_elements>::type all_ikwd;
- typedef typename mpl::equal_to< kwd_count, nb_elements>::type all_kwd;
-
- typedef typename mpl::or_< all_kwd, all_ikwd >::type all_directives_of_same_type;
-
- // Do we have a no case modifier
- typedef has_modifier<Modifiers, spirit::tag::char_code_base<spirit::tag::no_case> > no_case_modifier;
-
- // Should the no_case filter always be used ?
- typedef typename mpl::or_<
- no_case_modifier,
- mpl::and_<
- all_directives_of_same_type
- ,all_ikwd
- >
- >::type
- no_case;
-
- typedef no_case_filter<
- typename spirit::detail::get_encoding_with_case<
- Modifiers
- , char_encoding::standard
- , no_case::value>::type>
- nc_filter;
- // Determine the standard case filter type
typedef typename mpl::if_<
- no_case
- , nc_filter
- , spirit::qi::tst_pass_through >::type
- filter_type;
-
+ typename mpl::empty<complex_keywords_indexes>::type,
+ detail::empty_keywords_list,
+ detail::complex_keywords< complex_keywords_indexes >
+ >::type complex_keywords_type;
// build a bool array and an integer array which will be used to
// check that the repetition constraints of the kwd parsers are
@@ -339,91 +190,24 @@ namespace boost { namespace spirit { namespace repository { namespace qi
typedef boost::array<bool, fusion::result_of::size<Elements>::value> flags_type;
typedef boost::array<int, fusion::result_of::size<Elements>::value> counters_type;
+ typedef typename mpl::if_<
+ typename mpl::empty<string_keyword_indexes>::type,
+ detail::empty_keywords_list,
+ detail::string_keywords<
+ Elements,
+ string_keywords,
+ string_keyword_indexes,
+ flags_type,
+ Modifiers>
+ >::type string_keywords_type;
-
- // Functor which adds all the keywords/subject parser indexes
- // collected from the subject kwd directives to the keyword tst parser
- template< typename Sequence >
- struct keyword_entry_adder
+ keywords(Elements const& elements_) :
+ elements(elements_)
+ , string_keywords_inst(elements,flags_init)
+ , complex_keywords_inst(elements,flags_init)
{
- typedef int result_type;
-
- keyword_entry_adder(shared_ptr<keywords_type> lookup,flags_type &flags) :
- lookup(lookup)
- ,flags(flags)
- {}
-
- typedef typename fusion::result_of::begin< Sequence >::type sequence_begin;
-
- template <typename T>
- int operator()(const int i, const T &parser) const
- {
- // Determine the current position being handled
- typedef typename fusion::result_of::distance< sequence_begin, T >::type position_raw;
- // Transform the position to a parser index tag
- typedef typename mpl::integral_c<int,position_raw::value> position;
-
- return call(i,fusion::deref(parser),position());
}
- template <typename T, typename Position, typename Action>
- int call( const int i, const spirit::qi::action<T,Action> &parser, const Position position ) const
- {
-
- // Make the keyword/parse index entry in the tst parser
- lookup->add(
- traits::get_begin<char_type>(parser.subject.keyword.str),
- traits::get_end<char_type>(parser.subject.keyword.str),
- position
- );
- // Get the initial state of the flags array and store it in the flags initializer
- flags[Position::value]=parser.subject.iter.flag_init();
- return 0;
- }
-
- template <typename T, typename Position>
- int call( const int i, const T & parser, const Position position) const
- {
- // Make the keyword/parse index entry in the tst parser
- lookup->add(
- traits::get_begin<char_type>(parser.keyword.str),
- traits::get_end<char_type>(parser.keyword.str),
- position
- );
- // Get the initial state of the flags array and store it in the flags initializer
- flags[Position::value]=parser.iter.flag_init();
- return 0;
- }
-
- template <typename T, typename Position>
- int call( const int i, const spirit::qi::hold_directive<T> & parser, const Position position) const
- {
- // Make the keyword/parse index entry in the tst parser
- lookup->add(
- traits::get_begin<char_type>(parser.subject.keyword.str),
- traits::get_end<char_type>(parser.subject.keyword.str),
- position
- );
- // Get the initial state of the flags array and store it in the flags initializer
- flags[Position::value]=parser.subject.iter.flag_init();
- return 0;
- }
-
-
- shared_ptr<keywords_type> lookup;
- flags_type & flags;
- };
-
-
- keywords(Elements const& elements) :
- elements(elements)
- , lookup(new keywords_type())
- {
- // Loop through all the subject parsers to build the keyword parser symbol parser
- keyword_entry_adder<Elements> f1(lookup,flags_init);
- fusion::iter_fold(this->elements,0,f1);
- }
-
template <typename Iterator, typename Context
, typename Skipper, typename Attribute>
bool parse(Iterator& first, Iterator const& last
@@ -434,7 +218,7 @@ namespace boost { namespace spirit { namespace repository { namespace qi
// We need to handle the case where kwd / ikwd directives have been mixed
// This is where we decide which function should be called.
return parse_impl(first, last, context, skipper, attr_,
- typename mpl::or_<all_directives_of_same_type, no_case>::type()
+ typename string_keywords_type::requires_one_pass()
);
}
@@ -442,7 +226,7 @@ namespace boost { namespace spirit { namespace repository { namespace qi
, typename Skipper, typename Attribute>
bool parse_impl(Iterator& first, Iterator const& last
, Context& context, Skipper const& skipper
- , Attribute& attr_,mpl::true_ /* no ikwd */) const
+ , Attribute& attr_,mpl::true_ /* one pass */) const
{
// wrap the attribute in a tuple if it is not a tuple
@@ -458,10 +242,16 @@ namespace boost { namespace spirit { namespace repository { namespace qi
, flags_type, counters_type
, typename traits::wrap_if_not_tuple<Attribute>::type
, mpl::false_ > parser_visitor_type;
+
parser_visitor_type parse_visitor(elements, first, last
, context, skipper, flags
, counters, attr);
+ typedef repository::qi::detail::complex_kwd_function< parser_visitor_type > complex_kwd_function_type;
+
+ complex_kwd_function_type
+ complex_function(first,last,context,skipper,parse_visitor);
+
// We have a bool array 'flags' with one flag for each parser as well as a 'counter'
// array.
// The kwd directive sets and increments the counter when a successeful parse occured
@@ -471,35 +261,36 @@ namespace boost { namespace spirit { namespace repository { namespace qi
// The parsing takes place here in two steps:
// 1) parse a keyword and fetch the parser index associated with that keyword
// 2) call the associated parser and store the parsed value in the matching attribute.
- Iterator save = first;
+
while(true)
{
spirit::qi::skip_over(first, last, skipper);
- if (parser_index_type* val_ptr
- = lookup->find(first, last, filter_type()))
+ Iterator save = first;
+ if (string_keywords_inst.parse(first, last,parse_visitor,skipper))
{
- spirit::qi::skip_over(first, last, skipper);
- if(!apply_visitor(parse_visitor,*val_ptr)){
- first = save;
- return false;
- }
save = first;
}
- else
+ else {
+ // restore the position to the last successful keyword parse
+ first = save;
+ if(!complex_keywords_inst.parse(complex_function))
{
+ first = save;
// Check that we are leaving the keywords parser in a successfull state
BOOST_FOREACH(bool &valid,flags)
{
if(!valid)
{
- first = save;
return false;
}
}
return true;
}
+ else
+ save = first;
}
+ }
return false;
}
@@ -508,7 +299,7 @@ namespace boost { namespace spirit { namespace repository { namespace qi
, typename Skipper, typename Attribute>
bool parse_impl(Iterator& first, Iterator const& last
, Context& context, Skipper const& skipper
- , Attribute& attr_,mpl::false_) const
+ , Attribute& attr_,mpl::false_ /* two passes */) const
{
// wrap the attribute in a tuple if it is not a tuple
@@ -536,6 +327,12 @@ namespace boost { namespace spirit { namespace repository { namespace qi
no_case_parser_visitor_type no_case_parse_visitor(elements,first,last
,context,skipper,flags,counters,attr);
+ typedef repository::qi::detail::complex_kwd_function< parser_visitor_type > complex_kwd_function_type;
+
+ complex_kwd_function_type
+ complex_function(first,last,context,skipper,parse_visitor);
+
+
// We have a bool array 'flags' with one flag for each parser as well as a 'counter'
// array.
// The kwd directive sets and increments the counter when a successeful parse occured
@@ -545,47 +342,37 @@ namespace boost { namespace spirit { namespace repository { namespace qi
// The parsing takes place here in two steps:
// 1) parse a keyword and fetch the parser index associated with that keyword
// 2) call the associated parser and store the parsed value in the matching attribute.
- Iterator save = first;
+
while(true)
{
spirit::qi::skip_over(first, last, skipper);
- // First pass case sensitive
- Iterator saved_first = first;
- if (parser_index_type* val_ptr
- = lookup->find(first, last, spirit::qi::tst_pass_through()))
+ Iterator save = first;
+ // String keywords pass
+ if (string_keywords_inst.parse(first,last,parse_visitor,no_case_parse_visitor,skipper))
{
- spirit::qi::skip_over(first, last, skipper);
- if(!apply_visitor(parse_visitor,*val_ptr)){
- first = save;
- return false;
- }
save = first;
}
- // Second pass case insensitive
- else if(parser_index_type* val_ptr
- = lookup->find(saved_first,last,nc_filter()))
+ else {
+ first = save;
+
+ if(!complex_keywords_inst.parse(complex_function))
{
- first = saved_first;
- spirit::qi::skip_over(first, last, skipper);
- if(!apply_visitor(no_case_parse_visitor,*val_ptr)){
first = save;
- return false;
- }
- save = first;
- }
- else
- {
// Check that we are leaving the keywords parser in a successfull state
BOOST_FOREACH(bool &valid,flags)
{
if(!valid)
{
- first = save;
return false;
}
}
return true;
}
+ else
+ {
+ save = first;
+ }
+ }
}
return false;
}
@@ -600,7 +387,8 @@ namespace boost { namespace spirit { namespace repository { namespace qi
}
flags_type flags_init;
Elements elements;
- shared_ptr<keywords_type> lookup;
+ string_keywords_type string_keywords_inst;
+ complex_keywords_type complex_keywords_inst;
};
}}}}
@@ -634,6 +422,14 @@ namespace boost { namespace spirit { namespace traits
template <typename Elements, typename Modifiers>
struct has_semantic_action<repository::qi::keywords<Elements, Modifiers> >
: nary_has_semantic_action<Elements> {};
+
+ template <typename Elements, typename Attribute, typename Context
+ , typename Iterator, typename Modifiers>
+ struct handles_container<repository::qi::keywords<Elements,Modifiers>, Attribute
+ , Context, Iterator>
+ : nary_handles_container<Elements, Attribute, Context, Iterator> {};
+
+
}}}
#endif
diff --git a/boost/spirit/repository/home/support/kwd.hpp b/boost/spirit/repository/home/support/kwd.hpp
index efe756d3e0..e723cec8c6 100644
--- a/boost/spirit/repository/home/support/kwd.hpp
+++ b/boost/spirit/repository/home/support/kwd.hpp
@@ -15,7 +15,7 @@
namespace boost { namespace spirit { namespace repository
{
// The distinct extended terminal
- BOOST_SPIRIT_DEFINE_TERMINALS_NAME_EX(( kwd, kwd_type )( ikwd, ikwd_type ) )
+ BOOST_SPIRIT_DEFINE_TERMINALS_NAME_EX(( kwd, kwd_type )( ikwd, ikwd_type )(dkwd, dkwd_type)(idkwd, idkwd_type) )
}}}
diff --git a/boost/spirit/symbols.hpp b/boost/spirit/symbols.hpp
deleted file mode 100644
index df56a65d57..0000000000
--- a/boost/spirit/symbols.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_SYMBOLS
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_SYMBOLS
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_symbols.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_symbols.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_symbols.hpp>
-
-#endif
diff --git a/boost/spirit/symbols/symbols.hpp b/boost/spirit/symbols/symbols.hpp
deleted file mode 100644
index df56a65d57..0000000000
--- a/boost/spirit/symbols/symbols.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_SYMBOLS
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_SYMBOLS
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_symbols.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_symbols.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_symbols.hpp>
-
-#endif
diff --git a/boost/spirit/symbols/symbols_fwd.hpp b/boost/spirit/symbols/symbols_fwd.hpp
deleted file mode 100644
index 930f86b44e..0000000000
--- a/boost/spirit/symbols/symbols_fwd.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_SYMBOLS_FWD
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_SYMBOLS_FWD
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_symbols_fwd.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_symbols_fwd.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_symbols_fwd.hpp>
-
-#endif
diff --git a/boost/spirit/symbols/typeof.hpp b/boost/spirit/symbols/typeof.hpp
deleted file mode 100644
index 07c6b33239..0000000000
--- a/boost/spirit/symbols/typeof.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_TYPEOF_SYMBOLS
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_TYPEOF_SYMBOLS
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_typeof.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_typeof.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_typeof.hpp>
-
-#endif
diff --git a/boost/spirit/tree/ast.hpp b/boost/spirit/tree/ast.hpp
deleted file mode 100644
index 416b10f6ef..0000000000
--- a/boost/spirit/tree/ast.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_AST
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_AST
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_ast.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_ast.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_ast.hpp>
-
-#endif
diff --git a/boost/spirit/tree/ast_fwd.hpp b/boost/spirit/tree/ast_fwd.hpp
deleted file mode 100644
index 7b978d1278..0000000000
--- a/boost/spirit/tree/ast_fwd.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_AST_FWD
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_AST_FWD
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_ast_fwd.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_ast_fwd.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_ast_fwd.hpp>
-
-#endif
diff --git a/boost/spirit/tree/common.hpp b/boost/spirit/tree/common.hpp
deleted file mode 100644
index 7555b4dbfd..0000000000
--- a/boost/spirit/tree/common.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_COMMON
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_COMMON
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_common.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_common.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_common.hpp>
-
-#endif
diff --git a/boost/spirit/tree/common_fwd.hpp b/boost/spirit/tree/common_fwd.hpp
deleted file mode 100644
index 039b3b0d8d..0000000000
--- a/boost/spirit/tree/common_fwd.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_COMMON_FWD
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_COMMON_FWD
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_common_fwd.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_common_fwd.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_common_fwd.hpp>
-
-#endif
diff --git a/boost/spirit/tree/parse_tree.hpp b/boost/spirit/tree/parse_tree.hpp
deleted file mode 100644
index ef8c5d4734..0000000000
--- a/boost/spirit/tree/parse_tree.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_PARSE_TREE
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_PARSE_TREE
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_parse_tree.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_parse_tree.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_parse_tree.hpp>
-
-#endif
diff --git a/boost/spirit/tree/parse_tree_fwd.hpp b/boost/spirit/tree/parse_tree_fwd.hpp
deleted file mode 100644
index 8330731711..0000000000
--- a/boost/spirit/tree/parse_tree_fwd.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_PARSE_TREE_FWD
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_PARSE_TREE_FWD
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_parse_tree_fwd.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_parse_tree_fwd.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_parse_tree_fwd.hpp>
-
-#endif
diff --git a/boost/spirit/tree/parse_tree_utils.hpp b/boost/spirit/tree/parse_tree_utils.hpp
deleted file mode 100644
index 6df07fd96e..0000000000
--- a/boost/spirit/tree/parse_tree_utils.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_PARSE_TREE_UTILS
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_PARSE_TREE_UTILS
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_parse_tree_utils.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_parse_tree_utils.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_parse_tree_utils.hpp>
-
-#endif
diff --git a/boost/spirit/tree/parsetree.dtd b/boost/spirit/tree/parsetree.dtd
deleted file mode 100644
index 9d847c746c..0000000000
--- a/boost/spirit/tree/parsetree.dtd
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!-- This DTD is used for the output of Spirit parse tree's through -->
-<!-- the boost::spirit::tree_to_xml functions. -->
-<!-- Copyright (c) 2001-2007 Hartmut Kaiser -->
-<!-- Distribution under the Boost Software -->
-<!-- License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -->
-<!-- http://www.boost.org/LICENSE_1_0.txt) -->
-<!ELEMENT parsetree (parsenode)>
-<!ATTLIST parsetree
- version CDATA "1.0"
->
-<!ELEMENT parsenode ((value | token)?, parsenode*)>
-<!ATTLIST parsenode
- rule CDATA #IMPLIED
->
-<!ELEMENT value (#PCDATA | token)*>
-<!ELEMENT token (#PCDATA)>
-<!ATTLIST token
- id CDATA #REQUIRED
- is_root CDATA "0"
->
diff --git a/boost/spirit/tree/tree_to_xml.hpp b/boost/spirit/tree/tree_to_xml.hpp
deleted file mode 100644
index c4dece8ce2..0000000000
--- a/boost/spirit/tree/tree_to_xml.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_TREE_TO_XML
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_TREE_TO_XML
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_tree_to_xml.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_tree_to_xml.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_tree_to_xml.hpp>
-
-#endif
diff --git a/boost/spirit/tree/typeof.hpp b/boost/spirit/tree/typeof.hpp
deleted file mode 100644
index fd46ee3dc4..0000000000
--- a/boost/spirit/tree/typeof.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_TYPEOF_TREE
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_TYPEOF_TREE
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_typeof.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_typeof.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_typeof.hpp>
-
-#endif
diff --git a/boost/spirit/utility.hpp b/boost/spirit/utility.hpp
deleted file mode 100644
index 1aa7fbc58f..0000000000
--- a/boost/spirit/utility.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_UTILITY
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_UTILITY
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_utility.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_utility.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_utility.hpp>
-
-#endif
diff --git a/boost/spirit/utility/chset.hpp b/boost/spirit/utility/chset.hpp
deleted file mode 100644
index 8c8c188316..0000000000
--- a/boost/spirit/utility/chset.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_CHSET
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_CHSET
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_chset.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_chset.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_chset.hpp>
-
-#endif
diff --git a/boost/spirit/utility/chset_operators.hpp b/boost/spirit/utility/chset_operators.hpp
deleted file mode 100644
index a4e2dd0a70..0000000000
--- a/boost/spirit/utility/chset_operators.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_CHSET_OPERATORS
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_CHSET_OPERATORS
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_chset_operators.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_chset_operators.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_chset_operators.hpp>
-
-#endif
diff --git a/boost/spirit/utility/confix.hpp b/boost/spirit/utility/confix.hpp
deleted file mode 100644
index c7f9f76e34..0000000000
--- a/boost/spirit/utility/confix.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_CONFIX
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_CONFIX
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_confix.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_confix.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_confix.hpp>
-
-#endif
diff --git a/boost/spirit/utility/confix_fwd.hpp b/boost/spirit/utility/confix_fwd.hpp
deleted file mode 100644
index 5ae89079e2..0000000000
--- a/boost/spirit/utility/confix_fwd.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_CONFIX_FWD
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_CONFIX_FWD
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_confix_fwd.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_confix_fwd.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_confix_fwd.hpp>
-
-#endif
diff --git a/boost/spirit/utility/distinct.hpp b/boost/spirit/utility/distinct.hpp
deleted file mode 100644
index 201034ea0b..0000000000
--- a/boost/spirit/utility/distinct.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_DISTINCT
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_DISTINCT
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_distinct.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_distinct.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_distinct.hpp>
-
-#endif
diff --git a/boost/spirit/utility/distinct_fwd.hpp b/boost/spirit/utility/distinct_fwd.hpp
deleted file mode 100644
index b3a68859a1..0000000000
--- a/boost/spirit/utility/distinct_fwd.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_DISTINCT_FWD
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_DISTINCT_FWD
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_distinct_fwd.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_distinct_fwd.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_distinct_fwd.hpp>
-
-#endif
diff --git a/boost/spirit/utility/escape_char.hpp b/boost/spirit/utility/escape_char.hpp
deleted file mode 100644
index 8b7374da58..0000000000
--- a/boost/spirit/utility/escape_char.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_ESCAPE_CHAR
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_ESCAPE_CHAR
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_escape_char.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_escape_char.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_escape_char.hpp>
-
-#endif
diff --git a/boost/spirit/utility/escape_char_fwd.hpp b/boost/spirit/utility/escape_char_fwd.hpp
deleted file mode 100644
index 0db9cb9287..0000000000
--- a/boost/spirit/utility/escape_char_fwd.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_ESCAPE_CHAR_FWD
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_ESCAPE_CHAR_FWD
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_escape_char_fwd.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_escape_char_fwd.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_escape_char_fwd.hpp>
-
-#endif
diff --git a/boost/spirit/utility/flush_multi_pass.hpp b/boost/spirit/utility/flush_multi_pass.hpp
deleted file mode 100644
index 4d61fe0806..0000000000
--- a/boost/spirit/utility/flush_multi_pass.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_FLUSH_MULTI_PASS
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_FLUSH_MULTI_PASS
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_flush_multi_pass.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_flush_multi_pass.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_flush_multi_pass.hpp>
-
-#endif
diff --git a/boost/spirit/utility/functor_parser.hpp b/boost/spirit/utility/functor_parser.hpp
deleted file mode 100644
index 3112ea2f62..0000000000
--- a/boost/spirit/utility/functor_parser.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_FUNCTOR_PARSER
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_FUNCTOR_PARSER
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_functor_parser.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_functor_parser.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_functor_parser.hpp>
-
-#endif
diff --git a/boost/spirit/utility/grammar_def.hpp b/boost/spirit/utility/grammar_def.hpp
deleted file mode 100644
index fbb7c55299..0000000000
--- a/boost/spirit/utility/grammar_def.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_GRAMMAR_DEF
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_GRAMMAR_DEF
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_grammar_def.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_grammar_def.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_grammar_def.hpp>
-
-#endif
diff --git a/boost/spirit/utility/grammar_def_fwd.hpp b/boost/spirit/utility/grammar_def_fwd.hpp
deleted file mode 100644
index 54f64d2d17..0000000000
--- a/boost/spirit/utility/grammar_def_fwd.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_GRAMMAR_DEF_FWD
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_GRAMMAR_DEF_FWD
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_grammar_def_fwd.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_grammar_def_fwd.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_grammar_def_fwd.hpp>
-
-#endif
diff --git a/boost/spirit/utility/lists.hpp b/boost/spirit/utility/lists.hpp
deleted file mode 100644
index 9234263c10..0000000000
--- a/boost/spirit/utility/lists.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_LISTS
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_LISTS
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_lists.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_lists.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_lists.hpp>
-
-#endif
diff --git a/boost/spirit/utility/lists_fwd.hpp b/boost/spirit/utility/lists_fwd.hpp
deleted file mode 100644
index d256e5e200..0000000000
--- a/boost/spirit/utility/lists_fwd.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_LISTS_FWD
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_LISTS_FWD
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_lists_fwd.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_lists_fwd.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_lists_fwd.hpp>
-
-#endif
diff --git a/boost/spirit/utility/loops.hpp b/boost/spirit/utility/loops.hpp
deleted file mode 100644
index 562e71b602..0000000000
--- a/boost/spirit/utility/loops.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_LOOPS
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_LOOPS
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_loops.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_loops.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_loops.hpp>
-
-#endif
diff --git a/boost/spirit/utility/regex.hpp b/boost/spirit/utility/regex.hpp
deleted file mode 100644
index c612c13a26..0000000000
--- a/boost/spirit/utility/regex.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_REGEX
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_REGEX
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_regex.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_regex.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_regex.hpp>
-
-#endif
diff --git a/boost/spirit/utility/rule_parser.hpp b/boost/spirit/utility/rule_parser.hpp
deleted file mode 100644
index 77bdeb1841..0000000000
--- a/boost/spirit/utility/rule_parser.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_RULE_PARSER
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_RULE_PARSER
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_rule_parser.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_rule_parser.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_rule_parser.hpp>
-
-#endif
diff --git a/boost/spirit/utility/scoped_lock.hpp b/boost/spirit/utility/scoped_lock.hpp
deleted file mode 100644
index 6327f68f8f..0000000000
--- a/boost/spirit/utility/scoped_lock.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_SCOPED_LOCK
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_SCOPED_LOCK
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_scoped_lock.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_scoped_lock.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_scoped_lock.hpp>
-
-#endif
diff --git a/boost/spirit/utility/typeof.hpp b/boost/spirit/utility/typeof.hpp
deleted file mode 100644
index f2044bfc21..0000000000
--- a/boost/spirit/utility/typeof.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2008 Joel de Guzman
- Copyright (c) 2001-2008 Hartmut Kaiser
- http://spirit.sourceforge.net/
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#ifndef BOOST_SPIRIT_DEPRECATED_INCLUDE_TYPEOF_UTILITY
-#define BOOST_SPIRIT_DEPRECATED_INCLUDE_TYPEOF_UTILITY
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_typeof.hpp")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_typeof.hpp"
-#endif
-#endif
-
-#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
-#define BOOST_SPIRIT_USE_OLD_NAMESPACE
-#endif
-#include <boost/spirit/include/classic_typeof.hpp>
-
-#endif
diff --git a/boost/system/config.hpp b/boost/system/config.hpp
index bf78051f8f..b128717e78 100644
--- a/boost/system/config.hpp
+++ b/boost/system/config.hpp
@@ -16,6 +16,23 @@
// This header implements separate compilation features as described in
// http://www.boost.org/more/separate_compilation.html
+// normalize macros ------------------------------------------------------------------//
+
+#if !defined(BOOST_SYSTEM_DYN_LINK) && !defined(BOOST_SYSTEM_STATIC_LINK) \
+ && !defined(BOOST_ALL_DYN_LINK) && !defined(BOOST_ALL_STATIC_LINK)
+# define BOOST_SYSTEM_STATIC_LINK
+#endif
+
+#if defined(BOOST_ALL_DYN_LINK) && !defined(BOOST_SYSTEM_DYN_LINK)
+# define BOOST_SYSTEM_DYN_LINK
+#elif defined(BOOST_ALL_STATIC_LINK) && !defined(BOOST_SYSTEM_STATIC_LINK)
+# define BOOST_SYSTEM_STATIC_LINK
+#endif
+
+#if defined(BOOST_SYSTEM_DYN_LINK) && defined(BOOST_SYSTEM_STATIC_LINK)
+# error Must not define both BOOST_SYSTEM_DYN_LINK and BOOST_SYSTEM_STATIC_LINK
+#endif
+
// enable dynamic or static linking as requested --------------------------------------//
#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SYSTEM_DYN_LINK)
diff --git a/boost/thread/barrier.hpp b/boost/thread/barrier.hpp
index 4ca30cb4df..4fd89883b8 100644
--- a/boost/thread/barrier.hpp
+++ b/boost/thread/barrier.hpp
@@ -2,7 +2,7 @@
// David Moore, William E. Kempf
// Copyright (C) 2007-8 Anthony Williams
//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_BARRIER_JDM030602_HPP
@@ -28,14 +28,14 @@ namespace boost
: m_threshold(count), m_count(count), m_generation(0)
{
if (count == 0)
- boost::throw_exception(std::invalid_argument("count cannot be zero."));
+ boost::throw_exception(thread_exception(system::errc::invalid_argument, "barrier constructor: count cannot be zero."));
}
-
+
bool wait()
{
boost::mutex::scoped_lock lock(m_mutex);
unsigned int gen = m_generation;
-
+
if (--m_count == 0)
{
m_generation++;
diff --git a/boost/thread/cv_status.hpp b/boost/thread/cv_status.hpp
new file mode 100644
index 0000000000..99b3c0c218
--- /dev/null
+++ b/boost/thread/cv_status.hpp
@@ -0,0 +1,26 @@
+// cv_status.hpp
+//
+// Copyright (C) 2011 Vicente J. Botet Escriba
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_THREAD_CV_STATUS_HPP
+#define BOOST_THREAD_CV_STATUS_HPP
+
+#include <boost/detail/scoped_enum_emulation.hpp>
+
+namespace boost
+{
+
+ // enum class cv_status;
+ BOOST_SCOPED_ENUM_DECLARE_BEGIN(cv_status)
+ {
+ no_timeout,
+ timeout
+ }
+ BOOST_SCOPED_ENUM_DECLARE_END(cv_status)
+}
+
+#endif // header
diff --git a/boost/thread/detail/config.hpp b/boost/thread/detail/config.hpp
index b59550669c..d9270df8af 100644
--- a/boost/thread/detail/config.hpp
+++ b/boost/thread/detail/config.hpp
@@ -1,5 +1,6 @@
// Copyright (C) 2001-2003
// William E. Kempf
+// Copyright (C) 2011-2012 Vicente J. Botet Escriba
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -10,13 +11,117 @@
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
+// This compiler doesn't support Boost.Chrono
+#if defined __IBMCPP__ && (__IBMCPP__ < 1100)
+#define BOOST_THREAD_DONT_USE_CHRONO
+#endif
+
+// This compiler doesn't support Boost.Move
+#if BOOST_WORKAROUND(__SUNPRO_CC, < 0x5100)
+#define BOOST_THREAD_DONT_USE_MOVE
+#endif
+// This compiler doesn't support Boost.Container Allocators files
+#if defined __SUNPRO_CC
+#define BOOST_THREAD_DONT_PROVIDE_FUTURE_CTOR_ALLOCATORS
+#endif
+
+#if defined _WIN32_WCE && _WIN32_WCE==0x501
+#define BOOST_THREAD_DONT_PROVIDE_FUTURE_CTOR_ALLOCATORS
+#endif
+
+#if ! defined BOOST_THREAD_DONT_PROVIDE_BASIC_THREAD_ID
+#define BOOST_THREAD_PROVIDES_BASIC_THREAD_ID
+#endif
+
+// Default version is 2
#if !defined BOOST_THREAD_VERSION
-#define BOOST_THREAD_VERSION 1
+#define BOOST_THREAD_VERSION 2
#else
-#if BOOST_THREAD_VERSION!=1 && BOOST_THREAD_VERSION!=2
-#error "BOOST_THREAD_VERSION must be 1 or 2"
+#if BOOST_THREAD_VERSION!=2 && BOOST_THREAD_VERSION!=3
+#error "BOOST_THREAD_VERSION must be 2 or 3"
+#endif
+#endif
+
+// Uses Boost.System by default if not stated the opposite defining BOOST_THREAD_DONT_USE_SYSTEM
+#if ! defined BOOST_THREAD_DONT_USE_SYSTEM
+#define BOOST_THREAD_USES_SYSTEM
+#endif
+
+// Uses Boost.Chrono by default if not stated the opposite defining BOOST_THREAD_DONT_USE_CHRONO or BOOST_THREAD_DONT_USE_SYSTEM
+#if ! defined BOOST_THREAD_DONT_USE_CHRONO && ! defined BOOST_THREAD_DONT_USE_SYSTEM
+#define BOOST_THREAD_USES_CHRONO
+#endif
+
+// Don't provided by default in version 1.
+#if defined BOOST_THREAD_PROVIDES_EXPLICIT_LOCK_CONVERSION
+#define BOOST_THREAD_EXPLICIT_LOCK_CONVERSION explicit
+#else
+#define BOOST_THREAD_EXPLICIT_LOCK_CONVERSION
+#endif
+
+
+// Uses Boost.Move by default if not stated the opposite defining BOOST_THREAD_DONT_USE_MOVE
+#if ! defined BOOST_THREAD_DONT_USE_MOVE
+#if ! defined BOOST_THREAD_USES_MOVE
+//#define BOOST_THREAD_USES_MOVE
+#endif
#endif
+
+#if BOOST_THREAD_VERSION==2
+#if ! defined BOOST_THREAD_DONT_PROVIDE_PROMISE_LAZY
+#define BOOST_THREAD_PROMISE_LAZY
+#endif
+#if ! defined BOOST_THREAD_DONT_PROVIDE_DEPRECATED_FEATURES_SINCE_V3_0_0
+#define BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0
+#endif
+#endif
+
+#if BOOST_THREAD_VERSION==3
+#if ! defined BOOST_THREAD_DONT_PROVIDE_ONCE_CXX11
+#define BOOST_THREAD_PROVIDES_ONCE_CXX11
+#endif
+#if ! defined BOOST_THREAD_DONT_PROVIDE_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE
+#define BOOST_THREAD_PROVIDES_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE
+#endif
+#if ! defined BOOST_THREAD_DONT_PROVIDE_THREAD_MOVE_ASSIGN_CALLS_TERMINATE_IF_JOINABLE
+#define BOOST_THREAD_PROVIDES_THREAD_MOVE_ASSIGN_CALLS_TERMINATE_IF_JOINABLE
+#endif
+#if ! defined BOOST_THREAD_DONT_PROVIDE_FUTURE
+#define BOOST_THREAD_PROVIDES_FUTURE
+#endif
+#if ! defined BOOST_THREAD_DONT_PROVIDE_FUTURE_CTOR_ALLOCATORS
+#define BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS
+#endif
+#if ! defined BOOST_THREAD_DONT_PROVIDE_SHARED_MUTEX_UPWARDS_CONVERSIONS
+#define BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
+#endif
+#if ! defined BOOST_THREAD_DONT_PROVIDE_EXPLICIT_LOCK_CONVERSION
+#define BOOST_THREAD_PROVIDES_EXPLICIT_LOCK_CONVERSION
+#endif
+#if ! defined BOOST_THREAD_DONT_PROVIDE_GENERIC_SHARED_MUTEX_ON_WIN
+#define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
+#endif
+#if ! defined BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0
+#define BOOST_THREAD_DONT_PROVIDE_DEPRECATED_FEATURES_SINCE_V3_0_0
+#endif
+#if ! defined BOOST_THREAD_DONT_USE_MOVE
+#if ! defined BOOST_THREAD_USES_MOVE
+#define BOOST_THREAD_USES_MOVE
+#endif
+#endif
+
+#endif
+
+// BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN is defined if BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
+#if defined BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
+#define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
+#endif
+
+// BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0 defined by default up to Boost 1.52
+// BOOST_THREAD_DONT_PROVIDE_DEPRECATED_FEATURES_SINCE_V3_0_0 defined by default up to Boost 1.55
+#if ! defined BOOST_THREAD_DONT_PROVIDE_DEPRECATED_FEATURES_SINCE_V3_0_0
+#define BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0
#endif
#if BOOST_WORKAROUND(__BORLANDC__, < 0x600)
@@ -26,7 +131,7 @@
# pragma warn -8066 // Unreachable code
#endif
-#include "platform.hpp"
+#include <boost/thread/detail/platform.hpp>
// provided for backwards compatibility, since this
// macro was used for several releases by mistake.
diff --git a/boost/thread/detail/delete.hpp b/boost/thread/detail/delete.hpp
new file mode 100644
index 0000000000..9e56d4429e
--- /dev/null
+++ b/boost/thread/detail/delete.hpp
@@ -0,0 +1,45 @@
+// Copyright (C) 2012 Vicente J. Botet Escriba
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_THREAD_DETAIL_DELETE_HPP
+#define BOOST_THREAD_DETAIL_DELETE_HPP
+
+#include <boost/config.hpp>
+
+/**
+ * BOOST_THREAD_DELETE_COPY_CTOR deletes the copy constructor when the compiler supports it or
+ * makes it private.
+ *
+ * BOOST_THREAD_DELETE_COPY_ASSIGN deletes the copy assignment when the compiler supports it or
+ * makes it private.
+ */
+#ifndef BOOST_NO_DELETED_FUNCTIONS
+#define BOOST_THREAD_DELETE_COPY_CTOR(CLASS) \
+ CLASS(CLASS const&) = delete; \
+
+#define BOOST_THREAD_DELETE_COPY_ASSIGN(CLASS) \
+ CLASS& operator=(CLASS const&) = delete;
+
+#else // BOOST_NO_DELETED_FUNCTIONS
+#define BOOST_THREAD_DELETE_COPY_CTOR(CLASS) \
+ private: \
+ CLASS(CLASS&); \
+ public:
+
+#define BOOST_THREAD_DELETE_COPY_ASSIGN(CLASS) \
+ private: \
+ CLASS& operator=(CLASS&); \
+ public:
+#endif // BOOST_NO_DELETED_FUNCTIONS
+
+/**
+ * BOOST_THREAD_NO_COPYABLE deletes the copy constructor and assignment when the compiler supports it or
+ * makes them private.
+ */
+#define BOOST_THREAD_NO_COPYABLE(CLASS) \
+ BOOST_THREAD_DELETE_COPY_CTOR(CLASS) \
+ BOOST_THREAD_DELETE_COPY_ASSIGN(CLASS)
+
+#endif // BOOST_THREAD_DETAIL_DELETE_HPP
diff --git a/boost/thread/detail/memory.hpp b/boost/thread/detail/memory.hpp
new file mode 100644
index 0000000000..7d47efc781
--- /dev/null
+++ b/boost/thread/detail/memory.hpp
@@ -0,0 +1,54 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/thread for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_THREAD_DETAIL_MEMORY_HPP
+#define BOOST_THREAD_DETAIL_MEMORY_HPP
+
+#include <boost/container/allocator_traits.hpp>
+#include <boost/container/scoped_allocator.hpp>
+#include <boost/config.hpp>
+
+namespace boost
+{
+ namespace thread_detail
+ {
+ template <class _Alloc>
+ class allocator_destructor
+ {
+ typedef container::allocator_traits<_Alloc> alloc_traits;
+ public:
+ typedef typename alloc_traits::pointer pointer;
+ typedef typename alloc_traits::size_type size_type;
+ private:
+ _Alloc& alloc_;
+ size_type s_;
+ public:
+ allocator_destructor(_Alloc& a, size_type s)BOOST_NOEXCEPT
+ : alloc_(a), s_(s)
+ {}
+ void operator()(pointer p)BOOST_NOEXCEPT
+ {
+ alloc_traits::deallocate(alloc_, p, s_);
+ }
+ };
+ } //namespace thread_detail
+
+ typedef container::allocator_arg_t allocator_arg_t;
+ BOOST_CONSTEXPR_OR_CONST allocator_arg_t allocator_arg = {};
+
+ template <class T, class Alloc>
+ struct uses_allocator: public container::uses_allocator<T, Alloc>
+ {
+ };
+
+} // namespace boost
+
+
+#endif // BOOST_THREAD_DETAIL_MEMORY_HPP
diff --git a/boost/thread/detail/move.hpp b/boost/thread/detail/move.hpp
index 665a0b5978..748b8dc241 100644
--- a/boost/thread/detail/move.hpp
+++ b/boost/thread/detail/move.hpp
@@ -2,6 +2,7 @@
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// (C) Copyright 2007-8 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
#ifndef BOOST_THREAD_MOVE_HPP
#define BOOST_THREAD_MOVE_HPP
@@ -11,10 +12,12 @@
#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/remove_reference.hpp>
+#include <boost/type_traits/remove_cv.hpp>
+#include <boost/type_traits/decay.hpp>
#endif
+#include <boost/thread/detail/delete.hpp>
#include <boost/move/move.hpp>
-
#include <boost/config/abi_prefix.hpp>
namespace boost
@@ -22,6 +25,8 @@ namespace boost
namespace detail
{
+ template <typename T>
+ struct has_move_emulation_enabled_aux_dummy_specialization;
template<typename T>
struct thread_move_t
{
@@ -44,6 +49,7 @@ namespace boost
};
}
+
#ifndef BOOST_NO_SFINAE
template<typename T>
typename enable_if<boost::is_convertible<T&,boost::detail::thread_move_t<T> >, boost::detail::thread_move_t<T> >::type move(T& t)
@@ -57,9 +63,183 @@ namespace boost
{
return t;
}
+}
+
+#if ! defined BOOST_NO_RVALUE_REFERENCES
+
+#define BOOST_THREAD_RV_REF(TYPE) BOOST_RV_REF(TYPE)
+#define BOOST_THREAD_RV_REF_BEG BOOST_RV_REF_BEG
+#define BOOST_THREAD_RV_REF_END BOOST_RV_REF_END
+#define BOOST_THREAD_RV(V) V
+#define BOOST_THREAD_MAKE_RV_REF(RVALUE) RVALUE
+#define BOOST_THREAD_FWD_REF(TYPE) BOOST_FWD_REF(TYPE)
+#define BOOST_THREAD_DCL_MOVABLE(TYPE)
+#define BOOST_THREAD_DCL_MOVABLE_BEG(T) \
+ namespace detail { \
+ template <typename T> \
+ struct has_move_emulation_enabled_aux_dummy_specialization<
+
+#define BOOST_THREAD_DCL_MOVABLE_END > \
+ : integral_constant<bool, true> \
+ {}; \
+ }
+
+#elif ! defined BOOST_NO_RVALUE_REFERENCES && defined BOOST_MSVC
+
+#define BOOST_THREAD_RV_REF(TYPE) BOOST_RV_REF(TYPE)
+#define BOOST_THREAD_RV_REF_BEG BOOST_RV_REF_BEG
+#define BOOST_THREAD_RV_REF_END BOOST_RV_REF_END
+#define BOOST_THREAD_RV(V) V
+#define BOOST_THREAD_MAKE_RV_REF(RVALUE) RVALUE
+#define BOOST_THREAD_FWD_REF(TYPE) BOOST_FWD_REF(TYPE)
+#define BOOST_THREAD_DCL_MOVABLE(TYPE)
+#define BOOST_THREAD_DCL_MOVABLE_BEG(T) \
+ namespace detail { \
+ template <typename T> \
+ struct has_move_emulation_enabled_aux_dummy_specialization<
+
+#define BOOST_THREAD_DCL_MOVABLE_END > \
+ : integral_constant<bool, true> \
+ {}; \
+ }
+
+#else
+
+#if defined BOOST_THREAD_USES_MOVE
+#define BOOST_THREAD_RV_REF(TYPE) BOOST_RV_REF(TYPE)
+#define BOOST_THREAD_RV_REF_BEG BOOST_RV_REF_BEG
+#define BOOST_THREAD_RV_REF_END BOOST_RV_REF_END
+#define BOOST_THREAD_RV(V) V
+#define BOOST_THREAD_FWD_REF(TYPE) BOOST_FWD_REF(TYPE)
+#define BOOST_THREAD_DCL_MOVABLE(TYPE)
+#define BOOST_THREAD_DCL_MOVABLE_BEG(T) \
+ namespace detail { \
+ template <typename T> \
+ struct has_move_emulation_enabled_aux_dummy_specialization<
+
+#define BOOST_THREAD_DCL_MOVABLE_END > \
+ : integral_constant<bool, true> \
+ {}; \
+ }
+
+#else
+
+#define BOOST_THREAD_RV_REF(TYPE) boost::detail::thread_move_t< TYPE >
+#define BOOST_THREAD_RV_REF_BEG boost::detail::thread_move_t<
+#define BOOST_THREAD_RV_REF_END >
+#define BOOST_THREAD_RV(V) (*V)
+#define BOOST_THREAD_FWD_REF(TYPE) BOOST_FWD_REF(TYPE)
+
+#define BOOST_THREAD_DCL_MOVABLE(TYPE) \
+template <> \
+struct has_move_emulation_enabled_aux< TYPE > \
+ : BOOST_MOVE_BOOST_NS::integral_constant<bool, true> \
+{};
+
+#define BOOST_THREAD_DCL_MOVABLE_BEG(T) \
+template <typename T> \
+struct has_move_emulation_enabled_aux<
+
+#define BOOST_THREAD_DCL_MOVABLE_END > \
+ : BOOST_MOVE_BOOST_NS::integral_constant<bool, true> \
+{};
+
+#endif
+
+namespace boost
+{
+namespace detail
+{
+ template <typename T>
+ BOOST_THREAD_RV_REF(typename ::boost::remove_cv<typename ::boost::remove_reference<T>::type>::type)
+ make_rv_ref(T v) BOOST_NOEXCEPT
+ {
+ return (BOOST_THREAD_RV_REF(typename ::boost::remove_cv<typename ::boost::remove_reference<T>::type>::type))(v);
+ }
+// template <typename T>
+// BOOST_THREAD_RV_REF(typename ::boost::remove_cv<typename ::boost::remove_reference<T>::type>::type)
+// make_rv_ref(T &v) BOOST_NOEXCEPT
+// {
+// return (BOOST_THREAD_RV_REF(typename ::boost::remove_cv<typename ::boost::remove_reference<T>::type>::type))(v);
+// }
+// template <typename T>
+// const BOOST_THREAD_RV_REF(typename ::boost::remove_cv<typename ::boost::remove_reference<T>::type>::type)
+// make_rv_ref(T const&v) BOOST_NOEXCEPT
+// {
+// return (const BOOST_THREAD_RV_REF(typename ::boost::remove_cv<typename ::boost::remove_reference<T>::type>::type))(v);
+// }
+}
+}
+
+#define BOOST_THREAD_MAKE_RV_REF(RVALUE) RVALUE.move()
+//#define BOOST_THREAD_MAKE_RV_REF(RVALUE) boost::detail::make_rv_ref(RVALUE)
+#endif
+
+
+#if ! defined BOOST_NO_RVALUE_REFERENCES
+
+#define BOOST_THREAD_MOVABLE(TYPE)
+
+#else
+
+#if defined BOOST_THREAD_USES_MOVE
+#define BOOST_THREAD_MOVABLE(TYPE) \
+ ::boost::rv<TYPE>& move() BOOST_NOEXCEPT \
+ { \
+ return *static_cast< ::boost::rv<TYPE>* >(this); \
+ } \
+ const ::boost::rv<TYPE>& move() const BOOST_NOEXCEPT \
+ { \
+ return *static_cast<const ::boost::rv<TYPE>* >(this); \
+ } \
+ operator ::boost::rv<TYPE>&() \
+ { \
+ return *static_cast< ::boost::rv<TYPE>* >(this); \
+ } \
+ operator const ::boost::rv<TYPE>&() const \
+ { \
+ return *static_cast<const ::boost::rv<TYPE>* >(this); \
+ }\
+#else
+
+#define BOOST_THREAD_MOVABLE(TYPE) \
+ operator ::boost::detail::thread_move_t<TYPE>() BOOST_NOEXCEPT \
+ { \
+ return move(); \
+ } \
+ ::boost::detail::thread_move_t<TYPE> move() BOOST_NOEXCEPT \
+ { \
+ ::boost::detail::thread_move_t<TYPE> x(*this); \
+ return x; \
+ } \
+
+#endif
+#endif
+
+#define BOOST_THREAD_MOVABLE_ONLY(TYPE) \
+ BOOST_THREAD_NO_COPYABLE(TYPE) \
+ BOOST_THREAD_MOVABLE(TYPE) \
+
+#define BOOST_THREAD_COPYABLE_AND_MOVABLE(TYPE) \
+ BOOST_THREAD_MOVABLE(TYPE) \
+
+
+
+#ifndef BOOST_NO_RVALUE_REFERENCES
+namespace boost
+{ namespace thread_detail
+ {
+ template <class T>
+ typename decay<T>::type
+ decay_copy(T&& t)
+ {
+ return boost::forward<T>(t);
+ }
+ }
}
+#endif
#include <boost/config/abi_suffix.hpp>
diff --git a/boost/thread/detail/platform.hpp b/boost/thread/detail/platform.hpp
index 58601b04b2..1f33b1a67a 100644
--- a/boost/thread/detail/platform.hpp
+++ b/boost/thread/detail/platform.hpp
@@ -19,6 +19,7 @@
// choose platform
#if defined(linux) || defined(__linux) || defined(__linux__)
# define BOOST_THREAD_LINUX
+//# define BOOST_THREAD_WAIT_BUG boost::posix_time::microseconds(100000)
#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
# define BOOST_THREAD_BSD
#elif defined(sun) || defined(__sun)
@@ -35,6 +36,7 @@
# define BOOST_THREAD_BEOS
#elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)
# define BOOST_THREAD_MACOS
+//# define BOOST_THREAD_WAIT_BUG boost::posix_time::microseconds(1000)
#elif defined(__IBMCPP__) || defined(_AIX)
# define BOOST_THREAD_AIX
#elif defined(__amigaos__)
@@ -55,7 +57,7 @@
// dispatcher table. If there is no entry for a platform but pthreads is
// available on the platform, pthread is choosen as default. If nothing is
// available the preprocessor will fail with a diagnostic message.
-
+
#if defined(BOOST_THREAD_POSIX)
# define BOOST_THREAD_PLATFORM_PTHREAD
#else
diff --git a/boost/thread/detail/thread.hpp b/boost/thread/detail/thread.hpp
index 7ac342bfc6..3c71b53cf7 100644
--- a/boost/thread/detail/thread.hpp
+++ b/boost/thread/detail/thread.hpp
@@ -4,7 +4,9 @@
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// (C) Copyright 2007-10 Anthony Williams
+// (C) Copyright 20011-12 Vicente J. Botet Escriba
+#include <boost/thread/detail/config.hpp>
#include <boost/thread/exceptions.hpp>
#ifndef BOOST_NO_IOSTREAM
#include <ostream>
@@ -13,7 +15,6 @@
#include <boost/thread/mutex.hpp>
#include <boost/thread/xtime.hpp>
#include <boost/thread/detail/thread_heap_alloc.hpp>
-#include <boost/utility.hpp>
#include <boost/assert.hpp>
#include <list>
#include <algorithm>
@@ -25,6 +26,13 @@
#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/io/ios_state.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/type_traits/decay.hpp>
+#include <boost/functional/hash.hpp>
+#ifdef BOOST_THREAD_USES_CHRONO
+#include <boost/chrono/system_clocks.hpp>
+#include <boost/chrono/ceil.hpp>
+#endif
#include <boost/config/abi_prefix.hpp>
@@ -35,6 +43,7 @@
namespace boost
{
+
namespace detail
{
template<typename F>
@@ -42,18 +51,21 @@ namespace boost
public detail::thread_data_base
{
public:
+ BOOST_THREAD_NO_COPYABLE(thread_data)
#ifndef BOOST_NO_RVALUE_REFERENCES
- thread_data(F&& f_):
- f(static_cast<F&&>(f_))
- {}
- thread_data(F& f_):
- f(f_)
- {}
+ thread_data(BOOST_THREAD_RV_REF(F) f_):
+ f(boost::forward<F>(f_))
+ {}
+// This overloading must be removed if we want the packaged_task's tests to pass.
+// thread_data(F& f_):
+// f(f_)
+// {}
#else
- thread_data(F f_):
- f(f_)
+
+ thread_data(BOOST_THREAD_RV_REF(F) f_):
+ f(f_)
{}
- thread_data(detail::thread_move_t<F> f_):
+ thread_data(F f_):
f(f_)
{}
#endif
@@ -63,9 +75,6 @@ namespace boost
}
private:
F f;
-
- void operator=(thread_data&);
- thread_data(thread_data&);
};
template<typename F>
@@ -74,14 +83,11 @@ namespace boost
{
private:
F& f;
-
- void operator=(thread_data&);
- thread_data(thread_data&);
public:
+ BOOST_THREAD_NO_COPYABLE(thread_data)
thread_data(boost::reference_wrapper<F> f_):
f(f_)
{}
-
void run()
{
f();
@@ -94,13 +100,11 @@ namespace boost
{
private:
F& f;
- void operator=(thread_data&);
- thread_data(thread_data&);
public:
+ BOOST_THREAD_NO_COPYABLE(thread_data)
thread_data(const boost::reference_wrapper<F> f_):
f(f_)
{}
-
void run()
{
f();
@@ -110,15 +114,18 @@ namespace boost
class BOOST_THREAD_DECL thread
{
+ public:
+ typedef thread_attributes attributes;
+
+ BOOST_THREAD_MOVABLE_ONLY(thread)
private:
- thread(thread&);
- thread& operator=(thread&);
void release_handle();
detail::thread_data_ptr thread_info;
void start_thread();
+ void start_thread(const attributes& attr);
explicit thread(detail::thread_data_ptr data);
@@ -126,13 +133,15 @@ namespace boost
#ifndef BOOST_NO_RVALUE_REFERENCES
template<typename F>
- static inline detail::thread_data_ptr make_thread_info(F&& f)
+ static inline detail::thread_data_ptr make_thread_info(BOOST_THREAD_RV_REF(F) f)
{
- return detail::thread_data_ptr(detail::heap_new<detail::thread_data<typename boost::remove_reference<F>::type> >(static_cast<F&&>(f)));
+ return detail::thread_data_ptr(detail::heap_new<detail::thread_data<typename boost::remove_reference<F>::type> >(
+ boost::forward<F>(f)));
}
static inline detail::thread_data_ptr make_thread_info(void (*f)())
{
- return detail::thread_data_ptr(detail::heap_new<detail::thread_data<void(*)()> >(static_cast<void(*&&)()>(f)));
+ return detail::thread_data_ptr(detail::heap_new<detail::thread_data<void(*)()> >(
+ boost::forward<void(*)()>(f)));
}
#else
template<typename F>
@@ -141,7 +150,7 @@ namespace boost
return detail::thread_data_ptr(detail::heap_new<detail::thread_data<F> >(f));
}
template<typename F>
- static inline detail::thread_data_ptr make_thread_info(boost::detail::thread_move_t<F> f)
+ static inline detail::thread_data_ptr make_thread_info(BOOST_THREAD_RV_REF(F) f)
{
return detail::thread_data_ptr(detail::heap_new<detail::thread_data<F> >(f));
}
@@ -149,44 +158,40 @@ namespace boost
#endif
struct dummy;
public:
+#if 0 // This should not be needed anymore. Use instead BOOST_THREAD_MAKE_RV_REF.
#if BOOST_WORKAROUND(__SUNPRO_CC, < 0x5100)
thread(const volatile thread&);
#endif
- thread();
- ~thread();
-
-#ifndef BOOST_NO_RVALUE_REFERENCES
-#ifdef BOOST_MSVC
- template <class F>
- explicit thread(F f,typename disable_if<boost::is_convertible<F&,detail::thread_move_t<F> >, dummy* >::type=0):
- thread_info(make_thread_info(static_cast<F&&>(f)))
- {
- start_thread();
- }
-#else
- template <class F>
- thread(F&& f):
- thread_info(make_thread_info(static_cast<F&&>(f)))
- {
- start_thread();
- }
#endif
-
- thread(thread&& other)
+ thread() BOOST_NOEXCEPT;
+ ~thread()
{
- thread_info.swap(other.thread_info);
+ #if defined BOOST_THREAD_PROVIDES_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE
+ if (joinable()) {
+ std::terminate();
+ }
+ #else
+ detach();
+ #endif
}
-
- thread& operator=(thread&& other)
+#ifndef BOOST_NO_RVALUE_REFERENCES
+ template <
+ class F
+ >
+ explicit thread(BOOST_THREAD_RV_REF(F) f
+ , typename disable_if<is_same<typename decay<F>::type, thread>, dummy* >::type=0
+ ):
+ thread_info(make_thread_info(thread_detail::decay_copy(boost::forward<F>(f))))
{
- thread_info=other.thread_info;
- other.thread_info.reset();
- return *this;
+ start_thread();
}
-
- thread&& move()
+ template <
+ class F
+ >
+ thread(attributes& attrs, BOOST_THREAD_RV_REF(F) f):
+ thread_info(make_thread_info(thread_detail::decay_copy(boost::forward<F>(f))))
{
- return static_cast<thread&&>(*this);
+ start_thread(attrs);
}
#else
@@ -197,57 +202,73 @@ namespace boost
{
start_thread();
}
+ template <class F>
+ thread(attributes& attrs, F f):
+ thread_info(make_thread_info(f))
+ {
+ start_thread(attrs);
+ }
#else
template <class F>
- explicit thread(F f,typename disable_if<boost::is_convertible<F&,detail::thread_move_t<F> >, dummy* >::type=0):
+ explicit thread(F f
+ // todo Disable also if Or is_same<typename decay<F>::type, thread>
+ , typename disable_if<boost::is_convertible<F&,BOOST_THREAD_RV_REF(F) >, dummy* >::type=0):
thread_info(make_thread_info(f))
{
start_thread();
}
+ template <class F>
+ thread(attributes& attrs, F f
+ , typename disable_if<boost::is_convertible<F&,BOOST_THREAD_RV_REF(F) >, dummy* >::type=0):
+ thread_info(make_thread_info(f))
+ {
+ start_thread(attrs);
+ }
#endif
-
template <class F>
- explicit thread(detail::thread_move_t<F> f):
+ explicit thread(BOOST_THREAD_RV_REF(F) f
+ , typename disable_if<is_same<typename decay<F>::type, thread>, dummy* >::type=0
+ ):
thread_info(make_thread_info(f))
{
start_thread();
}
- thread(detail::thread_move_t<thread> x)
+ template <class F>
+ thread(attributes& attrs, BOOST_THREAD_RV_REF(F) f):
+ thread_info(make_thread_info(f))
{
- thread_info=x->thread_info;
- x->thread_info.reset();
+ start_thread(attrs);
}
-
+#endif
+ thread(BOOST_THREAD_RV_REF(thread) x)
+ {
+ thread_info=BOOST_THREAD_RV(x).thread_info;
+ BOOST_THREAD_RV(x).thread_info.reset();
+ }
+#if 0 // This should not be needed anymore. Use instead BOOST_THREAD_MAKE_RV_REF.
#if BOOST_WORKAROUND(__SUNPRO_CC, < 0x5100)
thread& operator=(thread x)
{
swap(x);
return *this;
}
-#else
- thread& operator=(detail::thread_move_t<thread> x)
- {
- thread new_thread(x);
- swap(new_thread);
- return *this;
- }
#endif
- operator detail::thread_move_t<thread>()
- {
- return move();
- }
+#endif
- detail::thread_move_t<thread> move()
+ thread& operator=(BOOST_THREAD_RV_REF(thread) other) BOOST_NOEXCEPT
{
- detail::thread_move_t<thread> x(*this);
- return x;
- }
+#if defined BOOST_THREAD_PROVIDES_THREAD_MOVE_ASSIGN_CALLS_TERMINATE_IF_JOINABLE
+ if (joinable()) std::terminate();
#endif
+ thread_info=BOOST_THREAD_RV(other).thread_info;
+ BOOST_THREAD_RV(other).thread_info.reset();
+ return *this;
+ }
template <class F,class A1>
- thread(F f,A1 a1):
+ thread(F f,A1 a1,typename disable_if<boost::is_convertible<F&,thread_attributes >, dummy* >::type=0):
thread_info(make_thread_info(boost::bind(boost::type<void>(),f,a1)))
{
start_thread();
@@ -308,36 +329,92 @@ namespace boost
start_thread();
}
- void swap(thread& x)
+ void swap(thread& x) BOOST_NOEXCEPT
{
thread_info.swap(x.thread_info);
}
class BOOST_SYMBOL_VISIBLE id;
- id get_id() const;
+ id get_id() const BOOST_NOEXCEPT;
- bool joinable() const;
+ bool joinable() const BOOST_NOEXCEPT;
void join();
- bool timed_join(const system_time& wait_until);
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Rep, class Period>
+ bool try_join_for(const chrono::duration<Rep, Period>& rel_time)
+ {
+ return try_join_until(chrono::steady_clock::now() + rel_time);
+ }
+ template <class Clock, class Duration>
+ bool try_join_until(const chrono::time_point<Clock, Duration>& t)
+ {
+ using namespace chrono;
+ system_clock::time_point s_now = system_clock::now();
+ typename Clock::time_point c_now = Clock::now();
+ return try_join_until(s_now + ceil<nanoseconds>(t - c_now));
+ }
+ template <class Duration>
+ bool try_join_until(const chrono::time_point<chrono::system_clock, Duration>& t)
+ {
+ using namespace chrono;
+ typedef time_point<system_clock, nanoseconds> nano_sys_tmpt;
+ return try_join_until(nano_sys_tmpt(ceil<nanoseconds>(t.time_since_epoch())));
+ }
+#endif
+#if defined(BOOST_THREAD_PLATFORM_WIN32)
+ bool timed_join(const system_time& abs_time);
+
+#ifdef BOOST_THREAD_USES_CHRONO
+ bool try_join_until(const chrono::time_point<chrono::system_clock, chrono::nanoseconds>& tp);
+#endif
+ public:
+
+#else
+ bool timed_join(const system_time& abs_time)
+ {
+ struct timespec const ts=detail::get_timespec(abs_time);
+ return do_try_join_until(ts);
+ }
+#ifdef BOOST_THREAD_USES_CHRONO
+ bool try_join_until(const chrono::time_point<chrono::system_clock, chrono::nanoseconds>& tp)
+ {
+ using namespace chrono;
+ nanoseconds d = tp.time_since_epoch();
+ timespec ts;
+ seconds s = duration_cast<seconds>(d);
+ ts.tv_sec = static_cast<long>(s.count());
+ ts.tv_nsec = static_cast<long>((d - s).count());
+ return do_try_join_until(ts);
+ }
+#endif
+ private:
+ bool do_try_join_until(struct timespec const &timeout);
+ public:
+
+#endif
template<typename TimeDuration>
inline bool timed_join(TimeDuration const& rel_time)
{
return timed_join(get_system_time()+rel_time);
}
- void detach();
- static unsigned hardware_concurrency();
+ void detach() BOOST_NOEXCEPT;
+
+ static unsigned hardware_concurrency() BOOST_NOEXCEPT;
+#define BOOST_THREAD_DEFINES_THREAD_NATIVE_HANDLE
typedef detail::thread_data_base::native_handle_type native_handle_type;
native_handle_type native_handle();
+#if defined BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0
+ // Use thread::id when comparisions are needed
// backwards compatibility
bool operator==(const thread& other) const;
bool operator!=(const thread& other) const;
-
- static inline void yield()
+#endif
+ static inline void yield() BOOST_NOEXCEPT
{
this_thread::yield();
}
@@ -349,37 +426,30 @@ namespace boost
// extensions
void interrupt();
- bool interruption_requested() const;
+ bool interruption_requested() const BOOST_NOEXCEPT;
};
- inline void swap(thread& lhs,thread& rhs)
+ inline void swap(thread& lhs,thread& rhs) BOOST_NOEXCEPT
{
return lhs.swap(rhs);
}
#ifndef BOOST_NO_RVALUE_REFERENCES
- inline thread&& move(thread& t)
+ inline thread&& move(thread& t) BOOST_NOEXCEPT
{
return static_cast<thread&&>(t);
}
- inline thread&& move(thread&& t)
- {
- return static_cast<thread&&>(t);
- }
-#else
- inline detail::thread_move_t<thread> move(detail::thread_move_t<thread> t)
- {
- return t;
- }
#endif
+ BOOST_THREAD_DCL_MOVABLE(thread)
+
namespace this_thread
{
- thread::id BOOST_THREAD_DECL get_id();
+ thread::id BOOST_THREAD_DECL get_id() BOOST_NOEXCEPT;
void BOOST_THREAD_DECL interruption_point();
- bool BOOST_THREAD_DECL interruption_enabled();
- bool BOOST_THREAD_DECL interruption_requested();
+ bool BOOST_THREAD_DECL interruption_enabled() BOOST_NOEXCEPT;
+ bool BOOST_THREAD_DECL interruption_requested() BOOST_NOEXCEPT;
inline BOOST_SYMBOL_VISIBLE void sleep(xtime const& abs_time)
{
@@ -390,48 +460,76 @@ namespace boost
class BOOST_SYMBOL_VISIBLE thread::id
{
private:
- detail::thread_data_ptr thread_data;
+ friend inline
+ std::size_t
+ hash_value(const thread::id &v)
+ {
+#if defined BOOST_THREAD_PROVIDES_BASIC_THREAD_ID
+ return hash_value(v.thread_data);
+#else
+ return hash_value(v.thread_data.get());
+#endif
+ }
- id(detail::thread_data_ptr thread_data_):
+#if defined BOOST_THREAD_PROVIDES_BASIC_THREAD_ID
+#if defined(BOOST_THREAD_PLATFORM_WIN32)
+ typedef unsigned int data;
+#else
+ typedef thread::native_handle_type data;
+#endif
+#else
+ typedef detail::thread_data_ptr data;
+#endif
+ data thread_data;
+
+ id(data thread_data_):
thread_data(thread_data_)
{}
friend class thread;
- friend id BOOST_THREAD_DECL this_thread::get_id();
+ friend id BOOST_THREAD_DECL this_thread::get_id() BOOST_NOEXCEPT;
public:
- id():
- thread_data()
+ id() BOOST_NOEXCEPT:
+#if defined BOOST_THREAD_PROVIDES_BASIC_THREAD_ID
+#if defined(BOOST_THREAD_PLATFORM_WIN32)
+ thread_data(0)
+#else
+ thread_data(0)
+#endif
+#else
+ thread_data()
+#endif
{}
- id(const id& other):
+ id(const id& other) BOOST_NOEXCEPT :
thread_data(other.thread_data)
{}
- bool operator==(const id& y) const
+ bool operator==(const id& y) const BOOST_NOEXCEPT
{
return thread_data==y.thread_data;
}
- bool operator!=(const id& y) const
+ bool operator!=(const id& y) const BOOST_NOEXCEPT
{
return thread_data!=y.thread_data;
}
- bool operator<(const id& y) const
+ bool operator<(const id& y) const BOOST_NOEXCEPT
{
return thread_data<y.thread_data;
}
- bool operator>(const id& y) const
+ bool operator>(const id& y) const BOOST_NOEXCEPT
{
return y.thread_data<thread_data;
}
- bool operator<=(const id& y) const
+ bool operator<=(const id& y) const BOOST_NOEXCEPT
{
return !(y.thread_data<thread_data);
}
- bool operator>=(const id& y) const
+ bool operator>=(const id& y) const BOOST_NOEXCEPT
{
return !(thread_data<y.thread_data);
}
@@ -440,7 +538,7 @@ namespace boost
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
template<class charT, class traits>
friend BOOST_SYMBOL_VISIBLE
- std::basic_ostream<charT, traits>&
+ std::basic_ostream<charT, traits>&
operator<<(std::basic_ostream<charT, traits>& os, const id& x)
{
if(x.thread_data)
@@ -456,12 +554,13 @@ namespace boost
#else
template<class charT, class traits>
BOOST_SYMBOL_VISIBLE
- std::basic_ostream<charT, traits>&
+ std::basic_ostream<charT, traits>&
print(std::basic_ostream<charT, traits>& os) const
{
if(thread_data)
{
- return os<<thread_data;
+ io::ios_flags_saver ifs( os );
+ return os<< std::hex << thread_data;
}
else
{
@@ -483,6 +582,7 @@ namespace boost
}
#endif
+#if defined BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0
inline bool thread::operator==(const thread& other) const
{
return get_id()==other.get_id();
@@ -492,6 +592,7 @@ namespace boost
{
return get_id()!=other.get_id();
}
+#endif
namespace detail
{
@@ -521,13 +622,6 @@ namespace boost
void BOOST_THREAD_DECL add_thread_exit_function(thread_exit_function_base*);
}
-#ifdef BOOST_NO_RVALUE_REFERENCES
- template <>
- struct has_move_emulation_enabled_aux<thread>
- : BOOST_MOVE_BOOST_NS::integral_constant<bool, true>
- {};
-#endif
-
namespace this_thread
{
template<typename F>
diff --git a/boost/thread/detail/thread_interruption.hpp b/boost/thread/detail/thread_interruption.hpp
index 60c0e65b8c..f1a165c33e 100644
--- a/boost/thread/detail/thread_interruption.hpp
+++ b/boost/thread/detail/thread_interruption.hpp
@@ -4,6 +4,10 @@
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// (C) Copyright 2007-9 Anthony Williams
+// (C) Copyright 2012 Vicente J. Botet Escriba
+
+#include <boost/thread/detail/config.hpp>
+#include <boost/thread/detail/delete.hpp>
namespace boost
{
@@ -11,23 +15,20 @@ namespace boost
{
class BOOST_THREAD_DECL disable_interruption
{
- disable_interruption(const disable_interruption&);
- disable_interruption& operator=(const disable_interruption&);
-
- bool interruption_was_enabled;
- friend class restore_interruption;
+ bool interruption_was_enabled;
+ friend class restore_interruption;
public:
- disable_interruption();
- ~disable_interruption();
+ BOOST_THREAD_NO_COPYABLE(disable_interruption)
+ disable_interruption() BOOST_NOEXCEPT;
+ ~disable_interruption() BOOST_NOEXCEPT;
};
class BOOST_THREAD_DECL restore_interruption
{
- restore_interruption(const restore_interruption&);
- restore_interruption& operator=(const restore_interruption&);
public:
- explicit restore_interruption(disable_interruption& d);
- ~restore_interruption();
+ BOOST_THREAD_NO_COPYABLE(restore_interruption)
+ explicit restore_interruption(disable_interruption& d) BOOST_NOEXCEPT;
+ ~restore_interruption() BOOST_NOEXCEPT;
};
}
}
diff --git a/boost/thread/exceptions.hpp b/boost/thread/exceptions.hpp
index 06ce04e0d1..08c28d3d17 100644
--- a/boost/thread/exceptions.hpp
+++ b/boost/thread/exceptions.hpp
@@ -1,8 +1,9 @@
// Copyright (C) 2001-2003
// William E. Kempf
// Copyright (C) 2007-9 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_THREAD_EXCEPTIONS_PDM070801_H
@@ -18,6 +19,9 @@
#include <string>
#include <stdexcept>
+#include <boost/system/system_error.hpp>
+#include <boost/system/error_code.hpp>
+
#include <boost/config/abi_prefix.hpp>
@@ -28,151 +32,188 @@ namespace boost
{};
class BOOST_SYMBOL_VISIBLE thread_exception:
- public std::exception
+ public system::system_error
+ //public std::exception
{
- protected:
- thread_exception():
- m_sys_err(0)
+ typedef system::system_error base_type;
+ public:
+ thread_exception()
+ : base_type(0,system::system_category())
{}
-
- thread_exception(int sys_err_code):
- m_sys_err(sys_err_code)
+
+ thread_exception(int sys_error_code)
+ : base_type(sys_error_code, system::system_category())
{}
-
- public:
+ thread_exception( int ev, const char * what_arg )
+ : base_type(system::error_code(ev, system::system_category()), what_arg)
+ {
+ }
+ thread_exception( int ev, const std::string & what_arg )
+ : base_type(system::error_code(ev, system::system_category()), what_arg)
+ {
+ }
+
~thread_exception() throw()
{}
-
+
int native_error() const
{
- return m_sys_err;
+ return code().value();
}
-
- private:
- int m_sys_err;
};
class BOOST_SYMBOL_VISIBLE condition_error:
- public std::exception
+ public system::system_error
+ //public std::exception
{
+ typedef system::system_error base_type;
public:
- const char* what() const throw()
- {
- return "Condition error";
- }
+ condition_error()
+ : base_type(system::error_code(0, system::system_category()), "Condition error")
+ {}
+ condition_error( int ev )
+ : base_type(system::error_code(ev, system::system_category()), "Condition error")
+ {
+ }
+ condition_error( int ev, const char * what_arg )
+ : base_type(system::error_code(ev, system::system_category()), what_arg)
+ {
+ }
+ condition_error( int ev, const std::string & what_arg )
+ : base_type(system::error_code(ev, system::system_category()), what_arg)
+ {
+ }
};
-
+
class BOOST_SYMBOL_VISIBLE lock_error:
public thread_exception
{
+ typedef thread_exception base_type;
public:
lock_error()
+ : base_type(0, "boost::lock_error")
{}
-
- lock_error(int sys_err_code):
- thread_exception(sys_err_code)
- {}
-
- ~lock_error() throw()
- {}
-
- virtual const char* what() const throw()
+ lock_error( int ev )
+ : base_type(ev, "boost::lock_error")
+ {
+ }
+ lock_error( int ev, const char * what_arg )
+ : base_type(ev, what_arg)
{
- return "boost::lock_error";
}
+ lock_error( int ev, const std::string & what_arg )
+ : base_type(ev, what_arg)
+ {
+ }
+
+ ~lock_error() throw()
+ {}
+
};
class BOOST_SYMBOL_VISIBLE thread_resource_error:
public thread_exception
{
+ typedef thread_exception base_type;
public:
- thread_resource_error()
- {}
-
- thread_resource_error(int sys_err_code):
- thread_exception(sys_err_code)
- {}
-
+ thread_resource_error()
+ : base_type(system::errc::resource_unavailable_try_again, "boost::thread_resource_error")
+ {}
+
+ thread_resource_error( int ev )
+ : base_type(ev, "boost::thread_resource_error")
+ {
+ }
+ thread_resource_error( int ev, const char * what_arg )
+ : base_type(ev, what_arg)
+ {
+ }
+ thread_resource_error( int ev, const std::string & what_arg )
+ : base_type(ev, what_arg)
+ {
+ }
+
+
~thread_resource_error() throw()
{}
-
- virtual const char* what() const throw()
- {
- return "boost::thread_resource_error";
- }
-
};
class BOOST_SYMBOL_VISIBLE unsupported_thread_option:
public thread_exception
{
+ typedef thread_exception base_type;
public:
- unsupported_thread_option()
- {}
-
- unsupported_thread_option(int sys_err_code):
- thread_exception(sys_err_code)
- {}
-
- ~unsupported_thread_option() throw()
- {}
-
+ unsupported_thread_option()
+ : base_type(system::errc::invalid_argument, "boost::unsupported_thread_option")
+ {}
+
+ unsupported_thread_option( int ev )
+ : base_type(ev, "boost::unsupported_thread_option")
+ {
+ }
+ unsupported_thread_option( int ev, const char * what_arg )
+ : base_type(ev, what_arg)
+ {
+ }
+ unsupported_thread_option( int ev, const std::string & what_arg )
+ : base_type(ev, what_arg)
+ {
+ }
- virtual const char* what() const throw()
- {
- return "boost::unsupported_thread_option";
- }
-
};
class BOOST_SYMBOL_VISIBLE invalid_thread_argument:
public thread_exception
{
+ typedef thread_exception base_type;
public:
invalid_thread_argument()
+ : base_type(system::errc::invalid_argument, "boost::invalid_thread_argument")
{}
-
- invalid_thread_argument(int sys_err_code):
- thread_exception(sys_err_code)
- {}
-
- ~invalid_thread_argument() throw()
- {}
-
- virtual const char* what() const throw()
+ invalid_thread_argument( int ev )
+ : base_type(ev, "boost::invalid_thread_argument")
+ {
+ }
+ invalid_thread_argument( int ev, const char * what_arg )
+ : base_type(ev, what_arg)
{
- return "boost::invalid_thread_argument";
}
-
+ invalid_thread_argument( int ev, const std::string & what_arg )
+ : base_type(ev, what_arg)
+ {
+ }
+
};
class BOOST_SYMBOL_VISIBLE thread_permission_error:
public thread_exception
{
+ typedef thread_exception base_type;
public:
- thread_permission_error()
- {}
-
- thread_permission_error(int sys_err_code):
- thread_exception(sys_err_code)
- {}
-
- ~thread_permission_error() throw()
- {}
-
+ thread_permission_error()
+ : base_type(system::errc::permission_denied, "boost::thread_permission_error")
+ {}
+
+ thread_permission_error( int ev )
+ : base_type(ev, "boost::thread_permission_error")
+ {
+ }
+ thread_permission_error( int ev, const char * what_arg )
+ : base_type(ev, what_arg)
+ {
+ }
+ thread_permission_error( int ev, const std::string & what_arg )
+ : base_type(ev, what_arg)
+ {
+ }
- virtual const char* what() const throw()
- {
- return "boost::thread_permission_error";
- }
-
};
} // namespace boost
diff --git a/boost/thread/future.hpp b/boost/thread/future.hpp
index bd87158338..8cad994de5 100644
--- a/boost/thread/future.hpp
+++ b/boost/thread/future.hpp
@@ -1,4 +1,5 @@
// (C) Copyright 2008-10 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
@@ -6,6 +7,15 @@
#ifndef BOOST_THREAD_FUTURE_HPP
#define BOOST_THREAD_FUTURE_HPP
+
+#include <boost/thread/detail/config.hpp>
+
+// boost::thread::future requires exception handling
+// due to boost::exception::exception_ptr dependency
+
+#ifndef BOOST_NO_EXCEPTIONS
+
+#include <boost/detail/scoped_enum_emulation.hpp>
#include <stdexcept>
#include <boost/thread/detail/move.hpp>
#include <boost/thread/thread_time.hpp>
@@ -16,6 +26,8 @@
#include <boost/scoped_ptr.hpp>
#include <boost/type_traits/is_fundamental.hpp>
#include <boost/type_traits/is_convertible.hpp>
+#include <boost/type_traits/remove_reference.hpp>
+#include <boost/type_traits/remove_cv.hpp>
#include <boost/mpl/if.hpp>
#include <boost/config.hpp>
#include <boost/throw_exception.hpp>
@@ -28,59 +40,168 @@
#include <list>
#include <boost/next_prior.hpp>
#include <vector>
+#include <boost/system/error_code.hpp>
+#ifdef BOOST_THREAD_USES_CHRONO
+#include <boost/chrono/system_clocks.hpp>
+#endif
+
+#if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS
+#include <boost/thread/detail/memory.hpp>
+#endif
+
+#include <boost/utility/result_of.hpp>
+//#include <boost/thread.hpp>
+
+#if defined BOOST_THREAD_PROVIDES_FUTURE
+#define BOOST_THREAD_FUTURE future
+#else
+#define BOOST_THREAD_FUTURE unique_future
+#endif
+
namespace boost
{
- class future_uninitialized:
- public std::logic_error
+
+ //enum class future_errc
+ BOOST_SCOPED_ENUM_DECLARE_BEGIN(future_errc)
+ {
+ broken_promise,
+ future_already_retrieved,
+ promise_already_satisfied,
+ no_state
+ }
+ BOOST_SCOPED_ENUM_DECLARE_END(future_errc)
+
+ namespace system
+ {
+ template <>
+ struct BOOST_SYMBOL_VISIBLE is_error_code_enum<future_errc> : public true_type {};
+
+ #ifdef BOOST_NO_SCOPED_ENUMS
+ template <>
+ struct BOOST_SYMBOL_VISIBLE is_error_code_enum<future_errc::enum_type> : public true_type { };
+ #endif
+ }
+
+ //enum class launch
+ BOOST_SCOPED_ENUM_DECLARE_BEGIN(launch)
+ {
+ async = 1,
+ deferred = 2,
+ any = async | deferred
+ }
+ BOOST_SCOPED_ENUM_DECLARE_END(launch)
+
+ //enum class future_status
+ BOOST_SCOPED_ENUM_DECLARE_BEGIN(future_status)
+ {
+ ready,
+ timeout,
+ deferred
+ }
+ BOOST_SCOPED_ENUM_DECLARE_END(future_status)
+
+ BOOST_THREAD_DECL
+ const system::error_category& future_category();
+
+ namespace system
+ {
+ inline BOOST_THREAD_DECL
+ error_code
+ make_error_code(future_errc e)
+ {
+ return error_code(underlying_cast<int>(e), boost::future_category());
+ }
+
+ inline BOOST_THREAD_DECL
+ error_condition
+ make_error_condition(future_errc e)
+ {
+ return error_condition(underlying_cast<int>(e), future_category());
+ }
+ }
+
+ class BOOST_SYMBOL_VISIBLE future_error
+ : public std::logic_error
+ {
+ system::error_code ec_;
+ public:
+ future_error(system::error_code ec)
+ : logic_error(ec.message()),
+ ec_(ec)
+ {
+ }
+
+ const system::error_code& code() const BOOST_NOEXCEPT
+ {
+ return ec_;
+ }
+
+ //virtual ~future_error() BOOST_NOEXCEPT;
+ };
+
+ class BOOST_SYMBOL_VISIBLE future_uninitialized:
+ public future_error
{
public:
future_uninitialized():
- std::logic_error("Future Uninitialized")
+ future_error(system::make_error_code(future_errc::no_state))
{}
};
- class broken_promise:
- public std::logic_error
+ class BOOST_SYMBOL_VISIBLE broken_promise:
+ public future_error
{
public:
broken_promise():
- std::logic_error("Broken promise")
+ future_error(system::make_error_code(future_errc::broken_promise))
{}
};
- class future_already_retrieved:
- public std::logic_error
+ class BOOST_SYMBOL_VISIBLE future_already_retrieved:
+ public future_error
{
public:
future_already_retrieved():
- std::logic_error("Future already retrieved")
+ future_error(system::make_error_code(future_errc::future_already_retrieved))
{}
};
- class promise_already_satisfied:
- public std::logic_error
+ class BOOST_SYMBOL_VISIBLE promise_already_satisfied:
+ public future_error
{
public:
promise_already_satisfied():
- std::logic_error("Promise already satisfied")
+ future_error(system::make_error_code(future_errc::promise_already_satisfied))
{}
};
- class task_already_started:
- public std::logic_error
+ class BOOST_SYMBOL_VISIBLE task_already_started:
+ public future_error
{
public:
task_already_started():
- std::logic_error("Task already started")
+ future_error(system::make_error_code(future_errc::promise_already_satisfied))
+ //std::logic_error("Task already started")
{}
};
- class task_moved:
- public std::logic_error
- {
- public:
- task_moved():
- std::logic_error("Task moved")
- {}
- };
+ class BOOST_SYMBOL_VISIBLE task_moved:
+ public future_error
+ {
+ public:
+ task_moved():
+ future_error(system::make_error_code(future_errc::no_state))
+ //std::logic_error("Task moved")
+ {}
+ };
+
+ class promise_moved:
+ public future_error
+ {
+ public:
+ promise_moved():
+ future_error(system::make_error_code(future_errc::no_state))
+ //std::logic_error("Promise moved")
+ {}
+ };
namespace future_state
{
@@ -93,6 +214,7 @@ namespace boost
{
boost::exception_ptr exception;
bool done;
+ bool thread_was_interrupted;
boost::mutex mutex;
boost::condition_variable waiters;
typedef std::list<boost::condition_variable_any*> waiter_list;
@@ -100,7 +222,8 @@ namespace boost
boost::function<void()> callback;
future_object_base():
- done(false)
+ done(false),
+ thread_was_interrupted(false)
{}
virtual ~future_object_base()
{}
@@ -165,6 +288,10 @@ namespace boost
{
waiters.wait(lock);
}
+ if(rethrow && thread_was_interrupted)
+ {
+ throw boost::thread_interrupted();
+ }
if(rethrow && exception)
{
boost::rethrow_exception(exception);
@@ -186,6 +313,25 @@ namespace boost
return true;
}
+#ifdef BOOST_THREAD_USES_CHRONO
+
+ template <class Clock, class Duration>
+ future_status
+ wait_until(const chrono::time_point<Clock, Duration>& abs_time)
+ {
+ boost::unique_lock<boost::mutex> lock(mutex);
+ do_callback(lock);
+ while(!done)
+ {
+ cv_status const st=waiters.wait_until(lock,abs_time);
+ if(st==cv_status::timeout && !done)
+ {
+ return future_status::timeout;
+ }
+ }
+ return future_status::ready;
+ }
+#endif
void mark_exceptional_finish_internal(boost::exception_ptr const& e)
{
exception=e;
@@ -196,16 +342,21 @@ namespace boost
boost::lock_guard<boost::mutex> lock(mutex);
mark_exceptional_finish_internal(boost::current_exception());
}
-
+ void mark_interrupted_finish()
+ {
+ boost::lock_guard<boost::mutex> lock(mutex);
+ thread_was_interrupted=true;
+ mark_finished_internal();
+ }
bool has_value()
{
boost::lock_guard<boost::mutex> lock(mutex);
- return done && !exception;
+ return done && !(exception || thread_was_interrupted);
}
bool has_exception()
{
boost::lock_guard<boost::mutex> lock(mutex);
- return done && exception;
+ return done && (exception || thread_was_interrupted);
}
template<typename F,typename U>
@@ -226,14 +377,20 @@ namespace boost
#ifndef BOOST_NO_RVALUE_REFERENCES
typedef T const& source_reference_type;
struct dummy;
- typedef typename boost::mpl::if_<boost::is_fundamental<T>,dummy&,T&&>::type rvalue_source_type;
- typedef typename boost::mpl::if_<boost::is_fundamental<T>,T,T&&>::type move_dest_type;
+ typedef typename boost::mpl::if_<boost::is_fundamental<T>,dummy&,BOOST_THREAD_RV_REF(T)>::type rvalue_source_type;
+ typedef typename boost::mpl::if_<boost::is_fundamental<T>,T,BOOST_THREAD_RV_REF(T)>::type move_dest_type;
+#elif defined BOOST_THREAD_USES_MOVE
+ typedef T& source_reference_type;
+ typedef typename boost::mpl::if_<boost::has_move_emulation_enabled<T>,BOOST_THREAD_RV_REF(T),T const&>::type rvalue_source_type;
+ typedef typename boost::mpl::if_<boost::has_move_emulation_enabled<T>,BOOST_THREAD_RV_REF(T),T>::type move_dest_type;
#else
typedef T& source_reference_type;
- typedef typename boost::mpl::if_<boost::is_convertible<T&,boost::detail::thread_move_t<T> >,boost::detail::thread_move_t<T>,T const&>::type rvalue_source_type;
- typedef typename boost::mpl::if_<boost::is_convertible<T&,boost::detail::thread_move_t<T> >,boost::detail::thread_move_t<T>,T>::type move_dest_type;
+ typedef typename boost::mpl::if_<boost::is_convertible<T&,BOOST_THREAD_RV_REF(T) >,BOOST_THREAD_RV_REF(T),T const&>::type rvalue_source_type;
+ typedef typename boost::mpl::if_<boost::is_convertible<T&,BOOST_THREAD_RV_REF(T) >,BOOST_THREAD_RV_REF(T),T>::type move_dest_type;
#endif
+ typedef const T& shared_future_get_result_type;
+
static void init(storage_type& storage,source_reference_type t)
{
storage.reset(new T(t));
@@ -241,7 +398,7 @@ namespace boost
static void init(storage_type& storage,rvalue_source_type t)
{
- storage.reset(new T(static_cast<rvalue_source_type>(t)));
+ storage.reset(new T(static_cast<rvalue_source_type>(t)));
}
static void cleanup(storage_type& storage)
@@ -258,6 +415,7 @@ namespace boost
struct rvalue_source_type
{};
typedef T& move_dest_type;
+ typedef T& shared_future_get_result_type;
static void init(storage_type& storage,T& t)
{
@@ -275,6 +433,7 @@ namespace boost
{
typedef bool storage_type;
typedef void move_dest_type;
+ typedef void shared_future_get_result_type;
static void init(storage_type& storage)
{
@@ -296,6 +455,7 @@ namespace boost
typedef typename future_traits<T>::source_reference_type source_reference_type;
typedef typename future_traits<T>::rvalue_source_type rvalue_source_type;
typedef typename future_traits<T>::move_dest_type move_dest_type;
+ typedef typename future_traits<T>::shared_future_get_result_type shared_future_get_result_type;
storage_type result;
@@ -308,6 +468,7 @@ namespace boost
future_traits<T>::init(result,result_);
mark_finished_internal();
}
+
void mark_finished_with_result_internal(rvalue_source_type result_)
{
future_traits<T>::init(result,static_cast<rvalue_source_type>(result_));
@@ -319,10 +480,11 @@ namespace boost
boost::lock_guard<boost::mutex> lock(mutex);
mark_finished_with_result_internal(result_);
}
+
void mark_finished_with_result(rvalue_source_type result_)
{
boost::lock_guard<boost::mutex> lock(mutex);
- mark_finished_with_result_internal(result_);
+ mark_finished_with_result_internal(static_cast<rvalue_source_type>(result_));
}
move_dest_type get()
@@ -331,6 +493,12 @@ namespace boost
return static_cast<move_dest_type>(*result);
}
+ shared_future_get_result_type get_sh()
+ {
+ wait();
+ return static_cast<shared_future_get_result_type>(*result);
+ }
+
future_state::state get_state()
{
boost::lock_guard<boost::mutex> guard(mutex);
@@ -353,7 +521,7 @@ namespace boost
struct future_object<void>:
detail::future_object_base
{
- typedef void move_dest_type;
+ typedef void shared_future_get_result_type;
future_object()
{}
@@ -373,7 +541,10 @@ namespace boost
{
wait();
}
-
+ void get_sh()
+ {
+ wait();
+ }
future_state::state get_state()
{
boost::lock_guard<boost::mutex> guard(mutex);
@@ -386,12 +557,22 @@ namespace boost
return future_state::ready;
}
}
-
private:
future_object(future_object const&);
future_object& operator=(future_object const&);
};
+// template<typename T, typename Allocator>
+// struct future_object_alloc: public future_object<T>
+// {
+// typedef future_object<T> base;
+// Allocator alloc_;
+//
+// public:
+// explicit future_object_alloc(const Allocator& a)
+// : alloc_(a) {}
+//
+// };
class future_waiter
{
struct registered_waiter;
@@ -399,38 +580,32 @@ namespace boost
struct registered_waiter
{
- boost::shared_ptr<detail::future_object_base> future;
+ boost::shared_ptr<detail::future_object_base> future_;
detail::future_object_base::waiter_list::iterator wait_iterator;
count_type index;
- registered_waiter(boost::shared_ptr<detail::future_object_base> const& future_,
+ registered_waiter(boost::shared_ptr<detail::future_object_base> const& a_future,
detail::future_object_base::waiter_list::iterator wait_iterator_,
count_type index_):
- future(future_),wait_iterator(wait_iterator_),index(index_)
+ future_(a_future),wait_iterator(wait_iterator_),index(index_)
{}
};
struct all_futures_lock
{
-#ifdef _MANAGED
- typedef std::ptrdiff_t count_type_portable;
-#else
- typedef count_type count_type_portable;
-#endif
- count_type_portable count;
-
+ count_type count;
boost::scoped_array<boost::unique_lock<boost::mutex> > locks;
all_futures_lock(std::vector<registered_waiter>& futures):
count(futures.size()),locks(new boost::unique_lock<boost::mutex>[count])
{
- for(count_type_portable i=0;i<count;++i)
+ for(count_type i=0;i<count;++i)
{
#if defined __DECCXX || defined __SUNPRO_CC
- locks[i]=boost::unique_lock<boost::mutex>(futures[i].future->mutex).move();
+ locks[i]=boost::unique_lock<boost::mutex>(futures[i].future_->mutex).move();
#else
- locks[i]=boost::unique_lock<boost::mutex>(futures[i].future->mutex);
+ locks[i]=boost::unique_lock<boost::mutex>(futures[i].future_->mutex);
#endif
}
}
@@ -442,7 +617,7 @@ namespace boost
void unlock()
{
- for(count_type_portable i=0;i<count;++i)
+ for(count_type i=0;i<count;++i)
{
locks[i].unlock();
}
@@ -461,9 +636,9 @@ namespace boost
template<typename F>
void add(F& f)
{
- if(f.future)
+ if(f.future_)
{
- futures.push_back(registered_waiter(f.future,f.future->register_external_waiter(cv),future_count));
+ futures.push_back(registered_waiter(f.future_,f.future_->register_external_waiter(cv),future_count));
}
++future_count;
}
@@ -475,7 +650,7 @@ namespace boost
{
for(count_type i=0;i<futures.size();++i)
{
- if(futures[i].future->done)
+ if(futures[i].future_->done)
{
return futures[i].index;
}
@@ -488,7 +663,7 @@ namespace boost
{
for(count_type i=0;i<futures.size();++i)
{
- futures[i].future->remove_external_waiter(futures[i].wait_iterator);
+ futures[i].future_->remove_external_waiter(futures[i].wait_iterator);
}
}
@@ -497,7 +672,7 @@ namespace boost
}
template <typename R>
- class unique_future;
+ class BOOST_THREAD_FUTURE;
template <typename R>
class shared_future;
@@ -509,7 +684,7 @@ namespace boost
};
template<typename T>
- struct is_future_type<unique_future<T> >
+ struct is_future_type<BOOST_THREAD_FUTURE<T> >
{
BOOST_STATIC_CONSTANT(bool, value=true);
};
@@ -626,14 +801,13 @@ namespace boost
class packaged_task;
template <typename R>
- class unique_future
+ class BOOST_THREAD_FUTURE
{
- unique_future(unique_future & rhs);// = delete;
- unique_future& operator=(unique_future& rhs);// = delete;
+ private:
typedef boost::shared_ptr<detail::future_object<R> > future_ptr;
- future_ptr future;
+ future_ptr future_;
friend class shared_future<R>;
friend class promise<R>;
@@ -642,99 +816,92 @@ namespace boost
typedef typename detail::future_traits<R>::move_dest_type move_dest_type;
- unique_future(future_ptr future_):
- future(future_)
+ BOOST_THREAD_FUTURE(future_ptr a_future):
+ future_(a_future)
{}
public:
+ BOOST_THREAD_MOVABLE_ONLY(BOOST_THREAD_FUTURE)
typedef future_state::state state;
- unique_future()
+ BOOST_THREAD_FUTURE()
{}
- ~unique_future()
+ ~BOOST_THREAD_FUTURE()
{}
-#ifndef BOOST_NO_RVALUE_REFERENCES
- unique_future(unique_future && other)
- {
- future.swap(other.future);
- }
- unique_future& operator=(unique_future && other)
- {
- future=other.future;
- other.future.reset();
- return *this;
- }
-#else
- unique_future(boost::detail::thread_move_t<unique_future> other):
- future(other->future)
+ BOOST_THREAD_FUTURE(BOOST_THREAD_RV_REF(BOOST_THREAD_FUTURE) other) BOOST_NOEXCEPT:
+ future_(BOOST_THREAD_RV(other).future_)
{
- other->future.reset();
+ BOOST_THREAD_RV(other).future_.reset();
}
- unique_future& operator=(boost::detail::thread_move_t<unique_future> other)
+ BOOST_THREAD_FUTURE& operator=(BOOST_THREAD_RV_REF(BOOST_THREAD_FUTURE) other) BOOST_NOEXCEPT
{
- future=other->future;
- other->future.reset();
+ future_=BOOST_THREAD_RV(other).future_;
+ BOOST_THREAD_RV(other).future_.reset();
return *this;
}
- operator boost::detail::thread_move_t<unique_future>()
+ shared_future<R> share()
{
- return boost::detail::thread_move_t<unique_future>(*this);
+ return shared_future<R>(::boost::move(*this));
}
-#endif
- void swap(unique_future& other)
+ void swap(BOOST_THREAD_FUTURE& other)
{
- future.swap(other.future);
+ future_.swap(other.future_);
}
// retrieving the value
move_dest_type get()
{
- if(!future)
+ if(!future_)
{
boost::throw_exception(future_uninitialized());
}
- return future->get();
+ return future_->get();
}
// functions to check state, and wait for ready
- state get_state() const
+ state get_state() const BOOST_NOEXCEPT
{
- if(!future)
+ if(!future_)
{
return future_state::uninitialized;
}
- return future->get_state();
+ return future_->get_state();
}
-
- bool is_ready() const
+ bool is_ready() const BOOST_NOEXCEPT
{
return get_state()==future_state::ready;
}
- bool has_exception() const
+ bool has_exception() const BOOST_NOEXCEPT
{
- return future && future->has_exception();
+ return future_ && future_->has_exception();
}
- bool has_value() const
+ bool has_value() const BOOST_NOEXCEPT
{
- return future && future->has_value();
+ return future_ && future_->has_value();
}
+ bool valid() const BOOST_NOEXCEPT
+ {
+ return future_ != 0;
+ }
+
+
void wait() const
{
- if(!future)
+ if(!future_)
{
boost::throw_exception(future_uninitialized());
}
- future->wait(false);
+ future_->wait(false);
}
template<typename Duration>
@@ -745,43 +912,55 @@ namespace boost
bool timed_wait_until(boost::system_time const& abs_time) const
{
- if(!future)
+ if(!future_)
{
boost::throw_exception(future_uninitialized());
}
- return future->timed_wait_until(abs_time);
+ return future_->timed_wait_until(abs_time);
}
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Rep, class Period>
+ future_status
+ wait_for(const chrono::duration<Rep, Period>& rel_time) const
+ {
+ return wait_until(chrono::steady_clock::now() + rel_time);
+ }
+ template <class Clock, class Duration>
+ future_status
+ wait_until(const chrono::time_point<Clock, Duration>& abs_time) const
+ {
+ if(!future_)
+ {
+ boost::throw_exception(future_uninitialized());
+ }
+ return future_->wait_until(abs_time);
+ }
+#endif
};
-#ifdef BOOST_NO_RVALUE_REFERENCES
- template <typename T>
- struct has_move_emulation_enabled_aux<unique_future<T> >
- : BOOST_MOVE_BOOST_NS::integral_constant<bool, true>
- {};
-#endif
+ BOOST_THREAD_DCL_MOVABLE_BEG(T) BOOST_THREAD_FUTURE<T> BOOST_THREAD_DCL_MOVABLE_END
template <typename R>
class shared_future
{
typedef boost::shared_ptr<detail::future_object<R> > future_ptr;
- future_ptr future;
-
-// shared_future(const unique_future<R>& other);
-// shared_future& operator=(const unique_future<R>& other);
+ future_ptr future_;
friend class detail::future_waiter;
friend class promise<R>;
friend class packaged_task<R>;
- shared_future(future_ptr future_):
- future(future_)
+ shared_future(future_ptr a_future):
+ future_(a_future)
{}
public:
+ BOOST_THREAD_MOVABLE(shared_future)
+
shared_future(shared_future const& other):
- future(other.future)
+ future_(other.future_)
{}
typedef future_state::state state;
@@ -794,112 +973,85 @@ namespace boost
shared_future& operator=(shared_future const& other)
{
- future=other.future;
+ future_=other.future_;
return *this;
}
-#ifndef BOOST_NO_RVALUE_REFERENCES
- shared_future(shared_future && other)
- {
- future.swap(other.future);
- }
- shared_future(unique_future<R> && other)
- {
- future.swap(other.future);
- }
- shared_future& operator=(shared_future && other)
- {
- future.swap(other.future);
- other.future.reset();
- return *this;
- }
- shared_future& operator=(unique_future<R> && other)
+ shared_future(BOOST_THREAD_RV_REF(shared_future) other) BOOST_NOEXCEPT :
+ future_(BOOST_THREAD_RV(other).future_)
{
- future.swap(other.future);
- other.future.reset();
- return *this;
+ BOOST_THREAD_RV(other).future_.reset();
}
-#else
- shared_future(boost::detail::thread_move_t<shared_future> other):
- future(other->future)
+ shared_future(BOOST_THREAD_RV_REF_BEG BOOST_THREAD_FUTURE<R> BOOST_THREAD_RV_REF_END other) BOOST_NOEXCEPT :
+ future_(BOOST_THREAD_RV(other).future_)
{
- other->future.reset();
+ BOOST_THREAD_RV(other).future_.reset();
}
-// shared_future(const unique_future<R> &) = delete;
- shared_future(boost::detail::thread_move_t<unique_future<R> > other):
- future(other->future)
+ shared_future& operator=(BOOST_THREAD_RV_REF(shared_future) other) BOOST_NOEXCEPT
{
- other->future.reset();
- }
- shared_future& operator=(boost::detail::thread_move_t<shared_future> other)
- {
- future.swap(other->future);
- other->future.reset();
+ future_.swap(BOOST_THREAD_RV(other).future_);
+ BOOST_THREAD_RV(other).future_.reset();
return *this;
}
- shared_future& operator=(boost::detail::thread_move_t<unique_future<R> > other)
+ shared_future& operator=(BOOST_THREAD_RV_REF_BEG BOOST_THREAD_FUTURE<R> BOOST_THREAD_RV_REF_END other) BOOST_NOEXCEPT
{
- future.swap(other->future);
- other->future.reset();
+ future_.swap(BOOST_THREAD_RV(other).future_);
+ BOOST_THREAD_RV(other).future_.reset();
return *this;
}
- operator boost::detail::thread_move_t<shared_future>()
- {
- return boost::detail::thread_move_t<shared_future>(*this);
- }
-
-#endif
-
- void swap(shared_future& other)
+ void swap(shared_future& other) BOOST_NOEXCEPT
{
- future.swap(other.future);
+ future_.swap(other.future_);
}
// retrieving the value
- //typename detail::future_object<R>::move_dest_type get()
- R get()
+ typename detail::future_object<R>::shared_future_get_result_type get()
{
- if(!future)
+ if(!future_)
{
boost::throw_exception(future_uninitialized());
}
- return future->get();
+ return future_->get_sh();
}
// functions to check state, and wait for ready
- state get_state() const
+ state get_state() const BOOST_NOEXCEPT
{
- if(!future)
+ if(!future_)
{
return future_state::uninitialized;
}
- return future->get_state();
+ return future_->get_state();
}
+ bool valid() const BOOST_NOEXCEPT
+ {
+ return future_ != 0;
+ }
- bool is_ready() const
+ bool is_ready() const BOOST_NOEXCEPT
{
return get_state()==future_state::ready;
}
- bool has_exception() const
+ bool has_exception() const BOOST_NOEXCEPT
{
- return future && future->has_exception();
+ return future_ && future_->has_exception();
}
- bool has_value() const
+ bool has_value() const BOOST_NOEXCEPT
{
- return future && future->has_value();
+ return future_ && future_->has_value();
}
void wait() const
{
- if(!future)
+ if(!future_)
{
boost::throw_exception(future_uninitialized());
}
- future->wait(false);
+ future_->wait(false);
}
template<typename Duration>
@@ -910,157 +1062,168 @@ namespace boost
bool timed_wait_until(boost::system_time const& abs_time) const
{
- if(!future)
+ if(!future_)
{
boost::throw_exception(future_uninitialized());
}
- return future->timed_wait_until(abs_time);
+ return future_->timed_wait_until(abs_time);
}
+#ifdef BOOST_THREAD_USES_CHRONO
- };
+ template <class Rep, class Period>
+ future_status
+ wait_for(const chrono::duration<Rep, Period>& rel_time) const
+ {
+ return wait_until(chrono::steady_clock::now() + rel_time);
-#ifdef BOOST_NO_RVALUE_REFERENCES
- template <typename T>
- struct has_move_emulation_enabled_aux<shared_future<T> >
- : BOOST_MOVE_BOOST_NS::integral_constant<bool, true>
- {};
+ }
+ template <class Clock, class Duration>
+ future_status
+ wait_until(const chrono::time_point<Clock, Duration>& abs_time) const
+ {
+ if(!future_)
+ {
+ boost::throw_exception(future_uninitialized());
+ }
+ return future_->wait_until(abs_time);
+ }
#endif
+ };
+
+ BOOST_THREAD_DCL_MOVABLE_BEG(T) shared_future<T> BOOST_THREAD_DCL_MOVABLE_END
template <typename R>
class promise
{
typedef boost::shared_ptr<detail::future_object<R> > future_ptr;
- future_ptr future;
+ future_ptr future_;
bool future_obtained;
- promise(promise & rhs);// = delete;
- promise & operator=(promise & rhs);// = delete;
-
void lazy_init()
{
- if(!atomic_load(&future))
+#if defined BOOST_THREAD_PROMISE_LAZY
+ if(!atomic_load(&future_))
{
future_ptr blank;
- atomic_compare_exchange(&future,&blank,future_ptr(new detail::future_object<R>));
+ atomic_compare_exchange(&future_,&blank,future_ptr(new detail::future_object<R>));
}
+#endif
}
public:
-// template <class Allocator> explicit promise(Allocator a);
+ BOOST_THREAD_MOVABLE_ONLY(promise)
+#if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS
+ template <class Allocator>
+ promise(boost::allocator_arg_t, Allocator a)
+ {
+ typedef typename Allocator::template rebind<detail::future_object<R> >::other A2;
+ A2 a2(a);
+ typedef thread_detail::allocator_destructor<A2> D;
+ future_ = future_ptr(::new(a2.allocate(1)) detail::future_object<R>(), D(a2, 1) );
+ future_obtained = false;
+ }
+#endif
promise():
- future(),future_obtained(false)
+#if defined BOOST_THREAD_PROMISE_LAZY
+ future_(),
+#else
+ future_(new detail::future_object<R>()),
+#endif
+ future_obtained(false)
{}
~promise()
{
- if(future)
+ if(future_)
{
- boost::lock_guard<boost::mutex> lock(future->mutex);
+ boost::lock_guard<boost::mutex> lock(future_->mutex);
- if(!future->done)
+ if(!future_->done)
{
- future->mark_exceptional_finish_internal(boost::copy_exception(broken_promise()));
+ future_->mark_exceptional_finish_internal(boost::copy_exception(broken_promise()));
}
}
}
// Assignment
-#ifndef BOOST_NO_RVALUE_REFERENCES
- promise(promise && rhs):
- future_obtained(rhs.future_obtained)
+ promise(BOOST_THREAD_RV_REF(promise) rhs) BOOST_NOEXCEPT :
+ future_(BOOST_THREAD_RV(rhs).future_),future_obtained(BOOST_THREAD_RV(rhs).future_obtained)
{
- future.swap(rhs.future);
- rhs.future_obtained=false;
+ BOOST_THREAD_RV(rhs).future_.reset();
+ BOOST_THREAD_RV(rhs).future_obtained=false;
}
- promise & operator=(promise&& rhs)
+ promise & operator=(BOOST_THREAD_RV_REF(promise) rhs) BOOST_NOEXCEPT
{
- future.swap(rhs.future);
- future_obtained=rhs.future_obtained;
- rhs.future.reset();
- rhs.future_obtained=false;
+ future_=BOOST_THREAD_RV(rhs).future_;
+ future_obtained=BOOST_THREAD_RV(rhs).future_obtained;
+ BOOST_THREAD_RV(rhs).future_.reset();
+ BOOST_THREAD_RV(rhs).future_obtained=false;
return *this;
}
-#else
- promise(boost::detail::thread_move_t<promise> rhs):
- future(rhs->future),future_obtained(rhs->future_obtained)
- {
- rhs->future.reset();
- rhs->future_obtained=false;
- }
- promise & operator=(boost::detail::thread_move_t<promise> rhs)
- {
- future=rhs->future;
- future_obtained=rhs->future_obtained;
- rhs->future.reset();
- rhs->future_obtained=false;
- return *this;
- }
-
- operator boost::detail::thread_move_t<promise>()
- {
- return boost::detail::thread_move_t<promise>(*this);
- }
-#endif
void swap(promise& other)
{
- future.swap(other.future);
+ future_.swap(other.future_);
std::swap(future_obtained,other.future_obtained);
}
// Result retrieval
- unique_future<R> get_future()
+ BOOST_THREAD_FUTURE<R> get_future()
{
lazy_init();
- if(future_obtained)
+ if (future_.get()==0)
+ {
+ boost::throw_exception(promise_moved());
+ }
+ if (future_obtained)
{
boost::throw_exception(future_already_retrieved());
}
future_obtained=true;
- return unique_future<R>(future);
+ return BOOST_THREAD_FUTURE<R>(future_);
}
void set_value(typename detail::future_traits<R>::source_reference_type r)
{
lazy_init();
- boost::lock_guard<boost::mutex> lock(future->mutex);
- if(future->done)
+ boost::lock_guard<boost::mutex> lock(future_->mutex);
+ if(future_->done)
{
boost::throw_exception(promise_already_satisfied());
}
- future->mark_finished_with_result_internal(r);
+ future_->mark_finished_with_result_internal(r);
}
// void set_value(R && r);
void set_value(typename detail::future_traits<R>::rvalue_source_type r)
{
lazy_init();
- boost::lock_guard<boost::mutex> lock(future->mutex);
- if(future->done)
+ boost::lock_guard<boost::mutex> lock(future_->mutex);
+ if(future_->done)
{
boost::throw_exception(promise_already_satisfied());
}
- future->mark_finished_with_result_internal(static_cast<typename detail::future_traits<R>::rvalue_source_type>(r));
+ future_->mark_finished_with_result_internal(static_cast<typename detail::future_traits<R>::rvalue_source_type>(r));
}
void set_exception(boost::exception_ptr p)
{
lazy_init();
- boost::lock_guard<boost::mutex> lock(future->mutex);
- if(future->done)
+ boost::lock_guard<boost::mutex> lock(future_->mutex);
+ if(future_->done)
{
boost::throw_exception(promise_already_satisfied());
}
- future->mark_exceptional_finish_internal(p);
+ future_->mark_exceptional_finish_internal(p);
}
template<typename F>
void set_wait_callback(F f)
{
lazy_init();
- future->set_wait_callback(f,this);
+ future_->set_wait_callback(f,this);
}
};
@@ -1070,135 +1233,140 @@ namespace boost
{
typedef boost::shared_ptr<detail::future_object<void> > future_ptr;
- future_ptr future;
+ future_ptr future_;
bool future_obtained;
- promise(promise & rhs);// = delete;
- promise & operator=(promise & rhs);// = delete;
-
void lazy_init()
{
- if(!atomic_load(&future))
+#if defined BOOST_THREAD_PROMISE_LAZY
+ if(!atomic_load(&future_))
{
future_ptr blank;
- atomic_compare_exchange(&future,&blank,future_ptr(new detail::future_object<void>));
+ atomic_compare_exchange(&future_,&blank,future_ptr(new detail::future_object<void>));
}
+#endif
}
public:
-// template <class Allocator> explicit promise(Allocator a);
+ BOOST_THREAD_MOVABLE_ONLY(promise)
+
+#if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS
+ template <class Allocator>
+ promise(boost::allocator_arg_t, Allocator a)
+ {
+ typedef typename Allocator::template rebind<detail::future_object<void> >::other A2;
+ A2 a2(a);
+ typedef thread_detail::allocator_destructor<A2> D;
+ future_ = future_ptr(::new(a2.allocate(1)) detail::future_object<void>(), D(a2, 1) );
+ future_obtained = false;
+ }
+#endif
promise():
- future(),future_obtained(false)
+#if defined BOOST_THREAD_PROMISE_LAZY
+ future_(),
+#else
+ future_(new detail::future_object<void>),
+#endif
+ future_obtained(false)
{}
~promise()
{
- if(future)
+ if(future_)
{
- boost::lock_guard<boost::mutex> lock(future->mutex);
+ boost::lock_guard<boost::mutex> lock(future_->mutex);
- if(!future->done)
+ if(!future_->done)
{
- future->mark_exceptional_finish_internal(boost::copy_exception(broken_promise()));
+ future_->mark_exceptional_finish_internal(boost::copy_exception(broken_promise()));
}
}
}
// Assignment
-#ifndef BOOST_NO_RVALUE_REFERENCES
- promise(promise && rhs):
- future_obtained(rhs.future_obtained)
- {
- future.swap(rhs.future);
- rhs.future_obtained=false;
- }
- promise & operator=(promise&& rhs)
- {
- future.swap(rhs.future);
- future_obtained=rhs.future_obtained;
- rhs.future.reset();
- rhs.future_obtained=false;
- return *this;
- }
-#else
- promise(boost::detail::thread_move_t<promise> rhs):
- future(rhs->future),future_obtained(rhs->future_obtained)
- {
- rhs->future.reset();
- rhs->future_obtained=false;
- }
- promise & operator=(boost::detail::thread_move_t<promise> rhs)
+ promise(BOOST_THREAD_RV_REF(promise) rhs) BOOST_NOEXCEPT :
+ future_(BOOST_THREAD_RV(rhs).future_),future_obtained(BOOST_THREAD_RV(rhs).future_obtained)
{
- future=rhs->future;
- future_obtained=rhs->future_obtained;
- rhs->future.reset();
- rhs->future_obtained=false;
- return *this;
+ // we need to release the future as shared_ptr doesn't implements move semantics
+ BOOST_THREAD_RV(rhs).future_.reset();
+ BOOST_THREAD_RV(rhs).future_obtained=false;
}
- operator boost::detail::thread_move_t<promise>()
+ promise & operator=(BOOST_THREAD_RV_REF(promise) rhs) BOOST_NOEXCEPT
{
- return boost::detail::thread_move_t<promise>(*this);
+ future_=BOOST_THREAD_RV(rhs).future_;
+ future_obtained=BOOST_THREAD_RV(rhs).future_obtained;
+ BOOST_THREAD_RV(rhs).future_.reset();
+ BOOST_THREAD_RV(rhs).future_obtained=false;
+ return *this;
}
-#endif
void swap(promise& other)
{
- future.swap(other.future);
+ future_.swap(other.future_);
std::swap(future_obtained,other.future_obtained);
}
// Result retrieval
- unique_future<void> get_future()
+ BOOST_THREAD_FUTURE<void> get_future()
{
lazy_init();
+ if (future_.get()==0)
+ {
+ boost::throw_exception(promise_moved());
+ }
if(future_obtained)
{
boost::throw_exception(future_already_retrieved());
}
future_obtained=true;
- return unique_future<void>(future);
+ return BOOST_THREAD_FUTURE<void>(future_);
}
void set_value()
{
lazy_init();
- boost::lock_guard<boost::mutex> lock(future->mutex);
- if(future->done)
+ boost::lock_guard<boost::mutex> lock(future_->mutex);
+ if(future_->done)
{
boost::throw_exception(promise_already_satisfied());
}
- future->mark_finished_with_result_internal();
+ future_->mark_finished_with_result_internal();
}
void set_exception(boost::exception_ptr p)
{
lazy_init();
- boost::lock_guard<boost::mutex> lock(future->mutex);
- if(future->done)
+ boost::lock_guard<boost::mutex> lock(future_->mutex);
+ if(future_->done)
{
boost::throw_exception(promise_already_satisfied());
}
- future->mark_exceptional_finish_internal(p);
+ future_->mark_exceptional_finish_internal(p);
}
template<typename F>
void set_wait_callback(F f)
{
lazy_init();
- future->set_wait_callback(f,this);
+ future_->set_wait_callback(f,this);
}
};
-#ifdef BOOST_NO_RVALUE_REFERENCES
- template <typename T>
- struct has_move_emulation_enabled_aux<promise<T> >
- : BOOST_MOVE_BOOST_NS::integral_constant<bool, true>
- {};
+#if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS
+ namespace container
+ {
+ template <class R, class Alloc>
+ struct uses_allocator<promise<R> , Alloc> : true_type
+ {
+ };
+ }
#endif
+ BOOST_THREAD_DCL_MOVABLE_BEG(T) promise<T> BOOST_THREAD_DCL_MOVABLE_END
+
namespace detail
{
template<typename R>
@@ -1211,6 +1379,10 @@ namespace boost
started(false)
{}
+ void reset()
+ {
+ started=false;
+ }
void run()
{
{
@@ -1243,26 +1415,32 @@ namespace boost
struct task_object:
task_base<R>
{
+ private:
+ task_object(task_object&);
+ public:
F f;
task_object(F const& f_):
f(f_)
{}
#ifndef BOOST_NO_RVALUE_REFERENCES
- task_object(F&& f_):
- f(f_)
+ task_object(BOOST_THREAD_RV_REF(F) f_):
+ f(boost::forward<F>(f_))
{}
#else
- task_object(boost::detail::thread_move_t<F> f_):
- f(f_)
+ task_object(BOOST_THREAD_RV_REF(F) f_):
+ f(boost::move(f_))
{}
#endif
-
void do_run()
{
try
{
this->mark_finished_with_result(f());
}
+ catch(thread_interrupted& )
+ {
+ this->mark_interrupted_finish();
+ }
catch(...)
{
this->mark_exceptional_finish();
@@ -1274,17 +1452,20 @@ namespace boost
struct task_object<void,F>:
task_base<void>
{
+ private:
+ task_object(task_object&);
+ public:
F f;
task_object(F const& f_):
f(f_)
{}
#ifndef BOOST_NO_RVALUE_REFERENCES
- task_object(F&& f_):
- f(f_)
+ task_object(BOOST_THREAD_RV_REF(F) f_):
+ f(boost::forward<F>(f_))
{}
#else
- task_object(boost::detail::thread_move_t<F> f_):
- f(f_)
+ task_object(BOOST_THREAD_RV_REF(F) f_):
+ f(boost::move(f_))
{}
#endif
@@ -1295,6 +1476,10 @@ namespace boost
f();
this->mark_finished_with_result();
}
+ catch(thread_interrupted& )
+ {
+ this->mark_interrupted_finish();
+ }
catch(...)
{
this->mark_exceptional_finish();
@@ -1304,47 +1489,91 @@ namespace boost
}
-
template<typename R>
class packaged_task
{
+ typedef boost::shared_ptr<detail::task_base<R> > task_ptr;
boost::shared_ptr<detail::task_base<R> > task;
bool future_obtained;
- packaged_task(packaged_task&);// = delete;
- packaged_task& operator=(packaged_task&);// = delete;
-
public:
+ typedef R result_type;
+ BOOST_THREAD_MOVABLE_ONLY(packaged_task)
+
packaged_task():
future_obtained(false)
{}
// construction and destruction
- template <class F>
- explicit packaged_task(F const& f):
- task(new detail::task_object<R,F>(f)),future_obtained(false)
- {}
+
explicit packaged_task(R(*f)()):
task(new detail::task_object<R,R(*)()>(f)),future_obtained(false)
{}
-
#ifndef BOOST_NO_RVALUE_REFERENCES
template <class F>
- explicit packaged_task(F&& f):
- task(new detail::task_object<R,F>(f)),future_obtained(false)
+ explicit packaged_task(BOOST_THREAD_RV_REF(F) f):
+ task(new detail::task_object<R,
+ typename remove_cv<typename remove_reference<F>::type>::type
+ >(boost::forward<F>(f))),future_obtained(false)
{}
#else
template <class F>
- explicit packaged_task(boost::detail::thread_move_t<F> f):
+ explicit packaged_task(F const& f):
task(new detail::task_object<R,F>(f)),future_obtained(false)
{}
+ template <class F>
+ explicit packaged_task(BOOST_THREAD_RV_REF(F) f):
+ task(new detail::task_object<R,F>(boost::move(f))),future_obtained(false)
+ {}
#endif
-// template <class F, class Allocator>
-// explicit packaged_task(F const& f, Allocator a);
-// template <class F, class Allocator>
-// explicit packaged_task(F&& f, Allocator a);
+#if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS
+ template <class Allocator>
+ packaged_task(boost::allocator_arg_t, Allocator a, R(*f)())
+ {
+ typedef R(*FR)();
+ typedef typename Allocator::template rebind<detail::task_object<R,FR> >::other A2;
+ A2 a2(a);
+ typedef thread_detail::allocator_destructor<A2> D;
+
+ task = task_ptr(::new(a2.allocate(1)) detail::task_object<R,FR>(f), D(a2, 1) );
+ future_obtained = false;
+ }
+#ifndef BOOST_NO_RVALUE_REFERENCES
+ template <class F, class Allocator>
+ packaged_task(boost::allocator_arg_t, Allocator a, BOOST_THREAD_RV_REF(F) f)
+ {
+ typedef typename remove_cv<typename remove_reference<F>::type>::type FR;
+ typedef typename Allocator::template rebind<detail::task_object<R,FR> >::other A2;
+ A2 a2(a);
+ typedef thread_detail::allocator_destructor<A2> D;
+ task = task_ptr(::new(a2.allocate(1)) detail::task_object<R,FR>(boost::forward<F>(f)), D(a2, 1) );
+ future_obtained = false;
+ }
+#else
+ template <class F, class Allocator>
+ packaged_task(boost::allocator_arg_t, Allocator a, const F& f)
+ {
+ typedef typename Allocator::template rebind<detail::task_object<R,F> >::other A2;
+ A2 a2(a);
+ typedef thread_detail::allocator_destructor<A2> D;
+
+ task = task_ptr(::new(a2.allocate(1)) detail::task_object<R,F>(f), D(a2, 1) );
+ future_obtained = false;
+ }
+ template <class F, class Allocator>
+ packaged_task(boost::allocator_arg_t, Allocator a, BOOST_THREAD_RV_REF(F) f)
+ {
+ typedef typename Allocator::template rebind<detail::task_object<R,F> >::other A2;
+ A2 a2(a);
+ typedef thread_detail::allocator_destructor<A2> D;
+
+ task = task_ptr(::new(a2.allocate(1)) detail::task_object<R,F>(boost::move(f)), D(a2, 1) );
+ future_obtained = false;
+ }
+#endif //BOOST_NO_RVALUE_REFERENCES
+#endif // BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS
~packaged_task()
{
@@ -1355,46 +1584,39 @@ namespace boost
}
// assignment
-#ifndef BOOST_NO_RVALUE_REFERENCES
- packaged_task(packaged_task&& other):
- future_obtained(other.future_obtained)
- {
- task.swap(other.task);
- other.future_obtained=false;
- }
- packaged_task& operator=(packaged_task&& other)
+ packaged_task(BOOST_THREAD_RV_REF(packaged_task) other) BOOST_NOEXCEPT :
+ future_obtained(BOOST_THREAD_RV(other).future_obtained)
{
- packaged_task temp(static_cast<packaged_task&&>(other));
- swap(temp);
- return *this;
+ task.swap(BOOST_THREAD_RV(other).task);
+ BOOST_THREAD_RV(other).future_obtained=false;
}
-#else
- packaged_task(boost::detail::thread_move_t<packaged_task> other):
- future_obtained(other->future_obtained)
+ packaged_task& operator=(BOOST_THREAD_RV_REF(packaged_task) other) BOOST_NOEXCEPT
{
- task.swap(other->task);
- other->future_obtained=false;
- }
- packaged_task& operator=(boost::detail::thread_move_t<packaged_task> other)
- {
- packaged_task temp(other);
+ packaged_task temp(static_cast<BOOST_THREAD_RV_REF(packaged_task)>(other));
swap(temp);
return *this;
}
- operator boost::detail::thread_move_t<packaged_task>()
+
+ void reset()
{
- return boost::detail::thread_move_t<packaged_task>(*this);
+ if (!valid())
+ throw future_error(system::make_error_code(future_errc::no_state));
+ task->reset();
+ future_obtained=false;
}
-#endif
- void swap(packaged_task& other)
+ void swap(packaged_task& other) BOOST_NOEXCEPT
{
task.swap(other.task);
std::swap(future_obtained,other.future_obtained);
}
+ bool valid() const BOOST_NOEXCEPT
+ {
+ return task.get()!=0;
+ }
// result retrieval
- unique_future<R> get_future()
+ BOOST_THREAD_FUTURE<R> get_future()
{
if(!task)
{
@@ -1403,12 +1625,14 @@ namespace boost
else if(!future_obtained)
{
future_obtained=true;
- return unique_future<R>(task);
+ return BOOST_THREAD_FUTURE<R>(task);
}
else
{
boost::throw_exception(future_already_retrieved());
}
+ return BOOST_THREAD_FUTURE<R>();
+
}
@@ -1430,14 +1654,50 @@ namespace boost
};
-#ifdef BOOST_NO_RVALUE_REFERENCES
- template <typename T>
- struct has_move_emulation_enabled_aux<packaged_task<T> >
- : BOOST_MOVE_BOOST_NS::integral_constant<bool, true>
- {};
+#if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS
+ namespace container
+ {
+ template <class R, class Alloc>
+ struct uses_allocator<packaged_task<R>, Alloc>
+ : public true_type {};
+ }
#endif
-}
+ BOOST_THREAD_DCL_MOVABLE_BEG(T) packaged_task<T> BOOST_THREAD_DCL_MOVABLE_END
+
+// template <class F>
+// BOOST_THREAD_FUTURE<typename boost::result_of<F()>::type>
+// async(launch policy, F f)
+// {
+// typedef typename boost::result_of<F()>::type R;
+// typedef BOOST_THREAD_FUTURE<R> future;
+// if (int(policy) & int(launch::async))
+// {
+// packaged_task<R> pt( f );
+//
+// BOOST_THREAD_FUTURE ret = pt.get_future();
+// boost::thread( boost::move(pt) ).detach();
+// return ::boost::move(ret);
+// }
+// else if (int(policy) & int(launch::deferred))
+// {
+// packaged_task<R> pt( f );
+//
+// BOOST_THREAD_FUTURE ret = pt.get_future();
+// return ::boost::move(ret);
+// }
+// }
+//
+// template <class F>
+// BOOST_THREAD_FUTURE<typename boost::result_of<F()>::type>
+// async(F f)
+// {
+// return async(launch::any, f);
+// }
-#endif
+
+}
+
+#endif // BOOST_NO_EXCEPTION
+#endif // header
diff --git a/boost/thread/locks.hpp b/boost/thread/locks.hpp
index 26012707e7..5111d33e68 100644
--- a/boost/thread/locks.hpp
+++ b/boost/thread/locks.hpp
@@ -2,6 +2,8 @@
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// (C) Copyright 2007 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
+
#ifndef BOOST_THREAD_LOCKS_HPP
#define BOOST_THREAD_LOCKS_HPP
#include <boost/thread/detail/config.hpp>
@@ -12,6 +14,10 @@
#include <boost/thread/thread_time.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/type_traits/is_class.hpp>
+#ifdef BOOST_THREAD_USES_CHRONO
+#include <boost/chrono/time_point.hpp>
+#include <boost/chrono/duration.hpp>
+#endif
#include <boost/config/abi_prefix.hpp>
@@ -164,9 +170,9 @@ namespace boost
struct adopt_lock_t
{};
- const defer_lock_t defer_lock={};
- const try_to_lock_t try_to_lock={};
- const adopt_lock_t adopt_lock={};
+ BOOST_CONSTEXPR_OR_CONST defer_lock_t defer_lock={};
+ BOOST_CONSTEXPR_OR_CONST try_to_lock_t try_to_lock={};
+ BOOST_CONSTEXPR_OR_CONST adopt_lock_t adopt_lock={};
template<typename Mutex>
class shared_lock;
@@ -248,9 +254,10 @@ namespace boost
private:
Mutex& m;
- explicit lock_guard(lock_guard&);
- lock_guard& operator=(lock_guard&);
public:
+ typedef Mutex mutex_type;
+ BOOST_THREAD_NO_COPYABLE(lock_guard)
+
explicit lock_guard(Mutex& m_):
m(m_)
{
@@ -265,22 +272,26 @@ namespace boost
}
};
-
template<typename Mutex>
class unique_lock
{
private:
Mutex* m;
bool is_locked;
- unique_lock(unique_lock&);
+
+ private:
explicit unique_lock(upgrade_lock<Mutex>&);
- unique_lock& operator=(unique_lock&);
unique_lock& operator=(upgrade_lock<Mutex>& other);
public:
+ typedef Mutex mutex_type;
+ BOOST_THREAD_MOVABLE_ONLY(unique_lock)
+
+#if 0 // This should not be needed anymore. Use instead BOOST_THREAD_MAKE_RV_REF.
#if BOOST_WORKAROUND(__SUNPRO_CC, < 0x5100)
unique_lock(const volatile unique_lock&);
#endif
- unique_lock():
+#endif
+ unique_lock() BOOST_NOEXCEPT :
m(0),is_locked(false)
{}
@@ -292,7 +303,7 @@ namespace boost
unique_lock(Mutex& m_,adopt_lock_t):
m(&m_),is_locked(true)
{}
- unique_lock(Mutex& m_,defer_lock_t):
+ unique_lock(Mutex& m_,defer_lock_t) BOOST_NOEXCEPT:
m(&m_),is_locked(false)
{}
unique_lock(Mutex& m_,try_to_lock_t):
@@ -311,86 +322,167 @@ namespace boost
{
timed_lock(target_time);
}
-#ifndef BOOST_NO_RVALUE_REFERENCES
- unique_lock(unique_lock&& other):
- m(other.m),is_locked(other.is_locked)
+
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Clock, class Duration>
+ unique_lock(Mutex& mtx, const chrono::time_point<Clock, Duration>& t)
+ : m(&mtx), is_locked(mtx.try_lock_until(t))
{
- other.is_locked=false;
- other.m=0;
}
- explicit unique_lock(upgrade_lock<Mutex>&& other);
-
- unique_lock<Mutex>&& move()
+ template <class Rep, class Period>
+ unique_lock(Mutex& mtx, const chrono::duration<Rep, Period>& d)
+ : m(&mtx), is_locked(mtx.try_lock_for(d))
{
- return static_cast<unique_lock<Mutex>&&>(*this);
}
+#endif
+ unique_lock(BOOST_THREAD_RV_REF(unique_lock) other) BOOST_NOEXCEPT:
+ m(BOOST_THREAD_RV(other).m),is_locked(BOOST_THREAD_RV(other).is_locked)
+ {
+ BOOST_THREAD_RV(other).is_locked=false;
+ BOOST_THREAD_RV(other).m=0;
+ }
+ BOOST_THREAD_EXPLICIT_LOCK_CONVERSION unique_lock(BOOST_THREAD_RV_REF_BEG upgrade_lock<Mutex> BOOST_THREAD_RV_REF_END other);
- unique_lock& operator=(unique_lock&& other)
+#ifndef BOOST_THREAD_PROVIDES_EXPLICIT_LOCK_CONVERSION
+ unique_lock& operator=(BOOST_THREAD_RV_REF_BEG upgrade_lock<Mutex> BOOST_THREAD_RV_REF_END other) BOOST_NOEXCEPT
{
- unique_lock temp(other.move());
+ unique_lock temp(::boost::move(other));
swap(temp);
return *this;
}
+#endif
- unique_lock& operator=(upgrade_lock<Mutex>&& other)
+ unique_lock& operator=(BOOST_THREAD_RV_REF(unique_lock) other) BOOST_NOEXCEPT
{
- unique_lock temp(other.move());
+ unique_lock temp(::boost::move(other));
swap(temp);
return *this;
}
- void swap(unique_lock&& other)
- {
- std::swap(m,other.m);
- std::swap(is_locked,other.is_locked);
- }
-#else
- unique_lock(detail::thread_move_t<unique_lock<Mutex> > other):
- m(other->m),is_locked(other->is_locked)
+#if 0 // This should not be needed anymore. Use instead BOOST_THREAD_MAKE_RV_REF.
+#if BOOST_WORKAROUND(__SUNPRO_CC, < 0x5100)
+ unique_lock& operator=(unique_lock<Mutex> other)
{
- other->is_locked=false;
- other->m=0;
+ swap(other);
+ return *this;
}
- unique_lock(detail::thread_move_t<upgrade_lock<Mutex> > other);
+#endif // BOOST_WORKAROUND
+#endif
- operator detail::thread_move_t<unique_lock<Mutex> >()
+ // Conversion from upgrade locking
+ unique_lock(BOOST_THREAD_RV_REF_BEG upgrade_lock<mutex_type> BOOST_THREAD_RV_REF_END ul, try_to_lock_t)
+ : m(0),is_locked(false)
{
- return move();
+ if (BOOST_THREAD_RV(ul).owns_lock()) {
+ if (BOOST_THREAD_RV(ul).mutex()->try_unlock_upgrade_and_lock())
+ {
+ m = BOOST_THREAD_RV(ul).release();
+ is_locked = true;
+ }
+ }
+ else
+ {
+ m = BOOST_THREAD_RV(ul).release();
+ }
}
- detail::thread_move_t<unique_lock<Mutex> > move()
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Clock, class Duration>
+ unique_lock(BOOST_THREAD_RV_REF_BEG upgrade_lock<mutex_type> BOOST_THREAD_RV_REF_END ul,
+ const chrono::time_point<Clock, Duration>& abs_time)
+ : m(0),is_locked(false)
{
- return detail::thread_move_t<unique_lock<Mutex> >(*this);
+ if (BOOST_THREAD_RV(ul).owns_lock()) {
+ if (BOOST_THREAD_RV(ul).mutex()->try_unlock_upgrade_and_lock_until(abs_time))
+ {
+ m = BOOST_THREAD_RV(ul).release();
+ is_locked = true;
+ }
+ }
+ else
+ {
+ m = BOOST_THREAD_RV(ul).release();
+ }
}
-#if BOOST_WORKAROUND(__SUNPRO_CC, < 0x5100)
- unique_lock& operator=(unique_lock<Mutex> other)
+ template <class Rep, class Period>
+ unique_lock(BOOST_THREAD_RV_REF_BEG upgrade_lock<mutex_type> BOOST_THREAD_RV_REF_END ul,
+ const chrono::duration<Rep, Period>& rel_time)
+ : m(0),is_locked(false)
{
- swap(other);
- return *this;
- }
-#else
- unique_lock& operator=(detail::thread_move_t<unique_lock<Mutex> > other)
- {
- unique_lock temp(other);
- swap(temp);
- return *this;
+ if (BOOST_THREAD_RV(ul).owns_lock()) {
+ if (BOOST_THREAD_RV(ul).mutex()->try_unlock_upgrade_and_lock_for(rel_time))
+ {
+ m = BOOST_THREAD_RV(ul).release();
+ is_locked = true;
+ }
+ }
+ else
+ {
+ m = BOOST_THREAD_RV(ul).release();
+ }
}
#endif
- unique_lock& operator=(detail::thread_move_t<upgrade_lock<Mutex> > other)
+#ifdef BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
+ // Conversion from shared locking
+ unique_lock(BOOST_THREAD_RV_REF_BEG shared_lock<mutex_type> BOOST_THREAD_RV_REF_END sl, try_to_lock_t)
+ : m(0),is_locked(false)
{
- unique_lock temp(other);
- swap(temp);
- return *this;
+ if (BOOST_THREAD_RV(sl).owns_lock()) {
+ if (BOOST_THREAD_RV(sl).mutex()->try_unlock_shared_and_lock())
+ {
+ m = BOOST_THREAD_RV(sl).release();
+ is_locked = true;
+ }
+ }
+ else
+ {
+ m = BOOST_THREAD_RV(sl).release();
+ }
+ }
+
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Clock, class Duration>
+ unique_lock(BOOST_THREAD_RV_REF_BEG shared_lock<mutex_type> BOOST_THREAD_RV_REF_END sl,
+ const chrono::time_point<Clock, Duration>& abs_time)
+ : m(0),is_locked(false)
+ {
+ if (BOOST_THREAD_RV(sl).owns_lock()) {
+ if (BOOST_THREAD_RV(sl).mutex()->try_unlock_shared_and_lock_until(abs_time))
+ {
+ m = BOOST_THREAD_RV(sl).release();
+ is_locked = true;
+ }
+ }
+ else
+ {
+ m = BOOST_THREAD_RV(sl).release();
+ }
}
- void swap(detail::thread_move_t<unique_lock<Mutex> > other)
+
+ template <class Rep, class Period>
+ unique_lock(BOOST_THREAD_RV_REF_BEG shared_lock<mutex_type> BOOST_THREAD_RV_REF_END sl,
+ const chrono::duration<Rep, Period>& rel_time)
+ : m(0),is_locked(false)
{
- std::swap(m,other->m);
- std::swap(is_locked,other->is_locked);
+ if (BOOST_THREAD_RV(sl).owns_lock()) {
+ if (BOOST_THREAD_RV(sl).mutex()->try_unlock_shared_and_lock_for(rel_time))
+ {
+ m = BOOST_THREAD_RV(sl).release();
+ is_locked = true;
+ }
+ }
+ else
+ {
+ m = BOOST_THREAD_RV(sl).release();
+ }
}
-#endif
- void swap(unique_lock& other)
+#endif // BOOST_THREAD_USES_CHRONO
+#endif // BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
+
+
+ void swap(unique_lock& other) BOOST_NOEXCEPT
{
std::swap(m,other.m);
std::swap(is_locked,other.is_locked);
@@ -405,18 +497,26 @@ namespace boost
}
void lock()
{
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost unique_lock has no mutex"));
+ }
if(owns_lock())
{
- boost::throw_exception(boost::lock_error());
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost unique_lock owns already the mutex"));
}
m->lock();
is_locked=true;
}
bool try_lock()
{
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost unique_lock has no mutex"));
+ }
if(owns_lock())
{
- boost::throw_exception(boost::lock_error());
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost unique_lock owns already the mutex"));
}
is_locked=m->try_lock();
return is_locked;
@@ -424,50 +524,118 @@ namespace boost
template<typename TimeDuration>
bool timed_lock(TimeDuration const& relative_time)
{
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost unique_lock has no mutex"));
+ }
+ if(owns_lock())
+ {
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost unique_lock owns already the mutex"));
+ }
is_locked=m->timed_lock(relative_time);
return is_locked;
}
bool timed_lock(::boost::system_time const& absolute_time)
{
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost unique_lock has no mutex"));
+ }
+ if(owns_lock())
+ {
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost unique_lock owns already the mutex"));
+ }
is_locked=m->timed_lock(absolute_time);
return is_locked;
}
bool timed_lock(::boost::xtime const& absolute_time)
{
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost unique_lock has no mutex"));
+ }
+ if(owns_lock())
+ {
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost unique_lock owns already the mutex"));
+ }
is_locked=m->timed_lock(absolute_time);
return is_locked;
}
+
+#ifdef BOOST_THREAD_USES_CHRONO
+
+ template <class Rep, class Period>
+ bool try_lock_for(const chrono::duration<Rep, Period>& rel_time)
+ {
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost unique_lock has no mutex"));
+ }
+ if(owns_lock())
+ {
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost unique_lock owns already the mutex"));
+ }
+ is_locked=m->try_lock_for(rel_time);
+ return is_locked;
+ }
+ template <class Clock, class Duration>
+ bool try_lock_until(const chrono::time_point<Clock, Duration>& abs_time)
+ {
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost unique_lock has no mutex"));
+ }
+ if(owns_lock())
+ {
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost unique_lock owns already the mutex"));
+ }
+ is_locked=m->try_lock_until(abs_time);
+ return is_locked;
+ }
+#endif
+
void unlock()
{
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost unique_lock has no mutex"));
+ }
if(!owns_lock())
{
- boost::throw_exception(boost::lock_error());
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost unique_lock doesn't own the mutex"));
}
m->unlock();
is_locked=false;
}
+#if defined(BOOST_NO_EXPLICIT_CONVERSION_OPERATORS)
typedef void (unique_lock::*bool_type)();
- operator bool_type() const
+ operator bool_type() const BOOST_NOEXCEPT
{
return is_locked?&unique_lock::lock:0;
}
- bool operator!() const
+ bool operator!() const BOOST_NOEXCEPT
{
return !owns_lock();
}
- bool owns_lock() const
+#else
+ explicit operator bool() const BOOST_NOEXCEPT
+ {
+ return owns_lock();
+ }
+#endif
+ bool owns_lock() const BOOST_NOEXCEPT
{
return is_locked;
}
- Mutex* mutex() const
+ Mutex* mutex() const BOOST_NOEXCEPT
{
return m;
}
- Mutex* release()
+ Mutex* release() BOOST_NOEXCEPT
{
Mutex* const res=m;
m=0;
@@ -479,51 +647,13 @@ namespace boost
friend class upgrade_lock<Mutex>;
};
-#ifndef BOOST_NO_RVALUE_REFERENCES
template<typename Mutex>
- void swap(unique_lock<Mutex>&& lhs,unique_lock<Mutex>&& rhs)
+ void swap(unique_lock<Mutex>& lhs,unique_lock<Mutex>& rhs) BOOST_NOEXCEPT
{
lhs.swap(rhs);
}
- template<typename Mutex>
- inline upgrade_lock<Mutex>&& move(upgrade_lock<Mutex>&& ul)
- {
- return static_cast<upgrade_lock<Mutex>&&>(ul);
- }
-
- template<typename Mutex>
- inline upgrade_lock<Mutex>&& move(upgrade_lock<Mutex>& ul)
- {
- return static_cast<upgrade_lock<Mutex>&&>(ul);
- }
-#endif
- template<typename Mutex>
- void swap(unique_lock<Mutex>& lhs,unique_lock<Mutex>& rhs)
- {
- lhs.swap(rhs);
- }
-
-#ifndef BOOST_NO_RVALUE_REFERENCES
- template<typename Mutex>
- inline unique_lock<Mutex>&& move(unique_lock<Mutex>&& ul)
- {
- return static_cast<unique_lock<Mutex>&&>(ul);
- }
-
- template<typename Mutex>
- inline unique_lock<Mutex>&& move(unique_lock<Mutex>& ul)
- {
- return static_cast<unique_lock<Mutex>&&>(ul);
- }
-#endif
-
-#ifdef BOOST_NO_RVALUE_REFERENCES
- template <typename Mutex>
- struct has_move_emulation_enabled_aux<unique_lock<Mutex> >
- : BOOST_MOVE_BOOST_NS::integral_constant<bool, true>
- {};
-#endif
+ BOOST_THREAD_DCL_MOVABLE_BEG(Mutex) unique_lock<Mutex> BOOST_THREAD_DCL_MOVABLE_END
template<typename Mutex>
class shared_lock
@@ -531,11 +661,12 @@ namespace boost
protected:
Mutex* m;
bool is_locked;
- private:
- explicit shared_lock(shared_lock&);
- shared_lock& operator=(shared_lock&);
+
public:
- shared_lock():
+ typedef Mutex mutex_type;
+ BOOST_THREAD_MOVABLE_ONLY(shared_lock)
+
+ shared_lock() BOOST_NOEXCEPT:
m(0),is_locked(false)
{}
@@ -547,7 +678,7 @@ namespace boost
shared_lock(Mutex& m_,adopt_lock_t):
m(&m_),is_locked(true)
{}
- shared_lock(Mutex& m_,defer_lock_t):
+ shared_lock(Mutex& m_,defer_lock_t) BOOST_NOEXCEPT:
m(&m_),is_locked(false)
{}
shared_lock(Mutex& m_,try_to_lock_t):
@@ -560,93 +691,89 @@ namespace boost
{
timed_lock(target_time);
}
-#ifndef BOOST_NO_RVALUE_REFERENCES
-#else
- shared_lock(detail::thread_move_t<shared_lock<Mutex> > other):
- m(other->m),is_locked(other->is_locked)
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Clock, class Duration>
+ shared_lock(Mutex& mtx, const chrono::time_point<Clock, Duration>& t)
+ : m(&mtx), is_locked(mtx.try_lock_shared_until(t))
{
- other->is_locked=false;
- other->m=0;
+ }
+ template <class Rep, class Period>
+ shared_lock(Mutex& mtx, const chrono::duration<Rep, Period>& d)
+ : m(&mtx), is_locked(mtx.try_lock_shared_for(d))
+ {
+ }
+#endif
+
+ shared_lock(BOOST_THREAD_RV_REF_BEG shared_lock<Mutex> BOOST_THREAD_RV_REF_END other) BOOST_NOEXCEPT:
+ m(BOOST_THREAD_RV(other).m),is_locked(BOOST_THREAD_RV(other).is_locked)
+ {
+ BOOST_THREAD_RV(other).is_locked=false;
+ BOOST_THREAD_RV(other).m=0;
}
- shared_lock(detail::thread_move_t<unique_lock<Mutex> > other):
- m(other->m),is_locked(other->is_locked)
+ BOOST_THREAD_EXPLICIT_LOCK_CONVERSION shared_lock(BOOST_THREAD_RV_REF_BEG unique_lock<Mutex> BOOST_THREAD_RV_REF_END other):
+ m(BOOST_THREAD_RV(other).m),is_locked(BOOST_THREAD_RV(other).is_locked)
{
if(is_locked)
{
m->unlock_and_lock_shared();
}
- other->is_locked=false;
- other->m=0;
+ BOOST_THREAD_RV(other).is_locked=false;
+ BOOST_THREAD_RV(other).m=0;
}
- shared_lock(detail::thread_move_t<upgrade_lock<Mutex> > other):
- m(other->m),is_locked(other->is_locked)
+ BOOST_THREAD_EXPLICIT_LOCK_CONVERSION shared_lock(BOOST_THREAD_RV_REF_BEG upgrade_lock<Mutex> BOOST_THREAD_RV_REF_END other):
+ m(BOOST_THREAD_RV(other).m),is_locked(BOOST_THREAD_RV(other).is_locked)
{
if(is_locked)
{
m->unlock_upgrade_and_lock_shared();
}
- other->is_locked=false;
- other->m=0;
- }
-
- operator detail::thread_move_t<shared_lock<Mutex> >()
- {
- return move();
+ BOOST_THREAD_RV(other).is_locked=false;
+ BOOST_THREAD_RV(other).m=0;
}
- detail::thread_move_t<shared_lock<Mutex> > move()
- {
- return detail::thread_move_t<shared_lock<Mutex> >(*this);
- }
-
- shared_lock& operator=(detail::thread_move_t<shared_lock<Mutex> > other)
+ shared_lock& operator=(BOOST_THREAD_RV_REF_BEG shared_lock<Mutex> BOOST_THREAD_RV_REF_END other) BOOST_NOEXCEPT
{
- shared_lock temp(other);
+ shared_lock temp(::boost::move(other));
swap(temp);
return *this;
}
-
- shared_lock& operator=(detail::thread_move_t<unique_lock<Mutex> > other)
+#ifndef BOOST_THREAD_PROVIDES_EXPLICIT_LOCK_CONVERSION
+ shared_lock& operator=(BOOST_THREAD_RV_REF_BEG unique_lock<Mutex> BOOST_THREAD_RV_REF_END other)
{
- shared_lock temp(other);
+ shared_lock temp(::boost::move(other));
swap(temp);
return *this;
}
- shared_lock& operator=(detail::thread_move_t<upgrade_lock<Mutex> > other)
+ shared_lock& operator=(BOOST_THREAD_RV_REF_BEG upgrade_lock<Mutex> BOOST_THREAD_RV_REF_END other)
{
- shared_lock temp(other);
+ shared_lock temp(::boost::move(other));
swap(temp);
return *this;
}
#endif
-#ifndef BOOST_NO_RVALUE_REFERENCES
- void swap(shared_lock&& other)
+ void swap(shared_lock& other) BOOST_NOEXCEPT
{
std::swap(m,other.m);
std::swap(is_locked,other.is_locked);
}
-#else
- void swap(boost::detail::thread_move_t<shared_lock<Mutex> > other)
- {
- std::swap(m,other->m);
- std::swap(is_locked,other->is_locked);
- }
-#endif
- void swap(shared_lock& other)
+
+ Mutex* mutex() const BOOST_NOEXCEPT
{
- std::swap(m,other.m);
- std::swap(is_locked,other.is_locked);
+ return m;
}
- Mutex* mutex() const
+ Mutex* release() BOOST_NOEXCEPT
{
- return m;
+ Mutex* const res=m;
+ m=0;
+ is_locked=false;
+ return res;
}
~shared_lock()
@@ -658,27 +785,39 @@ namespace boost
}
void lock()
{
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost shared_lock has no mutex"));
+ }
if(owns_lock())
{
- boost::throw_exception(boost::lock_error());
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost shared_lock owns already the mutex"));
}
m->lock_shared();
is_locked=true;
}
bool try_lock()
{
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost shared_lock has no mutex"));
+ }
if(owns_lock())
{
- boost::throw_exception(boost::lock_error());
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost shared_lock owns already the mutex"));
}
is_locked=m->try_lock_shared();
return is_locked;
}
bool timed_lock(boost::system_time const& target_time)
{
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost shared_lock has no mutex"));
+ }
if(owns_lock())
{
- boost::throw_exception(boost::lock_error());
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost shared_lock owns already the mutex"));
}
is_locked=m->timed_lock_shared(target_time);
return is_locked;
@@ -686,65 +825,91 @@ namespace boost
template<typename Duration>
bool timed_lock(Duration const& target_time)
{
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost shared_lock has no mutex"));
+ }
if(owns_lock())
{
- boost::throw_exception(boost::lock_error());
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost shared_lock owns already the mutex"));
}
is_locked=m->timed_lock_shared(target_time);
return is_locked;
}
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Rep, class Period>
+ bool try_lock_for(const chrono::duration<Rep, Period>& rel_time)
+ {
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost shared_lock has no mutex"));
+ }
+ if(owns_lock())
+ {
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost shared_lock owns already the mutex"));
+ }
+ is_locked=m->try_lock_shared_for(rel_time);
+ return is_locked;
+ }
+ template <class Clock, class Duration>
+ bool try_lock_until(const chrono::time_point<Clock, Duration>& abs_time)
+ {
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost shared_lock has no mutex"));
+ }
+ if(owns_lock())
+ {
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost shared_lock owns already the mutex"));
+ }
+ is_locked=m->try_lock_shared_until(abs_time);
+ return is_locked;
+ }
+#endif
void unlock()
{
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost shared_lock has no mutex"));
+ }
if(!owns_lock())
{
- boost::throw_exception(boost::lock_error());
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost shared_lock doesn't own the mutex"));
}
m->unlock_shared();
is_locked=false;
}
+#if defined(BOOST_NO_EXPLICIT_CONVERSION_OPERATORS)
typedef void (shared_lock<Mutex>::*bool_type)();
- operator bool_type() const
+ operator bool_type() const BOOST_NOEXCEPT
{
return is_locked?&shared_lock::lock:0;
}
- bool operator!() const
+ bool operator!() const BOOST_NOEXCEPT
{
return !owns_lock();
}
- bool owns_lock() const
+#else
+ explicit operator bool() const BOOST_NOEXCEPT
+ {
+ return owns_lock();
+ }
+#endif
+ bool owns_lock() const BOOST_NOEXCEPT
{
return is_locked;
}
};
-#ifdef BOOST_NO_RVALUE_REFERENCES
- template <typename Mutex>
- struct has_move_emulation_enabled_aux<shared_lock<Mutex> >
- : BOOST_MOVE_BOOST_NS::integral_constant<bool, true>
- {};
-#endif
-
+ BOOST_THREAD_DCL_MOVABLE_BEG(Mutex) shared_lock<Mutex> BOOST_THREAD_DCL_MOVABLE_END
-#ifndef BOOST_NO_RVALUE_REFERENCES
- template<typename Mutex>
- void swap(shared_lock<Mutex>&& lhs,shared_lock<Mutex>&& rhs)
- {
- lhs.swap(rhs);
- }
- template<typename Mutex>
- void swap(shared_lock<Mutex>& lhs,shared_lock<Mutex>& rhs)
- {
- lhs.swap(rhs);
- }
-#else
template<typename Mutex>
- void swap(shared_lock<Mutex>& lhs,shared_lock<Mutex>& rhs)
+ void swap(shared_lock<Mutex>& lhs,shared_lock<Mutex>& rhs) BOOST_NOEXCEPT
{
lhs.swap(rhs);
}
-#endif
template<typename Mutex>
class upgrade_lock
@@ -752,11 +917,12 @@ namespace boost
protected:
Mutex* m;
bool is_locked;
- private:
- explicit upgrade_lock(upgrade_lock&);
- upgrade_lock& operator=(upgrade_lock&);
+
public:
- upgrade_lock():
+ typedef Mutex mutex_type;
+ BOOST_THREAD_MOVABLE_ONLY(upgrade_lock)
+
+ upgrade_lock() BOOST_NOEXCEPT:
m(0),is_locked(false)
{}
@@ -768,7 +934,7 @@ namespace boost
upgrade_lock(Mutex& m_,adopt_lock_t):
m(&m_),is_locked(true)
{}
- upgrade_lock(Mutex& m_,defer_lock_t):
+ upgrade_lock(Mutex& m_,defer_lock_t) BOOST_NOEXCEPT:
m(&m_),is_locked(false)
{}
upgrade_lock(Mutex& m_,try_to_lock_t):
@@ -776,89 +942,128 @@ namespace boost
{
try_lock();
}
-#ifndef BOOST_NO_RVALUE_REFERENCES
- upgrade_lock(upgrade_lock<Mutex>&& other):
- m(other.m),is_locked(other.is_locked)
+
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Clock, class Duration>
+ upgrade_lock(Mutex& mtx, const chrono::time_point<Clock, Duration>& t)
+ : m(&mtx), is_locked(mtx.try_lock_upgrade_until(t))
{
- other.is_locked=false;
- other.m=0;
}
+ template <class Rep, class Period>
+ upgrade_lock(Mutex& mtx, const chrono::duration<Rep, Period>& d)
+ : m(&mtx), is_locked(mtx.try_lock_upgrade_for(d))
+ {
+ }
+#endif
- upgrade_lock(unique_lock<Mutex>&& other):
- m(other.m),is_locked(other.is_locked)
+ upgrade_lock(BOOST_THREAD_RV_REF_BEG upgrade_lock<Mutex> BOOST_THREAD_RV_REF_END other) BOOST_NOEXCEPT:
+ m(BOOST_THREAD_RV(other).m),is_locked(BOOST_THREAD_RV(other).is_locked)
+ {
+ BOOST_THREAD_RV(other).is_locked=false;
+ BOOST_THREAD_RV(other).m=0;
+ }
+
+ BOOST_THREAD_EXPLICIT_LOCK_CONVERSION upgrade_lock(BOOST_THREAD_RV_REF_BEG unique_lock<Mutex> BOOST_THREAD_RV_REF_END other):
+ m(BOOST_THREAD_RV(other).m),is_locked(BOOST_THREAD_RV(other).is_locked)
{
if(is_locked)
{
m->unlock_and_lock_upgrade();
}
- other.is_locked=false;
- other.m=0;
+ BOOST_THREAD_RV(other).is_locked=false;
+ BOOST_THREAD_RV(other).m=0;
}
- upgrade_lock& operator=(upgrade_lock<Mutex>&& other)
+ upgrade_lock& operator=(BOOST_THREAD_RV_REF_BEG upgrade_lock<Mutex> BOOST_THREAD_RV_REF_END other) BOOST_NOEXCEPT
{
- upgrade_lock temp(static_cast<upgrade_lock<Mutex>&&>(other));
+ upgrade_lock temp(::boost::move(other));
swap(temp);
return *this;
}
- upgrade_lock& operator=(unique_lock<Mutex>&& other)
+#ifndef BOOST_THREAD_PROVIDES_EXPLICIT_LOCK_CONVERSION
+ upgrade_lock& operator=(BOOST_THREAD_RV_REF_BEG unique_lock<Mutex> BOOST_THREAD_RV_REF_END other)
{
- upgrade_lock temp(static_cast<unique_lock<Mutex>&&>(other));
+ upgrade_lock temp(::boost::move(other));
swap(temp);
return *this;
}
-#else
- upgrade_lock(detail::thread_move_t<upgrade_lock<Mutex> > other):
- m(other->m),is_locked(other->is_locked)
- {
- other->is_locked=false;
- other->m=0;
- }
+#endif
- upgrade_lock(detail::thread_move_t<unique_lock<Mutex> > other):
- m(other->m),is_locked(other->is_locked)
+#ifdef BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
+ // Conversion from shared locking
+ upgrade_lock(BOOST_THREAD_RV_REF_BEG shared_lock<mutex_type> BOOST_THREAD_RV_REF_END sl, try_to_lock_t)
+ : m(0),is_locked(false)
{
- if(is_locked)
+ if (BOOST_THREAD_RV(sl).owns_lock()) {
+ if (BOOST_THREAD_RV(sl).mutex()->try_unlock_shared_and_lock_upgrade())
{
- m->unlock_and_lock_upgrade();
+ m = BOOST_THREAD_RV(sl).release();
+ is_locked = true;
}
- other->is_locked=false;
- other->m=0;
+ }
+ else
+ {
+ m = BOOST_THREAD_RV(sl).release();
+ }
}
- operator detail::thread_move_t<upgrade_lock<Mutex> >()
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Clock, class Duration>
+ upgrade_lock(BOOST_THREAD_RV_REF_BEG shared_lock<mutex_type> BOOST_THREAD_RV_REF_END sl,
+ const chrono::time_point<Clock, Duration>& abs_time)
+ : m(0),is_locked(false)
{
- return move();
+ if (BOOST_THREAD_RV(sl).owns_lock()) {
+ if (BOOST_THREAD_RV(sl).mutex()->try_unlock_shared_and_lock_upgrade_until(abs_time))
+ {
+ m = BOOST_THREAD_RV(sl).release();
+ is_locked = true;
+ }
+ }
+ else
+ {
+ m = BOOST_THREAD_RV(sl).release();
+ }
}
- detail::thread_move_t<upgrade_lock<Mutex> > move()
+ template <class Rep, class Period>
+ upgrade_lock(BOOST_THREAD_RV_REF_BEG shared_lock<mutex_type> BOOST_THREAD_RV_REF_END sl,
+ const chrono::duration<Rep, Period>& rel_time)
+ : m(0),is_locked(false)
{
- return detail::thread_move_t<upgrade_lock<Mutex> >(*this);
+ if (BOOST_THREAD_RV(sl).owns_lock()) {
+ if (BOOST_THREAD_RV(sl).mutex()->try_unlock_shared_and_lock_upgrade_for(rel_time))
+ {
+ m = BOOST_THREAD_RV(sl).release();
+ is_locked = true;
+ }
+ }
+ else
+ {
+ m = BOOST_THREAD_RV(sl).release();
+ }
}
+#endif // BOOST_THREAD_USES_CHRONO
+#endif // BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
-
- upgrade_lock& operator=(detail::thread_move_t<upgrade_lock<Mutex> > other)
+ void swap(upgrade_lock& other) BOOST_NOEXCEPT
{
- upgrade_lock temp(other);
- swap(temp);
- return *this;
+ std::swap(m,other.m);
+ std::swap(is_locked,other.is_locked);
}
-
- upgrade_lock& operator=(detail::thread_move_t<unique_lock<Mutex> > other)
+ Mutex* mutex() const BOOST_NOEXCEPT
{
- upgrade_lock temp(other);
- swap(temp);
- return *this;
+ return m;
}
-#endif
- void swap(upgrade_lock& other)
+ Mutex* release() BOOST_NOEXCEPT
{
- std::swap(m,other.m);
- std::swap(is_locked,other.is_locked);
+ Mutex* const res=m;
+ m=0;
+ is_locked=false;
+ return res;
}
-
~upgrade_lock()
{
if(owns_lock())
@@ -868,42 +1073,90 @@ namespace boost
}
void lock()
{
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost shared_lock has no mutex"));
+ }
if(owns_lock())
{
- boost::throw_exception(boost::lock_error());
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost upgrade_lock owns already the mutex"));
}
m->lock_upgrade();
is_locked=true;
}
bool try_lock()
{
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost shared_lock has no mutex"));
+ }
if(owns_lock())
{
- boost::throw_exception(boost::lock_error());
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost upgrade_lock owns already the mutex"));
}
is_locked=m->try_lock_upgrade();
return is_locked;
}
void unlock()
{
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost shared_lock has no mutex"));
+ }
if(!owns_lock())
{
- boost::throw_exception(boost::lock_error());
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost upgrade_lock doesn't own the mutex"));
}
m->unlock_upgrade();
is_locked=false;
}
-
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Rep, class Period>
+ bool try_lock_for(const chrono::duration<Rep, Period>& rel_time)
+ {
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost shared_lock has no mutex"));
+ }
+ if(owns_lock())
+ {
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost shared_lock owns already the mutex"));
+ }
+ is_locked=m->try_lock_upgrade_for(rel_time);
+ return is_locked;
+ }
+ template <class Clock, class Duration>
+ bool try_lock_until(const chrono::time_point<Clock, Duration>& abs_time)
+ {
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost shared_lock has no mutex"));
+ }
+ if(owns_lock())
+ {
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost shared_lock owns already the mutex"));
+ }
+ is_locked=m->try_lock_upgrade_until(abs_time);
+ return is_locked;
+ }
+#endif
+#if defined(BOOST_NO_EXPLICIT_CONVERSION_OPERATORS)
typedef void (upgrade_lock::*bool_type)();
- operator bool_type() const
+ operator bool_type() const BOOST_NOEXCEPT
{
return is_locked?&upgrade_lock::lock:0;
}
- bool operator!() const
+ bool operator!() const BOOST_NOEXCEPT
{
return !owns_lock();
}
- bool owns_lock() const
+#else
+ explicit operator bool() const BOOST_NOEXCEPT
+ {
+ return owns_lock();
+ }
+#endif
+ bool owns_lock() const BOOST_NOEXCEPT
{
return is_locked;
}
@@ -911,36 +1164,25 @@ namespace boost
friend class unique_lock<Mutex>;
};
-#ifdef BOOST_NO_RVALUE_REFERENCES
- template <typename Mutex>
- struct has_move_emulation_enabled_aux<upgrade_lock<Mutex> >
- : BOOST_MOVE_BOOST_NS::integral_constant<bool, true>
- {};
-#endif
-
-#ifndef BOOST_NO_RVALUE_REFERENCES
template<typename Mutex>
- unique_lock<Mutex>::unique_lock(upgrade_lock<Mutex>&& other):
- m(other.m),is_locked(other.is_locked)
+ void swap(upgrade_lock<Mutex>& lhs,upgrade_lock<Mutex>& rhs) BOOST_NOEXCEPT
{
- other.is_locked=false;
- if(is_locked)
- {
- m->unlock_upgrade_and_lock();
- }
+ lhs.swap(rhs);
}
-#else
+
+ BOOST_THREAD_DCL_MOVABLE_BEG(Mutex) upgrade_lock<Mutex> BOOST_THREAD_DCL_MOVABLE_END
+
template<typename Mutex>
- unique_lock<Mutex>::unique_lock(detail::thread_move_t<upgrade_lock<Mutex> > other):
- m(other->m),is_locked(other->is_locked)
+ unique_lock<Mutex>::unique_lock(BOOST_THREAD_RV_REF_BEG upgrade_lock<Mutex> BOOST_THREAD_RV_REF_END other):
+ m(BOOST_THREAD_RV(other).m),is_locked(BOOST_THREAD_RV(other).is_locked)
{
- other->is_locked=false;
if(is_locked)
{
m->unlock_upgrade_and_lock();
}
+ BOOST_THREAD_RV(other).release();
}
-#endif
+
template <class Mutex>
class upgrade_to_unique_lock
{
@@ -948,73 +1190,64 @@ namespace boost
upgrade_lock<Mutex>* source;
unique_lock<Mutex> exclusive;
- explicit upgrade_to_unique_lock(upgrade_to_unique_lock&);
- upgrade_to_unique_lock& operator=(upgrade_to_unique_lock&);
public:
+ typedef Mutex mutex_type;
+ BOOST_THREAD_MOVABLE_ONLY(upgrade_to_unique_lock)
+
explicit upgrade_to_unique_lock(upgrade_lock<Mutex>& m_):
- source(&m_),exclusive(move(*source))
+ source(&m_),exclusive(::boost::move(*source))
{}
~upgrade_to_unique_lock()
{
if(source)
{
- *source=move(exclusive);
+ *source=BOOST_THREAD_MAKE_RV_REF(upgrade_lock<Mutex>(::boost::move(exclusive)));
}
}
-#ifndef BOOST_NO_RVALUE_REFERENCES
- upgrade_to_unique_lock(upgrade_to_unique_lock<Mutex>&& other):
- source(other.source),exclusive(move(other.exclusive))
+ upgrade_to_unique_lock(BOOST_THREAD_RV_REF_BEG upgrade_to_unique_lock<Mutex> BOOST_THREAD_RV_REF_END other) BOOST_NOEXCEPT:
+ source(BOOST_THREAD_RV(other).source),exclusive(::boost::move(BOOST_THREAD_RV(other).exclusive))
{
- other.source=0;
+ BOOST_THREAD_RV(other).source=0;
}
- upgrade_to_unique_lock& operator=(upgrade_to_unique_lock<Mutex>&& other)
+ upgrade_to_unique_lock& operator=(BOOST_THREAD_RV_REF_BEG upgrade_to_unique_lock<Mutex> BOOST_THREAD_RV_REF_END other) BOOST_NOEXCEPT
{
upgrade_to_unique_lock temp(other);
swap(temp);
return *this;
}
-#else
- upgrade_to_unique_lock(detail::thread_move_t<upgrade_to_unique_lock<Mutex> > other):
- source(other->source),exclusive(move(other->exclusive))
- {
- other->source=0;
- }
- upgrade_to_unique_lock& operator=(detail::thread_move_t<upgrade_to_unique_lock<Mutex> > other)
- {
- upgrade_to_unique_lock temp(other);
- swap(temp);
- return *this;
- }
-#endif
- void swap(upgrade_to_unique_lock& other)
+ void swap(upgrade_to_unique_lock& other) BOOST_NOEXCEPT
{
std::swap(source,other.source);
exclusive.swap(other.exclusive);
}
+
+#if defined(BOOST_NO_EXPLICIT_CONVERSION_OPERATORS)
typedef void (upgrade_to_unique_lock::*bool_type)(upgrade_to_unique_lock&);
- operator bool_type() const
+ operator bool_type() const BOOST_NOEXCEPT
{
return exclusive.owns_lock()?&upgrade_to_unique_lock::swap:0;
}
- bool operator!() const
+ bool operator!() const BOOST_NOEXCEPT
{
return !owns_lock();
}
- bool owns_lock() const
+#else
+ explicit operator bool() const BOOST_NOEXCEPT
+ {
+ return owns_lock();
+ }
+#endif
+
+ bool owns_lock() const BOOST_NOEXCEPT
{
return exclusive.owns_lock();
}
};
-#ifdef BOOST_NO_RVALUE_REFERENCES
- template <typename Mutex>
- struct has_move_emulation_enabled_aux<upgrade_to_unique_lock<Mutex> >
- : BOOST_MOVE_BOOST_NS::integral_constant<bool, true>
- {};
-#endif
+ BOOST_THREAD_DCL_MOVABLE_BEG(Mutex) upgrade_to_unique_lock<Mutex> BOOST_THREAD_DCL_MOVABLE_END
namespace detail
{
@@ -1024,6 +1257,8 @@ namespace boost
{
typedef unique_lock<Mutex> base;
public:
+ BOOST_THREAD_MOVABLE_ONLY(try_lock_wrapper)
+
try_lock_wrapper()
{}
@@ -1041,53 +1276,26 @@ namespace boost
base(m_,try_to_lock)
{}
#ifndef BOOST_NO_RVALUE_REFERENCES
- try_lock_wrapper(try_lock_wrapper&& other):
- base(other.move())
+ try_lock_wrapper(BOOST_THREAD_RV_REF(try_lock_wrapper) other):
+ base(::boost::move(other))
{}
- try_lock_wrapper&& move()
- {
- return static_cast<try_lock_wrapper&&>(*this);
- }
-
- try_lock_wrapper& operator=(try_lock_wrapper<Mutex>&& other)
- {
- try_lock_wrapper temp(other.move());
- swap(temp);
- return *this;
- }
+#elif defined BOOST_THREAD_USES_MOVE
+ try_lock_wrapper(BOOST_THREAD_RV_REF(try_lock_wrapper) other):
+ base(::boost::move(static_cast<base&>(other)))
+ {}
- void swap(try_lock_wrapper&& other)
- {
- base::swap(other);
- }
#else
- try_lock_wrapper(detail::thread_move_t<try_lock_wrapper<Mutex> > other):
- base(detail::thread_move_t<base>(*other))
+ try_lock_wrapper(BOOST_THREAD_RV_REF(try_lock_wrapper) other):
+ base(BOOST_THREAD_RV_REF(base)(*other))
{}
-
- operator detail::thread_move_t<try_lock_wrapper<Mutex> >()
- {
- return move();
- }
-
- detail::thread_move_t<try_lock_wrapper<Mutex> > move()
- {
- return detail::thread_move_t<try_lock_wrapper<Mutex> >(*this);
- }
-
- try_lock_wrapper& operator=(detail::thread_move_t<try_lock_wrapper<Mutex> > other)
+#endif
+ try_lock_wrapper& operator=(BOOST_THREAD_RV_REF_BEG try_lock_wrapper<Mutex> BOOST_THREAD_RV_REF_END other)
{
try_lock_wrapper temp(other);
swap(temp);
return *this;
}
-
- void swap(detail::thread_move_t<try_lock_wrapper<Mutex> > other)
- {
- base::swap(*other);
- }
-#endif
void swap(try_lock_wrapper& other)
{
base::swap(other);
@@ -1116,36 +1324,30 @@ namespace boost
{
return base::release();
}
- bool operator!() const
- {
- return !this->owns_lock();
- }
+#if defined(BOOST_NO_EXPLICIT_CONVERSION_OPERATORS)
typedef typename base::bool_type bool_type;
operator bool_type() const
{
return base::operator bool_type();
}
+ bool operator!() const
+ {
+ return !this->owns_lock();
+ }
+#else
+ explicit operator bool() const
+ {
+ return owns_lock();
+ }
+#endif
};
-#ifndef BOOST_NO_RVALUE_REFERENCES
- template<typename Mutex>
- void swap(try_lock_wrapper<Mutex>&& lhs,try_lock_wrapper<Mutex>&& rhs)
- {
- lhs.swap(rhs);
- }
template<typename Mutex>
void swap(try_lock_wrapper<Mutex>& lhs,try_lock_wrapper<Mutex>& rhs)
{
lhs.swap(rhs);
}
-#else
- template<typename Mutex>
- void swap(try_lock_wrapper<Mutex>& lhs,try_lock_wrapper<Mutex>& rhs)
- {
- lhs.swap(rhs);
- }
-#endif
template<typename MutexType1,typename MutexType2>
unsigned try_lock_internal(MutexType1& m1,MutexType2& m2)
@@ -1620,7 +1822,6 @@ namespace boost
}
}
-
#include <boost/config/abi_suffix.hpp>
#endif
diff --git a/boost/thread/once.hpp b/boost/thread/once.hpp
index 975304e147..acd216edd6 100644
--- a/boost/thread/once.hpp
+++ b/boost/thread/once.hpp
@@ -3,7 +3,7 @@
// once.hpp
//
-// (C) Copyright 2006-7 Anthony Williams
+// (C) Copyright 2006-7 Anthony Williams
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
@@ -22,6 +22,8 @@
namespace boost
{
+ // template<class Callable, class ...Args> void
+ // call_once(once_flag& flag, Callable&& func, Args&&... args);
inline void call_once(void (*func)(),once_flag& flag)
{
call_once(flag,func);
diff --git a/boost/thread/pthread/condition_variable.hpp b/boost/thread/pthread/condition_variable.hpp
index 48ed8ff731..aa7100766e 100644
--- a/boost/thread/pthread/condition_variable.hpp
+++ b/boost/thread/pthread/condition_variable.hpp
@@ -4,11 +4,17 @@
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// (C) Copyright 2007-10 Anthony Williams
+// (C) Copyright 2011 Vicente J. Botet Escriba
#include <boost/thread/pthread/timespec.hpp>
#include <boost/thread/pthread/pthread_mutex_scoped_lock.hpp>
#include <boost/thread/pthread/thread_data.hpp>
#include <boost/thread/pthread/condition_variable_fwd.hpp>
+#ifdef BOOST_THREAD_USES_CHRONO
+#include <boost/chrono/system_clocks.hpp>
+#include <boost/chrono/ceil.hpp>
+#endif
+#include <boost/thread/detail/delete.hpp>
#include <boost/config/abi_prefix.hpp>
@@ -59,18 +65,22 @@ namespace boost
this_thread::interruption_point();
if(res)
{
- boost::throw_exception(condition_error());
+ boost::throw_exception(condition_error(res, "boost:: condition_variable constructor failed in pthread_cond_wait"));
}
}
- inline bool condition_variable::timed_wait(unique_lock<mutex>& m,boost::system_time const& wait_until)
+ inline bool condition_variable::do_timed_wait(
+ unique_lock<mutex>& m,
+ struct timespec const &timeout)
{
+ if (!m.owns_lock())
+ boost::throw_exception(condition_error(EPERM, "condition_variable do_timed_wait: mutex not locked"));
+
thread_cv_detail::lock_on_exit<unique_lock<mutex> > guard;
int cond_res;
{
detail::interruption_checker check_for_interruption(&internal_mutex,&cond);
guard.activate(m);
- struct timespec const timeout=detail::get_timespec(wait_until);
cond_res=pthread_cond_timedwait(&cond,&internal_mutex,&timeout);
}
this_thread::interruption_point();
@@ -80,18 +90,18 @@ namespace boost
}
if(cond_res)
{
- boost::throw_exception(condition_error());
+ boost::throw_exception(condition_error(cond_res, "condition_variable failed in pthread_cond_timedwait"));
}
return true;
}
- inline void condition_variable::notify_one()
+ inline void condition_variable::notify_one() BOOST_NOEXCEPT
{
boost::pthread::pthread_mutex_scoped_lock internal_lock(&internal_mutex);
BOOST_VERIFY(!pthread_cond_signal(&cond));
}
- inline void condition_variable::notify_all()
+ inline void condition_variable::notify_all() BOOST_NOEXCEPT
{
boost::pthread::pthread_mutex_scoped_lock internal_lock(&internal_mutex);
BOOST_VERIFY(!pthread_cond_broadcast(&cond));
@@ -102,22 +112,20 @@ namespace boost
pthread_mutex_t internal_mutex;
pthread_cond_t cond;
- condition_variable_any(condition_variable_any&);
- condition_variable_any& operator=(condition_variable_any&);
-
public:
+ BOOST_THREAD_NO_COPYABLE(condition_variable_any)
condition_variable_any()
{
int const res=pthread_mutex_init(&internal_mutex,NULL);
if(res)
{
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(res, "condition_variable_any failed in pthread_mutex_init"));
}
int const res2=pthread_cond_init(&cond,NULL);
if(res2)
{
BOOST_VERIFY(!pthread_mutex_destroy(&internal_mutex));
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(res, "condition_variable_any failed in pthread_cond_init"));
}
}
~condition_variable_any()
@@ -139,7 +147,7 @@ namespace boost
this_thread::interruption_point();
if(res)
{
- boost::throw_exception(condition_error());
+ boost::throw_exception(condition_error(res, "condition_variable_any failed in pthread_cond_wait"));
}
}
@@ -153,23 +161,7 @@ namespace boost
bool timed_wait(lock_type& m,boost::system_time const& wait_until)
{
struct timespec const timeout=detail::get_timespec(wait_until);
- int res=0;
- {
- thread_cv_detail::lock_on_exit<lock_type> guard;
- detail::interruption_checker check_for_interruption(&internal_mutex,&cond);
- guard.activate(m);
- res=pthread_cond_timedwait(&cond,&internal_mutex,&timeout);
- }
- this_thread::interruption_point();
- if(res==ETIMEDOUT)
- {
- return false;
- }
- if(res)
- {
- boost::throw_exception(condition_error());
- }
- return true;
+ return do_timed_wait(m, timeout);
}
template<typename lock_type>
bool timed_wait(lock_type& m,xtime const& wait_until)
@@ -206,17 +198,134 @@ namespace boost
return timed_wait(m,get_system_time()+wait_duration,pred);
}
- void notify_one()
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class lock_type,class Duration>
+ cv_status
+ wait_until(
+ lock_type& lock,
+ const chrono::time_point<chrono::system_clock, Duration>& t)
+ {
+ using namespace chrono;
+ typedef time_point<system_clock, nanoseconds> nano_sys_tmpt;
+ wait_until(lock,
+ nano_sys_tmpt(ceil<nanoseconds>(t.time_since_epoch())));
+ return system_clock::now() < t ? cv_status::no_timeout :
+ cv_status::timeout;
+ }
+
+ template <class lock_type, class Clock, class Duration>
+ cv_status
+ wait_until(
+ lock_type& lock,
+ const chrono::time_point<Clock, Duration>& t)
+ {
+ using namespace chrono;
+ system_clock::time_point s_now = system_clock::now();
+ typename Clock::time_point c_now = Clock::now();
+ wait_until(lock, s_now + ceil<nanoseconds>(t - c_now));
+ return Clock::now() < t ? cv_status::no_timeout : cv_status::timeout;
+ }
+
+ template <class lock_type, class Clock, class Duration, class Predicate>
+ bool
+ wait_until(
+ lock_type& lock,
+ const chrono::time_point<Clock, Duration>& t,
+ Predicate pred)
+ {
+ while (!pred())
+ {
+ if (wait_until(lock, t) == cv_status::timeout)
+ return pred();
+ }
+ return true;
+ }
+
+
+ template <class lock_type, class Rep, class Period>
+ cv_status
+ wait_for(
+ lock_type& lock,
+ const chrono::duration<Rep, Period>& d)
+ {
+ using namespace chrono;
+ system_clock::time_point s_now = system_clock::now();
+ steady_clock::time_point c_now = steady_clock::now();
+ wait_until(lock, s_now + ceil<nanoseconds>(d));
+ return steady_clock::now() - c_now < d ? cv_status::no_timeout :
+ cv_status::timeout;
+
+ }
+
+
+ template <class lock_type, class Rep, class Period, class Predicate>
+ bool
+ wait_for(
+ lock_type& lock,
+ const chrono::duration<Rep, Period>& d,
+ Predicate pred)
+ {
+ while (!pred())
+ {
+ if (wait_for(lock, d) == cv_status::timeout)
+ return pred();
+ }
+ return true;
+ }
+
+ template <class lock_type>
+ inline void wait_until(
+ lock_type& lk,
+ chrono::time_point<chrono::system_clock, chrono::nanoseconds> tp)
+ {
+ using namespace chrono;
+ nanoseconds d = tp.time_since_epoch();
+ timespec ts;
+ seconds s = duration_cast<seconds>(d);
+ ts.tv_sec = static_cast<long>(s.count());
+ ts.tv_nsec = static_cast<long>((d - s).count());
+ do_timed_wait(lk, ts);
+ }
+#endif
+
+ void notify_one() BOOST_NOEXCEPT
{
boost::pthread::pthread_mutex_scoped_lock internal_lock(&internal_mutex);
BOOST_VERIFY(!pthread_cond_signal(&cond));
}
- void notify_all()
+ void notify_all() BOOST_NOEXCEPT
{
boost::pthread::pthread_mutex_scoped_lock internal_lock(&internal_mutex);
BOOST_VERIFY(!pthread_cond_broadcast(&cond));
}
+ private: // used by boost::thread::try_join_until
+
+ template <class lock_type>
+ inline bool do_timed_wait(
+ lock_type& m,
+ struct timespec const &timeout)
+ {
+ int res=0;
+ {
+ thread_cv_detail::lock_on_exit<lock_type> guard;
+ detail::interruption_checker check_for_interruption(&internal_mutex,&cond);
+ guard.activate(m);
+ res=pthread_cond_timedwait(&cond,&internal_mutex,&timeout);
+ }
+ this_thread::interruption_point();
+ if(res==ETIMEDOUT)
+ {
+ return false;
+ }
+ if(res)
+ {
+ boost::throw_exception(condition_error(res, "condition_variable_any failed in pthread_cond_timedwait"));
+ }
+ return true;
+ }
+
+
};
}
diff --git a/boost/thread/pthread/condition_variable_fwd.hpp b/boost/thread/pthread/condition_variable_fwd.hpp
index f56bee4789..4f4bd881d9 100644
--- a/boost/thread/pthread/condition_variable_fwd.hpp
+++ b/boost/thread/pthread/condition_variable_fwd.hpp
@@ -4,41 +4,47 @@
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// (C) Copyright 2007-8 Anthony Williams
+// (C) Copyright 2011 Vicente J. Botet Escriba
#include <boost/assert.hpp>
#include <boost/throw_exception.hpp>
#include <pthread.h>
+#include <boost/thread/cv_status.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/locks.hpp>
#include <boost/thread/thread_time.hpp>
#include <boost/thread/xtime.hpp>
-
+#ifdef BOOST_THREAD_USES_CHRONO
+#include <boost/chrono/system_clocks.hpp>
+#include <boost/chrono/ceil.hpp>
+#endif
+#include <boost/thread/detail/delete.hpp>
+#include <boost/date_time/posix_time/posix_time_duration.hpp>
#include <boost/config/abi_prefix.hpp>
namespace boost
{
+
class condition_variable
{
private:
pthread_mutex_t internal_mutex;
pthread_cond_t cond;
- condition_variable(condition_variable&);
- condition_variable& operator=(condition_variable&);
-
public:
+ BOOST_THREAD_NO_COPYABLE(condition_variable)
condition_variable()
{
int const res=pthread_mutex_init(&internal_mutex,NULL);
if(res)
{
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(res, "boost:: condition_variable constructor failed in pthread_mutex_init"));
}
int const res2=pthread_cond_init(&cond,NULL);
if(res2)
{
BOOST_VERIFY(!pthread_mutex_destroy(&internal_mutex));
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(res2, "boost:: condition_variable constructor failed in pthread_cond_init"));
}
}
~condition_variable()
@@ -59,21 +65,38 @@ namespace boost
while(!pred()) wait(m);
}
- inline bool timed_wait(unique_lock<mutex>& m,
- boost::system_time const& wait_until);
- bool timed_wait(unique_lock<mutex>& m,xtime const& wait_until)
+
+ inline bool timed_wait(
+ unique_lock<mutex>& m,
+ boost::system_time const& wait_until)
+ {
+#if defined BOOST_THREAD_WAIT_BUG
+ struct timespec const timeout=detail::get_timespec(wait_until + BOOST_THREAD_WAIT_BUG);
+ return do_timed_wait(m, timeout);
+#else
+ struct timespec const timeout=detail::get_timespec(wait_until);
+ return do_timed_wait(m, timeout);
+#endif
+ }
+ bool timed_wait(
+ unique_lock<mutex>& m,
+ xtime const& wait_until)
{
return timed_wait(m,system_time(wait_until));
}
template<typename duration_type>
- bool timed_wait(unique_lock<mutex>& m,duration_type const& wait_duration)
+ bool timed_wait(
+ unique_lock<mutex>& m,
+ duration_type const& wait_duration)
{
return timed_wait(m,get_system_time()+wait_duration);
}
template<typename predicate_type>
- bool timed_wait(unique_lock<mutex>& m,boost::system_time const& wait_until,predicate_type pred)
+ bool timed_wait(
+ unique_lock<mutex>& m,
+ boost::system_time const& wait_until,predicate_type pred)
{
while (!pred())
{
@@ -84,25 +107,127 @@ namespace boost
}
template<typename predicate_type>
- bool timed_wait(unique_lock<mutex>& m,xtime const& wait_until,predicate_type pred)
+ bool timed_wait(
+ unique_lock<mutex>& m,
+ xtime const& wait_until,predicate_type pred)
{
return timed_wait(m,system_time(wait_until),pred);
}
template<typename duration_type,typename predicate_type>
- bool timed_wait(unique_lock<mutex>& m,duration_type const& wait_duration,predicate_type pred)
+ bool timed_wait(
+ unique_lock<mutex>& m,
+ duration_type const& wait_duration,predicate_type pred)
{
return timed_wait(m,get_system_time()+wait_duration,pred);
}
+#ifdef BOOST_THREAD_USES_CHRONO
+
+ template <class Duration>
+ cv_status
+ wait_until(
+ unique_lock<mutex>& lock,
+ const chrono::time_point<chrono::system_clock, Duration>& t)
+ {
+ using namespace chrono;
+ typedef time_point<system_clock, nanoseconds> nano_sys_tmpt;
+ wait_until(lock,
+ nano_sys_tmpt(ceil<nanoseconds>(t.time_since_epoch())));
+ return system_clock::now() < t ? cv_status::no_timeout :
+ cv_status::timeout;
+ }
+
+ template <class Clock, class Duration>
+ cv_status
+ wait_until(
+ unique_lock<mutex>& lock,
+ const chrono::time_point<Clock, Duration>& t)
+ {
+ using namespace chrono;
+ system_clock::time_point s_now = system_clock::now();
+ typename Clock::time_point c_now = Clock::now();
+ wait_until(lock, s_now + ceil<nanoseconds>(t - c_now));
+ return Clock::now() < t ? cv_status::no_timeout : cv_status::timeout;
+ }
+
+ template <class Clock, class Duration, class Predicate>
+ bool
+ wait_until(
+ unique_lock<mutex>& lock,
+ const chrono::time_point<Clock, Duration>& t,
+ Predicate pred)
+ {
+ while (!pred())
+ {
+ if (wait_until(lock, t) == cv_status::timeout)
+ return pred();
+ }
+ return true;
+ }
+
+
+ template <class Rep, class Period>
+ cv_status
+ wait_for(
+ unique_lock<mutex>& lock,
+ const chrono::duration<Rep, Period>& d)
+ {
+ using namespace chrono;
+ system_clock::time_point s_now = system_clock::now();
+ steady_clock::time_point c_now = steady_clock::now();
+ wait_until(lock, s_now + ceil<nanoseconds>(d));
+ return steady_clock::now() - c_now < d ? cv_status::no_timeout :
+ cv_status::timeout;
+
+ }
+
+
+ template <class Rep, class Period, class Predicate>
+ bool
+ wait_for(
+ unique_lock<mutex>& lock,
+ const chrono::duration<Rep, Period>& d,
+ Predicate pred)
+ {
+ while (!pred())
+ {
+ if (wait_for(lock, d) == cv_status::timeout)
+ return pred();
+ }
+ return true;
+ }
+#endif
+
+#define BOOST_THREAD_DEFINES_CONDITION_VARIABLE_NATIVE_HANDLE
typedef pthread_cond_t* native_handle_type;
native_handle_type native_handle()
{
return &cond;
}
- void notify_one();
- void notify_all();
+ void notify_one() BOOST_NOEXCEPT;
+ void notify_all() BOOST_NOEXCEPT;
+
+#ifdef BOOST_THREAD_USES_CHRONO
+ inline void wait_until(
+ unique_lock<mutex>& lk,
+ chrono::time_point<chrono::system_clock, chrono::nanoseconds> tp)
+ {
+ using namespace chrono;
+ nanoseconds d = tp.time_since_epoch();
+ timespec ts;
+ seconds s = duration_cast<seconds>(d);
+ ts.tv_sec = static_cast<long>(s.count());
+ ts.tv_nsec = static_cast<long>((d - s).count());
+ do_timed_wait(lk, ts);
+ }
+#endif
+ //private: // used by boost::thread::try_join_until
+
+ inline bool do_timed_wait(
+ unique_lock<mutex>& lock,
+ struct timespec const &timeout);
};
}
diff --git a/boost/thread/pthread/mutex.hpp b/boost/thread/pthread/mutex.hpp
index fc7c9cdfad..2c5af92b8a 100644
--- a/boost/thread/pthread/mutex.hpp
+++ b/boost/thread/pthread/mutex.hpp
@@ -1,12 +1,12 @@
#ifndef BOOST_THREAD_PTHREAD_MUTEX_HPP
#define BOOST_THREAD_PTHREAD_MUTEX_HPP
// (C) Copyright 2007-8 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include <pthread.h>
-#include <boost/utility.hpp>
#include <boost/throw_exception.hpp>
#include <boost/thread/exceptions.hpp>
#include <boost/thread/locks.hpp>
@@ -16,6 +16,11 @@
#include <errno.h>
#include <boost/thread/pthread/timespec.hpp>
#include <boost/thread/pthread/pthread_mutex_scoped_lock.hpp>
+#ifdef BOOST_THREAD_USES_CHRONO
+#include <boost/chrono/system_clocks.hpp>
+#include <boost/chrono/ceil.hpp>
+#endif
+#include <boost/thread/detail/delete.hpp>
#ifdef _POSIX_TIMEOUTS
#if _POSIX_TIMEOUTS >= 0 && _POSIX_C_SOURCE>=200112L
@@ -30,16 +35,16 @@ namespace boost
class mutex
{
private:
- mutex(mutex const&);
- mutex& operator=(mutex const&);
pthread_mutex_t m;
public:
+ BOOST_THREAD_NO_COPYABLE(mutex)
+
mutex()
{
int const res=pthread_mutex_init(&m,NULL);
if(res)
{
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(res, "boost:: mutex constructor failed in pthread_mutex_init"));
}
}
~mutex()
@@ -58,9 +63,9 @@ namespace boost
{
res = pthread_mutex_lock(&m);
} while (res == EINTR);
- if(res)
+ if (res)
{
- boost::throw_exception(lock_error(res));
+ boost::throw_exception(lock_error(res,"boost: mutex lock failed in pthread_mutex_lock"));
}
}
@@ -83,12 +88,17 @@ namespace boost
} while (res == EINTR);
if(res && (res!=EBUSY))
{
- boost::throw_exception(lock_error(res));
+ // The following throw_exception has been replaced by an assertion and just return false,
+ // as this is an internal error and the user can do nothing with the exception.
+ //boost::throw_exception(lock_error(res,"boost: mutex try_lock failed in pthread_mutex_trylock"));
+ BOOST_ASSERT_MSG(false ,"boost: mutex try_lock failed in pthread_mutex_trylock");
+ return false;
}
return !res;
}
+#define BOOST_THREAD_DEFINES_MUTEX_NATIVE_HANDLE
typedef pthread_mutex_t* native_handle_type;
native_handle_type native_handle()
{
@@ -104,28 +114,26 @@ namespace boost
class timed_mutex
{
private:
- timed_mutex(timed_mutex const&);
- timed_mutex& operator=(timed_mutex const&);
- private:
pthread_mutex_t m;
#ifndef BOOST_PTHREAD_HAS_TIMEDLOCK
pthread_cond_t cond;
bool is_locked;
#endif
public:
+ BOOST_THREAD_NO_COPYABLE(timed_mutex)
timed_mutex()
{
int const res=pthread_mutex_init(&m,NULL);
if(res)
{
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(res, "boost:: timed_mutex constructor failed in pthread_mutex_init"));
}
#ifndef BOOST_PTHREAD_HAS_TIMEDLOCK
int const res2=pthread_cond_init(&cond,NULL);
if(res2)
{
BOOST_VERIFY(!pthread_mutex_destroy(&m));
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(res2, "boost:: timed_mutex constructor failed in pthread_cond_init"));
}
is_locked=false;
#endif
@@ -165,19 +173,16 @@ namespace boost
BOOST_ASSERT(!res || res==EBUSY);
return !res;
}
- bool timed_lock(system_time const & abs_time)
- {
- struct timespec const timeout=detail::get_timespec(abs_time);
- int const res=pthread_mutex_timedlock(&m,&timeout);
- BOOST_ASSERT(!res || res==ETIMEDOUT);
- return !res;
- }
- typedef pthread_mutex_t* native_handle_type;
- native_handle_type native_handle()
+
+ private:
+ bool do_try_lock_until(struct timespec const &timeout)
{
- return &m;
+ int const res=pthread_mutex_timedlock(&m,&timeout);
+ BOOST_ASSERT(!res || res==ETIMEDOUT);
+ return !res;
}
+ public:
#else
void lock()
@@ -208,9 +213,9 @@ namespace boost
return true;
}
- bool timed_lock(system_time const & abs_time)
+ private:
+ bool do_try_lock_until(struct timespec const &timeout)
{
- struct timespec const timeout=detail::get_timespec(abs_time);
boost::pthread::pthread_mutex_scoped_lock const local_lock(&m);
while(is_locked)
{
@@ -224,8 +229,55 @@ namespace boost
is_locked=true;
return true;
}
+ public:
+#endif
+
+ bool timed_lock(system_time const & abs_time)
+ {
+ struct timespec const ts=detail::get_timespec(abs_time);
+ return do_try_lock_until(ts);
+ }
+
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Rep, class Period>
+ bool try_lock_for(const chrono::duration<Rep, Period>& rel_time)
+ {
+ return try_lock_until(chrono::steady_clock::now() + rel_time);
+ }
+ template <class Clock, class Duration>
+ bool try_lock_until(const chrono::time_point<Clock, Duration>& t)
+ {
+ using namespace chrono;
+ system_clock::time_point s_now = system_clock::now();
+ typename Clock::time_point c_now = Clock::now();
+ return try_lock_until(s_now + ceil<nanoseconds>(t - c_now));
+ }
+ template <class Duration>
+ bool try_lock_until(const chrono::time_point<chrono::system_clock, Duration>& t)
+ {
+ using namespace chrono;
+ typedef time_point<system_clock, nanoseconds> nano_sys_tmpt;
+ return try_lock_until(nano_sys_tmpt(ceil<nanoseconds>(t.time_since_epoch())));
+ }
+ bool try_lock_until(const chrono::time_point<chrono::system_clock, chrono::nanoseconds>& tp)
+ {
+ using namespace chrono;
+ nanoseconds d = tp.time_since_epoch();
+ timespec ts;
+ seconds s = duration_cast<seconds>(d);
+ ts.tv_sec = static_cast<long>(s.count());
+ ts.tv_nsec = static_cast<long>((d - s).count());
+ return do_try_lock_until(ts);
+ }
#endif
+#define BOOST_THREAD_DEFINES_TIMED_MUTEX_NATIVE_HANDLE
+ typedef pthread_mutex_t* native_handle_type;
+ native_handle_type native_handle()
+ {
+ return &m;
+ }
+
typedef unique_lock<timed_mutex> scoped_timed_lock;
typedef detail::try_lock_wrapper<timed_mutex> scoped_try_lock;
typedef scoped_timed_lock scoped_lock;
diff --git a/boost/thread/pthread/once.hpp b/boost/thread/pthread/once.hpp
index 81e744e645..80aa09ee12 100644
--- a/boost/thread/pthread/once.hpp
+++ b/boost/thread/pthread/once.hpp
@@ -4,29 +4,52 @@
// once.hpp
//
// (C) Copyright 2007-8 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include <boost/thread/detail/config.hpp>
-#include <boost/config.hpp>
#include <pthread.h>
#include <boost/assert.hpp>
#include <boost/thread/pthread/pthread_mutex_scoped_lock.hpp>
#include <boost/cstdint.hpp>
+#include <boost/thread/detail/delete.hpp>
#include <boost/config/abi_prefix.hpp>
namespace boost
{
+#define BOOST_ONCE_INITIAL_FLAG_VALUE 0
+
+#ifdef BOOST_THREAD_PROVIDES_ONCE_CXX11
+
+ struct once_flag
+ {
+ BOOST_THREAD_NO_COPYABLE(once_flag)
+ BOOST_CONSTEXPR once_flag() BOOST_NOEXCEPT
+ : epoch(BOOST_ONCE_INITIAL_FLAG_VALUE)
+ {}
+ private:
+ boost::uintmax_t epoch;
+ template<typename Function>
+ friend
+ void call_once(once_flag& flag,Function f);
+ };
+
+#else // BOOST_THREAD_PROVIDES_ONCE_CXX11
+
struct once_flag
{
boost::uintmax_t epoch;
};
+#define BOOST_ONCE_INIT {BOOST_ONCE_INITIAL_FLAG_VALUE}
+#endif // BOOST_THREAD_PROVIDES_ONCE_CXX11
+
namespace detail
{
BOOST_THREAD_DECL boost::uintmax_t& get_once_per_thread_epoch();
@@ -35,10 +58,6 @@ namespace boost
BOOST_THREAD_DECL extern pthread_cond_t once_epoch_cv;
}
-#define BOOST_ONCE_INITIAL_FLAG_VALUE 0
-#define BOOST_ONCE_INIT {BOOST_ONCE_INITIAL_FLAG_VALUE}
-
-
// Based on Mike Burrows fast_pthread_once algorithm as described in
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2444.html
template<typename Function>
@@ -59,18 +78,18 @@ namespace boost
{
flag.epoch=being_initialized;
#ifndef BOOST_NO_EXCEPTIONS
- try
+ try // BOOST_NO_EXCEPTIONS protected
{
#endif
pthread::pthread_mutex_scoped_unlock relocker(&detail::once_epoch_mutex);
f();
#ifndef BOOST_NO_EXCEPTIONS
}
- catch(...)
+ catch(...) // BOOST_NO_EXCEPTIONS protected
{
flag.epoch=uninitialized_flag;
BOOST_VERIFY(!pthread_cond_broadcast(&detail::once_epoch_cv));
- throw;
+ throw; // BOOST_NO_EXCEPTIONS protected
}
#endif
flag.epoch=--detail::once_global_epoch;
diff --git a/boost/thread/pthread/recursive_mutex.hpp b/boost/thread/pthread/recursive_mutex.hpp
index 113a0ac15e..22acf41fa2 100644
--- a/boost/thread/pthread/recursive_mutex.hpp
+++ b/boost/thread/pthread/recursive_mutex.hpp
@@ -1,12 +1,12 @@
#ifndef BOOST_THREAD_PTHREAD_RECURSIVE_MUTEX_HPP
#define BOOST_THREAD_PTHREAD_RECURSIVE_MUTEX_HPP
// (C) Copyright 2007-8 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include <pthread.h>
-#include <boost/utility.hpp>
#include <boost/throw_exception.hpp>
#include <boost/thread/exceptions.hpp>
#include <boost/thread/locks.hpp>
@@ -19,6 +19,11 @@
#include <errno.h>
#include <boost/thread/pthread/timespec.hpp>
#include <boost/thread/pthread/pthread_mutex_scoped_lock.hpp>
+#ifdef BOOST_THREAD_USES_CHRONO
+#include <boost/chrono/system_clocks.hpp>
+#include <boost/chrono/ceil.hpp>
+#endif
+#include <boost/thread/detail/delete.hpp>
#ifdef _POSIX_TIMEOUTS
#if _POSIX_TIMEOUTS >= 0
@@ -37,8 +42,6 @@ namespace boost
class recursive_mutex
{
private:
- recursive_mutex(recursive_mutex const&);
- recursive_mutex& operator=(recursive_mutex const&);
pthread_mutex_t m;
#ifndef BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
pthread_cond_t cond;
@@ -47,6 +50,7 @@ namespace boost
unsigned count;
#endif
public:
+ BOOST_THREAD_NO_COPYABLE(recursive_mutex)
recursive_mutex()
{
#ifdef BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
@@ -55,33 +59,33 @@ namespace boost
int const init_attr_res=pthread_mutexattr_init(&attr);
if(init_attr_res)
{
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(init_attr_res, "boost:: recursive_mutex constructor failed in pthread_mutexattr_init"));
}
int const set_attr_res=pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE);
if(set_attr_res)
{
BOOST_VERIFY(!pthread_mutexattr_destroy(&attr));
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(set_attr_res, "boost:: recursive_mutex constructor failed in pthread_mutexattr_settype"));
}
int const res=pthread_mutex_init(&m,&attr);
if(res)
{
BOOST_VERIFY(!pthread_mutexattr_destroy(&attr));
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(res, "boost:: recursive_mutex constructor failed in pthread_mutex_init"));
}
BOOST_VERIFY(!pthread_mutexattr_destroy(&attr));
#else
int const res=pthread_mutex_init(&m,NULL);
if(res)
{
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(res, "boost:: recursive_mutex constructor failed in pthread_mutex_init"));
}
int const res2=pthread_cond_init(&cond,NULL);
if(res2)
{
BOOST_VERIFY(!pthread_mutex_destroy(&m));
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(res2, "boost:: recursive_mutex constructor failed in pthread_cond_init"));
}
is_locked=false;
count=0;
@@ -112,6 +116,7 @@ namespace boost
BOOST_ASSERT(!res || res==EBUSY);
return !res;
}
+#define BOOST_THREAD_DEFINES_RECURSIVE_MUTEX_NATIVE_HANDLE
typedef pthread_mutex_t* native_handle_type;
native_handle_type native_handle()
{
@@ -171,9 +176,6 @@ namespace boost
class recursive_timed_mutex
{
private:
- recursive_timed_mutex(recursive_timed_mutex const&);
- recursive_timed_mutex& operator=(recursive_timed_mutex const&);
- private:
pthread_mutex_t m;
#ifndef BOOST_USE_PTHREAD_RECURSIVE_TIMEDLOCK
pthread_cond_t cond;
@@ -182,6 +184,7 @@ namespace boost
unsigned count;
#endif
public:
+ BOOST_THREAD_NO_COPYABLE(recursive_timed_mutex)
recursive_timed_mutex()
{
#ifdef BOOST_USE_PTHREAD_RECURSIVE_TIMEDLOCK
@@ -190,32 +193,32 @@ namespace boost
int const init_attr_res=pthread_mutexattr_init(&attr);
if(init_attr_res)
{
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(init_attr_res, "boost:: recursive_timed_mutex constructor failed in pthread_mutexattr_init"));
}
int const set_attr_res=pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE);
if(set_attr_res)
{
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(set_attr_res, "boost:: recursive_timed_mutex constructor failed in pthread_mutexattr_settype"));
}
int const res=pthread_mutex_init(&m,&attr);
if(res)
{
BOOST_VERIFY(!pthread_mutexattr_destroy(&attr));
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(res, "boost:: recursive_timed_mutex constructor failed in pthread_mutex_init"));
}
BOOST_VERIFY(!pthread_mutexattr_destroy(&attr));
#else
int const res=pthread_mutex_init(&m,NULL);
if(res)
{
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(res, "boost:: recursive_timed_mutex constructor failed in pthread_mutex_init"));
}
int const res2=pthread_cond_init(&cond,NULL);
if(res2)
{
BOOST_VERIFY(!pthread_mutex_destroy(&m));
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(res2, "boost:: recursive_timed_mutex constructor failed in pthread_cond_init"));
}
is_locked=false;
count=0;
@@ -252,19 +255,15 @@ namespace boost
BOOST_ASSERT(!res || res==EBUSY);
return !res;
}
- bool timed_lock(system_time const & abs_time)
+ private:
+ bool do_try_lock_until(struct timespec const &timeout)
{
- struct timespec const timeout=detail::get_timespec(abs_time);
int const res=pthread_mutex_timedlock(&m,&timeout);
BOOST_ASSERT(!res || res==ETIMEDOUT);
return !res;
}
- typedef pthread_mutex_t* native_handle_type;
- native_handle_type native_handle()
- {
- return &m;
- }
+ public:
#else
void lock()
@@ -308,9 +307,9 @@ namespace boost
return true;
}
- bool timed_lock(system_time const & abs_time)
+ private:
+ bool do_try_lock_until(struct timespec const &timeout)
{
- struct timespec const timeout=detail::get_timespec(abs_time);
boost::pthread::pthread_mutex_scoped_lock const local_lock(&m);
if(is_locked && pthread_equal(owner,pthread_self()))
{
@@ -331,8 +330,56 @@ namespace boost
owner=pthread_self();
return true;
}
+ public:
+
+#endif
+
+ bool timed_lock(system_time const & abs_time)
+ {
+ struct timespec const ts=detail::get_timespec(abs_time);
+ return do_try_lock_until(ts);
+ }
+
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Rep, class Period>
+ bool try_lock_for(const chrono::duration<Rep, Period>& rel_time)
+ {
+ return try_lock_until(chrono::steady_clock::now() + rel_time);
+ }
+ template <class Clock, class Duration>
+ bool try_lock_until(const chrono::time_point<Clock, Duration>& t)
+ {
+ using namespace chrono;
+ system_clock::time_point s_now = system_clock::now();
+ typename Clock::time_point c_now = Clock::now();
+ return try_lock_until(s_now + ceil<nanoseconds>(t - c_now));
+ }
+ template <class Duration>
+ bool try_lock_until(const chrono::time_point<chrono::system_clock, Duration>& t)
+ {
+ using namespace chrono;
+ typedef time_point<system_clock, nanoseconds> nano_sys_tmpt;
+ return try_lock_until(nano_sys_tmpt(ceil<nanoseconds>(t.time_since_epoch())));
+ }
+ bool try_lock_until(const chrono::time_point<chrono::system_clock, chrono::nanoseconds>& tp)
+ {
+ using namespace chrono;
+ nanoseconds d = tp.time_since_epoch();
+ timespec ts;
+ seconds s = duration_cast<seconds>(d);
+ ts.tv_sec = static_cast<long>(s.count());
+ ts.tv_nsec = static_cast<long>((d - s).count());
+ return do_try_lock_until(ts);
+ }
#endif
+#define BOOST_THREAD_DEFINES_RECURSIVE_TIMED_MUTEX_NATIVE_HANDLE
+ typedef pthread_mutex_t* native_handle_type;
+ native_handle_type native_handle()
+ {
+ return &m;
+ }
+
typedef unique_lock<recursive_timed_mutex> scoped_timed_lock;
typedef detail::try_lock_wrapper<recursive_timed_mutex> scoped_try_lock;
typedef scoped_timed_lock scoped_lock;
diff --git a/boost/thread/pthread/shared_mutex.hpp b/boost/thread/pthread/shared_mutex.hpp
index 56e209acf3..cf45188606 100644
--- a/boost/thread/pthread/shared_mutex.hpp
+++ b/boost/thread/pthread/shared_mutex.hpp
@@ -2,6 +2,7 @@
#define BOOST_THREAD_PTHREAD_SHARED_MUTEX_HPP
// (C) Copyright 2006-8 Anthony Williams
+// (C) Copyright 2012 Vicente J. Botet Escriba
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
@@ -12,6 +13,11 @@
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition_variable.hpp>
#include <boost/thread/detail/thread_interruption.hpp>
+#ifdef BOOST_THREAD_USES_CHRONO
+#include <boost/chrono/system_clocks.hpp>
+#include <boost/chrono/ceil.hpp>
+#endif
+#include <boost/thread/detail/delete.hpp>
#include <boost/config/abi_prefix.hpp>
@@ -42,8 +48,9 @@ namespace boost
shared_cond.notify_all();
}
-
public:
+ BOOST_THREAD_NO_COPYABLE(shared_mutex)
+
shared_mutex()
{
state_data state_={0,0,0,0};
@@ -102,7 +109,29 @@ namespace boost
{
return timed_lock_shared(get_system_time()+relative_time);
}
-
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Rep, class Period>
+ bool try_lock_shared_for(const chrono::duration<Rep, Period>& rel_time)
+ {
+ return try_lock_shared_until(chrono::steady_clock::now() + rel_time);
+ }
+ template <class Clock, class Duration>
+ bool try_lock_shared_until(const chrono::time_point<Clock, Duration>& abs_time)
+ {
+ boost::this_thread::disable_interruption do_not_disturb;
+ boost::mutex::scoped_lock lk(state_change);
+
+ while(state.exclusive || state.exclusive_waiting_blocked)
+ {
+ if(cv_status::timeout==shared_cond.wait_until(lk,abs_time))
+ {
+ return false;
+ }
+ }
+ ++state.shared_count;
+ return true;
+ }
+#endif
void unlock_shared()
{
boost::mutex::scoped_lock lk(state_change);
@@ -166,6 +195,37 @@ namespace boost
return timed_lock(get_system_time()+relative_time);
}
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Rep, class Period>
+ bool try_lock_for(const chrono::duration<Rep, Period>& rel_time)
+ {
+ return try_lock_until(chrono::steady_clock::now() + rel_time);
+ }
+ template <class Clock, class Duration>
+ bool try_lock_until(const chrono::time_point<Clock, Duration>& abs_time)
+ {
+ boost::this_thread::disable_interruption do_not_disturb;
+ boost::mutex::scoped_lock lk(state_change);
+
+ while(state.shared_count || state.exclusive)
+ {
+ state.exclusive_waiting_blocked=true;
+ if(cv_status::timeout == exclusive_cond.wait_until(lk,abs_time))
+ {
+ if(state.shared_count || state.exclusive)
+ {
+ state.exclusive_waiting_blocked=false;
+ release_waiters();
+ return false;
+ }
+ break;
+ }
+ }
+ state.exclusive=true;
+ return true;
+ }
+#endif
+
bool try_lock()
{
boost::mutex::scoped_lock lk(state_change);
@@ -228,6 +288,33 @@ namespace boost
return timed_lock_upgrade(get_system_time()+relative_time);
}
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Rep, class Period>
+ bool try_lock_upgrade_for(const chrono::duration<Rep, Period>& rel_time)
+ {
+ return try_lock_upgrade_until(chrono::steady_clock::now() + rel_time);
+ }
+ template <class Clock, class Duration>
+ bool try_lock_upgrade_until(const chrono::time_point<Clock, Duration>& abs_time)
+ {
+ boost::this_thread::disable_interruption do_not_disturb;
+ boost::mutex::scoped_lock lk(state_change);
+ while(state.exclusive || state.exclusive_waiting_blocked || state.upgrade)
+ {
+ if(cv_status::timeout == shared_cond.wait_until(lk,abs_time))
+ {
+ if(state.exclusive || state.exclusive_waiting_blocked || state.upgrade)
+ {
+ return false;
+ }
+ break;
+ }
+ }
+ ++state.shared_count;
+ state.upgrade=true;
+ return true;
+ }
+#endif
bool try_lock_upgrade()
{
boost::mutex::scoped_lock lk(state_change);
@@ -253,9 +340,12 @@ namespace boost
{
state.exclusive_waiting_blocked=false;
release_waiters();
+ } else {
+ shared_cond.notify_all();
}
}
+ // Upgrade <-> Exclusive
void unlock_upgrade_and_lock()
{
boost::this_thread::disable_interruption do_not_disturb;
@@ -279,6 +369,57 @@ namespace boost
release_waiters();
}
+ bool try_unlock_upgrade_and_lock()
+ {
+ boost::mutex::scoped_lock lk(state_change);
+ if( !state.exclusive
+ && !state.exclusive_waiting_blocked
+ && state.upgrade
+ && state.shared_count==1)
+ {
+ state.shared_count=0;
+ state.exclusive=true;
+ state.upgrade=false;
+ return true;
+ }
+ return false;
+ }
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Rep, class Period>
+ bool
+ try_unlock_upgrade_and_lock_for(
+ const chrono::duration<Rep, Period>& rel_time)
+ {
+ return try_unlock_upgrade_and_lock_until(
+ chrono::steady_clock::now() + rel_time);
+ }
+ template <class Clock, class Duration>
+ bool
+ try_unlock_upgrade_and_lock_until(
+ const chrono::time_point<Clock, Duration>& abs_time)
+ {
+ boost::this_thread::disable_interruption do_not_disturb;
+ boost::mutex::scoped_lock lk(state_change);
+ if (state.shared_count != 1)
+ {
+ for (;;)
+ {
+ cv_status status = shared_cond.wait_until(lk,abs_time);
+ if (state.shared_count == 1)
+ break;
+ if(status == cv_status::timeout)
+ return false;
+ }
+ }
+ state.upgrade=false;
+ state.exclusive=true;
+ state.exclusive_waiting_blocked=false;
+ state.shared_count=0;
+ return true;
+ }
+#endif
+
+ // Shared <-> Exclusive
void unlock_and_lock_shared()
{
boost::mutex::scoped_lock lk(state_change);
@@ -288,6 +429,58 @@ namespace boost
release_waiters();
}
+#ifdef BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
+ bool try_unlock_shared_and_lock()
+ {
+ boost::mutex::scoped_lock lk(state_change);
+ if( !state.exclusive
+ && !state.exclusive_waiting_blocked
+ && !state.upgrade
+ && state.shared_count==1)
+ {
+ state.shared_count=0;
+ state.exclusive=true;
+ return true;
+ }
+ return false;
+ }
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Rep, class Period>
+ bool
+ try_unlock_shared_and_lock_for(
+ const chrono::duration<Rep, Period>& rel_time)
+ {
+ return try_unlock_shared_and_lock_until(
+ chrono::steady_clock::now() + rel_time);
+ }
+ template <class Clock, class Duration>
+ bool
+ try_unlock_shared_and_lock_until(
+ const chrono::time_point<Clock, Duration>& abs_time)
+ {
+ boost::this_thread::disable_interruption do_not_disturb;
+ boost::mutex::scoped_lock lk(state_change);
+ if (state.shared_count != 1)
+ {
+ for (;;)
+ {
+ cv_status status = shared_cond.wait_until(lk,abs_time);
+ if (state.shared_count == 1)
+ break;
+ if(status == cv_status::timeout)
+ return false;
+ }
+ }
+ state.upgrade=false;
+ state.exclusive=true;
+ state.exclusive_waiting_blocked=false;
+ state.shared_count=0;
+ return true;
+ }
+#endif
+#endif
+
+ // Shared <-> Upgrade
void unlock_upgrade_and_lock_shared()
{
boost::mutex::scoped_lock lk(state_change);
@@ -295,7 +488,62 @@ namespace boost
state.exclusive_waiting_blocked=false;
release_waiters();
}
+
+#ifdef BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
+ bool try_unlock_shared_and_lock_upgrade()
+ {
+ boost::mutex::scoped_lock lk(state_change);
+ if( !state.exclusive
+ && !state.exclusive_waiting_blocked
+ && !state.upgrade
+ )
+ {
+ state.upgrade=true;
+ return true;
+ }
+ return false;
+ }
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Rep, class Period>
+ bool
+ try_unlock_shared_and_lock_upgrade_for(
+ const chrono::duration<Rep, Period>& rel_time)
+ {
+ return try_unlock_shared_and_lock_upgrade_until(
+ chrono::steady_clock::now() + rel_time);
+ }
+ template <class Clock, class Duration>
+ bool
+ try_unlock_shared_and_lock_upgrade_until(
+ const chrono::time_point<Clock, Duration>& abs_time)
+ {
+ boost::this_thread::disable_interruption do_not_disturb;
+ boost::mutex::scoped_lock lk(state_change);
+ if( state.exclusive
+ || state.exclusive_waiting_blocked
+ || state.upgrade
+ )
+ {
+ for (;;)
+ {
+ cv_status status = exclusive_cond.wait_until(lk,abs_time);
+ if( ! state.exclusive
+ && ! state.exclusive_waiting_blocked
+ && ! state.upgrade
+ )
+ break;
+ if(status == cv_status::timeout)
+ return false;
+ }
+ }
+ state.upgrade=true;
+ return true;
+ }
+#endif
+#endif
};
+
+ typedef shared_mutex upgrade_mutex;
}
#include <boost/config/abi_suffix.hpp>
diff --git a/boost/thread/pthread/thread_data.hpp b/boost/thread/pthread/thread_data.hpp
index 3de9b41b17..5f84799f85 100644
--- a/boost/thread/pthread/thread_data.hpp
+++ b/boost/thread/pthread/thread_data.hpp
@@ -4,6 +4,7 @@
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// (C) Copyright 2007 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
#include <boost/thread/detail/config.hpp>
#include <boost/thread/exceptions.hpp>
@@ -15,11 +16,56 @@
#include <boost/assert.hpp>
#include <boost/thread/pthread/condition_variable_fwd.hpp>
#include <map>
-
+#include <unistd.h>
+#ifdef BOOST_THREAD_USES_CHRONO
+#include <boost/chrono/system_clocks.hpp>
+#endif
#include <boost/config/abi_prefix.hpp>
namespace boost
{
+ class thread_attributes {
+ public:
+ thread_attributes() BOOST_NOEXCEPT {
+ int res = pthread_attr_init(&val_);
+ BOOST_VERIFY(!res && "pthread_attr_init failed");
+ }
+ ~thread_attributes() {
+ int res = pthread_attr_destroy(&val_);
+ BOOST_VERIFY(!res && "pthread_attr_destroy failed");
+ }
+ // stack
+ void set_stack_size(std::size_t size) BOOST_NOEXCEPT {
+ if (size==0) return;
+ std::size_t page_size = getpagesize();
+#ifdef PTHREAD_STACK_MIN
+ if (size<PTHREAD_STACK_MIN) size=PTHREAD_STACK_MIN;
+#endif
+ size = ((size+page_size-1)/page_size)*page_size;
+ int res = pthread_attr_setstacksize(&val_, size);
+ BOOST_VERIFY(!res && "pthread_attr_setstacksize failed");
+ }
+
+ std::size_t get_stack_size() const BOOST_NOEXCEPT {
+ std::size_t size;
+ int res = pthread_attr_getstacksize(&val_, &size);
+ BOOST_VERIFY(!res && "pthread_attr_getstacksize failed");
+ return size;
+ }
+#define BOOST_THREAD_DEFINES_THREAD_ATTRIBUTES_NATIVE_HANDLE
+
+ typedef pthread_attr_t native_handle_type;
+ native_handle_type* native_handle() BOOST_NOEXCEPT {
+ return &val_;
+ }
+ const native_handle_type* native_handle() const BOOST_NOEXCEPT {
+ return &val_;
+ }
+
+ private:
+ pthread_attr_t val_;
+ };
+
class thread;
namespace detail
@@ -83,11 +129,13 @@ namespace boost
void check_for_interruption()
{
+#ifndef BOOST_NO_EXCEPTIONS
if(thread_info->interrupt_requested)
{
thread_info->interrupt_requested=false;
- throw thread_interrupted();
+ throw thread_interrupted(); // BOOST_NO_EXCEPTIONS protected
}
+#endif
}
void operator=(interruption_checker&);
@@ -128,7 +176,10 @@ namespace boost
namespace this_thread
{
- void BOOST_THREAD_DECL yield();
+#ifdef BOOST_THREAD_USES_CHRONO
+ void BOOST_SYMBOL_VISIBLE sleep_for(const chrono::nanoseconds& ns);
+#endif
+ void BOOST_THREAD_DECL yield() BOOST_NOEXCEPT;
#ifdef __DECXXX
/// Workaround of DECCXX issue of incorrect template substitution
diff --git a/boost/thread/reverse_lock.hpp b/boost/thread/reverse_lock.hpp
new file mode 100644
index 0000000000..c196cde072
--- /dev/null
+++ b/boost/thread/reverse_lock.hpp
@@ -0,0 +1,58 @@
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// (C) Copyright 2012 Vicente J. Botet Escriba
+
+#ifndef BOOST_THREAD_REVERSE_LOCK_HPP
+#define BOOST_THREAD_REVERSE_LOCK_HPP
+#include <boost/thread/detail/config.hpp>
+#include <boost/thread/locks.hpp>
+#include <boost/thread/detail/delete.hpp>
+
+namespace boost
+{
+
+ template<typename Lock>
+ class reverse_lock
+ {
+
+ public:
+ typedef typename Lock::mutex_type mutex_type;
+ BOOST_THREAD_NO_COPYABLE(reverse_lock)
+
+ explicit reverse_lock(Lock& m_)
+ : m(m_), mtx(0)
+ {
+ if (m.owns_lock())
+ {
+ m.unlock();
+ }
+ mtx=m.release();
+ }
+ ~reverse_lock()
+ {
+ if (mtx) {
+ mtx->lock();
+ m = BOOST_THREAD_MAKE_RV_REF(Lock(*mtx, adopt_lock));
+ }
+ }
+
+ private:
+ Lock& m;
+ mutex_type* mtx;
+ };
+
+
+#ifdef BOOST_THREAD_NO_AUTO_DETECT_MUTEX_TYPES
+ template<typename T>
+ struct is_mutex_type<reverse_lock<T> >
+ {
+ BOOST_STATIC_CONSTANT(bool, value = true);
+ };
+
+#endif
+
+
+}
+
+#endif // header
diff --git a/boost/thread/shared_lock_guard.hpp b/boost/thread/shared_lock_guard.hpp
new file mode 100644
index 0000000000..8a2f2c54d1
--- /dev/null
+++ b/boost/thread/shared_lock_guard.hpp
@@ -0,0 +1,52 @@
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// (C) Copyright 2012 Vicente J. Botet Escriba
+
+#ifndef BOOST_THREAD_SHARED_LOCK_GUARD_HPP
+#define BOOST_THREAD_SHARED_LOCK_GUARD_HPP
+#include <boost/thread/detail/config.hpp>
+#include <boost/thread/locks.hpp>
+#include <boost/thread/detail/delete.hpp>
+
+namespace boost
+{
+
+ template<typename SharedMutex>
+ class shared_lock_guard
+ {
+ private:
+ SharedMutex& m;
+
+ public:
+ typedef SharedMutex mutex_type;
+ BOOST_THREAD_NO_COPYABLE(shared_lock_guard)
+ explicit shared_lock_guard(SharedMutex& m_):
+ m(m_)
+ {
+ m.lock_shared();
+ }
+ shared_lock_guard(SharedMutex& m_,adopt_lock_t):
+ m(m_)
+ {}
+ ~shared_lock_guard()
+ {
+ m.unlock_shared();
+ }
+ };
+
+#ifdef BOOST_THREAD_NO_AUTO_DETECT_MUTEX_TYPES
+
+ template<typename T>
+ struct is_mutex_type<shared_lock_guard<T> >
+ {
+ BOOST_STATIC_CONSTANT(bool, value = true);
+ };
+
+
+#endif
+
+
+}
+
+#endif // header
diff --git a/boost/thread/shared_mutex.hpp b/boost/thread/shared_mutex.hpp
index 51eda0de0b..e85e269d44 100644
--- a/boost/thread/shared_mutex.hpp
+++ b/boost/thread/shared_mutex.hpp
@@ -3,15 +3,20 @@
// shared_mutex.hpp
//
-// (C) Copyright 2007 Anthony Williams
+// (C) Copyright 2007 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-#include <boost/thread/detail/platform.hpp>
+#include <boost/thread/detail/config.hpp>
#if defined(BOOST_THREAD_PLATFORM_WIN32)
+#if defined(BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN)
+#include <boost/thread/pthread/shared_mutex.hpp>
+#else
#include <boost/thread/win32/shared_mutex.hpp>
+#endif
#elif defined(BOOST_THREAD_PLATFORM_PTHREAD)
#include <boost/thread/pthread/shared_mutex.hpp>
#else
diff --git a/boost/thread/thread.hpp b/boost/thread/thread.hpp
index fdfdadcc3e..ee15c6e365 100644
--- a/boost/thread/thread.hpp
+++ b/boost/thread/thread.hpp
@@ -3,7 +3,7 @@
// thread.hpp
//
-// (C) Copyright 2007-8 Anthony Williams
+// (C) Copyright 2007-8 Anthony Williams
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
@@ -22,6 +22,7 @@
#include <boost/thread/detail/thread.hpp>
#include <boost/thread/detail/thread_interruption.hpp>
#include <boost/thread/detail/thread_group.hpp>
+#include <boost/thread/v2/thread.hpp>
#endif
diff --git a/boost/thread/v2/thread.hpp b/boost/thread/v2/thread.hpp
new file mode 100644
index 0000000000..d686c5fe9b
--- /dev/null
+++ b/boost/thread/v2/thread.hpp
@@ -0,0 +1,56 @@
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// (C) Copyright 2011 Vicente J. Botet Escriba
+
+#ifndef BOOST_THREAD_V2_THREAD_HPP
+#define BOOST_THREAD_V2_THREAD_HPP
+
+#include <boost/thread/detail/config.hpp>
+#ifdef BOOST_THREAD_USES_CHRONO
+#include <boost/chrono/system_clocks.hpp>
+#endif
+#include <boost/thread/condition_variable.hpp>
+#include <boost/thread/locks.hpp>
+
+namespace boost
+{
+ namespace this_thread
+ {
+
+#ifdef BOOST_THREAD_USES_CHRONO
+
+ template <class Rep, class Period>
+ void sleep_for(const chrono::duration<Rep, Period>& d)
+ {
+ using namespace chrono;
+ nanoseconds ns = duration_cast<nanoseconds> (d);
+ if (ns < d) ++ns;
+ sleep_for(ns);
+ }
+
+ template <class Clock, class Duration>
+ void sleep_until(const chrono::time_point<Clock, Duration>& t)
+ {
+ using namespace chrono;
+ mutex mut;
+ condition_variable cv;
+ unique_lock<mutex> lk(mut);
+ while (Clock::now() < t)
+ cv.wait_until(lk, t);
+ }
+
+ template <class Duration>
+ inline BOOST_SYMBOL_VISIBLE
+ void sleep_until(const chrono::time_point<chrono::steady_clock, Duration>& t)
+ {
+ using namespace chrono;
+ sleep_for(t - steady_clock::now());
+ }
+
+#endif
+ }
+}
+
+
+#endif
diff --git a/boost/thread/win32/basic_recursive_mutex.hpp b/boost/thread/win32/basic_recursive_mutex.hpp
index e748aa725c..eb5ec8489d 100644
--- a/boost/thread/win32/basic_recursive_mutex.hpp
+++ b/boost/thread/win32/basic_recursive_mutex.hpp
@@ -4,6 +4,7 @@
// basic_recursive_mutex.hpp
//
// (C) Copyright 2006-8 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
@@ -11,6 +12,10 @@
#include <boost/thread/win32/thread_primitives.hpp>
#include <boost/thread/win32/basic_timed_mutex.hpp>
+#ifdef BOOST_THREAD_USES_CHRONO
+#include <boost/chrono/system_clocks.hpp>
+#include <boost/chrono/ceil.hpp>
+#endif
#include <boost/config/abi_prefix.hpp>
@@ -64,6 +69,20 @@ namespace boost
return timed_lock(get_system_time()+timeout);
}
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Rep, class Period>
+ bool try_lock_for(const chrono::duration<Rep, Period>& rel_time)
+ {
+ long const current_thread_id=win32::GetCurrentThreadId();
+ return try_recursive_lock(current_thread_id) || try_timed_lock_for(current_thread_id,rel_time);
+ }
+ template <class Clock, class Duration>
+ bool try_lock_until(const chrono::time_point<Clock, Duration>& t)
+ {
+ long const current_thread_id=win32::GetCurrentThreadId();
+ return try_recursive_lock(current_thread_id) || try_timed_lock_until(current_thread_id,t);
+ }
+#endif
void unlock()
{
if(!--recursion_count)
@@ -105,7 +124,28 @@ namespace boost
}
return false;
}
-
+ template <typename TP>
+ bool try_timed_lock_until(long current_thread_id,TP const& target)
+ {
+ if(mutex.try_lock_until(target))
+ {
+ BOOST_INTERLOCKED_EXCHANGE(&locking_thread_id,current_thread_id);
+ recursion_count=1;
+ return true;
+ }
+ return false;
+ }
+ template <typename D>
+ bool try_timed_lock_for(long current_thread_id,D const& target)
+ {
+ if(mutex.try_lock_for(target))
+ {
+ BOOST_INTERLOCKED_EXCHANGE(&locking_thread_id,current_thread_id);
+ recursion_count=1;
+ return true;
+ }
+ return false;
+ }
};
typedef basic_recursive_mutex_impl<basic_timed_mutex> basic_recursive_mutex;
diff --git a/boost/thread/win32/basic_timed_mutex.hpp b/boost/thread/win32/basic_timed_mutex.hpp
index a88c2a0f6f..30580e7c17 100644
--- a/boost/thread/win32/basic_timed_mutex.hpp
+++ b/boost/thread/win32/basic_timed_mutex.hpp
@@ -4,6 +4,7 @@
// basic_timed_mutex_win32.hpp
//
// (C) Copyright 2006-8 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
@@ -15,7 +16,10 @@
#include <boost/thread/thread_time.hpp>
#include <boost/thread/xtime.hpp>
#include <boost/detail/interlocked.hpp>
-
+#ifdef BOOST_THREAD_USES_CHRONO
+#include <boost/chrono/system_clocks.hpp>
+#include <boost/chrono/ceil.hpp>
+#endif
#include <boost/config/abi_prefix.hpp>
namespace boost
@@ -143,6 +147,7 @@ namespace boost
return true;
}
+
template<typename Duration>
bool timed_lock(Duration const& timeout)
{
@@ -154,6 +159,59 @@ namespace boost
return timed_lock(system_time(timeout));
}
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Rep, class Period>
+ bool try_lock_for(const chrono::duration<Rep, Period>& rel_time)
+ {
+ return try_lock_until(chrono::steady_clock::now() + rel_time);
+ }
+ template <class Clock, class Duration>
+ bool try_lock_until(const chrono::time_point<Clock, Duration>& t)
+ {
+ using namespace chrono;
+ system_clock::time_point s_now = system_clock::now();
+ typename Clock::time_point c_now = Clock::now();
+ return try_lock_until(s_now + ceil<system_clock::duration>(t - c_now));
+ }
+ template <class Duration>
+ bool try_lock_until(const chrono::time_point<chrono::system_clock, Duration>& t)
+ {
+ using namespace chrono;
+ typedef time_point<chrono::system_clock, chrono::system_clock::duration> sys_tmpt;
+ return try_lock_until(sys_tmpt(chrono::ceil<chrono::system_clock::duration>(t.time_since_epoch())));
+ }
+ bool try_lock_until(const chrono::time_point<chrono::system_clock, chrono::system_clock::duration>& tp)
+ {
+ if(try_lock())
+ {
+ return true;
+ }
+ long old_count=active_count;
+ mark_waiting_and_try_lock(old_count);
+
+ if(old_count&lock_flag_value)
+ {
+ bool lock_acquired=false;
+ void* const sem=get_event();
+
+ do
+ {
+ chrono::milliseconds rel_time= chrono::ceil<chrono::milliseconds>(tp-chrono::system_clock::now());
+
+ if(win32::WaitForSingleObject(sem,static_cast<unsigned long>(rel_time.count()))!=0)
+ {
+ BOOST_INTERLOCKED_DECREMENT(&active_count);
+ return false;
+ }
+ clear_waiting_and_try_lock(old_count);
+ lock_acquired=!(old_count&lock_flag_value);
+ }
+ while(!lock_acquired);
+ }
+ return true;
+ }
+#endif
+
void unlock()
{
long const offset=lock_flag_value;
diff --git a/boost/thread/win32/condition_variable.hpp b/boost/thread/win32/condition_variable.hpp
index 056bda8086..63f830b186 100644
--- a/boost/thread/win32/condition_variable.hpp
+++ b/boost/thread/win32/condition_variable.hpp
@@ -4,18 +4,24 @@
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// (C) Copyright 2007-8 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
#include <boost/thread/mutex.hpp>
#include <boost/thread/win32/thread_primitives.hpp>
#include <limits.h>
#include <boost/assert.hpp>
#include <algorithm>
-#include <boost/thread/thread.hpp>
+#include <boost/thread/cv_status.hpp>
+#include <boost/thread/win32/thread_data.hpp>
#include <boost/thread/thread_time.hpp>
#include <boost/thread/win32/interlocked_read.hpp>
#include <boost/thread/xtime.hpp>
#include <vector>
#include <boost/intrusive_ptr.hpp>
+#ifdef BOOST_THREAD_USES_CHRONO
+#include <boost/chrono/system_clocks.hpp>
+#include <boost/chrono/ceil.hpp>
+#endif
#include <boost/config/abi_prefix.hpp>
@@ -36,10 +42,8 @@ namespace boost
bool notified;
long references;
- basic_cv_list_entry(basic_cv_list_entry&);
- void operator=(basic_cv_list_entry&);
-
public:
+ BOOST_THREAD_NO_COPYABLE(basic_cv_list_entry)
explicit basic_cv_list_entry(detail::win32::handle_manager const& wake_sem_):
semaphore(detail::win32::create_anonymous_semaphore(0,LONG_MAX)),
wake_sem(wake_sem_.duplicate()),
@@ -77,9 +81,9 @@ namespace boost
return notified;
}
- bool wait(timeout wait_until)
+ bool wait(timeout abs_time)
{
- return this_thread::interruptible_wait(semaphore,wait_until);
+ return this_thread::interruptible_wait(semaphore,abs_time);
}
bool woken()
@@ -129,6 +133,7 @@ namespace boost
template<typename lock_type>
struct relocker
{
+ BOOST_THREAD_NO_COPYABLE(relocker)
lock_type& lock;
bool unlocked;
@@ -148,9 +153,6 @@ namespace boost
}
}
- private:
- relocker(relocker&);
- void operator=(relocker&);
};
@@ -182,6 +184,7 @@ namespace boost
{
entry_ptr const entry;
+ BOOST_THREAD_NO_COPYABLE(entry_manager)
entry_manager(entry_ptr const& entry_):
entry(entry_)
{}
@@ -195,16 +198,12 @@ namespace boost
{
return entry.get();
}
-
- private:
- void operator=(entry_manager&);
- entry_manager(entry_manager&);
};
protected:
template<typename lock_type>
- bool do_wait(lock_type& lock,timeout wait_until)
+ bool do_wait(lock_type& lock,timeout abs_time)
{
relocker<lock_type> locker(lock);
@@ -215,7 +214,7 @@ namespace boost
bool woken=false;
while(!woken)
{
- if(!entry->wait(wait_until))
+ if(!entry->wait(abs_time))
{
return false;
}
@@ -226,11 +225,11 @@ namespace boost
}
template<typename lock_type,typename predicate_type>
- bool do_wait(lock_type& m,timeout const& wait_until,predicate_type pred)
+ bool do_wait(lock_type& m,timeout const& abs_time,predicate_type pred)
{
while (!pred())
{
- if(!do_wait(m, wait_until))
+ if(!do_wait(m, abs_time))
return pred();
}
return true;
@@ -247,7 +246,7 @@ namespace boost
~basic_condition_variable()
{}
- void notify_one()
+ void notify_one() BOOST_NOEXCEPT
{
if(detail::interlocked_read_acquire(&total_count))
{
@@ -268,7 +267,7 @@ namespace boost
}
}
- void notify_all()
+ void notify_all() BOOST_NOEXCEPT
{
if(detail::interlocked_read_acquire(&total_count))
{
@@ -295,10 +294,8 @@ namespace boost
class condition_variable:
private detail::basic_condition_variable
{
- private:
- condition_variable(condition_variable&);
- void operator=(condition_variable&);
public:
+ BOOST_THREAD_NO_COPYABLE(condition_variable)
condition_variable()
{}
@@ -317,14 +314,14 @@ namespace boost
}
- bool timed_wait(unique_lock<mutex>& m,boost::system_time const& wait_until)
+ bool timed_wait(unique_lock<mutex>& m,boost::system_time const& abs_time)
{
- return do_wait(m,wait_until);
+ return do_wait(m,abs_time);
}
- bool timed_wait(unique_lock<mutex>& m,boost::xtime const& wait_until)
+ bool timed_wait(unique_lock<mutex>& m,boost::xtime const& abs_time)
{
- return do_wait(m,system_time(wait_until));
+ return do_wait(m,system_time(abs_time));
}
template<typename duration_type>
bool timed_wait(unique_lock<mutex>& m,duration_type const& wait_duration)
@@ -333,29 +330,79 @@ namespace boost
}
template<typename predicate_type>
- bool timed_wait(unique_lock<mutex>& m,boost::system_time const& wait_until,predicate_type pred)
+ bool timed_wait(unique_lock<mutex>& m,boost::system_time const& abs_time,predicate_type pred)
{
- return do_wait(m,wait_until,pred);
+ return do_wait(m,abs_time,pred);
}
template<typename predicate_type>
- bool timed_wait(unique_lock<mutex>& m,boost::xtime const& wait_until,predicate_type pred)
+ bool timed_wait(unique_lock<mutex>& m,boost::xtime const& abs_time,predicate_type pred)
{
- return do_wait(m,system_time(wait_until),pred);
+ return do_wait(m,system_time(abs_time),pred);
}
template<typename duration_type,typename predicate_type>
bool timed_wait(unique_lock<mutex>& m,duration_type const& wait_duration,predicate_type pred)
{
return do_wait(m,wait_duration.total_milliseconds(),pred);
}
+
+#ifdef BOOST_THREAD_USES_CHRONO
+
+ template <class Clock, class Duration>
+ cv_status
+ wait_until(
+ unique_lock<mutex>& lock,
+ const chrono::time_point<Clock, Duration>& t)
+ {
+ using namespace chrono;
+ do_wait(lock, ceil<milliseconds>(t-Clock::now()).count());
+ return Clock::now() < t ? cv_status::no_timeout :
+ cv_status::timeout;
+ }
+
+ template <class Rep, class Period>
+ cv_status
+ wait_for(
+ unique_lock<mutex>& lock,
+ const chrono::duration<Rep, Period>& d)
+ {
+ using namespace chrono;
+ steady_clock::time_point c_now = steady_clock::now();
+ do_wait(lock, ceil<milliseconds>(d).count());
+ return steady_clock::now() - c_now < d ? cv_status::no_timeout :
+ cv_status::timeout;
+ }
+
+ template <class Clock, class Duration, class Predicate>
+ bool
+ wait_until(
+ unique_lock<mutex>& lock,
+ const chrono::time_point<Clock, Duration>& t,
+ Predicate pred)
+ {
+ while (!pred())
+ {
+ if (wait_until(lock, t) == cv_status::timeout)
+ return pred();
+ }
+ return true;
+ }
+ template <class Rep, class Period, class Predicate>
+ bool
+ wait_for(
+ unique_lock<mutex>& lock,
+ const chrono::duration<Rep, Period>& d,
+ Predicate pred)
+ {
+ return wait_until(lock, chrono::steady_clock::now() + d, pred);
+ }
+#endif
};
class condition_variable_any:
private detail::basic_condition_variable
{
- private:
- condition_variable_any(condition_variable_any&);
- void operator=(condition_variable_any&);
public:
+ BOOST_THREAD_NO_COPYABLE(condition_variable_any)
condition_variable_any()
{}
@@ -375,15 +422,15 @@ namespace boost
}
template<typename lock_type>
- bool timed_wait(lock_type& m,boost::system_time const& wait_until)
+ bool timed_wait(lock_type& m,boost::system_time const& abs_time)
{
- return do_wait(m,wait_until);
+ return do_wait(m,abs_time);
}
template<typename lock_type>
- bool timed_wait(lock_type& m,boost::xtime const& wait_until)
+ bool timed_wait(lock_type& m,boost::xtime const& abs_time)
{
- return do_wait(m,system_time(wait_until));
+ return do_wait(m,system_time(abs_time));
}
template<typename lock_type,typename duration_type>
@@ -393,15 +440,15 @@ namespace boost
}
template<typename lock_type,typename predicate_type>
- bool timed_wait(lock_type& m,boost::system_time const& wait_until,predicate_type pred)
+ bool timed_wait(lock_type& m,boost::system_time const& abs_time,predicate_type pred)
{
- return do_wait(m,wait_until,pred);
+ return do_wait(m,abs_time,pred);
}
template<typename lock_type,typename predicate_type>
- bool timed_wait(lock_type& m,boost::xtime const& wait_until,predicate_type pred)
+ bool timed_wait(lock_type& m,boost::xtime const& abs_time,predicate_type pred)
{
- return do_wait(m,system_time(wait_until),pred);
+ return do_wait(m,system_time(abs_time),pred);
}
template<typename lock_type,typename duration_type,typename predicate_type>
@@ -409,6 +456,58 @@ namespace boost
{
return do_wait(m,wait_duration.total_milliseconds(),pred);
}
+#ifdef BOOST_THREAD_USES_CHRONO
+
+ template <class lock_type, class Clock, class Duration>
+ cv_status
+ wait_until(
+ lock_type& lock,
+ const chrono::time_point<Clock, Duration>& t)
+ {
+ using namespace chrono;
+ do_wait(lock, ceil<milliseconds>(t-Clock::now()).count());
+ return Clock::now() < t ? cv_status::no_timeout :
+ cv_status::timeout;
+ }
+
+ template <class lock_type, class Rep, class Period>
+ cv_status
+ wait_for(
+ lock_type& lock,
+ const chrono::duration<Rep, Period>& d)
+ {
+ using namespace chrono;
+ steady_clock::time_point c_now = steady_clock::now();
+ do_wait(lock, ceil<milliseconds>(d).count());
+ return steady_clock::now() - c_now < d ? cv_status::no_timeout :
+ cv_status::timeout;
+ }
+
+ template <class lock_type, class Clock, class Duration, class Predicate>
+ bool
+ wait_until(
+ lock_type& lock,
+ const chrono::time_point<Clock, Duration>& t,
+ Predicate pred)
+ {
+ while (!pred())
+ {
+ if (wait_until(lock, t) == cv_status::timeout)
+ return pred();
+ }
+ return true;
+ }
+
+ template <class lock_type, class Rep, class Period, class Predicate>
+ bool
+ wait_for(
+ lock_type& lock,
+ const chrono::duration<Rep, Period>& d,
+ Predicate pred)
+ {
+ return wait_until(lock, chrono::steady_clock::now() + d, pred);
+ }
+#endif
};
}
diff --git a/boost/thread/win32/mutex.hpp b/boost/thread/win32/mutex.hpp
index 92b2669e49..85a00e29f9 100644
--- a/boost/thread/win32/mutex.hpp
+++ b/boost/thread/win32/mutex.hpp
@@ -1,12 +1,12 @@
#ifndef BOOST_THREAD_WIN32_MUTEX_HPP
#define BOOST_THREAD_WIN32_MUTEX_HPP
// (C) Copyright 2005-7 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include <boost/thread/win32/basic_timed_mutex.hpp>
-#include <boost/utility.hpp>
#include <boost/thread/exceptions.hpp>
#include <boost/thread/locks.hpp>
@@ -22,10 +22,8 @@ namespace boost
class mutex:
public ::boost::detail::underlying_mutex
{
- private:
- mutex(mutex const&);
- mutex& operator=(mutex const&);
public:
+ BOOST_THREAD_NO_COPYABLE(mutex)
mutex()
{
initialize();
@@ -44,10 +42,8 @@ namespace boost
class timed_mutex:
public ::boost::detail::basic_timed_mutex
{
- private:
- timed_mutex(timed_mutex const&);
- timed_mutex& operator=(timed_mutex const&);
public:
+ BOOST_THREAD_NO_COPYABLE(timed_mutex)
timed_mutex()
{
initialize();
diff --git a/boost/thread/win32/once.hpp b/boost/thread/win32/once.hpp
index e1b1843230..3066b50bc3 100644
--- a/boost/thread/win32/once.hpp
+++ b/boost/thread/win32/once.hpp
@@ -3,8 +3,9 @@
// once.hpp
//
-// (C) Copyright 2005-7 Anthony Williams
+// (C) Copyright 2005-7 Anthony Williams
// (C) Copyright 2005 John Maddock
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
@@ -30,6 +31,25 @@ namespace std
namespace boost
{
+#ifdef BOOST_THREAD_PROVIDES_ONCE_CXX11
+
+ struct once_flag
+ {
+ BOOST_THREAD_NO_COPYABLE(once_flag)
+ BOOST_CONSTEXPR once_flag() BOOST_NOEXCEPT
+ : status(0), count(0)
+ {}
+ private:
+ long status;
+ long count;
+ template<typename Function>
+ friend
+ void call_once(once_flag& flag,Function f);
+ };
+
+#define BOOST_ONCE_INIT once_flag()
+#else // BOOST_THREAD_PROVIDES_ONCE_CXX11
+
struct once_flag
{
long status;
@@ -37,6 +57,7 @@ namespace boost
};
#define BOOST_ONCE_INIT {0,0}
+#endif // BOOST_THREAD_PROVIDES_ONCE_CXX11
namespace detail
{
@@ -71,29 +92,29 @@ namespace boost
#else
static const once_char_type fixed_mutex_name[]="Local\\{C15730E2-145C-4c5e-B005-3BC753F42475}-once-flag";
#endif
- BOOST_STATIC_ASSERT(sizeof(fixed_mutex_name) ==
+ BOOST_STATIC_ASSERT(sizeof(fixed_mutex_name) ==
(sizeof(once_char_type)*(once_mutex_name_fixed_length+1)));
-
+
std::memcpy(mutex_name,fixed_mutex_name,sizeof(fixed_mutex_name));
- detail::int_to_string(reinterpret_cast<std::ptrdiff_t>(flag_address),
+ detail::int_to_string(reinterpret_cast<std::ptrdiff_t>(flag_address),
mutex_name + once_mutex_name_fixed_length);
- detail::int_to_string(win32::GetCurrentProcessId(),
+ detail::int_to_string(win32::GetCurrentProcessId(),
mutex_name + once_mutex_name_fixed_length + sizeof(void*)*2);
}
-
+
inline void* open_once_event(once_char_type* mutex_name,void* flag_address)
{
if(!*mutex_name)
{
name_once_mutex(mutex_name,flag_address);
}
-
-#ifdef BOOST_NO_ANSI_APIS
+
+#ifdef BOOST_NO_ANSI_APIS
return ::boost::detail::win32::OpenEventW(
#else
return ::boost::detail::win32::OpenEventA(
#endif
- ::boost::detail::win32::synchronize |
+ ::boost::detail::win32::synchronize |
::boost::detail::win32::event_modify_state,
false,
mutex_name);
@@ -105,7 +126,7 @@ namespace boost
{
name_once_mutex(mutex_name,flag_address);
}
-#ifdef BOOST_NO_ANSI_APIS
+#ifdef BOOST_NO_ANSI_APIS
return ::boost::detail::win32::CreateEventW(
#else
return ::boost::detail::win32::CreateEventA(
@@ -115,7 +136,7 @@ namespace boost
mutex_name);
}
}
-
+
template<typename Function>
void call_once(once_flag& flag,Function f)
@@ -136,7 +157,9 @@ namespace boost
status=BOOST_INTERLOCKED_COMPARE_EXCHANGE(&flag.status,running_value,0);
if(!status)
{
- try
+#ifndef BOOST_NO_EXCEPTIONS
+ try // BOOST_NO_EXCEPTIONS protected
+#endif
{
if(!event_handle)
{
@@ -153,7 +176,7 @@ namespace boost
counted=true;
}
BOOST_INTERLOCKED_EXCHANGE(&flag.status,function_complete_flag_value);
- if(!event_handle &&
+ if(!event_handle &&
(::boost::detail::interlocked_read_acquire(&flag.count)>1))
{
event_handle=detail::create_once_event(mutex_name,&flag);
@@ -164,7 +187,8 @@ namespace boost
}
break;
}
- catch(...)
+#ifndef BOOST_NO_EXCEPTIONS
+ catch(...) // BOOST_NO_EXCEPTIONS protected
{
BOOST_INTERLOCKED_EXCHANGE(&flag.status,0);
if(!event_handle)
@@ -175,8 +199,9 @@ namespace boost
{
::boost::detail::win32::SetEvent(event_handle);
}
- throw;
+ throw; // BOOST_NO_EXCEPTIONS protected
}
+#endif
}
if(!counted)
diff --git a/boost/thread/win32/recursive_mutex.hpp b/boost/thread/win32/recursive_mutex.hpp
index 7832bf270d..5144e77aa7 100644
--- a/boost/thread/win32/recursive_mutex.hpp
+++ b/boost/thread/win32/recursive_mutex.hpp
@@ -10,7 +10,6 @@
// http://www.boost.org/LICENSE_1_0.txt)
-#include <boost/utility.hpp>
#include <boost/thread/win32/basic_recursive_mutex.hpp>
#include <boost/thread/exceptions.hpp>
#include <boost/thread/locks.hpp>
@@ -22,10 +21,8 @@ namespace boost
class recursive_mutex:
public ::boost::detail::basic_recursive_mutex
{
- private:
- recursive_mutex(recursive_mutex const&);
- recursive_mutex& operator=(recursive_mutex const&);
public:
+ BOOST_THREAD_NO_COPYABLE(recursive_mutex)
recursive_mutex()
{
::boost::detail::basic_recursive_mutex::initialize();
@@ -44,10 +41,8 @@ namespace boost
class recursive_timed_mutex:
public ::boost::detail::basic_recursive_timed_mutex
{
- private:
- recursive_timed_mutex(recursive_timed_mutex const&);
- recursive_timed_mutex& operator=(recursive_timed_mutex const&);
public:
+ BOOST_THREAD_NO_COPYABLE(recursive_timed_mutex)
recursive_timed_mutex()
{
::boost::detail::basic_recursive_timed_mutex::initialize();
diff --git a/boost/thread/win32/shared_mutex.hpp b/boost/thread/win32/shared_mutex.hpp
index aee40399e4..fef2d5badd 100644
--- a/boost/thread/win32/shared_mutex.hpp
+++ b/boost/thread/win32/shared_mutex.hpp
@@ -2,6 +2,7 @@
#define BOOST_THREAD_WIN32_SHARED_MUTEX_HPP
// (C) Copyright 2006-8 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
@@ -12,8 +13,12 @@
#include <boost/thread/win32/thread_primitives.hpp>
#include <boost/static_assert.hpp>
#include <limits.h>
-#include <boost/utility.hpp>
#include <boost/thread/thread_time.hpp>
+#ifdef BOOST_THREAD_USES_CHRONO
+#include <boost/chrono/system_clocks.hpp>
+#include <boost/chrono/ceil.hpp>
+#endif
+#include <boost/thread/detail/delete.hpp>
#include <boost/config/abi_prefix.hpp>
@@ -22,9 +27,6 @@ namespace boost
class shared_mutex
{
private:
- shared_mutex(shared_mutex const&);
- shared_mutex& operator=(shared_mutex const&);
- private:
struct state_data
{
unsigned shared_count:11,
@@ -76,6 +78,7 @@ namespace boost
public:
+ BOOST_THREAD_NO_COPYABLE(shared_mutex)
shared_mutex()
{
semaphores[unlock_sem]=detail::win32::create_anonymous_semaphore(0,LONG_MAX);
@@ -218,6 +221,115 @@ namespace boost
}
}
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Rep, class Period>
+ bool try_lock_shared_for(const chrono::duration<Rep, Period>& rel_time)
+ {
+ return try_lock_shared_until(chrono::steady_clock::now() + rel_time);
+ }
+ template <class Clock, class Duration>
+ bool try_lock_shared_until(const chrono::time_point<Clock, Duration>& t)
+ {
+ using namespace chrono;
+ system_clock::time_point s_now = system_clock::now();
+ typename Clock::time_point c_now = Clock::now();
+ return try_lock_shared_until(s_now + ceil<system_clock::duration>(t - c_now));
+ }
+ template <class Duration>
+ bool try_lock_shared_until(const chrono::time_point<chrono::system_clock, Duration>& t)
+ {
+ using namespace chrono;
+ typedef time_point<chrono::system_clock, chrono::system_clock::duration> sys_tmpt;
+ return try_lock_shared_until(sys_tmpt(chrono::ceil<chrono::system_clock::duration>(t.time_since_epoch())));
+ }
+ bool try_lock_shared_until(const chrono::time_point<chrono::system_clock, chrono::system_clock::duration>& tp)
+ {
+ for(;;)
+ {
+ state_data old_state=state;
+ for(;;)
+ {
+ state_data new_state=old_state;
+ if(new_state.exclusive || new_state.exclusive_waiting_blocked)
+ {
+ ++new_state.shared_waiting;
+ if(!new_state.shared_waiting)
+ {
+ boost::throw_exception(boost::lock_error());
+ }
+ }
+ else
+ {
+ ++new_state.shared_count;
+ if(!new_state.shared_count)
+ {
+ boost::throw_exception(boost::lock_error());
+ }
+ }
+
+ state_data const current_state=interlocked_compare_exchange(&state,new_state,old_state);
+ if(current_state==old_state)
+ {
+ break;
+ }
+ old_state=current_state;
+ }
+
+ if(!(old_state.exclusive| old_state.exclusive_waiting_blocked))
+ {
+ return true;
+ }
+
+ chrono::system_clock::time_point n = chrono::system_clock::now();
+ unsigned long res;
+ if (tp>n) {
+ chrono::milliseconds rel_time= chrono::ceil<chrono::milliseconds>(tp-n);
+ res=detail::win32::WaitForSingleObject(semaphores[unlock_sem],
+ static_cast<unsigned long>(rel_time.count()));
+ } else {
+ res=detail::win32::timeout;
+ }
+ if(res==detail::win32::timeout)
+ {
+ for(;;)
+ {
+ state_data new_state=old_state;
+ if(new_state.exclusive || new_state.exclusive_waiting_blocked)
+ {
+ if(new_state.shared_waiting)
+ {
+ --new_state.shared_waiting;
+ }
+ }
+ else
+ {
+ ++new_state.shared_count;
+ if(!new_state.shared_count)
+ {
+ return false;
+ }
+ }
+
+ state_data const current_state=interlocked_compare_exchange(&state,new_state,old_state);
+ if(current_state==old_state)
+ {
+ break;
+ }
+ old_state=current_state;
+ }
+
+ if(!(old_state.exclusive| old_state.exclusive_waiting_blocked))
+ {
+ return true;
+ }
+ return false;
+ }
+
+ BOOST_ASSERT(res==0);
+ }
+ }
+#endif
+
void unlock_shared()
{
state_data old_state=state;
@@ -380,6 +492,116 @@ namespace boost
}
}
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Rep, class Period>
+ bool try_lock_for(const chrono::duration<Rep, Period>& rel_time)
+ {
+ return try_lock_until(chrono::steady_clock::now() + rel_time);
+ }
+ template <class Clock, class Duration>
+ bool try_lock_until(const chrono::time_point<Clock, Duration>& t)
+ {
+ using namespace chrono;
+ system_clock::time_point s_now = system_clock::now();
+ typename Clock::time_point c_now = Clock::now();
+ return try_lock_until(s_now + ceil<system_clock::duration>(t - c_now));
+ }
+ template <class Duration>
+ bool try_lock_until(const chrono::time_point<chrono::system_clock, Duration>& t)
+ {
+ using namespace chrono;
+ typedef time_point<chrono::system_clock, chrono::system_clock::duration> sys_tmpt;
+ return try_lock_until(sys_tmpt(chrono::ceil<chrono::system_clock::duration>(t.time_since_epoch())));
+ }
+ bool try_lock_until(const chrono::time_point<chrono::system_clock, chrono::system_clock::duration>& tp)
+ {
+ for(;;)
+ {
+ state_data old_state=state;
+
+ for(;;)
+ {
+ state_data new_state=old_state;
+ if(new_state.shared_count || new_state.exclusive)
+ {
+ ++new_state.exclusive_waiting;
+ if(!new_state.exclusive_waiting)
+ {
+ boost::throw_exception(boost::lock_error());
+ }
+
+ new_state.exclusive_waiting_blocked=true;
+ }
+ else
+ {
+ new_state.exclusive=true;
+ }
+
+ state_data const current_state=interlocked_compare_exchange(&state,new_state,old_state);
+ if(current_state==old_state)
+ {
+ break;
+ }
+ old_state=current_state;
+ }
+
+ if(!old_state.shared_count && !old_state.exclusive)
+ {
+ return true;
+ }
+ #ifndef UNDER_CE
+ const bool wait_all = true;
+ #else
+ const bool wait_all = false;
+ #endif
+
+ chrono::system_clock::time_point n = chrono::system_clock::now();
+ unsigned long wait_res;
+ if (tp>n) {
+ chrono::milliseconds rel_time= chrono::ceil<chrono::milliseconds>(tp-chrono::system_clock::now());
+ wait_res=detail::win32::WaitForMultipleObjects(2,semaphores,wait_all,
+ static_cast<unsigned long>(rel_time.count()));
+ } else {
+ wait_res=detail::win32::timeout;
+ }
+ if(wait_res==detail::win32::timeout)
+ {
+ for(;;)
+ {
+ state_data new_state=old_state;
+ if(new_state.shared_count || new_state.exclusive)
+ {
+ if(new_state.exclusive_waiting)
+ {
+ if(!--new_state.exclusive_waiting)
+ {
+ new_state.exclusive_waiting_blocked=false;
+ }
+ }
+ }
+ else
+ {
+ new_state.exclusive=true;
+ }
+
+ state_data const current_state=interlocked_compare_exchange(&state,new_state,old_state);
+ if(current_state==old_state)
+ {
+ break;
+ }
+ old_state=current_state;
+ }
+ if(!old_state.shared_count && !old_state.exclusive)
+ {
+ return true;
+ }
+ return false;
+ }
+ BOOST_ASSERT(wait_res<2);
+ }
+ }
+#endif
+
void unlock()
{
state_data old_state=state;
@@ -502,6 +724,8 @@ namespace boost
if(last_reader)
{
release_waiters(old_state);
+ } else {
+ release_waiters(old_state);
}
break;
}
@@ -561,6 +785,27 @@ namespace boost
}
release_waiters(old_state);
}
+// bool try_unlock_upgrade_and_lock()
+// {
+// return false;
+// }
+//#ifdef BOOST_THREAD_USES_CHRONO
+// template <class Rep, class Period>
+// bool
+// try_unlock_upgrade_and_lock_for(
+// const chrono::duration<Rep, Period>& rel_time)
+// {
+// return try_unlock_upgrade_and_lock_until(
+// chrono::steady_clock::now() + rel_time);
+// }
+// template <class Clock, class Duration>
+// bool
+// try_unlock_upgrade_and_lock_until(
+// const chrono::time_point<Clock, Duration>& abs_time)
+// {
+// return false;
+// }
+//#endif
void unlock_and_lock_shared()
{
@@ -586,7 +831,6 @@ namespace boost
}
release_waiters(old_state);
}
-
void unlock_upgrade_and_lock_shared()
{
state_data old_state=state;
@@ -612,6 +856,8 @@ namespace boost
}
};
+ typedef shared_mutex upgrade_mutex;
+
}
#include <boost/config/abi_suffix.hpp>
diff --git a/boost/thread/win32/thread_data.hpp b/boost/thread/win32/thread_data.hpp
index d5303d897d..5af4fd3ed3 100644
--- a/boost/thread/win32/thread_data.hpp
+++ b/boost/thread/win32/thread_data.hpp
@@ -4,17 +4,58 @@
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// (C) Copyright 2008 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
#include <boost/thread/detail/config.hpp>
#include <boost/intrusive_ptr.hpp>
#include <boost/thread/thread_time.hpp>
#include <boost/thread/win32/thread_primitives.hpp>
#include <boost/thread/win32/thread_heap_alloc.hpp>
-
+#ifdef BOOST_THREAD_USES_CHRONO
+#include <boost/chrono/system_clocks.hpp>
+#endif
#include <boost/config/abi_prefix.hpp>
namespace boost
{
+ class thread_attributes {
+ public:
+ thread_attributes() BOOST_NOEXCEPT {
+ val_.stack_size = 0;
+ //val_.lpThreadAttributes=0;
+ }
+ ~thread_attributes() {
+ }
+ // stack size
+ void set_stack_size(std::size_t size) BOOST_NOEXCEPT {
+ val_.stack_size = size;
+ }
+
+ std::size_t get_stack_size() const BOOST_NOEXCEPT {
+ return val_.stack_size;
+ }
+
+ //void set_security(LPSECURITY_ATTRIBUTES lpThreadAttributes)
+ //{
+ // val_.lpThreadAttributes=lpThreadAttributes;
+ //}
+ //LPSECURITY_ATTRIBUTES get_security()
+ //{
+ // return val_.lpThreadAttributes;
+ //}
+
+ struct win_attrs {
+ std::size_t stack_size;
+ //LPSECURITY_ATTRIBUTES lpThreadAttributes;
+ };
+ typedef win_attrs native_handle_type;
+ native_handle_type* native_handle() {return &val_;}
+ const native_handle_type* native_handle() const {return &val_;}
+
+ private:
+ win_attrs val_;
+ };
+
namespace detail
{
struct thread_exit_callback_node;
@@ -153,7 +194,7 @@ namespace boost
namespace this_thread
{
- void BOOST_THREAD_DECL yield();
+ void BOOST_THREAD_DECL yield() BOOST_NOEXCEPT;
bool BOOST_THREAD_DECL interruptible_wait(detail::win32::handle handle_to_wait_for,detail::timeout target_time);
inline void interruptible_wait(uintmax_t milliseconds)
@@ -174,6 +215,12 @@ namespace boost
{
interruptible_wait(abs_time);
}
+#ifdef BOOST_THREAD_USES_CHRONO
+ inline void BOOST_SYMBOL_VISIBLE sleep_for(const chrono::nanoseconds& ns)
+ {
+ interruptible_wait(chrono::duration_cast<chrono::milliseconds>(ns).count());
+ }
+#endif
}
}
diff --git a/boost/thread/win32/thread_heap_alloc.hpp b/boost/thread/win32/thread_heap_alloc.hpp
index b7d329f31c..843e46b532 100644
--- a/boost/thread/win32/thread_heap_alloc.hpp
+++ b/boost/thread/win32/thread_heap_alloc.hpp
@@ -75,16 +75,20 @@ namespace boost
inline T* heap_new()
{
void* const heap_memory=allocate_raw_heap_memory(sizeof(T));
- try
+#ifndef BOOST_NO_EXCEPTIONS
+ try // BOOST_NO_EXCEPTIONS protected
+#endif
{
T* const data=new (heap_memory) T();
return data;
}
- catch(...)
+#ifndef BOOST_NO_EXCEPTIONS
+ catch(...) // BOOST_NO_EXCEPTIONS protected
{
free_raw_heap_memory(heap_memory);
- throw;
+ throw; // BOOST_NO_EXCEPTIONS protected
}
+#endif
}
#ifndef BOOST_NO_RVALUE_REFERENCES
@@ -92,127 +96,159 @@ namespace boost
inline T* heap_new(A1&& a1)
{
void* const heap_memory=allocate_raw_heap_memory(sizeof(T));
- try
+#ifndef BOOST_NO_EXCEPTIONS
+ try // BOOST_NO_EXCEPTIONS protected
+#endif
{
T* const data=new (heap_memory) T(static_cast<A1&&>(a1));
return data;
}
- catch(...)
+#ifndef BOOST_NO_EXCEPTIONS
+ catch(...) // BOOST_NO_EXCEPTIONS protected
{
free_raw_heap_memory(heap_memory);
- throw;
+ throw; // BOOST_NO_EXCEPTIONS protected
}
+#endif
}
template<typename T,typename A1,typename A2>
inline T* heap_new(A1&& a1,A2&& a2)
{
void* const heap_memory=allocate_raw_heap_memory(sizeof(T));
- try
+#ifndef BOOST_NO_EXCEPTIONS
+ try // BOOST_NO_EXCEPTIONS protected
+#endif
{
T* const data=new (heap_memory) T(static_cast<A1&&>(a1),static_cast<A2&&>(a2));
return data;
}
- catch(...)
+#ifndef BOOST_NO_EXCEPTIONS
+ catch(...) // BOOST_NO_EXCEPTIONS protected
{
free_raw_heap_memory(heap_memory);
- throw;
+ throw; // BOOST_NO_EXCEPTIONS protected
}
+#endif
}
template<typename T,typename A1,typename A2,typename A3>
inline T* heap_new(A1&& a1,A2&& a2,A3&& a3)
{
void* const heap_memory=allocate_raw_heap_memory(sizeof(T));
- try
+#ifndef BOOST_NO_EXCEPTIONS
+ try // BOOST_NO_EXCEPTIONS protected
+#endif
{
T* const data=new (heap_memory) T(static_cast<A1&&>(a1),static_cast<A2&&>(a2),
static_cast<A3&&>(a3));
return data;
}
- catch(...)
+#ifndef BOOST_NO_EXCEPTIONS
+ catch(...) // BOOST_NO_EXCEPTIONS protected
{
free_raw_heap_memory(heap_memory);
- throw;
+ throw; // BOOST_NO_EXCEPTIONS protected
}
+#endif
}
template<typename T,typename A1,typename A2,typename A3,typename A4>
inline T* heap_new(A1&& a1,A2&& a2,A3&& a3,A4&& a4)
{
void* const heap_memory=allocate_raw_heap_memory(sizeof(T));
- try
+#ifndef BOOST_NO_EXCEPTIONS
+ try // BOOST_NO_EXCEPTIONS protected
+#endif
{
T* const data=new (heap_memory) T(static_cast<A1&&>(a1),static_cast<A2&&>(a2),
static_cast<A3&&>(a3),static_cast<A4&&>(a4));
return data;
}
- catch(...)
+#ifndef BOOST_NO_EXCEPTIONS
+ catch(...) // BOOST_NO_EXCEPTIONS protected
{
free_raw_heap_memory(heap_memory);
- throw;
+ throw; // BOOST_NO_EXCEPTIONS protected
}
+#endif
}
#else
template<typename T,typename A1>
inline T* heap_new_impl(A1 a1)
{
void* const heap_memory=allocate_raw_heap_memory(sizeof(T));
- try
+#ifndef BOOST_NO_EXCEPTIONS
+ try // BOOST_NO_EXCEPTIONS protected
+#endif
{
T* const data=new (heap_memory) T(a1);
return data;
}
- catch(...)
+#ifndef BOOST_NO_EXCEPTIONS
+ catch(...) // BOOST_NO_EXCEPTIONS protected
{
free_raw_heap_memory(heap_memory);
- throw;
+ throw; // BOOST_NO_EXCEPTIONS protected
}
+#endif
}
template<typename T,typename A1,typename A2>
inline T* heap_new_impl(A1 a1,A2 a2)
{
void* const heap_memory=allocate_raw_heap_memory(sizeof(T));
- try
+#ifndef BOOST_NO_EXCEPTIONS
+ try // BOOST_NO_EXCEPTIONS protected
+#endif
{
T* const data=new (heap_memory) T(a1,a2);
return data;
}
- catch(...)
+#ifndef BOOST_NO_EXCEPTIONS
+ catch(...) // BOOST_NO_EXCEPTIONS protected
{
free_raw_heap_memory(heap_memory);
- throw;
+ throw; // BOOST_NO_EXCEPTIONS protected
}
+#endif
}
template<typename T,typename A1,typename A2,typename A3>
inline T* heap_new_impl(A1 a1,A2 a2,A3 a3)
{
void* const heap_memory=allocate_raw_heap_memory(sizeof(T));
- try
+#ifndef BOOST_NO_EXCEPTIONS
+ try // BOOST_NO_EXCEPTIONS protected
+#endif
{
T* const data=new (heap_memory) T(a1,a2,a3);
return data;
}
- catch(...)
+#ifndef BOOST_NO_EXCEPTIONS
+ catch(...) // BOOST_NO_EXCEPTIONS protected
{
free_raw_heap_memory(heap_memory);
- throw;
+ throw; // BOOST_NO_EXCEPTIONS protected
}
+#endif
}
template<typename T,typename A1,typename A2,typename A3,typename A4>
inline T* heap_new_impl(A1 a1,A2 a2,A3 a3,A4 a4)
{
void* const heap_memory=allocate_raw_heap_memory(sizeof(T));
- try
+#ifndef BOOST_NO_EXCEPTIONS
+ try // BOOST_NO_EXCEPTIONS protected
+#endif
{
T* const data=new (heap_memory) T(a1,a2,a3,a4);
return data;
}
- catch(...)
+#ifndef BOOST_NO_EXCEPTIONS
+ catch(...) // BOOST_NO_EXCEPTIONS protected
{
free_raw_heap_memory(heap_memory);
- throw;
+ throw; // BOOST_NO_EXCEPTIONS protected
}
+#endif
}
diff --git a/boost/thread/win32/thread_primitives.hpp b/boost/thread/win32/thread_primitives.hpp
index 0166f37d36..294e42ee9b 100644
--- a/boost/thread/win32/thread_primitives.hpp
+++ b/boost/thread/win32/thread_primitives.hpp
@@ -341,22 +341,42 @@ namespace boost
{
inline bool interlocked_bit_test_and_set(long* x,long bit)
{
+#if 0
__asm {
mov eax,bit;
mov edx,x;
lock bts [edx],eax;
setc al;
};
+#else
+ bool ret;
+ __asm {
+ mov eax,bit; mov edx,x; lock bts [edx],eax; setc al; mov ret, al
+ };
+ return ret;
+
+#endif
}
inline bool interlocked_bit_test_and_reset(long* x,long bit)
{
+#if 0
__asm {
mov eax,bit;
mov edx,x;
lock btr [edx],eax;
setc al;
};
+#else
+
+
+ bool ret;
+ __asm {
+ mov eax,bit; mov edx,x; lock btr [edx],eax; setc al; mov ret, al
+ };
+ return ret;
+
+#endif
}
}
diff --git a/boost/thread/xtime.hpp b/boost/thread/xtime.hpp
index 7cc6272d6a..1ca996fa0c 100644
--- a/boost/thread/xtime.hpp
+++ b/boost/thread/xtime.hpp
@@ -2,7 +2,7 @@
// William E. Kempf
// Copyright (C) 2007-8 Anthony Williams
//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_XTIME_WEK070601_HPP
@@ -20,7 +20,7 @@ namespace boost {
enum xtime_clock_types
{
- TIME_UTC=1
+ TIME_UTC_=1
// TIME_TAI,
// TIME_MONOTONIC,
// TIME_PROCESS,
@@ -53,14 +53,14 @@ struct xtime
boost::posix_time::microseconds((nsec+500)/1000);
#endif
}
-
+
};
inline xtime get_xtime(boost::system_time const& abs_time)
{
xtime res;
boost::posix_time::time_duration const time_since_epoch=abs_time-boost::posix_time::from_time_t(0);
-
+
res.sec=static_cast<xtime::xtime_sec_t>(time_since_epoch.total_seconds());
res.nsec=static_cast<xtime::xtime_nsec_t>(time_since_epoch.fractional_seconds()*(1000000000/time_since_epoch.ticks_per_second()));
return res;
@@ -68,7 +68,7 @@ inline xtime get_xtime(boost::system_time const& abs_time)
inline int xtime_get(struct xtime* xtp, int clock_type)
{
- if (clock_type == TIME_UTC)
+ if (clock_type == TIME_UTC_)
{
*xtp=get_xtime(get_system_time());
return clock_type;
@@ -81,7 +81,7 @@ inline int xtime_cmp(const xtime& xt1, const xtime& xt2)
{
if (xt1.sec == xt2.sec)
return (int)(xt1.nsec - xt2.nsec);
- else
+ else
return (xt1.sec > xt2.sec) ? 1 : -1;
}
diff --git a/boost/throw_exception.hpp b/boost/throw_exception.hpp
index a73acb671b..c1bff4379f 100644
--- a/boost/throw_exception.hpp
+++ b/boost/throw_exception.hpp
@@ -1,5 +1,11 @@
-#ifndef BOOST_THROW_EXCEPTION_HPP_INCLUDED
-#define BOOST_THROW_EXCEPTION_HPP_INCLUDED
+#ifndef UUID_AA15E74A856F11E08B8D93F24824019B
+#define UUID_AA15E74A856F11E08B8D93F24824019B
+#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma GCC system_header
+#endif
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(push,1)
+#endif
// MS compatible compilers support #pragma once
@@ -79,7 +85,7 @@ template<class E> BOOST_ATTRIBUTE_NORETURN inline void throw_exception( E const
set_info(
set_info(
set_info(
- boost::enable_error_info(x),
+ enable_error_info(x),
throw_function(current_function)),
throw_file(file)),
throw_line(line)));
@@ -88,4 +94,7 @@ template<class E> BOOST_ATTRIBUTE_NORETURN inline void throw_exception( E const
#endif
} // namespace boost
-#endif // #ifndef BOOST_THROW_EXCEPTION_HPP_INCLUDED
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(pop)
+#endif
+#endif
diff --git a/boost/type_traits/detail/bool_trait_def.hpp b/boost/type_traits/detail/bool_trait_def.hpp
index 0935c60727..e3c7774e39 100644
--- a/boost/type_traits/detail/bool_trait_def.hpp
+++ b/boost/type_traits/detail/bool_trait_def.hpp
@@ -8,7 +8,7 @@
// http://www.boost.org/LICENSE_1_0.txt)
// $Source$
-// $Date: 2011-10-09 18:28:33 -0400 (Sun, 09 Oct 2011) $
+// $Date: 2011-10-09 15:28:33 -0700 (Sun, 09 Oct 2011) $
// $Revision: 74865 $
#include <boost/type_traits/detail/template_arity_spec.hpp>
diff --git a/boost/type_traits/detail/bool_trait_undef.hpp b/boost/type_traits/detail/bool_trait_undef.hpp
index 6daba04cfe..008febe790 100644
--- a/boost/type_traits/detail/bool_trait_undef.hpp
+++ b/boost/type_traits/detail/bool_trait_undef.hpp
@@ -8,7 +8,7 @@
// http://www.boost.org/LICENSE_1_0.txt)
// $Source$
-// $Date: 2011-10-09 18:28:33 -0400 (Sun, 09 Oct 2011) $
+// $Date: 2011-10-09 15:28:33 -0700 (Sun, 09 Oct 2011) $
// $Revision: 74865 $
#undef BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL
diff --git a/boost/type_traits/detail/size_t_trait_def.hpp b/boost/type_traits/detail/size_t_trait_def.hpp
index 23deeaff8d..3be4f70af4 100644
--- a/boost/type_traits/detail/size_t_trait_def.hpp
+++ b/boost/type_traits/detail/size_t_trait_def.hpp
@@ -8,7 +8,7 @@
// http://www.boost.org/LICENSE_1_0.txt)
// $Source$
-// $Date: 2011-04-25 08:26:48 -0400 (Mon, 25 Apr 2011) $
+// $Date: 2011-04-25 05:26:48 -0700 (Mon, 25 Apr 2011) $
// $Revision: 71481 $
#include <boost/type_traits/detail/template_arity_spec.hpp>
diff --git a/boost/type_traits/detail/size_t_trait_undef.hpp b/boost/type_traits/detail/size_t_trait_undef.hpp
index 06a176dc8e..967fd91631 100644
--- a/boost/type_traits/detail/size_t_trait_undef.hpp
+++ b/boost/type_traits/detail/size_t_trait_undef.hpp
@@ -8,7 +8,7 @@
// http://www.boost.org/LICENSE_1_0.txt)
// $Source$
-// $Date: 2004-09-02 11:41:37 -0400 (Thu, 02 Sep 2004) $
+// $Date: 2004-09-02 08:41:37 -0700 (Thu, 02 Sep 2004) $
// $Revision: 24874 $
#undef BOOST_TT_AUX_SIZE_T_TRAIT_DEF1
diff --git a/boost/type_traits/detail/type_trait_def.hpp b/boost/type_traits/detail/type_trait_def.hpp
index 3903f7f277..224f84887d 100644
--- a/boost/type_traits/detail/type_trait_def.hpp
+++ b/boost/type_traits/detail/type_trait_def.hpp
@@ -8,7 +8,7 @@
// http://www.boost.org/LICENSE_1_0.txt)
// $Source$
-// $Date: 2011-04-25 08:26:48 -0400 (Mon, 25 Apr 2011) $
+// $Date: 2011-04-25 05:26:48 -0700 (Mon, 25 Apr 2011) $
// $Revision: 71481 $
#include <boost/type_traits/detail/template_arity_spec.hpp>
diff --git a/boost/type_traits/detail/type_trait_undef.hpp b/boost/type_traits/detail/type_trait_undef.hpp
index 9403b9bde1..c4f14ff8d1 100644
--- a/boost/type_traits/detail/type_trait_undef.hpp
+++ b/boost/type_traits/detail/type_trait_undef.hpp
@@ -8,7 +8,7 @@
// http://www.boost.org/LICENSE_1_0.txt)
// $Source$
-// $Date: 2004-09-02 11:41:37 -0400 (Thu, 02 Sep 2004) $
+// $Date: 2004-09-02 08:41:37 -0700 (Thu, 02 Sep 2004) $
// $Revision: 24874 $
#undef BOOST_TT_AUX_TYPE_TRAIT_DEF1
diff --git a/boost/type_traits/intrinsics.hpp b/boost/type_traits/intrinsics.hpp
index d47b33ee47..8408ec3a40 100644
--- a/boost/type_traits/intrinsics.hpp
+++ b/boost/type_traits/intrinsics.hpp
@@ -124,6 +124,7 @@
#endif
#if defined(BOOST_CLANG) && defined(__has_feature)
+# include <cstddef>
# include <boost/type_traits/is_same.hpp>
# include <boost/type_traits/is_reference.hpp>
# include <boost/type_traits/is_volatile.hpp>
@@ -131,10 +132,10 @@
# if __has_feature(is_union)
# define BOOST_IS_UNION(T) __is_union(T)
# endif
-# if __has_feature(is_pod) && defined(_LIBCPP_VERSION)
+# if (!defined(__GLIBCXX__) || (__GLIBCXX__ >= 20080306 && __GLIBCXX__ != 20080519)) && __has_feature(is_pod)
# define BOOST_IS_POD(T) __is_pod(T)
# endif
-# if __has_feature(is_empty) && defined(_LIBCPP_VERSION)
+# if (!defined(__GLIBCXX__) || (__GLIBCXX__ >= 20080306 && __GLIBCXX__ != 20080519)) && __has_feature(is_empty)
# define BOOST_IS_EMPTY(T) __is_empty(T)
# endif
# if __has_feature(has_trivial_constructor)
@@ -185,7 +186,7 @@
# define BOOST_HAS_TYPE_TRAITS_INTRINSICS
#endif
-#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3) && !defined(__GCCXML__)))
+#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3) && !defined(__GCCXML__))) && !defined(BOOST_CLANG)
# include <boost/type_traits/is_same.hpp>
# include <boost/type_traits/is_reference.hpp>
# include <boost/type_traits/is_volatile.hpp>
diff --git a/boost/type_traits/is_virtual_base_of.hpp b/boost/type_traits/is_virtual_base_of.hpp
index ffb021e69e..f57cb61876 100644
--- a/boost/type_traits/is_virtual_base_of.hpp
+++ b/boost/type_traits/is_virtual_base_of.hpp
@@ -23,7 +23,7 @@ namespace detail {
#ifdef BOOST_MSVC
#pragma warning( push )
#pragma warning( disable : 4584 4250)
-#elif defined __GNUC__
+#elif defined(__GNUC__) && (__GNUC__ >= 4)
#pragma GCC system_header
#endif
diff --git a/boost/units/conversion.hpp b/boost/units/conversion.hpp
index 5f739aa188..beb641516e 100644
--- a/boost/units/conversion.hpp
+++ b/boost/units/conversion.hpp
@@ -170,10 +170,12 @@ BOOST_UNITS_DEFAULT_CONVERSION(namespace_::name_ ## _base_unit, unit)
/// Find the conversion factor between two units.
template<class FromUnit,class ToUnit>
inline
-typename detail::conversion_factor_helper<FromUnit, ToUnit>::type
+typename one_to_double_type<
+ typename detail::conversion_factor_helper<FromUnit, ToUnit>::type
+>::type
conversion_factor(const FromUnit&,const ToUnit&)
{
- return(detail::conversion_factor_helper<FromUnit, ToUnit>::value());
+ return(one_to_double(detail::conversion_factor_helper<FromUnit, ToUnit>::value()));
}
} // namespace units
diff --git a/boost/units/detail/one.hpp b/boost/units/detail/one.hpp
index 4cadc2c5fc..bf1cad902b 100644
--- a/boost/units/detail/one.hpp
+++ b/boost/units/detail/one.hpp
@@ -102,6 +102,17 @@ inline bool operator>(const boost::units::one&, const T& t) {
return(1 > t);
}
+template<class T>
+T one_to_double(const T& t) { return t; }
+
+inline double one_to_double(const one&) { return 1.0; }
+
+template<class T>
+struct one_to_double_type { typedef T type; };
+
+template<>
+struct one_to_double_type<one> { typedef double type; };
+
} // namespace units
} // namespace boost
diff --git a/boost/units/detail/static_rational_power.hpp b/boost/units/detail/static_rational_power.hpp
index 9c71f55ab7..66c9d9d04b 100644
--- a/boost/units/detail/static_rational_power.hpp
+++ b/boost/units/detail/static_rational_power.hpp
@@ -93,7 +93,7 @@ struct static_int_power_impl<N, true>
typedef typename next::type type;
static type call(const Y& y, const R& r)
{
- const Y square = y * y;
+ const square_type square = y * y;
return(next::call(square, r));
}
};
@@ -185,7 +185,7 @@ struct static_rational_power_impl<static_rational<N, 1>, Y>
{
typedef typename static_int_power_sign_impl<N>::template apply<Y> impl;
typedef typename impl::type type;
- static Y call(const Y& y)
+ static type call(const Y& y)
{
return(impl::call(y));
}
diff --git a/boost/units/quantity.hpp b/boost/units/quantity.hpp
index 4fe916dcc4..3cd6682ce4 100644
--- a/boost/units/quantity.hpp
+++ b/boost/units/quantity.hpp
@@ -680,6 +680,15 @@ struct multiply_typeof_helper< X,quantity<Unit,Y> >
typedef quantity<unit_type,value_type> type;
};
+/// disambiguate
+/// INTERNAL ONLY
+template<class Unit,
+ class Y>
+struct multiply_typeof_helper< one,quantity<Unit,Y> >
+{
+ typedef quantity<Unit,Y> type;
+};
+
/// quantity times scalar typeof helper
/// INTERNAL ONLY
template<class Unit,
@@ -692,6 +701,15 @@ struct multiply_typeof_helper< quantity<Unit,X>,Y >
typedef quantity<unit_type,value_type> type;
};
+/// disambiguate
+/// INTERNAL ONLY
+template<class Unit,
+ class X>
+struct multiply_typeof_helper< quantity<Unit,X>,one >
+{
+ typedef quantity<Unit,X> type;
+};
+
/// unit times quantity typeof helper
/// INTERNAL ONLY
template<class Unit,
@@ -767,6 +785,15 @@ struct divide_typeof_helper< X,quantity<Unit,Y> >
typedef quantity<unit_type,value_type> type;
};
+/// disambiguate
+/// INTERNAL ONLY
+template<class Unit,
+ class Y>
+struct divide_typeof_helper< one,quantity<Unit,Y> >
+{
+ typedef quantity<Unit,Y> type;
+};
+
/// quantity divided by scalar typeof helper
/// INTERNAL ONLY
template<class Unit,
@@ -779,6 +806,15 @@ struct divide_typeof_helper< quantity<Unit,X>,Y >
typedef quantity<unit_type,value_type> type;
};
+/// disambiguate
+/// INTERNAL ONLY
+template<class Unit,
+ class X>
+struct divide_typeof_helper< quantity<Unit,X>,one >
+{
+ typedef quantity<Unit,X> type;
+};
+
/// unit divided by quantity typeof helper
/// INTERNAL ONLY
template<class Unit,
diff --git a/boost/units/systems/detail/constants.hpp b/boost/units/systems/detail/constants.hpp
index fac9b612cc..cf156f7072 100644
--- a/boost/units/systems/detail/constants.hpp
+++ b/boost/units/systems/detail/constants.hpp
@@ -20,6 +20,8 @@
#include <boost/units/static_constant.hpp>
#include <boost/units/units_fwd.hpp>
#include <boost/units/operators.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/detail/one.hpp>
namespace boost {
@@ -134,6 +136,72 @@ BOOST_UNITS_DEFINE_HELPER(divide, /)
#undef BOOST_UNITS_DEFINE_HELPER
+#define BOOST_UNITS_DEFINE_HELPER(name, symbol) \
+ \
+template<class T1> \
+struct name ## _typeof_helper<constant<T1>, one> \
+{ \
+ typedef typename name ## _typeof_helper<typename T1::value_type, one>::type type;\
+}; \
+ \
+template<class T2> \
+struct name ## _typeof_helper<one, constant<T2> > \
+{ \
+ typedef typename name ## _typeof_helper<one, typename T2::value_type>::type type;\
+}; \
+ \
+template<class T1> \
+typename name ## _typeof_helper<typename T1::value_type, one>::type \
+operator symbol(const constant<T1>& t, const one& u) \
+{ \
+ return(t.value() symbol u); \
+} \
+ \
+template<class T2> \
+typename name ## _typeof_helper<one, typename T2::value_type>::type \
+operator symbol(const one& t, const constant<T2>& u) \
+{ \
+ return(t symbol u.value()); \
+}
+
+BOOST_UNITS_DEFINE_HELPER(multiply, *)
+BOOST_UNITS_DEFINE_HELPER(divide, /)
+
+#undef BOOST_UNITS_DEFINE_HELPER
+
+template<class T1, long N, long D>
+struct power_typeof_helper<constant<T1>, static_rational<N,D> >
+{
+ typedef power_typeof_helper<typename T1::value_type, static_rational<N,D> > base;
+ typedef typename base::type type;
+ static type value(const constant<T1>& arg)
+ {
+ return base::value(arg.value());
+ }
+};
+
+#define BOOST_UNITS_DEFINE_HELPER(name, symbol) \
+ \
+template<class T1, class E> \
+struct name ## _typeof_helper<constant<T1> > \
+{ \
+ typedef typename name ## _typeof_helper<typename T1::value_type, E>::type type;\
+}; \
+ \
+template<class T1> \
+typename name ## _typeof_helper<typename T1::value_type, one>::type \
+operator symbol(const constant<T1>& t, const one& u) \
+{ \
+ return(t.value() symbol u); \
+} \
+ \
+template<class T2> \
+typename name ## _typeof_helper<one, typename T2::value_type>::type \
+operator symbol(const one& t, const constant<T2>& u) \
+{ \
+ return(t symbol u.value()); \
+}
+
#define BOOST_UNITS_PHYSICAL_CONSTANT(name, type, value_, uncertainty_) \
struct name ## _t { \
typedef type value_type; \
diff --git a/boost/unordered/detail/allocate.hpp b/boost/unordered/detail/allocate.hpp
new file mode 100644
index 0000000000..5574c15855
--- /dev/null
+++ b/boost/unordered/detail/allocate.hpp
@@ -0,0 +1,1246 @@
+
+// Copyright 2005-2011 Daniel James.
+// Copyright 2009 Pablo Halpern.
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org/libs/unordered for documentation
+
+#ifndef BOOST_UNORDERED_ALLOCATE_HPP
+#define BOOST_UNORDERED_ALLOCATE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+#include <boost/unordered/detail/fwd.hpp>
+#include <boost/move/move.hpp>
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/inc.hpp>
+#include <boost/preprocessor/dec.hpp>
+#include <boost/preprocessor/repetition/enum.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/enum_binary_params.hpp>
+#include <boost/preprocessor/repetition/repeat_from_to.hpp>
+#include <boost/type_traits/is_class.hpp>
+#include <boost/type_traits/add_lvalue_reference.hpp>
+#include <boost/tuple/tuple.hpp>
+#include <boost/utility/enable_if.hpp>
+#include <boost/utility/addressof.hpp>
+#include <boost/detail/select_type.hpp>
+#include <boost/assert.hpp>
+#include <utility>
+
+#if !defined(BOOST_NO_CXX11_HDR_TUPLE)
+#include <tuple>
+#endif
+
+#if defined(BOOST_MSVC)
+#pragma warning(push)
+#pragma warning(disable:4512) // assignment operator could not be generated.
+#pragma warning(disable:4345) // behavior change: an object of POD type
+ // constructed with an initializer of the form ()
+ // will be default-initialized.
+#endif
+
+#define BOOST_UNORDERED_EMPLACE_LIMIT 10
+
+namespace boost { namespace unordered { namespace detail {
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Bits and pieces for implementing traits
+
+ template <typename T> typename boost::add_lvalue_reference<T>::type make();
+ struct choice9 { typedef char (&type)[9]; };
+ struct choice8 : choice9 { typedef char (&type)[8]; };
+ struct choice7 : choice8 { typedef char (&type)[7]; };
+ struct choice6 : choice7 { typedef char (&type)[6]; };
+ struct choice5 : choice6 { typedef char (&type)[5]; };
+ struct choice4 : choice5 { typedef char (&type)[4]; };
+ struct choice3 : choice4 { typedef char (&type)[3]; };
+ struct choice2 : choice3 { typedef char (&type)[2]; };
+ struct choice1 : choice2 { typedef char (&type)[1]; };
+ choice1 choose();
+
+ typedef choice1::type yes_type;
+ typedef choice2::type no_type;
+
+ struct private_type
+ {
+ private_type const &operator,(int) const;
+ };
+
+ template <typename T>
+ no_type is_private_type(T const&);
+ yes_type is_private_type(private_type const&);
+
+ struct convert_from_anything {
+ template <typename T>
+ convert_from_anything(T const&);
+ };
+
+ ////////////////////////////////////////////////////////////////////////////
+ // emplace_args
+ //
+ // Either forwarding variadic arguments, or storing the arguments in
+ // emplace_args##n
+
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
+
+#define BOOST_UNORDERED_EMPLACE_TEMPLATE typename... Args
+#define BOOST_UNORDERED_EMPLACE_ARGS BOOST_FWD_REF(Args)... args
+#define BOOST_UNORDERED_EMPLACE_FORWARD boost::forward<Args>(args)...
+
+#define BOOST_UNORDERED_EMPLACE_ARGS1(a0) a0
+#define BOOST_UNORDERED_EMPLACE_ARGS2(a0, a1) a0, a1
+#define BOOST_UNORDERED_EMPLACE_ARGS3(a0, a1, a2) a0, a1, a2
+
+#else
+
+#define BOOST_UNORDERED_EMPLACE_TEMPLATE typename Args
+#define BOOST_UNORDERED_EMPLACE_ARGS Args const& args
+#define BOOST_UNORDERED_EMPLACE_FORWARD args
+
+#define BOOST_UNORDERED_FWD_PARAM(z, n, a) \
+ BOOST_FWD_REF(BOOST_PP_CAT(A, n)) BOOST_PP_CAT(a, n)
+
+#define BOOST_UNORDERED_CALL_FORWARD(z, i, a) \
+ boost::forward<BOOST_PP_CAT(A,i)>(BOOST_PP_CAT(a,i))
+
+#define BOOST_UNORDERED_EARGS(z, n, _) \
+ template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
+ struct BOOST_PP_CAT(emplace_args, n) \
+ { \
+ BOOST_PP_REPEAT_##z(n, BOOST_UNORDERED_EARGS_MEMBER, _) \
+ BOOST_PP_CAT(emplace_args, n) ( \
+ BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, Arg, b) \
+ ) : BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_EARGS_INIT, _) \
+ {} \
+ \
+ }; \
+ \
+ template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
+ inline BOOST_PP_CAT(emplace_args, n) < \
+ BOOST_PP_ENUM_PARAMS_Z(z, n, A) \
+ > create_emplace_args( \
+ BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, b) \
+ ) \
+ { \
+ BOOST_PP_CAT(emplace_args, n) < \
+ BOOST_PP_ENUM_PARAMS_Z(z, n, A) \
+ > e(BOOST_PP_ENUM_PARAMS_Z(z, n, b)); \
+ return e; \
+ }
+
+#define BOOST_UNORDERED_EMPLACE_ARGS1 create_emplace_args
+#define BOOST_UNORDERED_EMPLACE_ARGS2 create_emplace_args
+#define BOOST_UNORDERED_EMPLACE_ARGS3 create_emplace_args
+
+#if defined(BOOST_NO_RVALUE_REFERENCES)
+
+#define BOOST_UNORDERED_EARGS_MEMBER(z, n, _) \
+ typedef BOOST_FWD_REF(BOOST_PP_CAT(A, n)) BOOST_PP_CAT(Arg, n); \
+ BOOST_PP_CAT(Arg, n) BOOST_PP_CAT(a, n);
+
+#define BOOST_UNORDERED_EARGS_INIT(z, n, _) \
+ BOOST_PP_CAT(a, n)( \
+ boost::forward<BOOST_PP_CAT(A,n)>(BOOST_PP_CAT(b, n)))
+
+#else
+
+#define BOOST_UNORDERED_EARGS_MEMBER(z, n, _) \
+ typedef typename boost::add_lvalue_reference<BOOST_PP_CAT(A, n)>::type \
+ BOOST_PP_CAT(Arg, n); \
+ BOOST_PP_CAT(Arg, n) BOOST_PP_CAT(a, n);
+
+#define BOOST_UNORDERED_EARGS_INIT(z, n, _) \
+ BOOST_PP_CAT(a, n)(BOOST_PP_CAT(b, n))
+
+#endif
+
+BOOST_PP_REPEAT_FROM_TO(1, BOOST_UNORDERED_EMPLACE_LIMIT, BOOST_UNORDERED_EARGS,
+ _)
+
+#undef BOOST_UNORDERED_DEFINE_EMPLACE_ARGS
+#undef BOOST_UNORDERED_EARGS_MEMBER
+#undef BOOST_UNORDERED_EARGS_INIT
+
+#endif
+
+ ////////////////////////////////////////////////////////////////////////////
+ // rvalue parameters when type can't be a BOOST_RV_REF(T) parameter
+ // e.g. for int
+
+#if !defined(BOOST_NO_RVALUE_REFERENCES)
+# define BOOST_UNORDERED_RV_REF(T) BOOST_RV_REF(T)
+#else
+ struct please_ignore_this_overload {
+ typedef please_ignore_this_overload type;
+ };
+
+ template <typename T>
+ struct rv_ref_impl {
+ typedef BOOST_RV_REF(T) type;
+ };
+
+ template <typename T>
+ struct rv_ref :
+ boost::detail::if_true<
+ boost::is_class<T>::value
+ >::BOOST_NESTED_TEMPLATE then <
+ boost::unordered::detail::rv_ref_impl<T>,
+ please_ignore_this_overload
+ >::type
+ {};
+
+# define BOOST_UNORDERED_RV_REF(T) \
+ typename boost::unordered::detail::rv_ref<T>::type
+#endif
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Construct from tuple
+ //
+ // Used for piecewise construction.
+
+#if !defined(__SUNPRO_CC)
+
+# define BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(n, namespace_) \
+ template<typename T> \
+ void construct_from_tuple(T* ptr, namespace_ tuple<>) \
+ { \
+ new ((void*) ptr) T(); \
+ } \
+ \
+ BOOST_PP_REPEAT_FROM_TO(1, n, \
+ BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE_IMPL, namespace_)
+
+# define BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE_IMPL(z, n, namespace_) \
+ template<typename T, BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
+ void construct_from_tuple(T* ptr, \
+ namespace_ tuple<BOOST_PP_ENUM_PARAMS_Z(z, n, A)> const& x) \
+ { \
+ new ((void*) ptr) T( \
+ BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_GET_TUPLE_ARG, namespace_) \
+ ); \
+ }
+
+# define BOOST_UNORDERED_GET_TUPLE_ARG(z, n, namespace_) \
+ namespace_ get<n>(x)
+
+#else
+
+ template <int N> struct length {};
+
+# define BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(n, namespace_) \
+ template<typename T> \
+ void construct_from_tuple_impl( \
+ boost::unordered::detail::length<0>, T* ptr, \
+ namespace_ tuple<>) \
+ { \
+ new ((void*) ptr) T(); \
+ } \
+ \
+ BOOST_PP_REPEAT_FROM_TO(1, n, \
+ BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE_IMPL, namespace_)
+
+# define BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE_IMPL(z, n, namespace_) \
+ template<typename T, BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
+ void construct_from_tuple_impl( \
+ boost::unordered::detail::length<n>, T* ptr, \
+ namespace_ tuple<BOOST_PP_ENUM_PARAMS_Z(z, n, A)> const& x) \
+ { \
+ new ((void*) ptr) T( \
+ BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_GET_TUPLE_ARG, namespace_) \
+ ); \
+ }
+
+# define BOOST_UNORDERED_GET_TUPLE_ARG(z, n, namespace_) \
+ namespace_ get<n>(x)
+
+#endif
+
+BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(10, boost::)
+
+#if !defined(__SUNPRO_CC) && !defined(BOOST_NO_CXX11_HDR_TUPLE)
+ BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(10, std::)
+#endif
+
+#undef BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE
+#undef BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE_IMPL
+#undef BOOST_UNORDERED_GET_TUPLE_ARG
+
+#if defined(__SUNPRO_CC)
+
+ template <typename T, typename Tuple>
+ void construct_from_tuple(T* ptr, Tuple const& x)
+ {
+ construct_from_tuple_impl(
+ boost::unordered::detail::length<
+ boost::tuples::length<Tuple>::value>(),
+ ptr, x);
+ }
+
+#endif
+
+ ////////////////////////////////////////////////////////////////////////////
+ // SFINAE traits for construction.
+
+ // Decide which construction method to use for a three argument
+ // call. Note that this is difficult to do using overloads because
+ // the arguments are packed into 'emplace_args3'.
+ //
+ // The decision is made on the first argument.
+
+
+#if defined(BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT)
+ template <typename A, typename B, typename A0>
+ struct emulation1 {
+ static choice1::type test(choice1, std::pair<A, B> const&);
+ static choice2::type test(choice2, A const&);
+ static choice3::type test(choice3, convert_from_anything const&);
+
+ enum { value =
+ sizeof(test(choose(), boost::unordered::detail::make<A0>())) ==
+ sizeof(choice2::type) };
+ };
+#endif
+
+ template <typename A, typename B, typename A0>
+ struct check3_base {
+ static choice1::type test(choice1,
+ boost::unordered::piecewise_construct_t);
+
+#if defined(BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT)
+ static choice2::type test(choice2, A const&);
+#endif
+
+ static choice3::type test(choice3, ...);
+
+ enum { value =
+ sizeof(test(choose(), boost::unordered::detail::make<A0>())) };
+ };
+
+ template <typename A, typename B, typename A0>
+ struct piecewise3 {
+ enum { value = check3_base<A,B,A0>::value == sizeof(choice1::type) };
+ };
+
+#if defined(BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT)
+ template <typename A, typename B, typename A0>
+ struct emulation3 {
+ enum { value = check3_base<A,B,A0>::value == sizeof(choice2::type) };
+ };
+
+#endif
+
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Construct from variadic parameters
+
+ template <typename T, typename... Args>
+ inline void construct_impl(T* address, BOOST_FWD_REF(Args)... args)
+ {
+ new((void*) address) T(boost::forward<Args>(args)...);
+ }
+
+ template <typename A, typename B, typename A0, typename A1, typename A2>
+ inline typename enable_if<piecewise3<A, B, A0>, void>::type
+ construct_impl(std::pair<A, B>* address,
+ BOOST_FWD_REF(A0), BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
+ {
+ boost::unordered::detail::construct_from_tuple(
+ boost::addressof(address->first), boost::forward<A1>(a1));
+ boost::unordered::detail::construct_from_tuple(
+ boost::addressof(address->second), boost::forward<A2>(a2));
+ }
+
+#if defined(BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT)
+
+ template <typename A, typename B, typename A0>
+ inline typename enable_if<emulation1<A, B, A0>, void>::type
+ construct_impl(std::pair<A, B>* address, BOOST_FWD_REF(A0) a0)
+ {
+ new((void*) boost::addressof(address->first)) A(boost::forward<A0>(a0));
+ new((void*) boost::addressof(address->second)) B();
+ }
+
+ template <typename A, typename B, typename A0, typename A1, typename A2>
+ inline typename enable_if<emulation3<A, B, A0>, void>::type
+ construct_impl(std::pair<A, B>* address,
+ BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
+ {
+ new((void*) boost::addressof(address->first)) A(boost::forward<A0>(a0));
+ new((void*) boost::addressof(address->second)) B(
+ boost::forward<A1>(a1),
+ boost::forward<A2>(a2));
+ }
+
+ template <typename A, typename B,
+ typename A0, typename A1, typename A2, typename A3,
+ typename... Args>
+ inline void construct_impl(std::pair<A, B>* address,
+ BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2,
+ BOOST_FWD_REF(A3) a3, BOOST_FWD_REF(Args)... args)
+ {
+ new((void*) boost::addressof(address->first)) A(boost::forward<A0>(a0));
+
+ new((void*) boost::addressof(address->second)) B(
+ boost::forward<A1>(a1),
+ boost::forward<A2>(a2),
+ boost::forward<A3>(a3),
+ boost::forward<Args>(args)...);
+ }
+
+#endif // BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT
+
+#else // BOOST_NO_VARIADIC_TEMPLATES
+
+////////////////////////////////////////////////////////////////////////////////
+// Construct from emplace_args
+
+#define BOOST_UNORDERED_CONSTRUCT_IMPL(z, num_params, _) \
+ template < \
+ typename T, \
+ BOOST_PP_ENUM_PARAMS_Z(z, num_params, typename A) \
+ > \
+ inline void construct_impl(T* address, \
+ boost::unordered::detail::BOOST_PP_CAT(emplace_args,num_params) < \
+ BOOST_PP_ENUM_PARAMS_Z(z, num_params, A) \
+ > const& args) \
+ { \
+ new((void*) address) T( \
+ BOOST_PP_ENUM_##z(num_params, BOOST_UNORDERED_CALL_FORWARD, \
+ args.a)); \
+ }
+
+ template <typename T, typename A0>
+ inline void construct_impl(T* address, emplace_args1<A0> const& args)
+ {
+ new((void*) address) T(boost::forward<A0>(args.a0));
+ }
+
+ template <typename T, typename A0, typename A1>
+ inline void construct_impl(T* address, emplace_args2<A0, A1> const& args)
+ {
+ new((void*) address) T(
+ boost::forward<A0>(args.a0),
+ boost::forward<A1>(args.a1)
+ );
+ }
+
+ template <typename T, typename A0, typename A1, typename A2>
+ inline void construct_impl(T* address, emplace_args3<A0, A1, A2> const& args)
+ {
+ new((void*) address) T(
+ boost::forward<A0>(args.a0),
+ boost::forward<A1>(args.a1),
+ boost::forward<A2>(args.a2)
+ );
+ }
+
+ BOOST_PP_REPEAT_FROM_TO(4, BOOST_UNORDERED_EMPLACE_LIMIT,
+ BOOST_UNORDERED_CONSTRUCT_IMPL, _)
+
+#undef BOOST_UNORDERED_CONSTRUCT_IMPL
+
+ template <typename A, typename B, typename A0, typename A1, typename A2>
+ inline void construct_impl(std::pair<A, B>* address,
+ boost::unordered::detail::emplace_args3<A0, A1, A2> const& args,
+ typename enable_if<piecewise3<A, B, A0>, void*>::type = 0)
+ {
+ boost::unordered::detail::construct_from_tuple(
+ boost::addressof(address->first), args.a1);
+ boost::unordered::detail::construct_from_tuple(
+ boost::addressof(address->second), args.a2);
+ }
+
+#if defined(BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT)
+
+ template <typename A, typename B, typename A0>
+ inline void construct_impl(std::pair<A, B>* address,
+ boost::unordered::detail::emplace_args1<A0> const& args,
+ typename enable_if<emulation1<A, B, A0>, void*>::type = 0)
+ {
+ new((void*) boost::addressof(address->first)) A(
+ boost::forward<A0>(args.a0));
+ new((void*) boost::addressof(address->second)) B();
+ }
+
+ template <typename A, typename B, typename A0, typename A1, typename A2>
+ inline void construct_impl(std::pair<A, B>* address,
+ boost::unordered::detail::emplace_args3<A0, A1, A2> const& args,
+ typename enable_if<emulation3<A, B, A0>, void*>::type = 0)
+ {
+ new((void*) boost::addressof(address->first)) A(
+ boost::forward<A0>(args.a0));
+ new((void*) boost::addressof(address->second)) B(
+ boost::forward<A1>(args.a1),
+ boost::forward<A2>(args.a2));
+ }
+
+#define BOOST_UNORDERED_CONSTRUCT_PAIR_IMPL(z, num_params, _) \
+ template <typename A, typename B, \
+ BOOST_PP_ENUM_PARAMS_Z(z, num_params, typename A) \
+ > \
+ inline void construct_impl(std::pair<A, B>* address, \
+ boost::unordered::detail::BOOST_PP_CAT(emplace_args, num_params) < \
+ BOOST_PP_ENUM_PARAMS_Z(z, num_params, A) \
+ > const& args) \
+ { \
+ new((void*) boost::addressof(address->first)) A( \
+ boost::forward<A0>(args.a0)); \
+ new((void*) boost::addressof(address->second)) B( \
+ BOOST_PP_ENUM_##z(BOOST_PP_DEC(num_params), \
+ BOOST_UNORDERED_CALL_FORWARD2, args.a)); \
+ }
+
+#define BOOST_UNORDERED_CALL_FORWARD2(z, i, a) \
+ BOOST_UNORDERED_CALL_FORWARD(z, BOOST_PP_INC(i), a)
+
+ BOOST_UNORDERED_CONSTRUCT_PAIR_IMPL(1, 2, _)
+ BOOST_PP_REPEAT_FROM_TO(4, BOOST_UNORDERED_EMPLACE_LIMIT,
+ BOOST_UNORDERED_CONSTRUCT_PAIR_IMPL, _)
+
+#undef BOOST_UNORDERED_CONSTRUCT_PAIR_IMPL
+#undef BOOST_UNORDERED_CALL_FORWARD2
+
+#endif // BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT
+#endif // BOOST_NO_VARIADIC_TEMPLATES
+
+}}}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Pick which version of allocator_traits to use
+//
+// 0 = Own partial implementation
+// 1 = std::allocator_traits
+// 2 = boost::container::allocator_traits
+
+#if !defined(BOOST_UNORDERED_USE_ALLOCATOR_TRAITS)
+# if defined(__GXX_EXPERIMENTAL_CXX0X__) && \
+ (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))
+# define BOOST_UNORDERED_USE_ALLOCATOR_TRAITS 0
+# elif defined(BOOST_MSVC)
+# if BOOST_MSVC < 1400
+ // Use container's allocator_traits for older versions of Visual
+ // C++ as I don't test with them.
+# define BOOST_UNORDERED_USE_ALLOCATOR_TRAITS 2
+# endif
+# endif
+#endif
+
+#if !defined(BOOST_UNORDERED_USE_ALLOCATOR_TRAITS)
+# define BOOST_UNORDERED_USE_ALLOCATOR_TRAITS 0
+#endif
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Some utilities for implementing allocator_traits, but useful elsewhere so
+// they're always defined.
+
+#if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
+# include <type_traits>
+#endif
+
+namespace boost { namespace unordered { namespace detail {
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Integral_constrant, true_type, false_type
+ //
+ // Uses the standard versions if available.
+
+#if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
+
+ using std::integral_constant;
+ using std::true_type;
+ using std::false_type;
+
+#else
+
+ template <typename T, T Value>
+ struct integral_constant { enum { value = Value }; };
+
+ typedef boost::unordered::detail::integral_constant<bool, true> true_type;
+ typedef boost::unordered::detail::integral_constant<bool, false> false_type;
+
+#endif
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Explicitly call a destructor
+
+#if defined(BOOST_MSVC)
+#pragma warning(push)
+#pragma warning(disable:4100) // unreferenced formal parameter
+#endif
+
+ template <class T>
+ inline void destroy(T* x) {
+ x->~T();
+ }
+
+#if defined(BOOST_MSVC)
+#pragma warning(pop)
+#endif
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Expression test mechanism
+ //
+ // When SFINAE expressions are available, define
+ // BOOST_UNORDERED_HAS_FUNCTION which can check if a function call is
+ // supported by a class, otherwise define BOOST_UNORDERED_HAS_MEMBER which
+ // can detect if a class has the specified member, but not that it has the
+ // correct type, this is good enough for a passable impression of
+ // allocator_traits.
+
+#if !defined(BOOST_NO_SFINAE_EXPR)
+
+ template <typename T, unsigned int> struct expr_test;
+ template <typename T> struct expr_test<T, sizeof(char)> : T {};
+ template <typename U> static char for_expr_test(U const&);
+
+# define BOOST_UNORDERED_CHECK_EXPRESSION(count, result, expression) \
+ template <typename U> \
+ static typename boost::unordered::detail::expr_test< \
+ BOOST_PP_CAT(choice, result), \
+ sizeof(boost::unordered::detail::for_expr_test(( \
+ (expression), \
+ 0)))>::type test( \
+ BOOST_PP_CAT(choice, count))
+
+# define BOOST_UNORDERED_DEFAULT_EXPRESSION(count, result) \
+ template <typename U> \
+ static BOOST_PP_CAT(choice, result)::type test( \
+ BOOST_PP_CAT(choice, count))
+
+# define BOOST_UNORDERED_HAS_FUNCTION(name, thing, args, _) \
+ struct BOOST_PP_CAT(has_, name) \
+ { \
+ BOOST_UNORDERED_CHECK_EXPRESSION(1, 1, \
+ boost::unordered::detail::make< thing >().name args); \
+ BOOST_UNORDERED_DEFAULT_EXPRESSION(2, 2); \
+ \
+ enum { value = sizeof(test<T>(choose())) == sizeof(choice1::type) };\
+ }
+
+#else
+
+ template <typename T> struct identity { typedef T type; };
+
+# define BOOST_UNORDERED_CHECK_MEMBER(count, result, name, member) \
+ \
+ typedef typename boost::unordered::detail::identity<member>::type \
+ BOOST_PP_CAT(check, count); \
+ \
+ template <BOOST_PP_CAT(check, count) e> \
+ struct BOOST_PP_CAT(test, count) { \
+ typedef BOOST_PP_CAT(choice, result) type; \
+ }; \
+ \
+ template <class U> static typename \
+ BOOST_PP_CAT(test, count)<&U::name>::type \
+ test(BOOST_PP_CAT(choice, count))
+
+# define BOOST_UNORDERED_DEFAULT_MEMBER(count, result) \
+ template <class U> static BOOST_PP_CAT(choice, result)::type \
+ test(BOOST_PP_CAT(choice, count))
+
+# define BOOST_UNORDERED_HAS_MEMBER(name) \
+ struct BOOST_PP_CAT(has_, name) \
+ { \
+ struct impl { \
+ struct base_mixin { int name; }; \
+ struct base : public T, public base_mixin {}; \
+ \
+ BOOST_UNORDERED_CHECK_MEMBER(1, 1, name, int base_mixin::*); \
+ BOOST_UNORDERED_DEFAULT_MEMBER(2, 2); \
+ \
+ enum { value = sizeof(choice2::type) == \
+ sizeof(test<base>(choose())) \
+ }; \
+ }; \
+ \
+ enum { value = impl::value }; \
+ }
+
+#endif
+
+}}}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Allocator traits
+//
+// First our implementation, then later light wrappers around the alternatives
+
+#if BOOST_UNORDERED_USE_ALLOCATOR_TRAITS == 0
+
+# include <boost/limits.hpp>
+# include <boost/utility/enable_if.hpp>
+# include <boost/pointer_to_other.hpp>
+# if defined(BOOST_NO_SFINAE_EXPR)
+# include <boost/type_traits/is_same.hpp>
+# endif
+
+# if !defined(BOOST_NO_VARIADIC_TEMPLATES) && \
+ !defined(BOOST_NO_SFINAE_EXPR)
+# define BOOST_UNORDERED_DETAIL_FULL_CONSTRUCT 1
+# else
+# define BOOST_UNORDERED_DETAIL_FULL_CONSTRUCT 0
+# endif
+
+namespace boost { namespace unordered { namespace detail {
+
+ // TODO: Does this match std::allocator_traits<Alloc>::rebind_alloc<T>?
+ template <typename Alloc, typename T>
+ struct rebind_wrap
+ {
+ typedef typename Alloc::BOOST_NESTED_TEMPLATE rebind<T>::other type;
+ };
+
+# if defined(BOOST_MSVC) && BOOST_MSVC <= 1400
+
+# define BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(tname) \
+ template <typename Tp, typename Default> \
+ struct default_type_ ## tname { \
+ \
+ template <typename X> \
+ static choice1::type test(choice1, typename X::tname* = 0); \
+ \
+ template <typename X> \
+ static choice2::type test(choice2, void* = 0); \
+ \
+ struct DefaultWrap { typedef Default tname; }; \
+ \
+ enum { value = (1 == sizeof(test<Tp>(choose()))) }; \
+ \
+ typedef typename boost::detail::if_true<value>:: \
+ BOOST_NESTED_TEMPLATE then<Tp, DefaultWrap> \
+ ::type::tname type; \
+ }
+
+# else
+
+ template <typename T, typename T2>
+ struct sfinae : T2 {};
+
+# define BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(tname) \
+ template <typename Tp, typename Default> \
+ struct default_type_ ## tname { \
+ \
+ template <typename X> \
+ static typename boost::unordered::detail::sfinae< \
+ typename X::tname, choice1>::type \
+ test(choice1); \
+ \
+ template <typename X> \
+ static choice2::type test(choice2); \
+ \
+ struct DefaultWrap { typedef Default tname; }; \
+ \
+ enum { value = (1 == sizeof(test<Tp>(choose()))) }; \
+ \
+ typedef typename boost::detail::if_true<value>:: \
+ BOOST_NESTED_TEMPLATE then<Tp, DefaultWrap> \
+ ::type::tname type; \
+ }
+
+# endif
+
+# define BOOST_UNORDERED_DEFAULT_TYPE(T,tname, arg) \
+ typename default_type_ ## tname<T, arg>::type
+
+ BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(pointer);
+ BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(const_pointer);
+ BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(void_pointer);
+ BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(const_void_pointer);
+ BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(difference_type);
+ BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(size_type);
+ BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(propagate_on_container_copy_assignment);
+ BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(propagate_on_container_move_assignment);
+ BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(propagate_on_container_swap);
+
+# if !defined(BOOST_NO_SFINAE_EXPR)
+
+ template <typename T>
+ BOOST_UNORDERED_HAS_FUNCTION(
+ select_on_container_copy_construction, U const, (), 0
+ );
+
+ template <typename T>
+ BOOST_UNORDERED_HAS_FUNCTION(
+ max_size, U const, (), 0
+ );
+
+# if !defined(BOOST_NO_VARIADIC_TEMPLATES)
+
+ template <typename T, typename ValueType, typename... Args>
+ BOOST_UNORDERED_HAS_FUNCTION(
+ construct, U, (
+ boost::unordered::detail::make<ValueType*>(),
+ boost::unordered::detail::make<Args const>()...), 2
+ );
+
+# else
+
+ template <typename T, typename ValueType>
+ BOOST_UNORDERED_HAS_FUNCTION(
+ construct, U, (
+ boost::unordered::detail::make<ValueType*>(),
+ boost::unordered::detail::make<ValueType const>()), 2
+ );
+
+# endif
+
+ template <typename T, typename ValueType>
+ BOOST_UNORDERED_HAS_FUNCTION(
+ destroy, U, (boost::unordered::detail::make<ValueType*>()), 1
+ );
+
+# else
+
+ template <typename T>
+ BOOST_UNORDERED_HAS_MEMBER(select_on_container_copy_construction);
+
+ template <typename T>
+ BOOST_UNORDERED_HAS_MEMBER(max_size);
+
+ template <typename T, typename ValueType>
+ BOOST_UNORDERED_HAS_MEMBER(construct);
+
+ template <typename T, typename ValueType>
+ BOOST_UNORDERED_HAS_MEMBER(destroy);
+
+# endif
+
+ template <typename Alloc>
+ inline Alloc call_select_on_container_copy_construction(const Alloc& rhs,
+ typename boost::enable_if_c<
+ boost::unordered::detail::
+ has_select_on_container_copy_construction<Alloc>::value, void*
+ >::type = 0)
+ {
+ return rhs.select_on_container_copy_construction();
+ }
+
+ template <typename Alloc>
+ inline Alloc call_select_on_container_copy_construction(const Alloc& rhs,
+ typename boost::disable_if_c<
+ boost::unordered::detail::
+ has_select_on_container_copy_construction<Alloc>::value, void*
+ >::type = 0)
+ {
+ return rhs;
+ }
+
+ template <typename SizeType, typename Alloc>
+ inline SizeType call_max_size(const Alloc& a,
+ typename boost::enable_if_c<
+ boost::unordered::detail::has_max_size<Alloc>::value, void*
+ >::type = 0)
+ {
+ return a.max_size();
+ }
+
+ template <typename SizeType, typename Alloc>
+ inline SizeType call_max_size(const Alloc&, typename boost::disable_if_c<
+ boost::unordered::detail::has_max_size<Alloc>::value, void*
+ >::type = 0)
+ {
+ return (std::numeric_limits<SizeType>::max)();
+ }
+
+ template <typename Alloc>
+ struct allocator_traits
+ {
+ typedef Alloc allocator_type;
+ typedef typename Alloc::value_type value_type;
+
+ typedef BOOST_UNORDERED_DEFAULT_TYPE(Alloc, pointer, value_type*)
+ pointer;
+
+ template <typename T>
+ struct pointer_to_other : boost::pointer_to_other<pointer, T> {};
+
+ typedef BOOST_UNORDERED_DEFAULT_TYPE(Alloc, const_pointer,
+ typename pointer_to_other<const value_type>::type)
+ const_pointer;
+
+ //typedef BOOST_UNORDERED_DEFAULT_TYPE(Alloc, void_pointer,
+ // typename pointer_to_other<void>::type)
+ // void_pointer;
+ //
+ //typedef BOOST_UNORDERED_DEFAULT_TYPE(Alloc, const_void_pointer,
+ // typename pointer_to_other<const void>::type)
+ // const_void_pointer;
+
+ typedef BOOST_UNORDERED_DEFAULT_TYPE(Alloc, difference_type,
+ std::ptrdiff_t) difference_type;
+
+ typedef BOOST_UNORDERED_DEFAULT_TYPE(Alloc, size_type, std::size_t)
+ size_type;
+
+ // TODO: rebind_alloc and rebind_traits
+
+ static pointer allocate(Alloc& a, size_type n)
+ { return a.allocate(n); }
+
+ // I never use this, so I'll just comment it out for now.
+ //
+ //static pointer allocate(Alloc& a, size_type n,
+ // const_void_pointer hint)
+ // { return DEFAULT_FUNC(allocate, pointer)(a, n, hint); }
+
+ static void deallocate(Alloc& a, pointer p, size_type n)
+ { a.deallocate(p, n); }
+
+ public:
+
+# if BOOST_UNORDERED_DETAIL_FULL_CONSTRUCT
+
+ template <typename T, typename... Args>
+ static typename boost::enable_if_c<
+ boost::unordered::detail::has_construct<Alloc, T, Args...>
+ ::value>::type
+ construct(Alloc& a, T* p, BOOST_FWD_REF(Args)... x)
+ {
+ a.construct(p, boost::forward<Args>(x)...);
+ }
+
+ template <typename T, typename... Args>
+ static typename boost::disable_if_c<
+ boost::unordered::detail::has_construct<Alloc, T, Args...>
+ ::value>::type
+ construct(Alloc&, T* p, BOOST_FWD_REF(Args)... x)
+ {
+ new ((void*) p) T(boost::forward<Args>(x)...);
+ }
+
+ template <typename T>
+ static typename boost::enable_if_c<
+ boost::unordered::detail::has_destroy<Alloc, T>::value>::type
+ destroy(Alloc& a, T* p)
+ {
+ a.destroy(p);
+ }
+
+ template <typename T>
+ static typename boost::disable_if_c<
+ boost::unordered::detail::has_destroy<Alloc, T>::value>::type
+ destroy(Alloc&, T* p)
+ {
+ boost::unordered::detail::destroy(p);
+ }
+
+# elif !defined(BOOST_NO_SFINAE_EXPR)
+
+ template <typename T>
+ static typename boost::enable_if_c<
+ boost::unordered::detail::has_construct<Alloc, T>::value>::type
+ construct(Alloc& a, T* p, T const& x)
+ {
+ a.construct(p, x);
+ }
+
+ template <typename T>
+ static typename boost::disable_if_c<
+ boost::unordered::detail::has_construct<Alloc, T>::value>::type
+ construct(Alloc&, T* p, T const& x)
+ {
+ new ((void*) p) T(x);
+ }
+
+ template <typename T>
+ static typename boost::enable_if_c<
+ boost::unordered::detail::has_destroy<Alloc, T>::value>::type
+ destroy(Alloc& a, T* p)
+ {
+ a.destroy(p);
+ }
+
+ template <typename T>
+ static typename boost::disable_if_c<
+ boost::unordered::detail::has_destroy<Alloc, T>::value>::type
+ destroy(Alloc&, T* p)
+ {
+ boost::unordered::detail::destroy(p);
+ }
+
+# else
+
+ // If we don't have SFINAE expressions, only call construct for the
+ // copy constructor for the allocator's value_type - as that's
+ // the only construct method that old fashioned allocators support.
+
+ template <typename T>
+ static void construct(Alloc& a, T* p, T const& x,
+ typename boost::enable_if_c<
+ boost::unordered::detail::has_construct<Alloc, T>::value &&
+ boost::is_same<T, value_type>::value,
+ void*>::type = 0)
+ {
+ a.construct(p, x);
+ }
+
+ template <typename T>
+ static void construct(Alloc&, T* p, T const& x,
+ typename boost::disable_if_c<
+ boost::unordered::detail::has_construct<Alloc, T>::value &&
+ boost::is_same<T, value_type>::value,
+ void*>::type = 0)
+ {
+ new ((void*) p) T(x);
+ }
+
+ template <typename T>
+ static void destroy(Alloc& a, T* p,
+ typename boost::enable_if_c<
+ boost::unordered::detail::has_destroy<Alloc, T>::value &&
+ boost::is_same<T, value_type>::value,
+ void*>::type = 0)
+ {
+ a.destroy(p);
+ }
+
+ template <typename T>
+ static void destroy(Alloc&, T* p,
+ typename boost::disable_if_c<
+ boost::unordered::detail::has_destroy<Alloc, T>::value &&
+ boost::is_same<T, value_type>::value,
+ void*>::type = 0)
+ {
+ boost::unordered::detail::destroy(p);
+ }
+
+# endif
+
+ static size_type max_size(const Alloc& a)
+ {
+ return boost::unordered::detail::call_max_size<size_type>(a);
+ }
+
+ // Allocator propagation on construction
+
+ static Alloc select_on_container_copy_construction(Alloc const& rhs)
+ {
+ return boost::unordered::detail::
+ call_select_on_container_copy_construction(rhs);
+ }
+
+ // Allocator propagation on assignment and swap.
+ // Return true if lhs is modified.
+ typedef BOOST_UNORDERED_DEFAULT_TYPE(
+ Alloc, propagate_on_container_copy_assignment, false_type)
+ propagate_on_container_copy_assignment;
+ typedef BOOST_UNORDERED_DEFAULT_TYPE(
+ Alloc,propagate_on_container_move_assignment, false_type)
+ propagate_on_container_move_assignment;
+ typedef BOOST_UNORDERED_DEFAULT_TYPE(
+ Alloc,propagate_on_container_swap,false_type)
+ propagate_on_container_swap;
+ };
+}}}
+
+# undef BOOST_UNORDERED_DEFAULT_TYPE_TMPLT
+# undef BOOST_UNORDERED_DEFAULT_TYPE
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// std::allocator_traits
+
+#elif BOOST_UNORDERED_USE_ALLOCATOR_TRAITS == 1
+
+# include <memory>
+
+# define BOOST_UNORDERED_DETAIL_FULL_CONSTRUCT 1
+
+namespace boost { namespace unordered { namespace detail {
+
+ template <typename Alloc>
+ struct allocator_traits : std::allocator_traits<Alloc> {};
+
+ template <typename Alloc, typename T>
+ struct rebind_wrap
+ {
+ typedef typename std::allocator_traits<Alloc>::
+ template rebind_alloc<T> type;
+ };
+}}}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// boost::container::allocator_traits
+
+#elif BOOST_UNORDERED_USE_ALLOCATOR_TRAITS == 2
+
+# include <boost/container/allocator_traits.hpp>
+
+# define BOOST_UNORDERED_DETAIL_FULL_CONSTRUCT 0
+
+namespace boost { namespace unordered { namespace detail {
+
+ template <typename Alloc>
+ struct allocator_traits :
+ boost::container::allocator_traits<Alloc> {};
+
+ template <typename Alloc, typename T>
+ struct rebind_wrap :
+ boost::container::allocator_traits<Alloc>::
+ template portable_rebind_alloc<T>
+ {};
+
+}}}
+
+#else
+
+#error "Invalid BOOST_UNORDERED_USE_ALLOCATOR_TRAITS value."
+
+#endif
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Some helper functions for allocating & constructing
+
+namespace boost { namespace unordered { namespace detail {
+
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // construct_node/destroy_node
+ //
+ // Construct a node using the best available method.
+
+#if BOOST_UNORDERED_DETAIL_FULL_CONSTRUCT
+
+ template <typename Alloc, typename T, BOOST_UNORDERED_EMPLACE_TEMPLATE>
+ inline void construct_node(Alloc& a, T* p, BOOST_UNORDERED_EMPLACE_ARGS)
+ {
+ boost::unordered::detail::allocator_traits<Alloc>::construct(
+ a, p, BOOST_UNORDERED_EMPLACE_FORWARD);
+ }
+
+ template <typename Alloc, typename T>
+ inline void destroy_node(Alloc& a, T* p)
+ {
+ boost::unordered::detail::allocator_traits<Alloc>::destroy(a, p);
+ }
+
+#else
+
+ template <typename AllocTraits, typename T>
+ struct value_construct
+ {
+ typedef BOOST_DEDUCED_TYPENAME AllocTraits::allocator_type allocator;
+
+ allocator& alloc;
+ T* ptr;
+
+ value_construct(allocator& a, T* p) : alloc(a), ptr(p)
+ {
+ AllocTraits::construct(alloc, ptr, T());
+ }
+
+ void release()
+ {
+ ptr = 0;
+ }
+
+ ~value_construct()
+ {
+ if (ptr) AllocTraits::destroy(alloc, ptr);
+ }
+
+ private:
+ value_construct(value_construct const&);
+ value_construct& operator=(value_construct const&);
+ };
+
+ template <typename Alloc, typename T, BOOST_UNORDERED_EMPLACE_TEMPLATE>
+ inline void construct_node(Alloc& a, T* p, BOOST_UNORDERED_EMPLACE_ARGS)
+ {
+ value_construct<boost::unordered::detail::allocator_traits<Alloc>, T>
+ construct_guard(a, p);
+ boost::unordered::detail::construct_impl(
+ p->value_ptr(), BOOST_UNORDERED_EMPLACE_FORWARD);
+ construct_guard.release();
+ }
+
+ template <typename Alloc, typename T>
+ inline void destroy_node(Alloc& a, T* p)
+ {
+ boost::unordered::detail::destroy(p->value_ptr());
+ boost::unordered::detail::allocator_traits<Alloc>::destroy(a, p);
+ }
+
+#endif
+
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // array_constructor
+ //
+ // Allocate and construct an array in an exception safe manner, and
+ // clean up if an exception is thrown before the container takes charge
+ // of it.
+
+ template <typename Allocator>
+ struct array_constructor
+ {
+ typedef boost::unordered::detail::allocator_traits<Allocator> traits;
+ typedef typename traits::pointer pointer;
+
+ Allocator& alloc_;
+ pointer ptr_;
+ pointer constructed_;
+ std::size_t length_;
+
+ array_constructor(Allocator& a)
+ : alloc_(a), ptr_(), constructed_(), length_(0)
+ {
+ constructed_ = pointer();
+ ptr_ = pointer();
+ }
+
+ ~array_constructor() {
+ if (ptr_) {
+ for(pointer p = ptr_; p != constructed_; ++p)
+ traits::destroy(alloc_, boost::addressof(*p));
+
+ traits::deallocate(alloc_, ptr_, length_);
+ }
+ }
+
+ template <typename V>
+ void construct(V const& v, std::size_t l)
+ {
+ BOOST_ASSERT(!ptr_);
+ length_ = l;
+ ptr_ = traits::allocate(alloc_, length_);
+ pointer end = ptr_ + static_cast<std::ptrdiff_t>(length_);
+ for(constructed_ = ptr_; constructed_ != end; ++constructed_)
+ traits::construct(alloc_, boost::addressof(*constructed_), v);
+ }
+
+ pointer get() const
+ {
+ return ptr_;
+ }
+
+ pointer release()
+ {
+ pointer p(ptr_);
+ ptr_ = pointer();
+ return p;
+ }
+
+ private:
+
+ array_constructor(array_constructor const&);
+ array_constructor& operator=(array_constructor const&);
+ };
+}}}
+
+#if defined(BOOST_MSVC)
+#pragma warning(pop)
+#endif
+
+#endif
diff --git a/boost/unordered/detail/allocator_helpers.hpp b/boost/unordered/detail/allocator_helpers.hpp
deleted file mode 100644
index dbba504698..0000000000
--- a/boost/unordered/detail/allocator_helpers.hpp
+++ /dev/null
@@ -1,523 +0,0 @@
-
-// Copyright 2005-2011 Daniel James.
-// Copyright 2009 Pablo Halpern.
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-// Allocator traits written by Daniel James based on Pablo Halpern's
-// implementation.
-
-#ifndef BOOST_UNORDERED_DETAIL_ALLOCATOR_UTILITIES_HPP_INCLUDED
-#define BOOST_UNORDERED_DETAIL_ALLOCATOR_UTILITIES_HPP_INCLUDED
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
-# pragma once
-#endif
-
-#include <boost/config.hpp>
-#include <boost/detail/select_type.hpp>
-#include <boost/utility/enable_if.hpp>
-#include <boost/preprocessor/cat.hpp>
-#include <boost/preprocessor/enum.hpp>
-#include <boost/limits.hpp>
-#include <boost/type_traits/add_lvalue_reference.hpp>
-#include <boost/pointer_to_other.hpp>
-#include <boost/assert.hpp>
-#include <boost/utility/addressof.hpp>
-
-#if !defined(BOOST_UNORDERED_USE_ALLOCATOR_TRAITS)
-#define BOOST_UNORDERED_USE_ALLOCATOR_TRAITS 0
-#endif
-
-#if BOOST_UNORDERED_USE_ALLOCATOR_TRAITS
-# include <memory>
-#endif
-
-#if !defined(BOOST_NO_0X_HDR_TYPE_TRAITS)
-# include <type_traits>
-#endif
-
-namespace boost { namespace unordered { namespace detail {
-
- ////////////////////////////////////////////////////////////////////////////
- // Integral_constrant, true_type, false_type
- //
- // Uses the standard versions if available.
-
-#if !defined(BOOST_NO_0X_HDR_TYPE_TRAITS)
-
- using std::integral_constant;
- using std::true_type;
- using std::false_type;
-
-#else
-
- template <typename T, T Value>
- struct integral_constant { enum { value = Value }; };
-
- typedef boost::unordered::detail::integral_constant<bool, true> true_type;
- typedef boost::unordered::detail::integral_constant<bool, false> false_type;
-
-#endif
-
- ////////////////////////////////////////////////////////////////////////////
- // Explicitly call a destructor
-
-#if defined(BOOST_MSVC)
-#pragma warning(push)
-#pragma warning(disable:4100) // unreferenced formal parameter
-#endif
-
- template <class T>
- inline void destroy(T* x) {
- x->~T();
- }
-
-#if defined(BOOST_MSVC)
-#pragma warning(pop)
-#endif
-
- ////////////////////////////////////////////////////////////////////////////
- // Bits and pieces for implementing traits
- //
- // Some of these are also used elsewhere
-
- template <typename T> typename boost::add_lvalue_reference<T>::type make();
- struct choice9 { typedef char (&type)[9]; };
- struct choice8 : choice9 { typedef char (&type)[8]; };
- struct choice7 : choice8 { typedef char (&type)[7]; };
- struct choice6 : choice7 { typedef char (&type)[6]; };
- struct choice5 : choice6 { typedef char (&type)[5]; };
- struct choice4 : choice5 { typedef char (&type)[4]; };
- struct choice3 : choice4 { typedef char (&type)[3]; };
- struct choice2 : choice3 { typedef char (&type)[2]; };
- struct choice1 : choice2 { typedef char (&type)[1]; };
- choice1 choose();
-
- typedef choice1::type yes_type;
- typedef choice2::type no_type;
-
- struct private_type
- {
- private_type const &operator,(int) const;
- };
-
- template <typename T>
- no_type is_private_type(T const&);
- yes_type is_private_type(private_type const&);
-
- struct convert_from_anything {
- template <typename T>
- convert_from_anything(T const&);
- };
-
-#if !defined(BOOST_NO_SFINAE_EXPR)
-
-# define BOOST_UNORDERED_HAVE_CALL_DETECTION 1
-
- template <typename T, unsigned int> struct expr_test;
- template <typename T> struct expr_test<T, sizeof(char)> : T {};
- template <typename U> static char for_expr_test(U const&);
-
-#define BOOST_UNORDERED_CHECK_EXPRESSION(count, result, expression) \
- template <typename U> \
- static typename boost::unordered::detail::expr_test< \
- BOOST_PP_CAT(choice, result), \
- sizeof(boost::unordered::detail::for_expr_test(( \
- (expression), \
- 0)))>::type test( \
- BOOST_PP_CAT(choice, count))
-
-#define BOOST_UNORDERED_DEFAULT_EXPRESSION(count, result) \
- template <typename U> \
- static BOOST_PP_CAT(choice, result)::type test( \
- BOOST_PP_CAT(choice, count))
-
-#define BOOST_UNORDERED_HAS_FUNCTION(name, thing, args, _) \
- struct BOOST_PP_CAT(has_, name) \
- { \
- BOOST_UNORDERED_CHECK_EXPRESSION(1, 1, \
- boost::unordered::detail::make< thing >().name args); \
- BOOST_UNORDERED_DEFAULT_EXPRESSION(2, 2); \
- \
- enum { value = sizeof(test<T>(choose())) == sizeof(choice1::type) };\
- }
-
-#else
-
-# define BOOST_UNORDERED_HAVE_CALL_DETECTION 0
-
- template <typename T> struct identity { typedef T type; };
-
-#define BOOST_UNORDERED_CHECK_MEMBER(count, result, name, member) \
- \
- typedef typename boost::unordered::detail::identity<member>::type \
- BOOST_PP_CAT(check, count); \
- \
- template <BOOST_PP_CAT(check, count) e> \
- struct BOOST_PP_CAT(test, count) { \
- typedef BOOST_PP_CAT(choice, result) type; \
- }; \
- \
- template <class U> static typename \
- BOOST_PP_CAT(test, count)<&U::name>::type \
- test(BOOST_PP_CAT(choice, count))
-
-#define BOOST_UNORDERED_DEFAULT_MEMBER(count, result) \
- template <class U> static BOOST_PP_CAT(choice, result)::type \
- test(BOOST_PP_CAT(choice, count))
-
-#define BOOST_UNORDERED_HAS_MEMBER(name) \
- struct BOOST_PP_CAT(has_, name) \
- { \
- struct impl { \
- struct base_mixin { int name; }; \
- struct base : public T, public base_mixin {}; \
- \
- BOOST_UNORDERED_CHECK_MEMBER(1, 1, name, int base_mixin::*); \
- BOOST_UNORDERED_DEFAULT_MEMBER(2, 2); \
- \
- enum { value = sizeof(choice2::type) == \
- sizeof(test<base>(choose())) \
- }; \
- }; \
- \
- enum { value = impl::value }; \
- }
-
-#endif
-
- ////////////////////////////////////////////////////////////////////////////
- // Allocator traits
- //
- // Uses the standard versions if available.
- // (although untested as I don't have access to a standard version yet)
-
-#if BOOST_UNORDERED_USE_ALLOCATOR_TRAITS
-
- template <typename Alloc>
- struct allocator_traits : std::allocator_traits<Alloc> {};
-
- template <typename Alloc, typename T>
- struct rebind_wrap
- {
- typedef typename std::allocator_traits<Alloc>::
- template rebind_alloc<T> type;
- };
-
-#else
-
- // TODO: Does this match std::allocator_traits<Alloc>::rebind_alloc<T>?
- template <typename Alloc, typename T>
- struct rebind_wrap
- {
- typedef typename Alloc::BOOST_NESTED_TEMPLATE rebind<T>::other
- type;
- };
-
-#if defined(BOOST_MSVC) && BOOST_MSVC <= 1400
-
- #define BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(tname) \
- template <typename Tp, typename Default> \
- struct default_type_ ## tname { \
- \
- template <typename X> \
- static choice1::type test(choice1, typename X::tname* = 0); \
- \
- template <typename X> \
- static choice2::type test(choice2, void* = 0); \
- \
- struct DefaultWrap { typedef Default tname; }; \
- \
- enum { value = (1 == sizeof(test<Tp>(choose()))) }; \
- \
- typedef typename boost::detail::if_true<value>:: \
- BOOST_NESTED_TEMPLATE then<Tp, DefaultWrap> \
- ::type::tname type; \
- }
-
-#else
-
- template <typename T, typename T2>
- struct sfinae : T2 {};
-
- #define BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(tname) \
- template <typename Tp, typename Default> \
- struct default_type_ ## tname { \
- \
- template <typename X> \
- static typename boost::unordered::detail::sfinae< \
- typename X::tname, choice1>::type \
- test(choice1); \
- \
- template <typename X> \
- static choice2::type test(choice2); \
- \
- struct DefaultWrap { typedef Default tname; }; \
- \
- enum { value = (1 == sizeof(test<Tp>(choose()))) }; \
- \
- typedef typename boost::detail::if_true<value>:: \
- BOOST_NESTED_TEMPLATE then<Tp, DefaultWrap> \
- ::type::tname type; \
- }
-
-#endif
-
- #define BOOST_UNORDERED_DEFAULT_TYPE(T,tname, arg) \
- typename default_type_ ## tname<T, arg>::type
-
- BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(pointer);
- BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(const_pointer);
- BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(void_pointer);
- BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(const_void_pointer);
- BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(difference_type);
- BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(size_type);
- BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(propagate_on_container_copy_assignment);
- BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(propagate_on_container_move_assignment);
- BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(propagate_on_container_swap);
-
-#if BOOST_UNORDERED_HAVE_CALL_DETECTION
- template <typename T>
- BOOST_UNORDERED_HAS_FUNCTION(
- select_on_container_copy_construction, U const, (), 0
- );
-
- template <typename T>
- BOOST_UNORDERED_HAS_FUNCTION(
- max_size, U const, (), 0
- );
-
- template <typename T, typename ValueType>
- BOOST_UNORDERED_HAS_FUNCTION(
- construct, U, (
- boost::unordered::detail::make<ValueType*>(),
- boost::unordered::detail::make<ValueType const>()), 2
- );
-
- template <typename T, typename ValueType>
- BOOST_UNORDERED_HAS_FUNCTION(
- destroy, U, (boost::unordered::detail::make<ValueType*>()), 1
- );
-#else
- template <typename T>
- BOOST_UNORDERED_HAS_MEMBER(select_on_container_copy_construction);
-
- template <typename T>
- BOOST_UNORDERED_HAS_MEMBER(max_size);
-
- template <typename T, typename ValueType>
- BOOST_UNORDERED_HAS_MEMBER(construct);
-
- template <typename T, typename ValueType>
- BOOST_UNORDERED_HAS_MEMBER(destroy);
-#endif
-
- template <typename Alloc>
- inline typename boost::enable_if_c<
- boost::unordered::detail::
- has_select_on_container_copy_construction<Alloc>::value, Alloc
- >::type call_select_on_container_copy_construction(const Alloc& rhs)
- {
- return rhs.select_on_container_copy_construction();
- }
-
- template <typename Alloc>
- inline typename boost::disable_if_c<
- boost::unordered::detail::
- has_select_on_container_copy_construction<Alloc>::value, Alloc
- >::type call_select_on_container_copy_construction(const Alloc& rhs)
- {
- return rhs;
- }
-
- template <typename SizeType, typename Alloc>
- inline typename boost::enable_if_c<
- boost::unordered::detail::has_max_size<Alloc>::value, SizeType
- >::type call_max_size(const Alloc& a)
- {
- return a.max_size();
- }
-
- template <typename SizeType, typename Alloc>
- inline typename boost::disable_if_c<
- boost::unordered::detail::has_max_size<Alloc>::value, SizeType
- >::type call_max_size(const Alloc&)
- {
- return (std::numeric_limits<SizeType>::max)();
- }
-
- template <typename Alloc>
- struct allocator_traits
- {
- typedef Alloc allocator_type;
- typedef typename Alloc::value_type value_type;
-
- typedef BOOST_UNORDERED_DEFAULT_TYPE(Alloc, pointer, value_type*)
- pointer;
-
- template <typename T>
- struct pointer_to_other : boost::pointer_to_other<pointer, T> {};
-
- typedef BOOST_UNORDERED_DEFAULT_TYPE(Alloc, const_pointer,
- typename pointer_to_other<const value_type>::type)
- const_pointer;
-
- //typedef BOOST_UNORDERED_DEFAULT_TYPE(Alloc, void_pointer,
- // typename pointer_to_other<void>::type)
- // void_pointer;
- //
- //typedef BOOST_UNORDERED_DEFAULT_TYPE(Alloc, const_void_pointer,
- // typename pointer_to_other<const void>::type)
- // const_void_pointer;
-
- typedef BOOST_UNORDERED_DEFAULT_TYPE(Alloc, difference_type,
- std::ptrdiff_t) difference_type;
-
- typedef BOOST_UNORDERED_DEFAULT_TYPE(Alloc, size_type, std::size_t)
- size_type;
-
- // TODO: rebind_alloc and rebind_traits
-
- static pointer allocate(Alloc& a, size_type n)
- { return a.allocate(n); }
-
- // I never use this, so I'll just comment it out for now.
- //
- //static pointer allocate(Alloc& a, size_type n,
- // const_void_pointer hint)
- // { return DEFAULT_FUNC(allocate, pointer)(a, n, hint); }
-
- static void deallocate(Alloc& a, pointer p, size_type n)
- { a.deallocate(p, n); }
-
- public:
-
- // Only supporting the basic copy constructor for now.
-
- template <typename T>
- static typename boost::enable_if_c<
- boost::unordered::detail::has_construct<Alloc, T>::value>::type
- construct(Alloc& a, T* p, T const& x)
- {
- a.construct(p, x);
- }
-
- template <typename T>
- static typename boost::disable_if_c<
- boost::unordered::detail::has_construct<Alloc, T>::value>::type
- construct(Alloc&, T* p, T const& x)
- {
- new ((void*) p) T(x);
- }
-
- template <typename T>
- static typename boost::enable_if_c<
- boost::unordered::detail::has_destroy<Alloc, T>::value>::type
- destroy(Alloc& a, T* p)
- {
- a.destroy(p);
- }
-
- template <typename T>
- static typename boost::disable_if_c<
- boost::unordered::detail::has_destroy<Alloc, T>::value>::type
- destroy(Alloc&, T* p)
- {
- boost::unordered::detail::destroy(p);
- }
-
- static size_type max_size(const Alloc& a)
- {
- return boost::unordered::detail::call_max_size<size_type>(a);
- }
-
- // Allocator propagation on construction
-
- static Alloc select_on_container_copy_construction(Alloc const& rhs)
- {
- return boost::unordered::detail::
- call_select_on_container_copy_construction(rhs);
- }
-
- // Allocator propagation on assignment and swap.
- // Return true if lhs is modified.
- typedef BOOST_UNORDERED_DEFAULT_TYPE(
- Alloc, propagate_on_container_copy_assignment, false_type)
- propagate_on_container_copy_assignment;
- typedef BOOST_UNORDERED_DEFAULT_TYPE(
- Alloc,propagate_on_container_move_assignment, false_type)
- propagate_on_container_move_assignment;
- typedef BOOST_UNORDERED_DEFAULT_TYPE(
- Alloc,propagate_on_container_swap,false_type)
- propagate_on_container_swap;
- };
-
-#undef BOOST_UNORDERED_DEFAULT_TYPE_TMPLT
-#undef BOOST_UNORDERED_DEFAULT_TYPE
-
-#endif
-
- // array_constructor
- //
- // Allocate and construct an array in an exception safe manner, and
- // clean up if an exception is thrown before the container takes charge
- // of it.
-
- template <typename Allocator>
- struct array_constructor
- {
- typedef boost::unordered::detail::allocator_traits<Allocator> traits;
- typedef typename traits::pointer pointer;
-
- Allocator& alloc_;
- pointer ptr_;
- pointer constructed_;
- std::size_t length_;
-
- array_constructor(Allocator& a)
- : alloc_(a), ptr_(), constructed_(), length_(0)
- {
- constructed_ = pointer();
- ptr_ = pointer();
- }
-
- ~array_constructor() {
- if (ptr_) {
- for(pointer p = ptr_; p != constructed_; ++p)
- traits::destroy(alloc_, boost::addressof(*p));
-
- traits::deallocate(alloc_, ptr_, length_);
- }
- }
-
- template <typename V>
- void construct(V const& v, std::size_t l)
- {
- BOOST_ASSERT(!ptr_);
- length_ = l;
- ptr_ = traits::allocate(alloc_, length_);
- pointer end = ptr_ + static_cast<std::ptrdiff_t>(length_);
- for(constructed_ = ptr_; constructed_ != end; ++constructed_)
- traits::construct(alloc_, boost::addressof(*constructed_), v);
- }
-
- pointer get() const
- {
- return ptr_;
- }
-
- pointer release()
- {
- pointer p(ptr_);
- ptr_ = pointer();
- return p;
- }
- private:
- array_constructor(array_constructor const&);
- array_constructor& operator=(array_constructor const&);
- };
-}}}
-
-#endif
diff --git a/boost/unordered/detail/buckets.hpp b/boost/unordered/detail/buckets.hpp
index 7492220b16..85681a685c 100644
--- a/boost/unordered/detail/buckets.hpp
+++ b/boost/unordered/detail/buckets.hpp
@@ -12,12 +12,13 @@
#endif
#include <boost/unordered/detail/util.hpp>
-#include <boost/unordered/detail/allocator_helpers.hpp>
-#include <boost/unordered/detail/emplace_args.hpp>
+#include <boost/unordered/detail/allocate.hpp>
#include <boost/type_traits/aligned_storage.hpp>
#include <boost/type_traits/alignment_of.hpp>
#include <boost/swap.hpp>
#include <boost/assert.hpp>
+#include <boost/limits.hpp>
+#include <boost/iterator.hpp>
#if defined(BOOST_MSVC)
#pragma warning(push)
@@ -29,7 +30,10 @@ namespace boost { namespace unordered { namespace detail {
template <typename Types> struct table;
template <typename NodePointer> struct bucket;
struct ptr_bucket;
- template <typename A, typename Bucket, typename Node> struct buckets;
+ template <typename A, typename Bucket, typename Node, typename Policy>
+ struct buckets;
+ template <typename Types> struct table_impl;
+ template <typename Types> struct grouped_table_impl;
///////////////////////////////////////////////////////////////////
//
@@ -49,16 +53,14 @@ namespace boost { namespace unordered { namespace detail {
node_allocator& alloc_;
node_pointer node_;
- bool node_constructed_;
- bool value_constructed_;
+ bool constructed_;
public:
node_constructor(node_allocator& n) :
alloc_(n),
node_(),
- node_constructed_(false),
- value_constructed_(false)
+ constructed_(false)
{
}
@@ -69,26 +71,36 @@ namespace boost { namespace unordered { namespace detail {
template <BOOST_UNORDERED_EMPLACE_TEMPLATE>
void construct_value(BOOST_UNORDERED_EMPLACE_ARGS)
{
- BOOST_ASSERT(node_ && node_constructed_ && !value_constructed_);
- boost::unordered::detail::construct_impl(
- node_->value_ptr(), BOOST_UNORDERED_EMPLACE_FORWARD);
- value_constructed_ = true;
+ BOOST_ASSERT(node_ && !constructed_);
+ boost::unordered::detail::construct_node(alloc_,
+ boost::addressof(*node_), BOOST_UNORDERED_EMPLACE_FORWARD);
+ node_->init(static_cast<typename node::link_pointer>(node_));
+ constructed_ = true;
}
template <typename A0>
void construct_value2(BOOST_FWD_REF(A0) a0)
{
- BOOST_ASSERT(node_ && node_constructed_ && !value_constructed_);
- boost::unordered::detail::construct_impl2(
- node_->value_ptr(), boost::forward<A0>(a0));
- value_constructed_ = true;
+ BOOST_ASSERT(node_ && !constructed_);
+
+ boost::unordered::detail::construct_node(alloc_,
+ boost::addressof(*node_),
+ BOOST_UNORDERED_EMPLACE_ARGS1(boost::forward<A0>(a0)));
+
+ constructed_ = true;
+ node_->init(static_cast<typename node::link_pointer>(node_));
}
value_type const& value() const {
- BOOST_ASSERT(node_ && node_constructed_ && value_constructed_);
+ BOOST_ASSERT(node_ && constructed_);
return node_->value();
}
+ node_pointer get()
+ {
+ return node_;
+ }
+
// no throw
node_pointer release()
{
@@ -106,12 +118,8 @@ namespace boost { namespace unordered { namespace detail {
node_constructor<Alloc>::~node_constructor()
{
if (node_) {
- if (value_constructed_) {
- boost::unordered::detail::destroy(node_->value_ptr());
- }
-
- if (node_constructed_) {
- node_allocator_traits::destroy(alloc_,
+ if (constructed_) {
+ boost::unordered::detail::destroy_node(alloc_,
boost::addressof(*node_));
}
@@ -123,24 +131,13 @@ namespace boost { namespace unordered { namespace detail {
void node_constructor<Alloc>::construct_node()
{
if(!node_) {
- node_constructed_ = false;
- value_constructed_ = false;
-
+ constructed_ = false;
node_ = node_allocator_traits::allocate(alloc_, 1);
-
- node_allocator_traits::construct(alloc_,
- boost::addressof(*node_), node());
- node_->init(static_cast<typename node::link_pointer>(node_));
- node_constructed_ = true;
}
- else {
- BOOST_ASSERT(node_constructed_);
-
- if (value_constructed_)
- {
- boost::unordered::detail::destroy(node_->value_ptr());
- value_constructed_ = false;
- }
+ else if (constructed_) {
+ boost::unordered::detail::destroy_node(alloc_,
+ boost::addressof(*node_));
+ constructed_ = false;
}
}
@@ -179,12 +176,373 @@ namespace boost { namespace unordered { namespace detail {
enum { extra_node = false };
};
+ template <typename LinkPointer>
+ struct node_base
+ {
+ typedef LinkPointer link_pointer;
+ link_pointer next_;
+
+ node_base() : next_() {}
+ };
+
+}}}
+
+namespace boost { namespace unordered { namespace iterator_detail {
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Iterators
+ //
+ // all no throw
+
+ template <typename NodePointer, typename Value> struct iterator;
+ template <typename ConstNodePointer, typename NodePointer,
+ typename Value> struct c_iterator;
+ template <typename NodePointer, typename Value, typename Policy>
+ struct l_iterator;
+ template <typename ConstNodePointer, typename NodePointer,
+ typename Value, typename Policy> struct cl_iterator;
+
+ // Local Iterators
+ //
+ // all no throw
+
+ template <typename NodePointer, typename Value, typename Policy>
+ struct l_iterator
+ : public boost::iterator<
+ std::forward_iterator_tag, Value, std::ptrdiff_t,
+ NodePointer, Value&>
+ {
+#if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
+ template <typename ConstNodePointer, typename NodePointer2,
+ typename Value2, typename Policy2>
+ friend struct boost::unordered::iterator_detail::cl_iterator;
+ private:
+#endif
+ typedef NodePointer node_pointer;
+ typedef boost::unordered::iterator_detail::iterator<NodePointer, Value>
+ iterator;
+ node_pointer ptr_;
+ std::size_t bucket_;
+ std::size_t bucket_count_;
+
+ public:
+
+ l_iterator() : ptr_() {}
+
+ l_iterator(iterator x, std::size_t b, std::size_t c)
+ : ptr_(x.node_), bucket_(b), bucket_count_(c) {}
+
+ Value& operator*() const {
+ return ptr_->value();
+ }
+
+ Value* operator->() const {
+ return ptr_->value_ptr();
+ }
+
+ l_iterator& operator++() {
+ ptr_ = static_cast<node_pointer>(ptr_->next_);
+ if (ptr_ && Policy::to_bucket(bucket_count_, ptr_->hash_)
+ != bucket_)
+ ptr_ = node_pointer();
+ return *this;
+ }
+
+ l_iterator operator++(int) {
+ l_iterator tmp(*this);
+ ++(*this);
+ return tmp;
+ }
+
+ bool operator==(l_iterator x) const {
+ return ptr_ == x.ptr_;
+ }
+
+ bool operator!=(l_iterator x) const {
+ return ptr_ != x.ptr_;
+ }
+ };
+
+ template <typename ConstNodePointer, typename NodePointer, typename Value,
+ typename Policy>
+ struct cl_iterator
+ : public boost::iterator<
+ std::forward_iterator_tag, Value, std::ptrdiff_t,
+ ConstNodePointer, Value const&>
+ {
+ friend struct boost::unordered::iterator_detail::l_iterator
+ <NodePointer, Value, Policy>;
+ private:
+
+ typedef NodePointer node_pointer;
+ typedef boost::unordered::iterator_detail::iterator<NodePointer, Value>
+ iterator;
+ node_pointer ptr_;
+ std::size_t bucket_;
+ std::size_t bucket_count_;
+
+ public:
+
+ cl_iterator() : ptr_() {}
+
+ cl_iterator(iterator x, std::size_t b, std::size_t c) :
+ ptr_(x.node_), bucket_(b), bucket_count_(c) {}
+
+ cl_iterator(boost::unordered::iterator_detail::l_iterator<
+ NodePointer, Value, Policy> const& x) :
+ ptr_(x.ptr_), bucket_(x.bucket_), bucket_count_(x.bucket_count_)
+ {}
+
+ Value const&
+ operator*() const {
+ return ptr_->value();
+ }
+
+ Value const* operator->() const {
+ return ptr_->value_ptr();
+ }
+
+ cl_iterator& operator++() {
+ ptr_ = static_cast<node_pointer>(ptr_->next_);
+ if (ptr_ && Policy::to_bucket(bucket_count_, ptr_->hash_)
+ != bucket_)
+ ptr_ = node_pointer();
+ return *this;
+ }
+
+ cl_iterator operator++(int) {
+ cl_iterator tmp(*this);
+ ++(*this);
+ return tmp;
+ }
+
+ friend bool operator==(cl_iterator const& x, cl_iterator const& y) {
+ return x.ptr_ == y.ptr_;
+ }
+
+ friend bool operator!=(cl_iterator const& x, cl_iterator const& y) {
+ return x.ptr_ != y.ptr_;
+ }
+ };
+
+ template <typename NodePointer, typename Value>
+ struct iterator
+ : public boost::iterator<
+ std::forward_iterator_tag, Value, std::ptrdiff_t,
+ NodePointer, Value&>
+ {
+#if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
+ template <typename, typename, typename>
+ friend struct boost::unordered::iterator_detail::c_iterator;
+ template <typename, typename, typename>
+ friend struct boost::unordered::iterator_detail::l_iterator;
+ template <typename, typename, typename, typename>
+ friend struct boost::unordered::iterator_detail::cl_iterator;
+ template <typename>
+ friend struct boost::unordered::detail::table;
+ template <typename, typename, typename, typename>
+ friend struct boost::unordered::detail::buckets;
+ template <typename>
+ friend struct boost::unordered::detail::table_impl;
+ template <typename>
+ friend struct boost::unordered::detail::grouped_table_impl;
+ private:
+#endif
+ typedef NodePointer node_pointer;
+ node_pointer node_;
+
+ public:
+
+ iterator() : node_() {}
+
+ explicit iterator(node_pointer const& x) : node_(x) {}
+
+ Value& operator*() const {
+ return node_->value();
+ }
+
+ Value* operator->() const {
+ return &node_->value();
+ }
+
+ iterator& operator++() {
+ node_ = static_cast<node_pointer>(node_->next_);
+ return *this;
+ }
+
+ iterator operator++(int) {
+ iterator tmp(node_);
+ node_ = static_cast<node_pointer>(node_->next_);
+ return tmp;
+ }
+
+ bool operator==(iterator const& x) const {
+ return node_ == x.node_;
+ }
+
+ bool operator!=(iterator const& x) const {
+ return node_ != x.node_;
+ }
+ };
+
+ template <typename ConstNodePointer, typename NodePointer, typename Value>
+ struct c_iterator
+ : public boost::iterator<
+ std::forward_iterator_tag, Value, std::ptrdiff_t,
+ ConstNodePointer, Value const&>
+ {
+ friend struct boost::unordered::iterator_detail::iterator<
+ NodePointer, Value>;
+
+#if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
+ template <typename>
+ friend struct boost::unordered::detail::table;
+ template <typename, typename, typename, typename>
+ friend struct boost::unordered::detail::buckets;
+ template <typename>
+ friend struct boost::unordered::detail::table_impl;
+ template <typename>
+ friend struct boost::unordered::detail::grouped_table_impl;
+
+ private:
+#endif
+
+ typedef NodePointer node_pointer;
+ typedef boost::unordered::iterator_detail::iterator<NodePointer, Value>
+ iterator;
+ node_pointer node_;
+
+ public:
+
+ c_iterator() : node_() {}
+
+ explicit c_iterator(node_pointer const& x) : node_(x) {}
+
+ c_iterator(boost::unordered::iterator_detail::iterator<
+ NodePointer, Value> const& x) : node_(x.node_) {}
+
+ Value const& operator*() const {
+ return node_->value();
+ }
+
+ Value const* operator->() const {
+ return &node_->value();
+ }
+
+ c_iterator& operator++() {
+ node_ = static_cast<node_pointer>(node_->next_);
+ return *this;
+ }
+
+ c_iterator operator++(int) {
+ c_iterator tmp(node_);
+ node_ = static_cast<node_pointer>(node_->next_);
+ return tmp;
+ }
+
+ friend bool operator==(c_iterator const& x, c_iterator const& y) {
+ return x.node_ == y.node_;
+ }
+
+ friend bool operator!=(c_iterator const& x, c_iterator const& y) {
+ return x.node_ != y.node_;
+ }
+ };
+}}}
+
+namespace boost { namespace unordered { namespace detail {
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // Hash Policy
+ //
+ // Don't really want buckets to derive from this, but will for now.
+
+ template <typename SizeT>
+ struct prime_policy
+ {
+ template <typename Hash, typename T>
+ static inline SizeT apply_hash(Hash const& hf, T const& x) {
+ return hf(x);
+ }
+
+ static inline SizeT to_bucket(SizeT bucket_count, SizeT hash) {
+ return hash % bucket_count;
+ }
+
+ static inline SizeT new_bucket_count(SizeT min) {
+ return boost::unordered::detail::next_prime(min);
+ }
+
+ static inline SizeT prev_bucket_count(SizeT max) {
+ return boost::unordered::detail::prev_prime(max);
+ }
+ };
+
+ template <typename SizeT>
+ struct mix64_policy
+ {
+ template <typename Hash, typename T>
+ static inline SizeT apply_hash(Hash const& hf, T const& x) {
+ SizeT key = hf(x);
+ key = (~key) + (key << 21); // key = (key << 21) - key - 1;
+ key = key ^ (key >> 24);
+ key = (key + (key << 3)) + (key << 8); // key * 265
+ key = key ^ (key >> 14);
+ key = (key + (key << 2)) + (key << 4); // key * 21
+ key = key ^ (key >> 28);
+ key = key + (key << 31);
+ return key;
+ }
+
+ static inline SizeT to_bucket(SizeT bucket_count, SizeT hash) {
+ return hash & (bucket_count - 1);
+ }
+
+ static inline SizeT new_bucket_count(SizeT min) {
+ if (min <= 4) return 4;
+ --min;
+ min |= min >> 1;
+ min |= min >> 2;
+ min |= min >> 4;
+ min |= min >> 8;
+ min |= min >> 16;
+ min |= min >> 32;
+ return min + 1;
+ }
+
+ static inline SizeT prev_bucket_count(SizeT max) {
+ max |= max >> 1;
+ max |= max >> 2;
+ max |= max >> 4;
+ max |= max >> 8;
+ max |= max >> 16;
+ max |= max >> 32;
+ return (max >> 1) + 1;
+ }
+ };
+
+ template <int digits, int radix>
+ struct pick_policy_impl {
+ typedef prime_policy<std::size_t> type;
+ };
+
+ template <>
+ struct pick_policy_impl<64, 2> {
+ typedef mix64_policy<std::size_t> type;
+ };
+
+ struct pick_policy :
+ pick_policy_impl<
+ std::numeric_limits<std::size_t>::digits,
+ std::numeric_limits<std::size_t>::radix> {};
+
///////////////////////////////////////////////////////////////////
//
// Buckets
- template <typename A, typename Bucket, typename Node>
- struct buckets
+ template <typename A, typename Bucket, typename Node, typename Policy>
+ struct buckets : Policy
{
private:
buckets(buckets const&);
@@ -193,6 +551,7 @@ namespace boost { namespace unordered { namespace detail {
typedef boost::unordered::detail::allocator_traits<A> traits;
typedef typename traits::value_type value_type;
+ typedef Policy policy;
typedef Node node;
typedef Bucket bucket;
typedef typename boost::unordered::detail::rebind_wrap<A, node>::type
@@ -214,6 +573,16 @@ namespace boost { namespace unordered { namespace detail {
typedef boost::unordered::detail::node_constructor<node_allocator>
node_constructor;
+ typedef boost::unordered::iterator_detail::
+ iterator<node_pointer, value_type> iterator;
+ typedef boost::unordered::iterator_detail::
+ c_iterator<const_node_pointer, node_pointer, value_type> c_iterator;
+ typedef boost::unordered::iterator_detail::
+ l_iterator<node_pointer, value_type, policy> l_iterator;
+ typedef boost::unordered::iterator_detail::
+ cl_iterator<const_node_pointer, node_pointer, value_type, policy>
+ cl_iterator;
+
// Members
bucket_pointer buckets_;
@@ -247,7 +616,7 @@ namespace boost { namespace unordered { namespace detail {
std::size_t max_bucket_count() const
{
// -1 to account for the start bucket.
- return boost::unordered::detail::prev_prime(
+ return policy::prev_bucket_count(
bucket_allocator_traits::max_size(bucket_alloc()) - 1);
}
@@ -266,16 +635,17 @@ namespace boost { namespace unordered { namespace detail {
return this->get_bucket(bucket_index)->next_;
}
- node_pointer get_start() const
+ iterator get_start() const
{
- return static_cast<node_pointer>(this->get_previous_start()->next_);
+ return iterator(static_cast<node_pointer>(
+ this->get_previous_start()->next_));
}
- node_pointer get_start(std::size_t bucket_index) const
+ iterator get_start(std::size_t bucket_index) const
{
previous_pointer prev = this->get_previous_start(bucket_index);
- return prev ? static_cast<node_pointer>(prev->next_) :
- node_pointer();
+ return prev ? iterator(static_cast<node_pointer>(prev->next_)) :
+ iterator();
}
float load_factor() const
@@ -288,14 +658,15 @@ namespace boost { namespace unordered { namespace detail {
std::size_t bucket_size(std::size_t index) const
{
if (!this->size_) return 0;
- node_pointer ptr = this->get_start(index);
- if (!ptr) return 0;
+ iterator it = this->get_start(index);
+ if (!it.node_) return 0;
std::size_t count = 0;
- while(ptr && ptr->hash_ % this->bucket_count_ == index)
+ while(it.node_ && policy::to_bucket(
+ this->bucket_count_, it.node_->hash_) == index)
{
++count;
- ptr = static_cast<node_pointer>(ptr->next_);
+ ++it;
}
return count;
@@ -349,6 +720,14 @@ namespace boost { namespace unordered { namespace detail {
node_constructor a(this->node_alloc());
a.construct_node();
+ // Since this node is just to mark the beginning it doesn't
+ // contain a value, so just construct node::node_base
+ // which containers the pointer to the next element.
+ node_allocator_traits::construct(node_alloc(),
+ static_cast<typename node::node_base*>(
+ boost::addressof(*a.get())),
+ typename node::node_base());
+
(constructor.get() +
static_cast<std::ptrdiff_t>(this->bucket_count_))->next_ =
a.release();
@@ -391,21 +770,21 @@ namespace boost { namespace unordered { namespace detail {
////////////////////////////////////////////////////////////////////////
// Delete/destruct
- inline void delete_node(node_pointer n)
+ inline void delete_node(c_iterator n)
{
- boost::unordered::detail::destroy(n->value_ptr());
- node_allocator_traits::destroy(node_alloc(), boost::addressof(*n));
- node_allocator_traits::deallocate(node_alloc(), n, 1);
+ boost::unordered::detail::destroy_node(
+ node_alloc(), boost::addressof(*n.node_));
+ node_allocator_traits::deallocate(node_alloc(), n.node_, 1);
--size_;
}
- std::size_t delete_nodes(node_pointer begin, node_pointer end)
+ std::size_t delete_nodes(c_iterator begin, c_iterator end)
{
std::size_t count = 0;
while(begin != end) {
- node_pointer n = begin;
- begin = static_cast<node_pointer>(begin->next_);
+ c_iterator n = begin;
+ ++begin;
delete_node(n);
++count;
}
@@ -416,7 +795,8 @@ namespace boost { namespace unordered { namespace detail {
inline void delete_extra_node(bucket_pointer) {}
inline void delete_extra_node(node_pointer n) {
- node_allocator_traits::destroy(node_alloc(), boost::addressof(*n));
+ node_allocator_traits::destroy(node_alloc(),
+ static_cast<typename node::node_base*>(boost::addressof(*n)));
node_allocator_traits::deallocate(node_alloc(), n, 1);
}
@@ -433,7 +813,7 @@ namespace boost { namespace unordered { namespace detail {
while(prev->next_) {
node_pointer n = static_cast<node_pointer>(prev->next_);
prev->next_ = n->next_;
- delete_node(n);
+ delete_node(iterator(n));
}
delete_extra_node(prev);
@@ -463,7 +843,7 @@ namespace boost { namespace unordered { namespace detail {
while(prev->next_) {
node_pointer n = static_cast<node_pointer>(prev->next_);
prev->next_ = n->next_;
- delete_node(n);
+ delete_node(iterator(n));
}
bucket_pointer end = this->get_bucket(this->bucket_count_);
@@ -477,22 +857,24 @@ namespace boost { namespace unordered { namespace detail {
// This is called after erasing a node or group of nodes to fix up
// the bucket pointers.
- void fix_buckets(bucket_pointer bucket,
+ void fix_buckets(bucket_pointer this_bucket,
previous_pointer prev, node_pointer next)
{
if (!next)
{
- if (bucket->next_ == prev) bucket->next_ = node_pointer();
+ if (this_bucket->next_ == prev)
+ this_bucket->next_ = node_pointer();
}
else
{
bucket_pointer next_bucket = this->get_bucket(
- next->hash_ % this->bucket_count_);
+ policy::to_bucket(this->bucket_count_, next->hash_));
- if (next_bucket != bucket)
+ if (next_bucket != this_bucket)
{
next_bucket->next_ = prev;
- if (bucket->next_ == prev) bucket->next_ = node_pointer();
+ if (this_bucket->next_ == prev)
+ this_bucket->next_ = node_pointer();
}
}
}
@@ -513,7 +895,7 @@ namespace boost { namespace unordered { namespace detail {
if (n == end) return;
std::size_t new_bucket_index =
- n->hash_ % this->bucket_count_;
+ policy::to_bucket(this->bucket_count_, n->hash_);
if (bucket_index != new_bucket_index) {
bucket_index = new_bucket_index;
break;
@@ -529,7 +911,7 @@ namespace boost { namespace unordered { namespace detail {
if (n == end) break;
std::size_t new_bucket_index =
- n->hash_ % this->bucket_count_;
+ policy::to_bucket(this->bucket_count_, n->hash_);
if (bucket_index != new_bucket_index) {
bucket_index = new_bucket_index;
this->get_bucket(bucket_index)->next_ = previous_pointer();
@@ -538,7 +920,8 @@ namespace boost { namespace unordered { namespace detail {
// Finally fix the bucket containing the trailing node.
if (n) {
- this->get_bucket(n->hash_ % this->bucket_count_)->next_
+ this->get_bucket(
+ policy::to_bucket(this->bucket_count_, n->hash_))->next_
= prev;
}
}
diff --git a/boost/unordered/detail/emplace_args.hpp b/boost/unordered/detail/emplace_args.hpp
deleted file mode 100644
index 0e80d3c050..0000000000
--- a/boost/unordered/detail/emplace_args.hpp
+++ /dev/null
@@ -1,480 +0,0 @@
-
-// Copyright (C) 2011 Daniel James.
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-// See http://www.boost.org/libs/unordered for documentation
-
-#ifndef BOOST_UNORDERED_EMPLACE_ARGS_HPP
-#define BOOST_UNORDERED_EMPLACE_ARGS_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
-# pragma once
-#endif
-
-#include <boost/move/move.hpp>
-#include <boost/preprocessor/cat.hpp>
-#include <boost/preprocessor/inc.hpp>
-#include <boost/preprocessor/dec.hpp>
-#include <boost/preprocessor/repetition/enum.hpp>
-#include <boost/preprocessor/repetition/enum_params.hpp>
-#include <boost/preprocessor/repetition/enum_binary_params.hpp>
-#include <boost/preprocessor/repetition/repeat_from_to.hpp>
-#include <boost/type_traits/is_class.hpp>
-#include <boost/tuple/tuple.hpp>
-#include <utility>
-
-#if !defined(BOOST_NO_0X_HDR_TUPLE)
-#include <tuple>
-#endif
-
-#if defined(BOOST_MSVC)
-#pragma warning(push)
-#pragma warning(disable:4512) // assignment operator could not be generated.
-#pragma warning(disable:4345) // behavior change: an object of POD type
- // constructed with an initializer of the form ()
- // will be default-initialized.
-#endif
-
-#define BOOST_UNORDERED_EMPLACE_LIMIT 10
-
-#if !defined(BOOST_NO_RVALUE_REFERENCES) && \
- !defined(BOOST_NO_VARIADIC_TEMPLATES)
-#define BOOST_UNORDERED_VARIADIC_MOVE
-#endif
-
-namespace boost { namespace unordered { namespace detail {
-
- ////////////////////////////////////////////////////////////////////////////
- // emplace_args
- //
- // Either forwarding variadic arguments, or storing the arguments in
- // emplace_args##n
-
-#if defined(BOOST_UNORDERED_VARIADIC_MOVE)
-
-#define BOOST_UNORDERED_EMPLACE_TEMPLATE typename... Args
-#define BOOST_UNORDERED_EMPLACE_ARGS Args&&... args
-#define BOOST_UNORDERED_EMPLACE_FORWARD boost::forward<Args>(args)...
-
-#else
-
-#define BOOST_UNORDERED_EMPLACE_TEMPLATE typename Args
-#define BOOST_UNORDERED_EMPLACE_ARGS Args const& args
-#define BOOST_UNORDERED_EMPLACE_FORWARD args
-
-#define BOOST_UNORDERED_FWD_PARAM(z, n, a) \
- BOOST_FWD_REF(BOOST_PP_CAT(A, n)) BOOST_PP_CAT(a, n)
-
-#define BOOST_UNORDERED_CALL_FORWARD(z, i, a) \
- boost::forward<BOOST_PP_CAT(A,i)>(BOOST_PP_CAT(a,i))
-
-#define BOOST_UNORDERED_EARGS(z, n, _) \
- template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
- struct BOOST_PP_CAT(emplace_args, n) \
- { \
- BOOST_PP_REPEAT_##z(n, BOOST_UNORDERED_EARGS_MEMBER, _) \
- BOOST_PP_CAT(emplace_args, n) ( \
- BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, Arg, a) \
- ) : BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_EARGS_INIT, _) \
- {} \
- \
- }; \
- \
- template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
- inline BOOST_PP_CAT(emplace_args, n) < \
- BOOST_PP_ENUM_PARAMS_Z(z, n, A) \
- > create_emplace_args( \
- BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a) \
- ) \
- { \
- BOOST_PP_CAT(emplace_args, n) < \
- BOOST_PP_ENUM_PARAMS_Z(z, n, A) \
- > e(BOOST_PP_ENUM_PARAMS_Z(z, n, a)); \
- return e; \
- }
-
-#if defined(BOOST_NO_RVALUE_REFERENCES)
-
-#define BOOST_UNORDERED_EARGS_MEMBER(z, n, _) \
- typedef BOOST_FWD_REF(BOOST_PP_CAT(A, n)) BOOST_PP_CAT(Arg, n); \
- BOOST_PP_CAT(Arg, n) BOOST_PP_CAT(a, n);
-
-#define BOOST_UNORDERED_EARGS_INIT(z, n, _) \
- BOOST_PP_CAT(a, n)( \
- boost::forward<BOOST_PP_CAT(A,n)>(BOOST_PP_CAT(a, n)))
-
-#else
-
-#define BOOST_UNORDERED_EARGS_MEMBER(z, n, _) \
- typedef typename boost::add_lvalue_reference<BOOST_PP_CAT(A, n)>::type \
- BOOST_PP_CAT(Arg, n); \
- BOOST_PP_CAT(Arg, n) BOOST_PP_CAT(a, n);
-
-#define BOOST_UNORDERED_EARGS_INIT(z, n, _) \
- BOOST_PP_CAT(a, n)(BOOST_PP_CAT(a, n))
-
-#endif
-
-BOOST_PP_REPEAT_FROM_TO(1, BOOST_UNORDERED_EMPLACE_LIMIT, BOOST_UNORDERED_EARGS,
- _)
-
-#undef BOOST_UNORDERED_DEFINE_EMPLACE_ARGS
-#undef BOOST_UNORDERED_EARGS_MEMBER
-#undef BOOST_UNORDERED_EARGS_INIT
-
-#endif
-
- ////////////////////////////////////////////////////////////////////////////
- // rvalue parameters when type can't be a BOOST_RV_REF(T) parameter
- // e.g. for int
-
-#if !defined(BOOST_NO_RVALUE_REFERENCES)
-# define BOOST_UNORDERED_RV_REF(T) BOOST_RV_REF(T)
-#else
- struct please_ignore_this_overload {
- typedef please_ignore_this_overload type;
- };
-
- template <typename T>
- struct rv_ref_impl {
- typedef BOOST_RV_REF(T) type;
- };
-
- template <typename T>
- struct rv_ref :
- boost::detail::if_true<
- boost::is_class<T>::value
- >::BOOST_NESTED_TEMPLATE then <
- boost::unordered::detail::rv_ref_impl<T>,
- please_ignore_this_overload
- >::type
- {};
-
-# define BOOST_UNORDERED_RV_REF(T) \
- typename boost::unordered::detail::rv_ref<T>::type
-#endif
-
- ////////////////////////////////////////////////////////////////////////////
- // Construct from tuple
- //
- // Used for piecewise construction.
-
-#if !BOOST_WORKAROUND(__SUNPRO_CC, <= 0x590)
-
-#define BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(n, namespace_) \
- template<typename T> \
- void construct_from_tuple(T* ptr, namespace_::tuple<>) \
- { \
- new ((void*) ptr) T(); \
- } \
- \
- BOOST_PP_REPEAT_FROM_TO(1, n, \
- BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE_IMPL, namespace_)
-
-#define BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE_IMPL(z, n, namespace_) \
- template<typename T, BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
- void construct_from_tuple(T* ptr, \
- namespace_::tuple<BOOST_PP_ENUM_PARAMS_Z(z, n, A)> const& x) \
- { \
- new ((void*) ptr) T( \
- BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_GET_TUPLE_ARG, namespace_) \
- ); \
- }
-
-#define BOOST_UNORDERED_GET_TUPLE_ARG(z, n, namespace_) \
- namespace_::get<n>(x)
-
-BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(10, boost)
-
-#if !defined(BOOST_NO_0X_HDR_TUPLE)
-BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(10, std)
-#endif
-
-#undef BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE
-#undef BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE_IMPL
-#undef BOOST_UNORDERED_GET_TUPLE_ARG
-
-#else
-
- template <int N> struct length {};
-
- template<typename T>
- void construct_from_tuple_impl(
- boost::unordered::detail::length<0>, T* ptr,
- boost::tuple<>)
- {
- new ((void*) ptr) T();
- }
-
-#define BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE_IMPL(z, n, _) \
- template<typename T, BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
- void construct_from_tuple_impl( \
- boost::unordered::detail::length<n>, T* ptr, \
- namespace_::tuple<BOOST_PP_ENUM_PARAMS_Z(z, n, A)> const& x) \
- { \
- new ((void*) ptr) T( \
- BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_GET_TUPLE_ARG, namespace_) \
- ); \
- }
-
-#define BOOST_UNORDERED_GET_TUPLE_ARG(z, n, _) \
- boost::get<n>(x)
-
- BOOST_PP_REPEAT_FROM_TO(1, 10, \
- BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE_IMPL, _)
-
- template <typename T, typename Tuple>
- void construct_from_tuple(T* ptr, Tuple const& x)
- {
- construct_from_tuple_impl(
- boost::unordered::detail::length<
- boost::tuples::length<Tuple>::value>(),
- ptr, x);
- }
-
-#undef BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE_IMPL
-#undef BOOST_UNORDERED_GET_TUPLE_ARG
-
-#endif
-
- ////////////////////////////////////////////////////////////////////////////
- // SFINAE traits for construction.
-
- // Decide which construction method to use for a three argument
- // call. Note that this is difficult to do using overloads because
- // the arguments are packed into 'emplace_args3'.
- //
- // The decision is made on the first argument.
-
-
-#if defined(BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT)
- template <typename A, typename B, typename A0>
- struct emulation1 {
- static choice1::type test(choice1, std::pair<A, B> const&);
- static choice2::type test(choice2, A const&);
- static choice3::type test(choice3, convert_from_anything const&);
-
- enum { value =
- sizeof(test(choose(), boost::unordered::detail::make<A0>())) ==
- sizeof(choice2::type) };
- };
-#endif
-
- template <typename A, typename B, typename A0>
- struct check3_base {
- static choice1::type test(choice1,
- boost::unordered::piecewise_construct_t);
-
-#if defined(BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT)
- static choice2::type test(choice2, A const&);
-#endif
-
- static choice3::type test(choice3, ...);
-
- enum { value =
- sizeof(test(choose(), boost::unordered::detail::make<A0>())) };
- };
-
- template <typename A, typename B, typename A0>
- struct piecewise3 {
- enum { value = check3_base<A,B,A0>::value == sizeof(choice1::type) };
- };
-
-#if defined(BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT)
- template <typename A, typename B, typename A0>
- struct emulation3 {
- enum { value = check3_base<A,B,A0>::value == sizeof(choice2::type) };
- };
-
-#endif
-
-#if defined(BOOST_UNORDERED_VARIADIC_MOVE)
-
- ////////////////////////////////////////////////////////////////////////////
- // Construct from variadic parameters
-
- template <typename T, typename... Args>
- inline void construct_impl(T* address, Args&&... args)
- {
- new((void*) address) T(boost::forward<Args>(args)...);
- }
-
- template <typename A, typename B, typename A0, typename A1, typename A2>
- inline typename enable_if<piecewise3<A, B, A0>, void>::type
- construct_impl(std::pair<A, B>* address, A0&&, A1&& a1, A2&& a2)
- {
- boost::unordered::detail::construct_from_tuple(
- boost::addressof(address->first), a1);
- boost::unordered::detail::construct_from_tuple(
- boost::addressof(address->second), a2);
- }
-
-#if defined(BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT)
-
- template <typename A, typename B, typename A0>
- inline typename enable_if<emulation1<A, B, A0>, void>::type
- construct_impl(std::pair<A, B>* address, A0&& a0)
- {
- new((void*) boost::addressof(address->first)) A(boost::forward<A0>(a0));
- new((void*) boost::addressof(address->second)) B();
- }
-
- template <typename A, typename B, typename A0, typename A1, typename A2>
- inline typename enable_if<emulation3<A, B, A0>, void>::type
- construct_impl(std::pair<A, B>* address, A0&& a0, A1&& a1, A2&& a2)
- {
- new((void*) boost::addressof(address->first)) A(boost::forward<A0>(a0));
- new((void*) boost::addressof(address->second)) B(
- boost::forward<A1>(a1),
- boost::forward<A2>(a2));
- }
-
- template <typename A, typename B,
- typename A0, typename A1, typename A2, typename A3,
- typename... Args>
- inline void construct_impl(std::pair<A, B>* address,
- A0&& a0, A1&& a1, A2&& a2, A3&& a3, Args&&... args)
- {
- new((void*) boost::addressof(address->first)) A(boost::forward<A0>(a0));
-
- new((void*) boost::addressof(address->second)) B(
- boost::forward<A1>(a1),
- boost::forward<A2>(a2),
- boost::forward<A3>(a3),
- boost::forward<Args>(args)...);
- }
-
-#endif // BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT
-#else // BOOST_UNORDERED_VARIADIC_MOVE
-
-////////////////////////////////////////////////////////////////////////////////
-// Construct from emplace_args
-
-#define BOOST_UNORDERED_CONSTRUCT_IMPL(z, num_params, _) \
- template < \
- typename T, \
- BOOST_PP_ENUM_PARAMS_Z(z, num_params, typename A) \
- > \
- inline void construct_impl(T* address, \
- boost::unordered::detail::BOOST_PP_CAT(emplace_args,num_params) < \
- BOOST_PP_ENUM_PARAMS_Z(z, num_params, A) \
- > const& args) \
- { \
- new((void*) address) T( \
- BOOST_PP_ENUM_##z(num_params, BOOST_UNORDERED_CALL_FORWARD, \
- args.a)); \
- }
-
- template <typename T, typename A0>
- inline void construct_impl(T* address, emplace_args1<A0> const& args)
- {
- new((void*) address) T(boost::forward<A0>(args.a0));
- }
-
- template <typename T, typename A0, typename A1>
- inline void construct_impl(T* address, emplace_args2<A0, A1> const& args)
- {
- new((void*) address) T(
- boost::forward<A0>(args.a0),
- boost::forward<A1>(args.a1)
- );
- }
-
- template <typename T, typename A0, typename A1, typename A2>
- inline void construct_impl(T* address, emplace_args3<A0, A1, A2> const& args)
- {
- new((void*) address) T(
- boost::forward<A0>(args.a0),
- boost::forward<A1>(args.a1),
- boost::forward<A2>(args.a2)
- );
- }
-
- BOOST_PP_REPEAT_FROM_TO(4, BOOST_UNORDERED_EMPLACE_LIMIT,
- BOOST_UNORDERED_CONSTRUCT_IMPL, _)
-
-#undef BOOST_UNORDERED_CONSTRUCT_IMPL
-
- template <typename A, typename B, typename A0, typename A1, typename A2>
- inline typename enable_if<piecewise3<A, B, A0>, void>::type
- construct_impl(std::pair<A, B>* address,
- boost::unordered::detail::emplace_args3<A0, A1, A2> const& args)
- {
- boost::unordered::detail::construct_from_tuple(
- boost::addressof(address->first), args.a1);
- boost::unordered::detail::construct_from_tuple(
- boost::addressof(address->second), args.a2);
- }
-
-#if defined(BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT)
-
- template <typename A, typename B, typename A0>
- inline typename enable_if<emulation1<A, B, A0>, void>::type
- construct_impl(std::pair<A, B>* address,
- boost::unordered::detail::emplace_args1<A0> const& args)
- {
- new((void*) boost::addressof(address->first)) A(
- boost::forward<A0>(args.a0));
- new((void*) boost::addressof(address->second)) B();
- }
-
- template <typename A, typename B, typename A0, typename A1, typename A2>
- inline typename enable_if<emulation3<A, B, A0>, void>::type
- construct_impl(std::pair<A, B>* address,
- boost::unordered::detail::emplace_args3<A0, A1, A2> const& args)
- {
- new((void*) boost::addressof(address->first)) A(
- boost::forward<A0>(args.a0));
- new((void*) boost::addressof(address->second)) B(
- boost::forward<A1>(args.a1),
- boost::forward<A2>(args.a2));
- }
-
-#define BOOST_UNORDERED_CONSTRUCT_PAIR_IMPL(z, num_params, _) \
- template <typename A, typename B, \
- BOOST_PP_ENUM_PARAMS_Z(z, num_params, typename A) \
- > \
- inline void construct_impl(std::pair<A, B>* address, \
- boost::unordered::detail::BOOST_PP_CAT(emplace_args, num_params) < \
- BOOST_PP_ENUM_PARAMS_Z(z, num_params, A) \
- > const& args) \
- { \
- new((void*) boost::addressof(address->first)) A( \
- boost::forward<A0>(args.a0)); \
- new((void*) boost::addressof(address->second)) B( \
- BOOST_PP_ENUM_##z(BOOST_PP_DEC(num_params), \
- BOOST_UNORDERED_CALL_FORWARD2, args.a)); \
- }
-
-#define BOOST_UNORDERED_CALL_FORWARD2(z, i, a) \
- BOOST_UNORDERED_CALL_FORWARD(z, BOOST_PP_INC(i), a)
-
- BOOST_UNORDERED_CONSTRUCT_PAIR_IMPL(1, 2, _)
- BOOST_PP_REPEAT_FROM_TO(4, BOOST_UNORDERED_EMPLACE_LIMIT,
- BOOST_UNORDERED_CONSTRUCT_PAIR_IMPL, _)
-
-#undef BOOST_UNORDERED_CONSTRUCT_PAIR_IMPL
-#undef BOOST_UNORDERED_CALL_FORWARD2
-
-#endif // BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT
-#endif // BOOST_UNORDERED_VARIADIC_MOVE
-
- ////////////////////////////////////////////////////////////////////////////
- // Construct without using the emplace args mechanism.
-
- template <typename T, typename A0>
- inline void construct_impl2(T* address, BOOST_FWD_REF(A0) a0)
- {
- new((void*) address) T(
- boost::forward<A0>(a0)
- );
- }
-
-}}}
-
-#if defined(BOOST_MSVC)
-#pragma warning(pop)
-#endif
-
-#endif
diff --git a/boost/unordered/detail/equivalent.hpp b/boost/unordered/detail/equivalent.hpp
index 6e7e4190da..5cbf6a7cea 100644
--- a/boost/unordered/detail/equivalent.hpp
+++ b/boost/unordered/detail/equivalent.hpp
@@ -12,7 +12,6 @@
#endif
#include <boost/unordered/detail/table.hpp>
-#include <boost/unordered/detail/emplace_args.hpp>
#include <boost/unordered/detail/extract_key.hpp>
namespace boost { namespace unordered { namespace detail {
@@ -23,25 +22,52 @@ namespace boost { namespace unordered { namespace detail {
template <typename A, typename T>
struct grouped_node :
+ boost::unordered::detail::node_base<
+ typename ::boost::unordered::detail::rebind_wrap<
+ A, grouped_node<A, T> >::type::pointer
+ >,
boost::unordered::detail::value_base<T>
{
typedef typename ::boost::unordered::detail::rebind_wrap<
A, grouped_node<A, T> >::type::pointer link_pointer;
+ typedef boost::unordered::detail::node_base<link_pointer> node_base;
- link_pointer next_;
link_pointer group_prev_;
std::size_t hash_;
+#if BOOST_UNORDERED_DETAIL_FULL_CONSTRUCT
+ template <BOOST_UNORDERED_EMPLACE_TEMPLATE>
+ explicit grouped_node(BOOST_UNORDERED_EMPLACE_ARGS) :
+ node_base(),
+ group_prev_(),
+ hash_(0)
+ {
+ boost::unordered::detail::construct_impl(
+ this->value_ptr(), BOOST_UNORDERED_EMPLACE_FORWARD);
+ }
+
+ ~grouped_node() {
+ boost::unordered::detail::destroy(this->value_ptr());
+ }
+
+ grouped_node(grouped_node const&) {
+ assert(false);
+ }
+#else
grouped_node() :
- next_(),
+ node_base(),
group_prev_(),
hash_(0)
{}
+#endif
void init(link_pointer self)
{
group_prev_ = self;
}
+
+ private:
+ grouped_node& operator=(grouped_node const&);
};
template <typename T>
@@ -50,21 +76,45 @@ namespace boost { namespace unordered { namespace detail {
boost::unordered::detail::ptr_bucket
{
typedef boost::unordered::detail::ptr_bucket bucket_base;
+ typedef bucket_base node_base;
typedef ptr_bucket* link_pointer;
link_pointer group_prev_;
std::size_t hash_;
+#if BOOST_UNORDERED_DETAIL_FULL_CONSTRUCT
+ template <BOOST_UNORDERED_EMPLACE_TEMPLATE>
+ explicit grouped_ptr_node(BOOST_UNORDERED_EMPLACE_ARGS) :
+ bucket_base(),
+ group_prev_(0),
+ hash_(0)
+ {
+ boost::unordered::detail::construct_impl(
+ this->value_ptr(), BOOST_UNORDERED_EMPLACE_FORWARD);
+ }
+
+ ~grouped_ptr_node() {
+ boost::unordered::detail::destroy(this->value_ptr());
+ }
+
+ grouped_ptr_node(grouped_ptr_node const&) {
+ assert(false);
+ }
+#else
grouped_ptr_node() :
bucket_base(),
group_prev_(0),
hash_(0)
{}
+#endif
void init(link_pointer self)
{
group_prev_ = self;
}
+
+ private:
+ grouped_ptr_node& operator=(grouped_ptr_node const&);
};
// If the allocator uses raw pointers use grouped_ptr_node
@@ -136,6 +186,8 @@ namespace boost { namespace unordered { namespace detail {
typedef boost::unordered::detail::grouped_table_impl<types> table;
typedef boost::unordered::detail::set_extractor<value_type> extractor;
+
+ typedef boost::unordered::detail::pick_policy::type policy;
};
template <typename A, typename K, typename M, typename H, typename P>
@@ -160,6 +212,8 @@ namespace boost { namespace unordered { namespace detail {
typedef boost::unordered::detail::grouped_table_impl<types> table;
typedef boost::unordered::detail::map_extractor<key_type, value_type>
extractor;
+
+ typedef boost::unordered::detail::pick_policy::type policy;
};
template <typename Types>
@@ -169,6 +223,7 @@ namespace boost { namespace unordered { namespace detail {
typedef typename table::value_type value_type;
typedef typename table::bucket bucket;
typedef typename table::buckets buckets;
+ typedef typename table::policy policy;
typedef typename table::node_pointer node_pointer;
typedef typename table::node_allocator node_allocator;
typedef typename table::node_allocator_traits node_allocator_traits;
@@ -181,6 +236,7 @@ namespace boost { namespace unordered { namespace detail {
typedef typename table::node_constructor node_constructor;
typedef typename table::extractor extractor;
typedef typename table::iterator iterator;
+ typedef typename table::c_iterator c_iterator;
// Constructors
@@ -214,59 +270,61 @@ namespace boost { namespace unordered { namespace detail {
// Accessors
template <class Key, class Pred>
- node_pointer find_node_impl(
- std::size_t hash,
+ iterator find_node_impl(
+ std::size_t key_hash,
Key const& k,
Pred const& eq) const
{
- std::size_t bucket_index = hash % this->bucket_count_;
- node_pointer n = this->get_start(bucket_index);
+ std::size_t bucket_index =
+ policy::to_bucket(this->bucket_count_, key_hash);
+ iterator n = this->get_start(bucket_index);
for (;;)
{
- if (!n) return n;
+ if (!n.node_) return n;
- std::size_t node_hash = n->hash_;
- if (hash == node_hash)
+ std::size_t node_hash = n.node_->hash_;
+ if (key_hash == node_hash)
{
- if (eq(k, this->get_key(n->value())))
+ if (eq(k, this->get_key(*n)))
return n;
}
else
{
- if (node_hash % this->bucket_count_ != bucket_index)
- return node_pointer();
+ if (policy::to_bucket(this->bucket_count_, node_hash)
+ != bucket_index)
+ return iterator();
}
- n = static_cast<node_pointer>(
- static_cast<node_pointer>(n->group_prev_)->next_);
+ n = iterator(static_cast<node_pointer>(
+ static_cast<node_pointer>(n.node_->group_prev_)->next_));
}
}
std::size_t count(key_type const& k) const
{
- node_pointer n = this->find_node(k);
- if (!n) return 0;
+ iterator n = this->find_node(k);
+ if (!n.node_) return 0;
- std::size_t count = 0;
- node_pointer it = n;
+ std::size_t x = 0;
+ node_pointer it = n.node_;
do {
it = static_cast<node_pointer>(it->group_prev_);
- ++count;
- } while(it != n);
+ ++x;
+ } while(it != n.node_);
- return count;
+ return x;
}
std::pair<iterator, iterator>
equal_range(key_type const& k) const
{
- node_pointer n = this->find_node(k);
+ iterator n = this->find_node(k);
return std::make_pair(
- iterator(n), iterator(n ?
+ n, n.node_ ? iterator(
static_cast<node_pointer>(
- static_cast<node_pointer>(n->group_prev_)->next_) :
- n));
+ static_cast<node_pointer>(n.node_->group_prev_)->next_
+ )) : n);
}
// Equality
@@ -276,14 +334,14 @@ namespace boost { namespace unordered { namespace detail {
if(this->size_ != other.size_) return false;
if(!this->size_) return true;
- for(node_pointer n1 = this->get_start(); n1;)
+ for(iterator n1 = this->get_start(); n1.node_;)
{
- node_pointer n2 = other.find_matching_node(n1);
- if (!n2) return false;
- node_pointer end1 = static_cast<node_pointer>(
- static_cast<node_pointer>(n1->group_prev_)->next_);
- node_pointer end2 = static_cast<node_pointer>(
- static_cast<node_pointer>(n2->group_prev_)->next_);
+ iterator n2 = other.find_matching_node(n1);
+ if (!n2.node_) return false;
+ iterator end1(static_cast<node_pointer>(
+ static_cast<node_pointer>(n1.node_->group_prev_)->next_));
+ iterator end2(static_cast<node_pointer>(
+ static_cast<node_pointer>(n2.node_->group_prev_)->next_));
if (!group_equals(n1, end1, n2, end2)) return false;
n1 = end1;
}
@@ -293,25 +351,24 @@ namespace boost { namespace unordered { namespace detail {
#if !defined(BOOST_UNORDERED_DEPRECATED_EQUALITY)
- static bool group_equals(node_pointer n1, node_pointer end1,
- node_pointer n2, node_pointer end2)
+ static bool group_equals(iterator n1, iterator end1,
+ iterator n2, iterator end2)
{
for(;;)
{
- if (n1->value() != n2->value())
- break;
+ if (*n1 != *n2) break;
- n1 = static_cast<node_pointer>(n1->next_);
- n2 = static_cast<node_pointer>(n2->next_);
+ ++n1;
+ ++n2;
if (n1 == end1) return n2 == end2;
if (n2 == end2) return false;
}
- for(node_pointer n1a = n1, n2a = n2;;)
+ for(iterator n1a = n1, n2a = n2;;)
{
- n1a = static_cast<node_pointer>(n1a->next_);
- n2a = static_cast<node_pointer>(n2a->next_);
+ ++n1a;
+ ++n2a;
if (n1a == end1)
{
@@ -322,50 +379,50 @@ namespace boost { namespace unordered { namespace detail {
if (n2a == end2) return false;
}
- node_pointer start = n1;
- for(;n1 != end2; n1 = static_cast<node_pointer>(n1->next_))
+ iterator start = n1;
+ for(;n1 != end1; ++n1)
{
- value_type const& v = n1->value();
+ value_type const& v = *n1;
if (find(start, n1, v)) continue;
std::size_t matches = count_equal(n2, end2, v);
- if (!matches || matches != 1 + count_equal(
- static_cast<node_pointer>(n1->next_), end1, v))
- return false;
+ if (!matches) return false;
+ iterator next = n1;
+ ++next;
+ if (matches != 1 + count_equal(next, end1, v)) return false;
}
return true;
}
- static bool find(node_pointer n, node_pointer end, value_type const& v)
+ static bool find(iterator n, iterator end, value_type const& v)
{
- for(;n != end; n = static_cast<node_pointer>(n->next_))
- if (n->value() == v)
+ for(;n != end; ++n)
+ if (*n == v)
return true;
return false;
}
- static std::size_t count_equal(node_pointer n, node_pointer end,
+ static std::size_t count_equal(iterator n, iterator end,
value_type const& v)
{
std::size_t count = 0;
- for(;n != end; n = static_cast<node_pointer>(n->next_))
- if (n->value() == v) ++count;
+ for(;n != end; ++n)
+ if (*n == v) ++count;
return count;
}
#else
- static bool group_equals(node_pointer n1, node_pointer end1,
- node_pointer n2, node_pointer end2)
+ static bool group_equals(iterator n1, iterator end1,
+ iterator n2, iterator end2)
{
for(;;)
{
- if(!extractor::compare_mapped(
- n1->value(), n2->value()))
+ if(!extractor::compare_mapped(*n1, *n2))
return false;
- n1 = static_cast<node_pointer>(n1->next_);
- n2 = static_cast<node_pointer>(n2->next_);
+ ++n1;
+ ++n2;
if (n1 == end1) return n2 == end2;
if (n2 == end2) return false;
@@ -387,35 +444,37 @@ namespace boost { namespace unordered { namespace detail {
pos->group_prev_ = static_cast<link_pointer>(n);
}
- inline node_pointer add_node(
+ inline iterator add_node(
node_constructor& a,
- std::size_t hash,
- node_pointer pos)
+ std::size_t key_hash,
+ iterator pos)
{
node_pointer n = a.release();
- n->hash_ = hash;
- if(pos) {
- this->add_after_node(n, pos);
+ n->hash_ = key_hash;
+ if (pos.node_) {
+ this->add_after_node(n, pos.node_);
if (n->next_) {
- std::size_t next_bucket =
- static_cast<node_pointer>(n->next_)->hash_ %
- this->bucket_count_;
- if (next_bucket != hash % this->bucket_count_) {
+ std::size_t next_bucket = policy::to_bucket(
+ this->bucket_count_,
+ static_cast<node_pointer>(n->next_)->hash_);
+ if (next_bucket !=
+ policy::to_bucket(this->bucket_count_, key_hash)) {
this->get_bucket(next_bucket)->next_ = n;
}
}
}
else {
- bucket_pointer b = this->get_bucket(hash % this->bucket_count_);
+ bucket_pointer b = this->get_bucket(
+ policy::to_bucket(this->bucket_count_, key_hash));
if (!b->next_)
{
previous_pointer start_node = this->get_previous_start();
if (start_node->next_) {
- this->get_bucket(
+ this->get_bucket(policy::to_bucket(this->bucket_count_,
static_cast<node_pointer>(start_node->next_)->hash_
- % this->bucket_count_)->next_ = n;
+ ))->next_ = n;
}
b->next_ = start_node;
@@ -429,36 +488,44 @@ namespace boost { namespace unordered { namespace detail {
}
}
++this->size_;
- return n;
+ return iterator(n);
}
- node_pointer emplace_impl(node_constructor& a)
+ iterator emplace_impl(node_constructor& a)
{
key_type const& k = this->get_key(a.value());
- std::size_t hash = this->hash_function()(k);
- node_pointer position = this->find_node(hash, k);
+ std::size_t key_hash = this->hash(k);
+ iterator position = this->find_node(key_hash, k);
// reserve has basic exception safety if the hash function
// throws, strong otherwise.
this->reserve_for_insert(this->size_ + 1);
- return this->add_node(a, hash, position);
+ return this->add_node(a, key_hash, position);
}
void emplace_impl_no_rehash(node_constructor& a)
{
key_type const& k = this->get_key(a.value());
- std::size_t hash = this->hash_function()(k);
- this->add_node(a, hash,
- this->find_node(hash, k));
+ std::size_t key_hash = this->hash(k);
+ this->add_node(a, key_hash, this->find_node(key_hash, k));
}
#if defined(BOOST_NO_RVALUE_REFERENCES)
+# if defined(BOOST_NO_VARIADIC_TEMPLATES)
iterator emplace(boost::unordered::detail::emplace_args1<
boost::unordered::detail::please_ignore_this_overload> const&)
{
BOOST_ASSERT(false);
return iterator();
}
+# else
+ iterator emplace(
+ boost::unordered::detail::please_ignore_this_overload const&)
+ {
+ BOOST_ASSERT(false);
+ return iterator();
+ }
+# endif
#endif
template <BOOST_UNORDERED_EMPLACE_TEMPLATE>
@@ -523,11 +590,12 @@ namespace boost { namespace unordered { namespace detail {
{
if(!this->size_) return 0;
- std::size_t hash = this->hash_function()(k);
- std::size_t bucket_index = hash % this->bucket_count_;
- bucket_pointer bucket = this->get_bucket(bucket_index);
+ std::size_t key_hash = this->hash(k);
+ std::size_t bucket_index =
+ policy::to_bucket(this->bucket_count_, key_hash);
+ bucket_pointer this_bucket = this->get_bucket(bucket_index);
- previous_pointer prev = bucket->next_;
+ previous_pointer prev = this_bucket->next_;
if (!prev) return 0;
for (;;)
@@ -535,9 +603,10 @@ namespace boost { namespace unordered { namespace detail {
if (!prev->next_) return 0;
std::size_t node_hash =
static_cast<node_pointer>(prev->next_)->hash_;
- if (node_hash % this->bucket_count_ != bucket_index)
+ if (policy::to_bucket(this->bucket_count_, node_hash)
+ != bucket_index)
return 0;
- if (node_hash == hash &&
+ if (node_hash == key_hash &&
this->key_eq()(k, this->get_key(
static_cast<node_pointer>(prev->next_)->value())))
break;
@@ -550,37 +619,39 @@ namespace boost { namespace unordered { namespace detail {
static_cast<node_pointer>(pos->group_prev_)->next_;
node_pointer end = static_cast<node_pointer>(end1);
prev->next_ = end1;
- this->fix_buckets(bucket, prev, end);
- return this->delete_nodes(pos, end);
+ this->fix_buckets(this_bucket, prev, end);
+ return this->delete_nodes(c_iterator(pos), c_iterator(end));
}
- node_pointer erase(node_pointer r)
+ iterator erase(c_iterator r)
{
- BOOST_ASSERT(r);
- node_pointer next = static_cast<node_pointer>(r->next_);
+ BOOST_ASSERT(r.node_);
+ iterator next(r.node_);
+ ++next;
- bucket_pointer bucket = this->get_bucket(
- r->hash_ % this->bucket_count_);
- previous_pointer prev = unlink_node(*bucket, r);
+ bucket_pointer this_bucket = this->get_bucket(
+ policy::to_bucket(this->bucket_count_, r.node_->hash_));
+ previous_pointer prev = unlink_node(*this_bucket, r.node_);
- this->fix_buckets(bucket, prev, next);
+ this->fix_buckets(this_bucket, prev, next.node_);
this->delete_node(r);
return next;
}
- node_pointer erase_range(node_pointer r1, node_pointer r2)
+ iterator erase_range(c_iterator r1, c_iterator r2)
{
- if (r1 == r2) return r2;
+ if (r1 == r2) return iterator(r2.node_);
- std::size_t bucket_index = r1->hash_ % this->bucket_count_;
+ std::size_t bucket_index =
+ policy::to_bucket(this->bucket_count_, r1.node_->hash_);
previous_pointer prev = unlink_nodes(
- *this->get_bucket(bucket_index), r1, r2);
- this->fix_buckets_range(bucket_index, prev, r1, r2);
+ *this->get_bucket(bucket_index), r1.node_, r2.node_);
+ this->fix_buckets_range(bucket_index, prev, r1.node_, r2.node_);
this->delete_nodes(r1, r2);
- return r2;
+ return iterator(r2.node_);
}
static previous_pointer unlink_node(bucket& b, node_pointer n)
@@ -697,31 +768,31 @@ namespace boost { namespace unordered { namespace detail {
node_constructor a(dst.node_alloc());
- node_pointer n = src.get_start();
+ iterator n = src.get_start();
previous_pointer prev = dst.get_previous_start();
- while(n) {
- std::size_t hash = n->hash_;
- node_pointer group_end =
+ while (n.node_) {
+ std::size_t key_hash = n.node_->hash_;
+ iterator group_end(
static_cast<node_pointer>(
- static_cast<node_pointer>(n->group_prev_)->next_);
+ static_cast<node_pointer>(n.node_->group_prev_)->next_
+ ));
a.construct_node();
- a.construct_value2(n->value());
+ a.construct_value2(*n);
node_pointer first_node = a.release();
node_pointer end = first_node;
- first_node->hash_ = hash;
+ first_node->hash_ = key_hash;
prev->next_ = static_cast<link_pointer>(first_node);
++dst.size_;
- for(n = static_cast<node_pointer>(n->next_); n != group_end;
- n = static_cast<node_pointer>(n->next_))
+ for (++n; n != group_end; ++n)
{
a.construct_node();
- a.construct_value2(n->value());
+ a.construct_value2(*n);
end = a.release();
- end->hash_ = hash;
+ end->hash_ = key_hash;
add_after_node(end, first_node);
++dst.size_;
}
@@ -744,31 +815,31 @@ namespace boost { namespace unordered { namespace detail {
node_constructor a(dst.node_alloc());
- node_pointer n = src.get_start();
+ iterator n = src.get_start();
previous_pointer prev = dst.get_previous_start();
- while(n) {
- std::size_t hash = n->hash_;
- node_pointer group_end =
+ while (n.node_) {
+ std::size_t key_hash = n.node_->hash_;
+ iterator group_end(
static_cast<node_pointer>(
- static_cast<node_pointer>(n->group_prev_)->next_);
+ static_cast<node_pointer>(n.node_->group_prev_)->next_
+ ));
a.construct_node();
- a.construct_value2(boost::move(n->value()));
+ a.construct_value2(boost::move(*n));
node_pointer first_node = a.release();
node_pointer end = first_node;
- first_node->hash_ = hash;
+ first_node->hash_ = key_hash;
prev->next_ = static_cast<link_pointer>(first_node);
++dst.size_;
- for(n = static_cast<node_pointer>(n->next_); n != group_end;
- n = static_cast<node_pointer>(n->next_))
+ for(++n; n != group_end; ++n)
{
a.construct_node();
- a.construct_value2(boost::move(n->value()));
+ a.construct_value2(boost::move(*n));
end = a.release();
- end->hash_ = hash;
+ end->hash_ = key_hash;
add_after_node(end, first_node);
++dst.size_;
}
@@ -809,7 +880,8 @@ namespace boost { namespace unordered { namespace detail {
static previous_pointer place_in_bucket(buckets& dst,
previous_pointer prev, node_pointer end)
{
- bucket_pointer b = dst.get_bucket(end->hash_ % dst.bucket_count_);
+ bucket_pointer b = dst.get_bucket(policy::to_bucket(
+ dst.bucket_count_, end->hash_));
if (!b->next_) {
b->next_ = static_cast<node_pointer>(prev);
diff --git a/boost/unordered/detail/extract_key.hpp b/boost/unordered/detail/extract_key.hpp
index 4ca13e8ce2..56a85324ba 100644
--- a/boost/unordered/detail/extract_key.hpp
+++ b/boost/unordered/detail/extract_key.hpp
@@ -56,7 +56,7 @@ namespace detail {
return no_key();
}
-#if defined(BOOST_UNORDERED_VARIADIC_MOVE)
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
template <class... Args>
static no_key extract(Args const&...)
{
@@ -111,7 +111,7 @@ namespace detail {
return v.first;
}
-#if defined(BOOST_UNORDERED_VARIADIC_MOVE)
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
template <class Arg1, class... Args>
static key_type const& extract(key_type const& k,
Arg1 const&, Args const&...)
@@ -150,12 +150,12 @@ namespace detail {
}
#endif
-#if defined(BOOST_UNORDERED_VARIADIC_MOVE)
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
#define BOOST_UNORDERED_KEY_FROM_TUPLE(namespace_) \
template <typename T2> \
static no_key extract(boost::unordered::piecewise_construct_t, \
- namespace_::tuple<> const&, T2&&) \
+ namespace_::tuple<> const&, BOOST_FWD_REF(T2)) \
{ \
return no_key(); \
} \
@@ -163,7 +163,7 @@ namespace detail {
template <typename T, typename T2> \
static typename is_key<key_type, T>::type \
extract(boost::unordered::piecewise_construct_t, \
- namespace_::tuple<T> const& k, T2&&) \
+ namespace_::tuple<T> const& k, BOOST_FWD_REF(T2)) \
{ \
return typename is_key<key_type, T>::type( \
namespace_::get<0>(k)); \
@@ -191,7 +191,7 @@ namespace detail {
BOOST_UNORDERED_KEY_FROM_TUPLE(boost)
-#if !defined(BOOST_NO_0X_HDR_TUPLE)
+#if !defined(BOOST_NO_CXX11_HDR_TUPLE)
BOOST_UNORDERED_KEY_FROM_TUPLE(std)
#endif
diff --git a/boost/unordered/detail/fwd.hpp b/boost/unordered/detail/fwd.hpp
index 1949b5d199..ee8966b755 100644
--- a/boost/unordered/detail/fwd.hpp
+++ b/boost/unordered/detail/fwd.hpp
@@ -10,41 +10,11 @@
# pragma once
#endif
-#include <boost/config.hpp>
-#include <memory>
-#include <functional>
-#include <boost/functional/hash_fwd.hpp>
namespace boost
{
namespace unordered
{
- template <class K,
- class T,
- class H = boost::hash<K>,
- class P = std::equal_to<K>,
- class A = std::allocator<std::pair<const K, T> > >
- class unordered_map;
-
- template <class K,
- class T,
- class H = boost::hash<K>,
- class P = std::equal_to<K>,
- class A = std::allocator<std::pair<const K, T> > >
- class unordered_multimap;
-
- template <class T,
- class H = boost::hash<T>,
- class P = std::equal_to<T>,
- class A = std::allocator<T> >
- class unordered_set;
-
- template <class T,
- class H = boost::hash<T>,
- class P = std::equal_to<T>,
- class A = std::allocator<T> >
- class unordered_multiset;
-
struct piecewise_construct_t {};
const piecewise_construct_t piecewise_construct = piecewise_construct_t();
}
diff --git a/boost/unordered/detail/table.hpp b/boost/unordered/detail/table.hpp
index 66c46084ce..cbf6219554 100644
--- a/boost/unordered/detail/table.hpp
+++ b/boost/unordered/detail/table.hpp
@@ -11,251 +11,8 @@
#include <boost/unordered/detail/util.hpp>
#include <boost/type_traits/aligned_storage.hpp>
#include <boost/type_traits/alignment_of.hpp>
-#include <boost/iterator.hpp>
#include <cmath>
-namespace boost { namespace unordered { namespace iterator_detail {
-
- ////////////////////////////////////////////////////////////////////////////
- // Iterators
- //
- // all no throw
-
- template <typename NodePointer, typename Value> struct iterator;
- template <typename ConstNodePointer, typename NodePointer,
- typename Value> struct c_iterator;
- template <typename NodePointer, typename Value> struct l_iterator;
- template <typename ConstNodePointer, typename NodePointer,
- typename Value> struct cl_iterator;
-
- // Local Iterators
- //
- // all no throw
-
- template <typename NodePointer, typename Value>
- struct l_iterator
- : public boost::iterator<
- std::forward_iterator_tag, Value, std::ptrdiff_t,
- NodePointer, Value&>
- {
-#if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
- template <typename ConstNodePointer, typename NodePointer2,
- typename Value2>
- friend struct boost::unordered::iterator_detail::cl_iterator;
- private:
-#endif
- typedef NodePointer node_pointer;
- node_pointer ptr_;
- std::size_t bucket_;
- std::size_t bucket_count_;
-
- public:
-
- l_iterator() : ptr_() {}
-
- l_iterator(node_pointer x, std::size_t b, std::size_t c)
- : ptr_(x), bucket_(b), bucket_count_(c) {}
-
- Value& operator*() const {
- return ptr_->value();
- }
-
- Value* operator->() const {
- return ptr_->value_ptr();
- }
-
- l_iterator& operator++() {
- ptr_ = static_cast<node_pointer>(ptr_->next_);
- if (ptr_ && ptr_->hash_ % bucket_count_ != bucket_)
- ptr_ = node_pointer();
- return *this;
- }
-
- l_iterator operator++(int) {
- l_iterator tmp(*this);
- ++(*this);
- return tmp;
- }
-
- bool operator==(l_iterator x) const {
- return ptr_ == x.ptr_;
- }
-
- bool operator!=(l_iterator x) const {
- return ptr_ != x.ptr_;
- }
- };
-
- template <typename ConstNodePointer, typename NodePointer, typename Value>
- struct cl_iterator
- : public boost::iterator<
- std::forward_iterator_tag, Value, std::ptrdiff_t,
- ConstNodePointer, Value const&>
- {
- friend struct boost::unordered::iterator_detail::l_iterator
- <NodePointer, Value>;
- private:
-
- typedef NodePointer node_pointer;
- node_pointer ptr_;
- std::size_t bucket_;
- std::size_t bucket_count_;
-
- public:
-
- cl_iterator() : ptr_() {}
-
- cl_iterator(node_pointer x, std::size_t b, std::size_t c) :
- ptr_(x), bucket_(b), bucket_count_(c) {}
-
- cl_iterator(boost::unordered::iterator_detail::l_iterator<
- NodePointer, Value> const& x) :
- ptr_(x.ptr_), bucket_(x.bucket_), bucket_count_(x.bucket_count_)
- {}
-
- Value const&
- operator*() const {
- return ptr_->value();
- }
-
- Value const* operator->() const {
- return ptr_->value_ptr();
- }
-
- cl_iterator& operator++() {
- ptr_ = static_cast<node_pointer>(ptr_->next_);
- if (ptr_ && ptr_->hash_ % bucket_count_ != bucket_)
- ptr_ = node_pointer();
- return *this;
- }
-
- cl_iterator operator++(int) {
- cl_iterator tmp(*this);
- ++(*this);
- return tmp;
- }
-
- friend bool operator==(cl_iterator const& x, cl_iterator const& y) {
- return x.ptr_ == y.ptr_;
- }
-
- friend bool operator!=(cl_iterator const& x, cl_iterator const& y) {
- return x.ptr_ != y.ptr_;
- }
- };
-
- template <typename NodePointer, typename Value>
- struct iterator
- : public boost::iterator<
- std::forward_iterator_tag, Value, std::ptrdiff_t,
- NodePointer, Value&>
- {
-#if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
- template <typename ConstNodePointer, typename NodePointer2,
- typename Value2>
- friend struct boost::unordered::iterator_detail::c_iterator;
- private:
-#endif
- typedef NodePointer node_pointer;
- node_pointer node_;
-
- public:
-
- iterator() : node_() {}
-
- explicit iterator(node_pointer const& x) : node_(x) {}
-
- Value& operator*() const {
- return node_->value();
- }
-
- Value* operator->() const {
- return &node_->value();
- }
-
- iterator& operator++() {
- node_ = static_cast<node_pointer>(node_->next_);
- return *this;
- }
-
- iterator operator++(int) {
- iterator tmp(node_);
- node_ = static_cast<node_pointer>(node_->next_);
- return tmp;
- }
-
- bool operator==(iterator const& x) const {
- return node_ == x.node_;
- }
-
- bool operator!=(iterator const& x) const {
- return node_ != x.node_;
- }
- };
-
- template <typename ConstNodePointer, typename NodePointer, typename Value>
- struct c_iterator
- : public boost::iterator<
- std::forward_iterator_tag, Value, std::ptrdiff_t,
- ConstNodePointer, Value const&>
- {
- friend struct boost::unordered::iterator_detail::iterator<
- NodePointer, Value>;
-
-#if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
- template <typename K, typename T, typename H, typename P, typename A>
- friend class boost::unordered::unordered_map;
- template <typename K, typename T, typename H, typename P, typename A>
- friend class boost::unordered::unordered_multimap;
- template <typename T, typename H, typename P, typename A>
- friend class boost::unordered::unordered_set;
- template <typename T, typename H, typename P, typename A>
- friend class boost::unordered::unordered_multiset;
-
- private:
-#endif
-
- typedef NodePointer node_pointer;
- node_pointer node_;
-
- public:
-
- c_iterator() : node_() {}
-
- explicit c_iterator(node_pointer const& x) : node_(x) {}
-
- c_iterator(boost::unordered::iterator_detail::iterator<
- NodePointer, Value> const& x) : node_(x.node_) {}
-
- Value const& operator*() const {
- return node_->value();
- }
-
- Value const* operator->() const {
- return &node_->value();
- }
-
- c_iterator& operator++() {
- node_ = static_cast<node_pointer>(node_->next_);
- return *this;
- }
-
- c_iterator operator++(int) {
- c_iterator tmp(node_);
- node_ = static_cast<node_pointer>(node_->next_);
- return tmp;
- }
-
- friend bool operator==(c_iterator const& x, c_iterator const& y) {
- return x.node_ == y.node_;
- }
-
- friend bool operator!=(c_iterator const& x, c_iterator const& y) {
- return x.node_ != y.node_;
- }
- };
-}}}
-
namespace boost { namespace unordered { namespace detail {
////////////////////////////////////////////////////////////////////////////
@@ -302,7 +59,8 @@ namespace boost { namespace unordered { namespace detail {
boost::unordered::detail::buckets<
typename Types::allocator,
typename Types::bucket,
- typename Types::node>,
+ typename Types::node,
+ typename Types::policy>,
boost::unordered::detail::functions<
typename Types::hasher,
typename Types::key_equal>
@@ -318,6 +76,7 @@ namespace boost { namespace unordered { namespace detail {
typedef typename Types::value_type value_type;
typedef typename Types::table table_impl;
typedef typename Types::link_pointer link_pointer;
+ typedef typename Types::policy policy;
typedef boost::unordered::detail::functions<
typename Types::hasher,
@@ -326,22 +85,15 @@ namespace boost { namespace unordered { namespace detail {
typedef boost::unordered::detail::buckets<
typename Types::allocator,
typename Types::bucket,
- typename Types::node> buckets;
+ typename Types::node,
+ typename Types::policy> buckets;
typedef typename buckets::node_allocator node_allocator;
typedef typename buckets::node_allocator_traits node_allocator_traits;
typedef typename buckets::node_pointer node_pointer;
typedef typename buckets::const_node_pointer const_node_pointer;
- typedef boost::unordered::iterator_detail::
- iterator<node_pointer, value_type> iterator;
- typedef boost::unordered::iterator_detail::
- c_iterator<const_node_pointer, node_pointer, value_type> c_iterator;
- typedef boost::unordered::iterator_detail::
- l_iterator<node_pointer, value_type> l_iterator;
- typedef boost::unordered::iterator_detail::
- cl_iterator<const_node_pointer, node_pointer, value_type>
- cl_iterator;
+ typedef typename table::iterator iterator;
// Members
@@ -384,7 +136,7 @@ namespace boost { namespace unordered { namespace detail {
std::size_t min_buckets_for_size(std::size_t size) const
{
- BOOST_ASSERT(this->mlf_ != 0);
+ BOOST_ASSERT(this->mlf_ >= minimum_max_load_factor);
using namespace std;
@@ -395,7 +147,7 @@ namespace boost { namespace unordered { namespace detail {
// Or from rehash post-condition:
// count > size / mlf_
- return boost::unordered::detail::next_prime(
+ return policy::new_bucket_count(
boost::unordered::detail::double_to_size(floor(
static_cast<double>(size) /
static_cast<double>(mlf_))) + 1);
@@ -408,7 +160,7 @@ namespace boost { namespace unordered { namespace detail {
hasher const& hf,
key_equal const& eq,
node_allocator const& a) :
- buckets(a, boost::unordered::detail::next_prime(num_buckets)),
+ buckets(a, policy::new_bucket_count(num_buckets)),
functions(hf, eq),
mlf_(1.0f),
max_load_(0)
@@ -458,9 +210,9 @@ namespace boost { namespace unordered { namespace detail {
// Iterators
- node_pointer begin() const {
+ iterator begin() const {
return !this->buckets_ ?
- node_pointer() : this->get_start();
+ iterator() : this->get_start();
}
// Assignment
@@ -586,36 +338,41 @@ namespace boost { namespace unordered { namespace detail {
return extractor::extract(x);
}
+ std::size_t hash(key_type const& k) const
+ {
+ return policy::apply_hash(this->hash_function(), k);
+ }
+
// Find Node
template <typename Key, typename Hash, typename Pred>
- node_pointer generic_find_node(
+ iterator generic_find_node(
Key const& k,
- Hash const& hash_function,
+ Hash const& hf,
Pred const& eq) const
{
- if (!this->size_) return node_pointer();
+ if (!this->size_) return iterator();
return static_cast<table_impl const*>(this)->
- find_node_impl(hash_function(k), k, eq);
+ find_node_impl(policy::apply_hash(hf, k), k, eq);
}
- node_pointer find_node(
- std::size_t hash,
+ iterator find_node(
+ std::size_t key_hash,
key_type const& k) const
{
- if (!this->size_) return node_pointer();
+ if (!this->size_) return iterator();
return static_cast<table_impl const*>(this)->
- find_node_impl(hash, k, this->key_eq());
+ find_node_impl(key_hash, k, this->key_eq());
}
- node_pointer find_node(key_type const& k) const
+ iterator find_node(key_type const& k) const
{
- if (!this->size_) return node_pointer();
+ if (!this->size_) return iterator();
return static_cast<table_impl const*>(this)->
- find_node_impl(this->hash_function()(k), k, this->key_eq());
+ find_node_impl(this->hash(k), k, this->key_eq());
}
- node_pointer find_matching_node(node_pointer n) const
+ iterator find_matching_node(iterator n) const
{
// TODO: Does this apply to C++11?
//
@@ -623,13 +380,14 @@ namespace boost { namespace unordered { namespace detail {
// when different hash functions are used. So I can't use the hash
// value from the node here.
- return find_node(get_key(n->value()));
+ return find_node(get_key(*n));
}
// Reserve and rehash
void reserve_for_insert(std::size_t);
void rehash(std::size_t);
+ void reserve(std::size_t);
};
////////////////////////////////////////////////////////////////////////////
@@ -645,7 +403,9 @@ namespace boost { namespace unordered { namespace detail {
this->create_buckets();
this->max_load_ = this->calculate_max_load();
}
- else if(size >= max_load_) {
+ // According to the standard this should be 'size >= max_load_',
+ // but I think this is better, defect report filed.
+ else if(size > max_load_) {
std::size_t num_buckets
= this->min_buckets_for_size((std::max)(size,
this->size_ + (this->size_ >> 1)));
@@ -660,16 +420,16 @@ namespace boost { namespace unordered { namespace detail {
// strong otherwise.
template <typename Types>
- void table<Types>::rehash(std::size_t min_buckets)
+ inline void table<Types>::rehash(std::size_t min_buckets)
{
using namespace std;
if(!this->size_) {
if(this->buckets_) this->delete_buckets();
- this->bucket_count_ = next_prime(min_buckets);
+ this->bucket_count_ = policy::new_bucket_count(min_buckets);
}
else {
- min_buckets = next_prime((std::max)(min_buckets,
+ min_buckets = policy::new_bucket_count((std::max)(min_buckets,
boost::unordered::detail::double_to_size(floor(
static_cast<double>(this->size_) /
static_cast<double>(mlf_))) + 1));
@@ -680,6 +440,13 @@ namespace boost { namespace unordered { namespace detail {
}
}
}
+
+ template <typename Types>
+ inline void table<Types>::reserve(std::size_t num_elements)
+ {
+ rehash(static_cast<std::size_t>(
+ std::ceil(static_cast<double>(num_elements) / this->mlf_)));
+ }
}}}
#endif
diff --git a/boost/unordered/detail/unique.hpp b/boost/unordered/detail/unique.hpp
index 9c049f78c0..10db58fa75 100644
--- a/boost/unordered/detail/unique.hpp
+++ b/boost/unordered/detail/unique.hpp
@@ -12,35 +12,60 @@
#endif
#include <boost/unordered/detail/table.hpp>
-#include <boost/unordered/detail/emplace_args.hpp>
#include <boost/unordered/detail/extract_key.hpp>
#include <boost/throw_exception.hpp>
#include <stdexcept>
namespace boost { namespace unordered { namespace detail {
- template <typename A, typename T> struct node;
+ template <typename A, typename T> struct unique_node;
template <typename T> struct ptr_node;
template <typename Types> struct table_impl;
template <typename A, typename T>
- struct node :
+ struct unique_node :
+ boost::unordered::detail::node_base<
+ typename ::boost::unordered::detail::rebind_wrap<
+ A, unique_node<A, T> >::type::pointer
+ >,
boost::unordered::detail::value_base<T>
{
typedef typename ::boost::unordered::detail::rebind_wrap<
- A, node<A, T> >::type::pointer link_pointer;
+ A, unique_node<A, T> >::type::pointer link_pointer;
+ typedef boost::unordered::detail::node_base<link_pointer> node_base;
- link_pointer next_;
std::size_t hash_;
- node() :
- next_(),
+#if BOOST_UNORDERED_DETAIL_FULL_CONSTRUCT
+ template <BOOST_UNORDERED_EMPLACE_TEMPLATE>
+ explicit unique_node(BOOST_UNORDERED_EMPLACE_ARGS) :
+ node_base(),
+ hash_(0)
+ {
+ boost::unordered::detail::construct_impl(
+ this->value_ptr(), BOOST_UNORDERED_EMPLACE_FORWARD);
+ }
+
+ ~unique_node() {
+ boost::unordered::detail::destroy(this->value_ptr());
+ }
+
+ unique_node(unique_node const&) {
+ BOOST_ASSERT(false);
+ }
+#else
+ unique_node() :
+ node_base(),
hash_(0)
{}
+#endif
void init(link_pointer)
{
}
+
+ private:
+ unique_node& operator=(unique_node const&);
};
template <typename T>
@@ -49,18 +74,41 @@ namespace boost { namespace unordered { namespace detail {
boost::unordered::detail::ptr_bucket
{
typedef boost::unordered::detail::ptr_bucket bucket_base;
+ typedef bucket_base node_base;
typedef ptr_bucket* link_pointer;
std::size_t hash_;
+#if BOOST_UNORDERED_DETAIL_FULL_CONSTRUCT
+ template <BOOST_UNORDERED_EMPLACE_TEMPLATE>
+ explicit ptr_node(BOOST_UNORDERED_EMPLACE_ARGS) :
+ bucket_base(),
+ hash_(0)
+ {
+ boost::unordered::detail::construct_impl(
+ this->value_ptr(), BOOST_UNORDERED_EMPLACE_FORWARD);
+ }
+
+ ~ptr_node() {
+ boost::unordered::detail::destroy(this->value_ptr());
+ }
+
+ ptr_node(ptr_node const&) {
+ BOOST_ASSERT(false);
+ }
+#else
ptr_node() :
bucket_base(),
hash_(0)
{}
+#endif
void init(link_pointer)
{
}
+
+ private:
+ ptr_node& operator=(ptr_node const&);
};
// If the allocator uses raw pointers use ptr_node
@@ -69,7 +117,7 @@ namespace boost { namespace unordered { namespace detail {
template <typename A, typename T, typename NodePtr, typename BucketPtr>
struct pick_node2
{
- typedef boost::unordered::detail::node<A, T> node;
+ typedef boost::unordered::detail::unique_node<A, T> node;
typedef typename boost::unordered::detail::allocator_traits<
typename boost::unordered::detail::rebind_wrap<A, node>::type
@@ -132,6 +180,8 @@ namespace boost { namespace unordered { namespace detail {
typedef boost::unordered::detail::table_impl<types> table;
typedef boost::unordered::detail::set_extractor<value_type> extractor;
+
+ typedef boost::unordered::detail::pick_policy::type policy;
};
template <typename A, typename K, typename M, typename H, typename P>
@@ -156,6 +206,8 @@ namespace boost { namespace unordered { namespace detail {
typedef boost::unordered::detail::table_impl<types> table;
typedef boost::unordered::detail::map_extractor<key_type, value_type>
extractor;
+
+ typedef boost::unordered::detail::pick_policy::type policy;
};
template <typename Types>
@@ -165,6 +217,7 @@ namespace boost { namespace unordered { namespace detail {
typedef typename table::value_type value_type;
typedef typename table::bucket bucket;
typedef typename table::buckets buckets;
+ typedef typename table::policy policy;
typedef typename table::node_pointer node_pointer;
typedef typename table::node_allocator node_allocator;
typedef typename table::node_allocator_traits node_allocator_traits;
@@ -177,6 +230,7 @@ namespace boost { namespace unordered { namespace detail {
typedef typename table::node_constructor node_constructor;
typedef typename table::extractor extractor;
typedef typename table::iterator iterator;
+ typedef typename table::c_iterator c_iterator;
typedef std::pair<iterator, bool> emplace_return;
@@ -212,44 +266,46 @@ namespace boost { namespace unordered { namespace detail {
// Accessors
template <class Key, class Pred>
- node_pointer find_node_impl(
- std::size_t hash,
+ iterator find_node_impl(
+ std::size_t key_hash,
Key const& k,
Pred const& eq) const
{
- std::size_t bucket_index = hash % this->bucket_count_;
- node_pointer n = this->get_start(bucket_index);
+ std::size_t bucket_index =
+ policy::to_bucket(this->bucket_count_, key_hash);
+ iterator n = this->get_start(bucket_index);
for (;;)
{
- if (!n) return n;
+ if (!n.node_) return n;
- std::size_t node_hash = n->hash_;
- if (hash == node_hash)
+ std::size_t node_hash = n.node_->hash_;
+ if (key_hash == node_hash)
{
- if (eq(k, this->get_key(n->value())))
+ if (eq(k, this->get_key(*n)))
return n;
}
else
{
- if (node_hash % this->bucket_count_ != bucket_index)
- return node_pointer();
+ if (policy::to_bucket(this->bucket_count_, node_hash)
+ != bucket_index)
+ return iterator();
}
- n = static_cast<node_pointer>(n->next_);
+ ++n;
}
}
std::size_t count(key_type const& k) const
{
- return this->find_node(k) ? 1 : 0;
+ return this->find_node(k).node_ ? 1 : 0;
}
value_type& at(key_type const& k) const
{
if (this->size_) {
- node_pointer it = this->find_node(k);
- if (it) return it->value();
+ iterator it = this->find_node(k);
+ if (it.node_) return *it;
}
boost::throw_exception(
@@ -259,9 +315,10 @@ namespace boost { namespace unordered { namespace detail {
std::pair<iterator, iterator>
equal_range(key_type const& k) const
{
- node_pointer n = this->find_node(k);
- return std::make_pair(iterator(n),
- iterator(n ? static_cast<node_pointer>(n->next_) : n));
+ iterator n = this->find_node(k);
+ iterator n2 = n;
+ if (n2.node_) ++n2;
+ return std::make_pair(n, n2);
}
// equals
@@ -271,17 +328,15 @@ namespace boost { namespace unordered { namespace detail {
if(this->size_ != other.size_) return false;
if(!this->size_) return true;
- for(node_pointer n1 = this->get_start(); n1;
- n1 = static_cast<node_pointer>(n1->next_))
+ for(iterator n1 = this->get_start(); n1.node_; ++n1)
{
- node_pointer n2 = other.find_matching_node(n1);
+ iterator n2 = other.find_matching_node(n1);
#if !defined(BOOST_UNORDERED_DEPRECATED_EQUALITY)
- if(!n2 || n1->value() != n2->value())
+ if (!n2.node_ || *n1 != *n2)
return false;
#else
- if(!n2 || !extractor::compare_mapped(
- n1->value(), n2->value()))
+ if (!n2.node_ || !extractor::compare_mapped(*n1, *n2))
return false;
#endif
}
@@ -291,23 +346,24 @@ namespace boost { namespace unordered { namespace detail {
// Emplace/Insert
- inline node_pointer add_node(
+ inline iterator add_node(
node_constructor& a,
- std::size_t hash)
+ std::size_t key_hash)
{
node_pointer n = a.release();
- n->hash_ = hash;
+ n->hash_ = key_hash;
- bucket_pointer b = this->get_bucket(hash % this->bucket_count_);
+ bucket_pointer b = this->get_bucket(
+ policy::to_bucket(this->bucket_count_, key_hash));
if (!b->next_)
{
previous_pointer start_node = this->get_previous_start();
if (start_node->next_) {
- this->get_bucket(
- static_cast<node_pointer>(start_node->next_)->hash_ %
- this->bucket_count_)->next_ = n;
+ this->get_bucket(policy::to_bucket(this->bucket_count_,
+ static_cast<node_pointer>(start_node->next_)->hash_)
+ )->next_ = n;
}
b->next_ = start_node;
@@ -321,54 +377,57 @@ namespace boost { namespace unordered { namespace detail {
}
++this->size_;
- return n;
+ return iterator(n);
}
value_type& operator[](key_type const& k)
{
typedef typename value_type::second_type mapped_type;
- std::size_t hash = this->hash_function()(k);
- node_pointer pos = this->find_node(hash, k);
+ std::size_t key_hash = this->hash(k);
+ iterator pos = this->find_node(key_hash, k);
- if (pos) return pos->value();
+ if (pos.node_) return *pos;
// Create the node before rehashing in case it throws an
// exception (need strong safety in such a case).
node_constructor a(this->node_alloc());
a.construct_node();
-#if defined(BOOST_UNORDERED_VARIADIC_MOVE)
- a.construct_value(boost::unordered::piecewise_construct,
- boost::make_tuple(k), boost::make_tuple());
-#else
- a.construct_value(
- boost::unordered::detail::create_emplace_args(
- boost::unordered::piecewise_construct,
- boost::make_tuple(k),
- boost::make_tuple()));
-#endif
+
+ a.construct_value(BOOST_UNORDERED_EMPLACE_ARGS3(
+ boost::unordered::piecewise_construct,
+ boost::make_tuple(k),
+ boost::make_tuple()));
this->reserve_for_insert(this->size_ + 1);
- return add_node(a, hash)->value();
+ return *add_node(a, key_hash);
}
#if defined(BOOST_NO_RVALUE_REFERENCES)
+# if defined(BOOST_NO_VARIADIC_TEMPLATES)
emplace_return emplace(boost::unordered::detail::emplace_args1<
boost::unordered::detail::please_ignore_this_overload> const&)
{
BOOST_ASSERT(false);
- return emplace_return(iterator(this->begin()), false);
+ return emplace_return(this->begin(), false);
+ }
+# else
+ emplace_return emplace(
+ boost::unordered::detail::please_ignore_this_overload const&)
+ {
+ BOOST_ASSERT(false);
+ return emplace_return(this->begin(), false);
}
+# endif
#endif
template <BOOST_UNORDERED_EMPLACE_TEMPLATE>
emplace_return emplace(BOOST_UNORDERED_EMPLACE_ARGS)
{
-#if defined(BOOST_UNORDERED_VARIADIC_MOVE)
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
return emplace_impl(
extractor::extract(BOOST_UNORDERED_EMPLACE_FORWARD),
BOOST_UNORDERED_EMPLACE_FORWARD);
-
#else
return emplace_impl(
extractor::extract(args.a0, args.a1),
@@ -376,7 +435,7 @@ namespace boost { namespace unordered { namespace detail {
#endif
}
-#if !defined(BOOST_UNORDERED_VARIADIC_MOVE)
+#if defined(BOOST_NO_VARIADIC_TEMPLATES)
template <typename A0>
emplace_return emplace(
boost::unordered::detail::emplace_args1<A0> const& args)
@@ -389,10 +448,10 @@ namespace boost { namespace unordered { namespace detail {
emplace_return emplace_impl(key_type const& k,
BOOST_UNORDERED_EMPLACE_ARGS)
{
- std::size_t hash = this->hash_function()(k);
- node_pointer pos = this->find_node(hash, k);
+ std::size_t key_hash = this->hash(k);
+ iterator pos = this->find_node(key_hash, k);
- if (pos) return emplace_return(iterator(pos), false);
+ if (pos.node_) return emplace_return(pos, false);
// Create the node before rehashing in case it throws an
// exception (need strong safety in such a case).
@@ -403,21 +462,21 @@ namespace boost { namespace unordered { namespace detail {
// reserve has basic exception safety if the hash function
// throws, strong otherwise.
this->reserve_for_insert(this->size_ + 1);
- return emplace_return(iterator(this->add_node(a, hash)), true);
+ return emplace_return(this->add_node(a, key_hash), true);
}
emplace_return emplace_impl_with_node(node_constructor& a)
{
key_type const& k = this->get_key(a.value());
- std::size_t hash = this->hash_function()(k);
- node_pointer pos = this->find_node(hash, k);
+ std::size_t key_hash = this->hash(k);
+ iterator pos = this->find_node(key_hash, k);
- if (pos) return emplace_return(iterator(pos), false);
+ if (pos.node_) return emplace_return(pos, false);
// reserve has basic exception safety if the hash function
// throws, strong otherwise.
this->reserve_for_insert(this->size_ + 1);
- return emplace_return(iterator(this->add_node(a, hash)), true);
+ return emplace_return(this->add_node(a, key_hash), true);
}
template <BOOST_UNORDERED_EMPLACE_TEMPLATE>
@@ -473,12 +532,12 @@ namespace boost { namespace unordered { namespace detail {
void insert_range_empty(node_constructor& a, key_type const& k,
InputIt i, InputIt j)
{
- std::size_t hash = this->hash_function()(k);
+ std::size_t key_hash = this->hash(k);
a.construct_node();
a.construct_value2(*i);
this->reserve_for_insert(this->size_ +
boost::unordered::detail::insert_size(i, j));
- this->add_node(a, hash);
+ this->add_node(a, key_hash);
}
template <class InputIt>
@@ -486,19 +545,19 @@ namespace boost { namespace unordered { namespace detail {
InputIt i, InputIt j)
{
// No side effects in this initial code
- std::size_t hash = this->hash_function()(k);
- node_pointer pos = this->find_node(hash, k);
+ std::size_t key_hash = this->hash(k);
+ iterator pos = this->find_node(key_hash, k);
- if (!pos) {
+ if (!pos.node_) {
a.construct_node();
a.construct_value2(*i);
- if(this->size_ + 1 >= this->max_load_)
+ if(this->size_ + 1 > this->max_load_)
this->reserve_for_insert(this->size_ +
boost::unordered::detail::insert_size(i, j));
// Nothing after this point can throw.
- this->add_node(a, hash);
+ this->add_node(a, key_hash);
}
}
@@ -523,11 +582,12 @@ namespace boost { namespace unordered { namespace detail {
{
if(!this->size_) return 0;
- std::size_t hash = this->hash_function()(k);
- std::size_t bucket_index = hash % this->bucket_count_;
- bucket_pointer bucket = this->get_bucket(bucket_index);
+ std::size_t key_hash = this->hash(k);
+ std::size_t bucket_index =
+ policy::to_bucket(this->bucket_count_, key_hash);
+ bucket_pointer this_bucket = this->get_bucket(bucket_index);
- previous_pointer prev = bucket->next_;
+ previous_pointer prev = this_bucket->next_;
if (!prev) return 0;
for (;;)
@@ -535,9 +595,10 @@ namespace boost { namespace unordered { namespace detail {
if (!prev->next_) return 0;
std::size_t node_hash =
static_cast<node_pointer>(prev->next_)->hash_;
- if (node_hash % this->bucket_count_ != bucket_index)
+ if (policy::to_bucket(this->bucket_count_, node_hash)
+ != bucket_index)
return 0;
- if (node_hash == hash &&
+ if (node_hash == key_hash &&
this->key_eq()(k, this->get_key(
static_cast<node_pointer>(prev->next_)->value())))
break;
@@ -547,37 +608,39 @@ namespace boost { namespace unordered { namespace detail {
node_pointer pos = static_cast<node_pointer>(prev->next_);
node_pointer end = static_cast<node_pointer>(pos->next_);
prev->next_ = pos->next_;
- this->fix_buckets(bucket, prev, end);
- return this->delete_nodes(pos, end);
+ this->fix_buckets(this_bucket, prev, end);
+ return this->delete_nodes(c_iterator(pos), c_iterator(end));
}
- node_pointer erase(node_pointer r)
+ iterator erase(c_iterator r)
{
- BOOST_ASSERT(r);
- node_pointer next = static_cast<node_pointer>(r->next_);
+ BOOST_ASSERT(r.node_);
+ iterator next(r.node_);
+ ++next;
- bucket_pointer bucket = this->get_bucket(
- r->hash_ % this->bucket_count_);
- previous_pointer prev = unlink_node(*bucket, r);
+ bucket_pointer this_bucket = this->get_bucket(
+ policy::to_bucket(this->bucket_count_, r.node_->hash_));
+ previous_pointer prev = unlink_node(*this_bucket, r.node_);
- this->fix_buckets(bucket, prev, next);
+ this->fix_buckets(this_bucket, prev, next.node_);
this->delete_node(r);
return next;
}
- node_pointer erase_range(node_pointer r1, node_pointer r2)
+ iterator erase_range(c_iterator r1, c_iterator r2)
{
- if (r1 == r2) return r2;
+ if (r1 == r2) return iterator(r2.node_);
- std::size_t bucket_index = r1->hash_ % this->bucket_count_;
+ std::size_t bucket_index =
+ policy::to_bucket(this->bucket_count_, r1.node_->hash_);
previous_pointer prev = unlink_nodes(
- *this->get_bucket(bucket_index), r1, r2);
- this->fix_buckets_range(bucket_index, prev, r1, r2);
+ *this->get_bucket(bucket_index), r1.node_, r2.node_);
+ this->fix_buckets_range(bucket_index, prev, r1.node_, r2.node_);
this->delete_nodes(r1, r2);
- return r2;
+ return iterator(r2.node_);
}
static previous_pointer unlink_node(bucket& b, node_pointer n)
@@ -610,18 +673,18 @@ namespace boost { namespace unordered { namespace detail {
node_constructor a(dst.node_alloc());
- node_pointer n = src.get_start();
+ iterator n = src.get_start();
previous_pointer prev = dst.get_previous_start();
- while(n) {
+ while(n.node_) {
a.construct_node();
- a.construct_value2(n->value());
+ a.construct_value2(*n);
node_pointer node = a.release();
- node->hash_ = n->hash_;
+ node->hash_ = n.node_->hash_;
prev->next_ = static_cast<link_pointer>(node);
++dst.size_;
- n = static_cast<node_pointer>(n->next_);
+ ++n;
prev = place_in_bucket(dst, prev);
}
@@ -641,18 +704,18 @@ namespace boost { namespace unordered { namespace detail {
node_constructor a(dst.node_alloc());
- node_pointer n = src.get_start();
+ iterator n = src.get_start();
previous_pointer prev = dst.get_previous_start();
- while(n) {
+ while (n.node_) {
a.construct_node();
- a.construct_value2(boost::move(n->value()));
+ a.construct_value2(boost::move(*n));
node_pointer node = a.release();
- node->hash_ = n->hash_;
+ node->hash_ = n.node_->hash_;
prev->next_ = static_cast<link_pointer>(node);
++dst.size_;
- n = static_cast<node_pointer>(n->next_);
+ ++n;
prev = place_in_bucket(dst, prev);
}
@@ -689,7 +752,8 @@ namespace boost { namespace unordered { namespace detail {
previous_pointer prev)
{
node_pointer n = static_cast<node_pointer>(prev->next_);
- bucket_pointer b = dst.get_bucket(n->hash_ % dst.bucket_count_);
+ bucket_pointer b = dst.get_bucket(
+ buckets::to_bucket(dst.bucket_count_, n->hash_));
if (!b->next_) {
b->next_ = prev;
diff --git a/boost/unordered/detail/util.hpp b/boost/unordered/detail/util.hpp
index 53976f8e4f..a901477d19 100644
--- a/boost/unordered/detail/util.hpp
+++ b/boost/unordered/detail/util.hpp
@@ -56,7 +56,7 @@ namespace boost { namespace unordered { namespace detail {
// primes
#define BOOST_UNORDERED_PRIMES \
- (5ul)(11ul)(17ul)(29ul)(37ul)(53ul)(67ul)(79ul) \
+ (17ul)(29ul)(37ul)(53ul)(67ul)(79ul) \
(97ul)(131ul)(193ul)(257ul)(389ul)(521ul)(769ul) \
(1031ul)(1543ul)(2053ul)(3079ul)(6151ul)(12289ul)(24593ul) \
(49157ul)(98317ul)(196613ul)(393241ul)(786433ul) \
diff --git a/boost/unordered/unordered_map.hpp b/boost/unordered/unordered_map.hpp
index 1a7ff151cf..ce52e5becf 100644
--- a/boost/unordered/unordered_map.hpp
+++ b/boost/unordered/unordered_map.hpp
@@ -14,14 +14,13 @@
#endif
#include <boost/unordered/unordered_map_fwd.hpp>
-#include <boost/unordered/detail/allocator_helpers.hpp>
#include <boost/unordered/detail/equivalent.hpp>
#include <boost/unordered/detail/unique.hpp>
#include <boost/unordered/detail/util.hpp>
#include <boost/functional/hash.hpp>
#include <boost/move/move.hpp>
-#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
+#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
#include <initializer_list>
#endif
@@ -133,7 +132,7 @@ namespace unordered
unordered_map(unordered_map&&, allocator_type const&);
#endif
-#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
+#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
unordered_map(
std::initializer_list<value_type>,
size_type = boost::unordered::detail::default_bucket_count,
@@ -176,7 +175,7 @@ namespace unordered
#endif
#endif
-#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
+#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
unordered_map& operator=(std::initializer_list<value_type>);
#endif
@@ -203,12 +202,12 @@ namespace unordered
iterator begin()
{
- return iterator(table_.begin());
+ return table_.begin();
}
const_iterator begin() const
{
- return const_iterator(table_.begin());
+ return table_.begin();
}
iterator end()
@@ -223,7 +222,7 @@ namespace unordered
const_iterator cbegin() const
{
- return const_iterator(table_.begin());
+ return table_.begin();
}
const_iterator cend() const
@@ -233,15 +232,15 @@ namespace unordered
// emplace
-#if defined(BOOST_UNORDERED_VARIADIC_MOVE)
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
template <class... Args>
- std::pair<iterator, bool> emplace(Args&&... args)
+ std::pair<iterator, bool> emplace(BOOST_FWD_REF(Args)... args)
{
return table_.emplace(boost::forward<Args>(args)...);
}
template <class... Args>
- iterator emplace_hint(const_iterator, Args&&... args)
+ iterator emplace_hint(const_iterator, BOOST_FWD_REF(Args)... args)
{
return table_.emplace(boost::forward<Args>(args)...).first;
}
@@ -401,7 +400,7 @@ namespace unordered
template <class InputIt> void insert(InputIt, InputIt);
-#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
+#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
void insert(std::initializer_list<value_type>);
#endif
@@ -465,7 +464,8 @@ namespace unordered
size_type bucket(const key_type& k) const
{
- return table_.hash_function()(k) % table_.bucket_count_;
+ return table::to_bucket(table_.bucket_count_,
+ table_.hash(k));
}
local_iterator begin(size_type n)
@@ -514,6 +514,7 @@ namespace unordered
float load_factor() const;
void max_load_factor(float);
void rehash(size_type);
+ void reserve(size_type);
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
friend bool operator==<K,T,H,P,A>(
@@ -617,7 +618,7 @@ namespace unordered
unordered_multimap(unordered_multimap&&, allocator_type const&);
#endif
-#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
+#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
unordered_multimap(
std::initializer_list<value_type>,
size_type = boost::unordered::detail::default_bucket_count,
@@ -661,7 +662,7 @@ namespace unordered
#endif
#endif
-#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
+#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
unordered_multimap& operator=(std::initializer_list<value_type>);
#endif
@@ -688,12 +689,12 @@ namespace unordered
iterator begin()
{
- return iterator(table_.begin());
+ return table_.begin();
}
const_iterator begin() const
{
- return const_iterator(table_.begin());
+ return table_.begin();
}
iterator end()
@@ -708,7 +709,7 @@ namespace unordered
const_iterator cbegin() const
{
- return const_iterator(table_.begin());
+ return table_.begin();
}
const_iterator cend() const
@@ -718,15 +719,15 @@ namespace unordered
// emplace
-#if defined(BOOST_UNORDERED_VARIADIC_MOVE)
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
template <class... Args>
- iterator emplace(Args&&... args)
+ iterator emplace(BOOST_FWD_REF(Args)... args)
{
return table_.emplace(boost::forward<Args>(args)...);
}
template <class... Args>
- iterator emplace_hint(const_iterator, Args&&... args)
+ iterator emplace_hint(const_iterator, BOOST_FWD_REF(Args)... args)
{
return table_.emplace(boost::forward<Args>(args)...);
}
@@ -886,7 +887,7 @@ namespace unordered
template <class InputIt> void insert(InputIt, InputIt);
-#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
+#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
void insert(std::initializer_list<value_type>);
#endif
@@ -946,7 +947,8 @@ namespace unordered
size_type bucket(const key_type& k) const
{
- return table_.hash_function()(k) % table_.bucket_count_;
+ return table::to_bucket(table_.bucket_count_,
+ table_.hash(k));
}
local_iterator begin(size_type n)
@@ -995,6 +997,7 @@ namespace unordered
float load_factor() const;
void max_load_factor(float);
void rehash(size_type);
+ void reserve(size_type);
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
friend bool operator==<K,T,H,P,A>(
@@ -1084,7 +1087,7 @@ namespace unordered
#endif
-#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
+#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
template <class K, class T, class H, class P, class A>
unordered_map<K,T,H,P,A>::unordered_map(
@@ -1126,7 +1129,7 @@ namespace unordered
table_.insert_range(first, last);
}
-#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
+#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
template <class K, class T, class H, class P, class A>
void unordered_map<K,T,H,P,A>::insert(
std::initializer_list<value_type> list)
@@ -1139,7 +1142,7 @@ namespace unordered
typename unordered_map<K,T,H,P,A>::iterator
unordered_map<K,T,H,P,A>::erase(const_iterator position)
{
- return iterator(table_.erase(position.node_));
+ return table_.erase(position);
}
template <class K, class T, class H, class P, class A>
@@ -1154,7 +1157,7 @@ namespace unordered
unordered_map<K,T,H,P,A>::erase(
const_iterator first, const_iterator last)
{
- return iterator(table_.erase_range(first.node_, last.node_));
+ return table_.erase_range(first, last);
}
template <class K, class T, class H, class P, class A>
@@ -1212,14 +1215,14 @@ namespace unordered
typename unordered_map<K,T,H,P,A>::iterator
unordered_map<K,T,H,P,A>::find(const key_type& k)
{
- return iterator(table_.find_node(k));
+ return table_.find_node(k);
}
template <class K, class T, class H, class P, class A>
typename unordered_map<K,T,H,P,A>::const_iterator
unordered_map<K,T,H,P,A>::find(const key_type& k) const
{
- return const_iterator(table_.find_node(k));
+ return table_.find_node(k);
}
template <class K, class T, class H, class P, class A>
@@ -1231,7 +1234,7 @@ namespace unordered
CompatibleHash const& hash,
CompatiblePredicate const& eq)
{
- return iterator(table_.generic_find_node(k, hash, eq));
+ return table_.generic_find_node(k, hash, eq);
}
template <class K, class T, class H, class P, class A>
@@ -1243,7 +1246,7 @@ namespace unordered
CompatibleHash const& hash,
CompatiblePredicate const& eq) const
{
- return const_iterator(table_.generic_find_node(k, hash, eq));
+ return table_.generic_find_node(k, hash, eq);
}
template <class K, class T, class H, class P, class A>
@@ -1299,6 +1302,12 @@ namespace unordered
}
template <class K, class T, class H, class P, class A>
+ void unordered_map<K,T,H,P,A>::reserve(size_type n)
+ {
+ table_.reserve(n);
+ }
+
+ template <class K, class T, class H, class P, class A>
inline bool operator==(
unordered_map<K,T,H,P,A> const& m1,
unordered_map<K,T,H,P,A> const& m2)
@@ -1411,7 +1420,7 @@ namespace unordered
#endif
-#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
+#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
template <class K, class T, class H, class P, class A>
unordered_multimap<K,T,H,P,A>::unordered_multimap(
@@ -1453,7 +1462,7 @@ namespace unordered
table_.insert_range(first, last);
}
-#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
+#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
template <class K, class T, class H, class P, class A>
void unordered_multimap<K,T,H,P,A>::insert(
std::initializer_list<value_type> list)
@@ -1466,7 +1475,7 @@ namespace unordered
typename unordered_multimap<K,T,H,P,A>::iterator
unordered_multimap<K,T,H,P,A>::erase(const_iterator position)
{
- return iterator(table_.erase(position.node_));
+ return table_.erase(position);
}
template <class K, class T, class H, class P, class A>
@@ -1481,7 +1490,7 @@ namespace unordered
unordered_multimap<K,T,H,P,A>::erase(
const_iterator first, const_iterator last)
{
- return iterator(table_.erase_range(first.node_, last.node_));
+ return table_.erase_range(first, last);
}
template <class K, class T, class H, class P, class A>
@@ -1518,14 +1527,14 @@ namespace unordered
typename unordered_multimap<K,T,H,P,A>::iterator
unordered_multimap<K,T,H,P,A>::find(const key_type& k)
{
- return iterator(table_.find_node(k));
+ return table_.find_node(k);
}
template <class K, class T, class H, class P, class A>
typename unordered_multimap<K,T,H,P,A>::const_iterator
unordered_multimap<K,T,H,P,A>::find(const key_type& k) const
{
- return const_iterator(table_.find_node(k));
+ return table_.find_node(k);
}
template <class K, class T, class H, class P, class A>
@@ -1537,7 +1546,7 @@ namespace unordered
CompatibleHash const& hash,
CompatiblePredicate const& eq)
{
- return iterator(table_.generic_find_node(k, hash, eq));
+ return table_.generic_find_node(k, hash, eq);
}
template <class K, class T, class H, class P, class A>
@@ -1549,7 +1558,7 @@ namespace unordered
CompatibleHash const& hash,
CompatiblePredicate const& eq) const
{
- return const_iterator(table_.generic_find_node(k, hash, eq));
+ return table_.generic_find_node(k, hash, eq);
}
template <class K, class T, class H, class P, class A>
@@ -1605,6 +1614,12 @@ namespace unordered
}
template <class K, class T, class H, class P, class A>
+ void unordered_multimap<K,T,H,P,A>::reserve(size_type n)
+ {
+ table_.reserve(n);
+ }
+
+ template <class K, class T, class H, class P, class A>
inline bool operator==(
unordered_multimap<K,T,H,P,A> const& m1,
unordered_multimap<K,T,H,P,A> const& m2)
diff --git a/boost/unordered/unordered_map_fwd.hpp b/boost/unordered/unordered_map_fwd.hpp
index 91f1e3bdfa..980bb3ee77 100644
--- a/boost/unordered/unordered_map_fwd.hpp
+++ b/boost/unordered/unordered_map_fwd.hpp
@@ -10,12 +10,23 @@
# pragma once
#endif
+#include <boost/config.hpp>
+#include <memory>
+#include <functional>
+#include <boost/functional/hash_fwd.hpp>
#include <boost/unordered/detail/fwd.hpp>
namespace boost
{
namespace unordered
{
+ template <class K,
+ class T,
+ class H = boost::hash<K>,
+ class P = std::equal_to<K>,
+ class A = std::allocator<std::pair<const K, T> > >
+ class unordered_map;
+
template <class K, class T, class H, class P, class A>
inline bool operator==(unordered_map<K, T, H, P, A> const&,
unordered_map<K, T, H, P, A> const&);
@@ -26,6 +37,13 @@ namespace boost
inline void swap(unordered_map<K, T, H, P, A>&,
unordered_map<K, T, H, P, A>&);
+ template <class K,
+ class T,
+ class H = boost::hash<K>,
+ class P = std::equal_to<K>,
+ class A = std::allocator<std::pair<const K, T> > >
+ class unordered_multimap;
+
template <class K, class T, class H, class P, class A>
inline bool operator==(unordered_multimap<K, T, H, P, A> const&,
unordered_multimap<K, T, H, P, A> const&);
diff --git a/boost/unordered/unordered_set.hpp b/boost/unordered/unordered_set.hpp
index 384769ddf1..5d9a0b8e8d 100644
--- a/boost/unordered/unordered_set.hpp
+++ b/boost/unordered/unordered_set.hpp
@@ -14,14 +14,13 @@
#endif
#include <boost/unordered/unordered_set_fwd.hpp>
-#include <boost/unordered/detail/allocator_helpers.hpp>
#include <boost/unordered/detail/equivalent.hpp>
#include <boost/unordered/detail/unique.hpp>
#include <boost/unordered/detail/util.hpp>
#include <boost/functional/hash.hpp>
#include <boost/move/move.hpp>
-#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
+#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
#include <initializer_list>
#endif
@@ -131,7 +130,7 @@ namespace unordered
unordered_set(unordered_set&&, allocator_type const&);
#endif
-#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
+#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
unordered_set(
std::initializer_list<value_type>,
size_type = boost::unordered::detail::default_bucket_count,
@@ -174,7 +173,7 @@ namespace unordered
#endif
#endif
-#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
+#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
unordered_set& operator=(std::initializer_list<value_type>);
#endif
@@ -201,12 +200,12 @@ namespace unordered
iterator begin()
{
- return iterator(table_.begin());
+ return table_.begin();
}
const_iterator begin() const
{
- return const_iterator(table_.begin());
+ return table_.begin();
}
iterator end()
@@ -221,7 +220,7 @@ namespace unordered
const_iterator cbegin() const
{
- return const_iterator(table_.begin());
+ return table_.begin();
}
const_iterator cend() const
@@ -231,15 +230,15 @@ namespace unordered
// emplace
-#if defined(BOOST_UNORDERED_VARIADIC_MOVE)
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
template <class... Args>
- std::pair<iterator, bool> emplace(Args&&... args)
+ std::pair<iterator, bool> emplace(BOOST_FWD_REF(Args)... args)
{
return table_.emplace(boost::forward<Args>(args)...);
}
template <class... Args>
- iterator emplace_hint(const_iterator, Args&&... args)
+ iterator emplace_hint(const_iterator, BOOST_FWD_REF(Args)... args)
{
return table_.emplace(boost::forward<Args>(args)...).first;
}
@@ -400,7 +399,7 @@ namespace unordered
template <class InputIt> void insert(InputIt, InputIt);
-#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
+#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
void insert(std::initializer_list<value_type>);
#endif
@@ -450,7 +449,8 @@ namespace unordered
size_type bucket(const key_type& k) const
{
- return table_.hash_function()(k) % table_.bucket_count_;
+ return table::to_bucket(table_.bucket_count_,
+ table_.hash(k));
}
local_iterator begin(size_type n)
@@ -499,6 +499,7 @@ namespace unordered
float load_factor() const;
void max_load_factor(float);
void rehash(size_type);
+ void reserve(size_type);
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
friend bool operator==<T,H,P,A>(
@@ -601,7 +602,7 @@ namespace unordered
unordered_multiset(unordered_multiset&&, allocator_type const&);
#endif
-#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
+#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
unordered_multiset(
std::initializer_list<value_type>,
size_type = boost::unordered::detail::default_bucket_count,
@@ -645,7 +646,7 @@ namespace unordered
#endif
#endif
-#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
+#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
unordered_multiset& operator=(std::initializer_list<value_type>);
#endif
@@ -702,15 +703,15 @@ namespace unordered
// emplace
-#if defined(BOOST_UNORDERED_VARIADIC_MOVE)
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
template <class... Args>
- iterator emplace(Args&&... args)
+ iterator emplace(BOOST_FWD_REF(Args)... args)
{
return table_.emplace(boost::forward<Args>(args)...);
}
template <class... Args>
- iterator emplace_hint(const_iterator, Args&&... args)
+ iterator emplace_hint(const_iterator, BOOST_FWD_REF(Args)... args)
{
return table_.emplace(boost::forward<Args>(args)...);
}
@@ -871,7 +872,7 @@ namespace unordered
template <class InputIt> void insert(InputIt, InputIt);
-#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
+#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
void insert(std::initializer_list<value_type>);
#endif
@@ -921,7 +922,8 @@ namespace unordered
size_type bucket(const key_type& k) const
{
- return table_.hash_function()(k) % table_.bucket_count_;
+ return table::to_bucket(table_.bucket_count_,
+ table_.hash(k));
}
local_iterator begin(size_type n)
@@ -970,6 +972,7 @@ namespace unordered
float load_factor() const;
void max_load_factor(float);
void rehash(size_type);
+ void reserve(size_type);
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
friend bool operator==<T,H,P,A>(
@@ -1059,7 +1062,7 @@ namespace unordered
#endif
-#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
+#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
template <class T, class H, class P, class A>
unordered_set<T,H,P,A>::unordered_set(
@@ -1101,7 +1104,7 @@ namespace unordered
table_.insert_range(first, last);
}
-#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
+#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
template <class T, class H, class P, class A>
void unordered_set<T,H,P,A>::insert(
std::initializer_list<value_type> list)
@@ -1114,7 +1117,7 @@ namespace unordered
typename unordered_set<T,H,P,A>::iterator
unordered_set<T,H,P,A>::erase(const_iterator position)
{
- return iterator(table_.erase(position.node_));
+ return table_.erase(position);
}
template <class T, class H, class P, class A>
@@ -1129,7 +1132,7 @@ namespace unordered
unordered_set<T,H,P,A>::erase(
const_iterator first, const_iterator last)
{
- return iterator(table_.erase_range(first.node_, last.node_));
+ return table_.erase_range(first, last);
}
template <class T, class H, class P, class A>
@@ -1166,7 +1169,7 @@ namespace unordered
typename unordered_set<T,H,P,A>::const_iterator
unordered_set<T,H,P,A>::find(const key_type& k) const
{
- return const_iterator(table_.find_node(k));
+ return table_.find_node(k);
}
template <class T, class H, class P, class A>
@@ -1178,7 +1181,7 @@ namespace unordered
CompatibleHash const& hash,
CompatiblePredicate const& eq) const
{
- return const_iterator(table_.generic_find_node(k, hash, eq));
+ return table_.generic_find_node(k, hash, eq);
}
template <class T, class H, class P, class A>
@@ -1225,6 +1228,12 @@ namespace unordered
}
template <class T, class H, class P, class A>
+ void unordered_set<T,H,P,A>::reserve(size_type n)
+ {
+ table_.reserve(n);
+ }
+
+ template <class T, class H, class P, class A>
inline bool operator==(
unordered_set<T,H,P,A> const& m1,
unordered_set<T,H,P,A> const& m2)
@@ -1337,7 +1346,7 @@ namespace unordered
#endif
-#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
+#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
template <class T, class H, class P, class A>
unordered_multiset<T,H,P,A>::unordered_multiset(
@@ -1379,7 +1388,7 @@ namespace unordered
table_.insert_range(first, last);
}
-#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
+#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
template <class T, class H, class P, class A>
void unordered_multiset<T,H,P,A>::insert(
std::initializer_list<value_type> list)
@@ -1392,7 +1401,7 @@ namespace unordered
typename unordered_multiset<T,H,P,A>::iterator
unordered_multiset<T,H,P,A>::erase(const_iterator position)
{
- return iterator(table_.erase(position.node_));
+ return table_.erase(position);
}
template <class T, class H, class P, class A>
@@ -1407,7 +1416,7 @@ namespace unordered
unordered_multiset<T,H,P,A>::erase(
const_iterator first, const_iterator last)
{
- return iterator(table_.erase_range(first.node_, last.node_));
+ return table_.erase_range(first, last);
}
template <class T, class H, class P, class A>
@@ -1444,7 +1453,7 @@ namespace unordered
typename unordered_multiset<T,H,P,A>::const_iterator
unordered_multiset<T,H,P,A>::find(const key_type& k) const
{
- return const_iterator(table_.find_node(k));
+ return table_.find_node(k);
}
template <class T, class H, class P, class A>
@@ -1456,7 +1465,7 @@ namespace unordered
CompatibleHash const& hash,
CompatiblePredicate const& eq) const
{
- return const_iterator(table_.generic_find_node(k, hash, eq));
+ return table_.generic_find_node(k, hash, eq);
}
template <class T, class H, class P, class A>
@@ -1503,6 +1512,12 @@ namespace unordered
}
template <class T, class H, class P, class A>
+ void unordered_multiset<T,H,P,A>::reserve(size_type n)
+ {
+ table_.reserve(n);
+ }
+
+ template <class T, class H, class P, class A>
inline bool operator==(
unordered_multiset<T,H,P,A> const& m1,
unordered_multiset<T,H,P,A> const& m2)
diff --git a/boost/unordered/unordered_set_fwd.hpp b/boost/unordered/unordered_set_fwd.hpp
index f19c137d74..0c8b6d8d63 100644
--- a/boost/unordered/unordered_set_fwd.hpp
+++ b/boost/unordered/unordered_set_fwd.hpp
@@ -10,12 +10,22 @@
# pragma once
#endif
+#include <boost/config.hpp>
+#include <memory>
+#include <functional>
+#include <boost/functional/hash_fwd.hpp>
#include <boost/unordered/detail/fwd.hpp>
namespace boost
{
namespace unordered
{
+ template <class T,
+ class H = boost::hash<T>,
+ class P = std::equal_to<T>,
+ class A = std::allocator<T> >
+ class unordered_set;
+
template <class T, class H, class P, class A>
inline bool operator==(unordered_set<T, H, P, A> const&,
unordered_set<T, H, P, A> const&);
@@ -26,6 +36,12 @@ namespace boost
inline void swap(unordered_set<T, H, P, A> &m1,
unordered_set<T, H, P, A> &m2);
+ template <class T,
+ class H = boost::hash<T>,
+ class P = std::equal_to<T>,
+ class A = std::allocator<T> >
+ class unordered_multiset;
+
template <class T, class H, class P, class A>
inline bool operator==(unordered_multiset<T, H, P, A> const&,
unordered_multiset<T, H, P, A> const&);
diff --git a/boost/utility.hpp b/boost/utility.hpp
index b909f296b2..82177c8b47 100644
--- a/boost/utility.hpp
+++ b/boost/utility.hpp
@@ -13,6 +13,7 @@
#include <boost/utility/base_from_member.hpp>
#include <boost/utility/binary.hpp>
#include <boost/utility/enable_if.hpp>
+#include <boost/utility/identity_type.hpp>
#include <boost/checked_delete.hpp>
#include <boost/next_prior.hpp>
#include <boost/noncopyable.hpp>
diff --git a/boost/utility/declval.hpp b/boost/utility/declval.hpp
index 41ec3dcc69..d74610c584 100644
--- a/boost/utility/declval.hpp
+++ b/boost/utility/declval.hpp
@@ -13,6 +13,7 @@
//----------------------------------------------------------------------------//
#include <boost/type_traits/add_rvalue_reference.hpp>
+//#include <boost/type_traits/add_lvalue_reference.hpp>
//----------------------------------------------------------------------------//
// //
@@ -36,9 +37,13 @@
namespace boost {
+//#if !defined(BOOST_NO_RVALUE_REFERENCES)
template <typename T>
- typename add_rvalue_reference<T>::type declval(); //noexcept; // as unevaluated operand
-
+ typename add_rvalue_reference<T>::type declval() BOOST_NOEXCEPT; // as unevaluated operand
+//#else
+// template <typename T>
+// typename add_lvalue_reference<T>::type declval() BOOST_NOEXCEPT; // as unevaluated operand
+//#endif
} // namespace boost
#endif // BOOST_TYPE_TRAITS_EXT_DECLVAL__HPP
diff --git a/boost/utility/identity_type.hpp b/boost/utility/identity_type.hpp
new file mode 100644
index 0000000000..4a1f6c4de5
--- /dev/null
+++ b/boost/utility/identity_type.hpp
@@ -0,0 +1,46 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/utility/identity_type
+
+/** @file
+Wrap type expressions with round parenthesis so they can be passed to macros
+even if they contain commas.
+*/
+
+#ifndef BOOST_IDENTITY_TYPE_HPP_
+#define BOOST_IDENTITY_TYPE_HPP_
+
+#include <boost/type_traits/function_traits.hpp>
+
+/**
+@brief This macro allows to wrap the specified type expression within extra
+round parenthesis so the type can be passed as a single macro parameter even if
+it contains commas (not already wrapped within round parenthesis).
+
+@Params
+@Param{parenthesized_type,
+The type expression to be passed as macro parameter wrapped by a single set
+of round parenthesis <c>(...)</c>.
+This type expression can contain an arbitrary number of commas.
+}
+@EndParams
+
+This macro works on any C++03 compiler (it does not use variadic macros).
+
+This macro must be prefixed by <c>typename</c> when used within templates.
+Note that the compiler will not be able to automatically determine function
+template parameters when they are wrapped with this macro (these parameters
+need to be explicitly specified when calling the function template).
+
+On some compilers (like GCC), using this macro on abstract types requires to
+add and remove a reference to the specified type.
+*/
+#define BOOST_IDENTITY_TYPE(parenthesized_type) \
+ /* must NOT prefix this with `::` to work with parenthesized syntax */ \
+ boost::function_traits< void parenthesized_type >::arg1_type
+
+#endif // #include guard
+
diff --git a/boost/uuid/seed_rng.hpp b/boost/uuid/seed_rng.hpp
index 7c2b51d417..d5d1e0fc6a 100644
--- a/boost/uuid/seed_rng.hpp
+++ b/boost/uuid/seed_rng.hpp
@@ -79,7 +79,7 @@ public:
: rd_index_(5)
, random_(std::fopen( "/dev/urandom", "rb" ))
{}
-
+
~seed_rng()
{
if (random_) {
@@ -139,7 +139,7 @@ private:
}
{
- unsigned int rn[] =
+ unsigned int rn[] =
{ static_cast<unsigned int>(std::rand())
, static_cast<unsigned int>(std::rand())
, static_cast<unsigned int>(std::rand())
@@ -154,6 +154,9 @@ private:
if(random_)
{
// the not_used variable is to suppress warnings
+#if defined(__GNUC__)
+ __attribute__((unused))
+#endif
size_t not_used = 0;
not_used = std::fread( buffer, 1, 20, random_ );
}
@@ -190,7 +193,7 @@ private:
unsigned int rd_[5];
int rd_index_;
std::FILE * random_;
-
+
private: // make seed_rng noncopyable
seed_rng(seed_rng const&);
seed_rng& operator=(seed_rng const&);
@@ -213,7 +216,7 @@ class generator_iterator
, single_pass_traversal_tag
, typename Generator::result_type const&
> super_t;
-
+
public:
generator_iterator() : m_g(NULL) {}
generator_iterator(Generator* g) : m_g(g), m_value((*m_g)()) {}
diff --git a/boost/variant/detail/hash_variant.hpp b/boost/variant/detail/hash_variant.hpp
new file mode 100644
index 0000000000..3da669e91a
--- /dev/null
+++ b/boost/variant/detail/hash_variant.hpp
@@ -0,0 +1,48 @@
+//-----------------------------------------------------------------------------
+// boost variant/detail/hash_variant.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2011
+// Antony Polukhin
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+
+#ifndef BOOST_HASH_VARIANT_FUNCTION_HPP
+#define BOOST_HASH_VARIANT_FUNCTION_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+#include <boost/variant/variant_fwd.hpp>
+#include <boost/variant/static_visitor.hpp>
+#include <boost/variant/apply_visitor.hpp>
+#include <boost/functional/hash_fwd.hpp>
+
+namespace boost {
+
+ namespace detail { namespace variant {
+ struct variant_hasher: public boost::static_visitor<std::size_t> {
+ template <class T>
+ std::size_t operator()(T const& val) const {
+ using namespace boost;
+ hash<T> hasher;
+ return hasher(val);
+ }
+ };
+ }}
+
+ template < BOOST_VARIANT_ENUM_PARAMS(typename T) >
+ std::size_t hash_value(variant< BOOST_VARIANT_ENUM_PARAMS(T) > const& val) {
+ std::size_t seed = boost::apply_visitor(detail::variant::variant_hasher(), val);
+ hash_combine(seed, val.which());
+ return seed;
+ }
+}
+
+#endif
+
diff --git a/boost/variant/detail/visitation_impl.hpp b/boost/variant/detail/visitation_impl.hpp
index 73b33dd1e3..9cc3015049 100644
--- a/boost/variant/detail/visitation_impl.hpp
+++ b/boost/variant/detail/visitation_impl.hpp
@@ -261,7 +261,7 @@ visitation_impl(
# undef BOOST_VARIANT_AUX_APPLY_VISITOR_STEP_CASE
- default: BOOST_ASSERT(!"Boost.Variant internal error: 'which' out of range.");
+ default: break;
}
// If not handled in this iteration, continue unrolling:
diff --git a/boost/variant/variant.hpp b/boost/variant/variant.hpp
index d313cd2fe8..6afd19077e 100644
--- a/boost/variant/variant.hpp
+++ b/boost/variant/variant.hpp
@@ -32,6 +32,7 @@
#include "boost/variant/detail/make_variant_list.hpp"
#include "boost/variant/detail/over_sequence.hpp"
#include "boost/variant/detail/visitation_impl.hpp"
+#include "boost/variant/detail/hash_variant.hpp"
#include "boost/variant/detail/generic_result_type.hpp"
#include "boost/variant/detail/has_nothrow_move.hpp"
diff --git a/boost/version.hpp b/boost/version.hpp
index 0055f1ecb0..3eeeb362b2 100644
--- a/boost/version.hpp
+++ b/boost/version.hpp
@@ -19,7 +19,7 @@
// BOOST_VERSION / 100 % 1000 is the minor version
// BOOST_VERSION / 100000 is the major version
-#define BOOST_VERSION 104900
+#define BOOST_VERSION 105100
//
// BOOST_LIB_VERSION must be defined to be the same as BOOST_VERSION
@@ -27,9 +27,6 @@
// number, y is the minor version number, and z is the patch level if not 0.
// This is used by <config/auto_link.hpp> to select which library version to link to.
-#define BOOST_LIB_VERSION "1_49"
+#define BOOST_LIB_VERSION "1_51"
#endif
-
-
-
diff --git a/boost/wave.hpp b/boost/wave.hpp
index 14842e3637..f2b3bc20f2 100644
--- a/boost/wave.hpp
+++ b/boost/wave.hpp
@@ -5,7 +5,7 @@
See http://www.boost.org/libs/wave for documentation
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/cpp_context.hpp b/boost/wave/cpp_context.hpp
index f053cdb815..50c1d1ced9 100644
--- a/boost/wave/cpp_context.hpp
+++ b/boost/wave/cpp_context.hpp
@@ -4,7 +4,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/cpp_exceptions.hpp b/boost/wave/cpp_exceptions.hpp
index 3fbd61af96..3af69ea0ce 100644
--- a/boost/wave/cpp_exceptions.hpp
+++ b/boost/wave/cpp_exceptions.hpp
@@ -3,7 +3,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
@@ -283,7 +283,7 @@ public:
"a macro or scope name", // alreadydefined_name
"undefined macro or scope name may not be imported", // undefined_macroname
"ill formed macro name", // invalid_macroname
- "qualified names are supported in C++0x mode only", // unexpected_qualified_name
+ "qualified names are supported in C++11 mode only", // unexpected_qualified_name
"division by zero in preprocessor expression", // division_by_zero
"integer overflow in preprocessor expression", // integer_overflow
"this cannot be used as a macro name as it is "
diff --git a/boost/wave/cpp_iteration_context.hpp b/boost/wave/cpp_iteration_context.hpp
index bf9f734cdb..78c5590ce4 100644
--- a/boost/wave/cpp_iteration_context.hpp
+++ b/boost/wave/cpp_iteration_context.hpp
@@ -1,10 +1,10 @@
/*=============================================================================
Boost.Wave: A Standard compliant C++ preprocessor library
Definition of the preprocessor context
-
+
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
@@ -22,7 +22,7 @@
#include <boost/wave/cpp_exceptions.hpp>
#include <boost/wave/language_support.hpp>
#include <boost/wave/util/file_position.hpp>
-// #include <boost/spirit/include/iterator/classic_multi_pass.hpp> // make_multi_pass
+// #include <boost/spirit/include/iterator/classic_multi_pass.hpp> // make_multi_pass
// this must occur after all of the includes and before any code appears
#ifdef BOOST_HAS_ABI_HEADERS
@@ -36,9 +36,9 @@ namespace iteration_context_policies {
///////////////////////////////////////////////////////////////////////////////
//
-// The iteration_context_policies templates are policies for the
-// boost::wave::iteration_context which allows to control, how a given
-// input file is to be represented by a pair of iterators pointing to the
+// The iteration_context_policies templates are policies for the
+// boost::wave::iteration_context which allows to control, how a given
+// input file is to be represented by a pair of iterators pointing to the
// begin and the end of the resulting input sequence.
//
///////////////////////////////////////////////////////////////////////////////
@@ -47,18 +47,18 @@ namespace iteration_context_policies {
//
// load_file_to_string
//
- // Loads a file into a string and returns the iterators pointing to
+ // Loads a file into a string and returns the iterators pointing to
// the beginning and the end of the loaded string.
//
///////////////////////////////////////////////////////////////////////////
- struct load_file_to_string
+ struct load_file_to_string
{
template <typename IterContextT>
- class inner
+ class inner
{
public:
template <typename PositionT>
- static void init_iterators(IterContextT &iter_ctx,
+ static void init_iterators(IterContextT &iter_ctx,
PositionT const &act_pos, language_support language)
{
typedef typename IterContextT::iterator_type iterator_type;
@@ -66,7 +66,7 @@ namespace iteration_context_policies {
// read in the file
std::ifstream instream(iter_ctx.filename.c_str());
if (!instream.is_open()) {
- BOOST_WAVE_THROW_CTX(iter_ctx.ctx, preprocess_exception,
+ BOOST_WAVE_THROW_CTX(iter_ctx.ctx, preprocess_exception,
bad_include_file, iter_ctx.filename.c_str(), act_pos);
return;
}
@@ -77,7 +77,7 @@ namespace iteration_context_policies {
std::istreambuf_iterator<char>());
iter_ctx.first = iterator_type(
- iter_ctx.instring.begin(), iter_ctx.instring.end(),
+ iter_ctx.instring.begin(), iter_ctx.instring.end(),
PositionT(iter_ctx.filename), language);
iter_ctx.last = iterator_type();
}
@@ -92,7 +92,7 @@ namespace iteration_context_policies {
///////////////////////////////////////////////////////////////////////////////
// Base class for iteration contexts
template <typename ContextT, typename IteratorT>
-struct base_iteration_context
+struct base_iteration_context
{
enum file_type
{
@@ -103,21 +103,23 @@ struct base_iteration_context
};
base_iteration_context(ContextT& ctx_,
- BOOST_WAVE_STRINGTYPE const &fname, std::size_t if_block_depth = 0)
- : real_filename(fname), real_relative_filename(fname), filename(fname),
- line(1), emitted_lines(0), if_block_depth(if_block_depth), ctx(ctx_)
+ BOOST_WAVE_STRINGTYPE const &fname, std::size_t if_block_depth = 0)
+ : real_filename(fname), real_relative_filename(fname), filename(fname),
+ line(1), emitted_lines(0), if_block_depth(if_block_depth), ctx(ctx_),
+ type(main_file)
{}
- base_iteration_context(ContextT& ctx_,
- IteratorT const &first_, IteratorT const &last_,
+ base_iteration_context(ContextT& ctx_,
+ IteratorT const &first_, IteratorT const &last_,
BOOST_WAVE_STRINGTYPE const &fname, std::size_t if_block_depth = 0,
- file_type type = main_file)
- : first(first_), last(last_), real_filename(fname),
- real_relative_filename(fname), filename(fname),
- line(1), emitted_lines(0), if_block_depth(if_block_depth), ctx(ctx_)
+ file_type type_ = main_file)
+ : first(first_), last(last_), real_filename(fname),
+ real_relative_filename(fname), filename(fname),
+ line(1), emitted_lines(0), if_block_depth(if_block_depth), ctx(ctx_),
+ type(type_)
{}
// the actual input stream
- IteratorT first; // actual input stream position
+ IteratorT first; // actual input stream position
IteratorT last; // end of input stream
BOOST_WAVE_STRINGTYPE real_filename; // real name of the current file
BOOST_WAVE_STRINGTYPE real_relative_filename; // real relative name of the current file
@@ -130,14 +132,14 @@ struct base_iteration_context
};
///////////////////////////////////////////////////////////////////////////////
-//
+//
template <
- typename ContextT, typename IteratorT,
- typename InputPolicyT = typename ContextT::input_policy_type
+ typename ContextT, typename IteratorT,
+ typename InputPolicyT = typename ContextT::input_policy_type
>
struct iteration_context
: public base_iteration_context<ContextT, IteratorT>,
- public InputPolicyT::template
+ public InputPolicyT::template
inner<iteration_context<ContextT, IteratorT, InputPolicyT> >
{
typedef IteratorT iterator_type;
@@ -146,10 +148,10 @@ struct iteration_context
typedef base_iteration_context<ContextT, IteratorT> base_type;
typedef iteration_context<ContextT, IteratorT, InputPolicyT> self_type;
- iteration_context(ContextT& ctx, BOOST_WAVE_STRINGTYPE const &fname,
- position_type const &act_pos,
+ iteration_context(ContextT& ctx, BOOST_WAVE_STRINGTYPE const &fname,
+ position_type const &act_pos,
boost::wave::language_support language_,
- typename base_type::file_type type = base_type::main_file)
+ typename base_type::file_type type = base_type::main_file)
: base_iteration_context<ContextT, IteratorT>(ctx, fname, type)
{
InputPolicyT::template inner<self_type>::init_iterators(
diff --git a/boost/wave/cpp_throw.hpp b/boost/wave/cpp_throw.hpp
index 010e5719db..dbbd85865f 100644
--- a/boost/wave/cpp_throw.hpp
+++ b/boost/wave/cpp_throw.hpp
@@ -3,7 +3,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/cpplexer/convert_trigraphs.hpp b/boost/wave/cpplexer/convert_trigraphs.hpp
index 8f80cfba49..0b478c396c 100644
--- a/boost/wave/cpplexer/convert_trigraphs.hpp
+++ b/boost/wave/cpplexer/convert_trigraphs.hpp
@@ -5,7 +5,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/cpplexer/cpp_lex_interface.hpp b/boost/wave/cpplexer/cpp_lex_interface.hpp
index c69f8aaa53..d93a2e5b10 100644
--- a/boost/wave/cpplexer/cpp_lex_interface.hpp
+++ b/boost/wave/cpplexer/cpp_lex_interface.hpp
@@ -5,7 +5,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/cpplexer/cpp_lex_interface_generator.hpp b/boost/wave/cpplexer/cpp_lex_interface_generator.hpp
index 8e1bd7726c..73688ee5c4 100644
--- a/boost/wave/cpplexer/cpp_lex_interface_generator.hpp
+++ b/boost/wave/cpplexer/cpp_lex_interface_generator.hpp
@@ -5,7 +5,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/cpplexer/cpp_lex_iterator.hpp b/boost/wave/cpplexer/cpp_lex_iterator.hpp
index fe93888af5..580873cc0b 100644
--- a/boost/wave/cpplexer/cpp_lex_iterator.hpp
+++ b/boost/wave/cpplexer/cpp_lex_iterator.hpp
@@ -5,7 +5,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
@@ -133,7 +133,7 @@ typename lex_iterator_functor_shim<TokenT>::result_type const
// a third parameter containing the name of the parsed input file
// and a 4th parameter of the type boost::wave::language_support
// which specifies, which language subset should be supported (C++,
-// C99, C++0x etc.).
+// C99, C++11 etc.).
//
///////////////////////////////////////////////////////////////////////////////
diff --git a/boost/wave/cpplexer/cpp_lex_token.hpp b/boost/wave/cpplexer/cpp_lex_token.hpp
index 81e589539f..c69ea504d3 100644
--- a/boost/wave/cpplexer/cpp_lex_token.hpp
+++ b/boost/wave/cpplexer/cpp_lex_token.hpp
@@ -5,7 +5,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/cpplexer/cpplexer_exceptions.hpp b/boost/wave/cpplexer/cpplexer_exceptions.hpp
index 5ef0ca26e6..933c400b5f 100644
--- a/boost/wave/cpplexer/cpplexer_exceptions.hpp
+++ b/boost/wave/cpplexer/cpplexer_exceptions.hpp
@@ -3,7 +3,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/cpplexer/detect_include_guards.hpp b/boost/wave/cpplexer/detect_include_guards.hpp
index 09463ff8ea..286cd86acf 100644
--- a/boost/wave/cpplexer/detect_include_guards.hpp
+++ b/boost/wave/cpplexer/detect_include_guards.hpp
@@ -22,7 +22,7 @@
will work as well). The code allows for any whitespace, newline and single
'#' tokens before the #if/#ifndef and after the final #endif.
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/cpplexer/re2clex/aq.hpp b/boost/wave/cpplexer/re2clex/aq.hpp
index 7b24359a48..daf90657fe 100644
--- a/boost/wave/cpplexer/re2clex/aq.hpp
+++ b/boost/wave/cpplexer/re2clex/aq.hpp
@@ -4,7 +4,7 @@
http://www.boost.org/
Copyright (c) 2001 Daniel C. Nuffer.
- Copyright (c) 2001-2011 Hartmut Kaiser.
+ Copyright (c) 2001-2012 Hartmut Kaiser.
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/cpplexer/re2clex/cpp_re.hpp b/boost/wave/cpplexer/re2clex/cpp_re.hpp
index 5febbb4a20..527342bac4 100644
--- a/boost/wave/cpplexer/re2clex/cpp_re.hpp
+++ b/boost/wave/cpplexer/re2clex/cpp_re.hpp
@@ -5,7 +5,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp b/boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp
index 748738544b..d22a0154ae 100644
--- a/boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp
+++ b/boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp
@@ -5,7 +5,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
@@ -219,7 +219,7 @@ lexer<IteratorT, PositionT, TokenT>::get(TokenT& result)
}
#endif
- case T_LONGINTLIT: // supported in C++0x, C99 and long_long mode
+ case T_LONGINTLIT: // supported in C++11, C99 and long_long mode
value = string_type((char const *)scanner.tok,
scanner.cur-scanner.tok);
if (!boost::wave::need_long_long(language)) {
diff --git a/boost/wave/cpplexer/re2clex/scanner.hpp b/boost/wave/cpplexer/re2clex/scanner.hpp
index e052558e6d..1c696cf69b 100644
--- a/boost/wave/cpplexer/re2clex/scanner.hpp
+++ b/boost/wave/cpplexer/re2clex/scanner.hpp
@@ -4,7 +4,7 @@
http://www.boost.org/
Copyright (c) 2001 Daniel C. Nuffer.
- Copyright (c) 2001-2011 Hartmut Kaiser.
+ Copyright (c) 2001-2012 Hartmut Kaiser.
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
@@ -57,7 +57,7 @@ typedef struct Scanner {
bool detect_pp_numbers; /* lexer should prefer to detect pp-numbers */
bool enable_import_keyword; /* recognize import as a keyword */
bool single_line_only; /* don't report missing eol's in C++ comments */
- bool act_in_cpp0x_mode; /* lexer works in C++0x mode */
+ bool act_in_cpp0x_mode; /* lexer works in C++11 mode */
} Scanner;
///////////////////////////////////////////////////////////////////////////////
diff --git a/boost/wave/cpplexer/token_cache.hpp b/boost/wave/cpplexer/token_cache.hpp
index 4dedb48f24..39f75a2d92 100644
--- a/boost/wave/cpplexer/token_cache.hpp
+++ b/boost/wave/cpplexer/token_cache.hpp
@@ -3,7 +3,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/cpplexer/validate_universal_char.hpp b/boost/wave/cpplexer/validate_universal_char.hpp
index 09b0a06c92..9429bd12f3 100644
--- a/boost/wave/cpplexer/validate_universal_char.hpp
+++ b/boost/wave/cpplexer/validate_universal_char.hpp
@@ -5,7 +5,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/grammars/cpp_chlit_grammar.hpp b/boost/wave/grammars/cpp_chlit_grammar.hpp
index c494f9f973..ae563d056c 100644
--- a/boost/wave/grammars/cpp_chlit_grammar.hpp
+++ b/boost/wave/grammars/cpp_chlit_grammar.hpp
@@ -3,7 +3,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/grammars/cpp_defined_grammar.hpp b/boost/wave/grammars/cpp_defined_grammar.hpp
index d6d3422fe8..2e555cf39a 100644
--- a/boost/wave/grammars/cpp_defined_grammar.hpp
+++ b/boost/wave/grammars/cpp_defined_grammar.hpp
@@ -3,7 +3,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/grammars/cpp_defined_grammar_gen.hpp b/boost/wave/grammars/cpp_defined_grammar_gen.hpp
index 3da519e917..fd41a2bd3f 100644
--- a/boost/wave/grammars/cpp_defined_grammar_gen.hpp
+++ b/boost/wave/grammars/cpp_defined_grammar_gen.hpp
@@ -3,7 +3,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/grammars/cpp_expression_grammar.hpp b/boost/wave/grammars/cpp_expression_grammar.hpp
index a52d36a5c8..54c7477d34 100644
--- a/boost/wave/grammars/cpp_expression_grammar.hpp
+++ b/boost/wave/grammars/cpp_expression_grammar.hpp
@@ -3,7 +3,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/grammars/cpp_expression_grammar_gen.hpp b/boost/wave/grammars/cpp_expression_grammar_gen.hpp
index 593c97786b..a575c9f701 100644
--- a/boost/wave/grammars/cpp_expression_grammar_gen.hpp
+++ b/boost/wave/grammars/cpp_expression_grammar_gen.hpp
@@ -3,7 +3,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/grammars/cpp_expression_value.hpp b/boost/wave/grammars/cpp_expression_value.hpp
index 0cd6e13bc1..9703b3aebe 100644
--- a/boost/wave/grammars/cpp_expression_value.hpp
+++ b/boost/wave/grammars/cpp_expression_value.hpp
@@ -3,7 +3,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/grammars/cpp_grammar.hpp b/boost/wave/grammars/cpp_grammar.hpp
index d309e2e39b..9ef3559cd0 100644
--- a/boost/wave/grammars/cpp_grammar.hpp
+++ b/boost/wave/grammars/cpp_grammar.hpp
@@ -3,7 +3,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/grammars/cpp_grammar_gen.hpp b/boost/wave/grammars/cpp_grammar_gen.hpp
index d582a07144..d2d2212814 100644
--- a/boost/wave/grammars/cpp_grammar_gen.hpp
+++ b/boost/wave/grammars/cpp_grammar_gen.hpp
@@ -3,7 +3,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/grammars/cpp_intlit_grammar.hpp b/boost/wave/grammars/cpp_intlit_grammar.hpp
index 96ac8f62c1..b09ed71e56 100644
--- a/boost/wave/grammars/cpp_intlit_grammar.hpp
+++ b/boost/wave/grammars/cpp_intlit_grammar.hpp
@@ -3,7 +3,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/grammars/cpp_literal_grammar_gen.hpp b/boost/wave/grammars/cpp_literal_grammar_gen.hpp
index f6e24159bd..b06b98dc97 100644
--- a/boost/wave/grammars/cpp_literal_grammar_gen.hpp
+++ b/boost/wave/grammars/cpp_literal_grammar_gen.hpp
@@ -3,7 +3,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/grammars/cpp_predef_macros_gen.hpp b/boost/wave/grammars/cpp_predef_macros_gen.hpp
index 4e66a53cbd..dcbefda469 100644
--- a/boost/wave/grammars/cpp_predef_macros_gen.hpp
+++ b/boost/wave/grammars/cpp_predef_macros_gen.hpp
@@ -3,7 +3,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/grammars/cpp_predef_macros_grammar.hpp b/boost/wave/grammars/cpp_predef_macros_grammar.hpp
index 9d35a2f461..bb7fd8a734 100644
--- a/boost/wave/grammars/cpp_predef_macros_grammar.hpp
+++ b/boost/wave/grammars/cpp_predef_macros_grammar.hpp
@@ -3,7 +3,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/grammars/cpp_value_error.hpp b/boost/wave/grammars/cpp_value_error.hpp
index 9cba99a264..b1043ea2e6 100644
--- a/boost/wave/grammars/cpp_value_error.hpp
+++ b/boost/wave/grammars/cpp_value_error.hpp
@@ -3,7 +3,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/language_support.hpp b/boost/wave/language_support.hpp
index f4e599894a..df8839c463 100644
--- a/boost/wave/language_support.hpp
+++ b/boost/wave/language_support.hpp
@@ -1,10 +1,10 @@
/*=============================================================================
Boost.Wave: A Standard compliant C++ preprocessor library
Definition of the various language support constants
-
+
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
@@ -33,9 +33,10 @@ enum language_support {
// support flags for C99
support_option_variadics = 0x04,
support_c99 = support_option_variadics | support_option_long_long | 0x08,
-#endif
+#endif
#if BOOST_WAVE_SUPPORT_CPP0X != 0
support_cpp0x = support_option_variadics | support_option_long_long | 0x10,
+ support_cpp11 = support_cpp0x,
#endif
support_option_mask = 0xFFB0,
@@ -52,29 +53,29 @@ enum language_support {
};
///////////////////////////////////////////////////////////////////////////////
-//
+//
// need_cpp
//
// Extract, if the language to support is C++98
//
///////////////////////////////////////////////////////////////////////////////
inline bool
-need_cpp(language_support language)
+need_cpp(language_support language)
{
return (language & ~support_option_mask) == support_cpp;
}
///////////////////////////////////////////////////////////////////////////////
-//
+//
// need_cpp0x
//
-// Extract, if the language to support is C++0x
+// Extract, if the language to support is C++11
//
///////////////////////////////////////////////////////////////////////////////
#if BOOST_WAVE_SUPPORT_CPP0X != 0
inline bool
-need_cpp0x(language_support language)
+need_cpp0x(language_support language)
{
return (language & ~support_option_mask) == support_cpp0x;
}
@@ -82,7 +83,7 @@ need_cpp0x(language_support language)
#else
inline bool
-need_cpp0x(language_support language)
+need_cpp0x(language_support language)
{
return false;
}
@@ -91,14 +92,14 @@ need_cpp0x(language_support language)
#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
///////////////////////////////////////////////////////////////////////////////
-//
+//
// need_c99
//
// Extract, if the language to support is C99
//
///////////////////////////////////////////////////////////////////////////////
inline bool
-need_c99(language_support language)
+need_c99(language_support language)
{
return (language & ~support_option_mask) == support_c99;
}
@@ -106,8 +107,8 @@ need_c99(language_support language)
#else // BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
///////////////////////////////////////////////////////////////////////////////
-inline bool
-need_variadics(language_support language)
+inline bool
+need_variadics(language_support language)
{
return false;
}
@@ -121,7 +122,7 @@ enable_variadics(language_support language, bool enable = true)
//////////////////////////////////////////////////////////////////////////////
inline bool
-need_c99(language_support language)
+need_c99(language_support language)
{
return false;
}
@@ -129,7 +130,7 @@ need_c99(language_support language)
#endif // BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
///////////////////////////////////////////////////////////////////////////////
-//
+//
// get_support_options
//
// Set preserve comments support in the language to support
@@ -142,7 +143,7 @@ get_support_options(language_support language)
}
///////////////////////////////////////////////////////////////////////////////
-//
+//
// set_support_options
//
// Set language option (for fine tuning of lexer behavior)
@@ -178,7 +179,7 @@ set_support_options(language_support language, language_support option)
BOOST_WAVE_NEED_OPTION(option) \
BOOST_WAVE_ENABLE_OPTION(option) \
/**/
-
+
///////////////////////////////////////////////////////////////////////////////
BOOST_WAVE_OPTION(long_long) // support_option_long_long
BOOST_WAVE_OPTION(no_character_validation) // support_option_no_character_validation
@@ -192,7 +193,7 @@ BOOST_WAVE_OPTION(include_guard_detection) // support_option_include_guard_dete
#endif
#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
BOOST_WAVE_OPTION(variadics) // support_option_variadics
-#endif
+#endif
#if BOOST_WAVE_EMIT_PRAGMA_DIRECTIVES != 0
BOOST_WAVE_OPTION(emit_pragma_directives) // support_option_emit_pragma_directives
#endif
@@ -205,7 +206,7 @@ BOOST_WAVE_OPTION(emit_contnewlines) // support_option_emit_contnewlines
///////////////////////////////////////////////////////////////////////////////
} // namespace wave
-} // namespace boost
+} // namespace boost
// the suffix header occurs after all of the code
#ifdef BOOST_HAS_ABI_HEADERS
diff --git a/boost/wave/preprocessing_hooks.hpp b/boost/wave/preprocessing_hooks.hpp
index b57311323b..212fad6995 100644
--- a/boost/wave/preprocessing_hooks.hpp
+++ b/boost/wave/preprocessing_hooks.hpp
@@ -3,7 +3,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/token_ids.hpp b/boost/wave/token_ids.hpp
index a2edba7e08..eb4368c280 100644
--- a/boost/wave/token_ids.hpp
+++ b/boost/wave/token_ids.hpp
@@ -5,7 +5,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
@@ -287,7 +287,7 @@ enum token_id {
// import is needed to be a keyword for the C++ module Standards proposal
T_IMPORT = TOKEN_FROM_ID(421, KeywordTokenType),
-// C++0x keywords
+// C++11 keywords
T_ALIGNAS = TOKEN_FROM_ID(422, KeywordTokenType),
T_ALIGNOF = TOKEN_FROM_ID(423, KeywordTokenType),
T_CHAR16_T = TOKEN_FROM_ID(424, KeywordTokenType),
diff --git a/boost/wave/util/cpp_ifblock.hpp b/boost/wave/util/cpp_ifblock.hpp
index f89f9eaf66..34960de9a2 100644
--- a/boost/wave/util/cpp_ifblock.hpp
+++ b/boost/wave/util/cpp_ifblock.hpp
@@ -3,7 +3,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/util/cpp_include_paths.hpp b/boost/wave/util/cpp_include_paths.hpp
index 29c2bec3c9..d0f2fcbaa8 100644
--- a/boost/wave/util/cpp_include_paths.hpp
+++ b/boost/wave/util/cpp_include_paths.hpp
@@ -3,7 +3,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/util/cpp_iterator.hpp b/boost/wave/util/cpp_iterator.hpp
index 8441b41faa..8b378d6707 100644
--- a/boost/wave/util/cpp_iterator.hpp
+++ b/boost/wave/util/cpp_iterator.hpp
@@ -5,7 +5,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
@@ -61,32 +61,32 @@ namespace util {
///////////////////////////////////////////////////////////////////////////////
// retrieve the macro name from the parse tree
template <
- typename ContextT, typename ParseNodeT, typename TokenT,
+ typename ContextT, typename ParseNodeT, typename TokenT,
typename PositionT
>
-inline bool
-retrieve_macroname(ContextT& ctx, ParseNodeT const &node,
+inline bool
+retrieve_macroname(ContextT& ctx, ParseNodeT const &node,
boost::spirit::classic::parser_id id, TokenT &macroname, PositionT& act_pos,
bool update_position)
{
ParseNodeT const *name_node = 0;
using boost::spirit::classic::find_node;
- if (!find_node(node, id, &name_node))
+ if (!find_node(node, id, &name_node))
{
// ill formed define statement (unexpected, should not happen)
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, bad_define_statement,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, bad_define_statement,
"bad parse tree (unexpected)", act_pos);
return false;
}
typename ParseNodeT::children_t const &children = name_node->children;
- if (0 == children.size() ||
- children.front().value.begin() == children.front().value.end())
+ if (0 == children.size() ||
+ children.front().value.begin() == children.front().value.end())
{
// ill formed define statement (unexpected, should not happen)
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, bad_define_statement,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, bad_define_statement,
"bad parse tree (unexpected)", act_pos);
return false;
}
@@ -103,9 +103,9 @@ typename ParseNodeT::children_t const &children = name_node->children;
///////////////////////////////////////////////////////////////////////////////
// retrieve the macro parameters or the macro definition from the parse tree
template <typename ParseNodeT, typename ContainerT, typename PositionT>
-inline bool
+inline bool
retrieve_macrodefinition(
- ParseNodeT const &node, boost::spirit::classic::parser_id id,
+ ParseNodeT const &node, boost::spirit::classic::parser_id id,
ContainerT &macrodefinition, PositionT& act_pos, bool update_position)
{
using namespace boost::wave;
@@ -163,7 +163,7 @@ bool add_macro_definition(ContextT &ctx, std::string macrostring,
typedef typename ContextT::token_type token_type;
typedef typename ContextT::lexer_type lexer_type;
typedef typename token_type::position_type position_type;
- typedef boost::wave::grammars::predefined_macros_grammar_gen<lexer_type>
+ typedef boost::wave::grammars::predefined_macros_grammar_gen<lexer_type>
predef_macros_type;
using namespace boost::wave;
@@ -178,12 +178,12 @@ std::string::iterator end = macrostring.end();
// parse the macro definition
position_type act_pos("<command line>");
-boost::spirit::classic::tree_parse_info<lexer_type> hit =
+boost::spirit::classic::tree_parse_info<lexer_type> hit =
predef_macros_type::parse_predefined_macro(
lexer_type(begin, end, position_type(), language), lexer_type());
if (!hit.match || (!hit.full && T_EOF != token_id(*hit.stop))) {
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, bad_macro_definition,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, bad_macro_definition,
macrostring.c_str(), act_pos);
return false;
}
@@ -194,24 +194,24 @@ std::vector<token_type> macroparameters;
typename ContextT::token_sequence_type macrodefinition;
bool has_parameters = false;
- if (!boost::wave::util::retrieve_macroname(ctx, *hit.trees.begin(),
+ if (!boost::wave::util::retrieve_macroname(ctx, *hit.trees.begin(),
BOOST_WAVE_PLAIN_DEFINE_ID, macroname, act_pos, true))
return false;
- has_parameters = boost::wave::util::retrieve_macrodefinition(*hit.trees.begin(),
+ has_parameters = boost::wave::util::retrieve_macrodefinition(*hit.trees.begin(),
BOOST_WAVE_MACRO_PARAMETERS_ID, macroparameters, act_pos, true);
- boost::wave::util::retrieve_macrodefinition(*hit.trees.begin(),
+ boost::wave::util::retrieve_macrodefinition(*hit.trees.begin(),
BOOST_WAVE_MACRO_DEFINITION_ID, macrodefinition, act_pos, true);
-// If no macrodefinition is given, and the macro string does not end with a
+// If no macrodefinition is given, and the macro string does not end with a
// '=', then the macro should be defined with the value '1'
- if (0 == macrodefinition.size() &&
+ if (0 == macrodefinition.size() &&
'=' != macrostring[macrostring.size()-1])
{
macrodefinition.push_back(token_type(T_INTLIT, "1", act_pos));
}
// add the new macro to the macromap
- return ctx.add_macro_definition(macroname, has_parameters, macroparameters,
+ return ctx.add_macro_definition(macroname, has_parameters, macroparameters,
macrodefinition, is_predefined);
}
#endif // BOOST_WAVE_ENABLE_COMMANDLINE_MACROS != 0
@@ -226,11 +226,11 @@ template <typename ContextT> class pp_iterator;
namespace impl {
///////////////////////////////////////////////////////////////////////////////
-//
+//
// pp_iterator_functor
//
///////////////////////////////////////////////////////////////////////////////
-template <typename ContextT>
+template <typename ContextT>
class pp_iterator_functor {
public:
@@ -247,7 +247,7 @@ private:
typedef typename ContextT::lexer_type lexer_type;
typedef typename result_type::string_type string_type;
typedef typename result_type::position_type position_type;
- typedef boost::wave::grammars::cpp_grammar_gen<lexer_type, token_sequence_type>
+ typedef boost::wave::grammars::cpp_grammar_gen<lexer_type, token_sequence_type>
cpp_grammar_type;
// iteration context related types (an iteration context represents a current
@@ -258,9 +258,9 @@ private:
// parse tree related types
typedef typename cpp_grammar_type::node_factory_type node_factory_type;
- typedef boost::spirit::classic::tree_parse_info<lexer_type, node_factory_type>
+ typedef boost::spirit::classic::tree_parse_info<lexer_type, node_factory_type>
tree_parse_info_type;
- typedef boost::spirit::classic::tree_match<lexer_type, node_factory_type>
+ typedef boost::spirit::classic::tree_match<lexer_type, node_factory_type>
parse_tree_match_type;
typedef typename parse_tree_match_type::node_t parse_node_type; // tree_node<node_val_data<> >
typedef typename parse_tree_match_type::parse_node_t parse_node_value_type; // node_val_data<>
@@ -268,16 +268,16 @@ private:
public:
template <typename IteratorT>
- pp_iterator_functor(ContextT &ctx_, IteratorT const &first_,
+ pp_iterator_functor(ContextT &ctx_, IteratorT const &first_,
IteratorT const &last_, typename ContextT::position_type const &pos_)
- : ctx(ctx_),
+ : ctx(ctx_),
iter_ctx(new base_iteration_context_type(ctx,
- lexer_type(first_, last_, pos_,
- boost::wave::enable_prefer_pp_numbers(ctx.get_language())),
- lexer_type(),
+ lexer_type(first_, last_, pos_,
+ boost::wave::enable_prefer_pp_numbers(ctx.get_language())),
+ lexer_type(),
pos_.get_file().c_str()
- )),
- seen_newline(true), skipped_newline(false),
+ )),
+ seen_newline(true), skipped_newline(false),
must_emit_line_directive(false), act_pos(ctx_.get_main_pos()),
whitespace(boost::wave::need_insert_whitespace(ctx.get_language()))
{
@@ -296,7 +296,7 @@ public:
protected:
friend class pp_iterator<ContextT>;
- bool on_include_helper(char const *t, char const *s, bool is_system,
+ bool on_include_helper(char const *t, char const *s, bool is_system,
bool include_next);
protected:
@@ -369,10 +369,10 @@ private:
token_sequence_type unput_queue; // tokens to be preprocessed again
token_sequence_type pending_queue; // tokens already preprocessed
- // detect whether to insert additional whitespace in between two adjacent
- // tokens, which otherwise would form a different token type, if
+ // detect whether to insert additional whitespace in between two adjacent
+ // tokens, which otherwise would form a different token type, if
// re-tokenized
- boost::wave::util::insert_whitespace_detection whitespace;
+ boost::wave::util::insert_whitespace_detection whitespace;
};
///////////////////////////////////////////////////////////////////////////////
@@ -384,14 +384,14 @@ typename pp_iterator_functor<ContextT>::result_type const
///////////////////////////////////////////////////////////////////////////////
//
// returned_from_include()
-//
+//
// Tests if it is necessary to pop the include file context (eof inside
// a file was reached). If yes, it pops this context. Preprocessing will
// continue with the next outer file scope.
//
///////////////////////////////////////////////////////////////////////////////
-template <typename ContextT>
-inline bool
+template <typename ContextT>
+inline bool
pp_iterator_functor<ContextT>::returned_from_include()
{
if (iter_ctx->first == iter_ctx->last && ctx.get_iteration_depth() > 0) {
@@ -402,7 +402,7 @@ pp_iterator_functor<ContextT>::returned_from_include()
ctx.get_hooks().returning_from_include_file(ctx.derived());
#endif
- // restore the previous iteration context after finishing the preprocessing
+ // restore the previous iteration context after finishing the preprocessing
// of the included file
BOOST_WAVE_STRINGTYPE oldfile = iter_ctx->real_filename;
position_type old_pos (act_pos);
@@ -414,7 +414,7 @@ pp_iterator_functor<ContextT>::returned_from_include()
if (iter_ctx->first.has_include_guards(guard_name))
ctx.add_pragma_once_header(ctx.get_current_filename(), guard_name);
}
-#endif
+#endif
iter_ctx = ctx.pop_iteration_context();
must_emit_line_directive = true;
@@ -426,13 +426,13 @@ pp_iterator_functor<ContextT>::returned_from_include()
act_pos.set_line(iter_ctx->line);
act_pos.set_column(0);
- // restore the actual current file and directory
+ // restore the actual current file and directory
#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0
namespace fs = boost::filesystem;
fs::path rfp(wave::util::create_path(iter_ctx->real_filename.c_str()));
std::string real_filename(rfp.string());
ctx.set_current_filename(real_filename.c_str());
-#endif
+#endif
ctx.set_current_directory(iter_ctx->real_filename.c_str());
ctx.set_current_relative_filename(iter_ctx->real_relative_filename.c_str());
@@ -441,7 +441,7 @@ pp_iterator_functor<ContextT>::returned_from_include()
if (iter_ctx->if_block_depth != ctx.get_if_block_depth()) {
using boost::wave::util::impl::escape_lit;
BOOST_WAVE_STRINGTYPE msg(escape_lit(oldfile));
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, unbalanced_if_endif,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, unbalanced_if_endif,
msg.c_str(), old_pos);
}
return true;
@@ -458,30 +458,31 @@ pp_iterator_functor<ContextT>::returned_from_include()
///////////////////////////////////////////////////////////////////////////////
namespace impl {
- // It may be necessary to emit a #line directive either
- // - when comments need to be preserved: if the current token is not a
+ // It may be necessary to emit a #line directive either
+ // - when comments need to be preserved: if the current token is not a
// whitespace, except comments
- // - when comments are to be skipped: if the current token is not a
+ // - when comments are to be skipped: if the current token is not a
// whitespace token.
- template <typename ContextT>
+ template <typename ContextT>
bool consider_emitting_line_directive(ContextT const& ctx, token_id id)
{
- if (need_preserve_comments(ctx.get_language())) {
+ if (need_preserve_comments(ctx.get_language()))
+ {
if (!IS_CATEGORY(id, EOLTokenType) && !IS_CATEGORY(id, EOFTokenType))
{
return true;
}
}
- if (!IS_CATEGORY(id, WhiteSpaceTokenType) &&
+ if (!IS_CATEGORY(id, WhiteSpaceTokenType) &&
!IS_CATEGORY(id, EOLTokenType) && !IS_CATEGORY(id, EOFTokenType))
{
- return true;
+ return true;
}
return false;
}
}
-template <typename ContextT>
+template <typename ContextT>
inline typename pp_iterator_functor<ContextT>::result_type const &
pp_iterator_functor<ContextT>::operator()()
{
@@ -492,13 +493,17 @@ pp_iterator_functor<ContextT>::operator()()
// loop over skip able whitespace until something significant is found
bool was_seen_newline = seen_newline;
+ bool was_skipped_newline = skipped_newline;
token_id id = T_UNKNOWN;
try { // catch lexer exceptions
do {
+ if (skipped_newline) {
+ was_skipped_newline = true;
+ skipped_newline = false;
+ }
+
// get_next_token assigns result to act_token member
- if (skipped_newline)
- seen_newline = true;
get_next_token();
// if comments shouldn't be preserved replace them with newlines
@@ -510,6 +515,9 @@ pp_iterator_functor<ContextT>::operator()()
act_token.set_value("\n");
}
+ if (IS_CATEGORY(id, EOLTokenType))
+ seen_newline = true;
+
} while (ctx.get_hooks().may_skip_whitespace(ctx.derived(), act_token, skipped_newline));
}
catch (boost::wave::cpplexer::lexing_exception const& e) {
@@ -518,12 +526,16 @@ pp_iterator_functor<ContextT>::operator()()
return act_token;
}
+// restore the accumulated skipped_newline state for next invocation
+ if (was_skipped_newline)
+ skipped_newline = true;
+
// if there were skipped any newlines, we must emit a #line directive
- if ((must_emit_line_directive || (was_seen_newline && skipped_newline)) &&
- impl::consider_emitting_line_directive(ctx, id))
+ if ((must_emit_line_directive || (was_seen_newline && skipped_newline)) &&
+ impl::consider_emitting_line_directive(ctx, id))
{
// must emit a #line directive
- if (need_emit_line_directives(ctx.get_language()) && emit_line_directive())
+ if (need_emit_line_directives(ctx.get_language()) && emit_line_directive())
{
skipped_newline = false;
ctx.get_hooks().may_skip_whitespace(ctx.derived(), act_token, skipped_newline); // feed ws eater FSM
@@ -552,13 +564,13 @@ pp_iterator_functor<ContextT>::operator()()
#if BOOST_WAVE_SUPPORT_CPP0X != 0
case T_RAWSTRINGLIT:
- iter_ctx->emitted_lines +=
+ iter_ctx->emitted_lines +=
context_policies::util::rawstring_count_newlines(act_token);
break;
#endif
case T_CCOMMENT: // will come here only if whitespace is preserved
- iter_ctx->emitted_lines +=
+ iter_ctx->emitted_lines +=
context_policies::util::ccomment_count_newlines(act_token);
break;
@@ -569,12 +581,12 @@ pp_iterator_functor<ContextT>::operator()()
std::string pp_number(
util::to_string<std::string>(act_token.get_value()));
- lexer_type it = lexer_type(pp_number.begin(),
- pp_number.end(), act_token.get_position(),
+ lexer_type it = lexer_type(pp_number.begin(),
+ pp_number.end(), act_token.get_position(),
ctx.get_language());
lexer_type end = lexer_type();
- for (/**/; it != end && T_EOF != token_id(*it); ++it)
+ for (/**/; it != end && T_EOF != token_id(*it); ++it)
rescanned.push_back(*it);
pending_queue.splice(pending_queue.begin(), rescanned);
@@ -599,8 +611,8 @@ pp_iterator_functor<ContextT>::operator()()
// tokens, which would form different (and wrong) tokens
whitespace.shift_tokens(T_SPACE);
pending_queue.push_front(act_token); // push this token back
- return act_token = result_type(T_SPACE,
- typename result_type::string_type(" "),
+ return act_token = result_type(T_SPACE,
+ typename result_type::string_type(" "),
act_token.get_position());
}
whitespace.shift_tokens(id);
@@ -608,7 +620,7 @@ pp_iterator_functor<ContextT>::operator()()
}
///////////////////////////////////////////////////////////////////////////////
-template <typename ContextT>
+template <typename ContextT>
inline typename pp_iterator_functor<ContextT>::result_type const &
pp_iterator_functor<ContextT>::get_next_token()
{
@@ -616,21 +628,21 @@ pp_iterator_functor<ContextT>::get_next_token()
// if there is something in the unput_queue, then return the next token from
// there (all tokens in the queue are preprocessed already)
- if (!pending_queue.empty() || !unput_queue.empty())
+ if (!pending_queue.empty() || !unput_queue.empty())
return pp_token(); // return next token
// test for EOF, if there is a pending input context, pop it back and continue
// parsing with it
bool returned_from_include_file = returned_from_include();
-// try to generate the next token
+// try to generate the next token
if (iter_ctx->first != iter_ctx->last) {
do {
- // If there are pending tokens in the queue, we'll have to return
+ // If there are pending tokens in the queue, we'll have to return
// these. This may happen from a #pragma directive, which got replaced
// by some token sequence.
if (!pending_queue.empty()) {
- util::on_exit::pop_front<token_sequence_type>
+ util::on_exit::pop_front<token_sequence_type>
pop_front_token(pending_queue);
return act_token = pending_queue.front();
@@ -652,16 +664,16 @@ bool returned_from_include_file = returned_from_include();
++iter_ctx->first;
// now make sure this line has a newline
- if ((!seen_newline || act_pos.get_column() > 1) &&
- !need_single_line(ctx.get_language()))
+ if ((!seen_newline || act_pos.get_column() > 1) &&
+ !need_single_line(ctx.get_language()))
{
// warn, if this file does not end with a newline
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
last_line_not_terminated, "", act_pos);
}
continue; // if this is the main file, the while loop breaks
}
- else if (T_NEWLINE == id || T_CPPCOMMENT == id) {
+ else if (T_NEWLINE == id || T_CPPCOMMENT == id) {
// a newline is to be returned ASAP, a C++ comment too
// (the C++ comment token includes the trailing newline)
seen_newline = true;
@@ -673,7 +685,7 @@ bool returned_from_include_file = returned_from_include();
util::impl::call_skipped_token_hook(ctx, act_token);
continue;
}
- return act_token;
+ return act_token;
}
seen_newline = false;
@@ -684,17 +696,17 @@ bool returned_from_include_file = returned_from_include();
// must_emit_line_directive = true;
// loop to the next token to analyze
- // simply fall through, since the iterator was already adjusted
+ // simply fall through, since the iterator was already adjusted
// correctly
}
else if (ctx.get_if_block_status()) {
- // preprocess this token, eat up more, if appropriate, return
+ // preprocess this token, eat up more, if appropriate, return
// the next preprocessed token
return pp_token();
}
else {
- // compilation condition is false: if the current token is a
- // newline, account for it, otherwise discard the actual token and
+ // compilation condition is false: if the current token is a
+ // newline, account for it, otherwise discard the actual token and
// try the next one
if (T_NEWLINE == token_id(act_token)) {
seen_newline = true;
@@ -706,14 +718,14 @@ bool returned_from_include_file = returned_from_include();
++iter_ctx->first;
}
- } while ((iter_ctx->first != iter_ctx->last) ||
+ } while ((iter_ctx->first != iter_ctx->last) ||
(returned_from_include_file = returned_from_include()));
// overall eof reached
- if (ctx.get_if_block_depth() > 0 && !need_single_line(ctx.get_language()))
+ if (ctx.get_if_block_depth() > 0 && !need_single_line(ctx.get_language()))
{
// missing endif directive(s)
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
missing_matching_endif, "", act_pos);
}
}
@@ -730,7 +742,7 @@ bool returned_from_include_file = returned_from_include();
// emit_line_directive(): emits a line directive from the act_token data
//
///////////////////////////////////////////////////////////////////////////////
-template <typename ContextT>
+template <typename ContextT>
inline bool
pp_iterator_functor<ContextT>::emit_line_directive()
{
@@ -738,7 +750,7 @@ pp_iterator_functor<ContextT>::emit_line_directive()
typename ContextT::position_type pos = act_token.get_position();
-// if (must_emit_line_directive &&
+// if (must_emit_line_directive &&
// iter_ctx->emitted_lines+1 == act_pos.get_line() &&
// iter_ctx->filename == act_pos.get_file())
// {
@@ -746,14 +758,14 @@ typename ContextT::position_type pos = act_token.get_position();
// return false;
// }
- if (must_emit_line_directive ||
- iter_ctx->emitted_lines+1 != act_pos.get_line())
+ if (must_emit_line_directive ||
+ iter_ctx->emitted_lines+1 != act_pos.get_line())
{
// unput the current token
pending_queue.push_front(act_token);
pos.set_line(act_pos.get_line());
- if (iter_ctx->emitted_lines+2 == act_pos.get_line()) {
+ if (iter_ctx->emitted_lines+2 == act_pos.get_line() && act_pos.get_line() != 1) {
// prefer to output a single newline instead of the #line directive
// whitespace.shift_tokens(T_NEWLINE);
act_token = result_type(T_NEWLINE, "\n", pos);
@@ -776,7 +788,7 @@ typename ContextT::position_type pos = act_token.get_position();
pos.set_column(column); // account for '#line'
pending.push_back(result_type(T_SPACE, " ", pos));
- // 21 is the max required size for a 64 bit integer represented as a
+ // 21 is the max required size for a 64 bit integer represented as a
// string
char buffer[22];
@@ -822,7 +834,7 @@ typename ContextT::position_type pos = act_token.get_position();
// pptoken(): return the next preprocessed token
//
///////////////////////////////////////////////////////////////////////////////
-template <typename ContextT>
+template <typename ContextT>
inline typename pp_iterator_functor<ContextT>::result_type const &
pp_iterator_functor<ContextT>::pp_token()
{
@@ -832,7 +844,7 @@ token_id id = token_id(*iter_ctx->first);
// eat all T_PLACEHOLDER tokens, eventually slipped through out of the
// macro engine
- do {
+ do {
if (!pending_queue.empty()) {
// if there are pending tokens in the queue, return the first one
act_token = pending_queue.front();
@@ -840,14 +852,14 @@ token_id id = token_id(*iter_ctx->first);
act_pos = act_token.get_position();
}
else if (!unput_queue.empty()
- || T_IDENTIFIER == id
+ || T_IDENTIFIER == id
|| IS_CATEGORY(id, KeywordTokenType)
|| IS_EXTCATEGORY(id, OperatorTokenType|AltExtTokenType)
|| IS_CATEGORY(id, BoolLiteralTokenType))
{
// call the lexer, preprocess the required number of tokens, put them
// into the unput queue
- act_token = ctx.expand_tokensequence(iter_ctx->first,
+ act_token = ctx.expand_tokensequence(iter_ctx->first,
iter_ctx->last, pending_queue, unput_queue, skipped_newline);
}
else {
@@ -870,11 +882,11 @@ namespace impl {
// call 'found_directive' preprocessing hook
template <typename ContextT>
- bool call_found_directive_hook(ContextT& ctx,
+ bool call_found_directive_hook(ContextT& ctx,
typename ContextT::token_type const& found_directive)
{
#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0
- ctx.get_hooks().found_directive(found_directive);
+ ctx.get_hooks().found_directive(found_directive);
#else
if (ctx.get_hooks().found_directive(ctx.derived(), found_directive))
return true; // skip this directive and return newline only
@@ -884,11 +896,11 @@ namespace impl {
// // call 'skipped_token' preprocessing hook
// template <typename ContextT>
-// void call_skipped_token_hook(ContextT& ctx,
+// void call_skipped_token_hook(ContextT& ctx,
// typename ContextT::token_type const& skipped)
// {
// #if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0
-// ctx.get_hooks().skipped_token(skipped);
+// ctx.get_hooks().skipped_token(skipped);
// #else
// ctx.get_hooks().skipped_token(ctx.derived(), skipped);
// #endif
@@ -907,7 +919,7 @@ namespace impl {
if (IS_CATEGORY(id, EOLTokenType) || IS_CATEGORY(id, EOFTokenType))
break; // do not enter a new line
if (T_CPPCOMMENT == id ||
- context_policies::util::ccomment_has_newline(*it))
+ context_policies::util::ccomment_has_newline(*it))
{
break;
}
@@ -934,7 +946,7 @@ namespace impl {
token_id id = token_id(*it);
if (T_CPPCOMMENT == id || T_NEWLINE == id ||
- context_policies::util::ccomment_has_newline(*it))
+ context_policies::util::ccomment_has_newline(*it))
{
if (call_hook)
util::impl::call_skipped_token_hook(ctx, *it);
@@ -954,7 +966,7 @@ namespace impl {
///////////////////////////////////////////////////////////////////////////
template <typename ContextT, typename IteratorT>
- bool skip_to_eol(ContextT &ctx, IteratorT &it, IteratorT const &end,
+ bool skip_to_eol(ContextT &ctx, IteratorT &it, IteratorT const &end,
bool call_hook = true)
{
using namespace boost::wave;
@@ -963,9 +975,9 @@ namespace impl {
token_id id = token_id(*it);
if (T_CPPCOMMENT == id || T_NEWLINE == id ||
- context_policies::util::ccomment_has_newline(*it))
+ context_policies::util::ccomment_has_newline(*it))
{
- // always call hook for eol
+ // always call hook for eol
util::impl::call_skipped_token_hook(ctx, *it);
++it; // skip eol/C/C++ comment
return true; // found eol
@@ -995,12 +1007,12 @@ namespace impl {
///////////////////////////////////////////////////////////////////////////////
template <typename ContextT>
template <typename IteratorT>
-inline bool
+inline bool
pp_iterator_functor<ContextT>::extract_identifier(IteratorT &it)
{
token_id id = util::impl::skip_whitespace(it, iter_ctx->last);
- if (T_IDENTIFIER == id || IS_CATEGORY(id, KeywordTokenType) ||
- IS_EXTCATEGORY(id, OperatorTokenType|AltExtTokenType) ||
+ if (T_IDENTIFIER == id || IS_CATEGORY(id, KeywordTokenType) ||
+ IS_EXTCATEGORY(id, OperatorTokenType|AltExtTokenType) ||
IS_CATEGORY(id, BoolLiteralTokenType))
{
IteratorT save = it;
@@ -1022,10 +1034,10 @@ string_type str(util::impl::as_string<string_type>(iter_ctx->first, it));
///////////////////////////////////////////////////////////////////////////////
template <typename ContextT>
template <typename IteratorT>
-inline bool
+inline bool
pp_iterator_functor<ContextT>::ensure_is_last_on_line(IteratorT& it, bool call_hook)
{
- if (!impl::pp_is_last_on_line(ctx, it, iter_ctx->last, call_hook))
+ if (!impl::pp_is_last_on_line(ctx, it, iter_ctx->last, call_hook))
{
// enable error recovery (start over with the next line)
impl::skip_to_eol(ctx, it, iter_ctx->last);
@@ -1041,15 +1053,15 @@ pp_iterator_functor<ContextT>::ensure_is_last_on_line(IteratorT& it, bool call_h
return false;
}
- if (it == iter_ctx->last && !need_single_line(ctx.get_language()))
+ if (it == iter_ctx->last && !need_single_line(ctx.get_language()))
{
// The line doesn't end with an eol but eof token.
seen_newline = true; // allow to resume after warning
iter_ctx->first = it;
- // Trigger a warning that the last line was not terminated with a
+ // Trigger a warning that the last line was not terminated with a
// newline.
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
last_line_not_terminated, "", act_pos);
return false;
@@ -1059,20 +1071,20 @@ pp_iterator_functor<ContextT>::ensure_is_last_on_line(IteratorT& it, bool call_h
template <typename ContextT>
template <typename IteratorT>
-inline bool
+inline bool
pp_iterator_functor<ContextT>::skip_to_eol_with_check(IteratorT &it, bool call_hook)
{
typename ContextT::string_type value ((*it).get_value());
if (!impl::skip_to_eol(ctx, it, iter_ctx->last, call_hook) &&
- !need_single_line(ctx.get_language()))
+ !need_single_line(ctx.get_language()))
{
// The line doesn't end with an eol but eof token.
seen_newline = true; // allow to resume after warning
iter_ctx->first = it;
- // Trigger a warning, that the last line was not terminated with a
+ // Trigger a warning, that the last line was not terminated with a
// newline.
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
last_line_not_terminated, "", act_pos);
return false;
}
@@ -1084,8 +1096,8 @@ pp_iterator_functor<ContextT>::skip_to_eol_with_check(IteratorT &it, bool call_h
}
///////////////////////////////////////////////////////////////////////////////
-// handle_pp_directive: handle certain pp_directives
-template <typename ContextT>
+// handle_pp_directive: handle certain pp_directives
+template <typename ContextT>
template <typename IteratorT>
inline bool
pp_iterator_functor<ContextT>::handle_pp_directive(IteratorT &it)
@@ -1105,9 +1117,9 @@ pp_iterator_functor<ContextT>::handle_pp_directive(IteratorT &it)
case T_PP_ELIF: // #elif
if (!ctx.get_enclosing_if_block_status()) {
- if (!ctx.enter_elif_block(false)) {
+ if (!ctx.enter_elif_block(false)) {
// #else without matching #if
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
missing_matching_if, "#elif", act_pos);
return true; // do not analyze this directive any further
}
@@ -1126,7 +1138,7 @@ pp_iterator_functor<ContextT>::handle_pp_directive(IteratorT &it)
else
on_endif();
- // make sure, there are no (non-whitespace) tokens left on
+ // make sure, there are no (non-whitespace) tokens left on
// this line
ensure_is_last_on_line(it);
@@ -1156,11 +1168,11 @@ pp_iterator_functor<ContextT>::handle_pp_directive(IteratorT &it)
case T_PP_QHEADER_NEXT:
#endif
include_next = (T_PP_QHEADER_NEXT == id) ? true : false;
- if (!impl::call_found_directive_hook(ctx, *it))
+ if (!impl::call_found_directive_hook(ctx, *it))
{
string_type dir((*it).get_value());
- // make sure, there are no (non-whitespace) tokens left on
+ // make sure, there are no (non-whitespace) tokens left on
// this line
if (ensure_is_last_on_line(it))
{
@@ -1177,11 +1189,11 @@ pp_iterator_functor<ContextT>::handle_pp_directive(IteratorT &it)
case T_PP_HHEADER_NEXT:
#endif
include_next = (T_PP_HHEADER_NEXT == id) ? true : false;
- if (!impl::call_found_directive_hook(ctx, *it))
+ if (!impl::call_found_directive_hook(ctx, *it))
{
string_type dir((*it).get_value());
- // make sure, there are no (non-whitespace) tokens left on
+ // make sure, there are no (non-whitespace) tokens left on
// this line
if (ensure_is_last_on_line(it))
{
@@ -1203,7 +1215,7 @@ pp_iterator_functor<ContextT>::handle_pp_directive(IteratorT &it)
else
on_endif();
- // make sure, there are no (non-whitespace) tokens left on
+ // make sure, there are no (non-whitespace) tokens left on
// this line
ensure_is_last_on_line(it);
@@ -1225,8 +1237,8 @@ pp_iterator_functor<ContextT>::handle_pp_directive(IteratorT &it)
// extract first non-whitespace token as argument
case T_PP_UNDEF: // #undef
- if (!impl::call_found_directive_hook(ctx, *it) &&
- extract_identifier(it))
+ if (!impl::call_found_directive_hook(ctx, *it) &&
+ extract_identifier(it))
{
on_undefine(it);
}
@@ -1234,8 +1246,8 @@ pp_iterator_functor<ContextT>::handle_pp_directive(IteratorT &it)
break;
case T_PP_IFDEF: // #ifdef
- if (!impl::call_found_directive_hook(ctx, *it) &&
- extract_identifier(it))
+ if (!impl::call_found_directive_hook(ctx, *it) &&
+ extract_identifier(it))
{
on_ifdef(directive, it);
}
@@ -1243,8 +1255,8 @@ pp_iterator_functor<ContextT>::handle_pp_directive(IteratorT &it)
break;
case T_PP_IFNDEF: // #ifndef
- if (!impl::call_found_directive_hook(ctx, *it) &&
- extract_identifier(it))
+ if (!impl::call_found_directive_hook(ctx, *it) &&
+ extract_identifier(it))
{
on_ifndef(directive, it);
}
@@ -1254,8 +1266,8 @@ pp_iterator_functor<ContextT>::handle_pp_directive(IteratorT &it)
#if BOOST_WAVE_SUPPORT_MS_EXTENSIONS != 0
// case T_MSEXT_PP_REGION: // #region ...
// break;
-//
-// case T_MSEXT_PP_ENDREGION: // #endregion
+//
+// case T_MSEXT_PP_ENDREGION: // #endregion
// break;
#endif
@@ -1275,7 +1287,7 @@ pp_iterator_functor<ContextT>::handle_pp_directive(IteratorT &it)
///////////////////////////////////////////////////////////////////////////////
// pp_directive(): recognize a preprocessor directive
-template <typename ContextT>
+template <typename ContextT>
inline bool
pp_iterator_functor<ContextT>::pp_directive()
{
@@ -1331,7 +1343,7 @@ lexer_type it = iter_ctx->first;
// ignore/handle all pp directives not related to conditional compilation while
// if block status is false
if (handle_pp_directive(it)) {
- // we may skip pp directives only if the current if block status is
+ // we may skip pp directives only if the current if block status is
// false or if it was a #include directive we could handle directly
return true; // the pp directive has been handled/skipped
}
@@ -1345,21 +1357,21 @@ tree_parse_info_type hit = cpp_grammar_type::parse_cpp_grammar(
it, iter_ctx->last, act_pos, found_eof, found_directive, found_eoltokens);
if (hit.match) {
- // position the iterator past the matched sequence to allow
+ // position the iterator past the matched sequence to allow
// resynchronization, if an error occurs
iter_ctx->first = hit.stop;
seen_newline = true;
must_emit_line_directive = true;
- // found a valid pp directive, dispatch to the correct function to handle
+ // found a valid pp directive, dispatch to the correct function to handle
// the found pp directive
bool result = dispatch_directive (hit, found_directive, found_eoltokens);
if (found_eof && !need_single_line(ctx.get_language())) {
// The line was terminated with an end of file token.
- // So trigger a warning, that the last line was not terminated with a
+ // So trigger a warning, that the last line was not terminated with a
// newline.
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
last_line_not_terminated, "", act_pos);
}
return result;
@@ -1384,7 +1396,7 @@ tree_parse_info_type hit = cpp_grammar_type::parse_cpp_grammar(
// dispatch_directive(): dispatch a recognized preprocessor directive
//
///////////////////////////////////////////////////////////////////////////////
-template <typename ContextT>
+template <typename ContextT>
inline bool
pp_iterator_functor<ContextT>::dispatch_directive(
tree_parse_info_type const &hit, result_type const& found_directive,
@@ -1408,30 +1420,30 @@ const_child_iterator_t end_child_it = (*root.begin()).children.end();
token_id id = token_id(found_directive);
// call preprocessing hook
- if (impl::call_found_directive_hook(ctx, found_directive))
+ if (impl::call_found_directive_hook(ctx, found_directive))
return true; // skip this directive and return newline only
switch (static_cast<unsigned int>(id)) {
// case T_PP_QHEADER: // #include "..."
// #if BOOST_WAVE_SUPPORT_INCLUDE_NEXT != 0
// case T_PP_QHEADER_NEXT: // #include_next "..."
-// #endif
-// on_include ((*nodeval.begin()).get_value(), false,
+// #endif
+// on_include ((*nodeval.begin()).get_value(), false,
// T_PP_QHEADER_NEXT == id);
// break;
// case T_PP_HHEADER: // #include <...>
// #if BOOST_WAVE_SUPPORT_INCLUDE_NEXT != 0
// case T_PP_HHEADER_NEXT: // #include_next <...>
-// #endif
-// on_include ((*nodeval.begin()).get_value(), true,
+// #endif
+// on_include ((*nodeval.begin()).get_value(), true,
// T_PP_HHEADER_NEXT == id);
// break;
-
+
case T_PP_INCLUDE: // #include ...
#if BOOST_WAVE_SUPPORT_INCLUDE_NEXT != 0
case T_PP_INCLUDE_NEXT: // #include_next ...
-#endif
+#endif
on_include (begin_child_it, end_child_it, T_PP_INCLUDE_NEXT == id);
break;
@@ -1442,11 +1454,11 @@ token_id id = token_id(found_directive);
// case T_PP_UNDEF: // #undef
// on_undefine(*nodeval.begin());
// break;
-//
+//
// case T_PP_IFDEF: // #ifdef
// on_ifdef(found_directive, begin_child_it, end_child_it);
// break;
-//
+//
// case T_PP_IFNDEF: // #ifndef
// on_ifndef(found_directive, begin_child_it, end_child_it);
// break;
@@ -1479,7 +1491,7 @@ token_id id = token_id(found_directive);
case T_PP_WARNING: // #warning
on_warning(begin_child_it, end_child_it);
break;
-#endif
+#endif
case T_PP_PRAGMA: // #pragma
return on_pragma(begin_child_it, end_child_it);
@@ -1492,14 +1504,14 @@ token_id id = token_id(found_directive);
default: // #something else
on_illformed((*nodeval.begin()).get_value());
-
- // if we end up here, we have been instructed to ignore the error, so
+
+ // if we end up here, we have been instructed to ignore the error, so
// we simply copy the whole construct to the output
{
token_sequence_type expanded;
get_token_value<result_type, parse_node_type> get_value;
- std::copy(make_ref_transform_iterator(begin_child_it, get_value),
+ std::copy(make_ref_transform_iterator(begin_child_it, get_value),
make_ref_transform_iterator(end_child_it, get_value),
std::inserter(expanded, expanded.end()));
pending_queue.splice(pending_queue.begin(), expanded);
@@ -1514,14 +1526,14 @@ token_id id = token_id(found_directive);
}
///////////////////////////////////////////////////////////////////////////////
-//
+//
// on_include: handle #include <...> or #include "..." directives
//
///////////////////////////////////////////////////////////////////////////////
-template <typename ContextT>
-inline void
-pp_iterator_functor<ContextT>::on_include (string_type const &s,
- bool is_system, bool include_next)
+template <typename ContextT>
+inline void
+pp_iterator_functor<ContextT>::on_include (string_type const &s,
+ bool is_system, bool include_next)
{
BOOST_ASSERT(ctx.get_if_block_status());
@@ -1529,16 +1541,16 @@ pp_iterator_functor<ContextT>::on_include (string_type const &s,
typename string_type::size_type pos_end = s.find_last_of(is_system ? '>' : '\"');
if (string_type::npos == pos_end) {
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, bad_include_statement,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, bad_include_statement,
s.c_str(), act_pos);
return;
}
-typename string_type::size_type pos_begin =
+typename string_type::size_type pos_begin =
s.find_last_of(is_system ? '<' : '\"', pos_end-1);
if (string_type::npos == pos_begin) {
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, bad_include_statement,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, bad_include_statement,
s.c_str(), act_pos);
return;
}
@@ -1547,14 +1559,14 @@ std::string file_token(s.substr(pos_begin, pos_end-pos_begin+1).c_str());
std::string file_path(s.substr(pos_begin+1, pos_end-pos_begin-1).c_str());
// finally include the file
- on_include_helper(file_token.c_str(), file_path.c_str(), is_system,
+ on_include_helper(file_token.c_str(), file_path.c_str(), is_system,
include_next);
}
-template <typename ContextT>
-inline bool
-pp_iterator_functor<ContextT>::on_include_helper (char const *f, char const *s,
- bool is_system, bool include_next)
+template <typename ContextT>
+inline bool
+pp_iterator_functor<ContextT>::on_include_helper (char const *f, char const *s,
+ bool is_system, bool include_next)
{
namespace fs = boost::filesystem;
@@ -1572,31 +1584,31 @@ char const *current_name = 0; // never try to match current file name
ctx.get_hooks().found_include_directive(f, include_next);
#else
if (ctx.get_hooks().found_include_directive(ctx.derived(), f, include_next))
- return true; // client returned false: skip file to include
+ return true; // client returned false: skip file to include
#endif
file_path = util::impl::unescape_lit(file_path);
std::string native_path_str;
- if (!ctx.get_hooks().locate_include_file(ctx, file_path, is_system,
- current_name, dir_path, native_path_str))
+ if (!ctx.get_hooks().locate_include_file(ctx, file_path, is_system,
+ current_name, dir_path, native_path_str))
{
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, bad_include_file,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, bad_include_file,
file_path.c_str(), act_pos);
return false;
}
// test, if this file is known through a #pragma once directive
#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0
- if (!ctx.has_pragma_once(native_path_str))
-#endif
+ if (!ctx.has_pragma_once(native_path_str))
+#endif
{
// the new include file determines the actual current directory
ctx.set_current_directory(native_path_str.c_str());
// preprocess the opened file
boost::shared_ptr<base_iteration_context_type> new_iter_ctx (
- new iteration_context_type(ctx, native_path_str.c_str(), act_pos,
+ new iteration_context_type(ctx, native_path_str.c_str(), act_pos,
boost::wave::enable_prefer_pp_numbers(ctx.get_language()),
is_system ? base_iteration_context_type::system_header :
base_iteration_context_type::user_header));
@@ -1628,7 +1640,7 @@ char const *current_name = 0; // never try to match current file name
fs::path rfp(wave::util::create_path(iter_ctx->real_filename.c_str()));
std::string real_filename(rfp.string());
ctx.set_current_filename(real_filename.c_str());
-#endif
+#endif
ctx.set_current_relative_filename(dir_path.c_str());
iter_ctx->real_relative_filename = dir_path.c_str();
@@ -1640,7 +1652,7 @@ char const *current_name = 0; // never try to match current file name
}
///////////////////////////////////////////////////////////////////////////////
-//
+//
// on_include(): handle #include ... directives
//
///////////////////////////////////////////////////////////////////////////////
@@ -1649,7 +1661,7 @@ namespace impl {
// trim all whitespace from the beginning and the end of the given string
template <typename StringT>
- inline StringT
+ inline StringT
trim_whitespace(StringT const &s)
{
typedef typename StringT::size_type size_type;
@@ -1662,8 +1674,8 @@ namespace impl {
}
}
-template <typename ContextT>
-inline void
+template <typename ContextT>
+inline void
pp_iterator_functor<ContextT>::on_include(
typename parse_tree_type::const_iterator const &begin,
typename parse_tree_type::const_iterator const &end, bool include_next)
@@ -1675,12 +1687,12 @@ get_token_value<result_type, parse_node_type> get_value;
token_sequence_type expanded;
token_sequence_type toexpand;
- std::copy(make_ref_transform_iterator(begin, get_value),
+ std::copy(make_ref_transform_iterator(begin, get_value),
make_ref_transform_iterator(end, get_value),
std::inserter(toexpand, toexpand.end()));
typename token_sequence_type::iterator begin2 = toexpand.begin();
- ctx.expand_whole_tokensequence(begin2, toexpand.end(), expanded,
+ ctx.expand_whole_tokensequence(begin2, toexpand.end(), expanded,
false);
// now, include the file
@@ -1689,7 +1701,7 @@ bool is_system = '<' == s[0] && '>' == s[s.size()-1];
if (!is_system && !('\"' == s[0] && '\"' == s[s.size()-1])) {
// should resolve into something like <...> or "..."
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, bad_include_statement,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, bad_include_statement,
s.c_str(), act_pos);
return;
}
@@ -1697,14 +1709,14 @@ bool is_system = '<' == s[0] && '>' == s[s.size()-1];
}
///////////////////////////////////////////////////////////////////////////////
-//
+//
// on_define(): handle #define directives
//
///////////////////////////////////////////////////////////////////////////////
-template <typename ContextT>
-inline void
-pp_iterator_functor<ContextT>::on_define (parse_node_type const &node)
+template <typename ContextT>
+inline void
+pp_iterator_functor<ContextT>::on_define (parse_node_type const &node)
{
BOOST_ASSERT(ctx.get_if_block_status());
@@ -1715,12 +1727,12 @@ token_sequence_type macrodefinition;
bool has_parameters = false;
position_type pos(act_token.get_position());
- if (!boost::wave::util::retrieve_macroname(ctx, node,
+ if (!boost::wave::util::retrieve_macroname(ctx, node,
BOOST_WAVE_PLAIN_DEFINE_ID, macroname, pos, false))
return;
- has_parameters = boost::wave::util::retrieve_macrodefinition(node,
+ has_parameters = boost::wave::util::retrieve_macrodefinition(node,
BOOST_WAVE_MACRO_PARAMETERS_ID, macroparameters, pos, false);
- boost::wave::util::retrieve_macrodefinition(node,
+ boost::wave::util::retrieve_macrodefinition(node,
BOOST_WAVE_MACRO_DEFINITION_ID, macrodefinition, pos, false);
if (has_parameters) {
@@ -1729,44 +1741,44 @@ position_type pos(act_token.get_position());
// test whether ellipsis are given, and if yes, if these are placed as the
// last argument, test if __VA_ARGS__ is used as a macro parameter name
using namespace cpplexer;
- typedef typename std::vector<result_type>::iterator
+ typedef typename std::vector<result_type>::iterator
parameter_iterator_t;
bool seen_ellipses = false;
parameter_iterator_t end = macroparameters.end();
- for (parameter_iterator_t pit = macroparameters.begin();
- pit != end; ++pit)
+ for (parameter_iterator_t pit = macroparameters.begin();
+ pit != end; ++pit)
{
if (seen_ellipses) {
// ellipses are not the last given formal argument
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
- bad_define_statement, macroname.get_value().c_str(),
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
+ bad_define_statement, macroname.get_value().c_str(),
(*pit).get_position());
return;
}
- if (T_ELLIPSIS == token_id(*pit))
+ if (T_ELLIPSIS == token_id(*pit))
seen_ellipses = true;
// can't use __VA_ARGS__ as a argument name
if ("__VA_ARGS__" == (*pit).get_value()) {
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
- bad_define_statement_va_args,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
+ bad_define_statement_va_args,
macroname.get_value().c_str(), (*pit).get_position());
return;
}
}
- // if there wasn't an ellipsis, then there shouldn't be a __VA_ARGS__
+ // if there wasn't an ellipsis, then there shouldn't be a __VA_ARGS__
// placeholder in the definition too [C99 Standard 6.10.3.5]
if (!seen_ellipses) {
typedef typename token_sequence_type::iterator definition_iterator_t;
bool seen_va_args = false;
definition_iterator_t pend = macrodefinition.end();
- for (definition_iterator_t dit = macrodefinition.begin();
- dit != pend; ++dit)
+ for (definition_iterator_t dit = macrodefinition.begin();
+ dit != pend; ++dit)
{
- if (T_IDENTIFIER == token_id(*dit) &&
+ if (T_IDENTIFIER == token_id(*dit) &&
"__VA_ARGS__" == (*dit).get_value())
{
seen_va_args = true;
@@ -1774,8 +1786,8 @@ position_type pos(act_token.get_position());
}
if (seen_va_args) {
// must not have seen __VA_ARGS__ placeholder
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
- bad_define_statement_va_args,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
+ bad_define_statement_va_args,
macroname.get_value().c_str(), act_token.get_position());
return;
}
@@ -1786,17 +1798,17 @@ position_type pos(act_token.get_position());
{
// test, that there is no T_ELLIPSES given
using namespace cpplexer;
- typedef typename std::vector<result_type>::iterator
+ typedef typename std::vector<result_type>::iterator
parameter_iterator_t;
parameter_iterator_t end = macroparameters.end();
- for (parameter_iterator_t pit = macroparameters.begin();
- pit != end; ++pit)
+ for (parameter_iterator_t pit = macroparameters.begin();
+ pit != end; ++pit)
{
if (T_ELLIPSIS == token_id(*pit)) {
// if variadics are disabled, no ellipses should be given
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
- bad_define_statement, macroname.get_value().c_str(),
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
+ bad_define_statement, macroname.get_value().c_str(),
(*pit).get_position());
return;
}
@@ -1805,17 +1817,17 @@ position_type pos(act_token.get_position());
}
// add the new macro to the macromap
- ctx.add_macro_definition(macroname, has_parameters, macroparameters,
+ ctx.add_macro_definition(macroname, has_parameters, macroparameters,
macrodefinition);
}
///////////////////////////////////////////////////////////////////////////////
-//
+//
// on_undefine(): handle #undef directives
//
///////////////////////////////////////////////////////////////////////////////
-template <typename ContextT>
-inline void
+template <typename ContextT>
+inline void
pp_iterator_functor<ContextT>::on_undefine (lexer_type const &it)
{
BOOST_ASSERT(ctx.get_if_block_status());
@@ -1825,12 +1837,12 @@ pp_iterator_functor<ContextT>::on_undefine (lexer_type const &it)
}
///////////////////////////////////////////////////////////////////////////////
-//
+//
// on_ifdef(): handle #ifdef directives
//
///////////////////////////////////////////////////////////////////////////////
-template <typename ContextT>
-inline void
+template <typename ContextT>
+inline void
pp_iterator_functor<ContextT>::on_ifdef(
result_type const& found_directive, lexer_type const &it)
// typename parse_tree_type::const_iterator const &it)
@@ -1838,8 +1850,8 @@ pp_iterator_functor<ContextT>::on_ifdef(
{
// get_token_value<result_type, parse_node_type> get_value;
// token_sequence_type toexpand;
-//
-// std::copy(make_ref_transform_iterator((*begin).children.begin(), get_value),
+//
+// std::copy(make_ref_transform_iterator((*begin).children.begin(), get_value),
// make_ref_transform_iterator((*begin).children.end(), get_value),
// std::inserter(toexpand, toexpand.end()));
@@ -1854,19 +1866,19 @@ token_sequence_type directive;
#else
do {
is_defined = ctx.is_defined_macro((*it).get_value()); // toexpand.begin(), toexpand.end());
- } while (ctx.get_hooks().evaluated_conditional_expression(ctx.derived(),
+ } while (ctx.get_hooks().evaluated_conditional_expression(ctx.derived(),
found_directive, directive, is_defined));
#endif
ctx.enter_if_block(is_defined);
}
///////////////////////////////////////////////////////////////////////////////
-//
+//
// on_ifndef(): handle #ifndef directives
//
///////////////////////////////////////////////////////////////////////////////
-template <typename ContextT>
-inline void
+template <typename ContextT>
+inline void
pp_iterator_functor<ContextT>::on_ifndef(
result_type const& found_directive, lexer_type const &it)
// typename parse_tree_type::const_iterator const &it)
@@ -1874,8 +1886,8 @@ pp_iterator_functor<ContextT>::on_ifndef(
{
// get_token_value<result_type, parse_node_type> get_value;
// token_sequence_type toexpand;
-//
-// std::copy(make_ref_transform_iterator((*begin).children.begin(), get_value),
+//
+// std::copy(make_ref_transform_iterator((*begin).children.begin(), get_value),
// make_ref_transform_iterator((*begin).children.end(), get_value),
// std::inserter(toexpand, toexpand.end()));
@@ -1890,48 +1902,48 @@ token_sequence_type directive;
#else
do {
is_defined = ctx.is_defined_macro((*it).get_value()); // toexpand.begin(), toexpand.end());
- } while (ctx.get_hooks().evaluated_conditional_expression(ctx.derived(),
+ } while (ctx.get_hooks().evaluated_conditional_expression(ctx.derived(),
found_directive, directive, is_defined));
#endif
ctx.enter_if_block(!is_defined);
}
///////////////////////////////////////////////////////////////////////////////
-//
+//
// on_else(): handle #else directives
//
///////////////////////////////////////////////////////////////////////////////
-template <typename ContextT>
-inline void
+template <typename ContextT>
+inline void
pp_iterator_functor<ContextT>::on_else()
{
if (!ctx.enter_else_block()) {
// #else without matching #if
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, missing_matching_if,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, missing_matching_if,
"#else", act_pos);
}
}
///////////////////////////////////////////////////////////////////////////////
-//
+//
// on_endif(): handle #endif directives
//
///////////////////////////////////////////////////////////////////////////////
-template <typename ContextT>
-inline void
+template <typename ContextT>
+inline void
pp_iterator_functor<ContextT>::on_endif()
{
if (!ctx.exit_if_block()) {
// #endif without matching #if
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, missing_matching_if,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, missing_matching_if,
"#endif", act_pos);
}
}
///////////////////////////////////////////////////////////////////////////////
// replace all remaining (== undefined) identifiers with an integer literal '0'
-template <typename ContextT>
-inline void
+template <typename ContextT>
+inline void
pp_iterator_functor<ContextT>::replace_undefined_identifiers(
token_sequence_type &expanded)
{
@@ -1940,7 +1952,7 @@ pp_iterator_functor<ContextT>::replace_undefined_identifiers(
exp_it != exp_end; ++exp_it)
{
using namespace boost::wave;
-
+
token_id id = token_id(*exp_it);
if (IS_CATEGORY(id, IdentifierTokenType) ||
IS_CATEGORY(id, KeywordTokenType))
@@ -1952,12 +1964,12 @@ pp_iterator_functor<ContextT>::replace_undefined_identifiers(
}
///////////////////////////////////////////////////////////////////////////////
-//
+//
// on_if(): handle #if directives
//
///////////////////////////////////////////////////////////////////////////////
-template <typename ContextT>
-inline void
+template <typename ContextT>
+inline void
pp_iterator_functor<ContextT>::on_if(
result_type const& found_directive,
typename parse_tree_type::const_iterator const &begin,
@@ -1967,7 +1979,7 @@ pp_iterator_functor<ContextT>::on_if(
get_token_value<result_type, parse_node_type> get_value;
token_sequence_type toexpand;
- std::copy(make_ref_transform_iterator(begin, get_value),
+ std::copy(make_ref_transform_iterator(begin, get_value),
make_ref_transform_iterator(end, get_value),
std::inserter(toexpand, toexpand.end()));
@@ -1990,7 +2002,7 @@ token_sequence_type expanded;
{
string_type outstr(boost::wave::util::impl::as_string(toexpand));
outstr += "(" + boost::wave::util::impl::as_string(expanded) + ")";
- BOOST_WAVE_DUMP_CONDITIONAL_EXPRESSIONS_OUT << "#if " << outstr
+ BOOST_WAVE_DUMP_CONDITIONAL_EXPRESSIONS_OUT << "#if " << outstr
<< std::endl;
}
#endif
@@ -2010,8 +2022,8 @@ token_sequence_type expanded;
ctx.get_hooks().evaluated_conditional_expression(toexpand, if_status);
} while (false);
#else
- } while (ctx.get_hooks().evaluated_conditional_expression(ctx.derived(),
- found_directive, toexpand, if_status)
+ } while (ctx.get_hooks().evaluated_conditional_expression(ctx.derived(),
+ found_directive, toexpand, if_status)
&& status == grammars::error_noerror);
#endif
@@ -2019,31 +2031,31 @@ token_sequence_type expanded;
if (grammars::error_noerror != status) {
// division or other error by zero occurred
string_type expression = util::impl::as_string(expanded);
- if (0 == expression.size())
+ if (0 == expression.size())
expression = "<empty expression>";
if (grammars::error_division_by_zero & status) {
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, division_by_zero,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, division_by_zero,
expression.c_str(), act_pos);
}
else if (grammars::error_integer_overflow & status) {
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, integer_overflow,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, integer_overflow,
expression.c_str(), act_pos);
}
else if (grammars::error_character_overflow & status) {
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
character_literal_out_of_range, expression.c_str(), act_pos);
}
}
}
///////////////////////////////////////////////////////////////////////////////
-//
+//
// on_elif(): handle #elif directives
//
///////////////////////////////////////////////////////////////////////////////
-template <typename ContextT>
-inline void
+template <typename ContextT>
+inline void
pp_iterator_functor<ContextT>::on_elif(
result_type const& found_directive,
typename parse_tree_type::const_iterator const &begin,
@@ -2053,7 +2065,7 @@ pp_iterator_functor<ContextT>::on_elif(
get_token_value<result_type, parse_node_type> get_value;
token_sequence_type toexpand;
- std::copy(make_ref_transform_iterator(begin, get_value),
+ std::copy(make_ref_transform_iterator(begin, get_value),
make_ref_transform_iterator(end, get_value),
std::inserter(toexpand, toexpand.end()));
@@ -2063,7 +2075,7 @@ token_sequence_type toexpand;
if (ctx.get_if_block_some_part_status()) {
if (!ctx.enter_elif_block(false)) {
// #else without matching #if
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
missing_matching_if, "#elif", act_pos);
// fall through...
}
@@ -2072,7 +2084,7 @@ token_sequence_type toexpand;
typename token_sequence_type::iterator begin2 = toexpand.begin();
impl::skip_to_eol(ctx, begin2, toexpand.end());
- return; // one of previous #if/#elif was true, so don't enter this #elif
+ return; // one of previous #if/#elif was true, so don't enter this #elif
}
// preprocess the given sequence into the provided list
@@ -2082,7 +2094,7 @@ token_sequence_type expanded;
do {
expanded.clear();
-
+
typename token_sequence_type::iterator begin2 = toexpand.begin();
ctx.expand_whole_tokensequence(begin2, toexpand.end(), expanded);
@@ -2112,14 +2124,14 @@ token_sequence_type expanded;
ctx.get_hooks().evaluated_conditional_expression(toexpand, if_status);
} while (false);
#else
- } while (ctx.get_hooks().evaluated_conditional_expression(ctx.derived(),
- found_directive, toexpand, if_status)
+ } while (ctx.get_hooks().evaluated_conditional_expression(ctx.derived(),
+ found_directive, toexpand, if_status)
&& status == grammars::error_noerror);
#endif
- if (!ctx.enter_elif_block(if_status)) {
+ if (!ctx.enter_elif_block(if_status)) {
// #elif without matching #if
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, missing_matching_if,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, missing_matching_if,
"#elif", act_pos);
return;
}
@@ -2127,48 +2139,48 @@ token_sequence_type expanded;
if (grammars::error_noerror != status) {
// division or other error by zero occurred
string_type expression = util::impl::as_string(expanded);
- if (0 == expression.size())
+ if (0 == expression.size())
expression = "<empty expression>";
-
+
if (grammars::error_division_by_zero & status) {
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, division_by_zero,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, division_by_zero,
expression.c_str(), act_pos);
}
else if (grammars::error_integer_overflow & status) {
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
integer_overflow, expression.c_str(), act_pos);
}
else if (grammars::error_character_overflow & status) {
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
character_literal_out_of_range, expression.c_str(), act_pos);
}
}
}
///////////////////////////////////////////////////////////////////////////////
-//
+//
// on_illformed(): handles the illegal directive
//
///////////////////////////////////////////////////////////////////////////////
-template <typename ContextT>
-inline void
+template <typename ContextT>
+inline void
pp_iterator_functor<ContextT>::on_illformed(
typename result_type::string_type s)
{
BOOST_ASSERT(ctx.get_if_block_status());
-
+
// some messages have more than one newline at the end
typename string_type::size_type p = s.find_last_not_of('\n');
if (string_type::npos != p)
s = s.substr(0, p+1);
// throw the exception
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, ill_formed_directive,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, ill_formed_directive,
s.c_str(), act_pos);
}
///////////////////////////////////////////////////////////////////////////////
-//
+//
// on_line(): handle #line directives
//
///////////////////////////////////////////////////////////////////////////////
@@ -2177,7 +2189,7 @@ namespace impl {
template <typename IteratorT, typename StringT>
bool retrieve_line_info (IteratorT first, IteratorT const &last,
- unsigned int &line, StringT &file,
+ unsigned int &line, StringT &file,
boost::wave::preprocess_exception::error_code& error)
{
using namespace boost::wave;
@@ -2195,7 +2207,7 @@ namespace impl {
error = preprocess_exception::bad_line_number;
// extract file name (if it is given)
- while (++first != last && IS_CATEGORY(*first, WhiteSpaceTokenType))
+ while (++first != last && IS_CATEGORY(*first, WhiteSpaceTokenType))
/**/; // skip whitespace
if (first != last) {
@@ -2208,13 +2220,13 @@ namespace impl {
if ('L' == file_lit[0]) {
error = preprocess_exception::bad_line_filename;
- return false; // shouldn't be a wide character string
+ return false; // shouldn't be a wide character string
}
file = file_lit.substr(1, file_lit.size()-2);
// test if there is other junk on this line
- while (++first != last && IS_CATEGORY(*first, WhiteSpaceTokenType))
+ while (++first != last && IS_CATEGORY(*first, WhiteSpaceTokenType))
/**/; // skip whitespace
}
return first == last;
@@ -2224,8 +2236,8 @@ namespace impl {
}
}
-template <typename ContextT>
-inline void
+template <typename ContextT>
+inline void
pp_iterator_functor<ContextT>::on_line(
typename parse_tree_type::const_iterator const &begin,
typename parse_tree_type::const_iterator const &end)
@@ -2233,13 +2245,13 @@ pp_iterator_functor<ContextT>::on_line(
BOOST_ASSERT(ctx.get_if_block_status());
// Try to extract the line number and file name from the given token list
-// directly. If that fails, preprocess the whole token sequence and try again
+// directly. If that fails, preprocess the whole token sequence and try again
// to extract this information.
token_sequence_type expanded;
get_token_value<result_type, parse_node_type> get_value;
typedef typename ref_transform_iterator_generator<
- get_token_value<result_type, parse_node_type>,
+ get_token_value<result_type, parse_node_type>,
typename parse_tree_type::const_iterator
>::type const_tree_iterator_t;
@@ -2257,27 +2269,27 @@ token_sequence_type toexpand;
if (!impl::retrieve_line_info(first, last, line, file_name, error)) {
// preprocess the body of this #line message
typename token_sequence_type::iterator begin2 = toexpand.begin();
- ctx.expand_whole_tokensequence(begin2, toexpand.end(),
+ ctx.expand_whole_tokensequence(begin2, toexpand.end(),
expanded, false);
error = preprocess_exception::no_error;
- if (!impl::retrieve_line_info(expanded.begin(), expanded.end(),
+ if (!impl::retrieve_line_info(expanded.begin(), expanded.end(),
line, file_name, error))
{
typename ContextT::string_type msg(
boost::wave::util::impl::as_string(expanded));
- BOOST_WAVE_THROW_VAR_CTX(ctx, preprocess_exception, error,
+ BOOST_WAVE_THROW_VAR_CTX(ctx, preprocess_exception, error,
msg.c_str(), act_pos);
return;
}
// call the corresponding pp hook function
- ctx.get_hooks().found_line_directive(ctx.derived(), expanded, line,
+ ctx.get_hooks().found_line_directive(ctx.derived(), expanded, line,
file_name.c_str());
}
else {
// call the corresponding pp hook function
- ctx.get_hooks().found_line_directive(ctx.derived(), toexpand, line,
+ ctx.get_hooks().found_line_directive(ctx.derived(), toexpand, line,
file_name.c_str());
}
@@ -2292,13 +2304,13 @@ token_sequence_type toexpand;
if (error != preprocess_exception::no_error) {
typename ContextT::string_type msg(
boost::wave::util::impl::as_string(expanded));
- BOOST_WAVE_THROW_VAR_CTX(ctx, preprocess_exception, error,
+ BOOST_WAVE_THROW_VAR_CTX(ctx, preprocess_exception, error,
msg.c_str(), act_pos);
return;
}
// set new line number/filename only if ok
- if (!file_name.empty()) { // reuse current file name
+ if (!file_name.empty()) { // reuse current file name
using boost::wave::util::impl::unescape_lit;
act_pos.set_file(unescape_lit(file_name).c_str());
}
@@ -2307,12 +2319,12 @@ token_sequence_type toexpand;
}
///////////////////////////////////////////////////////////////////////////////
-//
+//
// on_error(): handle #error directives
//
///////////////////////////////////////////////////////////////////////////////
-template <typename ContextT>
-inline void
+template <typename ContextT>
+inline void
pp_iterator_functor<ContextT>::on_error(
typename parse_tree_type::const_iterator const &begin,
typename parse_tree_type::const_iterator const &end)
@@ -2324,7 +2336,7 @@ token_sequence_type expanded;
get_token_value<result_type, parse_node_type> get_value;
typename ref_transform_iterator_generator<
- get_token_value<result_type, parse_node_type>,
+ get_token_value<result_type, parse_node_type>,
typename parse_tree_type::const_iterator
>::type first = make_ref_transform_iterator(begin, get_value);
@@ -2336,32 +2348,32 @@ token_sequence_type toexpand;
std::inserter(toexpand, toexpand.end()));
typename token_sequence_type::iterator begin2 = toexpand.begin();
- ctx.expand_whole_tokensequence(begin2, toexpand.end(), expanded,
+ ctx.expand_whole_tokensequence(begin2, toexpand.end(), expanded,
false);
if (!ctx.get_hooks().found_error_directive(ctx.derived(), toexpand))
#else
// simply copy the body of this #error message to the issued diagnostic
// message
- std::copy(first, make_ref_transform_iterator(end, get_value),
+ std::copy(first, make_ref_transform_iterator(end, get_value),
std::inserter(expanded, expanded.end()));
if (!ctx.get_hooks().found_error_directive(ctx.derived(), expanded))
-#endif
+#endif
{
// report the corresponding error
BOOST_WAVE_STRINGTYPE msg(boost::wave::util::impl::as_string(expanded));
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, error_directive,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, error_directive,
msg.c_str(), act_pos);
}
}
#if BOOST_WAVE_SUPPORT_WARNING_DIRECTIVE != 0
///////////////////////////////////////////////////////////////////////////////
-//
+//
// on_warning(): handle #warning directives
//
///////////////////////////////////////////////////////////////////////////////
-template <typename ContextT>
-inline void
+template <typename ContextT>
+inline void
pp_iterator_functor<ContextT>::on_warning(
typename parse_tree_type::const_iterator const &begin,
typename parse_tree_type::const_iterator const &end)
@@ -2373,7 +2385,7 @@ token_sequence_type expanded;
get_token_value<result_type, parse_node_type> get_value;
typename ref_transform_iterator_generator<
- get_token_value<result_type, parse_node_type>,
+ get_token_value<result_type, parse_node_type>,
typename parse_tree_type::const_iterator
>::type first = make_ref_transform_iterator(begin, get_value);
@@ -2385,31 +2397,31 @@ token_sequence_type toexpand;
std::inserter(toexpand, toexpand.end()));
typename token_sequence_type::iterator begin2 = toexpand.begin();
- ctx.expand_whole_tokensequence(begin2, toexpand.end(), expanded,
+ ctx.expand_whole_tokensequence(begin2, toexpand.end(), expanded,
false);
if (!ctx.get_hooks().found_warning_directive(ctx.derived(), toexpand))
#else
// simply copy the body of this #warning message to the issued diagnostic
// message
- std::copy(first, make_ref_transform_iterator(end, get_value),
+ std::copy(first, make_ref_transform_iterator(end, get_value),
std::inserter(expanded, expanded.end()));
if (!ctx.get_hooks().found_warning_directive(ctx.derived(), expanded))
-#endif
+#endif
{
// report the corresponding error
BOOST_WAVE_STRINGTYPE msg(boost::wave::util::impl::as_string(expanded));
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, warning_directive,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, warning_directive,
msg.c_str(), act_pos);
}
}
#endif // BOOST_WAVE_SUPPORT_WARNING_DIRECTIVE != 0
///////////////////////////////////////////////////////////////////////////////
-//
+//
// on_pragma(): handle #pragma directives
//
///////////////////////////////////////////////////////////////////////////////
-template <typename ContextT>
+template <typename ContextT>
inline bool
pp_iterator_functor<ContextT>::on_pragma(
typename parse_tree_type::const_iterator const &begin,
@@ -2426,7 +2438,7 @@ token_sequence_type expanded;
get_token_value<result_type, parse_node_type> get_value;
typedef typename ref_transform_iterator_generator<
- get_token_value<result_type, parse_node_type>,
+ get_token_value<result_type, parse_node_type>,
typename parse_tree_type::const_iterator
>::type const_tree_iterator_t;
@@ -2436,13 +2448,13 @@ const_tree_iterator_t last = make_ref_transform_iterator(end, get_value);
expanded.push_back(result_type(T_PP_PRAGMA, "#pragma", act_token.get_position()));
expanded.push_back(result_type(T_SPACE, " ", act_token.get_position()));
- while (++first != last && IS_CATEGORY(*first, WhiteSpaceTokenType))
+ while (++first != last && IS_CATEGORY(*first, WhiteSpaceTokenType))
expanded.push_back(*first); // skip whitespace
if (first != last) {
- if (T_IDENTIFIER == token_id(*first) &&
- boost::wave::need_c99(ctx.get_language()) &&
- (*first).get_value() == "STDC")
+ if (T_IDENTIFIER == token_id(*first) &&
+ boost::wave::need_c99(ctx.get_language()) &&
+ (*first).get_value() == "STDC")
{
// do _not_ preprocess the token sequence
std::copy(first, last, std::inserter(expanded, expanded.end()));
@@ -2455,7 +2467,7 @@ const_tree_iterator_t last = make_ref_transform_iterator(end, get_value);
std::copy(first, last, std::inserter(toexpand, toexpand.end()));
typename token_sequence_type::iterator begin2 = toexpand.begin();
- ctx.expand_whole_tokensequence(begin2, toexpand.end(),
+ ctx.expand_whole_tokensequence(begin2, toexpand.end(),
expanded, false);
#else
// do _not_ preprocess the token sequence
@@ -2469,7 +2481,7 @@ const_tree_iterator_t last = make_ref_transform_iterator(end, get_value);
BOOST_ASSERT(unput_queue.empty());
BOOST_ASSERT(pending_queue.empty());
-// try to interpret the expanded #pragma body
+// try to interpret the expanded #pragma body
token_sequence_type pending;
if (interpret_pragma(expanded, pending)) {
// if there is some replacement text, insert it into the pending queue
@@ -2479,17 +2491,17 @@ const_tree_iterator_t last = make_ref_transform_iterator(end, get_value);
}
#if BOOST_WAVE_EMIT_PRAGMA_DIRECTIVES != 0
-// Move the resulting token sequence into the pending_queue, so it will be
+// Move the resulting token sequence into the pending_queue, so it will be
// returned to the caller.
if (boost::wave::need_emit_pragma_directives(ctx.get_language())) {
pending_queue.splice(pending_queue.begin(), expanded);
return false; // return the whole #pragma directive
}
-#endif
+#endif
return true; // skip the #pragma at all
}
-template <typename ContextT>
+template <typename ContextT>
inline bool
pp_iterator_functor<ContextT>::interpret_pragma(
token_sequence_type const &pragma_body, token_sequence_type &result)
@@ -2498,7 +2510,7 @@ pp_iterator_functor<ContextT>::interpret_pragma(
typename token_sequence_type::const_iterator end = pragma_body.end();
typename token_sequence_type::const_iterator it = pragma_body.begin();
- for (++it; it != end && IS_CATEGORY(*it, WhiteSpaceTokenType); ++it)
+ for (++it; it != end && IS_CATEGORY(*it, WhiteSpaceTokenType); ++it)
/**/; // skip whitespace
if (it == end) // eof reached
@@ -2512,16 +2524,16 @@ pp_iterator_functor<ContextT>::interpret_pragma(
} // namespace impl
///////////////////////////////////////////////////////////////////////////////
-//
+//
// pp_iterator
//
// The boost::wave::pp_iterator template is the iterator, through which
// the resulting preprocessed input stream is accessible.
-//
+//
///////////////////////////////////////////////////////////////////////////////
template <typename ContextT>
-class pp_iterator
+class pp_iterator
: public boost::spirit::classic::multi_pass<
boost::wave::impl::pp_iterator_functor<ContextT>,
boost::wave::util::functor_input
@@ -2531,14 +2543,14 @@ public:
typedef boost::wave::impl::pp_iterator_functor<ContextT> input_policy_type;
private:
- typedef
+ typedef
boost::spirit::classic::multi_pass<input_policy_type, boost::wave::util::functor_input>
base_type;
typedef pp_iterator<ContextT> self_type;
typedef boost::wave::util::functor_input functor_input_type;
public:
- pp_iterator()
+ pp_iterator()
{}
template <typename IteratorT>
@@ -2548,9 +2560,9 @@ public:
{}
bool force_include(char const *path_, bool is_last)
- {
- bool result = this->get_functor().on_include_helper(path_, path_,
- false, false);
+ {
+ bool result = this->get_functor().on_include_helper(path_, path_,
+ false, false);
if (is_last) {
this->functor_input_type::
template inner<input_policy_type>::advance_input();
diff --git a/boost/wave/util/cpp_macromap.hpp b/boost/wave/util/cpp_macromap.hpp
index 8b155b83af..fb251ea105 100644
--- a/boost/wave/util/cpp_macromap.hpp
+++ b/boost/wave/util/cpp_macromap.hpp
@@ -2,10 +2,10 @@
Boost.Wave: A Standard compliant C++ preprocessor library
Macro expansion engine
-
+
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
@@ -58,9 +58,9 @@ namespace boost { namespace wave { namespace util {
///////////////////////////////////////////////////////////////////////////////
//
// macromap
-//
-// This class holds all currently defined macros and on demand expands
-// those macro definitions
+//
+// This class holds all currently defined macros and on demand expands
+// those macro definitions
//
///////////////////////////////////////////////////////////////////////////////
template <typename ContextT>
@@ -74,16 +74,16 @@ class macromap {
typedef typename ContextT::token_sequence_type definition_container_type;
typedef std::vector<token_type> parameter_container_type;
- typedef macro_definition<token_type, definition_container_type>
+ typedef macro_definition<token_type, definition_container_type>
macro_definition_type;
- typedef symbol_table<string_type, macro_definition_type>
+ typedef symbol_table<string_type, macro_definition_type>
defined_macros_type;
- typedef typename defined_macros_type::value_type::second_type
+ typedef typename defined_macros_type::value_type::second_type
macro_ref_type;
public:
- macromap(ContextT &ctx_)
- : current_macros(0), defined_macros(new defined_macros_type(1)),
+ macromap(ContextT &ctx_)
+ : current_macros(0), defined_macros(new defined_macros_type(1)),
main_pos("", 0), ctx(ctx_), macro_uid(1)
{
current_macros = defined_macros.get();
@@ -91,14 +91,14 @@ public:
~macromap() {}
// Add a new macro to the given macro scope
- bool add_macro(token_type const &name, bool has_parameters,
- parameter_container_type &parameters,
- definition_container_type &definition, bool is_predefined = false,
+ bool add_macro(token_type const &name, bool has_parameters,
+ parameter_container_type &parameters,
+ definition_container_type &definition, bool is_predefined = false,
defined_macros_type *scope = 0);
// Tests, whether the given macro name is defined in the given macro scope
- bool is_defined(string_type const &name,
- typename defined_macros_type::iterator &it,
+ bool is_defined(string_type const &name,
+ typename defined_macros_type::iterator &it,
defined_macros_type *scope = 0) const;
// expects a token sequence as its parameters
@@ -109,31 +109,31 @@ public:
bool is_defined(string_type const &str) const;
// Get the macro definition for the given macro scope
- bool get_macro(string_type const &name, bool &has_parameters,
- bool &is_predefined, position_type &pos,
- parameter_container_type &parameters,
- definition_container_type &definition,
+ bool get_macro(string_type const &name, bool &has_parameters,
+ bool &is_predefined, position_type &pos,
+ parameter_container_type &parameters,
+ definition_container_type &definition,
defined_macros_type *scope = 0) const;
// Remove a macro name from the given macro scope
- bool remove_macro(string_type const &name, position_type const& pos,
+ bool remove_macro(string_type const &name, position_type const& pos,
bool even_predefined = false);
template <typename IteratorT, typename ContainerT>
- token_type const &expand_tokensequence(IteratorT &first,
- IteratorT const &last, ContainerT &pending, ContainerT &expanded,
+ token_type const &expand_tokensequence(IteratorT &first,
+ IteratorT const &last, ContainerT &pending, ContainerT &expanded,
bool& seen_newline, bool expand_operator_defined);
// Expand all macros inside the given token sequence
template <typename IteratorT, typename ContainerT>
- void expand_whole_tokensequence(ContainerT &expanded,
- IteratorT &first, IteratorT const &last,
+ void expand_whole_tokensequence(ContainerT &expanded,
+ IteratorT &first, IteratorT const &last,
bool expand_operator_defined);
// Init the predefined macros (add them to the given scope)
- void init_predefined_macros(char const *fname = "<Unknown>",
+ void init_predefined_macros(char const *fname = "<Unknown>",
defined_macros_type *scope = 0, bool at_global_scope = true);
- void predefine_macro(defined_macros_type *scope, string_type const &name,
+ void predefine_macro(defined_macros_type *scope, string_type const &name,
token_type const &t);
// Init the internal macro symbol namespace
@@ -146,9 +146,9 @@ public:
typedef typename defined_macros_type::name_iterator name_iterator;
typedef typename defined_macros_type::const_name_iterator const_name_iterator;
- name_iterator begin()
+ name_iterator begin()
{ return defined_macros_type::make_iterator(current_macros->begin()); }
- name_iterator end()
+ name_iterator end()
{ return defined_macros_type::make_iterator(current_macros->end()); }
const_name_iterator begin() const
{ return defined_macros_type::make_iterator(current_macros->begin()); }
@@ -158,43 +158,43 @@ public:
protected:
// Helper functions for expanding all macros in token sequences
template <typename IteratorT, typename ContainerT>
- token_type const &expand_tokensequence_worker(ContainerT &pending,
- unput_queue_iterator<IteratorT, token_type, ContainerT> &first,
- unput_queue_iterator<IteratorT, token_type, ContainerT> const &last,
+ token_type const &expand_tokensequence_worker(ContainerT &pending,
+ unput_queue_iterator<IteratorT, token_type, ContainerT> &first,
+ unput_queue_iterator<IteratorT, token_type, ContainerT> const &last,
bool& seen_newline, bool expand_operator_defined);
// Collect all arguments supplied to a macro invocation
#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0
template <typename IteratorT, typename ContainerT, typename SizeT>
typename std::vector<ContainerT>::size_type collect_arguments (
- token_type const curr_token, std::vector<ContainerT> &arguments,
+ token_type const curr_token, std::vector<ContainerT> &arguments,
IteratorT &next, IteratorT const &end, SizeT const &parameter_count,
bool& seen_newline);
#else
template <typename IteratorT, typename ContainerT, typename SizeT>
typename std::vector<ContainerT>::size_type collect_arguments (
- token_type const curr_token, std::vector<ContainerT> &arguments,
- IteratorT &next, IteratorT &endparen, IteratorT const &end,
+ token_type const curr_token, std::vector<ContainerT> &arguments,
+ IteratorT &next, IteratorT &endparen, IteratorT const &end,
SizeT const &parameter_count, bool& seen_newline);
#endif
// Expand a single macro name
template <typename IteratorT, typename ContainerT>
- bool expand_macro(ContainerT &pending, token_type const &name,
- typename defined_macros_type::iterator it,
- IteratorT &first, IteratorT const &last,
+ bool expand_macro(ContainerT &pending, token_type const &name,
+ typename defined_macros_type::iterator it,
+ IteratorT &first, IteratorT const &last,
bool& seen_newline, bool expand_operator_defined,
defined_macros_type *scope = 0, ContainerT *queue_symbol = 0);
// Expand a predefined macro (__LINE__, __FILE__ and __INCLUDE_LEVEL__)
template <typename ContainerT>
- bool expand_predefined_macro(token_type const &curr_token,
+ bool expand_predefined_macro(token_type const &curr_token,
ContainerT &expanded);
// Expand a single macro argument
template <typename ContainerT>
void expand_argument (typename std::vector<ContainerT>::size_type arg,
- std::vector<ContainerT> &arguments,
+ std::vector<ContainerT> &arguments,
std::vector<ContainerT> &expanded_args, bool expand_operator_defined,
std::vector<bool> &has_expanded_args);
@@ -202,13 +202,13 @@ protected:
template <typename ContainerT>
void expand_replacement_list(
macro_definition_type const &macrodefinition,
- std::vector<ContainerT> &arguments,
+ std::vector<ContainerT> &arguments,
bool expand_operator_defined, ContainerT &expanded);
// Rescans the replacement list for macro expansion
template <typename IteratorT, typename ContainerT>
- void rescan_replacement_list(token_type const &curr_token,
- macro_definition_type &macrodef, ContainerT &replacement_list,
+ void rescan_replacement_list(token_type const &curr_token,
+ macro_definition_type &macrodef, ContainerT &replacement_list,
ContainerT &expanded, bool expand_operator_defined,
IteratorT &nfirst, IteratorT const &nlast);
@@ -219,15 +219,15 @@ protected:
// Resolve operator _Pragma or the #pragma directive
template <typename IteratorT, typename ContainerT>
- bool resolve_operator_pragma(IteratorT &first,
+ bool resolve_operator_pragma(IteratorT &first,
IteratorT const &last, ContainerT &expanded, bool& seen_newline);
-// Handle the concatenation operator '##'
+// Handle the concatenation operator '##'
template <typename ContainerT>
bool concat_tokensequence(ContainerT &expanded);
template <typename ContainerT>
- bool is_valid_concat(string_type new_value,
+ bool is_valid_concat(string_type new_value,
position_type const &pos, ContainerT &rescanned);
#if BOOST_WAVE_SERIALIZATION != 0
@@ -248,7 +248,7 @@ private:
{
using namespace boost::serialization;
if (version != (loaded_version & ~version_mask)) {
- BOOST_WAVE_THROW(preprocess_exception, incompatible_config,
+ BOOST_WAVE_THROW(preprocess_exception, incompatible_config,
"cpp_context state version", get_main_pos());
}
ar & make_nvp("defined_macros", defined_macros);
@@ -271,35 +271,35 @@ private:
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
-//
+//
// add_macro(): adds a new macro to the macromap
//
///////////////////////////////////////////////////////////////////////////////
template <typename ContextT>
-inline bool
-macromap<ContextT>::add_macro(token_type const &name, bool has_parameters,
- parameter_container_type &parameters, definition_container_type &definition,
+inline bool
+macromap<ContextT>::add_macro(token_type const &name, bool has_parameters,
+ parameter_container_type &parameters, definition_container_type &definition,
bool is_predefined, defined_macros_type *scope)
{
if (!is_predefined && impl::is_special_macroname (name.get_value())) {
// exclude special macro names
- BOOST_WAVE_THROW_NAME_CTX(ctx, macro_handling_exception,
- illegal_redefinition, name.get_value().c_str(), main_pos,
+ BOOST_WAVE_THROW_NAME_CTX(ctx, macro_handling_exception,
+ illegal_redefinition, name.get_value().c_str(), main_pos,
name.get_value().c_str());
return false;
}
- if (boost::wave::need_variadics(ctx.get_language()) &&
- "__VA_ARGS__" == name.get_value())
+ if (boost::wave::need_variadics(ctx.get_language()) &&
+ "__VA_ARGS__" == name.get_value())
{
// can't use __VA_ARGS__ as a macro name
- BOOST_WAVE_THROW_NAME_CTX(ctx, macro_handling_exception,
- bad_define_statement_va_args, name.get_value().c_str(), main_pos,
+ BOOST_WAVE_THROW_NAME_CTX(ctx, macro_handling_exception,
+ bad_define_statement_va_args, name.get_value().c_str(), main_pos,
name.get_value().c_str());
return false;
}
if (AltExtTokenType == (token_id(name) & ExtTokenOnlyMask)) {
// exclude special operator names
- BOOST_WAVE_THROW_NAME_CTX(ctx, macro_handling_exception,
+ BOOST_WAVE_THROW_NAME_CTX(ctx, macro_handling_exception,
illegal_operator_redefinition, name.get_value().c_str(), main_pos,
name.get_value().c_str());
return false;
@@ -316,8 +316,8 @@ typename defined_macros_type::iterator it = current_scope->find(name.get_value()
!impl::parameters_equal(macrodef->macroparameters, parameters) ||
!impl::definition_equals(macrodef->macrodefinition, definition))
{
- BOOST_WAVE_THROW_NAME_CTX(ctx, macro_handling_exception,
- macro_redefinition, name.get_value().c_str(), main_pos,
+ BOOST_WAVE_THROW_NAME_CTX(ctx, macro_handling_exception,
+ macro_redefinition, name.get_value().c_str(), main_pos,
name.get_value().c_str());
}
return false;
@@ -327,20 +327,20 @@ typename defined_macros_type::iterator it = current_scope->find(name.get_value()
if (has_parameters) {
std::set<typename token_type::string_type> names;
- typedef typename parameter_container_type::iterator
+ typedef typename parameter_container_type::iterator
parameter_iterator_type;
- typedef typename std::set<typename token_type::string_type>::iterator
+ typedef typename std::set<typename token_type::string_type>::iterator
name_iterator_type;
parameter_iterator_type end = parameters.end();
- for (parameter_iterator_type itp = parameters.begin(); itp != end; ++itp)
+ for (parameter_iterator_type itp = parameters.begin(); itp != end; ++itp)
{
name_iterator_type pit = names.find((*itp).get_value());
if (pit != names.end()) {
// duplicate parameter name
- BOOST_WAVE_THROW_NAME_CTX(ctx, macro_handling_exception,
- duplicate_parameter_name, (*pit).c_str(), main_pos,
+ BOOST_WAVE_THROW_NAME_CTX(ctx, macro_handling_exception,
+ duplicate_parameter_name, (*pit).c_str(), main_pos,
name.get_value().c_str());
return false;
}
@@ -349,19 +349,19 @@ typename defined_macros_type::iterator it = current_scope->find(name.get_value()
}
// insert a new macro node
- std::pair<typename defined_macros_type::iterator, bool> p =
+ std::pair<typename defined_macros_type::iterator, bool> p =
current_scope->insert(
typename defined_macros_type::value_type(
- name.get_value(),
- macro_ref_type(new macro_definition_type(name,
+ name.get_value(),
+ macro_ref_type(new macro_definition_type(name,
has_parameters, is_predefined, ++macro_uid)
)
)
);
if (!p.second) {
- BOOST_WAVE_THROW_NAME_CTX(ctx, macro_handling_exception,
- macro_insertion_error, name.get_value().c_str(), main_pos,
+ BOOST_WAVE_THROW_NAME_CTX(ctx, macro_handling_exception,
+ macro_insertion_error, name.get_value().c_str(), main_pos,
name.get_value().c_str());
return false;
}
@@ -372,26 +372,26 @@ typename defined_macros_type::iterator it = current_scope->find(name.get_value()
// call the context supplied preprocessing hook
#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0
- ctx.get_hooks().defined_macro(name, has_parameters,
- (*p.first).second->macroparameters,
+ ctx.get_hooks().defined_macro(name, has_parameters,
+ (*p.first).second->macroparameters,
(*p.first).second->macrodefinition, is_predefined);
#else
- ctx.get_hooks().defined_macro(ctx.derived(), name, has_parameters,
- (*p.first).second->macroparameters,
+ ctx.get_hooks().defined_macro(ctx.derived(), name, has_parameters,
+ (*p.first).second->macroparameters,
(*p.first).second->macrodefinition, is_predefined);
#endif
return true;
}
///////////////////////////////////////////////////////////////////////////////
-//
+//
// is_defined(): returns, whether a given macro is already defined
//
///////////////////////////////////////////////////////////////////////////////
template <typename ContextT>
-inline bool
+inline bool
macromap<ContextT>::is_defined(typename token_type::string_type const &name,
- typename defined_macros_type::iterator &it,
+ typename defined_macros_type::iterator &it,
defined_macros_type *scope) const
{
if (0 == scope) scope = current_macros;
@@ -403,27 +403,27 @@ macromap<ContextT>::is_defined(typename token_type::string_type const &name,
if (name.size() < 8 || '_' != name[0] || '_' != name[1])
return false; // quick check failed
- return name == "__LINE__" || name == "__FILE__" ||
+ return name == "__LINE__" || name == "__FILE__" ||
name == "__INCLUDE_LEVEL__";
}
template <typename ContextT>
template <typename IteratorT>
-inline bool
-macromap<ContextT>::is_defined(IteratorT const &begin,
+inline bool
+macromap<ContextT>::is_defined(IteratorT const &begin,
IteratorT const &end) const
{
// in normal mode the name under inspection should consist of an identifier
// only
token_id id = token_id(*begin);
- if (T_IDENTIFIER != id &&
+ if (T_IDENTIFIER != id &&
!IS_CATEGORY(id, KeywordTokenType) &&
!IS_EXTCATEGORY(id, OperatorTokenType|AltExtTokenType) &&
- !IS_CATEGORY(id, BoolLiteralTokenType))
+ !IS_CATEGORY(id, BoolLiteralTokenType))
{
std::string msg(impl::get_full_name(begin, end));
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, invalid_macroname,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, invalid_macroname,
msg.c_str(), main_pos);
return false;
}
@@ -435,7 +435,7 @@ typename defined_macros_type::iterator cit;
if (++it != end) {
// there should be only one token as the inspected name
std::string msg(impl::get_full_name(begin, end));
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, invalid_macroname,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, invalid_macroname,
msg.c_str(), main_pos);
return false;
}
@@ -445,24 +445,24 @@ typename defined_macros_type::iterator cit;
///////////////////////////////////////////////////////////////////////////////
// same as above, only takes an arbitrary string type as its parameter
template <typename ContextT>
-inline bool
+inline bool
macromap<ContextT>::is_defined(string_type const &str) const
{
typename defined_macros_type::iterator cit;
- return is_defined(str, cit, 0);
+ return is_defined(str, cit, 0);
}
///////////////////////////////////////////////////////////////////////////////
-//
+//
// Get the macro definition for the given macro scope
//
///////////////////////////////////////////////////////////////////////////////
template <typename ContextT>
-inline bool
-macromap<ContextT>::get_macro(string_type const &name, bool &has_parameters,
- bool &is_predefined, position_type &pos,
- parameter_container_type &parameters,
- definition_container_type &definition,
+inline bool
+macromap<ContextT>::get_macro(string_type const &name, bool &has_parameters,
+ bool &is_predefined, position_type &pos,
+ parameter_container_type &parameters,
+ definition_container_type &definition,
defined_macros_type *scope) const
{
typename defined_macros_type::iterator it;
@@ -480,21 +480,21 @@ macro_definition_type &macro_def = *(*it).second.get();
}
///////////////////////////////////////////////////////////////////////////////
-//
+//
// remove_macro(): remove a macro from the macromap
//
///////////////////////////////////////////////////////////////////////////////
template <typename ContextT>
-inline bool
-macromap<ContextT>::remove_macro(string_type const &name,
+inline bool
+macromap<ContextT>::remove_macro(string_type const &name,
position_type const& pos, bool even_predefined)
{
typename defined_macros_type::iterator it = current_macros->find(name);
-
+
if (it != current_macros->end()) {
if ((*it).second->is_predefined) {
if (!even_predefined || impl::is_special_macroname(name)) {
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
bad_undefine_statement, name.c_str(), main_pos);
return false;
}
@@ -512,32 +512,32 @@ macromap<ContextT>::remove_macro(string_type const &name,
return true;
}
else if (impl::is_special_macroname(name)) {
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, bad_undefine_statement,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, bad_undefine_statement,
name.c_str(), pos);
}
return false; // macro was not defined
}
///////////////////////////////////////////////////////////////////////////////
-//
+//
// expand_tokensequence
//
-// This function is a helper function which wraps the given iterator
+// This function is a helper function which wraps the given iterator
// range into corresponding unput_iterator's and calls the main workhorse
// of the macro expansion engine (the function expand_tokensequence_worker)
//
-// This is the top level macro expansion function called from the
+// This is the top level macro expansion function called from the
// preprocessing iterator component only.
//
///////////////////////////////////////////////////////////////////////////////
template <typename ContextT>
template <typename IteratorT, typename ContainerT>
inline typename ContextT::token_type const &
-macromap<ContextT>::expand_tokensequence(IteratorT &first,
- IteratorT const &last, ContainerT &pending, ContainerT &expanded,
+macromap<ContextT>::expand_tokensequence(IteratorT &first,
+ IteratorT const &last, ContainerT &pending, ContainerT &expanded,
bool& seen_newline, bool expand_operator_defined)
{
- typedef impl::gen_unput_queue_iterator<IteratorT, token_type, ContainerT>
+ typedef impl::gen_unput_queue_iterator<IteratorT, token_type, ContainerT>
gen_type;
typedef typename gen_type::return_type iterator_type;
@@ -546,7 +546,7 @@ macromap<ContextT>::expand_tokensequence(IteratorT &first,
on_exit::assign<IteratorT, iterator_type> on_exit(first, first_it);
- return expand_tokensequence_worker(pending, first_it, last_it,
+ return expand_tokensequence_worker(pending, first_it, last_it,
seen_newline, expand_operator_defined);
}
@@ -555,8 +555,8 @@ on_exit::assign<IteratorT, iterator_type> on_exit(first, first_it);
// expand_tokensequence_worker
//
// This function is the main workhorse of the macro expansion engine. It
-// expands as much tokens as needed to identify the next preprocessed
-// token to return to the caller.
+// expands as much tokens as needed to identify the next preprocessed
+// token to return to the caller.
// It returns the next preprocessed token.
//
// The iterator 'first' is adjusted accordingly.
@@ -566,9 +566,9 @@ template <typename ContextT>
template <typename IteratorT, typename ContainerT>
inline typename ContextT::token_type const &
macromap<ContextT>::expand_tokensequence_worker(
- ContainerT &pending,
- unput_queue_iterator<IteratorT, token_type, ContainerT> &first,
- unput_queue_iterator<IteratorT, token_type, ContainerT> const &last,
+ ContainerT &pending,
+ unput_queue_iterator<IteratorT, token_type, ContainerT> &first,
+ unput_queue_iterator<IteratorT, token_type, ContainerT> const &last,
bool& seen_newline, bool expand_operator_defined)
{
// if there exist pending tokens (tokens, which are already preprocessed), then
@@ -579,7 +579,7 @@ macromap<ContextT>::expand_tokensequence_worker(
return act_token = pending.front();
}
-// analyze the next element of the given sequence, if it is an
+// analyze the next element of the given sequence, if it is an
// T_IDENTIFIER token, try to replace this as a macro etc.
using namespace boost::wave;
typedef unput_queue_iterator<IteratorT, token_type, ContainerT> iterator_type;
@@ -599,23 +599,23 @@ macromap<ContextT>::expand_tokensequence_worker(
if (T_IDENTIFIER == id || IS_CATEGORY(id, KeywordTokenType) ||
IS_EXTCATEGORY(id, OperatorTokenType|AltExtTokenType) ||
- IS_CATEGORY(id, BoolLiteralTokenType))
+ IS_CATEGORY(id, BoolLiteralTokenType))
{
// try to replace this identifier as a macro
if (expand_operator_defined && (*first).get_value() == "defined") {
// resolve operator defined()
return resolve_defined(first, last, pending);
}
- else if (boost::wave::need_variadics(ctx.get_language()) &&
- (*first).get_value() == "_Pragma")
+ else if (boost::wave::need_variadics(ctx.get_language()) &&
+ (*first).get_value() == "_Pragma")
{
// in C99 mode only: resolve the operator _Pragma
token_type curr_token = *first;
if (!resolve_operator_pragma(first, last, pending, seen_newline) ||
- pending.size() > 0)
+ pending.size() > 0)
{
- // unknown to us pragma or supplied replacement, return the
+ // unknown to us pragma or supplied replacement, return the
// next token
on_exit::pop_front<definition_container_type> pop_token(pending);
@@ -623,7 +623,7 @@ macromap<ContextT>::expand_tokensequence_worker(
}
// the operator _Pragma() was eaten completely, continue
- return act_token = token_type(T_PLACEHOLDER, "_",
+ return act_token = token_type(T_PLACEHOLDER, "_",
curr_token.get_position());
}
@@ -631,10 +631,10 @@ macromap<ContextT>::expand_tokensequence_worker(
typename defined_macros_type::iterator it;
if (is_defined(name_token.get_value(), it)) {
- // the current token contains an identifier, which is currently
+ // the current token contains an identifier, which is currently
// defined as a macro
- if (expand_macro(pending, name_token, it, first, last,
- seen_newline, expand_operator_defined))
+ if (expand_macro(pending, name_token, it, first, last,
+ seen_newline, expand_operator_defined))
{
// the tokens returned by expand_macro should be rescanned
// beginning at the last token of the returned replacement list
@@ -652,7 +652,7 @@ macromap<ContextT>::expand_tokensequence_worker(
else if (!pending.empty()) {
// return the first token from the pending queue
on_exit::pop_front<definition_container_type> pop_queue (pending);
-
+
return act_token = pending.front();
}
else {
@@ -661,13 +661,13 @@ macromap<ContextT>::expand_tokensequence_worker(
}
// return the next preprocessed token
- return expand_tokensequence_worker(pending, first, last,
+ return expand_tokensequence_worker(pending, first, last,
seen_newline, expand_operator_defined);
}
// else if (expand_operator_defined) {
-// // in preprocessing conditionals undefined identifiers and keywords
+// // in preprocessing conditionals undefined identifiers and keywords
// // are to be replaced with '0' (see. C++ standard 16.1.4, [cpp.cond])
-// return act_token =
+// return act_token =
// token_type(T_INTLIT, "0", (*first++).get_position());
// }
else {
@@ -678,11 +678,11 @@ macromap<ContextT>::expand_tokensequence_worker(
}
else if (expand_operator_defined && IS_CATEGORY(*first, BoolLiteralTokenType)) {
// expanding a constant expression inside #if/#elif, special handling
- // of 'true' and 'false'
+ // of 'true' and 'false'
- // all remaining identifiers and keywords, except for true and false,
+ // all remaining identifiers and keywords, except for true and false,
// are replaced with the pp-number 0 (C++ standard 16.1.4, [cpp.cond])
- return act_token = token_type(T_INTLIT, T_TRUE != id ? "0" : "1",
+ return act_token = token_type(T_INTLIT, T_TRUE != id ? "0" : "1",
(*first++).get_position());
}
else {
@@ -695,7 +695,7 @@ macromap<ContextT>::expand_tokensequence_worker(
}
///////////////////////////////////////////////////////////////////////////////
-//
+//
// collect_arguments(): collect the actual arguments of a macro invocation
//
// return the number of successfully detected non-empty arguments
@@ -704,15 +704,15 @@ macromap<ContextT>::expand_tokensequence_worker(
#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0
template <typename ContextT>
template <typename IteratorT, typename ContainerT, typename SizeT>
-inline typename std::vector<ContainerT>::size_type
-macromap<ContextT>::collect_arguments (token_type const curr_token,
- std::vector<ContainerT> &arguments, IteratorT &next,
+inline typename std::vector<ContainerT>::size_type
+macromap<ContextT>::collect_arguments (token_type const curr_token,
+ std::vector<ContainerT> &arguments, IteratorT &next,
IteratorT const &end, SizeT const &parameter_count, bool& seen_newline)
#else
template <typename ContextT>
template <typename IteratorT, typename ContainerT, typename SizeT>
-inline typename std::vector<ContainerT>::size_type
-macromap<ContextT>::collect_arguments (token_type const curr_token,
+inline typename std::vector<ContainerT>::size_type
+macromap<ContextT>::collect_arguments (token_type const curr_token,
std::vector<ContainerT> &arguments, IteratorT &next, IteratorT &endparen,
IteratorT const &end, SizeT const &parameter_count, bool& seen_newline)
#endif
@@ -731,13 +731,13 @@ token_type startof_argument_list = *next;
while (++next != end && nested_parenthesis_level) {
token_id id = token_id(*next);
- if (0 == parameter_count &&
+ if (0 == parameter_count &&
!IS_CATEGORY((*next), WhiteSpaceTokenType) && id != T_NEWLINE &&
- id != T_RIGHTPAREN && id != T_LEFTPAREN)
+ id != T_RIGHTPAREN && id != T_LEFTPAREN)
{
// there shouldn't be any arguments
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
- too_many_macroarguments, curr_token.get_value().c_str(),
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
+ too_many_macroarguments, curr_token.get_value().c_str(),
main_pos);
return 0;
}
@@ -760,13 +760,13 @@ token_type startof_argument_list = *next;
endparen = next;
#endif
if (parameter_count > 0) {
- if (argument->empty() ||
- impl::is_whitespace_only(*argument))
+ if (argument->empty() ||
+ impl::is_whitespace_only(*argument))
{
#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
if (boost::wave::need_variadics(ctx.get_language())) {
// store a placemarker as the argument
- argument->push_back(token_type(T_PLACEMARKER, "\xA7",
+ argument->push_back(token_type(T_PLACEMARKER, "\xA7",
(*next).get_position()));
++count_arguments;
}
@@ -785,13 +785,13 @@ token_type startof_argument_list = *next;
if (1 == nested_parenthesis_level) {
// next parameter
// trim_sequence(argument);
- if (argument->empty() ||
- impl::is_whitespace_only(*argument))
+ if (argument->empty() ||
+ impl::is_whitespace_only(*argument))
{
#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
if (boost::wave::need_variadics(ctx.get_language())) {
// store a placemarker as the argument
- argument->push_back(token_type(T_PLACEMARKER, "\xA7",
+ argument->push_back(token_type(T_PLACEMARKER, "\xA7",
(*next).get_position()));
++count_arguments;
}
@@ -816,7 +816,7 @@ token_type startof_argument_list = *next;
case T_SPACE:
case T_SPACE2:
case T_CCOMMENT:
- if (!was_whitespace)
+ if (!was_whitespace)
argument->push_back(token_type(T_SPACE, " ", (*next).get_position()));
was_whitespace = true;
break; // skip whitespace
@@ -833,12 +833,12 @@ token_type startof_argument_list = *next;
if (nested_parenthesis_level >= 1) {
// missing ')': improperly terminated macro invocation
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
improperly_terminated_macro, "missing ')'", main_pos);
return 0;
}
-// if no argument was expected and we didn't find any, than remove the empty
+// if no argument was expected and we didn't find any, than remove the empty
// element
if (0 == parameter_count && 0 == count_arguments) {
BOOST_ASSERT(1 == arguments.size());
@@ -848,20 +848,20 @@ token_type startof_argument_list = *next;
}
///////////////////////////////////////////////////////////////////////////////
-//
+//
// expand_whole_tokensequence
//
-// fully expands a given token sequence
+// fully expands a given token sequence
//
///////////////////////////////////////////////////////////////////////////////
template <typename ContextT>
template <typename IteratorT, typename ContainerT>
inline void
-macromap<ContextT>::expand_whole_tokensequence(ContainerT &expanded,
- IteratorT &first, IteratorT const &last,
+macromap<ContextT>::expand_whole_tokensequence(ContainerT &expanded,
+ IteratorT &first, IteratorT const &last,
bool expand_operator_defined)
{
- typedef impl::gen_unput_queue_iterator<IteratorT, token_type, ContainerT>
+ typedef impl::gen_unput_queue_iterator<IteratorT, token_type, ContainerT>
gen_type;
typedef typename gen_type::return_type iterator_type;
@@ -875,7 +875,7 @@ macromap<ContextT>::expand_whole_tokensequence(ContainerT &expanded,
while (!pending_queue.empty() || first_it != last_it) {
expanded.push_back(
- expand_tokensequence_worker(pending_queue, first_it,
+ expand_tokensequence_worker(pending_queue, first_it,
last_it, seen_newline, expand_operator_defined)
);
}
@@ -885,23 +885,23 @@ macromap<ContextT>::expand_whole_tokensequence(ContainerT &expanded,
}
///////////////////////////////////////////////////////////////////////////////
-//
+//
// expand_argument
//
-// fully expands the given argument of a macro call
+// fully expands the given argument of a macro call
//
///////////////////////////////////////////////////////////////////////////////
template <typename ContextT>
template <typename ContainerT>
-inline void
+inline void
macromap<ContextT>::expand_argument (
- typename std::vector<ContainerT>::size_type arg,
- std::vector<ContainerT> &arguments, std::vector<ContainerT> &expanded_args,
+ typename std::vector<ContainerT>::size_type arg,
+ std::vector<ContainerT> &arguments, std::vector<ContainerT> &expanded_args,
bool expand_operator_defined, std::vector<bool> &has_expanded_args)
{
if (!has_expanded_args[arg]) {
// expand the argument only once
- typedef typename std::vector<ContainerT>::value_type::iterator
+ typedef typename std::vector<ContainerT>::value_type::iterator
argument_iterator_type;
argument_iterator_type begin_it = arguments[arg].begin();
@@ -915,10 +915,10 @@ macromap<ContextT>::expand_argument (
}
///////////////////////////////////////////////////////////////////////////////
-//
+//
// expand_replacement_list
//
-// fully expands the replacement list of a given macro with the
+// fully expands the replacement list of a given macro with the
// actual arguments/expanded arguments
// handles the '#' [cpp.stringize] and the '##' [cpp.concat] operator
//
@@ -928,11 +928,11 @@ template <typename ContainerT>
inline void
macromap<ContextT>::expand_replacement_list(
macro_definition_type const &macrodef,
- std::vector<ContainerT> &arguments, bool expand_operator_defined,
+ std::vector<ContainerT> &arguments, bool expand_operator_defined,
ContainerT &expanded)
{
using namespace boost::wave;
- typedef typename macro_definition_type::const_definition_iterator_t
+ typedef typename macro_definition_type::const_definition_iterator_t
macro_definition_iter_t;
std::vector<ContainerT> expanded_args(arguments.size());
@@ -947,7 +947,7 @@ bool adjacent_stringize = false;
{
bool use_replaced_arg = true;
token_id base_id = BASE_TOKEN(token_id(*cit));
-
+
if (T_POUND_POUND == base_id) {
// concatenation operator
adjacent_concat = true;
@@ -958,7 +958,7 @@ bool adjacent_stringize = false;
adjacent_stringize = true;
}
else {
- if (adjacent_stringize || adjacent_concat ||
+ if (adjacent_stringize || adjacent_concat ||
T_POUND_POUND == impl::next_token<macro_definition_iter_t>
::peek(cit, cend))
{
@@ -978,8 +978,8 @@ bool adjacent_stringize = false;
BOOST_ASSERT(boost::wave::need_variadics(ctx.get_language()));
i = token_id(*cit) - T_EXTPARAMETERBASE;
is_ellipsis = true;
- }
- else
+ }
+ else
#endif
{
i = token_id(*cit) - T_PARAMETERBASE;
@@ -995,30 +995,30 @@ bool adjacent_stringize = false;
BOOST_ASSERT(boost::wave::need_variadics(ctx.get_language()));
// ensure all variadic arguments to be expanded
- for (typename vector<ContainerT>::size_type arg = i;
+ for (typename vector<ContainerT>::size_type arg = i;
arg < expanded_args.size(); ++arg)
{
- expand_argument(arg, arguments, expanded_args,
+ expand_argument(arg, arguments, expanded_args,
expand_operator_defined, has_expanded_args);
}
impl::replace_ellipsis(expanded_args, i, expanded, pos);
}
- else
+ else
#endif
{
// ensure argument i to be expanded
- expand_argument(i, arguments, expanded_args,
+ expand_argument(i, arguments, expanded_args,
expand_operator_defined, has_expanded_args);
// replace argument
ContainerT const &arg = expanded_args[i];
-
- std::copy(arg.begin(), arg.end(),
+
+ std::copy(arg.begin(), arg.end(),
std::inserter(expanded, expanded.end()));
}
}
- else if (adjacent_stringize &&
- !IS_CATEGORY(*cit, WhiteSpaceTokenType))
+ else if (adjacent_stringize &&
+ !IS_CATEGORY(*cit, WhiteSpaceTokenType))
{
// stringize the current argument
BOOST_ASSERT(!arguments[i].empty());
@@ -1030,14 +1030,14 @@ bool adjacent_stringize = false;
if (is_ellipsis && boost::wave::need_variadics(ctx.get_language())) {
impl::trim_sequence_left(arguments[i]);
impl::trim_sequence_right(arguments.back());
- expanded.push_back(token_type(T_STRINGLIT,
+ expanded.push_back(token_type(T_STRINGLIT,
impl::as_stringlit(arguments, i, pos), pos));
}
- else
-#endif
+ else
+#endif
{
impl::trim_sequence(arguments[i]);
- expanded.push_back(token_type(T_STRINGLIT,
+ expanded.push_back(token_type(T_STRINGLIT,
impl::as_stringlit(arguments[i], pos), pos));
}
adjacent_stringize = false;
@@ -1057,9 +1057,9 @@ bool adjacent_stringize = false;
#endif
{
ContainerT &arg = arguments[i];
-
+
impl::trim_sequence(arg);
- std::copy(arg.begin(), arg.end(),
+ std::copy(arg.begin(), arg.end(),
std::inserter(expanded, expanded.end()));
}
}
@@ -1086,15 +1086,15 @@ bool adjacent_stringize = false;
//
// rescan_replacement_list
//
-// As the name implies, this function is used to rescan the replacement list
+// As the name implies, this function is used to rescan the replacement list
// after the first macro substitution phase.
//
///////////////////////////////////////////////////////////////////////////////
template <typename ContextT>
template <typename IteratorT, typename ContainerT>
-inline void
-macromap<ContextT>::rescan_replacement_list(token_type const &curr_token,
- macro_definition_type &macro_def, ContainerT &replacement_list,
+inline void
+macromap<ContextT>::rescan_replacement_list(token_type const &curr_token,
+ macro_definition_type &macro_def, ContainerT &replacement_list,
ContainerT &expanded, bool expand_operator_defined,
IteratorT &nfirst, IteratorT const &nlast)
{
@@ -1126,8 +1126,8 @@ macromap<ContextT>::rescan_replacement_list(token_type const &curr_token,
typename ContainerT::iterator begin_it = replacement_list.begin();
typename ContainerT::iterator end_it = replacement_list.end();
- expand_whole_tokensequence(expanded, begin_it, end_it,
- expand_operator_defined);
+ expand_whole_tokensequence(expanded, begin_it, end_it,
+ expand_operator_defined);
// trim replacement list, leave placeholder tokens untouched
impl::trim_replacement_list(expanded);
@@ -1141,7 +1141,7 @@ macromap<ContextT>::rescan_replacement_list(token_type const &curr_token,
}
///////////////////////////////////////////////////////////////////////////////
-//
+//
// expand_macro(): expands a defined macro
//
// This functions tries to expand the macro, to which points the 'first'
@@ -1151,12 +1151,12 @@ macromap<ContextT>::rescan_replacement_list(token_type const &curr_token,
///////////////////////////////////////////////////////////////////////////////
template <typename ContextT>
template <typename IteratorT, typename ContainerT>
-inline bool
-macromap<ContextT>::expand_macro(ContainerT &expanded,
- token_type const &curr_token, typename defined_macros_type::iterator it,
- IteratorT &first, IteratorT const &last,
- bool& seen_newline, bool expand_operator_defined,
- defined_macros_type *scope, ContainerT *queue_symbol)
+inline bool
+macromap<ContextT>::expand_macro(ContainerT &expanded,
+ token_type const &curr_token, typename defined_macros_type::iterator it,
+ IteratorT &first, IteratorT const &last,
+ bool& seen_newline, bool expand_operator_defined,
+ defined_macros_type *scope, ContainerT *queue_symbol)
{
using namespace boost::wave;
@@ -1166,7 +1166,7 @@ macromap<ContextT>::expand_macro(ContainerT &expanded,
IS_CATEGORY(token_id(curr_token), KeywordTokenType) ||
IS_EXTCATEGORY(token_id(curr_token), OperatorTokenType|AltExtTokenType) ||
IS_CATEGORY(token_id(curr_token), BoolLiteralTokenType));
-
+
if (it == scope->end()) {
++first; // advance
@@ -1210,7 +1210,7 @@ macro_definition_type &macro_def = *(*it).second.get();
ContainerT replacement_list;
if (T_LEFTPAREN == impl::next_token<IteratorT>::peek(first, last)) {
- // called as a function-like macro
+ // called as a function-like macro
impl::skip_to_token(ctx, first, last, T_LEFTPAREN, seen_newline);
#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS == 0
@@ -1224,44 +1224,44 @@ ContainerT replacement_list;
// collect the arguments
std::vector<ContainerT> arguments;
#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0
- typename std::vector<ContainerT>::size_type count_args =
- collect_arguments (curr_token, arguments, first, last,
+ typename std::vector<ContainerT>::size_type count_args =
+ collect_arguments (curr_token, arguments, first, last,
macro_def.macroparameters.size(), seen_newline);
#else
- typename std::vector<ContainerT>::size_type count_args =
- collect_arguments (curr_token, arguments, first, seqend, last,
+ typename std::vector<ContainerT>::size_type count_args =
+ collect_arguments (curr_token, arguments, first, seqend, last,
macro_def.macroparameters.size(), seen_newline);
#endif
// verify the parameter count
if (count_args < macro_def.macroparameters.size() ||
- arguments.size() < macro_def.macroparameters.size())
+ arguments.size() < macro_def.macroparameters.size())
{
if (count_args != arguments.size()) {
// must been at least one empty argument in C++ mode
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
- empty_macroarguments, curr_token.get_value().c_str(),
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
+ empty_macroarguments, curr_token.get_value().c_str(),
main_pos);
}
else {
// too few macro arguments
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
- too_few_macroarguments, curr_token.get_value().c_str(),
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
+ too_few_macroarguments, curr_token.get_value().c_str(),
main_pos);
}
return false;
}
if (count_args > macro_def.macroparameters.size() ||
- arguments.size() > macro_def.macroparameters.size())
+ arguments.size() > macro_def.macroparameters.size())
{
#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
- if (!macro_def.has_ellipsis)
-#endif
+ if (!macro_def.has_ellipsis)
+#endif
{
// too many macro arguments
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
- too_many_macroarguments,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
+ too_many_macroarguments,
curr_token.get_value().c_str(), main_pos);
return false;
}
@@ -1270,18 +1270,22 @@ ContainerT replacement_list;
// inject tracing support
#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0
ctx.get_hooks().expanding_function_like_macro(
- macro_def.macroname, macro_def.macroparameters,
+ macro_def.macroname, macro_def.macroparameters,
macro_def.macrodefinition, curr_token, arguments);
#else
- if (ctx.get_hooks().expanding_function_like_macro(ctx.derived(),
- macro_def.macroname, macro_def.macroparameters,
+ if (ctx.get_hooks().expanding_function_like_macro(ctx.derived(),
+ macro_def.macroname, macro_def.macroparameters,
macro_def.macrodefinition, curr_token, arguments,
seqstart, seqend))
{
- // do not expand this macro, just copy the whole sequence
+// // do not expand this macro, just copy the whole sequence
+// expanded.push_back(curr_token);
+// std::copy(seqstart, first,
+// std::inserter(expanded, expanded.end()));
+ // do not expand macro, just copy macro name and parenthesis
expanded.push_back(curr_token);
- std::copy(seqstart, first,
- std::inserter(expanded, expanded.end()));
+ expanded.push_back(*seqstart);
+ first = ++seqstart;
return false; // no further preprocessing required
}
#endif
@@ -1296,10 +1300,10 @@ ContainerT replacement_list;
ctx.get_hooks().expanding_object_like_macro(
macro_def.macroname, macro_def.macrodefinition, curr_token);
#else
- if (ctx.get_hooks().expanding_object_like_macro(ctx.derived(),
+ if (ctx.get_hooks().expanding_object_like_macro(ctx.derived(),
macro_def.macroname, macro_def.macrodefinition, curr_token))
{
- // do not expand this macro, just copy the whole sequence
+ // do not expand this macro, just copy the whole sequence
expanded.push_back(curr_token);
return false; // no further preprocessing required
}
@@ -1308,8 +1312,8 @@ ContainerT replacement_list;
bool found = false;
impl::find_concat_operator concat_tag(found);
- std::remove_copy_if(macro_def.macrodefinition.begin(),
- macro_def.macrodefinition.end(),
+ std::remove_copy_if(macro_def.macrodefinition.begin(),
+ macro_def.macrodefinition.end(),
std::inserter(replacement_list, replacement_list.end()),
concat_tag);
@@ -1338,10 +1342,10 @@ ContainerT replacement_list;
ctx.get_hooks().expanding_object_like_macro(
macro_def.macroname, macro_def.macrodefinition, curr_token);
#else
- if (ctx.get_hooks().expanding_object_like_macro(ctx.derived(),
+ if (ctx.get_hooks().expanding_object_like_macro(ctx.derived(),
macro_def.macroname, macro_def.macrodefinition, curr_token))
{
- // do not expand this macro, just copy the whole sequence
+ // do not expand this macro, just copy the whole sequence
expanded.push_back(curr_token);
++first; // skip macro name
return false; // no further preprocessing required
@@ -1351,15 +1355,15 @@ ContainerT replacement_list;
bool found = false;
impl::find_concat_operator concat_tag(found);
- std::remove_copy_if(macro_def.macrodefinition.begin(),
- macro_def.macrodefinition.end(),
+ std::remove_copy_if(macro_def.macrodefinition.begin(),
+ macro_def.macrodefinition.end(),
std::inserter(replacement_list, replacement_list.end()),
concat_tag);
// handle concatenation operators
if (found && !concat_tokensequence(replacement_list))
return false;
-
+
++first; // skip macro name
}
}
@@ -1373,13 +1377,13 @@ ContainerT expanded_list;
ctx.get_hooks().expanded_macro(ctx.derived(), replacement_list);
#endif
- rescan_replacement_list(curr_token, macro_def, replacement_list,
+ rescan_replacement_list(curr_token, macro_def, replacement_list,
expanded_list, expand_operator_defined, first, last);
#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0
- ctx.get_hooks().rescanned_macro(expanded_list);
+ ctx.get_hooks().rescanned_macro(expanded_list);
#else
- ctx.get_hooks().rescanned_macro(ctx.derived(), expanded_list);
+ ctx.get_hooks().rescanned_macro(ctx.derived(), expanded_list);
#endif
expanded.splice(expanded.end(), expanded_list);
return true; // rescan is required
@@ -1387,25 +1391,25 @@ ContainerT expanded_list;
///////////////////////////////////////////////////////////////////////////////
//
-// If the token under inspection points to a certain predefined macro it will
+// If the token under inspection points to a certain predefined macro it will
// be expanded, otherwise false is returned.
// (only __FILE__, __LINE__ and __INCLUDE_LEVEL__ macros are expanded here)
//
///////////////////////////////////////////////////////////////////////////////
template <typename ContextT>
template <typename ContainerT>
-inline bool
-macromap<ContextT>::expand_predefined_macro(token_type const &curr_token,
+inline bool
+macromap<ContextT>::expand_predefined_macro(token_type const &curr_token,
ContainerT &expanded)
{
using namespace boost::wave;
-
+
string_type const &value = curr_token.get_value();
if (value.size() < 8 || '_' != value[0] || '_' != value[1])
return false; // quick check failed
-
- if (value == "__LINE__") {
+
+ if (value == "__LINE__") {
// expand the __LINE__ macro
char buffer[22]; // 21 bytes holds all NUL-terminated unsigned 64-bit numbers
@@ -1417,13 +1421,13 @@ string_type const &value = curr_token.get_value();
else if (value == "__FILE__") {
// expand the __FILE__ macro
namespace fs = boost::filesystem;
-
+
std::string file("\"");
fs::path filename(wave::util::create_path(main_pos.get_file().c_str()));
-
+
using boost::wave::util::impl::escape_lit;
file += escape_lit(wave::util::native_file_string(filename)) + "\"";
- expanded.push_back(token_type(T_STRINGLIT, file.c_str(),
+ expanded.push_back(token_type(T_STRINGLIT, file.c_str(),
curr_token.get_position()));
return true;
}
@@ -1441,29 +1445,29 @@ string_type const &value = curr_token.get_value();
///////////////////////////////////////////////////////////////////////////////
//
-// resolve_defined(): resolve the operator defined() and replace it with the
+// resolve_defined(): resolve the operator defined() and replace it with the
// correct T_INTLIT token
//
///////////////////////////////////////////////////////////////////////////////
template <typename ContextT>
template <typename IteratorT, typename ContainerT>
inline typename ContextT::token_type const &
-macromap<ContextT>::resolve_defined(IteratorT &first,
- IteratorT const &last, ContainerT &pending)
+macromap<ContextT>::resolve_defined(IteratorT &first,
+ IteratorT const &last, ContainerT &pending)
{
using namespace boost::wave;
using namespace boost::wave::grammars;
ContainerT result;
IteratorT start = first;
-boost::spirit::classic::parse_info<IteratorT> hit =
+boost::spirit::classic::parse_info<IteratorT> hit =
defined_grammar_gen<typename ContextT::lexer_type>::
parse_operator_defined(start, last, result);
-
+
if (!hit.hit) {
string_type msg ("defined(): ");
msg = msg + util::impl::as_string<string_type>(first, last);
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, ill_formed_expression,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, ill_formed_expression,
msg.c_str(), main_pos);
// insert a dummy token
@@ -1473,11 +1477,11 @@ boost::spirit::classic::parse_info<IteratorT> hit =
impl::assign_iterator<IteratorT>::do_(first, hit.stop);
// insert a token, which reflects the outcome
- pending.push_back(token_type(T_INTLIT,
- is_defined(result.begin(), result.end()) ? "1" : "0",
+ pending.push_back(token_type(T_INTLIT,
+ is_defined(result.begin(), result.end()) ? "1" : "0",
main_pos));
}
-
+
on_exit::pop_front<definition_container_type> pop_front_token(pending);
return act_token = pending.front();
@@ -1488,52 +1492,52 @@ on_exit::pop_front<definition_container_type> pop_front_token(pending);
// resolve_operator_pragma(): resolve the operator _Pragma() and dispatch to
// the associated action
//
-// This function returns true, if the pragma was correctly interpreted.
+// This function returns true, if the pragma was correctly interpreted.
// The iterator 'first' is positioned behind the closing ')'.
-// This function returns false, if the _Pragma was not known, the
+// This function returns false, if the _Pragma was not known, the
// preprocessed token sequence is pushed back to the 'pending' sequence.
//
///////////////////////////////////////////////////////////////////////////////
template <typename ContextT>
template <typename IteratorT, typename ContainerT>
inline bool
-macromap<ContextT>::resolve_operator_pragma(IteratorT &first,
- IteratorT const &last, ContainerT &pending, bool& seen_newline)
+macromap<ContextT>::resolve_operator_pragma(IteratorT &first,
+ IteratorT const &last, ContainerT &pending, bool& seen_newline)
{
// isolate the parameter of the operator _Pragma
token_type pragma_token = *first;
-
+
if (!impl::skip_to_token(ctx, first, last, T_LEFTPAREN, seen_newline)) {
// illformed operator _Pragma
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, ill_formed_expression,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, ill_formed_expression,
"operator _Pragma()", pragma_token.get_position());
return false;
}
-
+
std::vector<ContainerT> arguments;
#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0
- typename std::vector<ContainerT>::size_type count_args =
+ typename std::vector<ContainerT>::size_type count_args =
collect_arguments (pragma_token, arguments, first, last, 1, seen_newline);
#else
IteratorT endparen = first;
- typename std::vector<ContainerT>::size_type count_args =
- collect_arguments (pragma_token, arguments, first, endparen, last, 1,
+ typename std::vector<ContainerT>::size_type count_args =
+ collect_arguments (pragma_token, arguments, first, endparen, last, 1,
seen_newline);
#endif
// verify the parameter count
if (pragma_token.get_position().get_file().empty())
pragma_token.set_position(act_token.get_position());
-
+
if (count_args < 1 || arguments.size() < 1) {
// too few macro arguments
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, too_few_macroarguments,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, too_few_macroarguments,
pragma_token.get_value().c_str(), pragma_token.get_position());
return false;
}
if (count_args > 1 || arguments.size() > 1) {
// too many macro arguments
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, too_many_macroarguments,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, too_many_macroarguments,
pragma_token.get_value().c_str(), pragma_token.get_position());
return false;
}
@@ -1541,7 +1545,7 @@ macromap<ContextT>::resolve_operator_pragma(IteratorT &first,
// preprocess the pragma token body
typedef typename std::vector<ContainerT>::value_type::iterator
argument_iterator_type;
-
+
ContainerT expanded;
argument_iterator_type begin_it = arguments[0].begin();
argument_iterator_type end_it = arguments[0].end();
@@ -1549,7 +1553,7 @@ macromap<ContextT>::resolve_operator_pragma(IteratorT &first,
// un-escape the parameter of the operator _Pragma
typedef typename token_type::string_type string_type;
-
+
string_type pragma_cmd;
typename ContainerT::const_iterator end_exp = expanded.end();
for (typename ContainerT::const_iterator it_exp = expanded.begin();
@@ -1559,24 +1563,24 @@ macromap<ContextT>::resolve_operator_pragma(IteratorT &first,
break;
if (IS_CATEGORY(*it_exp, WhiteSpaceTokenType))
continue;
-
+
if (T_STRINGLIT != token_id(*it_exp)) {
// ill formed operator _Pragma
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
- ill_formed_pragma_option, "_Pragma",
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
+ ill_formed_pragma_option, "_Pragma",
pragma_token.get_position());
return false;
}
if (pragma_cmd.size() > 0) {
- // there should be exactly one string literal (string literals are to
- // be concatenated at translation phase 6, but _Pragma operators are
+ // there should be exactly one string literal (string literals are to
+ // be concatenated at translation phase 6, but _Pragma operators are
// to be executed at translation phase 4)
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
- ill_formed_pragma_option, "_Pragma",
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
+ ill_formed_pragma_option, "_Pragma",
pragma_token.get_position());
return false;
}
-
+
// remove the '\"' and concat all given string literal-values
string_type token_str = (*it_exp).get_value();
pragma_cmd += token_str.substr(1, token_str.size() - 2);
@@ -1585,23 +1589,23 @@ macromap<ContextT>::resolve_operator_pragma(IteratorT &first,
// tokenize the pragma body
typedef typename ContextT::lexer_type lexer_type;
-
+
ContainerT pragma;
std::string pragma_cmd_str(pragma_cmd_unesc.c_str());
- lexer_type it = lexer_type(pragma_cmd_str.begin(), pragma_cmd_str.end(),
+ lexer_type it = lexer_type(pragma_cmd_str.begin(), pragma_cmd_str.end(),
pragma_token.get_position(), ctx.get_language());
lexer_type end = lexer_type();
- for (/**/; it != end; ++it)
+ for (/**/; it != end; ++it)
pragma.push_back(*it);
-// analyze the preprocessed token sequence and eventually dispatch to the
+// analyze the preprocessed token sequence and eventually dispatch to the
// associated action
- if (interpret_pragma(ctx, pragma_token, pragma.begin(), pragma.end(),
+ if (interpret_pragma(ctx, pragma_token, pragma.begin(), pragma.end(),
pending))
{
return true; // successfully recognized a wave specific pragma
}
-
+
// unknown pragma token sequence, push it back and return to the caller
pending.push_front(token_type(T_SPACE, " ", pragma_token.get_position()));
pending.push_front(token_type(T_RIGHTPAREN, ")", pragma_token.get_position()));
@@ -1614,16 +1618,16 @@ macromap<ContextT>::resolve_operator_pragma(IteratorT &first,
///////////////////////////////////////////////////////////////////////////////
//
-// Test, whether the result of a concat operator is well formed or not.
+// Test, whether the result of a concat operator is well formed or not.
//
-// This is done by re-scanning (re-tokenizing) the resulting token sequence,
+// This is done by re-scanning (re-tokenizing) the resulting token sequence,
// which should give back exactly one token.
//
///////////////////////////////////////////////////////////////////////////////
template <typename ContextT>
template <typename ContainerT>
inline bool
-macromap<ContextT>::is_valid_concat(string_type new_value,
+macromap<ContextT>::is_valid_concat(string_type new_value,
position_type const &pos, ContainerT &rescanned)
{
// re-tokenize the newly generated string
@@ -1631,17 +1635,17 @@ macromap<ContextT>::is_valid_concat(string_type new_value,
std::string value_to_test(new_value.c_str());
- boost::wave::language_support lang =
+ boost::wave::language_support lang =
boost::wave::enable_prefer_pp_numbers(ctx.get_language());
lang = boost::wave::enable_single_line(lang);
- lexer_type it = lexer_type(value_to_test.begin(), value_to_test.end(), pos,
+ lexer_type it = lexer_type(value_to_test.begin(), value_to_test.end(), pos,
lang);
lexer_type end = lexer_type();
- for (/**/; it != end && T_EOF != token_id(*it); ++it)
+ for (/**/; it != end && T_EOF != token_id(*it); ++it)
{
// as of Wave V2.0.7 pasting of tokens is valid only if the resulting
- // tokens are pp_tokens (as mandated by C++0x)
+ // tokens are pp_tokens (as mandated by C++11)
if (!is_pp_token(*it))
return false;
rescanned.push_back(*it);
@@ -1650,7 +1654,7 @@ macromap<ContextT>::is_valid_concat(string_type new_value,
#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
if (boost::wave::need_variadics(ctx.get_language()))
return true; // in variadics mode token pasting is well defined
-#endif
+#endif
// test if the newly generated token sequence contains more than 1 token
return 1 == rescanned.size();
@@ -1663,8 +1667,8 @@ macromap<ContextT>::is_valid_concat(string_type new_value,
//
///////////////////////////////////////////////////////////////////////////////
template <typename Context>
-inline void report_invalid_concatenation(Context& ctx,
- typename Context::token_type const& prev,
+inline void report_invalid_concatenation(Context& ctx,
+ typename Context::token_type const& prev,
typename Context::token_type const& next,
typename Context::position_type const& main_pos)
{
@@ -1680,7 +1684,7 @@ typename Context::string_type error_string("\"");
template <typename ContextT>
template <typename ContainerT>
-inline bool
+inline bool
macromap<ContextT>::concat_tokensequence(ContainerT &expanded)
{
using namespace boost::wave;
@@ -1688,7 +1692,7 @@ macromap<ContextT>::concat_tokensequence(ContainerT &expanded)
iterator_type end = expanded.end();
iterator_type prev = end;
- for (iterator_type it = expanded.begin(); it != end; /**/)
+ for (iterator_type it = expanded.begin(); it != end; /**/)
{
if (T_POUND_POUND == BASE_TOKEN(token_id(*it))) {
iterator_type next = it;
@@ -1696,7 +1700,7 @@ macromap<ContextT>::concat_tokensequence(ContainerT &expanded)
++next;
if (prev == end || next == end) {
// error, '##' should be in between two tokens
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
ill_formed_operator, "concat ('##')", main_pos);
return false;
}
@@ -1707,12 +1711,12 @@ macromap<ContextT>::concat_tokensequence(ContainerT &expanded)
++next;
if (next == end) {
// error, '##' should be in between two tokens
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
ill_formed_operator, "concat ('##')", main_pos);
return false;
}
}
-
+
#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
if (boost::wave::need_variadics(ctx.get_language())) {
if (T_PLACEMARKER == token_id(*next)) {
@@ -1728,14 +1732,14 @@ macromap<ContextT>::concat_tokensequence(ContainerT &expanded)
iterator_type first_to_delete = prev;
*prev = *next;
- expanded.erase(++first_to_delete, ++next);
+ expanded.erase(++first_to_delete, ++next);
it = next;
continue;
}
}
#endif // BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
- // test if the concat operator has to concatenate two unrelated
+ // test if the concat operator has to concatenate two unrelated
// tokens i.e. the result yields more then one token
string_type concat_result;
ContainerT rescanned;
@@ -1743,10 +1747,10 @@ macromap<ContextT>::concat_tokensequence(ContainerT &expanded)
concat_result = ((*prev).get_value() + (*next).get_value());
// analyze the validity of the concatenation result
- if (!is_valid_concat(concat_result, (*prev).get_position(),
+ if (!is_valid_concat(concat_result, (*prev).get_position(),
rescanned) &&
- !IS_CATEGORY(*prev, WhiteSpaceTokenType) &&
- !IS_CATEGORY(*next, WhiteSpaceTokenType))
+ !IS_CATEGORY(*prev, WhiteSpaceTokenType) &&
+ !IS_CATEGORY(*next, WhiteSpaceTokenType))
{
report_invalid_concatenation(ctx, *prev, *next, main_pos);
return false;
@@ -1755,12 +1759,12 @@ macromap<ContextT>::concat_tokensequence(ContainerT &expanded)
#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
if (boost::wave::need_variadics(ctx.get_language())) {
// remove the prev, '##' and the next tokens from the sequence
- expanded.erase(prev, ++next); // remove not needed tokens
+ expanded.erase(prev, ++next); // remove not needed tokens
// some stl implementations clear() the container if we erased all
- // the elements, which orphans all iterators. we re-initialize these
+ // the elements, which orphans all iterators. we re-initialize these
// here
- if (expanded.empty())
+ if (expanded.empty())
end = next = expanded.end();
// replace the old token (pointed to by *prev) with the re-tokenized
@@ -1775,7 +1779,7 @@ macromap<ContextT>::concat_tokensequence(ContainerT &expanded)
else
#endif // BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
{
- // we leave the token_id unchanged, but unmark the token as
+ // we leave the token_id unchanged, but unmark the token as
// disabled, if appropriate
(*prev).set_value(concat_result);
if (T_NONREPLACABLE_IDENTIFIER == token_id(*prev))
@@ -1784,7 +1788,7 @@ macromap<ContextT>::concat_tokensequence(ContainerT &expanded)
// remove the '##' and the next tokens from the sequence
iterator_type first_to_delete = prev;
- expanded.erase(++first_to_delete, ++next);
+ expanded.erase(++first_to_delete, ++next);
}
it = next;
continue;
@@ -1806,14 +1810,14 @@ macromap<ContextT>::concat_tokensequence(ContainerT &expanded)
///////////////////////////////////////////////////////////////////////////////
template <typename ContextT>
inline void
-macromap<ContextT>::predefine_macro(defined_macros_type *scope,
+macromap<ContextT>::predefine_macro(defined_macros_type *scope,
string_type const &name, token_type const &t)
{
definition_container_type macrodefinition;
std::vector<token_type> param;
macrodefinition.push_back(t);
- add_macro(token_type(T_IDENTIFIER, name, t.get_position()),
+ add_macro(token_type(T_IDENTIFIER, name, t.get_position()),
false, param, macrodefinition, true, scope);
}
@@ -1823,8 +1827,8 @@ std::vector<token_type> param;
//
///////////////////////////////////////////////////////////////////////////////
template <typename ContextT>
-inline void
-macromap<ContextT>::init_predefined_macros(char const *fname,
+inline void
+macromap<ContextT>::init_predefined_macros(char const *fname,
defined_macros_type *scope, bool at_global_scope)
{
// if no scope is given, use the current one
@@ -1842,25 +1846,25 @@ position_type pos("<built-in>");
token_type(m.token_id, m.value, pos));
}
}
- else
-#endif
+ else
+#endif
{
#if BOOST_WAVE_SUPPORT_CPP0X != 0
if (boost::wave::need_cpp0x(ctx.get_language())) {
- // define C++0x specifics
+ // define C++11 specifics
for (int i = 0; 0 != predef.static_data_cpp0x(i).name; ++i) {
predefined_macros::static_macros const& m = predef.static_data_cpp0x(i);
- predefine_macro(current_scope, m.name,
+ predefine_macro(current_scope, m.name,
token_type(m.token_id, m.value, pos));
}
}
- else
-#endif
+ else
+#endif
{
// define C++ specifics
for (int i = 0; 0 != predef.static_data_cpp(i).name; ++i) {
predefined_macros::static_macros const& m = predef.static_data_cpp(i);
- predefine_macro(current_scope, m.name,
+ predefine_macro(current_scope, m.name,
token_type(m.token_id, m.value, pos));
}
@@ -1870,18 +1874,18 @@ position_type pos("<built-in>");
predefine_macro(current_scope, "__WAVE_HAS_VARIADICS__",
token_type(T_INTLIT, "1", pos));
}
-#endif
+#endif
}
}
-// predefine the __BASE_FILE__ macro which contains the main file name
- namespace fs = boost::filesystem;
+// predefine the __BASE_FILE__ macro which contains the main file name
+ namespace fs = boost::filesystem;
if (string_type(fname) != "<Unknown>") {
fs::path filename(create_path(fname));
using boost::wave::util::impl::escape_lit;
predefine_macro(current_scope, "__BASE_FILE__",
- token_type(T_STRINGLIT, string_type("\"") +
+ token_type(T_STRINGLIT, string_type("\"") +
escape_lit(native_file_string(filename)).c_str() + "\"", pos));
base_name = fname;
}
@@ -1890,7 +1894,7 @@ position_type pos("<built-in>");
using boost::wave::util::impl::escape_lit;
predefine_macro(current_scope, "__BASE_FILE__",
- token_type(T_STRINGLIT, string_type("\"") +
+ token_type(T_STRINGLIT, string_type("\"") +
escape_lit(native_file_string(filename)).c_str() + "\"", pos));
}
@@ -1908,7 +1912,7 @@ position_type pos("<built-in>");
//
///////////////////////////////////////////////////////////////////////////////
template <typename ContextT>
-inline void
+inline void
macromap<ContextT>::reset_macromap()
{
current_macros->clear();
diff --git a/boost/wave/util/cpp_macromap_predef.hpp b/boost/wave/util/cpp_macromap_predef.hpp
index 0725a36306..74ba2ad7b1 100644
--- a/boost/wave/util/cpp_macromap_predef.hpp
+++ b/boost/wave/util/cpp_macromap_predef.hpp
@@ -5,7 +5,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
@@ -224,7 +224,7 @@ namespace util {
}
#if BOOST_WAVE_SUPPORT_CPP0X != 0
- // C++0x mode
+ // C++11 mode
static_macros const& static_data_cpp0x(std::size_t i) const
{
static static_macros data[] = {
diff --git a/boost/wave/util/cpp_macromap_utils.hpp b/boost/wave/util/cpp_macromap_utils.hpp
index 84b5b03de6..36b187801d 100644
--- a/boost/wave/util/cpp_macromap_utils.hpp
+++ b/boost/wave/util/cpp_macromap_utils.hpp
@@ -5,7 +5,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/util/file_position.hpp b/boost/wave/util/file_position.hpp
index 87f6f77375..66c5d7814d 100644
--- a/boost/wave/util/file_position.hpp
+++ b/boost/wave/util/file_position.hpp
@@ -5,7 +5,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/util/filesystem_compatibility.hpp b/boost/wave/util/filesystem_compatibility.hpp
index 5bd924af72..157c6418c0 100644
--- a/boost/wave/util/filesystem_compatibility.hpp
+++ b/boost/wave/util/filesystem_compatibility.hpp
@@ -3,7 +3,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
@@ -25,12 +25,12 @@ namespace boost { namespace wave { namespace util
// interface wrappers for older Boost versions
inline boost::filesystem::path initial_path()
{
- return boost::filesystem::initial_path();
+ return boost::filesystem::initial_path();
}
inline boost::filesystem::path current_path()
{
- return boost::filesystem::current_path();
+ return boost::filesystem::current_path();
}
template <typename String>
@@ -43,18 +43,18 @@ namespace boost { namespace wave { namespace util
#endif
}
- inline std::string leaf(boost::filesystem::path const& p)
- {
+ inline std::string leaf(boost::filesystem::path const& p)
+ {
#if BOOST_FILESYSTEM_VERSION >= 3
- return p.leaf().string();
+ return p.leaf().string();
#else
- return p.leaf();
+ return p.leaf();
#endif
}
- inline boost::filesystem::path branch_path(boost::filesystem::path const& p)
- {
- return p.branch_path();
+ inline boost::filesystem::path branch_path(boost::filesystem::path const& p)
+ {
+ return p.branch_path();
}
inline boost::filesystem::path normalize(boost::filesystem::path& p)
@@ -62,12 +62,12 @@ namespace boost { namespace wave { namespace util
return p.normalize();
}
- inline std::string native_file_string(boost::filesystem::path const& p)
- {
+ inline std::string native_file_string(boost::filesystem::path const& p)
+ {
#if BOOST_FILESYSTEM_VERSION >= 3
- return p.string();
+ return p.string();
#else
- return p.native_file_string();
+ return p.native_file_string();
#endif
}
@@ -75,7 +75,11 @@ namespace boost { namespace wave { namespace util
boost::filesystem::path const& p)
{
#if BOOST_FILESYSTEM_VERSION >= 3
+#if BOOST_VERSION >= 105000
+ return boost::filesystem::complete(p, initial_path());
+#else
return boost::filesystem3::complete(p, initial_path());
+#endif
#else
return boost::filesystem::complete(p, initial_path());
#endif
@@ -85,7 +89,11 @@ namespace boost { namespace wave { namespace util
boost::filesystem::path const& p, boost::filesystem::path const& base)
{
#if BOOST_FILESYSTEM_VERSION >= 3
+#if BOOST_VERSION >= 105000
+ return boost::filesystem::complete(p, base);
+#else
return boost::filesystem3::complete(p, base);
+#endif
#else
return boost::filesystem::complete(p, base);
#endif
@@ -95,18 +103,26 @@ namespace boost { namespace wave { namespace util
// interface wrappers if deprecated functions do not exist
inline boost::filesystem::path initial_path()
- {
+ {
#if BOOST_FILESYSTEM_VERSION >= 3
+#if BOOST_VERSION >= 105000
+ return boost::filesystem::detail::initial_path();
+#else
return boost::filesystem3::detail::initial_path();
+#endif
#else
return boost::filesystem::initial_path<boost::filesystem::path>();
#endif
}
inline boost::filesystem::path current_path()
- {
+ {
#if BOOST_FILESYSTEM_VERSION >= 3
+#if BOOST_VERSION >= 105000
+ return boost::filesystem::current_path();
+#else
return boost::filesystem3::current_path();
+#endif
#else
return boost::filesystem::current_path<boost::filesystem::path>();
#endif
@@ -118,18 +134,18 @@ namespace boost { namespace wave { namespace util
return boost::filesystem::path(p);
}
- inline std::string leaf(boost::filesystem::path const& p)
- {
+ inline std::string leaf(boost::filesystem::path const& p)
+ {
#if BOOST_VERSION >= 104600 && BOOST_FILESYSTEM_VERSION >= 3
return p.filename().string();
#else
- return p.filename();
+ return p.filename();
#endif
}
- inline boost::filesystem::path branch_path(boost::filesystem::path const& p)
- {
- return p.parent_path();
+ inline boost::filesystem::path branch_path(boost::filesystem::path const& p)
+ {
+ return p.parent_path();
}
inline boost::filesystem::path normalize(boost::filesystem::path& p)
@@ -137,12 +153,12 @@ namespace boost { namespace wave { namespace util
return p; // function doesn't exist anymore
}
- inline std::string native_file_string(boost::filesystem::path const& p)
- {
+ inline std::string native_file_string(boost::filesystem::path const& p)
+ {
#if BOOST_VERSION >= 104600
- return p.string();
+ return p.string();
#else
- return p.file_string();
+ return p.file_string();
#endif
}
@@ -167,6 +183,13 @@ namespace boost { namespace wave { namespace util
}
#endif
+ // starting withBoost V1.50 create_directories throws if given an empty path
+ inline bool create_directories(boost::filesystem::path const& p)
+ {
+ if (p.string().empty())
+ return true;
+ return boost::filesystem::create_directories(p);
+ }
}}}
#endif
diff --git a/boost/wave/util/functor_input.hpp b/boost/wave/util/functor_input.hpp
index d30a090a1a..6cd75828fb 100644
--- a/boost/wave/util/functor_input.hpp
+++ b/boost/wave/util/functor_input.hpp
@@ -3,7 +3,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/util/insert_whitespace_detection.hpp b/boost/wave/util/insert_whitespace_detection.hpp
index 8485e9c1d1..e5726965f7 100644
--- a/boost/wave/util/insert_whitespace_detection.hpp
+++ b/boost/wave/util/insert_whitespace_detection.hpp
@@ -5,7 +5,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/util/interpret_pragma.hpp b/boost/wave/util/interpret_pragma.hpp
index e787040b1a..e5b9127366 100644
--- a/boost/wave/util/interpret_pragma.hpp
+++ b/boost/wave/util/interpret_pragma.hpp
@@ -3,7 +3,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/util/iteration_context.hpp b/boost/wave/util/iteration_context.hpp
index 8673f46639..1ea027c88d 100644
--- a/boost/wave/util/iteration_context.hpp
+++ b/boost/wave/util/iteration_context.hpp
@@ -3,7 +3,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
@@ -30,17 +30,17 @@ namespace util {
///////////////////////////////////////////////////////////////////////////////
template <typename IterationContextT>
-class iteration_context_stack
+class iteration_context_stack
{
typedef std::stack<IterationContextT> base_type;
-
+
public:
typedef typename base_type::size_type size_type;
-
+
iteration_context_stack()
: max_include_nesting_depth(BOOST_WAVE_MAX_INCLUDE_LEVEL_DEPTH)
{}
-
+
void set_max_include_nesting_depth(size_type new_depth)
{ max_include_nesting_depth = new_depth; }
size_type get_max_include_nesting_depth() const
@@ -49,22 +49,22 @@ public:
typename base_type::size_type size() const { return iter_ctx.size(); }
typename base_type::value_type &top() { return iter_ctx.top(); }
void pop() { iter_ctx.pop(); }
-
+
template <typename Context, typename PositionT>
- void push(Context& ctx, PositionT const &pos,
+ void push(Context& ctx, PositionT const &pos,
typename base_type::value_type const &val)
- {
+ {
if (iter_ctx.size() == max_include_nesting_depth) {
char buffer[22]; // 21 bytes holds all NUL-terminated unsigned 64-bit numbers
using namespace std; // for some systems sprintf is in namespace std
sprintf(buffer, "%d", (int)max_include_nesting_depth);
- BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
+ BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
include_nesting_too_deep, buffer, pos);
}
- iter_ctx.push(val);
+ iter_ctx.push(val);
}
-
+
private:
size_type max_include_nesting_depth;
base_type iter_ctx;
diff --git a/boost/wave/util/macro_definition.hpp b/boost/wave/util/macro_definition.hpp
index 16be858704..f488ac3a2a 100644
--- a/boost/wave/util/macro_definition.hpp
+++ b/boost/wave/util/macro_definition.hpp
@@ -3,7 +3,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/util/macro_helpers.hpp b/boost/wave/util/macro_helpers.hpp
index 4d156638dd..a33e8d02f9 100644
--- a/boost/wave/util/macro_helpers.hpp
+++ b/boost/wave/util/macro_helpers.hpp
@@ -3,7 +3,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/util/pattern_parser.hpp b/boost/wave/util/pattern_parser.hpp
index 876726fe4e..a36b980fbc 100644
--- a/boost/wave/util/pattern_parser.hpp
+++ b/boost/wave/util/pattern_parser.hpp
@@ -5,7 +5,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/util/symbol_table.hpp b/boost/wave/util/symbol_table.hpp
index 0eda557fba..312b0a2f19 100644
--- a/boost/wave/util/symbol_table.hpp
+++ b/boost/wave/util/symbol_table.hpp
@@ -3,7 +3,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/util/time_conversion_helper.hpp b/boost/wave/util/time_conversion_helper.hpp
index a477607b95..2918dde359 100644
--- a/boost/wave/util/time_conversion_helper.hpp
+++ b/boost/wave/util/time_conversion_helper.hpp
@@ -3,7 +3,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/util/transform_iterator.hpp b/boost/wave/util/transform_iterator.hpp
index 7477bfedbd..c60dbdaf4a 100644
--- a/boost/wave/util/transform_iterator.hpp
+++ b/boost/wave/util/transform_iterator.hpp
@@ -3,7 +3,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/util/unput_queue_iterator.hpp b/boost/wave/util/unput_queue_iterator.hpp
index 7fc060153b..6d1ce1dc32 100644
--- a/boost/wave/util/unput_queue_iterator.hpp
+++ b/boost/wave/util/unput_queue_iterator.hpp
@@ -5,7 +5,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/wave_config.hpp b/boost/wave/wave_config.hpp
index fa537a6891..ec712ef16d 100644
--- a/boost/wave/wave_config.hpp
+++ b/boost/wave/wave_config.hpp
@@ -5,7 +5,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
@@ -83,9 +83,9 @@
#endif
///////////////////////////////////////////////////////////////////////////////
-// Decide, whether to support C++0x
+// Decide, whether to support C++11
//
-// To implement C++0x keywords and preprocessor semantics define the following
+// To implement C++11 keywords and preprocessor semantics define the following
// to something not equal to zero.
//
#if !defined(BOOST_WAVE_SUPPORT_CPP0X)
diff --git a/boost/wave/wave_config_constant.hpp b/boost/wave/wave_config_constant.hpp
index 68bdf74c42..45f83a2abc 100644
--- a/boost/wave/wave_config_constant.hpp
+++ b/boost/wave/wave_config_constant.hpp
@@ -4,7 +4,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
diff --git a/boost/wave/wave_version.hpp b/boost/wave/wave_version.hpp
index 3512e0da10..7b143ca76c 100644
--- a/boost/wave/wave_version.hpp
+++ b/boost/wave/wave_version.hpp
@@ -5,7 +5,7 @@
http://www.boost.org/
- Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
@@ -16,11 +16,11 @@
// BOOST_WAVE_VERSION & 0x0000FF is the sub-minor version
// BOOST_WAVE_VERSION & 0x00FF00 is the minor version
// BOOST_WAVE_VERSION & 0xFF0000 is the major version
-#define BOOST_WAVE_VERSION 0x020300
+#define BOOST_WAVE_VERSION 0x020302
// The following defines contain the same information as above
#define BOOST_WAVE_VERSION_MAJOR 2
#define BOOST_WAVE_VERSION_MINOR 3
-#define BOOST_WAVE_VERSION_SUBMINOR 0
+#define BOOST_WAVE_VERSION_SUBMINOR 2
#endif // !defined(WAVE_VERSION_H_9D79ABDB_AC54_4C0A_89B1_F70A2DCFE21E_INCLUDED)
diff --git a/boost/wave/whitespace_handling.hpp b/boost/wave/whitespace_handling.hpp
index be9725fd8d..c81a67c67e 100644
--- a/boost/wave/whitespace_handling.hpp
+++ b/boost/wave/whitespace_handling.hpp
@@ -5,7 +5,7 @@
http://www.boost.org/
Copyright (c) 2003 Paul Mensonides
- Copyright (c) 2001-2011 Hartmut Kaiser.
+ Copyright (c) 2001-2012 Hartmut Kaiser.
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
@@ -67,7 +67,7 @@ namespace util {
#if BOOST_WAVE_SUPPORT_CPP0X != 0
///////////////////////////////////////////////////////////////////////////
- // This function returns the number of newlines in the given C++0x style
+ // This function returns the number of newlines in the given C++11 style
// raw string
template <typename TokenT>
int rawstring_count_newlines(TokenT const& token)
diff --git a/boost/xpressive/detail/core/adaptor.hpp b/boost/xpressive/detail/core/adaptor.hpp
index 6afecf2f92..28aaa23247 100644
--- a/boost/xpressive/detail/core/adaptor.hpp
+++ b/boost/xpressive/detail/core/adaptor.hpp
@@ -41,7 +41,7 @@ struct xpression_adaptor
&& ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
// Ugh, gcc has an optimizer bug which elides this c'tor call
// resulting in pure virtual function calls.
- __attribute__((noinline))
+ __attribute__((__noinline__))
#endif
: xpr_(xpr)
{
diff --git a/boost/xpressive/detail/static/type_traits.hpp b/boost/xpressive/detail/static/type_traits.hpp
index 67ba77e328..15f00a4243 100644
--- a/boost/xpressive/detail/static/type_traits.hpp
+++ b/boost/xpressive/detail/static/type_traits.hpp
@@ -13,6 +13,8 @@
# pragma once
#endif
+#include <string>
+#include <boost/config.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/iterator/iterator_traits.hpp>
#include <boost/type_traits/is_convertible.hpp>
@@ -55,6 +57,59 @@ struct is_random
{
};
+//////////////////////////////////////////////////////////////////////////
+// is_string_iterator
+//
+template<typename Iter>
+struct is_string_iterator
+ : mpl::false_
+{
+};
+
+template<>
+struct is_string_iterator<std::string::iterator>
+ : mpl::true_
+{
+};
+
+template<>
+struct is_string_iterator<std::string::const_iterator>
+ : mpl::true_
+{
+};
+
+#ifndef BOOST_NO_STD_WSTRING
+template<>
+struct is_string_iterator<std::wstring::iterator>
+ : mpl::true_
+{
+};
+
+template<>
+struct is_string_iterator<std::wstring::const_iterator>
+ : mpl::true_
+{
+};
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
+// is_char
+//
+template<typename T>
+struct is_char
+ : mpl::false_
+{};
+
+template<>
+struct is_char<char>
+ : mpl::true_
+{};
+
+template<>
+struct is_char<wchar_t>
+ : mpl::true_
+{};
+
}}} // namespace boost::xpressive::detail
#endif
diff --git a/boost/xpressive/detail/static/width_of.hpp b/boost/xpressive/detail/static/width_of.hpp
index eec6e5491d..f7f6f9ecd5 100644
--- a/boost/xpressive/detail/static/width_of.hpp
+++ b/boost/xpressive/detail/static/width_of.hpp
@@ -23,6 +23,7 @@
#include <boost/mpl/equal_to.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/xpressive/detail/detail_fwd.hpp>
+#include <boost/xpressive/detail/static/type_traits.hpp>
#include <boost/proto/traits.hpp>
namespace boost { namespace xpressive { namespace detail
@@ -67,24 +68,6 @@ namespace boost { namespace xpressive { namespace detail
{};
///////////////////////////////////////////////////////////////////////////////
- // is_char
- //
- template<typename T>
- struct is_char
- : mpl::false_
- {};
-
- template<>
- struct is_char<char>
- : mpl::true_
- {};
-
- template<>
- struct is_char<wchar_t>
- : mpl::true_
- {};
-
- ///////////////////////////////////////////////////////////////////////////////
// width_of_terminal
//
template<typename Expr, typename Char, bool IsXpr = is_xpr<Expr>::value>
diff --git a/boost/xpressive/regex_actions.hpp b/boost/xpressive/regex_actions.hpp
index e22b164a88..1f9617ba31 100644
--- a/boost/xpressive/regex_actions.hpp
+++ b/boost/xpressive/regex_actions.hpp
@@ -20,14 +20,17 @@
#include <boost/mpl/if.hpp>
#include <boost/mpl/or.hpp>
#include <boost/mpl/int.hpp>
+#include <boost/mpl/assert.hpp>
#include <boost/noncopyable.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/throw_exception.hpp>
#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/remove_cv.hpp>
#include <boost/type_traits/remove_reference.hpp>
+#include <boost/range/iterator_range.hpp>
#include <boost/xpressive/detail/detail_fwd.hpp>
#include <boost/xpressive/detail/core/state.hpp>
#include <boost/xpressive/detail/core/matcher/attr_matcher.hpp>
@@ -35,6 +38,7 @@
#include <boost/xpressive/detail/core/matcher/attr_begin_matcher.hpp>
#include <boost/xpressive/detail/core/matcher/predicate_matcher.hpp>
#include <boost/xpressive/detail/utility/ignore_unused.hpp>
+#include <boost/xpressive/detail/static/type_traits.hpp>
// These are very often needed by client code.
#include <boost/typeof/std/map.hpp>
@@ -62,21 +66,6 @@
#pragma warning(disable : 4610) // can never be instantiated - user defined constructor required
#endif
-namespace boost
-{
- namespace detail
- {
- // Bit of a hack to make lexical_cast work with wide sub_match
- template<typename T>
- struct stream_char;
-
- template<typename BidiIter>
- struct stream_char<xpressive::sub_match<BidiIter> >
- : boost::iterator_value<BidiIter>
- {};
- }
-}
-
namespace boost { namespace xpressive
{
@@ -572,7 +561,53 @@ namespace boost { namespace xpressive
template<typename Value>
T operator()(Value const &val) const
{
- return lexical_cast<T>(val);
+ return boost::lexical_cast<T>(val);
+ }
+
+ // Hack around some limitations in boost::lexical_cast
+ T operator()(csub_match const &val) const
+ {
+ return val.matched
+ ? boost::lexical_cast<T>(boost::make_iterator_range(val.first, val.second))
+ : boost::lexical_cast<T>("");
+ }
+
+ #ifndef BOOST_XPRESSIVE_NO_WREGEX
+ T operator()(wcsub_match const &val) const
+ {
+ return val.matched
+ ? boost::lexical_cast<T>(boost::make_iterator_range(val.first, val.second))
+ : boost::lexical_cast<T>("");
+ }
+ #endif
+
+ template<typename BidiIter>
+ T operator()(sub_match<BidiIter> const &val) const
+ {
+ // If this assert fires, you're trying to coerce a sequences of non-characters
+ // to some other type. Xpressive doesn't know how to do that.
+ typedef typename iterator_value<BidiIter>::type char_type;
+ BOOST_MPL_ASSERT_MSG(
+ (xpressive::detail::is_char<char_type>::value)
+ , CAN_ONLY_CONVERT_FROM_CHARACTER_SEQUENCES
+ , (char_type)
+ );
+ return this->impl(val, xpressive::detail::is_string_iterator<BidiIter>());
+ }
+
+ private:
+ template<typename RandIter>
+ T impl(sub_match<RandIter> const &val, mpl::true_) const
+ {
+ return val.matched
+ ? boost::lexical_cast<T>(boost::make_iterator_range(&*val.first, &*val.first + (val.second - val.first)))
+ : boost::lexical_cast<T>("");
+ }
+
+ template<typename BidiIter>
+ T impl(sub_match<BidiIter> const &val, mpl::false_) const
+ {
+ return boost::lexical_cast<T>(val.str());
}
};
diff --git a/boost/xpressive/sub_match.hpp b/boost/xpressive/sub_match.hpp
index 5bd778ba9f..a5f9559983 100644
--- a/boost/xpressive/sub_match.hpp
+++ b/boost/xpressive/sub_match.hpp
@@ -20,6 +20,8 @@
#include <utility>
#include <iterator>
#include <algorithm>
+#include <boost/mpl/assert.hpp>
+#include <boost/type_traits/is_same.hpp>
#include <boost/iterator/iterator_traits.hpp>
#include <boost/xpressive/detail/detail_fwd.hpp>
@@ -146,6 +148,11 @@ inline std::basic_ostream<Char, Traits> &operator <<
)
{
typedef typename iterator_value<BidiIter>::type char_type;
+ BOOST_MPL_ASSERT_MSG(
+ (boost::is_same<Char, char_type>::value)
+ , CHARACTER_TYPES_OF_STREAM_AND_SUB_MATCH_MUST_MATCH
+ , (Char, char_type)
+ );
if(sub.matched)
{
std::ostream_iterator<char_type, Char, Traits> iout(sout);
diff --git a/boost/xpressive/traits/cpp_regex_traits.hpp b/boost/xpressive/traits/cpp_regex_traits.hpp
index 5d5c7fd0b1..74a904cd12 100644
--- a/boost/xpressive/traits/cpp_regex_traits.hpp
+++ b/boost/xpressive/traits/cpp_regex_traits.hpp
@@ -20,10 +20,12 @@
#include <string>
#include <locale>
#include <sstream>
+#include <climits>
#include <boost/config.hpp>
#include <boost/assert.hpp>
#include <boost/integer.hpp>
#include <boost/mpl/assert.hpp>
+#include <boost/static_assert.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/xpressive/detail/detail_fwd.hpp>
@@ -89,7 +91,7 @@ namespace detail
template<umaskex_t In, umaskex_t Out = highest_bit, bool Done = (0 == (Out & In))>
struct unused_mask
{
- BOOST_MPL_ASSERT_RELATION(1, !=, Out);
+ BOOST_STATIC_ASSERT(1 != Out);
BOOST_STATIC_CONSTANT(umaskex_t, value = (unused_mask<In, (Out >> 1)>::value));
};
@@ -121,6 +123,8 @@ namespace detail
umaskex_t const std_ctype_reserved = 0x8000;
#elif defined(_CPPLIB_VER) && defined(BOOST_WINDOWS)
umaskex_t const std_ctype_reserved = 0x8200;
+ #elif defined(_LIBCPP_VERSION)
+ umaskex_t const std_ctype_reserved = 0x8000;
#else
umaskex_t const std_ctype_reserved = 0;
#endif
@@ -205,6 +209,16 @@ namespace detail
return true;
}
+ // HACKHACK Cygwin and mingw have buggy ctype facets for wchar_t
+ #if defined(__CYGWIN__) || defined(__MINGW32_VERSION)
+ if (std::ctype_base::xdigit == ((std::ctype_base::mask)(umask_t)mask & std::ctype_base::xdigit))
+ {
+ typename std::char_traits<Char>::int_type i = std::char_traits<Char>::to_int_type(ch);
+ if(UCHAR_MAX >= i && std::isxdigit(static_cast<int>(i)))
+ return true;
+ }
+ #endif
+
#else
umaskex_t tmp = mask & ~non_std_ctype_masks;
diff --git a/boost/xpressive/traits/detail/c_ctype.hpp b/boost/xpressive/traits/detail/c_ctype.hpp
index 5ed5d97c78..40788c46cd 100644
--- a/boost/xpressive/traits/detail/c_ctype.hpp
+++ b/boost/xpressive/traits/detail/c_ctype.hpp
@@ -496,8 +496,7 @@ struct char_class_impl<char>
static bool isctype(char ch, char_class_type mask)
{
- using namespace std;
- if(0 != __isctype(static_cast<unsigned char>(ch), mask))
+ if(glibc_isctype(ch, mask))
{
return true;
}
@@ -511,6 +510,15 @@ struct char_class_impl<char>
return false;
}
+
+ static bool glibc_isctype(char ch, char_class_type mask)
+ {
+ #ifdef __isctype
+ return 0 != __isctype(ch, mask);
+ #else
+ return 0 != ((*__ctype_b_loc())[(int)(ch)] & (unsigned short int)mask);
+ #endif
+ }
};
#ifndef BOOST_XPRESSIVE_NO_WREGEX
diff --git a/boost/xpressive/xpressive_fwd.hpp b/boost/xpressive/xpressive_fwd.hpp
index 00c8c61506..8ae9035fe0 100644
--- a/boost/xpressive/xpressive_fwd.hpp
+++ b/boost/xpressive/xpressive_fwd.hpp
@@ -31,7 +31,7 @@
# define BOOST_XPRESSIVE_USE_C_TRAITS
#endif
-#if defined(BOOST_NO_CWCHAR) | defined(BOOST_NO_CWCTYPE) | defined(BOOST_NO_STD_WSTRING)
+#if defined(BOOST_NO_CWCHAR) || defined(BOOST_NO_CWCTYPE) || defined(BOOST_NO_STD_WSTRING)
# ifndef BOOST_XPRESSIVE_NO_WREGEX
# define BOOST_XPRESSIVE_NO_WREGEX
# endif