util/Macros: replace with std::size() (C++17)

This commit is contained in:
Max Kellermann
2019-08-03 13:10:49 +02:00
parent d305f187d5
commit cde6c46d2f
27 changed files with 84 additions and 115 deletions

View File

@@ -30,15 +30,15 @@
#include "NumberParser.hxx"
#include "StringView.hxx"
#include "Macros.hxx"
#include <algorithm>
#include <iterator>
int64_t
ParseInt64(StringView s, const char **endptr_r, int base) noexcept
{
char buffer[32];
*std::copy_n(s.data, std::min(s.size, ARRAY_SIZE(buffer) - 1),
*std::copy_n(s.data, std::min(s.size, std::size(buffer) - 1),
buffer) = 0;
char *endptr;