fork download
  1. import std.algorithm;
  2. import std.stdio;
  3.  
  4. class Tag {
  5. public:
  6.  
  7. this ()
  8. {
  9. // empty
  10. }
  11.  
  12. string text () pure nothrow @safe
  13. {
  14. if (this.childs_) {
  15. return reduce! ((a, b) => a ~ b.text () ) ("", this.childs_);
  16. }
  17. else {
  18. return text_;
  19. }
  20. }
  21.  
  22. immutable auto childs ()
  23. {
  24. return this.childs_;
  25. }
  26.  
  27. private:
  28. Tag[] childs_;
  29. string text_;
  30. }
  31.  
  32. int main() {
  33. return 0;
  34. }
Success #stdin #stdout 0s 4092KB
stdin
Standard input is empty
stdout
Standard output is empty