This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

STL_MEMBER_TEMPLATES implementation is slightly wrong



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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]