Thread View: comp.std.c++
1 messages
1 total messages
Started by Cay Horstmann
Tue, 05 Sep 1995 05:25
size and length
Author: Cay Horstmann
Date: Tue, 05 Sep 1995 05:25
Date: Tue, 05 Sep 1995 05:25
16 lines
1169 bytes
1169 bytes
The number of elements in a vector is obtained by size(), the number of elements in a valarray by length() and the number of characters in a string by, you guessed it, either size() or length(). All other STL containers use size(). (There is also a length(const char[]) function in ios_traits, but it is not terribly related to this discussion.) Has the library workgroup spent any conscious thought on this weighty issue, or is all this just an accident? The obvious fix would be to add size(0 as a synonym to length() in valarrays. Cay horstman@cs.sjsu.edu --- [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu. Contact address: std-c++-request@ncar.ucar.edu. The moderation policy is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads