On Tuesday, 29 May 2018 at 19:17:37 UTC, Vijay Nayar wrote:
On Tuesday, 29 May 2018 at 12:58:20 UTC, Yuxuan Shui wrote:
[...]
I tried this again, this time completely ignoring lambdas and
completely specifying the desired type like so:
[...]
Issue created:
On Tuesday, 29 May 2018 at 12:58:20 UTC, Yuxuan Shui wrote:
I believe that is the case. Normally that will be fine, because
you can't modify them. Type-deduced lambda is a very special
case, as in their parameter types are deduced on first use, so
in a sense, they are "modified" by the first
On Tuesday, 29 May 2018 at 12:37:04 UTC, Vijay Nayar wrote:
On Tuesday, 29 May 2018 at 11:36:11 UTC, Yuxuan Shui wrote:
No, wait a second. (a)=>a is in default argument list, so it
is in the global scope. And it was instantiated when you
instantiate BTree with char.
Could you explain that
On Tuesday, 29 May 2018 at 11:36:11 UTC, Yuxuan Shui wrote:
No, wait a second. (a)=>a is in default argument list, so it is
in the global scope. And it was instantiated when you
instantiate BTree with char.
Could you explain that part a bit for me? Yes, (a) => a is a
default value, but
On Tuesday, 29 May 2018 at 11:34:03 UTC, Yuxuan Shui wrote:
On Saturday, 26 May 2018 at 11:56:30 UTC, Vijay Nayar wrote:
I've been experimenting with code that uses std.functional :
binaryFun and unaryFun, but I have found that using these
methods makes it impossible to add function attributes
On Saturday, 26 May 2018 at 11:56:30 UTC, Vijay Nayar wrote:
I've been experimenting with code that uses std.functional :
binaryFun and unaryFun, but I have found that using these
methods makes it impossible to add function attributes like
@safe, @nogc, pure, and nothrow, because no guarantee
On Sunday, 27 May 2018 at 20:38:25 UTC, Daniel Kozak wrote:
I would rewrite it to something like this:
template BTree(ValueT, KeyT = ValueT,alias KeyF =
unaryFun!"cast(const)a")
{
class BTree
{
This is roughly what I originally had, but it creates a number of
problems that I wanted
I would rewrite it to something like this:
import std.stdio;
import std.functional;
template BTree(ValueT, KeyT = ValueT,alias KeyF = unaryFun!"cast(const)a")
{
class BTree
{
auto getKey(ValueT val) {
return KeyF(val);
}
}
}
void main()
{
auto btree1
On Saturday, 26 May 2018 at 11:56:30 UTC, Vijay Nayar wrote:
The error is:
```
onlineapp.d(8): Error: function literal `__lambda6(char a)` is
not callable using argument types `(int)`
onlineapp.d(8):cannot pass argument `val` of type `int`
to parameter `char a`
onlineapp.d(15): Error:
I've been experimenting with code that uses std.functional :
binaryFun and unaryFun, but I have found that using these methods
makes it impossible to add function attributes like @safe, @nogc,
pure, and nothrow, because no guarantee can be made about the
functions created via a stream. For
10 matches
Mail list logo