d复制时包装类/接口至构中

struct ClassRangeWrapper(T)
    if (is(T == class) || is(T == interface))
{
    T payload;
    alias payload this;

    this(ref inout typeof(this) other) inout
    {
        this.payload = other.payload.save;
    }
}
posted @ 2021-11-02 11:31  zjh6  阅读(12)  评论(0)    收藏  举报  来源