Boost logo

Boost Users :

From: Martin Fisher (mnfisher_at_[hidden])
Date: 2008-01-30 08:41:15

My test program was as follows:

// fly.cpp : main project file.

#include "stdafx.h"

#include <string>
#include <iostream>
#include <vector>
#include <fstream>
#include <iterator>
#include <algorithm>
#include <boost/progress.hpp>
#include <boost/flyweight.hpp>

using namespace std;

vector<boost::flyweight<string> > vec;
//vector<string> vec;

struct Insert {
    void operator()(string s) {

void Test() {
    fstream f("d:\\bible12.txt", ios_base::in); // A large text file!
        boost::progress_timer t;
istream_iterator<string>(), Insert());

int main(int argc, char* argv[])
    cout << vec.size() << endl;
    copy(vec.begin(), vec.begin() + 200, ostream_iterator<string,
char>(cout, " "));
    return 0;

Using the boost_1_35_0 svn library download and Visual C++ 2008 Express
Originally compiled as a CLR program. Recompiling using native Win32
still gives a crash during program termination - in
atomic_count_win32.hpp in operator-- (BOOST_INTERLOCKED_DECREMENT)
Unhandled exception at 0x010752b9 in fly2.exe: 0xC0000005: Access
violation writing location 0x00779040.

There is still the anomaly of release version being slower than debug.
Compiled as release - the exception occurs in xmemory in _Destroy_range.

I'll experiment using set_factory in Borland - although I have largely
abandoned it's use, just can't compile enough of Boost to be useful now...


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at