Path: csiph.com!eeepc.pasdenom.info!news.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!news.belwue.de!not-for-mail From: Thomas Richter Newsgroups: comp.lang.java.programmer Subject: Re: Java vs C++ Date: Mon, 07 Feb 2011 00:57:45 +0100 Organization: InterNetNews at News.BelWue.DE (Stuttgart, Germany) Lines: 33 Message-ID: References: <4d4d585c$0$81476$e4fe514c@news.xs4all.nl> <4d4d60dc$0$23763$14726298@news.sunsite.dk> <4d4d8322$0$41117$e4fe514c@news.xs4all.nl> <4d4f0302$0$23753$14726298@news.sunsite.dk> NNTP-Posting-Host: vpn-m-8d3a2f62.campus.uni-stuttgart.de Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.belwue.de 1297036666 24632 141.58.47.98 (6 Feb 2011 23:57:46 GMT) X-Complaints-To: news@news.belwue.de NNTP-Posting-Date: Sun, 6 Feb 2011 23:57:46 +0000 (UTC) User-Agent: Mozilla-Thunderbird 2.0.0.24 (X11/20100329) In-Reply-To: <4d4f0302$0$23753$14726298@news.sunsite.dk> Xref: csiph.com comp.lang.java.programmer:25818 Arne Vajhøj wrote: >> Well, java had to take the route of type-erasure to allow generic >> progamming plus type checks because it wasn't part of the language to >> begin with, so it was "hacked" into the specs more or less. Generics are >> considerably less powerful, but also considerably easier than C++ >> templates. There's no metaprogramming with generics, and generics are >> mostly limited to containers which does not hold for C++ templates. They >> are quite different. > > Java generics are useful for more than containers. > > It just get complex when used for more than containers. Well, I didn't mean to say something else (see, I wrote "mostly", not "only"), but nevertheless, could you provide an example? >>> About the only thing they share in common is the syntax, and even >>> then, C++ didn't allow A> until C++0x (which, according to Bjarne >>> Stroustroup, took a bit of work to convince compiler vendors to accept). >> >> 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 > (note the space behind B) 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. > > Joshua did not claim otherwise. This was at least worded in a very misleading way. So long, Thomas