Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't hardcode int64_t for duration type representations #648

Merged
merged 1 commit into from
Mar 12, 2019

Commits on Mar 5, 2019

  1. Don't hardcode int64_t for duration type representations

    In LLVM's `libcxx`, `int64_t` doesn't match chrono literals. See example below. To compile, run  `clang++-6.0 -stdlib=libc++ -std=c++14 TEST.cpp`
    
    ```
    using namespace std::chrono_literals;
    
    template<typename RatioT = std::milli>
    bool
    wait_for_service(
       std::chrono::duration<int64_t, RatioT> timeout
    )
    {
       return timeout == std::chrono::nanoseconds(0);
    }
    
    int main() {
       wait_for_service(2s);
       return 0;
    }
    
    ```
    
    Result of compilation
    ```
    TEST.cpp:6:1: note: candidate template ignored: could not match 'long' against 'long long'
    wait_for_service(
    ```
    
    Signed-off-by: Emerson Knapp <eknapp@amazon.com>
    Emerson Knapp committed Mar 5, 2019
    Configuration menu
    Copy the full SHA
    c871c47 View commit details
    Browse the repository at this point in the history