Re: DMD won't compile re-init of variable

2020-02-03 Thread Simon via Digitalmars-d-learn
On Friday, 31 January 2020 at 14:01:04 UTC, Minty Fresh wrote: On Thursday, 30 January 2020 at 21:36:53 UTC, Adam D. Ruppe wrote: On Thursday, 30 January 2020 at 21:09:41 UTC, Simon wrote: How do I revert my variable to the init state? null is the initial state for those. More generally,

Re: DMD won't compile re-init of variable

2020-02-03 Thread Simon via Digitalmars-d-learn
On Thursday, 30 January 2020 at 21:18:04 UTC, MoonlightSentinel wrote: On Thursday, 30 January 2020 at 21:09:41 UTC, Simon wrote: Hi dlang community, I'm trying to implement a "reset" functionality which should revert all variables to the program start initial state. Example: import Graph;

Re: DMD won't compile re-init of variable

2020-01-31 Thread Minty Fresh via Digitalmars-d-learn
On Thursday, 30 January 2020 at 21:36:53 UTC, Adam D. Ruppe wrote: On Thursday, 30 January 2020 at 21:09:41 UTC, Simon wrote: How do I revert my variable to the init state? null is the initial state for those. More generally, .init can be used as to get the initial state for any type.

Re: DMD won't compile re-init of variable

2020-01-30 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 30 January 2020 at 21:09:41 UTC, Simon wrote: How do I revert my variable to the init state? null is the initial state for those.

Re: DMD won't compile re-init of variable

2020-01-30 Thread MoonlightSentinel via Digitalmars-d-learn
On Thursday, 30 January 2020 at 21:09:41 UTC, Simon wrote: Hi dlang community, I'm trying to implement a "reset" functionality which should revert all variables to the program start initial state. Example: import Graph; protected Edge[string] m_string2edge; int main() { // adding some

DMD won't compile re-init of variable

2020-01-30 Thread Simon via Digitalmars-d-learn
Hi dlang community, I'm trying to implement a "reset" functionality which should revert all variables to the program start initial state. Example: import Graph; protected Edge[string] m_string2edge; int main() { // adding some elements // not important how it works //