July 26, 2015
On Saturday, 25 July 2015 at 02:19:40 UTC, Max Klimov wrote:
> Where is unsafety? Code is the same for 3 versions

You only hope it's the same.

> Sorry, I didn't quite get it. What is this example for?

The example works like inout without inout, so you can use types with templates and virtual functions.
July 27, 2015
On Sunday, 26 July 2015 at 13:06:50 UTC, Kagamin wrote:
> The example works like inout without inout, so you can use types with templates and virtual functions.

Does constBack imply to have several static if constructions, function overloadings or template specializations? I mean does this help to reduce the amount of code? And it also sets aside the discussion about casting const away (http://forum.dlang.org/thread/riiehqozpkyluhhifwha@forum.dlang.org).

> You only hope it's the same.

I believe that generated code does not distinguish constness of object. Moreover, currently inout goes with one code, so it is possible.

All my questions and talks rose from inout restrictions on casting and keeping inside classes and structs. I'm not sure that they are needed. As for now, inout is quite useless for the cases little bit more complex than "inout(A) getData() inout { return data; }". It leads to templates overusage and code duplication. I'm not against inout, I'm for its improvement.


July 28, 2015
On Monday, 27 July 2015 at 20:13:31 UTC, Max Klimov wrote:
> I mean does this help to reduce the amount of code?

Function `f` in the example has only one instance of generated code.

> I'm not against inout, I'm for its improvement.

Improvement is welcome.
1 2
Next ›   Last »