Skip to content

Question regarding the design of the extension functions (subspan etc.) #65

@vvish

Description

@vvish

Hello,

I have a question regarding the design of the free functions:subspan, first and last:
As they do not explicitly accept span<T> are they intended to be used with any type that can be accepted by make_span function? If it is the case then the implementation seems to have an issue: as ADL is not finding them with non-span-specialization parameters the call to this functions should be qualified (currently they are not available in the nonstd namespace) and make_span in the trailing return type expression should be visible for non-ADL. Unfortunately the unit-tests cover only the cases where the span specialization is passed to the functions (works because of ADL), so it is not clear if the use-case was considered, although I personally find it to be useful (would be glad to contribute here).

If the functions are designed to be used with span-s only as wrappers for methods to avoid .template then maybe they could accept span<T> ?

Could you please clarify the use cases and rational behind the design?

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions