[Issue 21033] enhancement: allow assign to field when the shared owing object has been locked already without cast

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Dec 28 10:24:37 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=21033

--- Comment #5 from anonymous4 <dfj1esp02 at sneakemail.com> ---
You can store Duration:
class A {
        Duration unixTime;
        synchronized void setTime(ref SysTime t) {
                unixTime = t-epoch;
        }
        synchronized SysTime getTime() {
                return epoch+unixTime;
        }
}

--


More information about the Digitalmars-d-bugs mailing list