Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7651015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:24:00+00:00 2026-05-31T11:24:00+00:00

I am just exploring the STL containers in C++. Have some questions… There are

  • 0

I am just exploring the STL containers in C++. Have some questions…
There are two member functions max_size() and size(). They seem to be doing the same thing. I initially thought max_size() is the actual size of the array and size() is the number of elements explicitly stored. But as I tested it out, it’s not the case. Then why two different functions?

Is there any place where I can read the design specs of containers like in Java(not the functional description)? I seem to have many questions such as why the std::array size is fixed but can’t be changed dynamically like std::vector etc. Obviously there has to one reason or another for such design decisions. It would be useful to read such design specs to understand such limitations. I have one old “Effective STL” which doesn’t include std::array. I believe Scott meyers is yet to include std::array in it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T11:24:01+00:00Added an answer on May 31, 2026 at 11:24 am

    The max_size method of std::array only exists to make it look like the other STL containers. By having a common interface with other containers, much of the same code can be used for arrays, vectors and lists.

    Of course, since the size of an array<T, N> is part of the type, the size and max_size must both return the same value, N.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just started exploring TWILL . Twill is an amazing scripting language for
I just started exploring Scala in my free time. I have to say that
I have just started exploring SpringMVC and logback. This is my controller, (the only
I was just exploring Phorum for my website. I already have a separate log
I have just started this week in exploring Android Open GL ES and related
Just started exploring the API. I'm trying to get some documents' metadata via the
I have just started exploring Couchbase Mobile for Android and have been impressed with
I have just started exploring Backbone.js. Upon submission of a form I would like
Hi I have been recently exploring some of the Javascript mobile frameworks that can
I'm exploring annotations and came to a point where some annotations seems to have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.