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


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

Re: Use of const for non-reference parameters

From Gerhard Fiedler <gelists@gmail.com>
Subject Re: Use of const for non-reference parameters
Newsgroups comp.lang.c++
References <ygfhb7qi2dg.fsf@janus.isnogud.escape.de> <ee7c7f58-c957-44d8-991b-9b5e28704910@e35g2000yqc.googlegroups.com> <563a9f52-48ad-466b-9b2d-d83ae30d4b8e@fr19g2000vbb.googlegroups.com> <9e808451-1a06-4111-a302-c067d702fda1@t14g2000yqc.googlegroups.com>
Date 2011-06-17 11:41 -0300
Message-ID <1vp46u429msfo$.dlg@gelists.gmail.com> (permalink)
Organization Unlimited download news at news.astraweb.com

Show all headers | View raw


Howard Hinnant wrote:

> On Jun 16, 4:22 pm, Michael DOUBEZ <michael.dou...@free.fr> wrote:
>> Are you sure of that ? Did you observe it on a compiler ? 
> Did you?
[...]
>> Yet, this is pure speculation because compiler have ways to optimise
>> code beyond our abilities.

> $ clang++ -std=c++0x -stdlib=libc++ -DSLOW test.cpp

I don't know this compiler, but shouldn't you enable all possible
optimizations when talking about performance and optimization?

> $ a.out
> test lvalue
> copy construct
> copy construct
> 
> test rvalue
> copy construct
> [...]

This seems to be the expected behavior of unoptimized code, without any
performance data.

Gerhard

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


Thread

Use of const for non-reference parameters Urs Thuermann <urs@isnogud.escape.de> - 2011-06-16 10:53 +0200
  Re: Use of const for non-reference parameters Ian Collins <ian-news@hotmail.com> - 2011-06-16 21:15 +1200
    Re: Use of const for non-reference parameters yatremblay@bel1lin202.(none) (Yannick Tremblay) - 2011-06-16 11:50 +0000
  Re: Use of const for non-reference parameters "Balog Pal" <pasa@lib.hu> - 2011-06-16 11:35 +0200
    Re: Use of const for non-reference parameters Urs Thuermann <urs@isnogud.escape.de> - 2011-06-16 15:21 +0200
      Re: Use of const for non-reference parameters Marc <marc.glisse@gmail.com> - 2011-06-16 16:25 +0000
  Re: Use of const for non-reference parameters Michael DOUBEZ <michael.doubez@free.fr> - 2011-06-16 02:38 -0700
  Re: Use of const for non-reference parameters Saeed Amrollahi <amrollahi.saeed@gmail.com> - 2011-06-16 03:15 -0700
  Re: Use of const for non-reference parameters "Fred Zwarts \(KVI\)" <F.Zwarts@KVI.nl> - 2011-06-16 13:33 +0200
  Re: Use of const for non-reference parameters Howard Hinnant <howard.hinnant@gmail.com> - 2011-06-16 09:50 -0700
    Re: Use of const for non-reference parameters Michael DOUBEZ <michael.doubez@free.fr> - 2011-06-16 13:22 -0700
      Re: Use of const for non-reference parameters Howard Hinnant <howard.hinnant@gmail.com> - 2011-06-16 13:49 -0700
        Re: Use of const for non-reference parameters Gerhard Fiedler <gelists@gmail.com> - 2011-06-17 11:41 -0300
          Re: Use of const for non-reference parameters "Balog Pal" <pasa@lib.hu> - 2011-06-17 18:40 +0200
            Re: Use of const for non-reference parameters "Thomas J. Gritzan" <phygon_antispam@gmx.de> - 2011-06-17 22:01 +0200
              Re: Use of const for non-reference parameters "Balog Pal" <pasa@lib.hu> - 2011-06-18 03:01 +0200
            Re: Use of const for non-reference parameters Joshua Maurice <joshuamaurice@gmail.com> - 2011-06-17 13:30 -0700
          Re: Use of const for non-reference parameters Howard Hinnant <howard.hinnant@gmail.com> - 2011-06-17 16:51 -0700
  Re: Use of const for non-reference parameters "Johannes Schaub (litb)" <schaub.johannes@googlemail.com> - 2011-06-17 16:35 +0200
  Re: Use of const for non-reference parameters Juha Nieminen <nospam@thanks.invalid> - 2011-06-18 10:14 +0000
    Re: Use of const for non-reference parameters Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-06-18 11:45 +0000
      Re: Use of const for non-reference parameters "Alf P. Steinbach /Usenet" <alf.p.steinbach+usenet@gmail.com> - 2011-06-18 19:27 +0200

csiph-web