// Range v3 library // // Copyright Eric Niebler 2014 // // Use, modification and distribution is subject to the // Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // Project home: https://github.com/ericniebler/range-v3 //===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #include #include #include #include #include #include #include "../array.hpp" #include "../simple_test.hpp" #include "../test_iterators.hpp" #include "../test_utils.hpp" #ifdef RANGES_CXX_GREATER_THAN_11 RANGES_CXX14_CONSTEXPR auto fives() { array a{{0}}; ranges::fill(a, 5); return a; } RANGES_CXX14_CONSTEXPR auto fives(int n) { array a{{0}}; ranges::fill_n(ranges::begin(a), n, 5); return a; } #endif int main() { test_char>(); test_char>(); test_char>(); test_char(); test_char, sentinel>(); test_char, sentinel>(); test_char, sentinel>(); test_int>(); test_int>(); test_int>(); test_int(); test_int, sentinel>(); test_int, sentinel>(); test_int, sentinel>(); #ifdef RANGES_CXX_GREATER_THAN_11 { STATIC_CHECK(ranges::equal(fives(), {5, 5, 5, 5})); STATIC_CHECK(ranges::equal(fives(2), {5, 5, 0, 0})); STATIC_CHECK(!ranges::equal(fives(2), {5, 5, 5, 5})); } #endif return ::test_result(); }