Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<random>: Remove TR1 machinery #183

Open
StephanTLavavej opened this issue Oct 18, 2019 · 1 comment
Open

<random>: Remove TR1 machinery #183

StephanTLavavej opened this issue Oct 18, 2019 · 1 comment
Labels
enhancement Something can be improved vNext Breaks binary compatibility

Comments

@StephanTLavavej
Copy link
Member

StephanTLavavej commented Oct 18, 2019

In vNext, it'll be time to remove the tr1 namespace, which we've deprecated for a long time. This mostly consists of using-declarations. However, <random> contains actual machinery, like the old uniform_int which powers the modern uniform_int_distribution. We need to remove the old stuff while overhauling this header.

vNext note: Resolving this issue will require breaking binary compatibility. We won't be able to accept pull requests for this issue until the vNext branch is available. See #169 for more information.

@StephanTLavavej
Copy link
Member Author

We originally labeled this as vNext because of the base class involvement, but we've gotten a lot more comfortable about messing with base classes as long as the layout is otherwise preserved. It ought to be possible to fuse the base classes into the derived classes so we can cut the base classes (but this would be a significant change, please ask the maintainers before attempting to tackle this).

We've really dragged our feet on removing tr1 because there was a fair amount of code out there mentioning tr1::shared_ptr etc. and breaking it was a lot of headache for little reward. However, it's been a long time and we've removed tr1 by default in C++17 mode (encouraging migration). I still don't know if outright removing tr1 would be feasible right now, but I believe there's a difference between TR1 machinery that simply aliases Standard machinery (e.g. tr1::shared_ptr, tr1::function) and the non-Standard TR1 machinery in random (tr1::uniform_int is not the same as std::uniform_int_distribution). Specifically, the usage of the non-Standard TR1 random machinery should be near-zero, and the interface differences create a compelling case for pushing migration harder.

I think it might be possible to actually remove the TR1-only stuff in v19 (but again, check with the maintainers since our capacity for "nice to have" overhauls is limited and varying over time).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Something can be improved vNext Breaks binary compatibility
Projects
None yet
Development

No branches or pull requests

1 participant