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


Groups > comp.lang.c++ > #14455

Re: min/max by value - 25% faster

From Miles Bader <miles@gnu.org>
Newsgroups comp.lang.c++
Subject Re: min/max by value - 25% faster
Date 2012-02-23 22:43 +0900
Message-ID <87r4xl7jio.fsf@catnip.gol.com> (permalink)
References <d06bfb98-0fdb-4ca9-95e3-15faea0dfb4d@n12g2000yqb.googlegroups.com> <slrnjkaqn7.1ls.grahn+nntp@frailea.sa.invalid> <8b9d70a6-0087-489f-8195-216d429fd95d@t15g2000yqi.googlegroups.com>

Show all headers | View raw


Eirik <eirik.olimstad@gmail.com> writes:
> That example will of course result int the same, as foo takes
> arguments by value...

Er, isn't that the whole point -- that std::min yields _exactly the
same code_ as your hand-rolled not-using-references MIN thingy
(meaning there's no reason to not use std::min)?

-miles

-- 
Innards, n. pl. The stomach, heart, soul, and other bowels.

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

min/max by value - 25% faster Eirik <eirik.olimstad@gmail.com> - 2012-02-22 04:56 -0800
  Re: min/max by value - 25% faster Mike McCarty <mcmccarty@gmail.com> - 2012-02-22 06:56 -0800
    Re: min/max by value - 25% faster gwowen <gwowen@gmail.com> - 2012-02-22 07:56 -0800
    Re: min/max by value - 25% faster Eirik <eirik.olimstad@gmail.com> - 2012-02-22 10:00 -0800
      Re: min/max by value - 25% faster Mike McCarty <mcmccarty@gmail.com> - 2012-02-22 14:06 -0800
        Re: min/max by value - 25% faster BGB <cr88192@hotmail.com> - 2012-02-22 16:37 -0700
  Re: min/max by value - 25% faster Joshua Maurice <joshuamaurice@gmail.com> - 2012-02-22 14:16 -0800
  Re: min/max by value - 25% faster Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-02-22 22:23 +0000
    Re: min/max by value - 25% faster Eirik <eirik.olimstad@gmail.com> - 2012-02-23 04:47 -0800
      Re: min/max by value - 25% faster Miles Bader <miles@gnu.org> - 2012-02-23 22:43 +0900
      Re: min/max by value - 25% faster Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-02-23 15:39 +0000

csiph-web