Skip to content

constexpr StringView without literals #123

@jdumas

Description

@jdumas

Hi. I noticed that a constexpr Containers::StringView can only be created from const char * via a literal _s. Reading the doc this seems to be a deliberate design decision, but I'm not entirely sure why? E.g., the tag Global is documented as:

The referenced string is global, i.e., with an unlimited lifetime. Enabling this flag can avoid needless allocations and copies in cases where the consumer needs to extend lifetime of passed string view.

But why would you want to extend the lifetime of a passed string view? This is a view, not a smart pointer no?

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    TODO

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions