On Tuesday, 14 July 2020 at 00:17:14 UTC, solidstate1991 wrote:
Something like that, but with @safe, pure, etc. attributes.
I've tried to "bruteforce" it by generating functions with
combinations of attributes, and it kinda works, but is a very
janky solution.
I'll brainstorm some DIP to
On Tuesday, 7 July 2020 at 20:53:05 UTC, Ali Çehreli wrote:
I am not sure whether I understand it correctly but there has
been a request for opApply() to gain the attributes of the
delegate (or the range?). In other words, "transfer the
attributes to opApply". This is needed beca
there has been a
request for opApply() to gain the attributes of the delegate (or the
range?). In other words, "transfer the attributes to opApply". This is
needed because I want opApply() to work with any foreach body,
attributes of which opApply() cannot know.
I am sure I created an issu
On Tuesday, 7 July 2020 at 13:33:41 UTC, Paul Backus wrote:
You can make opApply a template:
int opApply(Dg)(Dg dg)
if (is(Dg : scope int delegate(ref E)))
{
// etc.
}
Because `scope int delegate(ref E) @safe` implicitly converts
to `scope int delegate(ref E)`,
On Tuesday, 7 July 2020 at 13:33:41 UTC, Paul Backus wrote:
You can make opApply a template:
int opApply(Dg)(Dg dg)
if (is(Dg : scope int delegate(ref E)))
{
// etc.
}
Because `scope int delegate(ref E) @safe` implicitly converts
to `scope int delegate(ref E)`,
On Tuesday, 7 July 2020 at 00:20:40 UTC, solidstate1991 wrote:
See implementation of data structure here:
https://github.com/ZILtoid1991/collections-d/blob/master/source/collections/treemap.d#L565
If I try to compile this code, it'll fail, limiting it's
usecase:
@safe pure unittest {
See implementation of data structure here:
https://github.com/ZILtoid1991/collections-d/blob/master/source/collections/treemap.d#L565
If I try to compile this code, it'll fail, limiting it's usecase:
@safe pure unittest {
alias IntMap = TreeMap!(int, int, false);
IntMap test;
On Sunday, 20 November 2016 at 16:36:18 UTC, Q. Schroll wrote:
How can I have relative-@attrib functions without unnecessary
manual overloading?
import std.traits;
auto f1(DG) (DG dg) if (isCallable!DG && Parameters!DG.length ==
1 && is(Parameters!DG[0] == int)) { // check other things here
When using functions with delegate (or function ptr) parameters
which should comply with some attributes, I cannot call the
delegate in the function what makes it pretty useless (I haven't
done research, but I claim that generally most functions taking
delegate parameters call them).
void