On Monday, 31 August 2020 at 05:46:45 UTC, ag0aep6g wrote:
`ref` kind of implies `scope` [1]. You don't need to type it
out. When you do type out `scope ref const(Price)`, the `scope`
actually doesn't apply to the `ref` but to the pointers in
`Price` (whereas the `scope` in `scope
On 31.08.20 06:24, outlandkarasu wrote:
I thought that I cannot make non-scope `ref` parameters from `scope`
array references.
But I found It allowed currently.
[...]
enum Currency : string {
USD = "USD", EUR = "EUR", GBP = "GBP", JPY = "JPY",
}
struct Instrument {
Currency bid;
On Sunday, 30 August 2020 at 16:33:58 UTC, ag0aep6g wrote:
On 30.08.20 17:24, outlandkarasu wrote:
enum Tag { tag = "tag" }
struct A { Tag tag; }
A createA() @safe
{
scope a = A(Tag.tag);
// Error: scope variable a may not be returned
return a;
// NG
//
On 30.08.20 17:24, outlandkarasu wrote:
enum Tag { tag = "tag" }
struct A { Tag tag; }
A createA() @safe
{
scope a = A(Tag.tag);
// Error: scope variable a may not be returned
return a;
// NG
// return A(a);
// return A(a.tag);
}
[...]
I