Created
March 14, 2015 00:47
-
-
Save wjwwood/47759d665a02b9f9ebf2 to your computer and use it in GitHub Desktop.
Example which fails to compile on Windows.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <chrono> | |
| #include <condition_variable> | |
| #include <mutex> | |
| const std::chrono::seconds operator "" _s(unsigned long long s) | |
| { | |
| return std::chrono::seconds(s); | |
| } | |
| const std::chrono::duration<long double> operator "" _s(long double s) | |
| { | |
| return std::chrono::duration<long double>(s); | |
| } | |
| int main() | |
| { | |
| std::condition_variable cond; | |
| std::mutex mutex; | |
| std::unique_lock<std::mutex> lock(mutex); | |
| cond.wait_for(lock, 0.5_s); | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment