Guest User

Check lvalue

a guest
May 26th, 2020
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 0.34 KB | None | 0 0
  1. import std.stdio : log = writeln;
  2. void main() {
  3.      log("Let's check whether 'this' is an lvalue");
  4.      Button btn = new Button("A button");  
  5. }
  6.  
  7. class Button
  8. {
  9.     this(string btntext)
  10.     {
  11.         mtext = btntext;
  12.         log("button created with the name , ", btntext);
  13.         log(&this);
  14.     }
  15.     private:
  16.     string mtext;
  17. }
Add Comment
Please, Sign In to add comment