On 04/21/14 14:45, Steven Schveighoffer via Digitalmars-d wrote:
> Reasons off the top of my head not to make them module functions:

[...]

Functions, unlike methods, do not work with rvalues.

Ie

   struct S {
      long[999999] data;
      auto f() { return data[0]; }
   }

   auto g(ref S _this) { with (_this) return data[1]; }

   void main() {
      auto a = S().f();
      auto b = S().g();
   }

artur

Reply via email to