]> gcc.gnu.org Git - gcc.git/blobdiff - libstdc++-v3/include/bits/chrono.h
libstdc++: Check static assertions earlier in chrono::duration
[gcc.git] / libstdc++-v3 / include / bits / chrono.h
index 421898516ae43b9cedac0f9b54014cf693fa3e1a..65e3e3183f7466bf4e1467ba3129b71e7261effa 100644 (file)
@@ -442,6 +442,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     template<typename _Rep, typename _Period>
       struct duration
       {
+       static_assert(!__is_duration<_Rep>::value, "rep cannot be a duration");
+       static_assert(__is_ratio<_Period>::value,
+                     "period must be a specialization of ratio");
+       static_assert(_Period::num > 0, "period must be positive");
+
       private:
        template<typename _Rep2>
          using __is_float = treat_as_floating_point<_Rep2>;
@@ -487,11 +492,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        using rep = _Rep;
        using period = typename _Period::type;
 
-       static_assert(!__is_duration<_Rep>::value, "rep cannot be a duration");
-       static_assert(__is_ratio<_Period>::value,
-                     "period must be a specialization of ratio");
-       static_assert(_Period::num > 0, "period must be positive");
-
        // 20.11.5.1 construction / copy / destroy
        constexpr duration() = default;
 
This page took 0.029466 seconds and 5 git commands to generate.