how to assign to shared obj.systime?

Kagamin spam at here.lot
Tue Jul 14 06:13:01 UTC 2020


---
import std;

shared class TimeCount {
	void startClock() {
		auto me = cast()this;
		me.startTime = Clock.currTime;
	}
	void endClock() {
		auto me = cast()this;
		me.endTime = Clock.currTime;
	}
	void calculateDuration() {
		auto me = cast()this;
		me.elapsed = me.endTime - me.startTime;
	}

	private:
	SysTime startTime;
	SysTime endTime;
	Duration elapsed;
}
---
And this is shorter than your unshared member specification.


More information about the Digitalmars-d-learn mailing list