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 7621057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:06:04+00:00 2026-05-31T04:06:04+00:00

The documentation for upper_bound states: …it attempts to find the element value in an

  • 0

The documentation for upper_bound states:

…it attempts to find the element value in an ordered range [first, last)… upper_bound returns the furthermost iterator i in [first, last) such that, for every iterator j in [first, i), value < *j is false.

However, if we have a vector<int> v that contains the numbers 1, 2, and 3, calling upper_bound(v.begin(), v.end(), 5) will return v.end(). But based on the definition, v.end() is not in the range [v.begin, v.end()). There is no such iterator that fits the requirements in the definition. Is the definition just lazy in not explicitly stating what happens in this case?

  • 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-31T04:06:06+00:00Added an answer on May 31, 2026 at 4:06 am

    SGI documentation is not relevant – the C++ standard is what you should be reading. Quoting C++11 §25.4.3.2:

    Returns: The furthermost iterator i in the range [first,last] such that for any iterator j in the range [first,i) the following corresponding conditions hold: !(value < *j) or comp(value, *j) == false.

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

Sidebar

Related Questions

Documentation for the constructor new Boolean(boolean value) in Java states: Note: It is rarely
Documentation for scala.util.Random.nextInt (n: Int): Int says "Returns a pseudorandom, uniformly distributed int value
Documentation for the stageWidth property of the stage object states that: If the value
Documentation states: Adds a user-defined custom member to an instance of a Windows PowerShell
Documentation says Dictionary keys order is unspecified. I guess it means the first added
Documentation states: Files are included based on the file path given or, if none
jCarousel documentation states the following: By passing the callback function itemLoadCallback as configuration option,
Documentation states: class Cart { // ... /** * @OneToOne(targetEntity=Customer, inversedBy=cart) * @JoinColumn(name=customer_id, referencedColumnName=id)
Documentation simply states that setting setAutosavingDelay to anything > 0 on the shared doc
Documentation states that 'handleResponseEnd' is called when the response has been completely received. http://twistedmatrix.com/documents/11.0.0/api/twisted.web.http.HTTPClient.html#handleResponseEnd

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.