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

Liter literal #35574

Merged
merged 2 commits into from
Nov 18, 2019
Merged

Liter literal #35574

merged 2 commits into from
Nov 18, 2019

Conversation

jbytheway
Copy link
Contributor

@jbytheway jbytheway commented Nov 18, 2019

Summary

SUMMARY: None

Purpose of change

Some of our volume literals (like 10000000_ml) were hard to read.

Describe the solution

Introduce a new user-defined literal suffix _liter for thousands of ml. Use it in all the places it makes sense to.

Also, rearrange and expand the units-related unit tests. We don't need a separate test file for each type of unit.

Testing

Ran the unit tests.

We already had a _ml literal.  Add a _liter literal.  Replace all uses
of _ml which were a whole number of liters with the new literal.

This is the same number of characters, and easier to read (especially
for the really big values; we have a few places with hundreds or
thousands of liters being mentioned).
Remove the separate test files with time and energy tests.  Consolidate
them into one new file units_test.cpp, and add some tests for the other
units-related stuff.
@ZhilkinSerg ZhilkinSerg added [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style labels Nov 18, 2019
@ZhilkinSerg ZhilkinSerg merged commit dd3d5cc into CleverRaven:master Nov 18, 2019
@ZhilkinSerg ZhilkinSerg added the Code: Tests Measurement, self-control, statistics, balancing. label Nov 18, 2019
@jbytheway jbytheway deleted the liter_literal branch November 19, 2019 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style Code: Tests Measurement, self-control, statistics, balancing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants