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


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

Re: a kind of template (or macro) to reuse parts of code...

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!news-1.dfn.de!news.dfn.de!news.informatik.hu-berlin.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Ian Collins <ian-news@hotmail.com>
Newsgroups comp.lang.c++
Subject Re: a kind of template (or macro) to reuse parts of code...
Date Sat, 15 Oct 2011 09:22:42 +1300
Lines 21
Message-ID <9frk0iFvblU1@mid.individual.net> (permalink)
References <j7a2dr$reb$1@gregory.bnet.hr> <j7a4rj$g9k$1@dont-email.me> <j7a5ce$13h$1@gregory.bnet.hr>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Trace individual.net ltV28NYs/CbyUQmHrHSbXAFj02DRIiyXmN3DAJ+ZHI+s/GeH0P
Cancel-Lock sha1:j0Ea8PY+5tB3GKRMdAxQOOcHIUc=
User-Agent Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.2.9) Gecko/20101021 Lightning/1.0b2 Thunderbird/3.1.4
In-Reply-To <j7a5ce$13h$1@gregory.bnet.hr>
Xref x330-a1.tempe.blueboxinc.net comp.lang.c++:10849

Show key headers only | View raw


On 10/15/11 09:16 AM, A wrote:

Please don't snip attributions, it is rude.

>> The above sounds as if you're asking about how to define functions, but
>> then in the text you indicate that you are familiar with that. So it does
>> not make sense as given. You need to provide a more clear example.
>
> If I call a function that would imply after compilation - storing registers
> on stack, a call to function, then returning registers from stack and
> return. All of that takes CPU cycles for time-critical loops. With inline
> code it would be compilers job to kind of "paste" a code defined in the
> template. And no, I don't really want to use inline assembly.

How do you know?  Have you measured?

C++ (and C these days) compilers are very good at inlining trivial 
functions.

-- 
Ian Collins

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


Thread

a kind of template (or macro) to reuse parts of code... "A" <a@a.a> - 2011-10-14 21:25 +0200
  Re: a kind of template (or macro) to reuse parts of code... "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2011-10-14 22:08 +0200
    Re: a kind of template (or macro) to reuse parts of code... "A" <a@a.a> - 2011-10-14 22:16 +0200
      Re: a kind of template (or macro) to reuse parts of code... Ian Collins <ian-news@hotmail.com> - 2011-10-15 09:22 +1300
        Re: a kind of template (or macro) to reuse parts of code... "A" <a@a.a> - 2011-10-14 22:36 +0200
          Re: a kind of template (or macro) to reuse parts of code... Ian Collins <ian-news@hotmail.com> - 2011-10-15 09:53 +1300
            Re: a kind of template (or macro) to reuse parts of code... "A" <a@a.a> - 2011-10-15 16:22 +0200
              Re: a kind of template (or macro) to reuse parts of code... Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-10-15 16:54 +0000
          Re: a kind of template (or macro) to reuse parts of code... Noah Roberts <roberts.noah@gmail.com> - 2011-10-14 14:07 -0700
      Re: a kind of template (or macro) to reuse parts of code... Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-10-15 07:33 +0000
    Re: a kind of template (or macro) to reuse parts of code... "A" <a@a.a> - 2011-10-14 22:18 +0200
  Re: a kind of template (or macro) to reuse parts of code... Marcel Müller <news.5.maazl@spamgourmet.com> - 2011-10-14 23:01 +0200
  Re: a kind of template (or macro) to reuse parts of code... Richard Damon <news.x.richarddamon@xoxy.net> - 2011-10-14 17:31 -0400
    Re: a kind of template (or macro) to reuse parts of code... "A" <a@a.a> - 2011-10-15 16:13 +0200
      Re: a kind of template (or macro) to reuse parts of code... "A" <a@a.a> - 2011-10-15 17:54 +0200
        Re: a kind of template (or macro) to reuse parts of code... Richard Damon <news.x.richarddamon@xoxy.net> - 2011-10-15 12:02 -0400

csiph-web