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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T09:23:00+00:00 2026-06-02T09:23:00+00:00

Is there any valid reason why would one prefer one pair over the other

  • 0

Is there any valid reason why would one prefer one pair over the other over the third over the fourth in the following sample?

map<const int, int> test;

test.insert(const pair<const int, int>(3, 9));
test.insert(const pair<int, int>(3, 9));
test.insert(pair<int, int>(3, 9));
test.insert(pair<const int, int>(5, 9));
  • 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-06-02T09:23:01+00:00Added an answer on June 2, 2026 at 9:23 am

    Basically yes. A dumb compiler will invoke one extra conversion constructor in this code

    test.insert(pair<const int, int>(5, 9));
    

    but an optimizing compiler will make it the same as other alternatives.

    I only ask, who would want to write code like this? Normally, I would write test.insert(std::make_pair(3, 9)) and wouldn’t care.

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

Sidebar

Related Questions

Is there any reason why imagecolorallocatealpha() would only be making the text grey? <?php
Is there any tool that can parse a valid C program and generate a
Is there any way to write a valid header/link/image? Something like <a href=index.html><h1 id=logo>Company
Is there any way to format this so it's a valid expression, without adding
Is there any cross-browser css sticky footer with W3C valid css and semantic X/HTML?
I know that technically all three ways below are valid, but is there any
Is there any quick way to copy eclipse and android development environment from one
Is there any reason why I couldn't include two mysql_fetch_array statements working on two
Is there a valid security reason for URLEncoding all QueryString values, or is it
Is there any way to update cookies across folders in PHP? For example, consider

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.