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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:10:09+00:00 2026-05-27T15:10:09+00:00

VC10 and GCC 4.4 accept the following, while Sun Studio 12 does not: std::pair<char*,

  • 0

VC10 and GCC 4.4 accept the following, while Sun Studio 12 does not:

std::pair<char*, int> p1;
std::pair<char* const, int> p2;
p1 = p2

Sun Studio 12 complains:

Error: Cannot use std::pair<char*const,
int> to initialize
std::pair<char*, int>.

Any ideas why this is happening and how I can get Sun Studio to ignore this. I am working with a third party library, which would be a pain to rewrite just for this sort of thing.

  • 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-27T15:10:10+00:00Added an answer on May 27, 2026 at 3:10 pm

    It seems to be a known issue with Sun’s std library.

    Your best bet may be to convince the author of the code to replace the assignment with:

    p1 = std::make_pair(p2.first, p2.second);
    

    Or at construction time:

    std::pair<char*, int> p1(p2.first, p2.second);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a std::map called 'prompts' which is declared like this: std::map<const int, wstring,
This example seems to compile with VC10 and gcc (though my version of gcc
Im using Opencv 2.3.1 on Visual studio 2010 (vc10) I have configured opencv based
I have the following line : CommonSettingsMandatory = #<Import Project=[\\.]*Shared(\\vc10\\|\\)CommonSettings\.targets, />#,true and i want
Other than Microsoft's upcoming VC10?
At http://blogs.msdn.com/vcblog/archive/2010/04/06/c-0x-core-language-features-in-vc10-the-table.aspx there is a table showing C++0x features that are implemented in 2010
I'm looking at [VC10's] unique_ptr and they do a couple things I don't understand:
I'm trying to compile VC6 project with VC10... I obtain an error C2678 with
I'm coding a simple SDL program with VC10. The problem that I am having
At my company, we recently switched from VC9 to VC10. We migrated our projects

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.