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


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

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

From "A" <a@a.a>
Newsgroups comp.lang.c++
Subject Re: a kind of template (or macro) to reuse parts of code...
Date 2011-10-15 16:22 +0200
Organization B.net Hrvatska d.o.o.
Message-ID <j7c503$j0g$1@gregory.bnet.hr> (permalink)
References (1 earlier) <j7a4rj$g9k$1@dont-email.me> <j7a5ce$13h$1@gregory.bnet.hr> <9frk0iFvblU1@mid.individual.net> <j7a6ip$3cr$1@gregory.bnet.hr> <9frlr7FvblU2@mid.individual.net>

Show all headers | View raw


> *Please don't snip attributions, it is rude.*  I'll ignore you if you do 
> it again.

Sorry, don't have idea what you're talking about here. Just cutting out the 
relevant part for the answer. All newsreaders have in-reference-to header so 
it is groupped as it should be.

>> How is a macro list thing more convenient than a function?

Because in this particular case it would be more useful. I have overloaded 
function that calls something like this:

- a block of always the same block of code here
- something different
- a different block of the same code here

and it is repeated in overloaded functions over and over. if I make a simple 
change in one or the other block I have to copy-paste them in each 
overloaded function. maintaining this would be easier if this code is placed 
in a function or... a kind of macro like i asked for in above explanations.

>> do with macros or templates or any other way except functions?
> Why?  You haven't provided any justification for this new construct.

I am informing myself of other ways of doing things. I already explained I 
can do it with functions but in this particular case a macro thing would be 
way more practical. No solution fits purposes. 

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