www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18847] New: std.allocator: Region uses .parent before it can


          Issue ID: 18847
           Summary: std.allocator: Region uses .parent before it can be
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: dlang-bugzilla thecybershadow.net
                CC: andrei erdani.com

Here is one constructor of

    static if (!is(ParentAllocator == NullAllocator))
    this(size_t n)

If parent has state, then there is no way to set it before it is used in the

There is a workaround: copy the contents of the constructor of the invoking
code, then use the constructor taking a buffer, and only then initialize the
parent. This is sub-ideal.

The constructor(s) should probably accept a parent argument as needed, or the
object should support deferred initialization.

May 10 2018