On Tuesday, 2 April 2019 at 18:52:07 UTC, Jacob Carlborg wrote:
On 2019-04-02 20:44, Q. Schroll wrote:
After removing the calls to writeln, the error I get is:
`this` for `read` needs to be type `Outer` not type `Inner`
You cannot access stuff in Outer because Inner objects are not
outer o
On 2019-04-02 20:44, Q. Schroll wrote:
After removing the calls to writeln, the error I get is:
`this` for `read` needs to be type `Outer` not type `Inner`
You cannot access stuff in Outer because Inner objects are not outer
objects and don't implicitly own an Outer object. In your Inner me
On Tuesday, 2 April 2019 at 18:20:09 UTC, Andrey wrote:
Hello,
In this example how can I access the members "read" and "q" of
struct Outer from Inner struct?
struct Outer
{
ulong q = 1;
Inner inner;
void read(ulong value)
{
q += value;
}
void run()
{
Hello,
In this example how can I access the members "read" and "q" of
struct Outer from Inner struct?
struct Outer
{
ulong q = 1;
Inner inner;
void read(ulong value)
{
q += value;
}
void run()
{
q.writeln;
read(5);
}
struct Inner