You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
In vs2013 __cplusplus value is 199711. c++11 version of wait_dequeue_timed's implemention is:
#if __cplusplus > 199711L // Attempts to dequeue an element; if the queue is empty, // waits until an element is available up to the specified timeout, // then dequeues it and returns true, or returns false if the timeout // expires before an element can be dequeued. // Using a negative timeout indicates an indefinite timeout, // and is thus functionally equivalent to calling wait_dequeue. template<typename U, typename Rep, typename Period> inline bool wait_dequeue_timed(U& result, std::chrono::duration<Rep, Period> const& timeout) { return wait_dequeue_timed(result, std::chrono::duration_cast<std::chrono::microseconds>(timeout).count()); } #endif
So vs2013 program unable to use wait_dequeue_timed above, but vs2013 did support chrono. Maybe another macro can be used to check compiler's c++11 support?
by the way , bool wait_dequeue_timed(U& result, std::int64_t timeout_usecs) timeout's time unit is microsecond, right?
The text was updated successfully, but these errors were encountered:
Hmm, yeah, I'll patch the #if to include VS2013+ too.
Yes, the timeout is in microseconds (abbreviated μs, or commonly us in ASCII like I've done in my code).
Hi,
In vs2013 __cplusplus value is 199711. c++11 version of wait_dequeue_timed's implemention is:
#if __cplusplus > 199711L // Attempts to dequeue an element; if the queue is empty, // waits until an element is available up to the specified timeout, // then dequeues it and returns true, or returns false if the timeout // expires before an element can be dequeued. // Using a negative timeout indicates an indefinite timeout, // and is thus functionally equivalent to calling wait_dequeue. template<typename U, typename Rep, typename Period> inline bool wait_dequeue_timed(U& result, std::chrono::duration<Rep, Period> const& timeout) { return wait_dequeue_timed(result, std::chrono::duration_cast<std::chrono::microseconds>(timeout).count()); } #endif
So vs2013 program unable to use wait_dequeue_timed above, but vs2013 did support chrono. Maybe another macro can be used to check compiler's c++11 support?
by the way , bool wait_dequeue_timed(U& result, std::int64_t timeout_usecs) timeout's time unit is microsecond, right?
The text was updated successfully, but these errors were encountered: