Boost logo

Boost-Commit :

From: eric_at_[hidden]
Date: 2008-03-06 18:03:11


Author: eric_niebler
Date: 2008-03-06 18:03:09 EST (Thu, 06 Mar 2008)
New Revision: 43533
URL: http://svn.boost.org/trac/boost/changeset/43533

Log:
Merged revisions 43518-43532 via svnmerge from
https://svn.boost.org/svn/boost/trunk

........
  r43523 | eric_niebler | 2008-03-05 17:56:57 -0800 (Wed, 05 Mar 2008) | 1 line
  
  fix documentation about droppable, replace accumulator_set_wrapper example with bind() and ref()
........
  r43524 | hkaiser | 2008-03-05 19:28:47 -0800 (Wed, 05 Mar 2008) | 1 line
  
  Wave: Fixed #1673.
........
  r43525 | emildotchevski | 2008-03-05 21:08:22 -0800 (Wed, 05 Mar 2008) | 1 line
  
  hooking up boost exception for testing
........
  r43526 | vladimir_prus | 2008-03-05 22:06:17 -0800 (Wed, 05 Mar 2008) | 6 lines
  
  Add 'pythonpath' feature to specify additional PYTHONPATH elements.
  Make bpl-test correctly set dependencies if used with multiple .pyd
  sources.
  
  Patch from Joshua Napoli.
........
  r43527 | vladimir_prus | 2008-03-05 22:57:27 -0800 (Wed, 05 Mar 2008) | 6 lines
  
  Arrange for HPP source to be scanned for #includes, too.
  This fixes PCH not being rebuild when some other headers
  included from HPP being compiled change.
  
  Thanks to Pierre-Luc Neron for the bug report.
........
  r43528 | anthonyw | 2008-03-05 23:59:16 -0800 (Wed, 05 Mar 2008) | 1 line
  
  made the callable_no_args function object a named object rather than a temporary, in order to avoid gratuitous breakage on some compilers
........
  r43530 | eric_niebler | 2008-03-06 09:56:42 -0800 (Thu, 06 Mar 2008) | 1 line
  
  work around msvc-7.1 bug
........
  r43531 | eric_niebler | 2008-03-06 10:07:22 -0800 (Thu, 06 Mar 2008) | 1 line
  
  fix warnings
........

Added:
   branches/proto/v3/libs/exception/test/Jamfile.v2
      - copied unchanged from r43531, /trunk/libs/exception/test/Jamfile.v2
   branches/proto/v3/libs/wave/test/testwave/testfiles/t_1_038.cpp
      - copied unchanged from r43531, /trunk/libs/wave/test/testwave/testfiles/t_1_038.cpp
Removed:
   branches/proto/v3/libs/exception/test/Jamfile
Properties modified:
   branches/proto/v3/ (props changed)
Text files modified:
   branches/proto/v3/boost/foreach.hpp | 8
   branches/proto/v3/boost/wave/cpp_context.hpp | 4
   branches/proto/v3/boost/wave/util/cpp_iterator.hpp | 22
   branches/proto/v3/boost/wave/util/cpp_macromap.hpp | 56 ++--
   branches/proto/v3/boost/wave/util/cpp_macromap_utils.hpp | 7
   branches/proto/v3/libs/accumulators/doc/accumulators.qbk | 165 ++++++++------
   branches/proto/v3/libs/thread/test/test_thread_launching.cpp | 3
   branches/proto/v3/libs/wave/ChangeLog | 2
   branches/proto/v3/libs/wave/test/testwave/testfiles/t_1_013.cpp | 1
   branches/proto/v3/libs/wave/test/testwave/testfiles/test.cfg | 453 ++++++++++++++++++++-------------------
   branches/proto/v3/status/Jamfile.v2 | 1
   branches/proto/v3/tools/build/v2/tools/builtin.jam | 9
   branches/proto/v3/tools/build/v2/tools/python.jam | 18 +
   branches/proto/v3/tools/wave/build/Jamfile.v2 | 2
   14 files changed, 411 insertions(+), 340 deletions(-)

Modified: branches/proto/v3/boost/foreach.hpp
==============================================================================
--- branches/proto/v3/boost/foreach.hpp (original)
+++ branches/proto/v3/boost/foreach.hpp 2008-03-06 18:03:09 EST (Thu, 06 Mar 2008)
@@ -411,7 +411,11 @@
 ///////////////////////////////////////////////////////////////////////////////
 // set_false
 //
-inline bool set_false(bool &b) { return b = false; }
+inline bool set_false(bool &b)
+{
+ b = false;
+ return false;
+}
 
 ///////////////////////////////////////////////////////////////////////////////
 // to_ptr
@@ -471,7 +475,7 @@
 };
 
 template<typename T>
-rvalue_probe<T> const make_probe(T const &t)
+rvalue_probe<T> const make_probe(T const &)
 {
     return rvalue_probe<T>();
 }

Modified: branches/proto/v3/boost/wave/cpp_context.hpp
==============================================================================
--- branches/proto/v3/boost/wave/cpp_context.hpp (original)
+++ branches/proto/v3/boost/wave/cpp_context.hpp 2008-03-06 18:03:09 EST (Thu, 06 Mar 2008)
@@ -332,10 +332,10 @@
     template <typename IteratorT2>
     token_type expand_tokensequence(IteratorT2 &first_, IteratorT2 const &last_,
         token_sequence_type &pending, token_sequence_type &expanded,
- bool expand_undefined = false)
+ bool& seen_newline, bool expand_undefined = false)
     {
         return macros.expand_tokensequence(first_, last_, pending, expanded,
- expand_undefined);
+ seen_newline, expand_undefined);
     }
 
     template <typename IteratorT2>

