delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/04/19/11:13:01

From: "Olaf van der Spek" <Olaf AT XCC DOT TMFWeb DOT NL>
Newsgroups: comp.os.msdos.djgpp
Subject: Overloading?
Date: Wed, 19 Apr 2000 16:55:21 +0200
Organization: EuroNet Internet
Lines: 33
Sender: spek AT d21006 DOT dtk DOT chello DOT nl
Message-ID: <8dkhco$ft5$1@beast.euro.net>
NNTP-Posting-Host: d21006.dtk.chello.nl
X-Trace: beast.euro.net 956156120 16293 213.46.21.6 (19 Apr 2000 14:55:20 GMT)
X-Complaints-To: abuse AT euronet DOT nl
NNTP-Posting-Date: 19 Apr 2000 14:55:20 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi,

I'm new to DJGPP and have a problem with two functions with the same name,
but with different parameters.

This is my own one:
int distance(const Cak_vector& a, const Cak_vector& b);

And this was is from stl_iterator.h:
template <class _InputIterator>
inline typename iterator_traits<_InputIterator>::difference_type
distance(_InputIterator __first, _InputIterator __last) {
  typedef typename iterator_traits<_InputIterator>::iterator_category
    _Category;
  return __distance(__first, __last, _Category());
}

Now the problem is that the compiler complains about value_type not present
in Cak_vector, because value_type is probably used in some way by the STL
function.
Is this a compiler bug or is it designed this way?
The code compiled correctly with MS VC6.
Is there a way around this other then renaming the function?


--

Olaf van der Spek
Almere, Holland
Olaf AT XCC DOT TMFWeb DOT NL
http://xcc.tiberian.com/


- Raw text -


  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019