]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/include/std/shared_mutex
libstdc++: Define and use chrono::is_clock for C++20
[thirdparty/gcc.git] / libstdc++-v3 / include / std / shared_mutex
index 9b597e762998e9df2190b3419a2c4faa6e8080a6..414dce3a1b7589511ed40275d484d498d1b4662f 100644 (file)
@@ -554,6 +554,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       bool
       try_lock_until(const chrono::time_point<_Clock, _Duration>& __atime)
       {
+#if __cplusplus > 201703L
+       static_assert(chrono::is_clock_v<_Clock>);
+#endif
        // The user-supplied clock may not tick at the same rate as
        // steady_clock, so we must loop in order to guarantee that
        // the timeout has expired before returning false.
@@ -639,6 +642,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       try_lock_shared_until(const chrono::time_point<_Clock,
                                                     _Duration>& __atime)
       {
+#if __cplusplus > 201703L
+       static_assert(chrono::is_clock_v<_Clock>);
+#endif
        // The user-supplied clock may not tick at the same rate as
        // steady_clock, so we must loop in order to guarantee that
        // the timeout has expired before returning false.