www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - bug in STL container 'slist'?

I used the STL container 'slist' (singly linked list) and got compile errors
inside the STL file _slist.c. Looking in
that file I did not understand why the compiler was complaining. A little
experimentation shows that 'slist' works fine
with built-in types but fails if you define an slist of any user-defined type.
'list' works fine in all cases. Here is a
very small example, and the output produced by the compiler. Can anyone figure
this out?

#include <slist>
class test {int a;};
int main() {std::slist<test> L;}

C:\dm\work>sc -I\dm\stlport\stlport test.cpp stlp45dms.lib -D_DLL
\dm\stlport\stlport\stl/_slist.c(106) : Error: illegal operand types
Had: test
and: const test
\dm\stlport\stlport\stl/_slist.c(120) : Error: illegal operand types
Had: test
and: test
\dm\stlport\stlport\stl/_slist.c(134) : Error: illegal operand types
Had: test
and: test
--- errorlevel 1
Jan 29 2004