[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with vector iterator

From: Thomas Maeder
Subject: Re: Help with vector iterator
Date: Sat, 08 Jan 2005 10:52:58 +0100
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Corporate Culture, linux)

[For some unknown reason, I can't access the original post, so I am
following up to this one.]

Guy Harrison <address@hidden> writes:

> Garrett Kajmowicz wrote:
>> I'm implementing the C++ standard library + stl for embedded systems
>> (  I have an implementation of std::vector which works
>> quite well up until you try and do vector<int>.  Any other data type is
>> find.
>> There are many problems which I have encountered, but this is the most
>> obvious (and I am hoping will lead me to the rest of the solution).
>> There are two insert functions I must provide:
>> void insert(iterator position, size_type n, const T& x );
>> template <class InputIterator> void insert(iterator position,
>> InputIterator first, InputIterator last)
>> For some reason, when I am using a data type of int, it will treat an
>> integer as an iterator which really screws things up.  Try dereferencing
>> and integer some time and enjoy the compiler errors.  In short, it always
>> calls the second function, even when I want it to call the first.

That's classical. E.g.:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]