January 29, 2004
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