On Monday, September 20, 2010 04:08:11 Kagamin wrote:
> Jonathan M Davis Wrote:
> > I don't think that there's anything Phobos can do
> > about it. It's a limitation of delegates.
>
> If the range doesn't support copying, it shouldn't pretend to support it,
> and algorithms relying on copy won't c
Jonathan M Davis Wrote:
> I don't think that there's anything Phobos can do
> about it. It's a limitation of delegates.
If the range doesn't support copying, it shouldn't pretend to support it, and
algorithms relying on copy won't compile.
On Monday 20 September 2010 01:08:25 Kagamin wrote:
> Jonathan M Davis Wrote:
> > delegate by definition has context which is not going to be copied. So,
> > any functon pointer or delegate that you have must refer to a function
> > which is logically pure, otherwise any algorithm that relies on sa
Jonathan M Davis Wrote:
> delegate by definition has context which is not going to be copied. So, any
> functon pointer or delegate that you have must refer to a function which is
> logically pure, otherwise any algorithm that relies on save is not going to
> work
> correctly.
If phobos cause
On Sunday 19 September 2010 17:13:14 Stewart Gordon wrote:
> On 19/09/2010 04:35, Jonathan M Davis wrote:
>
>
> > That doesn't work because you're just copying the pointer. Is there a way
> > to actually do a deep copy of the delegate? I can see why this would be
> > problematic if the delegate h
On 19/09/2010 04:35, Jonathan M Davis wrote:
That doesn't work because you're just copying the pointer. Is there a way to
actually do a deep copy of the delegate? I can see why this would be problematic
if the delegate had reference types in its scope (since presumably, they'd have
to be shallow
Is it in any way possible to copy a delegate? Take this program for example:
import std.stdio;
void main()
{
int a = 0;
int func()
{
return a++;
}
int delegate() b = &func;
int delegate() c = b;
writeln(b());
writeln(c());
writeln(b());
}
It will p