Constructors

Synopses

Declared in <bdlc_queue.h>

Create an in‐place queue. By default, the queue is empty. Optionally specify the initialLength of the queue. Queue elements are initialized with the specified initialValue, or to 0.0 if initialValue is not specified. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. The behavior is undefined unless 0 <= initialLength.

explicit
Queue(bslma::Allocator* basicAllocator = 0);

Same as the preceding overload, creating a queue of the specified initialLength with elements value‐initialized.

explicit
Queue(
    unsigned int initialLength,
    bslma::Allocator* basicAllocator = 0);

Create an in‐place queue with sufficient initial capacity to accommodate up to the specified numElements values without subsequent reallocation. A valid reference returned by the operator[] method is guaranteed to remain valid unless the value returned by the length method exceeds numElements (which would potentially cause a reallocation). Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. The behavior is undefined unless 0 <= numElements.

explicit
Queue(
    InitialCapacity const& numElements,
    bslma::Allocator* basicAllocator = 0);

Create an in‐place queue initialized to the value of the specified original queue. Optionally specify the basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used.

Queue(
    Queue const& original,
    bslma::Allocator* basicAllocator = 0);

Same as the preceding overload, initializing each element to the specified initialValue.

Queue(
    int initialLength,
    T const& initialValue,
    bslma::Allocator* basicAllocator = 0);

Create an in‐place queue initialized with the specified numElements leading values from the specified srcArray. Optionally specify the basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. The behavior is undefined unless 0 <= numElements. Note that srcArray must refer to sufficient memory to hold numElements values.

Queue(
    T const* srcArray,
    int numElements,
    bslma::Allocator* basicAllocator = 0);

Created with MrDocs