[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference decwet::visual

Title:Microsoft Visual C++ bug reports and kits
Notice:Register in Topic 2. 5.Last for latest Kit
Moderator:DECWET::THOMASN
Created:Tue May 17 1994
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:521
Total number of notes:2938

479.0. "VC5.0 - STL bug in MAP!" by OZROCK::MOORE (Stephen Moore) Wed Mar 12 1997 22:23

Folks,

Beware, the following crashes!

I'll post the solution as soon as I work it out.. if anyone knows the
answer please don't be shy.

Cheers,
Steve

////////////////////////////////////////////////////////////////////////////
//////////////////////////

#include <list>
#include <map>

class SidlSymbol {};

void main()

{
        using namespace std;    
        map<int, list<SidlSymbol*> > a_map;

        a_map[1]; // crash!!
}

////////////////////////////////////////////////////////////////////////////
///////////////////////
T.RTitleUserPersonal
Name
DateLines
479.1Fix.. NETRIX::&quot;[email protected]&quot;Stephen MooreThu Mar 13 1997 00:0818
Solution...

in file map change the operator[] as follows...

	
	Tref operator[](const key_type& _Kv)
                { _Ty t;
                iterator _P = insert(value_type(_Kv, t)).first;
                return ((*_P).second); }


There appears to be a compiler bug; the orginal code looks OK to me but
just won't work.

Cheers
Steve

[Posted by WWW Notes gateway]
479.2DECCXL::OUELLETTEcrunchThu Mar 13 1997 08:101
And this fails on which platforms?  Alpha, x86 or both?
479.3AlphaNETRIX::&quot;[email protected]&quot;Stephen MooreThu Mar 13 1997 16:108
Alpha.. haven't tried intel yet, I don't have it.

If you have the intel release could you test it out please and post the
results.

Thanks
Steve 
[Posted by WWW Notes gateway]
479.4Alpha-specific problemDECWET::THOMASBug-for-bug compatible with IntelFri Mar 14 1997 15:086
    This problem reproduces on the final Alpha kit, and does not reproduce
    on the final Intel kit.
    
    Thanks for reporting it, and thanks for the workaround.
    
    	Mike