Skip to content

<deque>: Support incomplete value type #3961

@zhihaoy

Description

@zhihaoy

Describe the bug

Certain standard sequence containers, such as list and vector, allow the value type to be an incomplete type to support recursive data structures. Although it's not a part of the standard (yet), Microsoft STL's deque implementation should consider supporting this. libstdc++ and libc++ since ABI version 2 (contributed by Google) have this support.

See also: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4510.html

Godbolt test case

https://godbolt.org/z/7fEbPnTc3

#include <deque>

struct Entry
{
    std::deque<Entry> messages;
    // ...
};

Expected behavior

Compiles without error.

STL version

Any.

Additional context

It could be done in vNext, as a part of #147.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementSomething can be improvedwontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions