View mode: basic / threaded / horizontal-split · Log in · Help
August 12, 2010
Re: A const idiom + a different 'delete'
bearophile Wrote:

> void main() {
>     int[int] aa_;
>     foreach (i; 0 .. 10)
>         aa_[i] = i * i;
> 
>     // now I'd like to freeze aa
>     const(int[int]) aa = aa_;
> }
> 

void f()
{
 {
   int[int] aa;
   //fill
   g(aa);
 }
 void g(ref const int[int] bb)
 {
   //do stuff
 }
}
Top | Discussion index | About this forum | D home