Modified: branches/proto/v3/boost/wave/util/cpp_iterator.hpp
==============================================================================
--- branches/proto/v3/boost/wave/util/cpp_iterator.hpp (original)
+++ branches/proto/v3/boost/wave/util/cpp_iterator.hpp 2008-03-06 18:03:09 EST (Thu, 06 Mar 2008)
@@ -283,8 +283,8 @@
         bool include_next);
     
 protected:
- result_type const &get_next_token();
- result_type const &pp_token(bool consider_emitting_line_directive = false);
+ result_type const &get_next_token(bool& skipped_newline);
+ result_type const &pp_token(bool& skipped_newline);
 
     bool pp_directive();
     template <typename IteratorT>
@@ -340,6 +340,7 @@
     boost::shared_ptr<base_iteration_context_type> iter_ctx;
     
     bool seen_newline; // needed for recognizing begin of line
+ bool skipped_newline; // a newline has been skipped since last one
     bool must_emit_line_directive; // must emit a line directive
     result_type act_token; // current token
     typename result_type::position_type &act_pos; // current fileposition (references the macromap)
@@ -463,16 +464,15 @@
     ctx.init_context();
     
     // loop over skip able whitespace until something significant is found
- bool skipped_newline = false;
     bool was_seen_newline = seen_newline;
     token_id id = T_UNKNOWN;
         
     try { // catch lexer exceptions
         do {
         // get_next_token assigns result to act_token member
- if (!seen_newline && skipped_newline)
+ if (skipped_newline)
                 seen_newline = true;
- get_next_token();
+ get_next_token(skipped_newline);
 
         // if comments shouldn't be preserved replace them with newlines
             id = token_id(act_token);
@@ -553,7 +553,7 @@
 
     default: // make sure whitespace at line begin keeps seen_newline status
         if (IS_CATEGORY(id, WhiteSpaceTokenType))
- seen_newline = skipped_newline;
+ seen_newline = was_seen_newline;
         break;
     }
 
@@ -573,14 +573,14 @@
 ///////////////////////////////////////////////////////////////////////////////
 template <typename ContextT>
 inline typename pp_iterator_functor<ContextT>::result_type const &
-pp_iterator_functor<ContextT>::get_next_token()
+pp_iterator_functor<ContextT>::get_next_token(bool& skipped_newline)
 {
     using namespace boost::wave;
     
 // 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())
- return pp_token(); // return next token
+ return pp_token(skipped_newline); // return next token
     
 // test for EOF, if there is a pending input context, pop it back and continue
 // parsing with it
@@ -657,7 +657,7 @@
             else if (ctx.get_if_block_status()) {
             // preprocess this token, eat up more, if appropriate, return
             // the next preprocessed token
- return pp_token(was_seen_newline);
+ return pp_token(skipped_newline);
             }
             else {
             // compilation condition is false: if the current token is a
@@ -785,7 +785,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 template <typename ContextT>
 inline typename pp_iterator_functor<ContextT>::result_type const &
-pp_iterator_functor<ContextT>::pp_token(bool consider_emitting_line_directive)
+pp_iterator_functor<ContextT>::pp_token(bool& skipped_newline)
 {
     using namespace boost::wave;
 
@@ -809,7 +809,7 @@
         // call the lexer, preprocess the required number of tokens, put them
         // into the unput queue
             act_token = ctx.expand_tokensequence(iter_ctx->first,
- iter_ctx->last, pending_queue, unput_queue);
+ iter_ctx->last, pending_queue, unput_queue, skipped_newline);
         }
         else {
         // simply return the next token

Modified: branches/proto/v3/boost/wave/util/cpp_macromap.hpp
==============================================================================
--- branches/proto/v3/boost/wave/util/cpp_macromap.hpp (original)
+++ branches/proto/v3/boost/wave/util/cpp_macromap.hpp 2008-03-06 18:03:09 EST (Thu, 06 Mar 2008)
@@ -121,7 +121,7 @@
     template <typename IteratorT, typename ContainerT>
     token_type const &expand_tokensequence(IteratorT &first,
         IteratorT const &last, ContainerT &pending, ContainerT &expanded,
- bool expand_operator_defined);
+ bool& seen_newline, bool expand_operator_defined);
 
 // Expand all macros inside the given token sequence
     template <typename IteratorT, typename ContainerT>
@@ -159,27 +159,29 @@
     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 expand_operator_defined);
+ 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,
- IteratorT &next, IteratorT const &end, SizeT const &parameter_count);
+ 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,
- SizeT const &parameter_count);
+ 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_operator_defined,
+ 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__)
@@ -216,7 +218,7 @@
 // Resolve operator _Pragma or the #pragma directive
     template <typename IteratorT, typename ContainerT>
     bool resolve_operator_pragma(IteratorT &first,
- IteratorT const &last, ContainerT &expanded);
+ IteratorT const &last, ContainerT &expanded, bool& seen_newline);
 
 // Handle the concatenation operator '##'
     template <typename ContainerT>
@@ -530,7 +532,7 @@
 inline typename ContextT::token_type const &
 macromap<ContextT>::expand_tokensequence(IteratorT &first,
     IteratorT const &last, ContainerT &pending, ContainerT &expanded,
- bool expand_operator_defined)
+ bool& seen_newline, bool expand_operator_defined)
 {
     typedef impl::gen_unput_queue_iterator<IteratorT, token_type, ContainerT>
         gen_type;
@@ -542,7 +544,7 @@
 on_exit::assign<IteratorT, iterator_type> on_exit(first, first_it);
 
     return expand_tokensequence_worker(pending, first_it, last_it,
- expand_operator_defined);
+ seen_newline, expand_operator_defined);
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -564,7 +566,7 @@
     ContainerT &pending,
     unput_queue_iterator<IteratorT, token_type, ContainerT> &first,
     unput_queue_iterator<IteratorT, token_type, ContainerT> const &last,
