---
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.
          • Re: how ... mw via Digitalmars-d-learn
            • Re:... Steven Schveighoffer via Digitalmars-d-learn
            • Re:... Jonathan M Davis via Digitalmars-d-learn
            • Re:... Arafel via Digitalmars-d-learn
            • Re:... Steven Schveighoffer via Digitalmars-d-learn
            • Re:... Arafel via Digitalmars-d-learn
            • Re:... Steven Schveighoffer via Digitalmars-d-learn
            • Re:... Arafel via Digitalmars-d-learn
            • Re:... Kagamin via Digitalmars-d-learn
            • Re:... Arafel via Digitalmars-d-learn
            • Re:... Kagamin via Digitalmars-d-learn
            • Re:... Kagamin via Digitalmars-d-learn
            • Re:... Arafel via Digitalmars-d-learn
            • Re:... Dominikus Dittes Scherkl via Digitalmars-d-learn
            • Re:... Arafel via Digitalmars-d-learn
            • Re:... Kagamin via Digitalmars-d-learn
        • Re: how to a... Kagamin via Digitalmars-d-learn
          • Re: how ... Steven Schveighoffer via Digitalmars-d-learn
  • Re: how to assign to shar... Jonathan M Davis via Digitalmars-d-learn

Reply via email to