Is it a right way for using containers std::list< std::string > strList ?

A

Anton

Hello !
I am writing a small program and wondering whether this expression is
right?

std::list< std::string > strList

I mean that this is container into container and don't know the side
effects of this expression, that could crash my program. Please , if
you know any side effect will you explain me where is it ?

Thanks in advanced !
 
P

Peter van Merkerk

I am writing a small program and wondering whether this expression is
right?

std::list< std::string > strList

I mean that this is container into container and don't know the side
effects of this expression, that could crash my program. Please , if
you know any side effect will you explain me where is it ?

Looks perfectly sound to me (except for the missing semicolon). The
std::string class meets the "copy constructable" and "assignable"
requirements of the C++ Standard Library containers.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,139
Messages
2,570,805
Members
47,351
Latest member
LolaD32479

Latest Threads

Top