|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r67943 - in sandbox/statistics/support/libs/assign/v2/example: . misc
From: erwann.rogard_at_[hidden]
Date: 2011-01-10 23:31:27
Author: e_r
Date: 2011-01-10 23:31:26 EST (Mon, 10 Jan 2011)
New Revision: 67943
URL: http://svn.boost.org/trac/boost/changeset/67943
Log:
upd libs/assign/v2
Added:
sandbox/statistics/support/libs/assign/v2/example/misc/
sandbox/statistics/support/libs/assign/v2/example/misc.cpp (contents, props changed)
sandbox/statistics/support/libs/assign/v2/example/misc.h (contents, props changed)
sandbox/statistics/support/libs/assign/v2/example/misc/chain.cpp (contents, props changed)
sandbox/statistics/support/libs/assign/v2/example/misc/chain.h (contents, props changed)
sandbox/statistics/support/libs/assign/v2/example/misc/convert.cpp (contents, props changed)
sandbox/statistics/support/libs/assign/v2/example/misc/convert.h (contents, props changed)
Added: sandbox/statistics/support/libs/assign/v2/example/misc.cpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/libs/assign/v2/example/misc.cpp 2011-01-10 23:31:26 EST (Mon, 10 Jan 2011)
@@ -0,0 +1,25 @@
+//////////////////////////////////////////////////////////////////////////////
+// Boost.Assign v2 //
+// //
+// Copyright (C) 2003-2004 Thorsten Ottosen //
+// Copyright (C) 2010 Erwann Rogard //
+// Use, modification and distribution are subject to the //
+// Boost Software License, Version 1.0. (See accompanying file //
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
+//////////////////////////////////////////////////////////////////////////////
+#include <libs/assign/v2/example/misc/chain.h>
+#include <libs/assign/v2/example/misc/convert.h>
+#include <libs/assign/v2/example/misc.h>
+
+namespace example_assign_v2{
+namespace xxx_misc{
+
+ void run(std::ostream& os)
+ {
+ xxx_chain::run( os );
+ xxx_convert::run( os );
+ }
+
+}// xxx_misc
+}// example_assign_v2
+
Added: sandbox/statistics/support/libs/assign/v2/example/misc.h
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/libs/assign/v2/example/misc.h 2011-01-10 23:31:26 EST (Mon, 10 Jan 2011)
@@ -0,0 +1,22 @@
+//////////////////////////////////////////////////////////////////////////////
+// Boost.Assign v2 //
+// //
+// Copyright (C) 2003-2004 Thorsten Ottosen //
+// Copyright (C) 2010 Erwann Rogard //
+// Use, modification and distribution are subject to the //
+// Boost Software License, Version 1.0. (See accompanying file //
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
+//////////////////////////////////////////////////////////////////////////////
+#ifndef BOOST_ASSIGN_V2_EXAMPLE_MISC_ER_2010_H
+#define BOOST_ASSIGN_V2_EXAMPLE_MISC_ER_2010_H
+#include <ostream>
+
+namespace example_assign_v2{
+namespace xxx_misc{
+
+ void run(std::ostream& os);
+
+}// xxx_misc
+}// example_assign_v2
+
+#endif
Added: sandbox/statistics/support/libs/assign/v2/example/misc/chain.cpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/libs/assign/v2/example/misc/chain.cpp 2011-01-10 23:31:26 EST (Mon, 10 Jan 2011)
@@ -0,0 +1,58 @@
+//////////////////////////////////////////////////////////////////////////////
+// Boost.Assign v2 //
+// //
+// Copyright (C) 2003-2004 Thorsten Ottosen //
+// Copyright (C) 2010 Erwann Rogard //
+// Use, modification and distribution are subject to the //
+// Boost Software License, Version 1.0. (See accompanying file //
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
+//////////////////////////////////////////////////////////////////////////////
+#include <vector>
+#include <list>
+#include <boost/array.hpp>
+#include <boost/assign/v2/chain.hpp>
+#include <boost/assign/v2/put/deque.hpp>
+#include <libs/assign/v2/example/include.h>
+#include <libs/assign/v2/example/misc/chain.h>
+
+namespace example_assign_v2{
+namespace xxx_misc{
+namespace xxx_chain{
+
+ void run(std::ostream& os)
+ {
+ os << "* xxx_chain" << std::endl;
+ {
+ os << "chain_read ";
+ //[chain_r
+ boost::array<int, 2> ar; ar[0] = 0; ar[1] = 1;
+ std::list<int> list( 1, 2 );
+ std::vector<int> vec( 2 ); vec[0] = 3; vec[1] = 4;
+ boost::for_each(
+ ar | as2::_chain( list ) | as2::_chain( vec ),
+ os << bl::_1 << ' '
+ ); // outputs 0, 1, 2, 3, 4
+ //]
+ }
+ {
+ //[chain_w
+ int const x = -1; int y; boost::array<int, 2> ar;
+ boost::copy(
+ std::vector<int>(3, x),
+ boost::begin(
+ ar /* lvalue */ | as2::_chain(
+ as2::ref::csv_array( y /* lvalue */ )
+ ) /* rvalue */
+ )
+ );
+ assert( ar[0] == x );
+ assert( ar[1] == x );
+ assert( y == x );
+ //]
+ }
+ os << std::endl;
+ }
+
+}// xxx_chain
+}// xxx_misc
+}// example_assign_v2
Added: sandbox/statistics/support/libs/assign/v2/example/misc/chain.h
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/libs/assign/v2/example/misc/chain.h 2011-01-10 23:31:26 EST (Mon, 10 Jan 2011)
@@ -0,0 +1,24 @@
+//////////////////////////////////////////////////////////////////////////////
+// Boost.Assign v2 //
+// //
+// Copyright (C) 2003-2004 Thorsten Ottosen //
+// Copyright (C) 2010 Erwann Rogard //
+// Use, modification and distribution are subject to the //
+// Boost Software License, Version 1.0. (See accompanying file //
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
+//////////////////////////////////////////////////////////////////////////////
+#ifndef BOOST_ASSIGN_V2_EXAMPLE_MISC_CHAIN_ER_2010_H
+#define BOOST_ASSIGN_V2_EXAMPLE_MISC_CHAIN_ER_2010_H
+#include <ostream>
+
+namespace example_assign_v2{
+namespace xxx_misc{
+namespace xxx_chain{
+
+ void run(std::ostream& os);
+
+}// xxx_chain
+}// xxx_misc
+}// example_assign_v2
+
+#endif
Added: sandbox/statistics/support/libs/assign/v2/example/misc/convert.cpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/libs/assign/v2/example/misc/convert.cpp 2011-01-10 23:31:26 EST (Mon, 10 Jan 2011)
@@ -0,0 +1,42 @@
+//////////////////////////////////////////////////////////////////////////////
+// Boost.Assign v2 //
+// //
+// Copyright (C) 2003-2004 Thorsten Ottosen //
+// Copyright (C) 2010 Erwann Rogard //
+// Use, modification and distribution are subject to the //
+// Boost Software License, Version 1.0. (See accompanying file //
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
+//////////////////////////////////////////////////////////////////////////////
+#include <vector>
+#include <stack>
+#include <boost/array.hpp>
+#include <boost/assign/v2/misc/convert.hpp>
+#include <libs/assign/v2/example/include.h>
+#include <libs/assign/v2/example/foo.h>
+#include <libs/assign/v2/example/misc/convert.h>
+
+namespace example_assign_v2{
+namespace xxx_misc{
+namespace xxx_convert{
+
+ void run(std::ostream& os)
+ {
+ {
+ //[convert_stack
+ std::vector<int> v( 3 ); v[0] = -1; v[1] = 0; v[2] = 1;
+ std::stack<int> lifo = as2::converter( v );
+ assert( lifo.top() == 1 );
+ //]
+ }
+ {
+ //[convert_array
+ std::vector<int> v( 3 ); v[0] = -1; v[1] = 99; v[2] = 1;
+ typedef boost::array<int, 3> ar_;
+ assert( ( as2::converter( v ).type<ar_>() )[1] == 99 );
+ //]
+ }
+ }
+
+}// xxx_convert
+}// xxx_misc
+}// example_assign_v2
Added: sandbox/statistics/support/libs/assign/v2/example/misc/convert.h
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/libs/assign/v2/example/misc/convert.h 2011-01-10 23:31:26 EST (Mon, 10 Jan 2011)
@@ -0,0 +1,24 @@
+//////////////////////////////////////////////////////////////////////////////
+// Boost.Assign v2 //
+// //
+// Copyright (C) 2003-2004 Thorsten Ottosen //
+// Copyright (C) 2010 Erwann Rogard //
+// Use, modification and distribution are subject to the //
+// Boost Software License, Version 1.0. (See accompanying file //
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
+//////////////////////////////////////////////////////////////////////////////
+#ifndef BOOST_ASSIGN_V2_EXAMPLE_MISC_CONVERT_ER_2010_H
+#define BOOST_ASSIGN_V2_EXAMPLE_MISC_CONVERT_ER_2010_H
+#include <ostream>
+
+namespace example_assign_v2{
+namespace xxx_misc{
+namespace xxx_convert{
+
+ void run(std::ostream& os);
+
+}// xxx_convert
+}// xxx_misc
+}// example_assign_v2
+
+#endif
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