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

Conference 7.286::visualc

Title:Microsoft Visual C/C++
Moderator:PLUGH::needle
Created:Tue Mar 16 1993
Last Modified:Wed Jun 04 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1121
Total number of notes:4385

1091.0. "VC5.0 - STL bug in MAP!" by OZROCK::MOORE (Stephen Moore) Thu Mar 13 1997 04:11

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
1091.1Fix..12368::&quot;moore@ozy.dec.com&quot;Stephen MooreThu Mar 13 1997 05:5820
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]
1091.2Alpha only.. this bug does not apply to intel!NETRIX::&quot;moore@ozy.dec.com&quot;Stephen MooreTue Mar 18 1997 00:131
[Posted by WWW Notes gateway]
1091.3DECCXL::OUELLETTEcrunchTue Mar 18 1997 16:091
See 1093.1