[PATCH] D55517: Remove `_VSTD`

Louis Dionne via Phabricator reviews at reviews.llvm.org
Mon Dec 10 10:44:08 PST 2018


ldionne accepted this revision.
ldionne added a comment.
This revision is now accepted and ready to land.

In D55517#1325586 <https://reviews.llvm.org/D55517#1325586>, @jfb wrote:

> > Quick Question: What's the difference between writing `_VSTD::` and `std::`? Nothing.
>
> I thought it was `std:: _LIBCPP_ABI_NAMESPACE` ?


That's correct, however I don't think it's a big deal. Indeed, discussed it and we couldn't find a reason why we would ever want to call a function that is not in the current ABI's namespace. And even if we did, we could always use `std::<ABI namespace>::function`.

In D55517#1325604 <https://reviews.llvm.org/D55517#1325604>, @lebedev.ri wrote:

> Not hardcoding "::std" simplifies changing that namespace for whatever reasons.
>  I'm not sure if it is supported or not, but at least one person in
>  #llvm asked about that/did that.


It's already impossible to just rename namespace `std` because some places hardcode things like `namespace std { ... }` (specifically, places where we purposefully don't use the ABI versioning namespace use this pattern). I don't think it's a good idea to refrain from making this change "just in case". I'm not saying it will never be useful, but let's revisit this decision when/if we get an actual use case for changing the namespace name? And at that point we could address the situation fully by also handling places that explicitly say `namespace std { ... }`.

I personally like this change but I'd wait a bit to see whether other people oppose (and why) before submitting.


Repository:
  rCXX libc++

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55517/new/

https://reviews.llvm.org/D55517





More information about the libcxx-commits mailing list