Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
std::tr1::array - What's the difference between max_size and size?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Sarath  
View profile  
 More options Aug 17, 9:49 am
Newsgroups: comp.lang.c++
From: Sarath <CSar...@gmail.com>
Date: Mon, 17 Aug 2009 06:49:15 -0700 (PDT)
Local: Mon, Aug 17 2009 9:49 am
Subject: std::tr1::array - What's the difference between max_size and size?
From the documentaiton, I could not find any difference between these
functions.

std::tr1::array - What's the difference between max_size and size?

Thank you.

-Sarath


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
SG  
View profile  
 More options Aug 17, 10:22 am
Newsgroups: comp.lang.c++
From: SG <s.gesem...@gmail.com>
Date: Mon, 17 Aug 2009 07:22:17 -0700 (PDT)
Local: Mon, Aug 17 2009 10:22 am
Subject: Re: std::tr1::array - What's the difference between max_size and size?
On 17 Aug., 15:49, Sarath <CSar...@gmail.com> wrote:

> From the documentaiton, I could not find any difference between these
> functions.

> std::tr1::array - What's the difference between max_size and size?

> Thank you.

> -Sarath

Good question. It's not explained in the draft
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf

But max_size probably returns the maximum number of elements that can
be stored in this container. Since array is a fixed-size container I
would guess that the resulf of array<T,N>::max_size() equals
array<T,N>::size().

Cheers!
SG


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pete Becker  
View profile  
(1 user)  More options Aug 17, 10:51 am
Newsgroups: comp.lang.c++
From: Pete Becker <p...@versatilecoding.com>
Date: Mon, 17 Aug 2009 10:51:35 -0400
Local: Mon, Aug 17 2009 10:51 am
Subject: Re: std::tr1::array - What's the difference between max_size and size?

Sarath wrote:
> From the documentaiton, I could not find any difference between these
> functions.

> std::tr1::array - What's the difference between max_size and size?

STL containers in general provide both member functions. size() tells
you how many elements there are currently in the container, and
max_size() gives you an estimate of the maximum number of elements that
you could put into the container.

For array, both values are the same.

--
   Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of
"The Standard C++ Library Extensions: a Tutorial and Reference"
(www.petebecker.com/tr1book)


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Knockr  
View profile  
 More options Aug 19, 4:46 am
Newsgroups: comp.lang.c++
From: Knockr <csar...@gmail.com>
Date: Wed, 19 Aug 2009 01:46:54 -0700 (PDT)
Local: Wed, Aug 19 2009 4:46 am
Subject: Re: std::tr1::array - What's the difference between max_size and size?
On Aug 17, 11:51 pm, Pete Becker <p...@versatilecoding.com> wrote:

Thanks Pete and SG

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google