public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "squell at alumina dot nl" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/22634] partial_sum is too constrained
Date: Mon, 25 Jul 2005 14:02:00 -0000	[thread overview]
Message-ID: <20050725140145.782.qmail@sourceware.org> (raw)
In-Reply-To: <20050723200746.22634.squell@alumina.nl>


------- Additional Comments From squell at alumina dot nl  2005-07-25 14:01 -------
(In reply to comment #13)
> I've attached the work-around I personally use to this kind of problem, which is
> wrapping the iterator in another iterator which changes the value_type. 

I tried this approach as well :) I called it a 'cast_iterator'. However,
writing a full iterator class is involved, especially if you don't want to 
restrict the iterator class to 'input_iterator_tag'.

Second, I felt it was 'writing to the implementation'. I know that libstdc++
uses the 'value_type' to determine the type, but this doesn't mean other
implementations use it! In the end, it is a non-solution.

If you've want the non-expanding behaviour, this will always be possible by
simply using a function object. For example;

   std::partial_sum(begin, end, std::plus<char>())

This is *guaranteed* not to expand.

~Marc.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22634


  parent reply	other threads:[~2005-07-25 14:01 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-23 20:08 [Bug libstdc++/22634] New: " squell at alumina dot nl
2005-07-23 20:09 ` [Bug libstdc++/22634] " squell at alumina dot nl
2005-07-23 21:28 ` bangerth at dealii dot org
2005-07-23 23:50 ` squell at alumina dot nl
2005-07-24  0:22 ` bangerth at dealii dot org
2005-07-24  3:01 ` squell at alumina dot nl
2005-07-24  3:27 ` gdr at integrable-solutions dot net
2005-07-24  3:32 ` gdr at integrable-solutions dot net
2005-07-24 10:11 ` pcarlini at suse dot de
2005-07-24 12:41 ` gdr at integrable-solutions dot net
2005-07-24 17:18 ` squell at alumina dot nl
2005-07-24 17:26 ` gdr at integrable-solutions dot net
2005-07-25  9:51 ` chris at bubblescope dot net
2005-07-25 10:24 ` gdr at integrable-solutions dot net
2005-07-25 14:02 ` squell at alumina dot nl [this message]
2005-07-25 14:17 ` squell at alumina dot nl
     [not found] <bug-22634-11044@http.gcc.gnu.org/bugzilla/>
2006-02-04 12:45 ` squell at alumina dot nl
2006-02-04 20:53 ` pcarlini at suse dot de

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050725140145.782.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).