|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r66089 - in branches/release: . boost boost/algorithm/string boost/archive boost/bimap boost/config boost/detail boost/filesystem boost/functional/hash boost/fusion boost/gil boost/graph boost/integer boost/interprocess boost/intrusive boost/io boost/iostreams boost/math boost/msm boost/program_options boost/property_tree boost/range boost/regex boost/serialization boost/signals boost/signals2 boost/spirit boost/spirit/home boost/spirit/home/classic/error_handling boost/spirit/home/classic/utility boost/spirit/home/karma boost/spirit/home/karma/numeric/detail boost/spirit/home/support boost/spirit/home/support/iterators/detail boost/statechart boost/system boost/thread boost/tr1 boost/type_traits boost/unordered boost/utility boost/uuid boost/variant boost/wave doc libs libs/algorithm/string libs/array/doc libs/array/test libs/bimap libs/config libs/filesystem libs/functional/hash libs/fusion libs/graph_parallel libs/integer libs/interprocess libs/intrusive libs/math libs/math/doc/sf_and_dist libs/mpi/build libs/mpl/doc/refmanual libs/mpl/doc/src/refmanual libs/msm libs/program_options libs/property_tree libs/range libs/regex libs/serialization libs/serialization/doc libs/serialization/test libs/signals libs/signals2 libs/spirit libs/spirit/classic/example libs/spirit/doc libs/spirit/example libs/spirit/phoenix libs/spirit/test libs/spirit/test/karma libs/spirit/test/qi libs/statechart libs/static_assert libs/system libs/thread libs/timer libs/tr1 libs/type_traits libs/type_traits/doc libs/unordered libs/utility libs/utility/swap/test libs/uuid libs/wave more more/getting_started status tools tools/bcp tools/boostbook tools/build/v2 tools/inspect tools/quickbook tools/regression tools/regression/src tools/release tools/wave
From: hartmut.kaiser_at_[hidden]
Date: 2010-10-19 08:49:14
Author: hkaiser
Date: 2010-10-19 08:49:10 EDT (Tue, 19 Oct 2010)
New Revision: 66089
URL: http://svn.boost.org/trac/boost/changeset/66089
Log:
Spirit: merging from trunk
Added:
branches/release/libs/spirit/test/karma/real_scientific.cpp
- copied unchanged from r66052, /trunk/libs/spirit/test/karma/real_scientific.cpp
Properties modified:
branches/release/ (props changed)
branches/release/INSTALL (props changed)
branches/release/Jamroot (props changed)
branches/release/LICENSE_1_0.txt (props changed)
branches/release/boost/ (props changed)
branches/release/boost-build.jam (props changed)
branches/release/boost.css (props changed)
branches/release/boost.png (props changed)
branches/release/boost/algorithm/string/ (props changed)
branches/release/boost/archive/ (props changed)
branches/release/boost/archive/basic_archive.hpp (props changed)
branches/release/boost/array.hpp (props changed)
branches/release/boost/bimap/ (props changed)
branches/release/boost/config/ (props changed)
branches/release/boost/config.hpp (props changed)
branches/release/boost/detail/ (props changed)
branches/release/boost/detail/endian.hpp (props changed)
branches/release/boost/filesystem/ (props changed)
branches/release/boost/filesystem.hpp (props changed)
branches/release/boost/functional/hash/ (props changed)
branches/release/boost/fusion/ (props changed)
branches/release/boost/gil/ (props changed)
branches/release/boost/graph/ (props changed)
branches/release/boost/integer/ (props changed)
branches/release/boost/interprocess/ (props changed)
branches/release/boost/intrusive/ (props changed)
branches/release/boost/io/ (props changed)
branches/release/boost/iostreams/ (props changed)
branches/release/boost/math/ (props changed)
branches/release/boost/math_fwd.hpp (props changed)
branches/release/boost/msm/ (props changed)
branches/release/boost/program_options/ (props changed)
branches/release/boost/property_tree/ (props changed)
branches/release/boost/range/ (props changed)
branches/release/boost/regex/ (props changed)
branches/release/boost/serialization/ (props changed)
branches/release/boost/signals/ (props changed)
branches/release/boost/signals2/ (props changed)
branches/release/boost/signals2.hpp (props changed)
branches/release/boost/spirit/ (props changed)
branches/release/boost/spirit/home/ (props changed)
branches/release/boost/spirit/home/karma/ (props changed)
branches/release/boost/spirit/home/support/attributes.hpp (props changed)
branches/release/boost/statechart/ (props changed)
branches/release/boost/system/ (props changed)
branches/release/boost/thread/ (props changed)
branches/release/boost/thread.hpp (props changed)
branches/release/boost/tr1/ (props changed)
branches/release/boost/type_traits/ (props changed)
branches/release/boost/unordered/ (props changed)
branches/release/boost/utility/ (props changed)
branches/release/boost/utility/value_init.hpp (props changed)
branches/release/boost/uuid/ (props changed)
branches/release/boost/variant/ (props changed)
branches/release/boost/version.hpp (props changed)
branches/release/boost/wave/ (props changed)
branches/release/bootstrap.bat (props changed)
branches/release/bootstrap.sh (props changed)
branches/release/doc/ (props changed)
branches/release/index.htm (props changed)
branches/release/index.html (props changed)
branches/release/libs/ (props changed)
branches/release/libs/algorithm/string/ (props changed)
branches/release/libs/array/doc/array.xml (props changed)
branches/release/libs/array/test/array0.cpp (props changed)
branches/release/libs/array/test/array2.cpp (props changed)
branches/release/libs/bimap/ (props changed)
branches/release/libs/config/ (props changed)
branches/release/libs/filesystem/ (props changed)
branches/release/libs/functional/hash/ (props changed)
branches/release/libs/fusion/ (props changed)
branches/release/libs/graph_parallel/ (props changed)
branches/release/libs/integer/ (props changed)
branches/release/libs/interprocess/ (props changed)
branches/release/libs/intrusive/ (props changed)
branches/release/libs/libraries.htm (props changed)
branches/release/libs/maintainers.txt (props changed)
branches/release/libs/math/ (props changed)
branches/release/libs/math/doc/sf_and_dist/ (props changed)
branches/release/libs/mpi/build/ (props changed)
branches/release/libs/mpl/doc/refmanual/broken-compiler-workarounds.html (props changed)
branches/release/libs/mpl/doc/refmanual/categorized-index-concepts.html (props changed)
branches/release/libs/mpl/doc/refmanual/cfg-no-preprocessed-headers.html (props changed)
branches/release/libs/mpl/doc/refmanual/composition-and-argument-binding.html (props changed)
branches/release/libs/mpl/doc/refmanual/data-types-concepts.html (props changed)
branches/release/libs/mpl/doc/refmanual/data-types-miscellaneous.html (props changed)
branches/release/libs/mpl/doc/refmanual/extensible-associative-sequence.html (props changed)
branches/release/libs/mpl/doc/refmanual/inserter-class.html (props changed)
branches/release/libs/mpl/doc/refmanual/tag-dispatched-metafunction.html (props changed)
branches/release/libs/mpl/doc/refmanual/trivial-metafunctions-summary.html (props changed)
branches/release/libs/mpl/doc/src/refmanual/Iterators-Iterator.rst (props changed)
branches/release/libs/msm/ (props changed)
branches/release/libs/program_options/ (props changed)
branches/release/libs/property_tree/ (props changed)
branches/release/libs/range/ (props changed)
branches/release/libs/regex/ (props changed)
branches/release/libs/serialization/ (props changed)
branches/release/libs/serialization/doc/ (props changed)
branches/release/libs/serialization/test/ (props changed)
branches/release/libs/serialization/test/A.cpp (props changed)
branches/release/libs/serialization/test/A.hpp (props changed)
branches/release/libs/serialization/test/A.ipp (props changed)
branches/release/libs/serialization/test/B.hpp (props changed)
branches/release/libs/serialization/test/C.hpp (props changed)
branches/release/libs/serialization/test/D.hpp (props changed)
branches/release/libs/serialization/test/J.hpp (props changed)
branches/release/libs/serialization/test/Jamfile.v2 (props changed)
branches/release/libs/serialization/test/base.hpp (props changed)
branches/release/libs/serialization/test/binary_archive.hpp (props changed)
branches/release/libs/serialization/test/binary_warchive.hpp (props changed)
branches/release/libs/serialization/test/derived2.hpp (props changed)
branches/release/libs/serialization/test/dll_a.cpp (props changed)
branches/release/libs/serialization/test/dll_base.cpp (props changed)
branches/release/libs/serialization/test/dll_derived2.cpp (props changed)
branches/release/libs/serialization/test/polymorphic_array_binary_archive.hpp (props changed)
branches/release/libs/serialization/test/polymorphic_base.cpp (props changed)
branches/release/libs/serialization/test/polymorphic_base.hpp (props changed)
branches/release/libs/serialization/test/polymorphic_binary_archive.hpp (props changed)
branches/release/libs/serialization/test/polymorphic_derived1.cpp (props changed)
branches/release/libs/serialization/test/polymorphic_derived1.hpp (props changed)
branches/release/libs/serialization/test/polymorphic_derived2.cpp (props changed)
branches/release/libs/serialization/test/polymorphic_derived2.hpp (props changed)
branches/release/libs/serialization/test/polymorphic_text_archive.hpp (props changed)
branches/release/libs/serialization/test/polymorphic_text_warchive.hpp (props changed)
branches/release/libs/serialization/test/polymorphic_xml_archive.hpp (props changed)
branches/release/libs/serialization/test/polymorphic_xml_warchive.hpp (props changed)
branches/release/libs/serialization/test/portable_binary_archive.hpp (props changed)
branches/release/libs/serialization/test/test_array.cpp (props changed)
branches/release/libs/serialization/test/test_binary.cpp (props changed)
branches/release/libs/serialization/test/test_bitset.cpp (props changed)
branches/release/libs/serialization/test/test_check.cpp (props changed)
branches/release/libs/serialization/test/test_class_info_load.cpp (props changed)
branches/release/libs/serialization/test/test_class_info_save.cpp (props changed)
branches/release/libs/serialization/test/test_codecvt_null.cpp (props changed)
branches/release/libs/serialization/test/test_complex.cpp (props changed)
branches/release/libs/serialization/test/test_const_load_fail1.cpp (props changed)
branches/release/libs/serialization/test/test_const_load_fail1_nvp.cpp (props changed)
branches/release/libs/serialization/test/test_const_load_fail2.cpp (props changed)
branches/release/libs/serialization/test/test_const_load_fail2_nvp.cpp (props changed)
branches/release/libs/serialization/test/test_const_load_fail3.cpp (props changed)
branches/release/libs/serialization/test/test_const_load_fail3_nvp.cpp (props changed)
branches/release/libs/serialization/test/test_const_pass.cpp (props changed)
branches/release/libs/serialization/test/test_const_save_warn1.cpp (props changed)
branches/release/libs/serialization/test/test_const_save_warn1_nvp.cpp (props changed)
branches/release/libs/serialization/test/test_const_save_warn2.cpp (props changed)
branches/release/libs/serialization/test/test_const_save_warn2_nvp.cpp (props changed)
branches/release/libs/serialization/test/test_const_save_warn3.cpp (props changed)
branches/release/libs/serialization/test/test_const_save_warn3_nvp.cpp (props changed)
branches/release/libs/serialization/test/test_const_save_warn4.cpp (props changed)
branches/release/libs/serialization/test/test_const_save_warn4_nvp.cpp (props changed)
branches/release/libs/serialization/test/test_contained_class.cpp (props changed)
branches/release/libs/serialization/test/test_cyclic_ptrs.cpp (props changed)
branches/release/libs/serialization/test/test_decl.hpp (props changed)
branches/release/libs/serialization/test/test_delete_pointer.cpp (props changed)
branches/release/libs/serialization/test/test_deque.cpp (props changed)
branches/release/libs/serialization/test/test_derived.cpp (props changed)
branches/release/libs/serialization/test/test_derived_class.cpp (props changed)
branches/release/libs/serialization/test/test_derived_class_ptr.cpp (props changed)
branches/release/libs/serialization/test/test_diamond.cpp (props changed)
branches/release/libs/serialization/test/test_diamond_complex.cpp (props changed)
branches/release/libs/serialization/test/test_dll_exported.cpp (props changed)
branches/release/libs/serialization/test/test_dll_plugin.cpp (props changed)
branches/release/libs/serialization/test/test_dll_simple.cpp (props changed)
branches/release/libs/serialization/test/test_exported.cpp (props changed)
branches/release/libs/serialization/test/test_inclusion.cpp (props changed)
branches/release/libs/serialization/test/test_iterators.cpp (props changed)
branches/release/libs/serialization/test/test_iterators_base64.cpp (props changed)
branches/release/libs/serialization/test/test_list.cpp (props changed)
branches/release/libs/serialization/test/test_list_ptrs.cpp (props changed)
branches/release/libs/serialization/test/test_map.cpp (props changed)
branches/release/libs/serialization/test/test_mi.cpp (props changed)
branches/release/libs/serialization/test/test_mult_archive_types.cpp (props changed)
branches/release/libs/serialization/test/test_multiple_inheritance.cpp (props changed)
branches/release/libs/serialization/test/test_multiple_ptrs.cpp (props changed)
branches/release/libs/serialization/test/test_new_operator.cpp (props changed)
branches/release/libs/serialization/test/test_no_rtti.cpp (props changed)
branches/release/libs/serialization/test/test_non_default_ctor.cpp (props changed)
branches/release/libs/serialization/test/test_non_default_ctor2.cpp (props changed)
branches/release/libs/serialization/test/test_non_intrusive.cpp (props changed)
branches/release/libs/serialization/test/test_not_serializable.cpp (props changed)
branches/release/libs/serialization/test/test_null_ptr.cpp (props changed)
branches/release/libs/serialization/test/test_nvp.cpp (props changed)
branches/release/libs/serialization/test/test_object.cpp (props changed)
branches/release/libs/serialization/test/test_optional.cpp (props changed)
branches/release/libs/serialization/test/test_pimpl.cpp (props changed)
branches/release/libs/serialization/test/test_polymorphic.cpp (props changed)
branches/release/libs/serialization/test/test_polymorphic2.cpp (props changed)
branches/release/libs/serialization/test/test_polymorphic2.hpp (props changed)
branches/release/libs/serialization/test/test_polymorphic2imp.cpp (props changed)
branches/release/libs/serialization/test/test_polymorphic_A.cpp (props changed)
branches/release/libs/serialization/test/test_polymorphic_A.hpp (props changed)
branches/release/libs/serialization/test/test_primitive.cpp (props changed)
branches/release/libs/serialization/test/test_private_base.cpp (props changed)
branches/release/libs/serialization/test/test_private_ctor.cpp (props changed)
branches/release/libs/serialization/test/test_recursion.cpp (props changed)
branches/release/libs/serialization/test/test_registered.cpp (props changed)
branches/release/libs/serialization/test/test_reset_object_address.cpp (props changed)
branches/release/libs/serialization/test/test_set.cpp (props changed)
branches/release/libs/serialization/test/test_shared_ptr.cpp (props changed)
branches/release/libs/serialization/test/test_shared_ptr_132.cpp (props changed)
branches/release/libs/serialization/test/test_shared_ptr_multi_base.cpp (props changed)
branches/release/libs/serialization/test/test_simple_class.cpp (props changed)
branches/release/libs/serialization/test/test_simple_class_ptr.cpp (props changed)
branches/release/libs/serialization/test/test_singleton.cpp (props changed)
branches/release/libs/serialization/test/test_smart_cast.cpp (props changed)
branches/release/libs/serialization/test/test_split.cpp (props changed)
branches/release/libs/serialization/test/test_static_warning.cpp (props changed)
branches/release/libs/serialization/test/test_tools.hpp (props changed)
branches/release/libs/serialization/test/test_tracking.cpp (props changed)
branches/release/libs/serialization/test/test_traits_fail.cpp (props changed)
branches/release/libs/serialization/test/test_traits_pass.cpp (props changed)
branches/release/libs/serialization/test/test_unregistered.cpp (props changed)
branches/release/libs/serialization/test/test_utf8_codecvt.cpp (props changed)
branches/release/libs/serialization/test/test_valarray.cpp (props changed)
branches/release/libs/serialization/test/test_variant.cpp (props changed)
branches/release/libs/serialization/test/test_vector.cpp (props changed)
branches/release/libs/serialization/test/test_void_cast.cpp (props changed)
branches/release/libs/serialization/test/text_archive.hpp (props changed)
branches/release/libs/serialization/test/text_warchive.hpp (props changed)
branches/release/libs/serialization/test/xml_archive.hpp (props changed)
branches/release/libs/serialization/test/xml_warchive.hpp (props changed)
branches/release/libs/signals/ (props changed)
branches/release/libs/signals2/ (props changed)
branches/release/libs/spirit/ (props changed)
branches/release/libs/spirit/classic/example/ (props changed)
branches/release/libs/spirit/doc/ (props changed)
branches/release/libs/spirit/example/ (props changed)
branches/release/libs/spirit/phoenix/ (props changed)
branches/release/libs/spirit/test/ (props changed)
branches/release/libs/spirit/test/qi/optional.cpp (props changed)
branches/release/libs/statechart/ (props changed)
branches/release/libs/static_assert/ (props changed)
branches/release/libs/system/ (props changed)
branches/release/libs/thread/ (props changed)
branches/release/libs/timer/ (props changed)
branches/release/libs/tr1/ (props changed)
branches/release/libs/type_traits/ (props changed)
branches/release/libs/type_traits/doc/ (props changed)
branches/release/libs/unordered/ (props changed)
branches/release/libs/utility/ (props changed)
branches/release/libs/utility/swap.html (props changed)
branches/release/libs/utility/swap/test/std_bitset.cpp (props changed)
branches/release/libs/utility/value_init.htm (props changed)
branches/release/libs/utility/value_init_test.cpp (props changed)
branches/release/libs/uuid/ (props changed)
branches/release/libs/wave/ (props changed)
branches/release/more/ (props changed)
branches/release/more/getting_started/ (props changed)
branches/release/rst.css (props changed)
branches/release/status/ (props changed)
branches/release/status/Jamfile.v2 (props changed)
branches/release/status/explicit-failures-markup.xml (props changed)
branches/release/tools/ (props changed)
branches/release/tools/bcp/ (props changed)
branches/release/tools/boostbook/ (props changed)
branches/release/tools/build/v2/ (props changed)
branches/release/tools/inspect/ (props changed)
branches/release/tools/quickbook/ (props changed)
branches/release/tools/regression/ (props changed)
branches/release/tools/regression/src/library_status.cpp (props changed)
branches/release/tools/release/ (props changed)
branches/release/tools/wave/ (props changed)
Text files modified:
branches/release/boost/spirit/home/classic/error_handling/exceptions.hpp | 4 +-
branches/release/boost/spirit/home/classic/utility/functor_parser.hpp | 6 ++--
branches/release/boost/spirit/home/classic/utility/loops.hpp | 20 ++++++++--------
branches/release/boost/spirit/home/karma/numeric/detail/real_utils.hpp | 11 ++++++--
branches/release/boost/spirit/home/support/iterators/detail/fixed_size_queue.hpp | 48 +++++++++++++++++++++------------------
branches/release/boost/spirit/home/support/iterators/detail/fixed_size_queue_policy.hpp | 37 +++++++++++++++++-------------
branches/release/libs/spirit/test/Jamfile | 1
7 files changed, 71 insertions(+), 56 deletions(-)
Modified: branches/release/boost/spirit/home/classic/error_handling/exceptions.hpp
==============================================================================
--- branches/release/boost/spirit/home/classic/error_handling/exceptions.hpp (original)
+++ branches/release/boost/spirit/home/classic/error_handling/exceptions.hpp 2010-10-19 08:49:10 EDT (Tue, 19 Oct 2010)
@@ -222,9 +222,9 @@
error_status(
result_t result_ = fail,
- std::ptrdiff_t length = -1,
+ std::ptrdiff_t length_ = -1,
T const& value_ = T())
- : result(result_), length(length), value(value_) {}
+ : result(result_), length(length_), value(value_) {}
result_t result;
std::ptrdiff_t length;
Modified: branches/release/boost/spirit/home/classic/utility/functor_parser.hpp
==============================================================================
--- branches/release/boost/spirit/home/classic/utility/functor_parser.hpp (original)
+++ branches/release/boost/spirit/home/classic/utility/functor_parser.hpp 2010-10-19 08:49:10 EDT (Tue, 19 Oct 2010)
@@ -54,13 +54,13 @@
typedef typename ScannerT::iterator_t iterator_t;
iterator_t const s(scan.first);
- functor_result_t result;
- std::ptrdiff_t len = functor(scan, result);
+ functor_result_t functor_result;
+ std::ptrdiff_t len = functor(scan, functor_result);
if (len < 0)
return scan.no_match();
else
- return scan.create_match(std::size_t(len), result, s, scan.first);
+ return scan.create_match(std::size_t(len), functor_result, s, scan.first);
}
};
Modified: branches/release/boost/spirit/home/classic/utility/loops.hpp
==============================================================================
--- branches/release/boost/spirit/home/classic/utility/loops.hpp (original)
+++ branches/release/boost/spirit/home/classic/utility/loops.hpp 2010-10-19 08:49:10 EDT (Tue, 19 Oct 2010)
@@ -47,8 +47,8 @@
typedef fixed_loop<ParserT, ExactT> self_t;
typedef unary<ParserT, parser<self_t> > base_t;
- fixed_loop (ParserT const & subject, ExactT const & exact)
- : base_t(subject), m_exact(exact) {}
+ fixed_loop (ParserT const & subject_, ExactT const & exact)
+ : base_t(subject_), m_exact(exact) {}
template <typename ScannerT>
typename parser_result <self_t, ScannerT>::type
@@ -112,8 +112,8 @@
typedef finite_loop <ParserT, MinT, MaxT> self_t;
typedef unary<ParserT, parser<self_t> > base_t;
- finite_loop (ParserT const & subject, MinT const & min, MaxT const & max)
- : base_t(subject), m_min(min), m_max(max) {}
+ finite_loop (ParserT const & subject_, MinT const & min, MaxT const & max)
+ : base_t(subject_), m_min(min), m_max(max) {}
template <typename ScannerT>
typename parser_result <self_t, ScannerT>::type
@@ -196,11 +196,11 @@
typedef unary<ParserT, parser<self_t> > base_t;
infinite_loop (
- ParserT const& subject,
+ ParserT const& subject_,
MinT const& min,
more_t const&
)
- : base_t(subject), m_min(min) {}
+ : base_t(subject_), m_min(min) {}
template <typename ScannerT>
typename parser_result <self_t, ScannerT>::type
@@ -253,9 +253,9 @@
template <typename ParserT>
fixed_loop <ParserT, ExactT>
- operator[](parser <ParserT> const & subject) const
+ operator[](parser <ParserT> const & subject_) const
{
- return fixed_loop <ParserT, ExactT> (subject.derived (), m_exact);
+ return fixed_loop <ParserT, ExactT> (subject_.derived (), m_exact);
}
ExactT m_exact;
@@ -283,11 +283,11 @@
template <typename ParserT>
typename impl::loop_traits<ParserT, MinT, MaxT>::type
- operator[](parser <ParserT> const & subject) const
+ operator[](parser <ParserT> const & subject_) const
{
typedef typename impl::loop_traits<ParserT, MinT, MaxT>::type ret_t;
return ret_t(
- subject.derived(),
+ subject_.derived(),
m_min,
m_max);
}
Modified: branches/release/boost/spirit/home/karma/numeric/detail/real_utils.hpp
==============================================================================
--- branches/release/boost/spirit/home/karma/numeric/detail/real_utils.hpp (original)
+++ branches/release/boost/spirit/home/karma/numeric/detail/real_utils.hpp 2010-10-19 08:49:10 EDT (Tue, 19 Oct 2010)
@@ -142,8 +142,13 @@
dim = log10(n);
if (dim > 0)
n /= spirit::detail::pow10<U>(detail::truncate_to_long::call(dim));
- else if (n < 1.)
- n *= spirit::detail::pow10<U>(detail::truncate_to_long::call(-dim) + 1);
+ else if (n < 1.) {
+ long exp = detail::truncate_to_long::call(-dim);
+ if (exp != -dim)
+ ++exp;
+ dim = -exp;
+ n *= spirit::detail::pow10<U>(exp);
+ }
}
// prepare numbers (sign, integer and fraction part)
@@ -206,7 +211,7 @@
if (r && 0 == (Policies::fmtflags::fixed & flags)) {
return p.template exponent<CharEncoding, Tag>(sink,
- detail::truncate_to_long::call(dim >= 0 ? dim : dim - 1));
+ detail::truncate_to_long::call(dim));
}
return r;
}
Modified: branches/release/boost/spirit/home/support/iterators/detail/fixed_size_queue.hpp
==============================================================================
--- branches/release/boost/spirit/home/support/iterators/detail/fixed_size_queue.hpp (original)
+++ branches/release/boost/spirit/home/support/iterators/detail/fixed_size_queue.hpp 2010-10-19 08:49:10 EDT (Tue, 19 Oct 2010)
@@ -33,21 +33,22 @@
///////////////////////////////////////////////////////////////////////////
template <typename Queue, typename T, typename Pointer>
class fsq_iterator
- : public boost::iterator_adaptor<
- fsq_iterator<Queue, T, Pointer>, Pointer, T,
+ : public boost::iterator_facade<
+ fsq_iterator<Queue, T, Pointer>, T,
std::random_access_iterator_tag
>
{
public:
typedef typename Queue::position_type position_type;
- typedef boost::iterator_adaptor<
- fsq_iterator<Queue, T, Pointer>, Pointer, T,
+ typedef boost::iterator_facade<
+ fsq_iterator<Queue, T, Pointer>, T,
std::random_access_iterator_tag
> base_type;
fsq_iterator() {}
fsq_iterator(position_type const &p_) : p(p_) {}
+ position_type &get_position() { return p; }
position_type const &get_position() const { return p; }
private:
@@ -73,30 +74,30 @@
--p.pos;
}
- template <
- typename OtherDerived, typename OtherIterator,
- typename V, typename C, typename R, typename D
- >
- bool equal(iterator_adaptor<OtherDerived, OtherIterator, V, C, R, D>
- const &x) const
+ bool is_eof() const
{
- position_type const &rhs_pos =
- static_cast<OtherDerived const &>(x).get_position();
+ return p.self == 0 || p.pos == p.self->size();
+ }
+
+ template <typename Q, typename T_, typename P>
+ bool equal(fsq_iterator<Q, T_, P> const &x) const
+ {
+ if (is_eof())
+ return x.is_eof();
+ if (x.is_eof())
+ return false;
+
+ position_type const &rhs_pos = x.get_position();
return (p.self == rhs_pos.self) && (p.pos == rhs_pos.pos);
}
- template <
- typename OtherDerived, typename OtherIterator,
- typename V, typename C, typename R, typename D
- >
+ template <typename Q, typename T_, typename P>
typename base_type::difference_type distance_to(
- iterator_adaptor<OtherDerived, OtherIterator, V, C, R, D>
- const &x) const
+ fsq_iterator<Q, T_, P> const &x) const
{
typedef typename base_type::difference_type difference_type;
- position_type const &p2 =
- static_cast<OtherDerived const &>(x).get_position();
+ position_type const &p2 = x.get_position();
std::size_t pos1 = p.pos;
std::size_t pos2 = p2.pos;
@@ -161,6 +162,9 @@
position(const fixed_size_queue* s, std::size_t p)
: self(const_cast<fixed_size_queue*>(s)), pos(p)
{}
+
+ bool is_initialized() const { return self != 0; }
+ void set_queue(fixed_size_queue* q) { self = q; }
};
public:
@@ -206,12 +210,12 @@
iterator end()
{
- return iterator(position(this, m_tail));
+ return iterator(position(0, m_tail));
}
const_iterator end() const
{
- return const_iterator(position(this, m_tail));
+ return const_iterator(position(0, m_tail));
}
std::size_t size() const
Modified: branches/release/boost/spirit/home/support/iterators/detail/fixed_size_queue_policy.hpp
==============================================================================
--- branches/release/boost/spirit/home/support/iterators/detail/fixed_size_queue_policy.hpp (original)
+++ branches/release/boost/spirit/home/support/iterators/detail/fixed_size_queue_policy.hpp 2010-10-19 08:49:10 EDT (Tue, 19 Oct 2010)
@@ -41,11 +41,11 @@
unique() {}
unique(unique const& x)
- : queuePosition(x.queuePosition) {}
+ : queued_position(x.queued_position) {}
void swap(unique& x)
{
- boost::swap(queuePosition, x.queuePosition);
+ boost::swap(queued_position, x.queued_position);
}
// This is called when the iterator is dereferenced. It's a
@@ -55,11 +55,13 @@
static typename MultiPass::reference
dereference(MultiPass const& mp)
{
- if (mp.queuePosition == mp.shared()->queuedElements.end())
- {
+ if (!mp.queued_position.get_position().is_initialized())
+ mp.queued_position.get_position().set_queue(&mp.shared()->queued_elements);
+
+ if (mp.queued_position == mp.shared()->queued_elements.end())
return MultiPass::get_input(mp);
- }
- return *mp.queuePosition;
+
+ return *mp.queued_position;
}
// This is called when the iterator is incremented. It's a
@@ -68,17 +70,20 @@
template <typename MultiPass>
static void increment(MultiPass& mp)
{
- if (mp.queuePosition == mp.shared()->queuedElements.end())
+ if (!mp.queued_position.get_position().is_initialized())
+ mp.queued_position.get_position().set_queue(&mp.shared()->queued_elements);
+
+ if (mp.queued_position == mp.shared()->queued_elements.end())
{
// don't let the queue get larger than N
- if (mp.shared()->queuedElements.size() >= N)
- mp.shared()->queuedElements.pop_front();
+ if (mp.shared()->queued_elements.size() >= N)
+ mp.shared()->queued_elements.pop_front();
- mp.shared()->queuedElements.push_back(
+ mp.shared()->queued_elements.push_back(
MultiPass::get_input(mp));
MultiPass::advance_input(mp);
}
- ++mp.queuePosition;
+ ++mp.queued_position;
}
// clear_queue is a no-op
@@ -87,7 +92,7 @@
template <typename MultiPass>
static bool is_eof(MultiPass const& mp)
{
- return mp.queuePosition == mp.shared()->queuedElements.end() &&
+ return mp.queued_position == mp.shared()->queued_elements.end() &&
MultiPass::input_at_eof(mp);
}
@@ -95,18 +100,18 @@
template <typename MultiPass>
static bool equal_to(MultiPass const& mp, MultiPass const& x)
{
- return mp.queuePosition == x.queuePosition;
+ return mp.queued_position == x.queued_position;
}
// called by operator<
template <typename MultiPass>
static bool less_than(MultiPass const& mp, MultiPass const& x)
{
- return mp.queuePosition < x.queuePosition;
+ return mp.queued_position < x.queued_position;
}
protected:
- mutable typename queue_type::iterator queuePosition;
+ mutable typename queue_type::iterator queued_position;
};
///////////////////////////////////////////////////////////////////////
@@ -114,7 +119,7 @@
struct shared
{
typedef detail::fixed_size_queue<Value, N> queue_type;
- queue_type queuedElements;
+ queue_type queued_elements;
};
};
Modified: branches/release/libs/spirit/test/Jamfile
==============================================================================
--- branches/release/libs/spirit/test/Jamfile (original)
+++ branches/release/libs/spirit/test/Jamfile 2010-10-19 08:49:10 EDT (Tue, 19 Oct 2010)
@@ -161,6 +161,7 @@
[ run karma/semantic_action_attribute.cpp : : : : ]
[ compile qi/single_element_sequence_attribute.cpp : : qi_single_element_sequence_attribute ]
[ compile qi/debug_optional.cpp : : qi_debug_optional ]
+ [ run karma/real_scientific.cpp : : : : ]
;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk