On 7/25/20 4:07 PM, Steven Schveighoffer wrote:
On 7/25/20 3:16 PM, FreeSlave wrote:
On Saturday, 25 July 2020 at 14:19:15 UTC, Steven Schveighoffer wrote:
The only way to do this without code duplication (but with generated
code duplication) is to template the byAction function on the type o
On 7/25/20 3:16 PM, FreeSlave wrote:
On Saturday, 25 July 2020 at 14:19:15 UTC, Steven Schveighoffer wrote:
The only way to do this without code duplication (but with generated
code duplication) is to template the byAction function on the type of
`this`:
auto byAction(this This)() { /* same
On Saturday, 25 July 2020 at 18:06:51 UTC, powerboat9 wrote:
Does dlang have an analog to Result or Option types from rust?
In addition to Nullable in the standard library, there are some
packages on dub you might find useful:
* optional: an option type that can also function as a range, for
On Saturday, 25 July 2020 at 14:19:15 UTC, Steven Schveighoffer
wrote:
The only way to do this without code duplication (but with
generated code duplication) is to template the byAction
function on the type of `this`:
auto byAction(this This)() { /* same implementation */ }
Note that this O
On Saturday, 25 July 2020 at 18:06:51 UTC, powerboat9 wrote:
Does dlang have an analog to Result or Option types from rust?
Standard library has std.typecons.Nullable
https://dlang.org/phobos/std_typecons.html#Nullable
Note that objects are nullable by themselves as classes are
reference ty
Does dlang have an analog to Result or Option types from rust?
On 7/25/20 8:26 AM, FreeSlave wrote:
I want to be able to return a range of const objects from the const
object and a range mutable objects from the mutable object.
inout comes to mind, but not applicable in this case, because inout must
be applied to the return type as whole, which does not m
I want to be able to return a range of const objects from the
const object and a range mutable objects from the mutable object.
inout comes to mind, but not applicable in this case, because
inout must be applied to the return type as whole, which does not
make much sense for the range. Definin