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


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

Re: Why const int& ?

From Ian Collins <ian-news@hotmail.com>
Newsgroups comp.lang.c++
Subject Re: Why const int& ?
Date 2011-11-07 07:43 +1300
Message-ID <9ho2pnF62gU2@mid.individual.net> (permalink)
References <6b75c326-029d-49c2-8b81-e8e7095dc695@du8g2000vbb.googlegroups.com>

Show all headers | View raw


On 11/ 7/11 06:00 AM, Travis Parks wrote:
> Could someone quickly remind me why functions taking ints should
> consider passing by constant reference?

Your wouldn't normally pass an int by const reference, but if you are 
declaring a template, then const reference ( const T& ) is appropriate.

-- 
Ian Collins

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


Thread

Why const int&  ? Travis Parks <jehugaleahsa@gmail.com> - 2011-11-06 09:00 -0800
  Re: Why const int&  ? "io_x" <a@b.c.invalid> - 2011-11-06 18:09 +0100
  Re: Why const int&  ? Marc <marc.glisse@gmail.com> - 2011-11-06 17:12 +0000
  Re: Why const int&  ? Ian Collins <ian-news@hotmail.com> - 2011-11-07 07:43 +1300
  Re: Why const int& ? Joshua Maurice <joshuamaurice@gmail.com> - 2011-11-07 14:36 -0800
    Re: Why const int& ? Travis Parks <jehugaleahsa@gmail.com> - 2011-11-07 18:37 -0800
      Re: Why const int& ? Joshua Maurice <joshuamaurice@gmail.com> - 2011-11-08 17:13 -0800
        Re: Why const int& ? Juha Nieminen <nospam@thanks.invalid> - 2011-11-09 09:00 +0000
          Re: Why const int& ? Brian Drummond <brian@shapes.demon.co.uk> - 2011-11-09 09:49 +0000
        Re: Why const int& ? Travis Parks <jehugaleahsa@gmail.com> - 2011-11-11 16:11 -0800

csiph-web