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


Groups > comp.lang.java.programmer > #25838

Re: Java vs C++

X-FeedAbuse http://nntpfeed.proxad.net/abuse.pl feeded by 88.191.16.109
Path csiph.com!eeepc.pasdenom.info!news.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!nospam.fr.eu.org!usenet-fr.net!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From Joshua Cranmer <Pidgeot18@verizon.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Java vs C++
Date Sun, 06 Feb 2011 12:57:46 -0500
Organization A noiseless patient Spider
Lines 28
Message-ID <iimnes$dh2$1@news.eternal-september.org> (permalink)
References <iijbfr$pb2$1@lust.ihug.co.nz> <4d4d585c$0$81476$e4fe514c@news.xs4all.nl> <4d4d60dc$0$23763$14726298@news.sunsite.dk> <4d4d8322$0$41117$e4fe514c@news.xs4all.nl> <iil53i$q34$1@lust.ihug.co.nz> <iil5ed$10m$1@news.eternal-september.org> <iimf47$soo$1@news.belwue.de>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Sun, 6 Feb 2011 17:57:48 +0000 (UTC)
Injection-Info mx01.eternal-september.org; posting-host="LtjcJP1H6uHOtkcPMh0bUA"; logging-data="13858"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/K6azSZF0ynX7Y74G5wvOyS7jgULd7Yp8="
User-Agent Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.12pre) Gecko/20101019 Lightning/1.0b3pre Thunderbird/3.1.6pre
In-Reply-To <iimf47$soo$1@news.belwue.de>
Cancel-Lock sha1:p71fIvwf6TOxYRgTWmbv0PDG+Dw=
Xref csiph.com comp.lang.java.programmer:25838

Show key headers only | View raw


On 02/06/2011 10:35 AM, Thomas Richter wrote:
> Joshua Cranmer wrote:
>> Templates in C++ are basically advanced macros--each invocation of a
>> template type regenerates the class, so a Foo<int> and a Foo<double>
>> are two completely different things.
>
> That's much more than a macro could do. Templates are a language of its
> own, include syntax checks, etc. Quite unlike macros, they do not
> substitute text patterns. Templates allow meta-programming, i.e. you can
> use the compiler to generate code. And, of course, templates are quite
> complex - very unlike the simple-minded preprocessor.

It is the code generation that I'm referring to as "an advanced macro". 
It's a macro generator that understands types and is heavily integrated 
with the syntax of C++, but it is basically a way to automatically 
generate code.

> I beg your pardon? C++ allows nested templates since C++99 and before.
> The only issue here is a notational one, namely that you had to write
> A<B<C> > (note the space behind B<C>) to avoid >> being parsed as a
> token (shifting, namely). That is the only thing that got fixed in
> C++0x, not nesting templates which is part of the language since C++99.

I was specifically referring to the ability to use >> instead of > >.

-- 
Beware of bugs in the above code; I have only proved it correct, not 
tried it. -- Donald E. Knuth

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Re: Java vs C++ Silvio <silvio@moc.com> - 2011-02-05 18:04 +0100
  Re: Java vs C++ Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-02-07 16:21 +0800
  Re: Java vs C++ Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-02-07 12:28 +1300
  Re: Java vs C++ Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-02-08 09:22 +1300
    Re: Java vs C++ Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-02-07 17:25 -0500
      Re: Java vs C++ Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-02-08 16:08 +1300
  Re: Java vs C++ Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-02-07 12:24 +1300
    Re: Java vs C++ Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-02-07 15:03 +1300
      Re: Java vs C++ Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-02-06 21:18 -0500
      Re: Java vs C++ Arne Vajhøj <arne@vajhoej.dk> - 2011-02-06 21:26 -0500
    Re: Java vs C++ Arne Vajhøj <arne@vajhoej.dk> - 2011-02-06 20:15 -0500
  Re: Java vs C++ Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-02-07 15:55 +1300
  Re: Java vs C++ "javax.swing.JSnarker" <gharriman@boojum.mit.edu> - 2011-02-06 19:54 -0500
  Re: Java vs C++ Arne Vajhøj <arne@vajhoej.dk> - 2011-02-06 20:50 -0500
  Re: Java vs C++ Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-02-07 15:54 +0800
  Re: Java vs C++ Thomas Richter <thor@math.tu-berlin.de> - 2011-02-07 01:04 +0100
    Re: Java vs C++ Arne Vajhøj <arne@vajhoej.dk> - 2011-02-06 20:26 -0500
      Re: Java vs C++ Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-02-07 19:09 +1300
        Re: Java vs C++ Lew <noone@lewscanon.com> - 2011-02-07 07:29 -0500
        Re: Java vs C++ "Mike Schilling" <mscottschilling@hotmail.com> - 2011-02-06 22:52 -0800
    Re: Java vs C++ Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-02-07 13:32 +1300
  Re: Java vs C++ Thomas Richter <thor@math.tu-berlin.de> - 2011-02-06 16:35 +0100
    Re: Java vs C++ Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-02-07 15:51 +1300
      Re: Java vs C++ Arne Vajhøj <arne@vajhoej.dk> - 2011-02-06 22:06 -0500
    Re: Java vs C++ Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-02-07 15:01 +1300
      Re: Java vs C++ Thomas Richter <thor@math.tu-berlin.de> - 2011-02-07 14:53 +0100
    Re: Java vs C++ Arne Vajhøj <arne@vajhoej.dk> - 2011-02-07 19:52 -0500
    Re: Java vs C++ Lew <noone@lewscanon.com> - 2011-02-06 13:09 -0500
      Re: Java vs C++ Thomas Richter <thor@math.tu-berlin.de> - 2011-02-07 00:55 +0100
    Re: Java vs C++ Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-02-07 15:00 +1300
      Re: Java vs C++ Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-02-06 21:20 -0500
        Re: Java vs C++ Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-02-07 15:52 +1300
      Re: Java vs C++ Arne Vajhøj <arne@vajhoej.dk> - 2011-02-06 21:25 -0500
    Re: Java vs C++ Arne Vajhøj <arne@vajhoej.dk> - 2011-02-06 20:29 -0500
    Re: Java vs C++ Thomas Richter <thor@math.tu-berlin.de> - 2011-02-07 00:57 +0100
    Re: Java vs C++ Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-02-06 12:57 -0500
    Re: Java vs C++ Arne Vajhøj <arne@vajhoej.dk> - 2011-02-06 15:22 -0500
    Re: Java vs C++ "Mike Schilling" <mscottschilling@hotmail.com> - 2011-02-06 08:11 -0800
    Re: Java vs C++ Ken Wesson <kwesson@gmail.com> - 2011-02-07 04:41 +0100
  Re: Java vs C++ Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-02-06 21:12 -0500
  Re: Java vs C++ Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-02-07 12:26 +1300
  Re: Java vs C++ Arne Vajhøj <arne@vajhoej.dk> - 2011-02-06 15:27 -0500
  Re: Java vs C++ Thomas Richter <thor@math.tu-berlin.de> - 2011-02-06 16:45 +0100
  Re: Java vs C++ Arne Vajhøj <arne@vajhoej.dk> - 2011-02-06 20:51 -0500

csiph-web