nholthaus / units

a compile-time, header-only, dimensional analysis and unit conversion library built on c++14 with no dependencies.
http://nholthaus.github.io/units/
MIT License
952 stars 135 forks source link

DRY in return types #180

Closed JohelEGP closed 5 years ago

JohelEGP commented 6 years ago

This prevent the use of the return type in the function signature and return statement from desynchronizing. With the upcoming changes, such desynchronization would cause a temporary to be used to construct the actual return type.

The return types of the return statements were more readable than those of the function signature, as we used type aliases local to the functions. I didn't want to change the function signatures as that might be visible in the doxygen-generated documentation.