On 13.06.21 19:49, vit wrote:
Is possible create and use scope output range allocated on stack in
@safe code?
Example:
```d
//-dip1000
struct OutputRange{
private bool valid = true;
private void* ptr;
int count = 0;
void put(Val)(auto ref scope Val
On Sunday, 13 June 2021 at 17:49:50 UTC, vit wrote:
Is possible create and use scope output range allocated on
stack in @safe code?
Example:
```d
//-dip1000
struct OutputRange{
private bool valid = true;
private void* ptr;
int count = 0;
void
On Sunday, 13 June 2021 at 17:18:46 UTC, ag0aep6g wrote:
On Sunday, 13 June 2021 at 16:27:18 UTC, vit wrote:
Why I can take address of Foo variable but not Bar?
```d
//-dip1000
struct Foo{
private double d;
}
struct Bar{
private void* ptr;
}
void main()@safe{
///this is OK:
On Sunday, 13 June 2021 at 16:27:18 UTC, vit wrote:
Why I can take address of Foo variable but not Bar?
```d
//-dip1000
struct Foo{
private double d;
}
struct Bar{
private void* ptr;
}
void main()@safe{
///this is OK:
{
scope Foo x;
scope ptr =
}
Why I can take address of Foo variable but not Bar?
```d
//-dip1000
struct Foo{
private double d;
}
struct Bar{
private void* ptr;
}
void main()@safe{
///this is OK:
{
scope Foo x;
scope ptr =
}
///Error: cannot take address of `scope` local `x` in