Skip to content

Best practices are unknown for avoiding recursive instantiation in mutually recursive user-defined types #43

@saki7

Description

@saki7

Although rvariant's unit tests correctly handle basic "truly recursive" types, I have found that properly constraining user-defined types is very challenging in practice.

For instance, inadvertently applying std::is_constructible to a user-defined class's generic constructor can effectively introduce type-level left recursion, resulting in the well-known error: "satisfaction of constraint depends on itself".

We should document strategies to avoid such pitfalls, and perhaps provide a tutorial on constructing legitimate recursive types.

We definitely need minimal reproducible example for this. I have just encountered such error in medium-sized codebase, and I'm having a hard time reducing the code.

related: #39 and #45

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationhelp wantedExtra attention is neededtruly-recursiveIssues related to truly recursive types

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions