|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r54510 - sandbox/monotonic/boost/heterogenous
From: christian.schladetsch_at_[hidden]
Date: 2009-06-29 18:51:35
Author: cschladetsch
Date: 2009-06-29 18:51:35 EDT (Mon, 29 Jun 2009)
New Revision: 54510
URL: http://svn.boost.org/trac/boost/changeset/54510
Log:
uses vector::base_type rather than heterogenous::common_base. this allows users to select their own base types
Text files modified:
sandbox/monotonic/boost/heterogenous/vector.hpp | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
Modified: sandbox/monotonic/boost/heterogenous/vector.hpp
==============================================================================
--- sandbox/monotonic/boost/heterogenous/vector.hpp (original)
+++ sandbox/monotonic/boost/heterogenous/vector.hpp 2009-06-29 18:51:35 EDT (Mon, 29 Jun 2009)
@@ -22,6 +22,7 @@
template <class Alloc = monotonic::allocator<int>, class Base = common_base >
struct vector
{
+ typedef Base base_type;
typedef typename make_clone_allocator<Alloc>::type allocator_type;
typedef ptr_vector<Base, allocator, allocator_type> implementation;
typedef typename implementation::value_type value_type;
@@ -51,7 +52,7 @@
template <class Ty, class Fun>
Fun for_each(Fun fun)
{
- BOOST_FOREACH(common_base &b, *this)
+ BOOST_FOREACH(base_type &b, *this)
{
if (Ty *ptr = dynamic_cast<Ty *>(&b))
{
@@ -64,7 +65,7 @@
template <class Ty, class Fun>
Fun for_each(Fun fun) const
{
- BOOST_FOREACH(const common_base &base, *this)
+ BOOST_FOREACH(const base_type &base, *this)
{
if (Ty *ptr = dynamic_cast<Ty *>(&base))
{
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