$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r82344 - in trunk/libs/range: doc/html doc/html/range/reference/adaptors/reference doc/reference/adaptors doc/reference/adaptors/examples test test/adaptor_test
From: zeratul976_at_[hidden]
Date: 2013-01-03 18:44:37
Author: nathanridge
Date: 2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
New Revision: 82344
URL: http://svn.boost.org/trac/boost/changeset/82344
Log:
[range] refactor use of examples in documentation to avoid redundancy
Removed:
   trunk/libs/range/doc/reference/adaptors/examples/adjacent_filtered.cpp
   trunk/libs/range/doc/reference/adaptors/examples/copied.cpp
   trunk/libs/range/doc/reference/adaptors/examples/filtered.cpp
   trunk/libs/range/doc/reference/adaptors/examples/indexed.cpp
   trunk/libs/range/doc/reference/adaptors/examples/map_keys.cpp
   trunk/libs/range/doc/reference/adaptors/examples/map_values.cpp
   trunk/libs/range/doc/reference/adaptors/examples/replaced.cpp
   trunk/libs/range/doc/reference/adaptors/examples/replaced_if.cpp
   trunk/libs/range/doc/reference/adaptors/examples/reversed.cpp
   trunk/libs/range/doc/reference/adaptors/examples/sliced.cpp
   trunk/libs/range/doc/reference/adaptors/examples/strided.cpp
   trunk/libs/range/doc/reference/adaptors/examples/transformed.cpp
   trunk/libs/range/doc/reference/adaptors/examples/uniqued.cpp
Text files modified: 
   trunk/libs/range/doc/html/index.html                                       |     2                                         
   trunk/libs/range/doc/html/range/reference/adaptors/reference/filtered.html |     2                                         
   trunk/libs/range/doc/html/range/reference/adaptors/reference/indexed.html  |    21 --------                                
   trunk/libs/range/doc/html/range/reference/adaptors/reference/reversed.html |     2                                         
   trunk/libs/range/doc/html/range/reference/adaptors/reference/uniqued.html  |     4 +                                       
   trunk/libs/range/doc/reference/adaptors/adjacent_filtered.qbk              |    26 ---------                               
   trunk/libs/range/doc/reference/adaptors/copied.qbk                         |    25 --------                                
   trunk/libs/range/doc/reference/adaptors/filtered.qbk                       |    28 ---------                               
   trunk/libs/range/doc/reference/adaptors/indexed.qbk                        |    59 ---------------------                   
   trunk/libs/range/doc/reference/adaptors/indirected.qbk                     |    26 ---------                               
   trunk/libs/range/doc/reference/adaptors/map_keys.qbk                       |    27 ---------                               
   trunk/libs/range/doc/reference/adaptors/map_values.qbk                     |    27 ---------                               
   trunk/libs/range/doc/reference/adaptors/replaced.qbk                       |    25 --------                                
   trunk/libs/range/doc/reference/adaptors/replaced_if.qbk                    |    30 ----------                              
   trunk/libs/range/doc/reference/adaptors/reversed.qbk                       |    25 --------                                
   trunk/libs/range/doc/reference/adaptors/sliced.qbk                         |    25 --------                                
   trunk/libs/range/doc/reference/adaptors/strided.qbk                        |    25 --------                                
   trunk/libs/range/doc/reference/adaptors/transformed.qbk                    |    31 -----------                             
   trunk/libs/range/doc/reference/adaptors/type_erased.qbk                    |    90 ---------------------------------       
   trunk/libs/range/doc/reference/adaptors/uniqued.qbk                        |    23 --------                                
   trunk/libs/range/test/Jamfile.v2                                           |    14 -----                                   
   trunk/libs/range/test/adaptor_test/adjacent_filtered_example.cpp           |    49 ++++++++++--------                      
   trunk/libs/range/test/adaptor_test/copied_example.cpp                      |    42 +++++++++------                         
   trunk/libs/range/test/adaptor_test/filtered_example.cpp                    |    61 +++++++++++++---------                  
   trunk/libs/range/test/adaptor_test/indexed_example.cpp                     |   105 +++++++++++++++++++++------------------ 
   trunk/libs/range/test/adaptor_test/indirected_example.cpp                  |    54 +++++++++++---------                    
   trunk/libs/range/test/adaptor_test/map_keys_example.cpp                    |    52 +++++++++++--------                     
   trunk/libs/range/test/adaptor_test/map_values_example.cpp                  |    52 +++++++++++--------                     
   trunk/libs/range/test/adaptor_test/replaced_example.cpp                    |    50 ++++++++++--------                      
   trunk/libs/range/test/adaptor_test/replaced_if_example.cpp                 |    61 +++++++++++++---------                  
   trunk/libs/range/test/adaptor_test/reversed_example.cpp                    |    44 +++++++++-------                        
   trunk/libs/range/test/adaptor_test/sliced_example.cpp                      |    50 ++++++++++--------                      
   trunk/libs/range/test/adaptor_test/strided_example.cpp                     |    50 ++++++++++--------                      
   trunk/libs/range/test/adaptor_test/transformed_example.cpp                 |    64 +++++++++++++----------                 
   trunk/libs/range/test/adaptor_test/type_erased_example.cpp                 |    11 +++                                     
   trunk/libs/range/test/adaptor_test/uniqued_example.cpp                     |    49 ++++++++++--------                      
   36 files changed, 487 insertions(+), 844 deletions(-)
Modified: trunk/libs/range/doc/html/index.html
==============================================================================
--- trunk/libs/range/doc/html/index.html	(original)
+++ trunk/libs/range/doc/html/index.html	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -147,7 +147,7 @@
   </p>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: January 03, 2013 at 01:05:23 GMT</small></p></td>
+<td align="left"><p><small>Last revised: January 03, 2013 at 23:22:09 GMT</small></p></td>
 <td align="right"><div class="copyright-footer"></div></td>
 </tr></table>
 <hr>
Modified: trunk/libs/range/doc/html/range/reference/adaptors/reference/filtered.html
==============================================================================
--- trunk/libs/range/doc/html/range/reference/adaptors/reference/filtered.html	(original)
+++ trunk/libs/range/doc/html/range/reference/adaptors/reference/filtered.html	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -132,6 +132,8 @@
     <span class="identifier">boost</span><span class="special">::</span><span class="identifier">copy</span><span class="special">(</span>
         <span class="identifier">input</span> <span class="special">|</span> <span class="identifier">filtered</span><span class="special">(</span><span class="identifier">is_even</span><span class="special">()),</span>
         <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream_iterator</span><span class="special"><</span><span class="keyword">int</span><span class="special">>(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special">,</span> <span class="string">","</span><span class="special">));</span>
+
+    <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
 <span class="special">}</span>
 </pre>
 <p>
Modified: trunk/libs/range/doc/html/range/reference/adaptors/reference/indexed.html
==============================================================================
--- trunk/libs/range/doc/html/range/reference/adaptors/reference/indexed.html	(original)
+++ trunk/libs/range/doc/html/range/reference/adaptors/reference/indexed.html	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -124,27 +124,6 @@
     <span class="identifier">display_element_and_index</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">begin</span><span class="special">(</span><span class="identifier">rng</span><span class="special">),</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">end</span><span class="special">(</span><span class="identifier">rng</span><span class="special">));</span>
 <span class="special">}</span>
 
-<span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">Iterator1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Iterator2</span><span class="special">></span>
-<span class="keyword">void</span> <span class="identifier">check_element_and_index</span><span class="special">(</span>
-        <span class="identifier">Iterator1</span> <span class="identifier">test_first</span><span class="special">,</span>
-        <span class="identifier">Iterator1</span> <span class="identifier">test_last</span><span class="special">,</span>
-        <span class="identifier">Iterator2</span> <span class="identifier">reference_first</span><span class="special">,</span>
-        <span class="identifier">Iterator2</span> <span class="identifier">reference_last</span><span class="special">)</span>
-<span class="special">{</span>
-    <span class="identifier">BOOST_CHECK_EQUAL</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">distance</span><span class="special">(</span><span class="identifier">test_first</span><span class="special">,</span> <span class="identifier">test_last</span><span class="special">),</span>
-                       <span class="identifier">std</span><span class="special">::</span><span class="identifier">distance</span><span class="special">(</span><span class="identifier">reference_first</span><span class="special">,</span> <span class="identifier">reference_last</span><span class="special">)</span> <span class="special">);</span>
-
-    <span class="keyword">int</span> <span class="identifier">reference_index</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
-
-    <span class="identifier">Iterator1</span> <span class="identifier">test_it</span> <span class="special">=</span> <span class="identifier">test_first</span><span class="special">;</span>
-    <span class="identifier">Iterator2</span> <span class="identifier">reference_it</span> <span class="special">=</span> <span class="identifier">reference_first</span><span class="special">;</span>
-    <span class="keyword">for</span> <span class="special">(;</span> <span class="identifier">test_it</span> <span class="special">!=</span> <span class="identifier">test_last</span><span class="special">;</span> <span class="special">++</span><span class="identifier">test_it</span><span class="special">,</span> <span class="special">++</span><span class="identifier">reference_it</span><span class="special">,</span> <span class="special">++</span><span class="identifier">reference_index</span><span class="special">)</span>
-    <span class="special">{</span>
-        <span class="identifier">BOOST_CHECK_EQUAL</span><span class="special">(</span> <span class="special">*</span><span class="identifier">test_it</span><span class="special">,</span> <span class="special">*</span><span class="identifier">reference_it</span> <span class="special">);</span>
-        <span class="identifier">BOOST_CHECK_EQUAL</span><span class="special">(</span> <span class="identifier">test_it</span><span class="special">.</span><span class="identifier">index</span><span class="special">(),</span> <span class="identifier">reference_index</span> <span class="special">);</span>
-    <span class="special">}</span>
-<span class="special">}</span>
-
 <span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">argc</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">char</span><span class="special">*</span> <span class="identifier">argv</span><span class="special">[])</span>
 <span class="special">{</span>
     <span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">assign</span><span class="special">;</span>
Modified: trunk/libs/range/doc/html/range/reference/adaptors/reference/reversed.html
==============================================================================
--- trunk/libs/range/doc/html/range/reference/adaptors/reference/reversed.html	(original)
+++ trunk/libs/range/doc/html/range/reference/adaptors/reference/reversed.html	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -104,7 +104,7 @@
 <span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
 <span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">vector</span><span class="special">></span>
 
-<span class="keyword">void</span> <span class="identifier">reversed_example_test</span><span class="special">()</span>
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">argc</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">char</span><span class="special">*</span> <span class="identifier">argv</span><span class="special">[])</span>
 <span class="special">{</span>
     <span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">adaptors</span><span class="special">;</span>
     <span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">assign</span><span class="special">;</span>
Modified: trunk/libs/range/doc/html/range/reference/adaptors/reference/uniqued.html
==============================================================================
--- trunk/libs/range/doc/html/range/reference/adaptors/reference/uniqued.html	(original)
+++ trunk/libs/range/doc/html/range/reference/adaptors/reference/uniqued.html	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -109,7 +109,7 @@
 <span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
 <span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">vector</span><span class="special">></span>
 
-<span class="keyword">void</span> <span class="identifier">uniqued_example_test</span><span class="special">()</span>
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">argc</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">char</span><span class="special">*</span> <span class="identifier">argv</span><span class="special">[])</span>
 <span class="special">{</span>
     <span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">assign</span><span class="special">;</span>
     <span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">adaptors</span><span class="special">;</span>
@@ -120,6 +120,8 @@
     <span class="identifier">boost</span><span class="special">::</span><span class="identifier">copy</span><span class="special">(</span>
         <span class="identifier">input</span> <span class="special">|</span> <span class="identifier">uniqued</span><span class="special">,</span>
         <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream_iterator</span><span class="special"><</span><span class="keyword">int</span><span class="special">>(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special">,</span> <span class="string">","</span><span class="special">));</span>
+
+    <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
 <span class="special">}</span>
 </pre>
 <p>
Modified: trunk/libs/range/doc/reference/adaptors/adjacent_filtered.qbk
==============================================================================
--- trunk/libs/range/doc/reference/adaptors/adjacent_filtered.qbk	(original)
+++ trunk/libs/range/doc/reference/adaptors/adjacent_filtered.qbk	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -19,30 +19,8 @@
 * [*Returned Range Category:] The minimum of the range category of `rng` and __forward_range__
 
 [section:adjacent_filtered_example adjacent_filtered example]
-``
-#include <boost/range/adaptor/adjacent_filtered.hpp>
-#include <boost/range/algorithm/copy.hpp>
-#include <boost/assign.hpp>
-#include <algorithm>
-#include <functional>
-#include <iostream>
-#include <vector>
-
-int main(int argc, const char* argv[])
-{
-    using namespace boost::assign;
-    using namespace boost::adaptors;
-
-    std::vector<int> input;
-    input += 1,1,2,2,2,3,4,5,6;
-
-    boost::copy(
-        input | adjacent_filtered(std::not_equal_to<int>()),
-        std::ostream_iterator<int>(std::cout, ","));
-
-    return 0;
-}
-``
+[import ../../../test/adaptor_test/adjacent_filtered_example.cpp]
+[adjacent_filtered_example]
 [endsect]
 
 This would produce the output:
Modified: trunk/libs/range/doc/reference/adaptors/copied.qbk
==============================================================================
--- trunk/libs/range/doc/reference/adaptors/copied.qbk	(original)
+++ trunk/libs/range/doc/reference/adaptors/copied.qbk	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -17,29 +17,8 @@
 * [*Returned Range Category:] __random_access_range__
 
 [section:copied_example copied example]
-``
-#include <boost/range/adaptor/copied.hpp>
-#include <boost/range/algorithm/copy.hpp>
-#include <boost/assign.hpp>
-#include <algorithm>
-#include <iostream>
-#include <vector>
-
-int main(int argc, const char* argv[])
-{
-    using namespace boost::assign;
-    using namespace boost::adaptors;
-
-    std::vector<int> input;
-    input += 1,2,3,4,5,6,7,8,9,10;
-
-    boost::copy(
-        input | copied(1, 5),
-        std::ostream_iterator<int>(std::cout, ","));
-
-    return 0;
-}
-``
+[import ../../../test/adaptor_test/copied_example.cpp]
+[copied_example]
 [endsect]
 
 This would produce the output:
Deleted: trunk/libs/range/doc/reference/adaptors/examples/adjacent_filtered.cpp
==============================================================================
--- trunk/libs/range/doc/reference/adaptors/examples/adjacent_filtered.cpp	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
+++ (empty file)
@@ -1,32 +0,0 @@
-// Boost.Range library
-//
-//  Copyright Thorsten Ottosen 2003-2004. 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)
-//
-// For more information, see http://www.boost.org/libs/range/
-//
-#include <boost/range/adaptor/adjacent_filtered.hpp>
-#include <boost/range/algorithm/copy.hpp>
-#include <boost/assign.hpp>
-#include <algorithm>
-#include <functional>
-#include <iostream>
-#include <vector>
-
-int main(int argc, const char* argv[])
-{
-    using namespace boost::assign;
-    using namespace boost::adaptors;
-    
-    std::vector<int> input;
-    input += 1,1,2,2,2,3,4,5,6;
-    
-    boost::copy(
-        input | adjacent_filtered(std::not_equal_to<int>()),
-        std::ostream_iterator<int>(std::cout, ","));
-        
-   return 0;
-}
-
Deleted: trunk/libs/range/doc/reference/adaptors/examples/copied.cpp
==============================================================================
--- trunk/libs/range/doc/reference/adaptors/examples/copied.cpp	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
+++ (empty file)
@@ -1,31 +0,0 @@
-// Boost.Range library
-//
-//  Copyright Thorsten Ottosen 2003-2004. 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)
-//
-// For more information, see http://www.boost.org/libs/range/
-//
-#include <boost/range/adaptor/copied.hpp>
-#include <boost/range/algorithm/copy.hpp>
-#include <boost/assign.hpp>
-#include <algorithm>
-#include <iostream>
-#include <vector>
-
-int main(int argc, const char* argv[])
-{
-    using namespace boost::assign;
-    using namespace boost::adaptors;
-    
-    std::vector<int> input;
-    input += 1,2,3,4,5,6,7,8,9,10;
-    
-    boost::copy(
-        input | copied(1, 5),
-        std::ostream_iterator<int>(std::cout, ","));
-        
-    return 0;
-}
-
Deleted: trunk/libs/range/doc/reference/adaptors/examples/filtered.cpp
==============================================================================
--- trunk/libs/range/doc/reference/adaptors/examples/filtered.cpp	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
+++ (empty file)
@@ -1,36 +0,0 @@
-// Boost.Range library
-//
-//  Copyright Thorsten Ottosen 2003-2004. 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)
-//
-// For more information, see http://www.boost.org/libs/range/
-//
-#include <boost/range/adaptor/filtered.hpp>
-#include <boost/range/algorithm/copy.hpp>
-#include <boost/assign.hpp>
-#include <algorithm>
-#include <iostream>
-#include <vector>
-
-struct is_even
-{
-    bool operator()(int x) const { return x % 2 == 0; }
-};
-
-int main(int argc, const char* argv[])
-{
-    using namespace boost::assign;
-    using namespace boost::adaptors;
-    
-    std::vector<int> input;
-    input += 1,2,3,4,5,6,7,8,9;
-    
-    boost::copy(
-        input | filtered(is_even()),
-        std::ostream_iterator<int>(std::cout, ","));
-        
-    return 0;
-}
-
Deleted: trunk/libs/range/doc/reference/adaptors/examples/indexed.cpp
==============================================================================
--- trunk/libs/range/doc/reference/adaptors/examples/indexed.cpp	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
+++ (empty file)
@@ -1,45 +0,0 @@
-// Boost.Range library
-//
-//  Copyright Thorsten Ottosen 2003-2004. 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)
-//
-// For more information, see http://www.boost.org/libs/range/
-//
-#include <boost/range/adaptor/indexed.hpp>
-#include <boost/range/algorithm/copy.hpp>
-#include <boost/assign.hpp>
-#include <algorithm>
-#include <iostream>
-#include <vector>
-
-template<typename Iterator>
-void display_element_and_index(Iterator first, Iterator last)
-{
-    for (Iterator it = first; it != last; ++it)
-    {
-        std::cout << "Element = " << *it
-                  << " Index = " << it.index() << std::endl;
-    }
-}
-
-template<typename SinglePassRange>
-void display_element_and_index(const SinglePassRange& rng)
-{
-    display_element_and_index(boost::begin(rng), boost::end(rng));
-}
-
-int main(int argc, const char* argv[])
-{
-    using namespace boost::assign;
-    using namespace boost::adaptors;
-    
-    std::vector<int> input;
-    input += 10,20,30,40,50,60,70,80,90;
-    
-    display_element_and_index( input | indexed(0) );
-    
-    return 0;
-}
-
Deleted: trunk/libs/range/doc/reference/adaptors/examples/map_keys.cpp
==============================================================================
--- trunk/libs/range/doc/reference/adaptors/examples/map_keys.cpp	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
+++ (empty file)
@@ -1,33 +0,0 @@
-// Boost.Range library
-//
-//  Copyright Thorsten Ottosen 2003-2004. 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)
-//
-// For more information, see http://www.boost.org/libs/range/
-//
-#include <boost/range/adaptor/map.hpp>
-#include <boost/range/algorithm/copy.hpp>
-#include <boost/assign.hpp>
-#include <algorithm>
-#include <iostream>
-#include <map>
-#include <vector>
-
-int main(int argc, const char* argv[])
-{
-    using namespace boost::assign;
-    using namespace boost::adaptors;
-    
-    std::map<int, int> input;
-    for (int i = 0; i < 10; ++i)
-        input.insert(std::make_pair(i, i * 10));
-        
-    boost::copy(
-        input | map_keys,
-        std::ostream_iterator<int>(std::cout, ","));
-        
-    return 0;
-}
-
Deleted: trunk/libs/range/doc/reference/adaptors/examples/map_values.cpp
==============================================================================
--- trunk/libs/range/doc/reference/adaptors/examples/map_values.cpp	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
+++ (empty file)
@@ -1,33 +0,0 @@
-// Boost.Range library
-//
-//  Copyright Thorsten Ottosen 2003-2004. 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)
-//
-// For more information, see http://www.boost.org/libs/range/
-//
-#include <boost/range/adaptor/map.hpp>
-#include <boost/range/algorithm/copy.hpp>
-#include <boost/assign.hpp>
-#include <algorithm>
-#include <iostream>
-#include <map>
-#include <vector>
-
-int main(int argc, const char* argv[])
-{
-    using namespace boost::assign;
-    using namespace boost::adaptors;
-    
-    std::map<int, int> input;
-    for (int i = 0; i < 10; ++i)
-        input.insert(std::make_pair(i, i * 10));
-        
-    boost::copy(
-        input | map_values,
-        std::ostream_iterator<int>(std::cout, ","));
-        
-    return 0;
-}
-
Deleted: trunk/libs/range/doc/reference/adaptors/examples/replaced.cpp
==============================================================================
--- trunk/libs/range/doc/reference/adaptors/examples/replaced.cpp	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
+++ (empty file)
@@ -1,31 +0,0 @@
-// Boost.Range library
-//
-//  Copyright Thorsten Ottosen 2003-2004. 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)
-//
-// For more information, see http://www.boost.org/libs/range/
-//
-#include <boost/range/adaptor/replaced.hpp>
-#include <boost/range/algorithm/copy.hpp>
-#include <boost/assign.hpp>
-#include <algorithm>
-#include <iostream>
-#include <vector>
-
-int main(int argc, const char* argv[])
-{
-    using namespace boost::adaptors;
-    using namespace boost::assign;
-    
-    std::vector<int> input;
-    input += 1,2,3,2,5,2,7,2,9;
-    
-    boost::copy(
-        input | replaced(2, 10),
-        std::ostream_iterator<int>(std::cout, ","));
-        
-    return 0;
-}
-
Deleted: trunk/libs/range/doc/reference/adaptors/examples/replaced_if.cpp
==============================================================================
--- trunk/libs/range/doc/reference/adaptors/examples/replaced_if.cpp	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
+++ (empty file)
@@ -1,35 +0,0 @@
-// Boost.Range library
-//
-//  Copyright Thorsten Ottosen 2003-2004. 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)
-//
-// For more information, see http://www.boost.org/libs/range/
-//
-#include <boost/range/adaptor/replaced_if.hpp>
-#include <boost/range/algorithm/copy.hpp>
-#include <boost/assign.hpp>
-#include <algorithm>
-#include <iostream>
-#include <vector>
-
-struct is_even
-{
-    bool operator()(int x) const { return x % 2 == 0; }
-};
-
-int main(int argc, const char* argv[])
-{
-    using namespace boost::adaptors;
-    using namespace boost::assign;
-    
-    std::vector<int> input;
-    input += 1,2,3,4,5,6,7,8,9;
-    
-    boost::copy(
-        input | replaced_if(is_even(), 10),
-        std::ostream_iterator<int>(std::cout, ","));
-        
-    return 0;
-}
Deleted: trunk/libs/range/doc/reference/adaptors/examples/reversed.cpp
==============================================================================
--- trunk/libs/range/doc/reference/adaptors/examples/reversed.cpp	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
+++ (empty file)
@@ -1,31 +0,0 @@
-// Boost.Range library
-//
-//  Copyright Thorsten Ottosen 2003-2004. 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)
-//
-// For more information, see http://www.boost.org/libs/range/
-//
-#include <boost/range/adaptor/reversed.hpp>
-#include <boost/range/algorithm/copy.hpp>
-#include <boost/assign.hpp>
-#include <algorithm>
-#include <iostream>
-#include <vector>
-
-int main(int argc, const char* argv[])
-{
-    using namespace boost::adaptors;
-    using namespace boost::assign;
-    
-    std::vector<int> input;
-    input += 1,2,3,4,5,6,7,8,9;
-    
-    boost::copy(
-        input | reversed,
-        std::ostream_iterator<int>(std::cout, ","));
-        
-    return 0;
-}
-
Deleted: trunk/libs/range/doc/reference/adaptors/examples/sliced.cpp
==============================================================================
--- trunk/libs/range/doc/reference/adaptors/examples/sliced.cpp	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
+++ (empty file)
@@ -1,31 +0,0 @@
-// Boost.Range library
-//
-//  Copyright Thorsten Ottosen 2003-2004. 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)
-//
-// For more information, see http://www.boost.org/libs/range/
-//
-#include <boost/range/adaptor/sliced.hpp>
-#include <boost/range/algorithm/copy.hpp>
-#include <boost/assign.hpp>
-#include <algorithm>
-#include <iostream>
-#include <vector>
-
-int main(int argc, const char* argv[])
-{
-    using namespace boost::adaptors;
-    using namespace boost::assign;
-    
-    std::vector<int> input;
-    input += 1,2,3,4,5,6,7,8,9;
-    
-    boost::copy(
-        input | sliced(2, 5),
-        std::ostream_iterator<int>(std::cout, ","));
-        
-    return 0;
-}
-
Deleted: trunk/libs/range/doc/reference/adaptors/examples/strided.cpp
==============================================================================
--- trunk/libs/range/doc/reference/adaptors/examples/strided.cpp	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
+++ (empty file)
@@ -1,31 +0,0 @@
-// Boost.Range library
-//
-//  Copyright Thorsten Ottosen 2003-2004. 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)
-//
-// For more information, see http://www.boost.org/libs/range/
-//
-#include <boost/range/adaptor/strided.hpp>
-#include <boost/range/algorithm/copy.hpp>
-#include <boost/assign.hpp>
-#include <algorithm>
-#include <iostream>
-#include <vector>
-
-int main(int argc, const char* argv[])
-{
-    using namespace boost::adaptors;
-    using namespace boost::assign;
-    
-    std::vector<int> input;
-    input += 1,2,3,4,5,6,7,8,9,10;
-    
-    boost::copy(
-        input | strided(2),
-        std::ostream_iterator<int>(std::cout, ","));
-        
-    return 0;
-}
-
Deleted: trunk/libs/range/doc/reference/adaptors/examples/transformed.cpp
==============================================================================
--- trunk/libs/range/doc/reference/adaptors/examples/transformed.cpp	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
+++ (empty file)
@@ -1,37 +0,0 @@
-// Boost.Range library
-//
-//  Copyright Thorsten Ottosen 2003-2004. 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)
-//
-// For more information, see http://www.boost.org/libs/range/
-//
-#include <boost/range/adaptor/transformed.hpp>
-#include <boost/range/algorithm/copy.hpp>
-#include <boost/assign.hpp>
-#include <algorithm>
-#include <iostream>
-#include <vector>
-
-struct double_int
-{
-    typedef int result_type;
-    int operator()(int x) const { return x * 2; }
-};
-
-int main(int argc, const char* argv[])
-{
-    using namespace boost::adaptors;
-    using namespace boost::assign;
-    
-    std::vector<int> input;
-    input += 1,2,3,4,5,6,7,8,9,10;
-    
-    boost::copy(
-        input | transformed(double_int()),
-        std::ostream_iterator<int>(std::cout, ","));
-        
-    return 0;
-}
-
Deleted: trunk/libs/range/doc/reference/adaptors/examples/uniqued.cpp
==============================================================================
--- trunk/libs/range/doc/reference/adaptors/examples/uniqued.cpp	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
+++ (empty file)
@@ -1,31 +0,0 @@
-// Boost.Range library
-//
-//  Copyright Thorsten Ottosen 2003-2004. 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)
-//
-// For more information, see http://www.boost.org/libs/range/
-//
-#include <boost/range/adaptor/uniqued.hpp>
-#include <boost/range/algorithm/copy.hpp>
-#include <boost/assign.hpp>
-#include <algorithm>
-#include <iostream>
-#include <vector>
-
-int main(int argc, const char* argv[])
-{
-    using namespace boost::assign;
-    using namespace boost::adaptors;
-    
-    std::vector<int> input;
-    input += 1,1,2,2,2,3,4,5,6;
-    
-    boost::copy(
-        input | uniqued,
-        std::ostream_iterator<int>(std::cout, ","));
-        
-    return 0;
-}
-
Modified: trunk/libs/range/doc/reference/adaptors/filtered.qbk
==============================================================================
--- trunk/libs/range/doc/reference/adaptors/filtered.qbk	(original)
+++ trunk/libs/range/doc/reference/adaptors/filtered.qbk	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -19,32 +19,8 @@
 * [*Returned Range Category:] The minimum of the range category of `rng` and __bidirectional_range__
 
 [section:filtered_example filtered example]
-``
-#include <boost/range/adaptor/filtered.hpp>
-#include <boost/range/algorithm/copy.hpp>
-#include <boost/assign.hpp>
-#include <algorithm>
-#include <iostream>
-#include <vector>
-
-struct is_even
-{
-    bool operator()( int x ) const { return x % 2 == 0; }
-};
-
-int main(int argc, const char* argv[])
-{
-    using namespace boost::assign;
-    using namespace boost::adaptors;
-
-    std::vector<int> input;
-    input += 1,2,3,4,5,6,7,8,9;
-
-    boost::copy(
-        input | filtered(is_even()),
-        std::ostream_iterator<int>(std::cout, ","));
-}
-``
+[import ../../../test/adaptor_test/filtered_example.cpp]
+[filtered_example]
 [endsect]
 
 This would produce the output:
Modified: trunk/libs/range/doc/reference/adaptors/indexed.qbk
==============================================================================
--- trunk/libs/range/doc/reference/adaptors/indexed.qbk	(original)
+++ trunk/libs/range/doc/reference/adaptors/indexed.qbk	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -17,63 +17,8 @@
 * [*Returned Range Category:] The range category of `rng`
 
 [section:indexed_example indexed example]
-``
-#include <boost/range/adaptor/indexed.hpp>
-#include <boost/range/algorithm/copy.hpp>
-#include <boost/assign.hpp>
-#include <algorithm>
-#include <iostream>
-#include <vector>
-
-template<class Iterator>
-void display_element_and_index(Iterator first, Iterator last)
-{
-    for (Iterator it = first; it != last; ++it)
-    {
-        std::cout << "Element = " << *it << " Index = " << it.index() << std::endl;
-    }
-}
-
-template<class SinglePassRange>
-void display_element_and_index(const SinglePassRange& rng)
-{
-    display_element_and_index(boost::begin(rng), boost::end(rng));
-}
-
-template<class Iterator1, class Iterator2>
-void check_element_and_index(
-        Iterator1 test_first,
-        Iterator1 test_last,
-        Iterator2 reference_first,
-        Iterator2 reference_last)
-{
-    BOOST_CHECK_EQUAL( std::distance(test_first, test_last),
-                       std::distance(reference_first, reference_last) );
-
-    int reference_index = 0;
-
-    Iterator1 test_it = test_first;
-    Iterator2 reference_it = reference_first;
-    for (; test_it != test_last; ++test_it, ++reference_it, ++reference_index)
-    {
-        BOOST_CHECK_EQUAL( *test_it, *reference_it );
-        BOOST_CHECK_EQUAL( test_it.index(), reference_index );
-    }
-}
-
-int main(int argc, const char* argv[])
-{
-    using namespace boost::assign;
-    using namespace boost::adaptors;
-
-    std::vector<int> input;
-    input += 10,20,30,40,50,60,70,80,90;
-
-    display_element_and_index( input | indexed(0) );
-
-    return 0;
-}
-``
+[import ../../../test/adaptor_test/indexed_example.cpp]
+[indexed_example]
 [endsect]
 
 This would produce the output:
Modified: trunk/libs/range/doc/reference/adaptors/indirected.qbk
==============================================================================
--- trunk/libs/range/doc/reference/adaptors/indirected.qbk	(original)
+++ trunk/libs/range/doc/reference/adaptors/indirected.qbk	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -18,30 +18,8 @@
 * [*Returned Range Category:] The range category of `rng`
 
 [section:indirected_example indirected example]
-``
-#include <boost/range/adaptor/indirected.hpp>
-#include <boost/range/algorithm/copy.hpp>
-#include <boost/shared_ptr.hpp>
-#include <algorithm>
-#include <iostream>
-#include <vector>
-
-int main(int argc, const char* argv[])
-{
-    using namespace boost::adaptors;
-
-    std::vector<boost::shared_ptr<int> > input;
-
-    for (int i = 0; i < 10; ++i)
-        input.push_back(boost::shared_ptr<int>(new int(i)));
-
-    boost::copy(
-        input | indirected,
-        std::ostream_iterator<int>(std::cout, ","));
-
-    return 0;
-}
-``
+[import ../../../test/adaptor_test/indirected_example.cpp]
+[indirected_example]
 [endsect]
 
 This would produce the output:
Modified: trunk/libs/range/doc/reference/adaptors/map_keys.qbk
==============================================================================
--- trunk/libs/range/doc/reference/adaptors/map_keys.qbk	(original)
+++ trunk/libs/range/doc/reference/adaptors/map_keys.qbk	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -18,31 +18,8 @@
 * [*Returned Range Category:] The range category of `rng`.
 
 [section:map_keys_example map_keys example]
-``
-#include <boost/range/adaptor/map.hpp>
-#include <boost/range/algorithm/copy.hpp>
-#include <boost/assign.hpp>
-#include <algorithm>
-#include <iostream>
-#include <map>
-#include <vector>
-
-int main(int argc, const char* argv[])
-{
-    using namespace boost::assign;
-    using namespace boost::adaptors;
-
-    std::map<int,int> input;
-    for (int i = 0; i < 10; ++i)
-        input.insert(std::make_pair(i, i * 10));
-
-    boost::copy(
-        input | map_keys,
-        std::ostream_iterator<int>(std::cout, ","));
-
-    return 0;
-}
-``
+[import ../../../test/adaptor_test/map_keys_example.cpp]
+[map_keys_example]
 [endsect]
 
 This would produce the output:
Modified: trunk/libs/range/doc/reference/adaptors/map_values.qbk
==============================================================================
--- trunk/libs/range/doc/reference/adaptors/map_values.qbk	(original)
+++ trunk/libs/range/doc/reference/adaptors/map_values.qbk	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -18,31 +18,8 @@
 * [*Returned Range Category:] The range category of `rng`.
 
 [section:map_values_example map_values example]
-``
-#include <boost/range/adaptor/map.hpp>
-#include <boost/range/algorithm/copy.hpp>
-#include <boost/assign.hpp>
-#include <algorithm>
-#include <iostream>
-#include <map>
-#include <vector>
-
-int main(int argc, const char* argv[])
-{
-    using namespace boost::assign;
-    using namespace boost::adaptors;
-
-    std::map<int,int> input;
-    for (int i = 0; i < 10; ++i)
-        input.insert(std::make_pair(i, i * 10));
-
-    boost::copy(
-        input | map_values,
-        std::ostream_iterator<int>(std::cout, ","));
-
-    return 0;
-}
-``
+[import ../../../test/adaptor_test/map_values_example.cpp]
+[map_values_example]
 [endsect]
 
 This would produce the output:
Modified: trunk/libs/range/doc/reference/adaptors/replaced.qbk
==============================================================================
--- trunk/libs/range/doc/reference/adaptors/replaced.qbk	(original)
+++ trunk/libs/range/doc/reference/adaptors/replaced.qbk	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -20,29 +20,8 @@
 * [*Returned Range Category:] The range category of `rng`.
 
 [section:replaced_example replaced example]
-``
-#include <boost/range/adaptor/replaced.hpp>
-#include <boost/range/algorithm/copy.hpp>
-#include <boost/assign.hpp>
-#include <algorithm>
-#include <iostream>
-#include <vector>
-
-int main(int argc, const char* argv[])
-{
-    using namespace boost::adaptors;
-    using namespace boost::assign;
-
-    std::vector<int> input;
-    input += 1,2,3,2,5,2,7,2,9;
-
-    boost::copy(
-        input | replaced(2, 10),
-        std::ostream_iterator<int>(std::cout, ","));
-
-    return 0;
-}
-``
+[import ../../../test/adaptor_test/replaced_example.cpp]
+[replaced_example]
 [endsect]
 
 This would produce the output:
Modified: trunk/libs/range/doc/reference/adaptors/replaced_if.qbk
==============================================================================
--- trunk/libs/range/doc/reference/adaptors/replaced_if.qbk	(original)
+++ trunk/libs/range/doc/reference/adaptors/replaced_if.qbk	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -20,34 +20,8 @@
 * [*Returned Range Category:] The range category of `rng`.
 
 [section:replaced_if_example replaced_if example]
-``
-#include <boost/range/adaptor/replaced_if.hpp>
-#include <boost/range/algorithm/copy.hpp>
-#include <boost/assign.hpp>
-#include <algorithm>
-#include <iostream>
-#include <vector>
-
-struct is_even
-{
-    bool operator()(int x) const { return x % 2 == 0; }
-};
-
-int main(int argc, const char* argv[])
-{
-    using namespace boost::adaptors;
-    using namespace boost::assign;
-
-    std::vector<int> input;
-    input += 1,2,3,4,5,6,7,8,9;
-
-    boost::copy(
-        input | replaced_if(is_even(), 10),
-        std::ostream_iterator<int>(std::cout, ","));
-
-    return 0;
-}
-``
+[import ../../../test/adaptor_test/replaced_if_example.cpp]
+[replaced_if_example]
 [endsect]
 
 This would produce the output:
Modified: trunk/libs/range/doc/reference/adaptors/reversed.qbk
==============================================================================
--- trunk/libs/range/doc/reference/adaptors/reversed.qbk	(original)
+++ trunk/libs/range/doc/reference/adaptors/reversed.qbk	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -17,29 +17,8 @@
 * [*Returned Range Category:] The range category of `rng`.
 
 [section:reversed_example reversed example]
-``
-#include <boost/range/adaptor/reversed.hpp>
-#include <boost/range/algorithm/copy.hpp>
-#include <boost/assign.hpp>
-#include <algorithm>
-#include <iostream>
-#include <vector>
-
-void reversed_example_test()
-{
-    using namespace boost::adaptors;
-    using namespace boost::assign;
-
-    std::vector<int> input;
-    input += 1,2,3,4,5,6,7,8,9;
-
-    boost::copy(
-        input | reversed,
-        std::ostream_iterator<int>(std::cout, ","));
-
-    return 0;
-}
-``
+[import ../../../test/adaptor_test/reversed_example.cpp]
+[reversed_example]
 [endsect]
 
 This would produce the output:
Modified: trunk/libs/range/doc/reference/adaptors/sliced.qbk
==============================================================================
--- trunk/libs/range/doc/reference/adaptors/sliced.qbk	(original)
+++ trunk/libs/range/doc/reference/adaptors/sliced.qbk	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -18,29 +18,8 @@
 * [*Returned Range Category:] __random_access_range__
 
 [section:sliced_example sliced example]
-``
-#include <boost/range/adaptor/sliced.hpp>
-#include <boost/range/algorithm/copy.hpp>
-#include <boost/assign.hpp>
-#include <algorithm>
-#include <iostream>
-#include <vector>
-
-int main(int argc, const char* argv[])
-{
-    using namespace boost::adaptors;
-    using namespace boost::assign;
-
-    std::vector<int> input;
-    input += 1,2,3,4,5,6,7,8,9;
-
-    boost::copy(
-        input | sliced(2, 5),
-        std::ostream_iterator<int>(std::cout, ","));
-
-    return 0;
-}
-``
+[import ../../../test/adaptor_test/sliced_example.cpp]
+[sliced_example]
 [endsect]
 
 This would produce the output:
Modified: trunk/libs/range/doc/reference/adaptors/strided.qbk
==============================================================================
--- trunk/libs/range/doc/reference/adaptors/strided.qbk	(original)
+++ trunk/libs/range/doc/reference/adaptors/strided.qbk	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -17,29 +17,8 @@
 * [*Returned Range Category:] The range category of `rng`.
 
 [section:strided_example strided example]
-``
-#include <boost/range/adaptor/strided.hpp>
-#include <boost/range/algorithm/copy.hpp>
-#include <boost/assign.hpp>
-#include <algorithm>
-#include <iostream>
-#include <vector>
-
-int main(int argc, const char* argv[])
-{
-    using namespace boost::adaptors;
-    using namespace boost::assign;
-
-    std::vector<int> input;
-    input += 1,2,3,4,5,6,7,8,9,10;
-
-    boost::copy(
-        input | strided(2),
-        std::ostream_iterator<int>(std::cout, ","));
-
-    return 0;
-}
-``
+[import ../../../test/adaptor_test/strided_example.cpp]
+[strided_example]
 [endsect]
 
 This would produce the output:
Modified: trunk/libs/range/doc/reference/adaptors/transformed.qbk
==============================================================================
--- trunk/libs/range/doc/reference/adaptors/transformed.qbk	(original)
+++ trunk/libs/range/doc/reference/adaptors/transformed.qbk	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -19,35 +19,8 @@
 * [*Returned Range Category:] The range category of `rng`.
 
 [section:transformed_example transformed example]
-``
-#include <boost/range/adaptor/transformed.hpp>
-#include <boost/range/algorithm/copy.hpp>
-#include <boost/assign.hpp>
-#include <algorithm>
-#include <iostream>
-#include <vector>
-
-struct double_int
-{
-    typedef int result_type;
-    int operator()(int x) const { return x * 2; }
-};
-
-int main(int argc, const char* argv[])
-{
-    using namespace boost::adaptors;
-    using namespace boost::assign;
-
-    std::vector<int> input;
-    input += 1,2,3,4,5,6,7,8,9,10;
-
-    boost::copy(
-        input | transformed(double_int()),
-        std::ostream_iterator<int>(std::cout, ","));
-
-    return 0;
-}
-``
+[import ../../../test/adaptor_test/transformed_example.cpp]
+[transformed_example]
 [endsect]
 
 This would produce the output:
Modified: trunk/libs/range/doc/reference/adaptors/type_erased.qbk
==============================================================================
--- trunk/libs/range/doc/reference/adaptors/type_erased.qbk	(original)
+++ trunk/libs/range/doc/reference/adaptors/type_erased.qbk	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -49,94 +49,8 @@
 ``
 
 [section:type_erased_example type-erased example]
-``
-#include <boost/range/adaptor/type_erased.hpp>
-#include <boost/range/algorithm/copy.hpp>
-#include <boost/assign.hpp>
-#include <boost/foreach.hpp>
-#include <algorithm>
-#include <iostream>
-#include <list>
-#include <vector>
-
-// The client interface from an OO perspective merely requires a sequence
-// of integers that can be forward traversed
-typedef boost::any_range<
-    int
-  , boost::forward_traversal_tag
-  , int
-  , std::ptrdiff_t
-> integer_range;
-
-namespace server
-{
-    void display_integers(const integer_range& rng)
-    {
-        boost::copy(rng,
-                    std::ostream_iterator<int>(std::cout, ","));
-
-        std::cout << std::endl;
-    }
-}
-
-namespace client
-{
-    void run()
-    {
-        using namespace boost::assign;
-        using namespace boost::adaptors;
-
-        // Under most conditions one would simply use an appropriate
-        // any_range as a function parameter. The type_erased adaptor
-        // is often superfluous. However because the type_erased
-        // adaptor is applied to a range, we can use default template
-        // arguments that are generated in conjunction with the
-        // range type to which we are applying the adaptor.
-
-        std::vector<int> input;
-        input += 1,2,3,4,5;
-
-        // Note that this call is to a non-template function
-        server::display_integers(input);
-
-        std::list<int> input2;
-        input2 += 6,7,8,9,10;
-
-        // Note that this call is to the same non-tempate function
-        server::display_integers(input2);
-
-        input2.clear();
-        input2 += 11,12,13,14,15;
-
-        // Calling using the adaptor looks like this:
-        // Notice that here I have a type_erased that would be a
-        // bidirectional_traversal_tag, but this is convertible
-        // to the forward_traversal_tag equivalent hence this
-        // works.
-        server::display_integers(input2 | type_erased<>());
-
-        // However we may simply wish to define an adaptor that
-        // takes a range and makes it into an appropriate
-        // forward_traversal any_range...
-        typedef boost::adaptors::type_erased<
-            boost::use_default
-          , boost::forward_traversal_tag
-        > type_erased_forward;
-
-        // This adaptor can turn other containers with different
-        // value_types and reference_types into the appropriate
-        // any_range.
-
-        server::display_integers(input2 | type_erased_forward());
-    }
-}
-
-int main(int argc, const char* argv[])
-{
-    client::run();
-    return 0;
-}
-``
+[import ../../../test/adaptor_test/type_erased_example.cpp]
+[type_erased_example]
 [endsect]
 
 This would produce the output:
Modified: trunk/libs/range/doc/reference/adaptors/uniqued.qbk
==============================================================================
--- trunk/libs/range/doc/reference/adaptors/uniqued.qbk	(original)
+++ trunk/libs/range/doc/reference/adaptors/uniqued.qbk	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -18,27 +18,8 @@
 * [*Returned Range Category:] The minimum of the range concept of `rng` and __forward_range__.
 
 [section:uniqued_example uniqued example]
-``
-#include <boost/range/adaptor/uniqued.hpp>
-#include <boost/range/algorithm/copy.hpp>
-#include <boost/assign.hpp>
-#include <algorithm>
-#include <iostream>
-#include <vector>
-
-void uniqued_example_test()
-{
-    using namespace boost::assign;
-    using namespace boost::adaptors;
-
-    std::vector<int> input;
-    input += 1,1,2,2,2,3,4,5,6;
-
-    boost::copy(
-        input | uniqued,
-        std::ostream_iterator<int>(std::cout, ","));
-}
-``
+[import ../../../test/adaptor_test/uniqued_example.cpp]
+[uniqued_example]
 [endsect]
 
 This would produce the output:
Modified: trunk/libs/range/test/Jamfile.v2
==============================================================================
--- trunk/libs/range/test/Jamfile.v2	(original)
+++ trunk/libs/range/test/Jamfile.v2	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -31,21 +31,7 @@
 }
 
 test-suite range :
-    [ compile ../doc/reference/adaptors/examples/adjacent_filtered.cpp : : example_adjacent_filtered ]
-    [ compile ../doc/reference/adaptors/examples/copied.cpp : : example_copied ]
-    [ compile ../doc/reference/adaptors/examples/filtered.cpp : : example_filtered ]
-    [ compile ../doc/reference/adaptors/examples/indexed.cpp : : example_indexed ]
-    [ compile ../doc/reference/adaptors/examples/indirected.cpp : : example_indirected ]
-    [ compile ../doc/reference/adaptors/examples/map_keys.cpp : : example_map_keys ]
-    [ compile ../doc/reference/adaptors/examples/map_values.cpp : : example_map_values ]
-    [ compile ../doc/reference/adaptors/examples/replaced.cpp : : example_replaced ]
-    [ compile ../doc/reference/adaptors/examples/replaced_if.cpp : : example_replaced_if ]
-    [ compile ../doc/reference/adaptors/examples/reversed.cpp : : example_reversed ]
-    [ compile ../doc/reference/adaptors/examples/sliced.cpp : : example_sliced ]
-    [ compile ../doc/reference/adaptors/examples/strided.cpp : : example_strided ]
     [ compile ../doc/reference/adaptors/examples/tokenized.cpp : : example_tokenized ]
-    [ compile ../doc/reference/adaptors/examples/transformed.cpp : : example_transformed ]
-    [ compile ../doc/reference/adaptors/examples/uniqued.cpp : : example_uniqued ]
         [ compile-fail compile_fail/iterator_range1.cpp ]
         [ range-test adaptor_test/adjacent_filtered ]
         [ range-test adaptor_test/copied ]
Modified: trunk/libs/range/test/adaptor_test/adjacent_filtered_example.cpp
==============================================================================
--- trunk/libs/range/test/adaptor_test/adjacent_filtered_example.cpp	(original)
+++ trunk/libs/range/test/adaptor_test/adjacent_filtered_example.cpp	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -8,6 +8,7 @@
 //
 // For more information, see http://www.boost.org/libs/range/
 //
+//[adjacent_filtered_example
 #include <boost/range/adaptor/adjacent_filtered.hpp>
 #include <boost/range/algorithm/copy.hpp>
 #include <boost/assign.hpp>
@@ -16,6 +17,7 @@
 #include <iostream>
 #include <vector>
 
+//<-
 #include <boost/range/algorithm_ext/push_back.hpp>
 
 #include <boost/test/test_tools.hpp>
@@ -23,27 +25,32 @@
 
 namespace
 {
-    void adjacent_filtered_example_test()
-    {
-        using namespace boost::assign;
-        using namespace boost::adaptors;
-
-        std::vector<int> input;
-        input += 1,1,2,2,2,3,4,5,6;
-
-        boost::copy(
-            input | adjacent_filtered(std::not_equal_to<int>()),
-            std::ostream_iterator<int>(std::cout, ","));
-
-        std::vector<int> reference;
-        reference += 1,2,3,4,5,6;
-
-        std::vector<int> test;
-        boost::push_back(test, input | adjacent_filtered(std::not_equal_to<int>()));
-
-        BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
-            test.begin(), test.end() );
-    }
+void adjacent_filtered_example_test()
+//->
+//=int main(int argc, const char* argv[])
+{
+    using namespace boost::assign;
+    using namespace boost::adaptors;
+
+    std::vector<int> input;
+    input += 1,1,2,2,2,3,4,5,6;
+
+    boost::copy(
+        input | adjacent_filtered(std::not_equal_to<int>()),
+        std::ostream_iterator<int>(std::cout, ","));
+    
+//=    return 0;
+//=}
+//]
+    std::vector<int> reference;
+    reference += 1,2,3,4,5,6;
+
+    std::vector<int> test;
+    boost::push_back(test, input | adjacent_filtered(std::not_equal_to<int>()));
+
+    BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
+        test.begin(), test.end() );
+}
 }
 
 boost::unit_test::test_suite*
