This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
STL_MEMBER_TEMPLATES implementation is slightly wrong
- To: "Brad M. Garcia" <bgarcia at eng dot fore dot com>
- Subject: STL_MEMBER_TEMPLATES implementation is slightly wrong
- From: Mark Mitchell <mmitchell at usa dot net>
- Date: Tue, 6 Jan 1998 10:13:36 GMT
- Cc: egcs-bugs at cygnus dot com
- References: <Pine.LNX.3.96.980106105653.16175A-100000@spud.eng.fore.com>
- Reply-To: mmitchell at usa dot net
>>>>> "Brad" == Brad M Garcia <bgarcia@eng.fore.com> writes:
Brad> Code that looks like:
Brad> vector<myclass>::iterator begin;
Brad> vector<myclass>::const_iterator end; vector<myclass> foo(
Brad> begin, end );
Brad> No longer works with STL_MEMBER_TEMPLATES turned on. The
Brad> template definition for this particular constructor is:
Brad> template <class InputIterator> vector(InputIterator first,
Brad> InputIterator last) : start(0), finish(0), end_of_storage(0)
Brad> { range_initialize(first, last, iterator_category(first)); }
Brad> Which means that the two arguments to the constructor must
Brad> be of the same exact type (which is not correct). The above
In fact, this is precisely what the standard specifies:
template <class InputIterator>
vector(InputIterator first, InputIterator last,
const Allocator& = Allocator());
So, the implementation is correct.
Brad> Brad Garcia ___/ __ / __ / ___/ "Being the Linux of digital
Brad> media __/ / / / _/ __/ would be a very good life." _/ ____/
Brad> _/ _| ____/ - Jean-Louis Gassee, CEO of Be, Inc.
--
Mark Mitchell mmitchell@usa.net
Stanford University http://www.stanford.edu