vpiotr / decimal_for_cpp

Decimal data type for C++
273 stars 68 forks source link

fixes bugs in operator<=> implementation #45

Closed salvoilmiosi closed 3 years ago

salvoilmiosi commented 3 years ago

You still need to define operator== if you define operator<=> decimal_cast requires a template parameter, so you either use decimal_cast< Prec > or static_cast< decimal >, which are the same thing. Also defining operator != is redundant because in c++20 it's implicitly defined as !(a == b), but i kept it for compatibility with older compilers anyway.

vpiotr commented 3 years ago

Thanks!