Modified: trunk/libs/range/test/adaptor_test/copied_example.cpp
==============================================================================
--- trunk/libs/range/test/adaptor_test/copied_example.cpp	(original)
+++ trunk/libs/range/test/adaptor_test/copied_example.cpp	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -8,6 +8,7 @@
 //
 // For more information, see http://www.boost.org/libs/range/
 //
+//[copied_example
 #include <boost/range/adaptor/copied.hpp>
 #include <boost/range/algorithm/copy.hpp>
 #include <boost/assign.hpp>
@@ -15,6 +16,7 @@
 #include <iostream>
 #include <vector>
 
+//<-
 #include <boost/range/algorithm_ext/push_back.hpp>
 
 #include <boost/test/test_tools.hpp>
@@ -22,28 +24,32 @@
 
 namespace
 {
-    void copied_example_test()
-    {
-        using namespace boost::assign;
-        using namespace boost::adaptors;
-
-        std::vector<int> input;
-        input += 1,2,3,4,5,6,7,8,9,10;
-
-        boost::copy(
-            input | copied(1, 5),
-            std::ostream_iterator<int>(std::cout, ","));
+void copied_example_test()
+//->
+//=int main(int argc, const char* argv[])
+{
+    using namespace boost::assign;
+    using namespace boost::adaptors;
 
+    std::vector<int> input;
+    input += 1,2,3,4,5,6,7,8,9,10;
 
-        std::vector<int> reference;
-        reference += 2,3,4,5;
+    boost::copy(
+        input | copied(1, 5),
+        std::ostream_iterator<int>(std::cout, ","));
+
+//=    return 0;
+//=}
+//]
+    std::vector<int> reference;
+    reference += 2,3,4,5;
 
-        std::vector<int> test;
-        boost::push_back(test, input | copied(1, 5));
+    std::vector<int> test;
+    boost::push_back(test, input | copied(1, 5));
 
-        BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
-            test.begin(), test.end() );
-    }
+    BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
+        test.begin(), test.end() );
+}
 }
 
 boost::unit_test::test_suite*
Modified: trunk/libs/range/test/adaptor_test/filtered_example.cpp
==============================================================================
--- trunk/libs/range/test/adaptor_test/filtered_example.cpp	(original)
+++ trunk/libs/range/test/adaptor_test/filtered_example.cpp	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -8,6 +8,7 @@
 //
 // For more information, see http://www.boost.org/libs/range/
 //
+//[filtered_example
 #include <boost/range/adaptor/filtered.hpp>
 #include <boost/range/algorithm/copy.hpp>
 #include <boost/assign.hpp>
@@ -15,6 +16,7 @@
 #include <iostream>
 #include <vector>
 
+//<-
 #include <boost/test/test_tools.hpp>
 #include <boost/test/unit_test.hpp>
 
@@ -22,32 +24,39 @@
 
 namespace 
 {
-    struct is_even
-    {
-        bool operator()( int x ) const { return x % 2 == 0; }
-    };
-
-    void filtered_example_test()
-    {
-        using namespace boost::assign;
-        using namespace boost::adaptors;
-
-        std::vector<int> input;
-        input += 1,2,3,4,5,6,7,8,9;
-
-        boost::copy(
-            input | filtered(is_even()),
-            std::ostream_iterator<int>(std::cout, ","));
-
-        std::vector<int> reference;
-        reference += 2,4,6,8;
-
-        std::vector<int> test;
-        boost::push_back(test, input | filtered(is_even()));
-
-        BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
-            test.begin(), test.end() );
-    }
+//->    
+struct is_even
+{
+    bool operator()( int x ) const { return x % 2 == 0; }
+};
+
+//<-
+void filtered_example_test()
+//->
+//=int main(int argc, const char* argv[])
+{
+    using namespace boost::assign;
+    using namespace boost::adaptors;
+
+    std::vector<int> input;
+    input += 1,2,3,4,5,6,7,8,9;
+
+    boost::copy(
+        input | filtered(is_even()),
+        std::ostream_iterator<int>(std::cout, ","));
+
+//=    return 0;
+//=}
+//]
+    std::vector<int> reference;
+    reference += 2,4,6,8;
+
+    std::vector<int> test;
+    boost::push_back(test, input | filtered(is_even()));
+
+    BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
+        test.begin(), test.end() );
+}
 }
 
 boost::unit_test::test_suite*
Modified: trunk/libs/range/test/adaptor_test/indexed_example.cpp
==============================================================================
--- trunk/libs/range/test/adaptor_test/indexed_example.cpp	(original)
+++ trunk/libs/range/test/adaptor_test/indexed_example.cpp	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -8,6 +8,7 @@
 //
 // For more information, see http://www.boost.org/libs/range/
 //
+//[indexed_example
 #include <boost/range/adaptor/indexed.hpp>
 #include <boost/range/algorithm/copy.hpp>
 #include <boost/assign.hpp>
@@ -15,6 +16,7 @@
 #include <iostream>
 #include <vector>
 
+//<-
 #include <boost/test/test_tools.hpp>
 #include <boost/test/unit_test.hpp>
 
@@ -22,65 +24,72 @@
 
 namespace 
 {
-    template<class Iterator>
-    void display_element_and_index(Iterator first, Iterator last)
-    {
-        for (Iterator it = first; it != last; ++it)
-        {
-            std::cout << "Element = " << *it << " Index = " << it.index() << std::endl;
-        }
-    }
-
-    template<class SinglePassRange>
-    void display_element_and_index(const SinglePassRange& rng)
-    {
-        display_element_and_index(boost::begin(rng), boost::end(rng));
-    }
 
-    template<class Iterator1, class Iterator2>
-    void check_element_and_index(
-            Iterator1 test_first,
-            Iterator1 test_last,
-            Iterator2 reference_first,
-            Iterator2 reference_last)
-    {
-        BOOST_CHECK_EQUAL( std::distance(test_first, test_last),
-                           std::distance(reference_first, reference_last) );
+template<class Iterator1, class Iterator2>
+void check_element_and_index(
+        Iterator1 test_first,
+        Iterator1 test_last,
+        Iterator2 reference_first,
+        Iterator2 reference_last)
+{
+    BOOST_CHECK_EQUAL( std::distance(test_first, test_last),
+                       std::distance(reference_first, reference_last) );
 
-        int reference_index = 0;
+    int reference_index = 0;
 
-        Iterator1 test_it = test_first;
-        Iterator2 reference_it = reference_first;
-        for (; test_it != test_last; ++test_it, ++reference_it, ++reference_index)
-        {
-            BOOST_CHECK_EQUAL( *test_it, *reference_it );
-            BOOST_CHECK_EQUAL( test_it.index(), reference_index );
-        }
+    Iterator1 test_it = test_first;
+    Iterator2 reference_it = reference_first;
+    for (; test_it != test_last; ++test_it, ++reference_it, ++reference_index)
+    {
+        BOOST_CHECK_EQUAL( *test_it, *reference_it );
+        BOOST_CHECK_EQUAL( test_it.index(), reference_index );
     }
+}
 
-    template<class SinglePassRange1, class SinglePassRange2>
-    void check_element_and_index(
-        const SinglePassRange1& test_rng,
-        const SinglePassRange2& reference_rng)
+template<class SinglePassRange1, class SinglePassRange2>
+void check_element_and_index(
+    const SinglePassRange1& test_rng,
+    const SinglePassRange2& reference_rng)
+{
+    check_element_and_index(boost::begin(test_rng), boost::end(test_rng),
+        boost::begin(reference_rng), boost::end(reference_rng));
+}
+//->    
+template<class Iterator>
+void display_element_and_index(Iterator first, Iterator last)
+{
+    for (Iterator it = first; it != last; ++it)
     {
-        check_element_and_index(boost::begin(test_rng), boost::end(test_rng),
-            boost::begin(reference_rng), boost::end(reference_rng));
+        std::cout << "Element = " << *it << " Index = " << it.index() << std::endl;
     }
+}
 
-    void indexed_example_test()
-    {
-        using namespace boost::assign;
-        using namespace boost::adaptors;
+template<class SinglePassRange>
+void display_element_and_index(const SinglePassRange& rng)
+{
+    display_element_and_index(boost::begin(rng), boost::end(rng));
+}
 
-        std::vector<int> input;
-        input += 10,20,30,40,50,60,70,80,90;
+//<-
+void indexed_example_test()
+//->
+//=int main(int argc, const char* argv[])
+{
+    using namespace boost::assign;
+    using namespace boost::adaptors;
 
-        display_element_and_index( input | indexed(0) );
+    std::vector<int> input;
+    input += 10,20,30,40,50,60,70,80,90;
 
-        check_element_and_index(
-            input | indexed(0),
-            input);
-    }
+    display_element_and_index( input | indexed(0) );
+
+//=    return 0;
+//=}
+//]
+    check_element_and_index(
+        input | indexed(0),
+        input);
+}
 }
 
 boost::unit_test::test_suite*
Modified: trunk/libs/range/test/adaptor_test/indirected_example.cpp
==============================================================================
--- trunk/libs/range/test/adaptor_test/indirected_example.cpp	(original)
+++ trunk/libs/range/test/adaptor_test/indirected_example.cpp	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -8,6 +8,7 @@
 //
 // For more information, see http://www.boost.org/libs/range/
 //
+//[indirected_example
 #include <boost/range/adaptor/indirected.hpp>
 #include <boost/range/algorithm/copy.hpp>
 #include <boost/shared_ptr.hpp>
@@ -15,6 +16,7 @@
 #include <iostream>
 #include <vector>
 
+//<-
 #include <boost/test/test_tools.hpp>
 #include <boost/test/unit_test.hpp>
 
@@ -22,30 +24,34 @@
 
 namespace 
 {
-    void indirected_example_test()
-    {
-        using namespace boost::adaptors;
-
-        std::vector<boost::shared_ptr<int> > input;
-
-        for (int i = 0; i < 10; ++i)
-            input.push_back(boost::shared_ptr<int>(new int(i)));
-        
-        boost::copy(
-            input | indirected,
-            std::ostream_iterator<int>(std::cout, ","));
-
-
-        std::vector<int> reference;
-        for (int i = 0; i < 10; ++i)
-            reference.push_back(i);
-
-        std::vector<int> test;
-        boost::push_back(test, input | indirected);
-
-        BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
-            test.begin(), test.end() );
-    }
+void indirected_example_test()
+//->
+//=int main(int argc, const char* argv[])
+{
+    using namespace boost::adaptors;
+
+    std::vector<boost::shared_ptr<int> > input;
+
+    for (int i = 0; i < 10; ++i)
+        input.push_back(boost::shared_ptr<int>(new int(i)));
+    
+    boost::copy(
+        input | indirected,
+        std::ostream_iterator<int>(std::cout, ","));
+
+//=    return 0;
+//=}
+//]
+    std::vector<int> reference;
+    for (int i = 0; i < 10; ++i)
+        reference.push_back(i);
+
+    std::vector<int> test;
+    boost::push_back(test, input | indirected);
+
+    BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
+        test.begin(), test.end() );
+}
 }
 
 boost::unit_test::test_suite*
Modified: trunk/libs/range/test/adaptor_test/map_keys_example.cpp
==============================================================================
--- trunk/libs/range/test/adaptor_test/map_keys_example.cpp	(original)
+++ trunk/libs/range/test/adaptor_test/map_keys_example.cpp	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -8,6 +8,7 @@
 //
 // For more information, see http://www.boost.org/libs/range/
 //
+//[map_keys_example
 #include <boost/range/adaptor/map.hpp>
 #include <boost/range/algorithm/copy.hpp>
 #include <boost/assign.hpp>
@@ -16,6 +17,7 @@
 #include <map>
 #include <vector>
 
+//<-
 #include <boost/test/test_tools.hpp>
 #include <boost/test/unit_test.hpp>
 
@@ -23,29 +25,33 @@
 
 namespace 
 {
-    void map_keys_example_test()
-    {
-        using namespace boost::assign;
-        using namespace boost::adaptors;
-
-        std::map<int,int> input;
-        for (int i = 0; i < 10; ++i)
-            input.insert(std::make_pair(i, i * 10));
-
-        boost::copy(
-            input | map_keys,
-            std::ostream_iterator<int>(std::cout, ","));
-
-        
-        std::vector<int> reference;
-        reference += 0,1,2,3,4,5,6,7,8,9;
-
-        std::vector<int> test;
-        boost::push_back(test, input | map_keys);
-
-        BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
-            test.begin(), test.end() );
-    }
+void map_keys_example_test()
+//->
+//=int main(int argc, const char* argv[])
+{
+    using namespace boost::assign;
+    using namespace boost::adaptors;
+
+    std::map<int,int> input;
+    for (int i = 0; i < 10; ++i)
+        input.insert(std::make_pair(i, i * 10));
+
+    boost::copy(
+        input | map_keys,
+        std::ostream_iterator<int>(std::cout, ","));
+
+//=    return 0;
+//=}
+//]
+    std::vector<int> reference;
+    reference += 0,1,2,3,4,5,6,7,8,9;
+
+    std::vector<int> test;
+    boost::push_back(test, input | map_keys);
+
+    BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
+        test.begin(), test.end() );
+}
 }
 
 boost::unit_test::test_suite*
