Is there any C ++ class that cannot be used in STL?

Just come up with this question. Any hint?

+5
source share
5 answers

which cannot be copied. STL containers require objects to be copied because the container has a copy of this object and must be able to move it.

+13
source

My favorite thing not to embed in an STL container is std :: auto_ptr ... very bad things ... basically unexpected loss of objects that I think.

, , , - . - (, auto_ptr) ( , , ). .

, "" .

+9

, . , , , , . .

+4

A class cannot throw exceptions in the destructor ... well, no class should ever throw a destructor

+2
source

Depends on the container, for more information, section 23 of the Standard specifies the requirements for all containers and methods.

To be safe, you must assume that it is always required: Default construction and copying

0
source

All Articles