diff --git a/examples/range_pipe.cc b/examples/range_pipe.cc index ad0f82f..4394055 100644 --- a/examples/range_pipe.cc +++ b/examples/range_pipe.cc @@ -73,7 +73,7 @@ int main() { /* more complex pipe */ writeln("several piped algorithms"); - srand(static_cast(time(0))); + srand(static_cast(std::time(nullptr))); std::array arr; generate(iter(arr), []() { return rand() % 128; }); diff --git a/ostd/range.hh b/ostd/range.hh index e9a4ea4..c7070c6 100644 --- a/ostd/range.hh +++ b/ostd/range.hh @@ -177,17 +177,16 @@ struct contiguous_range_tag: finite_random_access_range_tag {}; namespace detail { template - struct range_category_test { - template - static char test(typename RR::range_category *); - template - static int test(...); - static constexpr bool value = (sizeof(test(0)) == sizeof(char)); - }; + inline auto range_category_test(int) -> std::integral_constant< + bool, !std::is_void_v + >; + + template + inline std::false_type range_category_test(...); template static inline constexpr bool const test_range_category = - range_category_test::value; + decltype(range_category_test(0))::value; template struct range_traits_base {