diff --git a/benchmark/0001.refterm/Makefile b/benchmark/0001.refterm/Makefile index 3bd903656..3c4b35d8a 100644 --- a/benchmark/0001.refterm/Makefile +++ b/benchmark/0001.refterm/Makefile @@ -1,32 +1,9 @@ -CXX = clang++ -FASTIOINCLUDEPATH = -I../../include -CXXFLAGS = -Ofast -march=native -std=c++20 $(FASTIOINCLUDEPATH) -CXXEXTRAFLAGS = -flto -LDFLAGS = -fuse-ld=lld -s +CXX = clang++ FASTIOINCLUDEPATH = -I../../ include CXXFLAGS = -Ofast - march = native - std = c++ 20 $(FASTIOINCLUDEPATH) + CXXEXTRAFLAGS = -flto + LDFLAGS = -fuse - ld = lld - s -all: out_buf.exe fpipe.exe stdio.exe stdio_hack.exe iostream.exe fstream.exe filebuf_file.exe + all : out_buf.exe fpipe.exe stdio.exe stdio_hack.exe iostream.exe fstream.exe filebuf_file.exe -out_buf.exe:pch.hpp.gch out_buf.cc - $(CXX) -o out_buf.exe out_buf.cc $(CXXFLAGS) $(LDFLAGS) $(CXXEXTRAFLAGS) -include pch.hpp -fpipe.exe:pch.hpp.gch fpipe.cc - $(CXX) -o fpipe.exe fpipe.cc $(CXXFLAGS) $(LDFLAGS) $(CXXEXTRAFLAGS) -include pch.hpp -stdio.exe:pch.hpp.gch stdio.cc - $(CXX) -o stdio.exe stdio.cc $(CXXFLAGS) $(LDFLAGS) $(CXXEXTRAFLAGS) -include pch.hpp -stdio_hack.exe:pch.hpp.gch stdio_hack.cc - $(CXX) -o stdio_hack.exe stdio_hack.cc $(CXXFLAGS) $(LDFLAGS) $(CXXEXTRAFLAGS) -include pch.hpp -iostream.exe:iostreampch.hpp.gch iostream.cc - $(CXX) -o iostream.exe iostream.cc $(CXXFLAGS) $(LDFLAGS) $(CXXEXTRAFLAGS) -include iostreampch.hpp -fstream.exe:filebufpch.hpp.gch fstream.cc - $(CXX) -o fstream.exe fstream.cc $(CXXFLAGS) $(LDFLAGS) $(CXXEXTRAFLAGS) -include filebufpch.hpp -lntdll -filebuf_file.exe:filebufpch.hpp.gch filebuf_file.cc - $(CXX) -o filebuf_file.exe filebuf_file.cc $(CXXFLAGS) $(LDFLAGS) $(CXXEXTRAFLAGS) -include filebufpch.hpp -lntdll -filebufpch.hpp.gch:filebufpch.hpp pch.hpp.gch - $(CXX) -c filebufpch.hpp $(CXXFLAGS) $(FASTIOINCLUDEPATH) -include pch.hpp -iostreampch.hpp.gch:iostreampch.hpp pch.hpp.gch - $(CXX) -c iostreampch.hpp $(CXXFLAGS) $(FASTIOINCLUDEPATH) -include pch.hpp -pch.hpp.gch:pch.hpp - $(CXX) -c pch.hpp $(CXXFLAGS) $(FASTIOINCLUDEPATH) -clean: - rm *.gch *.tmp *.txt -distclean: - rm filebuf_file.exe fpipe.exe fstream.exe iostream.exe out_buf.exe stdio.exe stdio_hack.exe *.gch *.tmp *.txt + out_buf.exe : pch.hpp.gch out_buf.cc + $(CXX) - + o out_buf.exe out_buf.cc $(CXXFLAGS) $(LDFLAGS) $(CXXEXTRAFLAGS) - include pch.hpp fpipe.exe : pch.hpp.gch fpipe.cc $(CXX) - o fpipe.exe fpipe.cc $(CXXFLAGS) $(LDFLAGS) $(CXXEXTRAFLAGS) - include pch.hpp stdio.exe : pch.hpp.gch stdio.cc $(CXX) - o stdio.exe stdio.cc $(CXXFLAGS) $(LDFLAGS) $(CXXEXTRAFLAGS) - include pch.hpp stdio_hack.exe : pch.hpp.gch stdio_hack.cc $(CXX) - o stdio_hack.exe stdio_hack.cc $(CXXFLAGS) $(LDFLAGS) $(CXXEXTRAFLAGS) - include pch.hpp iostream.exe : iostreampch.hpp.gch iostream.cc $(CXX) - o iostream.exe iostream.cc $(CXXFLAGS) $(LDFLAGS) $(CXXEXTRAFLAGS) - include iostreampch.hpp fstream.exe : filebufpch.hpp.gch fstream.cc $(CXX) - o fstream.exe fstream.cc $(CXXFLAGS) $(LDFLAGS) $(CXXEXTRAFLAGS) - include filebufpch.hpp - lntdll filebuf_file.exe : filebufpch.hpp.gch filebuf_file.cc $(CXX) - o filebuf_file.exe filebuf_file.cc $(CXXFLAGS) $(LDFLAGS) $(CXXEXTRAFLAGS) - include filebufpch.hpp - lntdll filebufpch.hpp.gch : filebufpch.hpp pch.hpp.gch $(CXX) - c filebufpch.hpp $(CXXFLAGS) $(FASTIOINCLUDEPATH) - include pch.hpp iostreampch.hpp.gch : iostreampch.hpp pch.hpp.gch $(CXX) - c iostreampch.hpp $(CXXFLAGS) $(FASTIOINCLUDEPATH) - include pch.hpp pch.hpp.gch : pch.hpp $(CXX) - c pch.hpp $(CXXFLAGS) $(FASTIOINCLUDEPATH) clean : rm *.gch *.tmp *.txt distclean : rm filebuf_file.exe fpipe.exe fstream.exe iostream.exe out_buf.exe stdio.exe stdio_hack.exe *.gch *.tmp *.txt diff --git a/benchmark/0001.refterm/filebuf_file.cc b/benchmark/0001.refterm/filebuf_file.cc index 267cf2485..2516e27ed 100644 --- a/benchmark/0001.refterm/filebuf_file.cc +++ b/benchmark/0001.refterm/filebuf_file.cc @@ -17,6 +17,7 @@ inline void test() int main() { fast_io::u8obuf_file timer_obf(u"filebuf_file.txt"); - fast_io::timer t(u8"filebuf_file"); + auto t0{posix_clock_gettime(fast_io::posix_clock_id::monotonic)}; test(); + print(timer_obf, posix_clock_gettime(fast_io::posix_clock_id::monotonic) - t0, u8"s\n"); } diff --git a/benchmark/0001.refterm/fpipe.cc b/benchmark/0001.refterm/fpipe.cc index 77e6f028c..f08c36ec6 100644 --- a/benchmark/0001.refterm/fpipe.cc +++ b/benchmark/0001.refterm/fpipe.cc @@ -1,6 +1,5 @@ #include #include -#include #include using namespace fast_io::io; @@ -16,6 +15,7 @@ inline void test() int main() { fast_io::u8obuf_file timer_obf(u"fpipe.txt"); - fast_io::timer t(u8"fpipe"); + auto t0{posix_clock_gettime(fast_io::posix_clock_id::monotonic)}; test(); + print(timer_obf, posix_clock_gettime(fast_io::posix_clock_id::monotonic) - t0, u8"s\n"); } diff --git a/benchmark/0001.refterm/fstream.cc b/benchmark/0001.refterm/fstream.cc index f9bdfb30a..6fe75dd7b 100644 --- a/benchmark/0001.refterm/fstream.cc +++ b/benchmark/0001.refterm/fstream.cc @@ -19,6 +19,7 @@ inline void test() int main() { fast_io::u8obuf_file timer_obf(u"fstream.txt"); - fast_io::timer t(u8"fstream"); + auto t0{posix_clock_gettime(fast_io::posix_clock_id::monotonic)}; test(); + print(timer_obf, posix_clock_gettime(fast_io::posix_clock_id::monotonic) - t0, u8"s\n"); } diff --git a/benchmark/0001.refterm/iostream.cc b/benchmark/0001.refterm/iostream.cc index 72da9a68f..f78cb13ba 100644 --- a/benchmark/0001.refterm/iostream.cc +++ b/benchmark/0001.refterm/iostream.cc @@ -16,6 +16,7 @@ int main() { std::ios::sync_with_stdio(false); fast_io::u8obuf_file timer_obf(u"iostream.txt"); - fast_io::timer t(u8"iostream"); + auto t0{posix_clock_gettime(fast_io::posix_clock_id::monotonic)}; test(); + print(timer_obf, posix_clock_gettime(fast_io::posix_clock_id::monotonic) - t0, u8"s\n"); } diff --git a/benchmark/0001.refterm/out_buf.cc b/benchmark/0001.refterm/out_buf.cc index eca36e628..c4ee9b216 100644 --- a/benchmark/0001.refterm/out_buf.cc +++ b/benchmark/0001.refterm/out_buf.cc @@ -15,6 +15,7 @@ inline void test() int main() { fast_io::u8obuf_file timer_obf(u"out_buf.txt"); - fast_io::timer t(u8"out_buf"); + auto t0{posix_clock_gettime(fast_io::posix_clock_id::monotonic)}; test(); + print(timer_obf, posix_clock_gettime(fast_io::posix_clock_id::monotonic) - t0, u8"s\n"); } diff --git a/benchmark/0001.refterm/stdio.cc b/benchmark/0001.refterm/stdio.cc index 5fabed0af..7a6b72c37 100644 --- a/benchmark/0001.refterm/stdio.cc +++ b/benchmark/0001.refterm/stdio.cc @@ -1,6 +1,5 @@ #include #include -#include using namespace fast_io::io; inline void test() @@ -14,6 +13,7 @@ inline void test() int main() { fast_io::u8obuf_file timer_obf(u"stdio.txt"); - fast_io::timer t(u8"stdio"); + auto t0{posix_clock_gettime(fast_io::posix_clock_id::monotonic)}; test(); + print(timer_obf, posix_clock_gettime(fast_io::posix_clock_id::monotonic) - t0, u8"s\n"); } diff --git a/benchmark/0001.refterm/stdio_hack.cc b/benchmark/0001.refterm/stdio_hack.cc index ebbd3b94a..08c43964f 100644 --- a/benchmark/0001.refterm/stdio_hack.cc +++ b/benchmark/0001.refterm/stdio_hack.cc @@ -14,6 +14,7 @@ inline void test() int main() { fast_io::u8obuf_file timer_obf(u"stdio_hack.txt"); - fast_io::timer t(u8"stdio_hack"); + auto t0{posix_clock_gettime(fast_io::posix_clock_id::monotonic)}; test(); + print(timer_obf, posix_clock_gettime(fast_io::posix_clock_id::monotonic) - t0, u8"s\n"); } diff --git a/include/fast_io_core_impl/integers/sto/sto_contiguous.h b/include/fast_io_core_impl/integers/sto/sto_contiguous.h index 06ba9a5bd..f09f9cd4e 100644 --- a/include/fast_io_core_impl/integers/sto/sto_contiguous.h +++ b/include/fast_io_core_impl/integers/sto/sto_contiguous.h @@ -578,10 +578,8 @@ inline constexpr ::fast_io::freestanding::array generate_pow_table() noexc template inline constexpr ::fast_io::freestanding::array pow_table_n{::fast_io::details::generate_pow_table()}; + template -#if defined(__SSE4_1__) && __has_cpp_attribute(__gnu__::__cold__) && (defined(__x86_64__) || defined(_M_AMD64)) -[[__gnu__::__cold__]] -#endif inline constexpr parse_result scan_int_contiguous_none_simd_space_part_define_impl(char_type const *first, char_type const *last, T &res) noexcept { @@ -610,11 +608,6 @@ scan_int_contiguous_none_simd_space_part_define_impl(char_type const *first, cha constexpr bool isebcdic{::fast_io::details::is_ebcdic}; if constexpr (!isebcdic && (::std::numeric_limits<::std::uint_least64_t>::digits == 64u) && false) { - // Inspired by: - // https://github.com/fastfloat/fast_float - // Implementation of higher performance (Binary to Hexadecimal): - // Optimize both fixed range and infinite range (suitable for scan) - if constexpr (sizeof(::std::uint_least32_t) < sizeof(::std::size_t)) { if constexpr (base_char_type <= 10) @@ -699,7 +692,7 @@ scan_int_contiguous_none_simd_space_part_define_impl(char_type const *first, cha if (::std::uint_least32_t const cval{((val + first_bound) | (val - 0x30303030)) & 0x80808080}; cval) { - auto const ctrz_cval{::std::countr_zero(cval)}; + auto ctrz_cval{::std::countr_zero(cval)}; auto const valid_bits{ctrz_cval & -8}; if (!valid_bits) [[unlikely]] @@ -723,10 +716,10 @@ scan_int_contiguous_none_simd_space_part_define_impl(char_type const *first, cha val = (val * base_char_type) + (val >> 8); val = (((val & mask) * pow_base_sizeof_base_2) + ((val >> 16) & mask)); - constexpr auto pow_table{generate_pow_table()}; - res = static_cast(res * pow_table[ctrz_cval / (8 * sizeof(char_type))] + val); + ctrz_cval >= shifter; + res = static_cast(res * ::fast_io::details::pow_table_n.index_unchecked(ctrz_cval) + val); - first += ctrz_cval / (8 * sizeof(char_type)); + first += ctrz_cval; return scan_int_contiguous_none_simd_space_part_check_overflow_impl(first, last, res); @@ -764,7 +757,7 @@ scan_int_contiguous_none_simd_space_part_define_impl(char_type const *first, cha if (::std::uint_least64_t const cval{((val + first_bound) | (val - 0x0030003000300030)) & 0x8000800080008000}; cval) { - auto const ctrz_cval{::std::countr_zero(cval)}; + auto ctrz_cval{::std::countr_zero(cval)}; auto const valid_bits{ctrz_cval & -16}; if (!valid_bits) [[unlikely]] @@ -787,11 +780,11 @@ scan_int_contiguous_none_simd_space_part_define_impl(char_type const *first, cha val -= 0x0030003000300030; val = (val * base_char_type) + (val >> 16); val = (((val & mask) * pow_base_sizeof_base_2) + ((val >> 32) & mask)); - constexpr auto pow_table{generate_pow_table()}; - res = static_cast(res * pow_table[ctrz_cval / (8 * sizeof(char_type))] + val); + ctrz_cval >>= shifter; + res = static_cast(res * ::fast_io::details::pow_table_n.index_unchecked(ctrz_cval) + val); - first += ctrz_cval / (8 * sizeof(char_type)); + first += ctrz_cval; return scan_int_contiguous_none_simd_space_part_check_overflow_impl(first, last, res); } @@ -833,7 +826,7 @@ scan_int_contiguous_none_simd_space_part_define_impl(char_type const *first, cha 0x8080808080808080}; cval) { - auto const ctrz_cval{::std::countr_zero(cval)}; + auto ctrz_cval{::std::countr_zero(cval)}; auto const valid_bits{ctrz_cval & -8}; if (!valid_bits) [[unlikely]] @@ -861,11 +854,10 @@ scan_int_contiguous_none_simd_space_part_define_impl(char_type const *first, cha val = (val * base_char_type) + (val >> 8); val = (((val & mask) * mul1) + (((val >> 16) & mask) * mul2)) >> 32; - constexpr auto pow_table{generate_pow_table()}; - - res = static_cast(res * pow_table[ctrz_cval / (8 * sizeof(char_type))] + val); + ctrz_cval >>= shifter; - first += ctrz_cval / (8 * sizeof(char_type)); + res = static_cast(res * ::fast_io::details::pow_table_n.index_unchecked(ctrz_cval) + val); + first += ctrz_cval; return scan_int_contiguous_none_simd_space_part_check_overflow_impl(first, last, res); } @@ -886,80 +878,6 @@ scan_int_contiguous_none_simd_space_part_define_impl(char_type const *first, cha first += sizeof(::std::uint_least64_t); } } - -// It seems that it is unnecessary to read 4-bit data in base11-hexadecimal system, -// and the time for 4-bit data reading of this algorithm even exceeds 4 times of cyclic reading -#if 0 - if constexpr (max_size >= sizeof(::std::uint_least32_t)) - { - if (static_cast<::std::size_t>(first_phase_last - first) >= sizeof(::std::uint_least32_t)) - { - ::std::uint_least32_t val; - ::fast_io::freestanding::my_memcpy(__builtin_addressof(val), first, sizeof(::std::uint_least32_t)); - - val = ::fast_io::little_endian(val); - - constexpr ::std::uint_least32_t pow_base_sizeof_u32{::fast_io::details::compile_time_pow<::std::uint_least32_t>(static_cast<::std::uint_least32_t>(base_char_type), sizeof(::std::uint_least32_t))}; - constexpr ::std::uint_least32_t first_bound1{0x39393939 + 0x01010101 * (16 - base_char_type)}; - constexpr ::std::uint_least32_t first_bound2{0x19191919 + 0x01010101 * (16 - base_char_type)}; - - if (::std::uint_least32_t const cval{((((val + 0x46464646) | (val - 0x30303030)) & - ((val + first_bound1) | (val - 0x40404040)) & - ((val + first_bound2) | (val - 0x60606060))) | - ~(((val + 0x3f3f3f3f) | (val - 0x40404040)) & - ((val + 0x1f1f1f1f) | (val - 0x60606060)))) & - 0x80808080}; - cval) - { - auto const ctrz_cval{::std::countr_zero(cval)}; - auto const valid_bits{ctrz_cval & -8}; - - if (!valid_bits) [[unlikely]] - { - return scan_int_contiguous_none_simd_space_part_check_overflow_impl(first, last, res); - } - - val <<= 32 - valid_bits; - - ::std::uint_least32_t all_zero{0x30303030}; - - all_zero >>= valid_bits; - - val |= all_zero; - - constexpr ::std::uint_least32_t pow_base_sizeof_base_2{::fast_io::details::compile_time_pow<::std::uint_least32_t>(static_cast<::std::uint_least32_t>(base_char_type), 2)}; - - constexpr ::std::uint_least32_t mask{0x000000FF}; - - val -= 0x30303030; - val = (val & 0x0f0f0f0f) + ((val & 0x10101010) >> 4) * 9; - val = (val * base_char_type) + (val >> 8); - val = (((val & mask) * pow_base_sizeof_base_2) + ((val >> 16) & mask)); - - constexpr auto pow_table{generate_pow_table()}; - - res = static_cast(res * pow_table[ctrz_cval / (8 * sizeof(char_type))] + val); - - first += ctrz_cval / (8 * sizeof(char_type)); - - return scan_int_contiguous_none_simd_space_part_check_overflow_impl(first, last, res); - } - else - { - constexpr ::std::uint_least32_t pow_base_sizeof_base_2{::fast_io::details::compile_time_pow<::std::uint_least32_t>(static_cast<::std::uint_least32_t>(base_char_type), 2)}; - - constexpr ::std::uint_least32_t mask{0x000000FF}; - - val -= 0x30303030; - val = (val & 0x0f0f0f0f) + ((val & 0x10101010) >> 4) * 9; - val = (val * base_char_type) + (val >> 8); - val = (((val & mask) * pow_base_sizeof_base_2) + ((val >> 16) & mask)); - res = static_cast(res * pow_base_sizeof_u32 + val); - first += sizeof(::std::uint_least32_t); - } - } - } -#endif } } } @@ -1028,83 +946,6 @@ scan_int_contiguous_none_simd_space_part_define_impl(char_type const *first, cha } } } - else if constexpr (base_char_type <= 16) - { - if constexpr (sizeof(char_type) == sizeof(char8_t)) - { - // It seems that it is unnecessary to read 4-bit data in base11-hexadecimal system, - // and the time for 4-bit data reading of this algorithm even exceeds 4 times of cyclic reading -#if 0 - if constexpr (max_size >= sizeof(::std::uint_least32_t)) - { - while (static_cast<::std::size_t>(first_phase_last - first) >= sizeof(::std::uint_least32_t)) - { - ::std::uint_least32_t val; - ::fast_io::freestanding::my_memcpy(__builtin_addressof(val), first, sizeof(::std::uint_least32_t)); - - val = ::fast_io::little_endian(val); - - constexpr ::std::uint_least32_t pow_base_sizeof_u32{::fast_io::details::compile_time_pow<::std::uint_least32_t>(static_cast<::std::uint_least32_t>(base_char_type), sizeof(::std::uint_least32_t))}; - constexpr ::std::uint_least32_t first_bound1{0x39393939 + 0x01010101 * (16 - base_char_type)}; - constexpr ::std::uint_least32_t first_bound2{0x19191919 + 0x01010101 * (16 - base_char_type)}; - - if (::std::uint_least32_t const cval{((((val + 0x46464646) | (val - 0x30303030)) & - ((val + first_bound1) | (val - 0x40404040)) & - ((val + first_bound2) | (val - 0x60606060))) | - ~(((val + 0x3f3f3f3f) | (val - 0x40404040)) & - ((val + 0x1f1f1f1f) | (val - 0x60606060)))) & - 0x80808080}; - cval) - { - auto const ctrz_cval{::std::countr_zero(cval)}; - auto const valid_bits{ctrz_cval & -8}; - - if (!valid_bits) [[unlikely]] - { - return scan_int_contiguous_none_simd_space_part_check_overflow_impl(first, last, res); - } - - val <<= 32 - valid_bits; - - ::std::uint_least32_t all_zero{0x30303030}; - - all_zero >>= valid_bits; - - val |= all_zero; - - constexpr ::std::uint_least32_t pow_base_sizeof_base_2{::fast_io::details::compile_time_pow<::std::uint_least32_t>(static_cast<::std::uint_least32_t>(base_char_type), 2)}; - - constexpr ::std::uint_least32_t mask{0x000000FF}; - - val -= 0x30303030; - val = (val & 0x0f0f0f0f) + ((val & 0x10101010) >> 4) * 9; - val = (val * base_char_type) + (val >> 8); - val = (((val & mask) * pow_base_sizeof_base_2) + ((val >> 16) & mask)); - - constexpr auto pow_table{generate_pow_table()}; - res = static_cast(res * pow_table[ctrz_cval / (8 * sizeof(char_type))] + val); - - first += ctrz_cval / (8 * sizeof(char_type)); - - return scan_int_contiguous_none_simd_space_part_check_overflow_impl(first, last, res); - } - - constexpr ::std::uint_least32_t pow_base_sizeof_base_2{::fast_io::details::compile_time_pow<::std::uint_least32_t>(static_cast<::std::uint_least32_t>(base_char_type), 2)}; - - constexpr ::std::uint_least32_t mask{0x000000FF}; - val -= 0x30303030; - - val = (val & 0x0f0f0f0f) + ((val & 0x10101010) >> 4) * 9; - - val = (val * base_char_type) + (val >> 8); - val = (((val & mask) * pow_base_sizeof_base_2) + ((val >> 16) & mask)); - res = static_cast(res * pow_base_sizeof_u32 + val); - first += sizeof(::std::uint_least32_t); - } - } -#endif - } - } } } } diff --git a/include/fast_io_dsal/impl/array.h b/include/fast_io_dsal/impl/array.h index 305d1edc7..466b937ba 100644 --- a/include/fast_io_dsal/impl/array.h +++ b/include/fast_io_dsal/impl/array.h @@ -25,7 +25,7 @@ class array #elif __has_cpp_attribute(msvc::no_unique_address) [[msvc::no_unique_address]] #endif - value_type content[N]; + value_type element[N]; static inline constexpr bool is_empty() noexcept { @@ -55,52 +55,52 @@ class array } inline constexpr iterator begin() noexcept { - return content; + return element; } inline constexpr const_iterator begin() const noexcept { - return content; + return element; } inline constexpr const_iterator cbegin() const noexcept { - return content; + return element; } inline constexpr iterator end() noexcept { - return content + N; + return element + N; } inline constexpr const_iterator end() const noexcept { - return content + N; + return element + N; } inline constexpr const_iterator cend() const noexcept { - return content + N; + return element + N; } inline constexpr reverse_iterator rbegin() noexcept { - return reverse_iterator(content + N); + return reverse_iterator(element + N); } inline constexpr const_reverse_iterator rbegin() const noexcept { - return const_reverse_iterator(content + N); + return const_reverse_iterator(element + N); } inline constexpr const_reverse_iterator crbegin() const noexcept { - return const_reverse_iterator(content + N); + return const_reverse_iterator(element + N); } inline constexpr reverse_iterator rend() noexcept { - return reverse_iterator(content); + return reverse_iterator(element); } inline constexpr const_reverse_iterator rend() const noexcept { - return const_reverse_iterator(content); + return const_reverse_iterator(element); } inline constexpr const_reverse_iterator crend() const noexcept { - return const_reverse_iterator(content); + return const_reverse_iterator(element); } #if __has_cpp_attribute(__gnu__::__always_inline__) @@ -110,7 +110,7 @@ class array #endif inline constexpr const_pointer data() const noexcept { - return content; + return element; } #if __has_cpp_attribute(__gnu__::__always_inline__) @@ -120,17 +120,17 @@ class array #endif inline constexpr pointer data() noexcept { - return content; + return element; } inline constexpr void fill(const_reference u) noexcept { - ::std::fill_n(content, N, u); + ::std::fill_n(element, N, u); } inline constexpr void swap(array &other) noexcept(::std::is_nothrow_swappable_v) { - ::std::swap_ranges(content, content + N, other.content); + ::std::swap_ranges(element, element + N, other.element); } #if __has_cpp_attribute(__gnu__::__always_inline__) @@ -144,7 +144,7 @@ class array { ::fast_io::fast_terminate(); } - return content[idx]; + return element[idx]; } #if __has_cpp_attribute(__gnu__::__always_inline__) [[__gnu__::__always_inline__]] @@ -157,7 +157,7 @@ class array { ::fast_io::fast_terminate(); } - return content[idx]; + return element[idx]; } #if __has_cpp_attribute(__gnu__::__always_inline__) [[__gnu__::__always_inline__]] @@ -166,7 +166,7 @@ class array #endif inline constexpr reference index_unchecked(size_type idx) noexcept { - return content[idx]; + return element[idx]; } #if __has_cpp_attribute(__gnu__::__always_inline__) [[__gnu__::__always_inline__]] @@ -175,7 +175,7 @@ class array #endif inline constexpr const_reference index_unchecked(size_type idx) const noexcept { - return content[idx]; + return element[idx]; } #if __has_cpp_attribute(__gnu__::__always_inline__) @@ -186,7 +186,7 @@ class array inline constexpr reference back() noexcept { constexpr size_type nm1{N - 1}; - return content[nm1]; + return element[nm1]; } #if __has_cpp_attribute(__gnu__::__always_inline__) [[__gnu__::__always_inline__]] @@ -196,7 +196,7 @@ class array inline constexpr const_reference back() const noexcept { constexpr size_type nm1{N - 1}; - return content[nm1]; + return element[nm1]; } #if __has_cpp_attribute(__gnu__::__always_inline__) [[__gnu__::__always_inline__]] @@ -206,7 +206,7 @@ class array inline constexpr reference back_unchecked() noexcept { constexpr size_type nm1{N - 1}; - return content[nm1]; + return element[nm1]; } #if __has_cpp_attribute(__gnu__::__always_inline__) [[__gnu__::__always_inline__]] @@ -216,7 +216,7 @@ class array inline constexpr const_reference back_unchecked() const noexcept { constexpr size_type nm1{N - 1}; - return content[nm1]; + return element[nm1]; } #if __has_cpp_attribute(__gnu__::__always_inline__) @@ -226,7 +226,7 @@ class array #endif inline constexpr reference front() noexcept { - return *content; + return *element; } #if __has_cpp_attribute(__gnu__::__always_inline__) [[__gnu__::__always_inline__]] @@ -235,7 +235,7 @@ class array #endif inline constexpr const_reference front() const noexcept { - return *content; + return *element; } #if __has_cpp_attribute(__gnu__::__always_inline__) [[__gnu__::__always_inline__]] @@ -244,7 +244,7 @@ class array #endif inline constexpr reference front_unchecked() noexcept { - return *content; + return *element; } #if __has_cpp_attribute(__gnu__::__always_inline__) [[__gnu__::__always_inline__]] @@ -253,7 +253,7 @@ class array #endif inline constexpr const_reference front_unchecked() const noexcept { - return *content; + return *element; } };