Boost logo

Boost :

From: John Reid (j.reid_at_[hidden])
Date: 2006-05-22 10:18:36


Hi,

I'm getting a runtime check error from MSVC8 in the following code
checked out from cvs_head:

serialization/collections_load_imp.hpp
line 116

...

template<class Archive, class Container, class InputFunction, class R>
inline void load_collection(Archive & ar, Container &s)
{
    s.clear();
    // retrieve number of elements
    unsigned int count;
    unsigned int item_version;
    ar >> BOOST_SERIALIZATION_NVP(count);
    if(3 < ar.get_library_version()){
        ar >> BOOST_SERIALIZATION_NVP(item_version);
    }
    R rx;
    rx(s, count);
    InputFunction ifunc;
    while(count-- > 0){
        ifunc(ar, s, item_version);
    }
}

...

The debugger breaks every time ifunc() is called which is frustrating to
say the least.

If load_collection() is wrapped with

#pragma runtime_checks( "u", off )
...
#pragma runtime_checks( "u", restore )

it doesn't help - perhaps I've rebuilt it incorrectly, perhaps the
pragma needs to be around where the code is instantiated. I managed to
get around the problem by assigning 0 to item_version.

Has anyone specifically chosen to turn runtime checks on for debug
builds with MSVC8 or is this just the default?

Thanks,
John.


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