Questions about D

Bill Baxter dnewsgroup at
Thu May 22 15:10:36 PDT 2008

Jarrett Billingsley wrote:
> "Bill Baxter" <dnewsgroup at> wrote in message 
> news:g14nq9$dgq$1 at
>> In C++ you can put things in an anonymous namespace:
>> namespace {
>>    int variable_only_i_can_see;
>>    double function_only_i_can_call() { return (double)rand()/RAND_MAX; }
>> }
>> In C you could use "static":
>>  static int only_i_can_see;
>> In D I'm not sure if there is any such thing.
> Uh, 'private'? 

Maybe it's supposed to have that effect, but currently at least it does 
not insulate you from namespace clashes.  Wasn't that how this 
conversation began?


More information about the Digitalmars-d-learn mailing list