refactor: hello_units fixed to provide literals and references preprocessor defines explicitly

This commit is contained in:
Mateusz Pusz
2021-04-06 16:36:52 +02:00
parent 512406e900
commit 1f80c57fad
4 changed files with 13 additions and 4 deletions

View File

@ -28,6 +28,8 @@ analysis and unit/quantity manipulation. The basic idea and design heavily bases
Here is a small example of possible operations:
```cpp
#define UNITS_REFERENCES
#include <units/isq/si/area.h>
#include <units/isq/si/frequency.h>
#include <units/isq/si/length.h>
@ -64,6 +66,9 @@ and dimensional analysis can be performed without sacrificing on accuracy. Pleas
the below example for a quick preview of basic library features:
```cpp
#define UNITS_REFERENCES
#define UNITS_LITERALS
#include <units/format.h>
#include <units/isq/si/length.h>
#include <units/isq/si/speed.h>

View File

@ -3,6 +3,8 @@ Quick Start
Here is a small example of possible operations::
#define UNITS_REFERENCES
#include <units/isq/si/area.h>
#include <units/isq/si/frequency.h>
#include <units/isq/si/length.h>
@ -40,6 +42,9 @@ but still easy to use interface where all unit conversions and dimensional analy
performed without sacrificing on accuracy. Please see the below example for a quick preview
of basic library features::
#define UNITS_REFERENCES
#define UNITS_LITERALS
#include <units/format.h>
#include <units/isq/si/length.h>
#include <units/isq/si/speed.h>

View File

@ -28,7 +28,3 @@ add_subdirectory(references)
add_executable(hello_units hello_units.cpp)
target_link_libraries(hello_units PRIVATE mp-units::core-fmt mp-units::core-io mp-units::si mp-units::si-international)
target_compile_definitions(hello_units PRIVATE
UNITS_REFERENCES
UNITS_LITERALS
)

View File

@ -20,6 +20,9 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#define UNITS_REFERENCES
#define UNITS_LITERALS
#include <units/format.h>
#include <units/isq/si/international/length.h>
#include <units/isq/si/international/speed.h> // IWYU pragma: keep