On Monday, 17 July 2017 at 12:29:41 UTC, jmh530 wrote:
Forgive me, but what about anySatisfy
https://dlang.org/library/std/meta/any_satisfy.html
Oh sorry, I see that's a little different.
On Friday, 14 July 2017 at 19:49:05 UTC, Andrei Alexandrescu
wrote:
An effective way of improving the state of affairs would be to
create a PR that makes the constraint easier to read and write,
e.g.:
among!(R, double, int) && among!(W, string, char, dchar)
In fact it's surprising it
On Saturday, 15 July 2017 at 10:34:13 UTC, Enamex wrote:
But specializations are quite different from constraints, no?
Constraints wouldn't help when the template name is overloaded
and passes the constraint checks of several different template
implementations; specializations narrow things
On Friday, 14 July 2017 at 19:49:05 UTC, Andrei Alexandrescu
wrote:
On 7/14/17 2:19 PM, data pulverizer wrote:
template Construct(R: Union{double, int}, W: Union{string,
char, dchar})
template Construct(R, W)
if ((is(R == double) || is(R == int))
&& (is(W == string) || is(W == char) ||
On Friday, 14 July 2017 at 23:04:48 UTC, Stefan Koch wrote:
One important characteristic about constraints, is that they
are not bound to types.
Also they can from conjunctions and disjunctions.
Combined with ctfe they are very flexible and powerful.
I do not know how you would do the same
On Friday, 14 July 2017 at 22:49:18 UTC, data pulverizer wrote:
On Friday, 14 July 2017 at 22:25:15 UTC, data pulverizer wrote:
I am aware that this suggestion touches the language and the
compiler - and may significant implications. I would like to
know whether this could be done without too
On Friday, 14 July 2017 at 22:25:15 UTC, data pulverizer wrote:
I am aware that this suggestion touches the language and the
compiler - and may significant implications. I would like to
know whether this could be done without too much effort and
whether it would break anything else?
If you
On Friday, 14 July 2017 at 18:19:03 UTC, data pulverizer wrote:
Dear all,
Template specializations are a great feature in D. They allow
the programmer to create template specializations but they can
also be a powerful way of constraining templates by
implementing only the specializations
On Friday, July 14, 2017 4:45:10 PM MDT Andrei Alexandrescu via Digitalmars-
d wrote:
> On 07/14/2017 04:29 PM, Jonathan M Davis via Digitalmars-d wrote:
> > I'd guess that you'd use staticIndexOf an check for
> > -1 to implement it
>
> Given that constraints are user-facing, having a forwarding
On 07/14/2017 04:29 PM, Jonathan M Davis via Digitalmars-d wrote:
I'd guess that you'd use staticIndexOf an check for
-1 to implement it
Given that constraints are user-facing, having a forwarding one-liner
may be justifiable. -- Andrei
On Friday, July 14, 2017 3:49:05 PM MDT Andrei Alexandrescu via Digitalmars-
d wrote:
> On 7/14/17 2:19 PM, data pulverizer wrote:
> > template Construct(R: Union{double, int}, W: Union{string, char, dchar})
>
> template Construct(R, W)
> if ((is(R == double) || is(R == int))
> && (is(W ==
On 7/14/17 2:19 PM, data pulverizer wrote:
template Construct(R: Union{double, int}, W: Union{string, char, dchar})
template Construct(R, W)
if ((is(R == double) || is(R == int))
&& (is(W == string) || is(W == char) || is(W == dchar))
It would be good to get comments and suggestions
Dear all,
Template specializations are a great feature in D. They allow the
programmer to create template specializations but they can also
be a powerful way of constraining templates by implementing only
the specializations that you need. In contrast template
constraints can quickly become
13 matches
Mail list logo