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

  • Home
  • SEARCH
  • 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
  • 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-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

Ask A Question

Stats

  • Questions 531k
  • Answers 531k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If you have a sub-tree whose only nodes have empty… May 16, 2026 at 11:49 pm
  • Editorial Team
    Editorial Team added an answer OK, I got it. The module name is the (case… May 16, 2026 at 11:49 pm
  • Editorial Team
    Editorial Team added an answer Just change if($jackin) { to if(isset($jackin)) { in login.php file… May 16, 2026 at 11:49 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I'm developing a windows application in C# using VS2005. Consider i need to call
Environment: Built interface using Glade3. Backend is written in Python using the GTK+ Builder
Environment: Linux C++ / Qt 4x I do not understand why the following downcast
I’m currently using the OpenNETCF.Desktop.Communication.dll to copy files from my desktop to a CE
I want to start using .NET 3.5 features in an app that is currently
I've installed Git to do some development using Visual Studio 2008. Most of the
Hey all, I have created a WinForms to handle Persistence Activities using the Windows
I am using VS2008 + C# + .Net 3.5 + IIS 7.0 + ASP.Net
Environment: Main platform: MAC OSX 10.6 Secondary platform via VMWare Fusion: Windows 7 64-bit
Development Environment : - VS2010 - .Net Framework 4.0, 3.5, 2.0 Staging and Production

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.