Modified: trunk/libs/range/test/adaptor_test/map_values_example.cpp
==============================================================================
--- trunk/libs/range/test/adaptor_test/map_values_example.cpp	(original)
+++ trunk/libs/range/test/adaptor_test/map_values_example.cpp	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -8,6 +8,7 @@
 //
 // For more information, see http://www.boost.org/libs/range/
 //
+//[map_values_example
 #include <boost/range/adaptor/map.hpp>
 #include <boost/range/algorithm/copy.hpp>
 #include <boost/assign.hpp>
@@ -16,6 +17,7 @@
 #include <map>
 #include <vector>
 
+//<-
 #include <boost/test/test_tools.hpp>
 #include <boost/test/unit_test.hpp>
 
@@ -23,29 +25,33 @@
 
 namespace 
 {
-    void map_values_example_test()
-    {
-        using namespace boost::assign;
-        using namespace boost::adaptors;
-
-        std::map<int,int> input;
-        for (int i = 0; i < 10; ++i)
-            input.insert(std::make_pair(i, i * 10));
-
-        boost::copy(
-            input | map_values,
-            std::ostream_iterator<int>(std::cout, ","));
-
-        
-        std::vector<int> reference;
-        reference += 0,10,20,30,40,50,60,70,80,90;
-
-        std::vector<int> test;
-        boost::push_back(test, input | map_values);
-
-        BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
-            test.begin(), test.end() );
-    }
+void map_values_example_test()
+//->
+//=int main(int argc, const char* argv[])
+{
+    using namespace boost::assign;
+    using namespace boost::adaptors;
+
+    std::map<int,int> input;
+    for (int i = 0; i < 10; ++i)
+        input.insert(std::make_pair(i, i * 10));
+
+    boost::copy(
+        input | map_values,
+        std::ostream_iterator<int>(std::cout, ","));
+
+//=    return 0;
+//=}
+//]
+    std::vector<int> reference;
+    reference += 0,10,20,30,40,50,60,70,80,90;
+
+    std::vector<int> test;
+    boost::push_back(test, input | map_values);
+
+    BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
+        test.begin(), test.end() );
+}
 }
 
 boost::unit_test::test_suite*
Modified: trunk/libs/range/test/adaptor_test/replaced_example.cpp
==============================================================================
--- trunk/libs/range/test/adaptor_test/replaced_example.cpp	(original)
+++ trunk/libs/range/test/adaptor_test/replaced_example.cpp	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -8,6 +8,7 @@
 //
 // For more information, see http://www.boost.org/libs/range/
 //
+//[replaced_example
 #include <boost/range/adaptor/replaced.hpp>
 #include <boost/range/algorithm/copy.hpp>
 #include <boost/assign.hpp>
@@ -15,6 +16,7 @@
 #include <iostream>
 #include <vector>
 
+//<-
 #include <boost/test/test_tools.hpp>
 #include <boost/test/unit_test.hpp>
 
@@ -22,28 +24,32 @@
 
 namespace 
 {
-    void replaced_example_test()
-    {
-        using namespace boost::adaptors;
-        using namespace boost::assign;
-
-        std::vector<int> input;
-        input += 1,2,3,2,5,2,7,2,9;
-        
-        boost::copy(
-            input | replaced(2, 10),
-            std::ostream_iterator<int>(std::cout, ","));
-
-
-        std::vector<int> reference;
-        reference += 1,10,3,10,5,10,7,10,9;
-
-        std::vector<int> test;
-        boost::push_back(test, input | replaced(2, 10));
-
-        BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
-            test.begin(), test.end() );
-    }
+void replaced_example_test()
+//->
+//=int main(int argc, const char* argv[])
+{
+    using namespace boost::adaptors;
+    using namespace boost::assign;
+
+    std::vector<int> input;
+    input += 1,2,3,2,5,2,7,2,9;
+    
+    boost::copy(
+        input | replaced(2, 10),
+        std::ostream_iterator<int>(std::cout, ","));
+
+//=    return 0;
+//=}
+//]
+    std::vector<int> reference;
+    reference += 1,10,3,10,5,10,7,10,9;
+
+    std::vector<int> test;
+    boost::push_back(test, input | replaced(2, 10));
+
+    BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
+        test.begin(), test.end() );
+}
 }
 
 boost::unit_test::test_suite*
Modified: trunk/libs/range/test/adaptor_test/replaced_if_example.cpp
==============================================================================
--- trunk/libs/range/test/adaptor_test/replaced_if_example.cpp	(original)
+++ trunk/libs/range/test/adaptor_test/replaced_if_example.cpp	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -8,6 +8,7 @@
 //
 // For more information, see http://www.boost.org/libs/range/
 //
+//[replaced_if_example
 #include <boost/range/adaptor/replaced_if.hpp>
 #include <boost/range/algorithm/copy.hpp>
 #include <boost/assign.hpp>
@@ -15,6 +16,7 @@
 #include <iostream>
 #include <vector>
 
+//<-
 #include <boost/test/test_tools.hpp>
 #include <boost/test/unit_test.hpp>
 
@@ -22,32 +24,39 @@
 
 namespace 
 {
-    struct is_even
-    {
-        bool operator()(int x) const { return x % 2 == 0; }
-    };
-
-    void replaced_if_example_test()
-    {
-        using namespace boost::adaptors;
-        using namespace boost::assign;
-
-        std::vector<int> input;
-        input += 1,2,3,4,5,6,7,8,9;
-        
-        boost::copy(
-            input | replaced_if(is_even(), 10),
-            std::ostream_iterator<int>(std::cout, ","));
-
-        std::vector<int> reference;
-        reference += 1,10,3,10,5,10,7,10,9;
-
-        std::vector<int> test;
-        boost::push_back(test, input | replaced_if(is_even(), 10));
-
-        BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
-            test.begin(), test.end() );
-    }
+//->
+struct is_even
+{
+    bool operator()(int x) const { return x % 2 == 0; }
+};
+
+//<-
+void replaced_if_example_test()
+//->
+//=int main(int argc, const char* argv[])
+{
+    using namespace boost::adaptors;
+    using namespace boost::assign;
+
+    std::vector<int> input;
+    input += 1,2,3,4,5,6,7,8,9;
+    
+    boost::copy(
+        input | replaced_if(is_even(), 10),
+        std::ostream_iterator<int>(std::cout, ","));
+
+//=    return 0;
+//=}
+//]
+    std::vector<int> reference;
+    reference += 1,10,3,10,5,10,7,10,9;
+
+    std::vector<int> test;
+    boost::push_back(test, input | replaced_if(is_even(), 10));
+
+    BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
+        test.begin(), test.end() );
+}
 }
 
 boost::unit_test::test_suite*
Modified: trunk/libs/range/test/adaptor_test/reversed_example.cpp
==============================================================================
--- trunk/libs/range/test/adaptor_test/reversed_example.cpp	(original)
+++ trunk/libs/range/test/adaptor_test/reversed_example.cpp	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -8,6 +8,7 @@
 //
 // For more information, see http://www.boost.org/libs/range/
 //
+//[reversed_example
 #include <boost/range/adaptor/reversed.hpp>
 #include <boost/range/algorithm/copy.hpp>
 #include <boost/assign.hpp>
@@ -15,6 +16,7 @@
 #include <iostream>
 #include <vector>
 
+//<-
 #include <boost/test/test_tools.hpp>
 #include <boost/test/unit_test.hpp>
 
@@ -22,25 +24,29 @@
 
 namespace 
 {
-    void reversed_example_test()
-    {
-        using namespace boost::adaptors;
-        using namespace boost::assign;
-
-        std::vector<int> input;
-        input += 1,2,3,4,5,6,7,8,9;
-        
-        boost::copy(
-            input | reversed,
-            std::ostream_iterator<int>(std::cout, ","));
-
-
-        std::vector<int> test;
-        boost::push_back(test, input | reversed);
-
-        BOOST_CHECK_EQUAL_COLLECTIONS( input.rbegin(), input.rend(),
-            test.begin(), test.end() );
-    }
+void reversed_example_test()
+//->
+//=int main(int argc, const char* argv[])
+{
+    using namespace boost::adaptors;
+    using namespace boost::assign;
+
+    std::vector<int> input;
+    input += 1,2,3,4,5,6,7,8,9;
+    
+    boost::copy(
+        input | reversed,
+        std::ostream_iterator<int>(std::cout, ","));
+
+//=    return 0;
+//=}
+//]
+    std::vector<int> test;
+    boost::push_back(test, input | reversed);
+
+    BOOST_CHECK_EQUAL_COLLECTIONS( input.rbegin(), input.rend(),
+        test.begin(), test.end() );
+}
 }
 
 boost::unit_test::test_suite*
Modified: trunk/libs/range/test/adaptor_test/sliced_example.cpp
==============================================================================
--- trunk/libs/range/test/adaptor_test/sliced_example.cpp	(original)
+++ trunk/libs/range/test/adaptor_test/sliced_example.cpp	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -8,6 +8,7 @@
 //
 // For more information, see http://www.boost.org/libs/range/
 //
+//[sliced_example
 #include <boost/range/adaptor/sliced.hpp>
 #include <boost/range/algorithm/copy.hpp>
 #include <boost/assign.hpp>
@@ -15,6 +16,7 @@
 #include <iostream>
 #include <vector>
 
+//<-
 #include <boost/test/test_tools.hpp>
 #include <boost/test/unit_test.hpp>
 
@@ -22,28 +24,32 @@
 
 namespace 
 {
-    void sliced_example_test()
-    {
-        using namespace boost::adaptors;
-        using namespace boost::assign;
-
-        std::vector<int> input;
-        input += 1,2,3,4,5,6,7,8,9;
-        
-        boost::copy(
-            input | sliced(2, 5),
-            std::ostream_iterator<int>(std::cout, ","));
-
-
-        std::vector<int> reference;
-        reference += 3,4,5;
-
-        std::vector<int> test;
-        boost::push_back(test, input | sliced(2, 5));
-
-        BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
-            test.begin(), test.end() );
-    }
+void sliced_example_test()
+//->
+//=int main(int argc, const char* argv[])
+{
+    using namespace boost::adaptors;
+    using namespace boost::assign;
+
+    std::vector<int> input;
+    input += 1,2,3,4,5,6,7,8,9;
+    
+    boost::copy(
+        input | sliced(2, 5),
+        std::ostream_iterator<int>(std::cout, ","));
+
+//=    return 0;
+//=}
+//]
+    std::vector<int> reference;
+    reference += 3,4,5;
+
+    std::vector<int> test;
+    boost::push_back(test, input | sliced(2, 5));
+
+    BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
+        test.begin(), test.end() );
+}
 }
 
 boost::unit_test::test_suite*
Modified: trunk/libs/range/test/adaptor_test/strided_example.cpp
==============================================================================
--- trunk/libs/range/test/adaptor_test/strided_example.cpp	(original)
+++ trunk/libs/range/test/adaptor_test/strided_example.cpp	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -8,6 +8,7 @@
 //
 // For more information, see http://www.boost.org/libs/range/
 //
+//[strided_example
 #include <boost/range/adaptor/strided.hpp>
 #include <boost/range/algorithm/copy.hpp>
 #include <boost/assign.hpp>
@@ -15,6 +16,7 @@
 #include <iostream>
 #include <vector>
 
+//<-
 #include <boost/test/test_tools.hpp>
 #include <boost/test/unit_test.hpp>
 
@@ -22,28 +24,32 @@
 
 namespace 
 {
-    void strided_example_test()
-    {
-        using namespace boost::adaptors;
-        using namespace boost::assign;
-
-        std::vector<int> input;
-        input += 1,2,3,4,5,6,7,8,9,10;
-        
-        boost::copy(
-            input | strided(2),
-            std::ostream_iterator<int>(std::cout, ","));
-
-
-        std::vector<int> reference;
-        reference += 1,3,5,7,9;
-
-        std::vector<int> test;
-        boost::push_back(test, input | strided(2));
-
-        BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
-            test.begin(), test.end() );
-    }
+void strided_example_test()
+//->
+//=int main(int argc, const char* argv[])
+{
+    using namespace boost::adaptors;
+    using namespace boost::assign;
+
+    std::vector<int> input;
+    input += 1,2,3,4,5,6,7,8,9,10;
+    
+    boost::copy(
+        input | strided(2),
+        std::ostream_iterator<int>(std::cout, ","));
+
+//=    return 0;
+//=}
+//]
+    std::vector<int> reference;
+    reference += 1,3,5,7,9;
+
+    std::vector<int> test;
+    boost::push_back(test, input | strided(2));
+
+    BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
+        test.begin(), test.end() );
+}
 }
 
 boost::unit_test::test_suite*
Modified: trunk/libs/range/test/adaptor_test/transformed_example.cpp
==============================================================================
--- trunk/libs/range/test/adaptor_test/transformed_example.cpp	(original)
+++ trunk/libs/range/test/adaptor_test/transformed_example.cpp	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -8,6 +8,7 @@
 //
 // For more information, see http://www.boost.org/libs/range/
 //
+//[transformed_example
 #include <boost/range/adaptor/transformed.hpp>
 #include <boost/range/algorithm/copy.hpp>
 #include <boost/assign.hpp>
@@ -15,6 +16,7 @@
 #include <iostream>
 #include <vector>
 
+//<-
 #include <boost/test/test_tools.hpp>
 #include <boost/test/unit_test.hpp>
 
@@ -22,34 +24,40 @@
 
 namespace 
 {
-    struct double_int
-    {
-        typedef int result_type;
-        int operator()(int x) const { return x * 2; }
-    };
-
-    void transformed_example_test()
-    {
-        using namespace boost::adaptors;
-        using namespace boost::assign;
-
-        std::vector<int> input;
-        input += 1,2,3,4,5,6,7,8,9,10;
-        
-        boost::copy(
-            input | transformed(double_int()),
-            std::ostream_iterator<int>(std::cout, ","));
-
-
-        std::vector<int> reference;
-        reference += 2,4,6,8,10,12,14,16,18,20;
-
-        std::vector<int> test;
-        boost::push_back(test, input | transformed(double_int()));
-
-        BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
-            test.begin(), test.end() );
-    }
+//->
+struct double_int
+{
+    typedef int result_type;
+    int operator()(int x) const { return x * 2; }
+};
+
+//<-
+void transformed_example_test()
+//->
+//=int main(int argc, const char* argv[])
+{
+    using namespace boost::adaptors;
+    using namespace boost::assign;
+
+    std::vector<int> input;
+    input += 1,2,3,4,5,6,7,8,9,10;
+    
+    boost::copy(
+        input | transformed(double_int()),
+        std::ostream_iterator<int>(std::cout, ","));
+
+//=    return 0;
+//=}
+//]
+    std::vector<int> reference;
+    reference += 2,4,6,8,10,12,14,16,18,20;
+
+    std::vector<int> test;
+    boost::push_back(test, input | transformed(double_int()));
+
+    BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
+        test.begin(), test.end() );
+}
 }
 
 boost::unit_test::test_suite*
Modified: trunk/libs/range/test/adaptor_test/type_erased_example.cpp
==============================================================================
--- trunk/libs/range/test/adaptor_test/type_erased_example.cpp	(original)
+++ trunk/libs/range/test/adaptor_test/type_erased_example.cpp	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -8,6 +8,7 @@
 //
 // For more information, see http://www.boost.org/libs/range/
 //
+//[type_erased_example
 #include <boost/range/adaptor/type_erased.hpp>
 #include <boost/range/algorithm/copy.hpp>
 #include <boost/assign.hpp>
@@ -16,7 +17,7 @@
 #include <iostream>
 #include <list>
 #include <vector>
-
+//<-
 #include <boost/test/test_tools.hpp>
 #include <boost/test/unit_test.hpp>
 
@@ -26,6 +27,7 @@
     {
         namespace type_erased_example
         {
+//->            
 
 // The client interface from an OO perspective merely requires a sequence
 // of integers that can be forward traversed
@@ -99,6 +101,13 @@
     }
 }
 
+//=int main(int argc, const char* argv[])
+//={
+//=    client::run();
+//=    return 0;
+//=}
+//]
+
         } // namespace type_erased_example
     } // namespace boost_range_test
 } // anonymous namespace
Modified: trunk/libs/range/test/adaptor_test/uniqued_example.cpp
==============================================================================
--- trunk/libs/range/test/adaptor_test/uniqued_example.cpp	(original)
+++ trunk/libs/range/test/adaptor_test/uniqued_example.cpp	2013-01-03 18:44:30 EST (Thu, 03 Jan 2013)
@@ -8,6 +8,7 @@
 //
 // For more information, see http://www.boost.org/libs/range/
 //
+//[uniqued_example
 #include <boost/range/adaptor/uniqued.hpp>
 #include <boost/range/algorithm/copy.hpp>
 #include <boost/assign.hpp>
@@ -15,6 +16,7 @@
 #include <iostream>
 #include <vector>
 
+//<-
 #include <boost/range/algorithm_ext/push_back.hpp>
 
 #include <boost/test/test_tools.hpp>
@@ -22,27 +24,32 @@
 
 namespace
 {
-    void uniqued_example_test()
-    {
-        using namespace boost::assign;
-        using namespace boost::adaptors;
-
-        std::vector<int> input;
-        input += 1,1,2,2,2,3,4,5,6;
-
-        boost::copy(
-            input | uniqued,
-            std::ostream_iterator<int>(std::cout, ","));
-
-        std::vector<int> reference;
-        reference += 1,2,3,4,5,6;
-
-        std::vector<int> test;
-        boost::push_back( test, input | uniqued );
-
-        BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
-            test.begin(), test.end() );
-    }
+void uniqued_example_test()
+//->
+//=int main(int argc, const char* argv[])
+{
+    using namespace boost::assign;
+    using namespace boost::adaptors;
+
+    std::vector<int> input;
+    input += 1,1,2,2,2,3,4,5,6;
+
+    boost::copy(
+        input | uniqued,
+        std::ostream_iterator<int>(std::cout, ","));
+
+//=    return 0;
+//=}
+//]
+    std::vector<int> reference;
+    reference += 1,2,3,4,5,6;
+
+    std::vector<int> test;
+    boost::push_back( test, input | uniqued );
+
+    BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
+        test.begin(), test.end() );
+}
 }
 
 boost::unit_test::test_suite*