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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T21:17:22+00:00 2026-05-14T21:17:22+00:00

Environment: VS2005 C++ using STLPort 5.1.4. Compiling the following code snippet: std::string copied =

  • 0

Environment: VS2005 C++ using STLPort 5.1.4.

Compiling the following code snippet:

std::string copied = "asdf";
char ch = 's';
copied.insert(0,1,ch);

I receive an error:

Error   1   error C2668: 'stlpx_std::basic_string<_CharT,_Traits,_Alloc>::insert' : ambiguous call to overloaded function   

It appears that the problem is the insert method call on the string object.

The two defined overloads are

void insert ( iterator p, size_t n, char c );
string& insert ( size_t pos1, size_t n, char c );

But given that STLPort uses a simple char* as its iterator, the literal zero in the insert method in my code is ambiguous.

So while I can easily overcome the problem by hinting such as

copied.insert(size_t(0),1,ch);

My question is: is this overloading and possible ambiguity intentional in the specification? Or more likely an unintended side-effect of the specific STLPort implementation?

(Note that the Microsoft-supplied STL does not have this problem as it has a class for the iterator, instead of a naked pointer)

  • 1 1 Answer
  • 1 View
  • 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-14T21:17:23+00:00Added an answer on May 14, 2026 at 9:17 pm

    Known issue, ruled “Not A Defect”. http://std.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#84

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

Sidebar

Related Questions

Environment: Seam, Richfaces The following code snippet causes the method getUsers to be called
I receive the following error when attempting to Step Into a process using F11
The following code immediately crashes the Visual Basic compiler in VS2005 (at least, for
Environment I am using the native document management integration between Microsoft Dynamics CRM 2011
(Environment: gcc/g++ 4.6.1 in -std=gnu++0x mode on Linux 3.0 / x86_64...) #include <stdlib.h> #include
I'm developing a windows application in C# using VS2005. Consider i need to call
This is trouble shooting question. Our application's development environment is VS2005 C/C++, VB6 based
I am using C# in VS2008 in a WinXP/Win7/WinServer2003 environment. Is there a way
Environment: Rails 3.0.1 Ruby 1.8.7 MySQL 5.5.16 Community server...Jdk 1.6 gem 'sunspot_rails' gem 'sunspot_solr'
Environment: Windows Server 2008 R2 on Amazon EC2 Netbeans IDE with Glassfish started on

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.