Skip to main content
added 408 characters in body
Source Link

After trying your sample I have only 2 notes -

Use namespace for your library.

And provide microseconds_d, milliseconds_d, etc as part of the library as well (under the same namespace to avoid possible conflicts) so user can easily use ready-made types to switch from one units to another without thinking and plying with typedefs in "PROGRAM" code.

For extending - I feel like have possibility to configure printer to add units literal would be nice and also switch between number output 12345678.50ms and time output 00:01:23.234

EDIT

To make clean compilation

  • need to fix warning shown by gcc when compiled with -Werror=shadow
  • need to include <memory> to avoid error C2039: 'unique_ptr': is not a member of 'std' in VS2017

I strongly feel that any code to be distributed as library should be compiled at highest warning level since it is impossible to perdict the compilation settings of the customer's project

After trying your sample I have only 2 notes -

Use namespace for your library.

And provide microseconds_d, milliseconds_d, etc as part of the library as well (under the same namespace to avoid possible conflicts) so user can easily use ready-made types to switch from one units to another without thinking and plying with typedefs in "PROGRAM" code.

For extending - I feel like have possibility to configure printer to add units literal would be nice and also switch between number output 12345678.50ms and time output 00:01:23.234

After trying your sample I have only 2 notes -

Use namespace for your library.

And provide microseconds_d, milliseconds_d, etc as part of the library as well (under the same namespace to avoid possible conflicts) so user can easily use ready-made types to switch from one units to another without thinking and plying with typedefs in "PROGRAM" code.

For extending - I feel like have possibility to configure printer to add units literal would be nice and also switch between number output 12345678.50ms and time output 00:01:23.234

EDIT

To make clean compilation

  • need to fix warning shown by gcc when compiled with -Werror=shadow
  • need to include <memory> to avoid error C2039: 'unique_ptr': is not a member of 'std' in VS2017

I strongly feel that any code to be distributed as library should be compiled at highest warning level since it is impossible to perdict the compilation settings of the customer's project

Source Link

After trying your sample I have only 2 notes -

Use namespace for your library.

And provide microseconds_d, milliseconds_d, etc as part of the library as well (under the same namespace to avoid possible conflicts) so user can easily use ready-made types to switch from one units to another without thinking and plying with typedefs in "PROGRAM" code.

For extending - I feel like have possibility to configure printer to add units literal would be nice and also switch between number output 12345678.50ms and time output 00:01:23.234