Skip to content

Commit 9c59b1a

Browse files
committed
Minor compile time improvements for log
1 parent 651fcb5 commit 9c59b1a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

source/bounded/log.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import std_module;
2222

2323
namespace bounded {
2424

25-
constexpr auto log_impl(auto value, auto const base) {
25+
constexpr auto log_impl(auto value, auto const base) -> int {
2626
auto sum = 0;
2727
while (value >= base) {
2828
value /= base;
@@ -31,8 +31,8 @@ constexpr auto log_impl(auto value, auto const base) {
3131
return sum;
3232
}
3333

34-
constexpr auto as_unsigned = [](auto const value) {
35-
return static_cast<numeric_traits::promoted_unsigned<decltype(value)>>(value);
34+
constexpr auto as_unsigned(auto const value) {
35+
return static_cast<numeric_traits::make_unsigned<decltype(value)>>(value);
3636
};
3737

3838
// TODO: It's useful for 0 to return 0, but that's not `log`.

0 commit comments

Comments
 (0)