This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [libstdc++] Doxygen markup for algorithms
- From: Jonathan Wakely <cow at compsoc dot man dot ac dot uk>
- To: Kenny Simpson <theonetruekenny at yahoo dot com>
- Cc: phil at jaj dot com, libstdc++ at gcc dot gnu dot org
- Date: Mon, 11 Feb 2002 10:34:48 +0000
- Subject: Re: [libstdc++] Doxygen markup for algorithms
- References: <20020211044413.93105.qmail@web20010.mail.yahoo.com>
On Sun, Feb 10, 2002 at 08:44:13PM -0800, Kenny Simpson wrote:
> I believe the description for std::for_each is overly
> restrictive. In particular, the requirement that
> * @p f must not modify its argument.
>
> Not the the old draft Standard had this restriction,
> but the final version does not. (implied from issue
> 290 - don't have my copy of the Standard in front of
> me).
>
> See
> http://std.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#290
>
> And also see Section 9.2.2: Nonmodifying Algorithms
> and Modifying Algorithms in Josutis' Book where he
> states that the function object passed to for_each may
> modify the element.
Oops, my mistake, I should have spotted that. I was working mainly from
the SGI docs when I started, and should have gone back to review it with
the other sources I was using (Josutis isn't one of them unfortunately)
Reading the text of the proposal am I right in thinking it can modify the
argument so long as it doesn't change anything that would affect the
ordering of the sequence?
To be honest, I'm glad the function object can modify its arg, as I've
got code that uses a functor to delete each pointer in a sequence, so now
I know it's standard conforming :)
Should there be a doxygen group for "non-modifying sequence operations"
that describes the common features of for_each, find_if etc. ?
I'll read the lwg issues again and review all my doxygen comments asap.
Thanks for spotting it!
jon
--
Dull but sincere filler