vpiotr / decimal_for_cpp

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

Support DEC_TRIVIAL_DEFAULT_CONSTRUCTIBLE #63

Closed jj683 closed 5 months ago

jj683 commented 5 months ago

Fixes https://github.com/vpiotr/decimal_for_cpp/issues/38

In general, trivially default constructible types are much better optimized by the compiler, such as in this example: https://godbolt.org/z/91WqG3ha5

I would like to allow the developer to manually select the desired behavior. At the same time, by default, keep the current one: initialization with zero.

vpiotr commented 5 months ago

Thanks! Looks OK, merged.