convert ... to array

Zarathustra adam.chrapkowski at gmail.com
Tue Oct 20 03:19:01 PDT 2009


  import std.stdio;
  class Foo{
    final int array(...){
      for(uint i = 0; i < _arguments.length; i++){
        if(_arguments[i] == typeid(int [])){

          int [] l_arr = *cast(int []*)_argptr;
          writefln("%d", l_arr[0]);
        }
      }
      return 0x0;
    }
  }
  //
    Foo foo = new Foo;
    int [] myarray = [1, 2, 3];
    foo.array(myarray);



More information about the Digitalmars-d-learn mailing list