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.
protected Edge[string] m_string2edge;
// adding some elements
// not important how it works
// m_string2edge[name] = e;
// resetting it
m_string2edge = null;
m_string2edge = new Edge[string]; // <- won't compile
How do I revert my variable to the init state?
Thanks in advance,
You can use m_string2edge.clear() if you want to remove all
entries from m_string2edge.