Skip to content

support references as bounded types? #5

@HDembinski

Description

@HDembinski

variant2 cannot have references as bounded types, https://godbolt.org/z/mnP-CU, which is conforming with std::variant, but this could be another improvement over std::variant if it is not too much work to implement. boost::variant is supporting them and I am using this in boost.histogram in this function
https://github.com/HDembinski/histogram/blob/5ae08d40c26f8db0613545b84a4c0b60c3729102/include/boost/histogram/detail/axes.hpp#L47
which allows me to get a reference to an element of a std::tuple with a run-time index.

Related SO question:
https://stackoverflow.com/questions/54218595/why-are-references-forbidden-in-stdvariant

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions