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


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

Re: Java vs C++

From Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand>
Newsgroups comp.lang.java.programmer
Subject Re: Java vs C++
Followup-To comp.lang.java.programmer
Date 2011-02-07 15:02 +1300
Organization Geek Central
Message-ID <iinjr9$7j3$10@lust.ihug.co.nz> (permalink)
References (6 earlier) <iil74u$rac$1@lust.ihug.co.nz> <4d4f042b$0$23753$14726298@news.sunsite.dk> <iincuv$ot9$1@news.belwue.de> <iineik$3tp$10@lust.ihug.co.nz> <iinft1$95e$1@speranza.aioe.org>

Followups directed to: comp.lang.java.programmer

Show all headers | View raw


In message <iinft1$95e$1@speranza.aioe.org>, javax.swing.JSnarker wrote:

> On 06/02/2011 7:32 PM, Lawrence D'Oliveiro wrote:
>
>> In message<iincuv$ot9$1@news.belwue.de>, Thomas Richter wrote:
>>
>>> There is no "ClassCastException" in C++.
>>
>> Yes there is. It’s called “bad_cast”. Where do you think Java got the
>> idea from?
> 
> dynamic_cast<foo>(bar) can throw this if bar is not really a foo. But
> C++ lets you use the unsafe old (foo)bar cast from C, and if bar is not
> really a foo, welcome to undefined behaviorville.

The fact remains, there IS an equivalent to ClassCastException in C++.

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


Thread

Re: Java vs C++ Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-02-07 15:02 +1300
  Re: Java vs C++ Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-02-08 16:15 +1300
  Re: Java vs C++ Thomas Richter <thor@math.tu-berlin.de> - 2011-02-07 14:57 +0100

csiph-web