www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.ide
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript
electronics



digitalmars.D - Re: rtti cast

↑ ↓ ← terranium <spam here.lot> writes:
BCS Wrote:

 Thinking about it, I can't recall ever casting to a derived type where a 
 failed cast was an indication of a bug.

 a little sugar for the other way might be even handier

May 08 2008
↑ ↓ → BCS <ao pathlink.com> writes:
Reply to terranium,

 BCS Wrote:
 
 Thinking about it, I can't recall ever casting to a derived type
 where a failed cast was an indication of a bug.
 


Ok, some some people use then one way, I use them another. That doesn't prove that they your proposal is better (or worse) than the current way.
 When a function receives unexpected input it's
 a bug.
 

That's irrelevant. What I'm saying is that in every case I know of where I have used such a cast, the cast failing was /not/ unexpected. It was mealy a legitimate and /expected/ "no" answer to the question "is a's type B?"
May 08 2008