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

Use std::numeric_limits<> #9954

Closed
wants to merge 3 commits into from
Closed

Use std::numeric_limits<> #9954

wants to merge 3 commits into from

Conversation

siying
Copy link
Contributor

@siying siying commented May 5, 2022

Summary:
Right now we still don't fully use std::numeric_limits but use a macro, mainly for supporting VS 2013. Right now we only support VS 2017 and up so it is not a problem. The code comment claims that MinGW still needs it. We don't have a CI running MinGW so it's hard to validate. since we now require C++17, it's hard to imagine MinGW would still build RocksDB but doesn't support std::numeric_limits<>.

Test Plan: See CI Runs.

Summary:
This is partial change so far to watch CI run

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
@siying siying changed the title Test std::numeric_limits<> Use std::numeric_limits<> May 5, 2022
@siying siying requested review from ltamasi and pdillinger and removed request for pdillinger May 5, 2022 17:34
@facebook-github-bot
Copy link
Contributor

@siying has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Copy link
Contributor

@riversand963 riversand963 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as long as all tests pass

Copy link
Contributor

@pdillinger pdillinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tend to prefer UINT32_MAX etc. for readability and minimal headers. They seem to be standard https://en.cppreference.com/w/cpp/types/integer, though I can't find SIZE_MAX as standard C++.

@siying
Copy link
Contributor Author

siying commented May 5, 2022

I tend to prefer UINT32_MAX etc. for readability and minimal headers. They seem to be standard https://en.cppreference.com/w/cpp/types/integer, though I can't find SIZE_MAX as standard C++.

I'm not knowledgeable enough to think through the difference between the two, so I wouldn't make a switch in such a find & replace job. I think it's a good idea to separate the two into two PRs even if we decide to switch to macro. @ltamasi might have some comments on which one to use.

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

Successfully merging this pull request may close these issues.

4 participants