- bool expand_operator_defined)
+ bool& seen_newline, bool expand_operator_defined)
 {
 // if there exist pending tokens (tokens, which are already preprocessed), then
 // return the next one from there
@@ -607,7 +609,7 @@
             // in C99 mode only: resolve the operator _Pragma
             token_type curr_token = *first;
             
- if (!resolve_operator_pragma(first, last, pending) ||
+ if (!resolve_operator_pragma(first, last, pending, seen_newline) ||
                     pending.size() > 0)
                 {
                 // unknown to us pragma or supplied replacement, return the
@@ -629,7 +631,7 @@
             // the current token contains an identifier, which is currently
             // defined as a macro
                 if (expand_macro(pending, name_token, it, first, last,
- expand_operator_defined))
+ seen_newline, expand_operator_defined))
                 {
                 // the tokens returned by expand_macro should be rescanned
                 // beginning at the last token of the returned replacement list
@@ -657,7 +659,7 @@
 
             // return the next preprocessed token
                 return expand_tokensequence_worker(pending, first, last,
- expand_operator_defined);
+ seen_newline, expand_operator_defined);
             }
 // else if (expand_operator_defined) {
 // // in preprocessing conditionals undefined identifiers and keywords
@@ -702,14 +704,14 @@
 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)
+ 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,
     std::vector<ContainerT> &arguments, IteratorT &next, IteratorT &endparen,
- IteratorT const &end, SizeT const &parameter_count)
+ IteratorT const &end, SizeT const &parameter_count, bool& seen_newline)
 #endif
 {
     using namespace boost::wave;
@@ -805,10 +807,12 @@
             was_whitespace = false;
             break;
 
+ case T_NEWLINE:
+ seen_newline = true;
+ /* fall through */
         case T_SPACE:
         case T_SPACE2:
         case T_CCOMMENT:
- case T_NEWLINE:
             if (!was_whitespace)
                 argument->push_back(token_type(T_SPACE, " ", (*next).get_position()));
             was_whitespace = true;
@@ -863,10 +867,11 @@
 
 on_exit::assign<IteratorT, iterator_type> on_exit(first, first_it);
 ContainerT pending_queue;
+bool seen_newline;
     
     while (!pending_queue.empty() || first_it != last_it) {
         token_type t = expand_tokensequence_worker(pending_queue, first_it,
- last_it, expand_operator_defined);
+ last_it, seen_newline, expand_operator_defined);
 
         expanded.push_back(t);
     }
@@ -1146,8 +1151,8 @@
 macromap<ContextT>::expand_macro(ContainerT &expanded,
     token_type const &curr_token, typename defined_macros_type::iterator it,
     IteratorT &first, IteratorT const &last,
- bool expand_operator_defined, defined_macros_type *scope,
- ContainerT *queue_symbol)
+ bool& seen_newline, bool expand_operator_defined,
+ defined_macros_type *scope, ContainerT *queue_symbol)
 {
     using namespace boost::wave;
     
@@ -1202,7 +1207,7 @@
 
     if (T_LEFTPAREN == impl::next_token<IteratorT>::peek(first, last)) {
     // called as a function-like macro
- impl::skip_to_token(first, last, T_LEFTPAREN);
+ impl::skip_to_token(first, last, T_LEFTPAREN, seen_newline);
         
 #if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS == 0
         IteratorT seqstart = first;
@@ -1217,11 +1222,11 @@
 #if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0
         typename std::vector<ContainerT>::size_type count_args =
             collect_arguments (curr_token, arguments, first, last,
- macro_def.macroparameters.size());
+ macro_def.macroparameters.size(), seen_newline);
 #else
         typename std::vector<ContainerT>::size_type count_args =
             collect_arguments (curr_token, arguments, first, seqend, last,
- macro_def.macroparameters.size());
+ macro_def.macroparameters.size(), seen_newline);
 #endif
 
         // verify the parameter count
@@ -1491,12 +1496,12 @@
 template <typename IteratorT, typename ContainerT>
 inline bool
 macromap<ContextT>::resolve_operator_pragma(IteratorT &first,
- IteratorT const &last, ContainerT &pending)
+ 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(first, last, T_LEFTPAREN)) {
+ if (!impl::skip_to_token(first, last, T_LEFTPAREN, seen_newline)) {
     // illformed operator _Pragma
         BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, ill_formed_expression,
             "operator _Pragma()", pragma_token.get_position());
@@ -1506,11 +1511,12 @@
     std::vector<ContainerT> arguments;
 #if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0
     typename std::vector<ContainerT>::size_type count_args =
- collect_arguments (pragma_token, arguments, first, last, 1);
+ 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);
+ collect_arguments (pragma_token, arguments, first, endparen, last, 1,
+ seen_newline);
 #endif
 
 // verify the parameter count

Modified: branches/proto/v3/boost/wave/util/cpp_macromap_utils.hpp
==============================================================================
--- branches/proto/v3/boost/wave/util/cpp_macromap_utils.hpp (original)
+++ branches/proto/v3/boost/wave/util/cpp_macromap_utils.hpp 2008-03-06 18:03:09 EST (Thu, 06 Mar 2008)
@@ -438,7 +438,8 @@
 ///////////////////////////////////////////////////////////////////////////////
 template <typename IteratorT>
 inline bool
-skip_to_token(IteratorT &it, IteratorT const &end, token_id id)
+skip_to_token(IteratorT &it, IteratorT const &end, token_id id,
+ bool& seen_newline)
 {
     using namespace boost::wave;
     if (token_id(*it) == id)
@@ -447,8 +448,10 @@
         return false;
 
     while (IS_CATEGORY(*it, WhiteSpaceTokenType) ||
- T_NEWLINE == token_id(*it))
+ T_NEWLINE == token_id(*it))
     {
+ if (T_NEWLINE == token_id(*it))
+ seen_newline = true;
         if (++it == end)
             return false;
     }

Modified: branches/proto/v3/libs/accumulators/doc/accumulators.qbk
==============================================================================
--- branches/proto/v3/libs/accumulators/doc/accumulators.qbk (original)
+++ branches/proto/v3/libs/accumulators/doc/accumulators.qbk 2008-03-06 18:03:09 EST (Thu, 06 Mar 2008)
@@ -247,34 +247,8 @@
 This works, but some accumulators are not cheap to copy. For
 example, the _tail_ and _tail_variate_ accumulators must store a `std::vector<>`, so copying
 these accumulators involves a dynamic allocation. We might be better off in this
-case to define a wrapper that stores a reference to an _accumulator_set_ and forwards the
-function call operator to it. See below:
-
- template< typename Sample, typename Features, typename Weight >
- struct accumulator_set_wrapper
- : std::unary_function< Sample, void >
- {
- accumulator_set_wrapper( accumulator_set< Sample, Features, Weight > & acc )
- : acc_(acc)
- {
- }
-
- void operator()( Sample const & sample )
- {
- this->acc_( sample );
- }
- private:
- accumulator_set< Sample, Features, Weight > & acc_;
- };
-
- template< typename Sample, typename Features, typename Weight >
- accumulator_set_wrapper< typename Sample, typename Features, typename Weight >
- make_accumulator_set_wrapper( accumulator_set< Sample, Features, Weight > & acc )
- {
- return acc;
- }
-
-You might use such an `accumulator_set_wrapper<>` as follows:
+case passing the accumulator by reference, with the help of `boost::bind()` and
+`boost::ref()`. See below:
 
     // The data for which we wish to calculate statistical properties:
     std::vector< double > data( /* stuff */ );
@@ -284,10 +258,13 @@
         tag::tail<left>::cache_size = 4 );
 
     // Use std::for_each to accumulate the statistical properties:
- std::for_each( data.begin(), data.end(), make_accumulator_set_wrapper( acc ) );
+ std::for_each( data.begin(), data.end(), bind<void>( ref(acc), _1 ) );
+
+Notice now that we don't care about the return value of `std::for_each()` anymore because
+`std::for_each()` is modifying `acc` directly.
 
-Notice now that we don't care about the return value of `std::for_each` anymore because
-`std::for_each` is modifying `acc` directly.
+[note To use `boost::bind()` and `boost::ref()`, you must `#include` [^<boost/bind.hpp>]
+and [^<boost/ref.hpp>]]
 
 [endsect]
 
@@ -598,54 +575,106 @@
 [h3 Droppable Accumulators]
 
 The term "droppable" refers to an accumulator that can be removed from the _accumulator_set_.
-You can request that an accumulator be made droppable by using the _droppable_ class template,
-as follows:
+You can request that an accumulator be made droppable by using the _droppable_ class template.
+
+ // calculate sum and count, make sum droppable:
+ accumulator_set< double, features< tag::count, droppable<tag::sum> > > acc;
 
- // calculate sum and mean, make mean droppable
- accumulator_set< double, features< tag::sum, droppable<tag::mean> > > acc;
-
     // add some data
- acc(1.0);
+ acc(3.0);
     acc(2.0);
 
- // drop the mean (mean is 1.5 here)
- acc.drop<tag::mean>();
+ // drop the sum (sum is 5 here)
+ acc.drop<tag::sum>();
     
     // add more data
- acc(3.0);
+ acc(1.0);
     
- // This will display "6" and "1.5"
- std::cout << sum(acc) << '\n' << mean(acc);
+ // This will display "3" and "5"
+ std::cout << count(acc) << ' ' << sum(acc);
+
+Any accumulators that get added to an accumulator set in order to satisfy
+dependencies on droppable accumulators are themselves droppable. Consider
+the following accumulator:
 
-Dropping an accumulator essentially freezes it in its current state. It no longer gets
-updates. For many accumulators, not receiving updates is sufficient to freeze their
-states. But for the `mean_accumulator` defined above, that's not the case. Its
-result depends on the `sum` and `count` accumulators, which are not frozen. Instead,
-it needs to save its result at the point it is dropped. The Accumulators Framework
-provides some utilities to make this simple. Simply create the following
-specialization of _droppable_accumulator_:
+ // Sum is not droppable. Mean is droppable. Count, brought in to
+ // satisfy mean's dependencies, is implicitly droppable, too.
+ accumulator_set< double, features< tag::sum, droppable<tag::mean> > > acc;
 
- namespace boost { namespace accumulators {
+`mean` depends on `sum` and `count`. Since `mean` is droppable, so too is `count`.
+However, we have explictitly requested that `sum` be not droppable, so it isn't. Had
+we left `tag::sum` out of the above declaration, the `sum` accumulator would have
+been implicitly droppable.
+
+A droppable accumulator is reference counted, and is only really dropped after all the
+accumulators that depend on it have been dropped. This can lead to some surprising
+behavior in some situations.
     
- // cache the result at the point the accumulator is dropped.
- template<typename Sample>
- struct droppable_accumulator<impl::mean_accumulator<Sample> >
- : droppable_accumulator_base<
- with_cached_result<impl::mean_accumulator<Sample> >
- >
- {
- template<typename Args>
- droppable_accumulator(Args const & args)
- : droppable_accumulator::base(args)
- {
- }
- };
+ // calculate sum and mean, make mean droppable.
+ accumulator_set< double, features< tag::sum, droppable<tag::mean> > > acc;
     
- }}
-
-This specialization will get used whenever `mean_accumulator<>` is made droppable.
-The `with_cached_result<>` utility causes the result to be cached at the point
-the accumulator is dropped by implementing `on_drop(Args)` appropriately.
+ // add some data
+ acc(1.0);
+ acc(2.0);
+
+ // drop the mean. mean's reference count
+ // drops to 0, so it's really dropped. So
+ // too, count's reference count drops to 0
+ // and is really dropped.
+ acc.drop<tag::mean>();
+
+ // add more data. Sum continues to accumulate!
+ acc(3.0);
+
+ // This will display "6 2 3"
+ std::cout << sum(acc) << ' '
+ << count(acc) << ' '
+ << mean(acc);
+
+Note that at the point at which `mean` is dropped, `sum` is 3, `count` is 2, and
+therefore `mean` is 1.5. But since `sum` continues to accumulate even after `mean`
+has been dropped, the value of `mean` continues to change. If you want to remember
+the value of `mean` at the point it is dropped, you should save its value into
+a local variable.
+
+The following rules more precisely specify how droppable and non-droppable
+accumulators behave within an accumulator set.
+
+* There are two types of accumulators: droppable and non-droppable.
+ The default is non-droppable.
+* For any feature `X`, both `X` and `droppable<X>` satisfy the `X` dependency.
+* If feature `X` depends on `Y` and `Z`, then `droppable<X>` depends on
+ `droppable<Y>` and `droppable<Z>`.
+* All accumulators have `add_ref()` and `drop()` member functions.
+* For non-droppable accumulators, `drop()` is a no-op, and `add_ref()`
+ invokes `add_ref()` on all accumulators corresponding to the features
+ upon which the current accumulator depends.
+* Droppable accumulators have a reference count and define `add_ref()`
+ and `drop()` to manipulate the reference count.
+* For droppable accumulators, `add_ref()` increments the accumulator's
+ reference count, and also `add_ref()`'s the accumulators corresponding
+ to the features upon which the current accumulator depends.
+* For droppable accumulators, `drop()` decrements the accumulator's
+ reference count, and also `drop()`'s the accumulators corresponding to
+ the features upon which the current accumulator depends.
+* The accumulator_set constructor walks the list of *user-specified*
+ features and `add_ref()`'s the accumulator that corresponds to each of
+ them. (Note: that means that an accumulator that is not user-specified
+ but in the set merely to satisfy a dependency will be dropped as soon
+ as all its dependencies have been dropped. Ones that have been user
+ specified are not dropped until their dependencies have been
+ dropped *and* the user has explicitly dropped the accumulator.)
+* Droppable accumulators check their reference count in their
+ accumulate member function. If the reference count is 0, the function
+ is a no-op.
+* Users are not allowed to drop a feature that is not user-specified and
+ marked as droppable.
+
+And as an optimization:
+
+* If the user specifies the non-droppable feature `X`, which depends on `Y`
+ and `Z`, then the accumulators for `Y` and `Z` can be safely made
+ non-droppable, as well as any accumulators on which they depend.
 
 [endsect]
 

Deleted: branches/proto/v3/libs/exception/test/Jamfile
==============================================================================
--- branches/proto/v3/libs/exception/test/Jamfile 2008-03-06 18:03:09 EST (Thu, 06 Mar 2008)
+++ (empty file)
@@ -1,20 +0,0 @@
-# Boost Exception Library test Jamfile
-#
-# Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc.
-#
-# Distributed under the Boost Software License, Version 1.0. (See accompanying
-# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-import testing ;
-
-run cloning_test.cpp ;
-run unknown_exception_test.cpp ;
-run to_string_test.cpp ;
-run exception_test.cpp ;
-run boost_error_info_test.cpp ;
-run enable_error_info_test.cpp helper1.cpp ;
-run throw_exception_test.cpp helper2.cpp ;
-run errno_test.cpp ;
-run error_info_test.cpp ;
-run what_test.cpp ;
-compile-fail exception_fail.cpp ;

Modified: branches/proto/v3/libs/thread/test/test_thread_launching.cpp
==============================================================================
--- branches/proto/v3/libs/thread/test/test_thread_launching.cpp (original)
+++ branches/proto/v3/libs/thread/test/test_thread_launching.cpp 2008-03-06 18:03:09 EST (Thu, 06 Mar 2008)
@@ -37,7 +37,8 @@
 
 void test_thread_callable_object_no_arguments()
 {
- boost::thread callable((callable_no_args()));
+ callable_no_args func;
+ boost::thread callable(func);
     callable.join();
     BOOST_CHECK(callable_no_args::called);
 }

Modified: branches/proto/v3/libs/wave/ChangeLog
==============================================================================
--- branches/proto/v3/libs/wave/ChangeLog (original)
+++ branches/proto/v3/libs/wave/ChangeLog 2008-03-06 18:03:09 EST (Thu, 06 Mar 2008)
@@ -167,6 +167,8 @@
   (BOOST_HAS_THREADS).
 - Fixed a whitespace insertion glitch, where whitespace got inserted
   unconditionally between two operators even if one of these was a comma.
+- Fixed #line directive after a macro invocation containing newlines to
+ correctly reference the line number.
   
 Boost V1.34.0
 - Wave Version 1.2.4

Modified: branches/proto/v3/libs/wave/test/testwave/testfiles/t_1_013.cpp
==============================================================================
--- branches/proto/v3/libs/wave/test/testwave/testfiles/t_1_013.cpp (original)
+++ branches/proto/v3/libs/wave/test/testwave/testfiles/t_1_013.cpp 2008-03-06 18:03:09 EST (Thu, 06 Mar 2008)
@@ -30,6 +30,7 @@
 //R #line 22 "t_1_013.cpp"
 //R printf("x" "1" "= %d, x" "2" "= %s", x1, x2);
 //R fputs("strncmp(\"abc\\0d\?\", \"abc\", '\\4', \"\\u1234\") == 0" ": @\n", s);
+//R
 //R "vers2.hpp"
 //R "hello";
 //R "hello" ", world"

Modified: branches/proto/v3/libs/wave/test/testwave/testfiles/test.cfg
==============================================================================
--- branches/proto/v3/libs/wave/test/testwave/testfiles/test.cfg (original)
+++ branches/proto/v3/libs/wave/test/testwave/testfiles/test.cfg 2008-03-06 18:03:09 EST (Thu, 06 Mar 2008)
@@ -1,226 +1,227 @@
-#
-# Boost.Wave: A Standard compliant C++ preprocessor library
-# http://www.boost.org/
-#
-# Copyright (c) 2003-2006 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)
-#
-
-#
-# t_1: Macro expansion
-#
-t_1_001.cpp
-t_1_002.cpp
-t_1_003.cpp
-t_1_004.cpp
-t_1_005.cpp
-t_1_006.cpp
-t_1_007.cpp
-t_1_008.cpp
-t_1_009.cpp
-t_1_010.cpp
-t_1_011.cpp
-t_1_012.cpp
-t_1_013.cpp
-# t_1_014 currently disabled because of a known problem in the Wave library
-#t_1_014.cpp
-t_1_015.cpp
-t_1_016.cpp
-t_1_017.cpp
-t_1_018.cpp
-t_1_019.cpp
-t_1_020.cpp
-t_1_021.cpp
-t_1_022.cpp
-t_1_023.cpp
-t_1_024.cpp
-t_1_025.cpp
-t_1_026.cpp
-t_1_027.cpp
-t_1_028.cpp
-t_1_029.cpp
-t_1_030.cpp
-t_1_031.cpp
-t_1_032.cpp
-t_1_033.cpp
-t_1_034.cpp
-t_1_035.cpp
-t_1_036.cpp
-t_1_037.cpp
-
-#
-# t_2: Preprocessing directives
-#
-t_2_001.cpp
-t_2_002.cpp
-t_2_003.cpp
-t_2_004.cpp
-t_2_005.cpp
-t_2_006.cpp
-t_2_007.cpp
-t_2_008.cpp
-t_2_009.cpp
-t_2_010.cpp
-t_2_011.cpp
-t_2_012.cpp
-t_2_013.cpp
-t_2_014.cpp
-t_2_015.cpp
-t_2_016.cpp
-t_2_017.cpp
-
-#
-# t_3: Predefined macros
-#
-t_3_001.cpp
-t_3_002.cpp
-t_3_003.cpp
-t_3_004.cpp
-
-#
-# Preprocessing expressions
-#
-t_4_001.cpp
-t_4_002.cpp
-t_4_003.cpp
-t_4_004.cpp
-
-#
-# unit tests from the mcpp preprocessor validation suite
-# (general functionality)
-#
-t_5_001.cpp
-t_5_002.cpp
-t_5_003.cpp
-# t_5_004 is currently disabled because of a known problem in the Wave library
-#t_5_004.cpp
-t_5_005.cpp
-t_5_006.cpp
-t_5_007.cpp
-t_5_008.cpp
-t_5_009.cpp
-t_5_010.cpp
-t_5_011.cpp
-t_5_012.cpp
-t_5_013.cpp
-t_5_014.cpp
-t_5_015.cpp
-t_5_016.cpp
-t_5_017.cpp
-t_5_018.cpp
-t_5_019.cpp
-t_5_020.cpp
-t_5_021.cpp
-t_5_022.cpp
-t_5_023.cpp
-t_5_024.cpp
-t_5_025.cpp
-t_5_026.cpp
-t_5_027.cpp
-t_5_028.cpp
-t_5_029.cpp
-# t_5_030 contains one disabled test
-t_5_030.cpp
-t_5_031.cpp
-t_5_032.cpp
-t_5_033.cpp
-t_5_034.cpp
-t_5_035.cpp
-
-#
-# unit tests from the mcpp preprocessor validation suite
-# (error reporting)
-#
-t_6_001.cpp
-t_6_002.cpp
-t_6_003.cpp
-t_6_004.cpp
-t_6_005.cpp
-t_6_006.cpp
-t_6_007.cpp
-t_6_008.cpp
-t_6_009.cpp
-t_6_010.cpp
-t_6_011.cpp
-t_6_012.cpp
-t_6_013.cpp
-t_6_014.cpp
-t_6_015.cpp
-t_6_016.cpp
-t_6_017.cpp
-t_6_018.cpp
-t_6_019.cpp
-t_6_020.cpp
-t_6_021.cpp
-t_6_022.cpp
-t_6_023.cpp
-t_6_024.cpp
-t_6_025.cpp
-t_6_026.cpp
-t_6_027.cpp
-t_6_028.cpp
-t_6_029.cpp
-t_6_030.cpp
-t_6_031.cpp
-t_6_032.cpp
-t_6_033.cpp
-t_6_034.cpp
-t_6_035.cpp
-t_6_036.cpp
-t_6_037.cpp
-t_6_038.cpp
-t_6_039.cpp
-t_6_040.cpp
-t_6_041.cpp
-t_6_042.cpp
-t_6_043.cpp
-t_6_044.cpp
-t_6_045.cpp
-t_6_046.cpp
-t_6_047.cpp
-t_6_048.cpp
-t_6_049.cpp
-t_6_050.cpp
-t_6_051.cpp
-t_6_052.cpp
-t_6_053.cpp
-t_6_054.cpp
-t_6_055.cpp
-t_6_056.cpp
-t_6_057.cpp
-t_6_058.cpp
-t_6_059.cpp
-t_6_060.cpp
-t_6_061.cpp
-t_6_062.cpp
-t_6_063.cpp
-t_6_064.cpp
-t_6_065.cpp
-t_6_066.cpp
-t_6_067.cpp
-t_6_068.cpp
-t_6_069.cpp
-
-#
-# t_9: General preprocessing problems
-#
-t_9_001.cpp
-t_9_002.cpp
-t_9_003.cpp
-t_9_004.cpp
-t_9_005.cpp
-t_9_006.cpp
-t_9_007.cpp
-t_9_008.cpp
-t_9_009.cpp
-t_9_010.cpp
-t_9_011.cpp
-t_9_012.cpp
-t_9_013.cpp
-t_9_014.cpp
-t_9_015.cpp
-t_9_016.cpp
-t_9_017.cpp
-t_9_018.cpp
-t_9_019.cpp
+#
+# Boost.Wave: A Standard compliant C++ preprocessor library
+# http://www.boost.org/
+#
+# Copyright (c) 2003-2008 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)
+#
+
+#
+# t_1: Macro expansion
+#
+t_1_001.cpp
+t_1_002.cpp
+t_1_003.cpp
+t_1_004.cpp
+t_1_005.cpp
+t_1_006.cpp
+t_1_007.cpp
+t_1_008.cpp
+t_1_009.cpp
+t_1_010.cpp
+t_1_011.cpp
+t_1_012.cpp
+t_1_013.cpp
+# t_1_014 currently disabled because of a known problem in the Wave library
+#t_1_014.cpp
+t_1_015.cpp
+t_1_016.cpp
+t_1_017.cpp
+t_1_018.cpp
+t_1_019.cpp
+t_1_020.cpp
+t_1_021.cpp
+t_1_022.cpp
+t_1_023.cpp
+t_1_024.cpp
+t_1_025.cpp
+t_1_026.cpp
+t_1_027.cpp
+t_1_028.cpp
+t_1_029.cpp
+t_1_030.cpp
+t_1_031.cpp
+t_1_032.cpp
+t_1_033.cpp
+t_1_034.cpp
+t_1_035.cpp
+t_1_036.cpp
+t_1_037.cpp
+t_1_038.cpp
+
+#
+# t_2: Preprocessing directives
+#
+t_2_001.cpp
+t_2_002.cpp
+t_2_003.cpp
+t_2_004.cpp
+t_2_005.cpp
+t_2_006.cpp
+t_2_007.cpp
+t_2_008.cpp
+t_2_009.cpp
+t_2_010.cpp
+t_2_011.cpp
+t_2_012.cpp
+t_2_013.cpp
+t_2_014.cpp
+t_2_015.cpp
+t_2_016.cpp
+t_2_017.cpp
+
+#
+# t_3: Predefined macros
+#
+t_3_001.cpp
+t_3_002.cpp
+t_3_003.cpp
+t_3_004.cpp
+
+#
+# Preprocessing expressions
+#
+t_4_001.cpp
+t_4_002.cpp
+t_4_003.cpp
+t_4_004.cpp
+
+#
+# unit tests from the mcpp preprocessor validation suite
+# (general functionality)
+#
+t_5_001.cpp
+t_5_002.cpp
+t_5_003.cpp
+# t_5_004 is currently disabled because of a known problem in the Wave library
+#t_5_004.cpp
+t_5_005.cpp
+t_5_006.cpp
+t_5_007.cpp
+t_5_008.cpp
+t_5_009.cpp
+t_5_010.cpp
+t_5_011.cpp
+t_5_012.cpp
+t_5_013.cpp
+t_5_014.cpp
+t_5_015.cpp
+t_5_016.cpp
+t_5_017.cpp
+t_5_018.cpp
+t_5_019.cpp
+t_5_020.cpp
+t_5_021.cpp
+t_5_022.cpp
+t_5_023.cpp
+t_5_024.cpp
+t_5_025.cpp
+t_5_026.cpp
+t_5_027.cpp
+t_5_028.cpp
+t_5_029.cpp
+# t_5_030 contains one disabled test
+t_5_030.cpp
+t_5_031.cpp
+t_5_032.cpp
+t_5_033.cpp
+t_5_034.cpp
+t_5_035.cpp
+
+#
+# unit tests from the mcpp preprocessor validation suite
+# (error reporting)
+#
+t_6_001.cpp
+t_6_002.cpp
+t_6_003.cpp
+t_6_004.cpp
+t_6_005.cpp
+t_6_006.cpp
+t_6_007.cpp
+t_6_008.cpp
+t_6_009.cpp
+t_6_010.cpp
+t_6_011.cpp
+t_6_012.cpp
+t_6_013.cpp
+t_6_014.cpp
+t_6_015.cpp
+t_6_016.cpp
+t_6_017.cpp
+t_6_018.cpp
+t_6_019.cpp
+t_6_020.cpp
+t_6_021.cpp
+t_6_022.cpp
+t_6_023.cpp
+t_6_024.cpp
+t_6_025.cpp
+t_6_026.cpp
+t_6_027.cpp
+t_6_028.cpp
+t_6_029.cpp
+t_6_030.cpp
+t_6_031.cpp
+t_6_032.cpp
+t_6_033.cpp
+t_6_034.cpp
+t_6_035.cpp
+t_6_036.cpp
+t_6_037.cpp
+t_6_038.cpp
+t_6_039.cpp
+t_6_040.cpp
+t_6_041.cpp
+t_6_042.cpp
+t_6_043.cpp
+t_6_044.cpp
+t_6_045.cpp
+t_6_046.cpp
+t_6_047.cpp
+t_6_048.cpp
+t_6_049.cpp
+t_6_050.cpp
+t_6_051.cpp
+t_6_052.cpp
+t_6_053.cpp
+t_6_054.cpp
+t_6_055.cpp
+t_6_056.cpp
+t_6_057.cpp
+t_6_058.cpp
+t_6_059.cpp
+t_6_060.cpp
+t_6_061.cpp
+t_6_062.cpp
+t_6_063.cpp
+t_6_064.cpp
+t_6_065.cpp
+t_6_066.cpp
+t_6_067.cpp
+t_6_068.cpp
+t_6_069.cpp
+
+#
+# t_9: General preprocessing problems
+#
+t_9_001.cpp
+t_9_002.cpp
+t_9_003.cpp
+t_9_004.cpp
+t_9_005.cpp
+t_9_006.cpp
+t_9_007.cpp
+t_9_008.cpp
+t_9_009.cpp
+t_9_010.cpp
+t_9_011.cpp
+t_9_012.cpp
+t_9_013.cpp
+t_9_014.cpp
+t_9_015.cpp
+t_9_016.cpp
+t_9_017.cpp
+t_9_018.cpp
+t_9_019.cpp

Modified: branches/proto/v3/status/Jamfile.v2
==============================================================================
--- branches/proto/v3/status/Jamfile.v2 (original)
+++ branches/proto/v3/status/Jamfile.v2 2008-03-06 18:03:09 EST (Thu, 06 Mar 2008)
@@ -38,6 +38,7 @@
 build-project ../libs/date_time/test ; # test-suite date_time
 build-project ../libs/disjoint_sets ; # test-suite disjoint_sets
 build-project ../libs/dynamic_bitset ; # test-suite dynamic_bitset
+build-project ../libs/exception ;
 build-project ../libs/filesystem/test ; # test-suite filesystem
 build-project ../libs/foreach/test ; # test-suite foreach
 build-project ../libs/format/test ; # test-suite format

Modified: branches/proto/v3/tools/build/v2/tools/builtin.jam
==============================================================================
--- branches/proto/v3/tools/build/v2/tools/builtin.jam (original)
+++ branches/proto/v3/tools/build/v2/tools/builtin.jam 2008-03-06 18:03:09 EST (Thu, 06 Mar 2008)
@@ -437,8 +437,17 @@
 
 scanner.register c-scanner : include ;
 
+# It most cases where a CPP file or a H file is a source of some action,
+# we should rebuild the result if any of files included by CPP/H
+# are changed. One case when this is not needed is installation,
+# which is handled specifically.
 type.set-scanner CPP : c-scanner ;
 type.set-scanner C : c-scanner ;
+# One case where scanning of H/HPP files is necessary is PCH generation --
+# if any header included by HPP being precompiled changes, we need to
+# recompile the header.
+type.set-scanner H : c-scanner ;
+type.set-scanner HPP : c-scanner ;
 
 
 # The generator class for libraries (target type LIB). Depending on properties

Modified: branches/proto/v3/tools/build/v2/tools/python.jam
==============================================================================
--- branches/proto/v3/tools/build/v2/tools/python.jam (original)
+++ branches/proto/v3/tools/build/v2/tools/python.jam 2008-03-06 18:03:09 EST (Thu, 06 Mar 2008)
@@ -111,6 +111,12 @@
 
     configure $(version) : $(cmd-or-prefix) : $(includes) : $(libraries) : $(condition) : $(extension-suffix) ;
 
+ # The pythonpath feature specifies additional elements for the PYTHONPATH
+ # environment variable, set by run-pyd. For example, pythonpath can be used
+ # to access Python modules that are part of the product being built, but
+ # are not installed in the development system's default paths.
+ feature.feature pythonpath : : free optional path ;
+
     project.pop-current ;
 }
 
@@ -1148,6 +1154,13 @@
     return $(x[1]) ;
 }
 
+# Extract the path to a single ".pyd" source. This is used to build the
+# PYTHONPATH for running bpl tests.
+local rule pyd-pythonpath ( source )
+{
+ return [ on $(source) return $(LOCATE) $(SEARCH) ] ;
+}
+
 # The flag settings on testing.capture-output do not
 # apply to python.capture output at the moment.
 # Redo this explicitly.
@@ -1161,8 +1174,9 @@
     # over explicitly.
     RUN_PATH on $(sources[1]) = [ on $(sources[2-]) return $(RUN_PATH) ] ;
 
- PYTHONPATH = [ on $(sources[2-]) return $(LOCATE) $(SEARCH) ] ;
-
+ PYTHONPATH = [ sequence.transform pyd-pythonpath : $(sources[2-]) ] ;
+ PYTHONPATH += [ feature.get-values pythonpath : $(properties) ] ;
+
     # After test is run, we remove the Python module, but not the Python
     # script.
     testing.capture-output $(target) : $(sources[1]) : $(properties)

Modified: branches/proto/v3/tools/wave/build/Jamfile.v2
==============================================================================
--- branches/proto/v3/tools/wave/build/Jamfile.v2 (original)
+++ branches/proto/v3/tools/wave/build/Jamfile.v2 2008-03-06 18:03:09 EST (Thu, 06 Mar 2008)
@@ -24,7 +24,7 @@
     /boost//thread
     /boost//date_time
     :
- <threading>multi
+ <threading>multi
 # <debug-symbols>on
     :
     release


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