SDL and a 'proper' forum

mike vertex at gmx.at
Mon Sep 4 07:32:38 PDT 2006


Am 04.09.2006, 03:53 Uhr, schrieb Daniel White <twinbee40 at skytopia.com>:

> Excellent! That's just the kind of thing I was hoping for. Is it
> possible
> to forget having to declare function headers above all the functions
> like
> one usually does in C?

Hi!

You don't have to declare functions before using them:

' void bar()
' {
'     foo(); // this works just nicely in D
' }
'
' void foo()
' {
'     doStuff();
' }

That's one of the reasons why I switched from C++ to D (and this is also  
one of the reasons why after converting some C++ stuff to D I had about  
30-40% less LOC).

Also you don't have to write those

' void MyClass::doStuff()

things and go hunting for implementations of member functions ("Where'd I  
put that function? In the header file or in the cpp file? Did I make it  
inline or not?") :-)

Declaration and implementation are always in the same spot and don't need  
to appear before the actual usage in the code.

-Mike

-- 
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/



More information about the Digitalmars-d-learn mailing list