Skip to content

sus::dyn() without an explicit template parameter? #358

Open
@danakj

Description

@danakj

The dyn() function requires a template parameter of the type erasure class DynC of concept C currently.

Whereas into() does not, since it constructs a marker type and then uses type deduction to determine what to construct.

We should in theory be able to do the same with Dyn and have it defer choosing the reference type until the operator is called, but it may be tricky to maintain const correctness.

Here's a test demo envionment in which this could be explored: https://godbolt.org/z/Y5nGe4E16

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions