Welcome C ++ programmers. I have, what I hope, a quick question about STL containers:
std::list<std::string> l;
This statement compiles fine when used in some C ++ source files (with corresponding inclusions). But
std::list<const std::string> m;
or
std::list<std::string * const> n;
cannot compile when using gcc (gcc version 4.0.1 (Apple Inc. build 5484)). However, using the Visual Studio 2008 C ++ compiler, there are no complaints.
A little research shows what elements in STL containers should be Assignable. Is there a STL bug in the VC implementation (I would say "unlikely") or do they use a different concept Assignable?
source
share