Skip to content

[SUGGESTION] Namespace definition to use += instead of = #438

Description

@JohelEGP

So after some thought of brainstorming options, include ones that include is, the one I like the best is to use exactly the declaration syntax, but with == to connote equality with an existing entity, instead of = which connotes setting the new entity's value.

A wild thought.

Maybe a namespace declaration should use += instead of =.
So ns: namespace = { would become ns: namespace += {.

+= denotes in-place addition, not definition.
But notice how : remains despite +=.
So it both (re)defines the namespace's identifier, which is valid, and adds to it.
Then all remaining uses of : /*signature*/ = would denote definition of the non re-definable kind, which is a bigger plus.

How does that fit with the current Cpp2?
What about with your idea to replace namespace with a metafunction, @hsutter?

Originally posted by @JohelEGP in #273 (comment)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions