In your example size() returns 4 capacity() returns 6 end() returns a pointer to the 5th element When in doubt about standard container design examing std::vector is a good place to start. Good Luck -----Original Message----- From: Foster, Gareth [mailto:gareth.foster@siemens.com] Sent: Tuesday, February 08, 2005 8:36 AM To: 'boost-users@lists.boost.org' Subject: [Boost-users] Custom containers Hello all, If you were to write a container that had a certain size, say 6, but may not always contain 6 items, say it contains 4, what would it be best to have the following methods do? size() - returns 6 or 4? end() - returns an iterator on the 5th or 7th element? I'm not sure if the standard way of writing such things dictates a certain approach, or if it is purely down to the intended use. Thanks for any information. Gaz ******************************* * http://planetearthworm.com/ * *******************************
participants (1)
-
Johnson, Donald W MVK Contractor