Skip to content

move span to boost::core:: #196

Open

Description

@vinniefalco

I think span should be declared and defined in boost::core:: so that one may write core::span when inside the boost namespace. We should still lift it into the enclosing boost:: namespace, so this is in addition to not in lieu of. This should not break anything.

Activity

  1. glenfe commented on May 26, 2025

    @glenfe
    Member

    I can understand doing this for new components in Core, but why would we want to do this for existing components?

  2. Lastique commented on May 26, 2025

    @Lastique
    Member

    One big reason to place components into more compartmentalized namespaces is avoiding unintended conflicts caused by ADL. When a type is likely to be passed as function or template parameters, or used as a base class, you don't want it to pull lots of unrelated stuff from wide namespaces, such as boost.

  3. vinniefalco commented on May 26, 2025

    @vinniefalco
    MemberAuthor

    why would we want to do this for existing components?

    I want to reiterate that this proposal does not break anything. The reason we want to do this for existing components is for teaching/documentation. It is better to see core::span in header files and documentation rather than span or boost::span as this makes the origin of the symbol clear and unambiguous.

    Existing code deeply nested in the boost namespace can still utter span if it wants to, with the ambiguities it brings. Or authors can opt-in to less ambiguity by writing core::span (my preference) or the more wordy boost::core::span.

    Lately I have been writing system::error_code and core::string_view instead of using aliases to those types in my own namespace for clarity, as when you have N libraries each providing aliases for error codes, string views, and other things, the result is unergonomic.

  4. glenfe commented on May 26, 2025

    @glenfe
    Member

    That sounds fine; I have no objection to it.

  5. self-assigned this
    on May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions