Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > How to extend the STL?

Reply
Thread Tools

How to extend the STL?

 
 
Leon
Guest
Posts: n/a
 
      08-06-2003
Hi all.

Can anyone give some good pointers or hyperlinks about how to 'extend' the
STL with my own datastructures?

For example, I'd like to add a disjoint set datastructure, but I don't know
how to use (derive from?) the std::iterator in my own class. Also, the stuff
with
allocators isn't entirely clear to me.

Does anybody know of any links which describe this sort of information about
the STL?

Thanks in advance,
Leon.


 
Reply With Quote
 
 
 
 
Noah Roberts
Guest
Posts: n/a
 
      08-06-2003
Leon wrote:
> Hi all.
>
> Can anyone give some good pointers or hyperlinks about how to 'extend' the
> STL with my own datastructures?
>
> For example, I'd like to add a disjoint set datastructure, but I don't know
> how to use (derive from?) the std::iterator in my own class. Also, the stuff
> with
> allocators isn't entirely clear to me.
>
> Does anybody know of any links which describe this sort of information about
> the STL?


I can suggest a book: The C++ Standard Library A Tutorial and Reference
by Nicolai M. Josuttis. ISBN: 0-201-37926-0

Section 7.5.2 "User-Defined Iterators" tells you what you want to know
and provides example code.

NR

 
Reply With Quote
 
 
 
 
Cees Wesseling
Guest
Posts: n/a
 
      08-06-2003
Hi Leon,

I advice to study a good book on the STL. Personally I appreciate both
The C++ standard Library, A tutorial and reference by Josuttis
and
C++ templates The complete guide by Vandevoorde and Josuttis
very much. The first book will probably already get you there.

Cheers, Cees

> Can anyone give some good pointers or hyperlinks about how to 'extend' the
> STL with my own datastructures?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How to extend the range of my MN-700 Base Station =?Utf-8?B?d29vcm9i?= Wireless Networking 1 07-02-2005 03:15 AM
Looking for recommendation to extend DS3 over fiber Pasquale Cisco 2 01-23-2004 04:16 PM
How to Extend Session time Yuriy ASP .Net 4 10-17-2003 03:40 PM
How to extend Session? Yuriy ASP .Net 2 10-17-2003 06:39 AM



Advertisments