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>: Fix minor conformance issues #4120

Conversation

StephanTLavavej
Copy link
Member

  • Conformance: base_type in <random> is a non-Standard typedef.
    • Remove it outright for Standard discard_block_engine (via the new base class _Discard_block_base introduced by Implement LWG-3561 Issue with internal counter in discard_block_engine #4066), independent_bits_engine, and shuffle_order_engine.
    • For discard_block, which is usually the base class for Standard discard_block_engine, we can guard the typedef with TR1's availability, and deprecate it. We should then avoid using it ourselves.
  • Conformance: Add _Engine&& constructors to discard_block and _Discard_block_base.
    • discard_block_engine had an _Engine&& constructor but its base classes didn't, so it was always copying.

Remove it outright for Standard `discard_block_engine` (via the new base class `_Discard_block_base`), `independent_bits_engine`, and `shuffle_order_engine`.

For `discard_block`, which is usually the base class for Standard `discard_block_engine`, we can guard the typedef with TR1's availability, and deprecate it. We should then avoid using it ourselves.
…scard_block_base`.

`discard_block_engine` had an `_Engine&&` constructor but its base classes didn't, so it was always copying.
@StephanTLavavej StephanTLavavej added the bug Something isn't working label Oct 23, 2023
@StephanTLavavej StephanTLavavej requested a review from a team as a code owner October 23, 2023 16:07
stl/inc/random Show resolved Hide resolved
@StephanTLavavej StephanTLavavej self-assigned this Oct 24, 2023
@StephanTLavavej
Copy link
Member Author

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit fb8fc41 into microsoft:main Oct 25, 2023
37 checks passed
@StephanTLavavej StephanTLavavej deleted the dry-cleaning-4-random-conformance branch October 25, 2023 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants