ways to count elements in STL

Q: for any container how to get the size

Q3: if i give you a range (2 iterators), count how many items

Q3b: what about a home-grown loop to get the count?

Q: accumulate()?

Q: for_each()? I feel this is more clumsy than home-grown loop

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s