About static variables

Christophe travert at phare.normalesup.org
Mon Sep 5 15:18:24 PDT 2011


Nothing worth adding a confusing semantic to the langage. Just prefix 
your variable's name.
Nobody will want to use myFunctionPrivateVariable outside of myFunction:

class Foo {
  private size_t myFunctionPrivateCount;
  void myFunction() {
    alias myFunctionPrivateCount count;
       // ..
       count++;
  }                                                                                                                                                          
}



More information about the Digitalmars-d-learn mailing list