mirror of
https://github.com/gbdev/rgbds.git
synced 2026-07-02 14:08:04 +00:00
Use C++20 concepts to require constraints on template parameters (#1977)
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <charconv>
|
||||
#include <concepts> // unsigned_integral
|
||||
#include <errno.h>
|
||||
#include <fstream>
|
||||
#include <inttypes.h>
|
||||
@@ -202,7 +203,7 @@ static void warnExtraColors(
|
||||
}
|
||||
|
||||
// Parses the initial part of a string_view, advancing the "read index" as it does
|
||||
template<typename UintT> // Should be uint*_t
|
||||
template<std::unsigned_integral UintT>
|
||||
static std::optional<UintT> parseDec(std::string const &str, size_t &n) {
|
||||
UintT value = 0;
|
||||
auto result = std::from_chars(str.data() + n, str.data() + str.length(), value);
|
||||
|
||||
Reference in New Issue
Block a user