Boost logo

Boost :

From: SourceForge.net (noreply_at_[hidden])
Date: 2005-04-09 00:46:44


Bugs item #1179641, was opened at 2005-04-09 00:46
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1179641&group_id=7586

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Greg Rosenblatt (glr9940)
Assigned to: Nobody/Anonymous (nobody)
Summary: boost::pool_allocator breaks with vector of vectors

Initial Comment:
The resulting executable built with the following code
under GCC 3.3.5 produces a segmentation fault when
run:

Note that switching the definition of EventVector to use
a vector with a standard allocator will fix the problem.

Also note that the definition of IndexVector doesn't seem
to matter.

#include <boost/pool/pool_alloc.hpp>
#include <vector>
#include <iostream>

template <typename DataType>
struct PooledVector {
       typedef std::vector<DataType,
boost::pool_allocator<DataType> > Type;
};

typedef PooledVector<int>::Type EventVector;
//typedef std::vector<int> EventVector;

//typedef PooledVector<EventVector>::Type
IndexVector;
typedef std::vector<EventVector> IndexVector;

int main() {
               IndexVector iv;
               iv.push_back(EventVector());
               iv.back().push_back(3);
               std::cout << "it works\n";
       return 0;
}

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1179641&group_id=7586

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Boost-bugs mailing list
Boost-bugs_at_[hidden]
https://lists.sourceforge.net/lists/listinfo/boost-bugs


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk