On Tuesday, 17 February 2015 at 19:46:09 UTC, Nordlöw wrote:
Superb! I'd like to see this getting into std.typecons.
Having this in the language will attract (more) Ada programmers
to D.
Should I do PR for std.typecons.[iI]ndexedBy?
I'm not familiar with Ada, and I don't immediately see
On Wednesday, 18 February 2015 at 12:44:22 UTC, anonymous wrote:
Should I do PR for std.typecons.[iI]ndexedBy?
I'm not familiar with Ada, and I don't immediately see what
indexedBy is good for. So maybe gather some examples where it's
beneficial, before going for Phobos.
Ok, I have a use
Having this in the language will attract (more) Ada programmers
to D.
“Having this or that will attract (XY)-programmers / magically
make D successful in niche Z” is an argument too weak for phobos
inclusion, IMO.
On Tuesday, 17 February 2015 at 13:38:41 UTC, Per Nordlöw wrote:
This looses most of the meaning of my idea. I still want my
range to inherit all the powers of its wrapped range.
Is there no way to disable member functions in D?
I hadn't thought of @disable. Played around with it a bit. The
On Monday, 16 February 2015 at 20:17:55 UTC, anonymous wrote:
Remove that `alias _r this;`. You don't want to forward
opIndex, so you can't use alias this which forwards everything
that doesn't compile. opDispatch may be an option to forward
everything but opIndex.
This looses most of the
On Tuesday, 17 February 2015 at 15:02:05 UTC, anonymous wrote:
I hadn't thought of @disable. Played around with it a bit. The
following code seems to work. I didn't really test it or think
very hard about it, though.
Superb! I'd like to see this getting into std.typecons.
Having this in the
On Monday, 16 February 2015 at 20:09:09 UTC, Nordlöw wrote:
I'm trying to figure out how to implement a light-weight wrappr
realizing type-safe indexing á lá Ada. Here's my first try:
struct Ix(T = size_t)
{
@safe pure: @nogc nothrow:
this(T ix) { this._ix = ix; }
alias _ix this;
On Monday, 16 February 2015 at 20:09:09 UTC, Nordlöw wrote:
I'm trying to figure out how to implement a light-weight wrappr
realizing type-safe indexing á lá Ada. Here's my first try:
See also:
https://github.com/nordlow/justd/blob/master/typecons_ex.d#L83
I'm trying to figure out how to implement a light-weight wrappr
realizing type-safe indexing á lá Ada. Here's my first try:
struct Ix(T = size_t)
{
@safe pure: @nogc nothrow:
this(T ix) { this._ix = ix; }
alias _ix this;
private T _ix = 0;
}
struct IndexedBy(R, I)
{
auto
On Monday, 16 February 2015 at 20:09:09 UTC, Nordlöw wrote:
How can I prevent
jx[0] = 11;
from compiling?
Remove that `alias _r this;`. You don't want to forward opIndex,
so you can't use alias this which forwards everything that
doesn't compile. opDispatch may be an option to forward
On Monday, 16 February 2015 at 20:48:29 UTC, Nordlöw wrote:
Thanks!
See also:
http://forum.dlang.org/thread/akibggljgcmmacsba...@forum.dlang.org
On Monday, 16 February 2015 at 20:17:55 UTC, anonymous wrote:
Remove that `alias _r this;`. You don't want to forward
opIndex, so you can't use alias this which forwards everything
that doesn't compile. opDispatch may be an option to forward
everything but opIndex.
Thanks!
On Monday, 16 February 2015 at 20:17:55 UTC, anonymous wrote:
that doesn't compile. opDispatch may be an option to forward
everything but opIndex.
What about disable?
13 matches
Mail list logo