help-gplusplus
[Top][All Lists]
Advanced

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

Re: Help with vector iterator


From: Ulrich Eckhardt
Subject: Re: Help with vector iterator
Date: Mon, 03 Jan 2005 09:57:09 +0100
User-agent: KNode/0.7.7

Garrett Kajmowicz wrote:
> I'm implementing the C++ standard library + stl for embedded systems
> (ucxx.uclibc.org).

I guess you mean http://cxx.uclibc.org

BTW: 'the STL' is a library created by HP long ago. It influenced the C++
standardlibrary, but it is not part thereof although oth intersect a lot.
IOW, very strictly spoken, your above sentence makes no sense.

> 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.

Firstly, I'm not sure how that is related to the GCC. However, you could
take a look at e.g. STLport and how they do it. IIRC, disambiguating
between the two versions is done via some metaprogramming tricks.
And no, other than STLport's, you can't copy code from GCC's libstdc++ due
to conflicting licenses AFAICT, but IANAL.

Uli

-- 
http://gcc.gnu.org/faq.html
http://parashift.com/c++-faq-lite/


reply via email to

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