size and iterator of deque

Joined
Feb 12, 2008
Messages
108
Reaction score
0
Hello everyone,


I am studying the C++ Standard Library book. In 6.3 Deques, it is mentioned,

1.

Iterators must be smart pointers of a special type rather than ordinary pointers because they must jump between different blocks.

What means "smart pointers of a special type" here? I do not understand if smart pointers here means auto_ptr something.

2.

In systems that have size limitations for blocks of memory (for example, some PC systems), a deque might contain more elements because it uses more than one block of memory. Thus, max_size() might be larger for deques.

I do not quite understand why we need special care about "more elements, ... more than one block of memory". I have this confusion is because deque is implemented as chunks of memory internally, which is already more than one blocks of memory, it has nothing to do with size limitations. What does the author mean here?

Why "max_size() might be larger for deques"?


thanks in advance,
George
 

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

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top