I'm having trouble trying to return a const reference of a structure.

public struct Structure {
}

public class A {
    private Structure structure;

    this(Structure structure)
    {
        this.structure = structure;
    }

    public ref const Structure getStructure() const {
        return structure;
    }
}

cannot implicitly convert expression (this.structure) of type const(Structure) to Structure

Reply via email to