You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(1) Sometimes there are traits used, such as detail::bias_v<>, but other times the trait's functionality is replicated in-line. I find this more difficult to read, instead of using the trait. As an example, in the function detail::to_chars_impl(), we have this line:
This line could easily be replaced with the following, which means exactly the same thing, but is easier to visually parse.
constexpr auto max_fractional_value = TargetDecimalType{1, bias_v<TargetDecimalType>};
I don't want this to sound like a nit-pick, but cases like this have made it more difficult for me to understand and work through the code.
(2) On the topic of traits, I think there should be some more traits defined, to remove usage of things like std::is_same<...>::value. This is another thing that has made it more difficult for me to read the code. Something along the lines of detail::is_fast<...> to denote whether you have a _fast type or not. For example, you could replace the following
As well, detail::bit_width<...> would help remove lines like std::is_same<T, decimal128>::value || std::is_same<T, decimal128_fast>::value, and turn them into detail::bit_width<...>::value == 128. These are just suggestions and don't need to be taken verbatim. Anything to remove duplication and make the code easier to understand.
The text was updated successfully, but these errors were encountered:
(1) Sometimes there are traits used, such as
detail::bias_v<>
, but other times the trait's functionality is replicated in-line. I find this more difficult to read, instead of using the trait. As an example, in the functiondetail::to_chars_impl()
, we have this line:This line could easily be replaced with the following, which means exactly the same thing, but is easier to visually parse.
I don't want this to sound like a nit-pick, but cases like this have made it more difficult for me to understand and work through the code.
(2) On the topic of traits, I think there should be some more traits defined, to remove usage of things like
std::is_same<...>::value
. This is another thing that has made it more difficult for me to read the code. Something along the lines ofdetail::is_fast<...>
to denote whether you have a_fast
type or not. For example, you could replace the followingWith the following
As well,
detail::bit_width<...>
would help remove lines likestd::is_same<T, decimal128>::value || std::is_same<T, decimal128_fast>::value
, and turn them intodetail::bit_width<...>::value == 128
. These are just suggestions and don't need to be taken verbatim. Anything to remove duplication and make the code easier to understand.The text was updated successfully, but these errors were encountered: