Boost logo

Boost :

From: Victor A. Wagner Jr. (vawjr_at_[hidden])
Date: 2005-12-28 10:26:50

At 03:31 2005-12-27, Reece Dunn wrote:
>Victor A. Wagner Jr. wrote:
> >At 11:59 2005-12-24, simon meiklejohn wrote:
> > >running a debug build of one of your examples in
> > >vc8.0 (visual studio beta 2) asserts "list iterators incompatible"
> > >from a calling location in hash_map.hpp
> > >// Insert a new entry into the map.
> > >std::pair<iterator, bool> insert(const value_type& v)
> > >{
> > > size_t bucket = boost::hash_value(v.first) % num_buckets;
> > > iterator it = buckets_[bucket].first;
> > > if (it == values_.end() ) <--- asserts
> > >
> > >Probably just "Safe" C++ library getting in the way. Anyone
> > >know a way to disable this checking?
>This is different to the "safe" C and C++ libraries.
> >you may be pleased to know that with the
> >"release" vs2005 there is no assert (debug), but
> >I'm concerned about the program itself.
>Assertions are not compiled in release builds.

I have _no_ idea why this is mentioned here. the OP said he was
using the beta version of the compiler, I'm using the release version
of the compiler.

>In the new VS2005 standard
>library, there are assertion checks to validate various things such as:
>* checking that two iterators being compared are from the same container;
>* checking that an iterator hasn't gone past the end of the container.
>It may be interesting to see if the following asserts (bug in the runtime
> iterator first = c.begin(), last = c.end();
> if( first == last ) // does this assert?
> {
> }
>However, this most likely indicates a bug in that code.
> >I get different outputs from release and debug
> >ok, this intrigued me I put
> >breakpoints before the output of "Successful........" and looked at buf_
> >when in release, there was a '\0' after the
> >"hello there", in debug, there wasn't.
> >I then looked up readsome for I/O streams in
> >"The C++ Standard Library" Nicolai Josuttis... his documentation says
> >readsome() returns a std::streamsize (so you know
> >how many characters are actually in the biffer)
> >AND explicitly says there will be NO '\0' put into the buffer.
>So is the I/O stream implementation inserting a '\0' in the release build as
>part of their "safe" runtime library initiative? Or is this in Johnathan's
>I/O streams library?

who knows? I just thought running the program with the final
compiler would make sense rather than chasing gremlins in a beta

>- Reece
>Unsubscribe & other changes:

Victor A. Wagner Jr.
The five most dangerous words in the English language:
               "There oughta be a law"

Boost list run by bdawes at, gregod at, cpdaniel at, john at