"%s"-format template function arguments

2018-04-15 Thread vladdeSV via Digitalmars-d-learn
Hello people of D-land. In a template function, I want to format all arguments as if it was an array. Se this snippet of code: foo(1,2,3); void foo(T...)(T args) { writefln("expected: %s", [1,2,3]); writefln("actual: %s", args); } The code above will output

@property get/set or public varaible?

2016-12-04 Thread vladdeSV via Digitalmars-d-learn
Hello! I have a question not directly related to D as it is with coding standards. My issue at hand is if I have one variable for a class, which I want to be directly accessible for anything else, should it be 1. public, or 2. private, with @property get/setters? From what I have been

Re: Access vialotion

2016-06-22 Thread vladdeSV via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 12:47:31 UTC, TheDGuy wrote: On Wednesday, 22 June 2016 at 12:45:29 UTC, TheDGuy wrote: I have an array of buttons: class Window : MainWindow{ private Button[4] bArr; this(){ Button btn_1 = new Button(); Button btn_2 = new Button();