Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.std.c++ > #270

Re: [alg.equal]: really requires a bidirectional iterator

From Pete Becker<pete@versatilecoding.com>
Newsgroups comp.std.c++
Subject Re: [alg.equal]: really requires a bidirectional iterator
Date 2011-09-03 14:36 -0700
Organization Roundhouse Consulting, Ltd.
Message-ID <2011090214140728116-pete@versatilecodingcom> (permalink)
References <j3oo43$2ti2$1@news2.ipartners.pl>

Show all headers | View raw


On 2011-09-02 17:45:58 +0000, Krzysztof Żelechowski said:

>  The expression (*i == *(first2 + (i - first1))) does not have a meaning for
>  input iterators.

See [alg.general]/12:

	In the description of the algorithms operators + and - are used for some
	of the iterator categories for which they do not have to be defined. In these
	cases the semantics of a+n is the same as that of

		X tmp = a;
  		advance(tmp, n);
  		return tmp;

	and that of b-a is the same as of

		return distance(a, b);

-- 
  Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The
Standard C++ Library Extensions: a Tutorial and Reference
(www.petebecker.com/tr1book)


[ comp.std.c++ is moderated.  To submit articles, try posting with your ]
[ newsreader.  If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]

Back to comp.std.c++ | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

[alg.equal]: really requires a bidirectional iterator Krzysztof Żelechowski<giecrilj@stegny.2a.pl> - 2011-09-02 10:45 -0700
  Re: [alg.equal]: really requires a bidirectional iterator Daniel Krügler<daniel.kruegler@googlemail.com> - 2011-09-03 14:36 -0700
  Re: [alg.equal]: really requires a bidirectional iterator Pete Becker<pete@versatilecoding.com> - 2011-09-03 14:36 -0700
    Re: [alg.equal]: really requires a bidirectional iterator Krzysztof Żelechowski<giecrilj@stegny.2a.pl> - 2011-09-05 15:13 -0700
      Re: [alg.equal]: really requires a bidirectional iterator Daniel Krügler<daniel.kruegler@googlemail.com> - 2011-09-06 11:19 -0700
  Re: [alg.equal]: really requires a bidirectional iterator Dave Abrahams<dave@boostpro.com> - 2011-09-03 14:36 -0700

csiph-web