On 2/2/20 1:57 PM, ag0aep6g wrote:
On 02.02.20 19:49, ag0aep6g wrote:
On 02.02.20 19:18, Steven Schveighoffer wrote:
I'm not sure if I got it right, but like this?
int*[][] g1;
int*[] g2;
int* g3;
void main() @safe
{
/* An array stored on the stack, of referen
On 02.02.20 19:49, ag0aep6g wrote:
On 02.02.20 19:18, Steven Schveighoffer wrote:
I'm not sure if I got it right, but like this?
int*[][] g1;
int*[] g2;
int* g3;
void main() @safe
{
/* An array stored on the stack, of references to heap data: */
int*[3
On 2/2/20 1:32 PM, Dennis wrote:
On Sunday, 2 February 2020 at 18:18:28 UTC, Steven Schveighoffer wrote:
scope should have been a type constructor.
I feel the same way, I find const/immutable much easier to reason about
than scope in its current state.
Do you think scope as a storage class is
On 02.02.20 19:18, Steven Schveighoffer wrote:
On 2/2/20 10:20 AM, ag0aep6g wrote:
[...]
void main() @safe
{
int* a0;
scope int** b0 = &a0; /* accepted */
scope int* a2;
scope int** b2 = &a2; /* rejected */
}
Now it's important to realize tha
On Sunday, 2 February 2020 at 18:18:28 UTC, Steven Schveighoffer
wrote:
scope should have been a type constructor.
I feel the same way, I find const/immutable much easier to reason
about than scope in its current state.
Do you think scope as a storage class is fundamentally broken, or
is it s
Thanks for your response.
On Sunday, 2 February 2020 at 15:20:39 UTC, ag0aep6g wrote:
Now it's important to realize that `scope` only applies to the
top-level of the type.
This is where my confusion was.
I knew scope wasn't transitive, so I thought that `scope
string[1]` meant the static arra
On 2/2/20 10:20 AM, ag0aep6g wrote:
On 02.02.20 14:40, Dennis wrote:
Compiling the following with -dip1000 gives an error.
```
void main() @safe {
string[1] a0;
scope int[1] a1;
scope string[1] a2;
scope string[] b0 = a0[]; // Fine
scope int[] b1 = a1[]; // Fine
s
On 02.02.20 14:40, Dennis wrote:
Compiling the following with -dip1000 gives an error.
```
void main() @safe {
string[1] a0;
scope int[1] a1;
scope string[1] a2;
scope string[] b0 = a0[]; // Fine
scope int[] b1 = a1[]; // Fine
scope string[] b2 = a2[]; // Error: ca
Compiling the following with -dip1000 gives an error.
```
void main() @safe {
string[1] a0;
scope int[1] a1;
scope string[1] a2;
scope string[] b0 = a0[]; // Fine
scope int[] b1 = a1[]; // Fine
scope string[] b2 = a2[]; // Error: cannot take address of
scope local a2
}