Commit 5ef57d70 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook GitHub Bot

avoid ambiguity in to_ascii_size

Summary: The ambiguity is that the name appears as both `folly::to_ascii_size` and `folly::detail::to_ascii_size`, so that anything which imports both `folly` and `folly::detail` or which is within `folly::detail` may, depending on the particular compiler, find an unqualified call ambiguous.

Differential Revision: D27535255

fbshipit-source-id: 05db44e6b153d75b691d67c878785cab1655051d
parent 8f802235
...@@ -243,7 +243,7 @@ FOLLY_ALWAYS_INLINE size_t to_ascii_size_clzll(uint64_t v) { ...@@ -243,7 +243,7 @@ FOLLY_ALWAYS_INLINE size_t to_ascii_size_clzll(uint64_t v) {
} }
template <uint64_t Base> template <uint64_t Base>
FOLLY_ALWAYS_INLINE size_t to_ascii_size(uint64_t v) { FOLLY_ALWAYS_INLINE size_t to_ascii_size_route(uint64_t v) {
return kIsArchAmd64 && !(Base & (Base - 1)) // return kIsArchAmd64 && !(Base & (Base - 1)) //
? to_ascii_size_clzll<Base>(v) ? to_ascii_size_clzll<Base>(v)
: to_ascii_size_array<Base>(v); : to_ascii_size_array<Base>(v);
...@@ -269,7 +269,7 @@ FOLLY_ALWAYS_INLINE void to_ascii_with_basic( ...@@ -269,7 +269,7 @@ FOLLY_ALWAYS_INLINE void to_ascii_with_basic(
} }
template <uint64_t Base, typename Alphabet> template <uint64_t Base, typename Alphabet>
FOLLY_ALWAYS_INLINE size_t to_ascii_with_basic(char* out, uint64_t v) { FOLLY_ALWAYS_INLINE size_t to_ascii_with_basic(char* out, uint64_t v) {
auto const size = to_ascii_size<Base>(v); auto const size = to_ascii_size_route<Base>(v);
to_ascii_with_basic<Base, Alphabet>(out, size, v); to_ascii_with_basic<Base, Alphabet>(out, size, v);
return size; return size;
} }
...@@ -283,7 +283,7 @@ FOLLY_ALWAYS_INLINE void to_ascii_with_array( ...@@ -283,7 +283,7 @@ FOLLY_ALWAYS_INLINE void to_ascii_with_array(
} }
template <uint64_t Base, typename Alphabet> template <uint64_t Base, typename Alphabet>
FOLLY_ALWAYS_INLINE size_t to_ascii_with_array(char* out, uint64_t v) { FOLLY_ALWAYS_INLINE size_t to_ascii_with_array(char* out, uint64_t v) {
auto const size = to_ascii_size<Base>(v); auto const size = to_ascii_size_route<Base>(v);
to_ascii_with_array<Base, Alphabet>(out, size, v); to_ascii_with_array<Base, Alphabet>(out, size, v);
return size; return size;
} }
...@@ -319,7 +319,7 @@ FOLLY_ALWAYS_INLINE void to_ascii_with_table( ...@@ -319,7 +319,7 @@ FOLLY_ALWAYS_INLINE void to_ascii_with_table(
} }
template <uint64_t Base, typename Alphabet> template <uint64_t Base, typename Alphabet>
FOLLY_ALWAYS_INLINE size_t to_ascii_with_table(char* out, uint64_t v) { FOLLY_ALWAYS_INLINE size_t to_ascii_with_table(char* out, uint64_t v) {
auto const size = to_ascii_size<Base>(v); auto const size = to_ascii_size_route<Base>(v);
to_ascii_with_table<Base, Alphabet>(out, size, v); to_ascii_with_table<Base, Alphabet>(out, size, v);
return size; return size;
} }
...@@ -352,7 +352,7 @@ FOLLY_INLINE_VARIABLE constexpr size_t to_ascii_size_max_decimal = ...@@ -352,7 +352,7 @@ FOLLY_INLINE_VARIABLE constexpr size_t to_ascii_size_max_decimal =
// async-signal-safe // async-signal-safe
template <uint64_t Base> template <uint64_t Base>
size_t to_ascii_size(uint64_t v) { size_t to_ascii_size(uint64_t v) {
return detail::to_ascii_size<Base>(v); return detail::to_ascii_size_route<Base>(v);
} }
// to_ascii_size_decimal // to_ascii_size_decimal
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment