DMD 1.022 and 2.005 releases

BLS nanali at nospam-wanadoo.fr
Wed Oct 10 08:28:33 PDT 2007


0ffh schrieb:
> BLS wrote:
>> 0ffh schrieb:
>>> If you're so in love with C++, why bother with D?
>> NOOOOOoooo, clarification ;-), I don't like C++, BUT I need to translate
>> some Cpp libs into D. And sometimes it is difficult to do this job [...]
> 
> I suppose life just isn't fair. =)
> 
>> beside, C++ is No 2 on my personal programming language SL
> 
> What is an SL?
> 

I am pretty sure Gerhard Schroeder still has a top ten placement on 
George W. Bush's S-List, HTH :)

> Earlier, BLS wrote:
>> &references ... The Rationales do not say a anything about it The D 
>> "compared to C" just says ... We don't have it.
> 
> Yup, and good riddance I say!
> IMHO even the out/ref keyword is a mistake!
> (It's also the only mistake of it's kind in Pascal, btw.)
> 

I do not agree, but this is not the point. The problem is that C++ folks 
seems to love this feature, and I have to translate it into D (somehow).

>> Struct inheritance Why we need an *alias here instead of just writing 
>> structA : structB;
> 
> Maybe you have a point here. I suppose mixins can't be used, as there
> would probably be a problem overriding.
> 
>> C++ op overloading; D is not competitive.
> 
> Hmmmm.... I can't recall any major issues here.
> 

For example :
// Allready translated C++ stuff
class CFont
{
public:
   HFONT m_hFont;

   this(HFONT hFont = null)
   {
     m_hFont = hFont;
   }
   ~this()
   {
     if(m_hFont !is null && !DeleteObject(m_hFont))
     m_hFont = null;
   }

// TODO How to translate this C++ construct  into D

     operator HFONT() {return m_hFont;}

// That's the problem.
But as allready said/ D 2 opImplicitCast may solve the problem.

> Regards, Frank
Thanks Bjoern



More information about the Digitalmars-d-announce mailing list