Commit 3f488e75 authored by Wez Furlong's avatar Wez Furlong Committed by Facebook Github Bot

folly: resolve ambiguous floor overload on macos

Summary:
This manifested once D13765262 landed, but is likely
more closely related to the changes in D4375603:

```
In file included from /Users/facebook/wez-fbsource/fbcode/watchman/external/folly/folly/io/async/TimeoutManager.cpp:21:
/Users/facebook/wez-fbsource/fbcode/watchman/external/folly/folly/Chrono.h:153:32: error: call to 'floor' is ambiguous
  return detail::round_impl(d, floor<To>(d));
                               ^~~~~~~~~
/Users/facebook/wez-fbsource/fbcode/watchman/external/folly/folly/io/async/TimeoutManager.cpp:77:44: note: in instantiation of function template specialization 'folly::chrono::round<std::__1::chrono::duration<long
      long, std::__1::ratio<1, 1000> >, long long, std::__1::ratio<1, 1000000>, void>' requested here
  timeout_type timeout_ms = folly::chrono::round<timeout_type>(timeout);
                                           ^
/usr/local/fbprojects/packages/xcode/104/xcode_10.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/chrono:444:1: note: candidate function [with _ToDuration =
      std::__1::chrono::duration<long long, std::__1::ratio<1, 1000> >, _Rep = long long, _Period = std::__1::ratio<1, 1000000>]
floor(const duration<_Rep, _Period>& __d)
^
/Users/facebook/wez-fbsource/fbcode/watchman/external/folly/folly/Chrono.h:127:14: note: candidate function [with To = std::__1::chrono::duration<long long, std::__1::ratio<1, 1000> >, Rep = long long, Period =
      std::__1::ratio<1, 1000000>, $3 = void]
constexpr To floor(std::chrono::duration<Rep, Period> const& d) {
             ^
```

this diff resolves the ambiguity in favor of `folly::chrono::floor`.

Reviewed By: bolinfest

Differential Revision: D14000897

fbshipit-source-id: 669dbf3573c3799cb21e14f247acc8d053afe746
parent b23981b8
......@@ -150,7 +150,7 @@ template <
detail::is_duration<To>::value &&
!std::chrono::treat_as_floating_point<typename To::rep>::value>::type>
constexpr To round(std::chrono::duration<Rep, Period> const& d) {
return detail::round_impl(d, floor<To>(d));
return detail::round_impl(d, folly::chrono::floor<To>(d));
}
// mimic: std::chrono::round, C++17
......
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