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

fix: add default parameters to random distributions (requires C++20) #17

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wdconinc
Copy link
Contributor

Briefly, what does this PR introduce?

This adds constraints for integral and floating point types to make sure that default parameter values are well-defined. Instead of gaussian(0.,1.), we can now also use gaussian() with the same effect. This reduces the need to specify constants where they can be easily swapped, e.g. mu and sigma.

What kind of change does this PR introduce?

  • Bug fix (issue #__)
  • New feature (issue #__)
  • Documentation update
  • Other: __

Please check if this PR fulfills the following:

  • Tests for the changes have been added
  • Documentation has been added / updated
  • Changes have been communicated to collaborators

Does this PR introduce breaking changes? What changes might users need to make to their code?

No.

Does this PR change default behavior?

No.

This adds constraints for integral and floating point types to make sure that
default parameter values are well-defined. Instead of `gaussian(0.,1.)`, we
can now also use `gaussian()` with the same effect. This reduces the need to
specify constants where they can be easily swapped, e.g. mu and sigma.
@wdconinc wdconinc requested a review from sly2j December 31, 2023 23:29
@wdconinc
Copy link
Contributor Author

I guess we could add enable_if logic for C++17 support, or just require C++20 at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant