mirror of
https://github.com/gbdev/rgbds.git
synced 2026-08-23 15:24:35 +00:00
Use C++20 concepts to require constraints on template parameters (#1977)
This commit is contained in:
@@ -95,6 +95,7 @@ static std::string readKeyword(int initial) {
|
||||
}
|
||||
|
||||
template<uint32_t Base>
|
||||
requires BaseV<Base>
|
||||
static yy::parser::symbol_type readNumber(int initial, char const *prefix, char const *name) {
|
||||
LexerStackEntry &context = lexerStack.back();
|
||||
uint32_t number;
|
||||
|
||||
+4
-4
@@ -310,8 +310,9 @@ static bool compareSymbols(SortedSymbol const &sym1, SortedSymbol const &sym2) {
|
||||
< std::tie(sym2.addr, sym2_local, sym2.parentAddr, sym2_name);
|
||||
}
|
||||
|
||||
template<typename CallbackFnT>
|
||||
static void forEachSortedSection(SortedSections const &bankSections, CallbackFnT callback) {
|
||||
static void forEachSortedSection(
|
||||
SortedSections const &bankSections, Procedure<Section const &> auto callback
|
||||
) {
|
||||
for (Section const *sect : bankSections.zeroLenSections) {
|
||||
for (Section const &piece : sect->pieces()) {
|
||||
callback(piece);
|
||||
@@ -411,8 +412,7 @@ static void writeSectionName(std::string const &name, FILE *file) {
|
||||
}
|
||||
}
|
||||
|
||||
template<typename CallbackFnT>
|
||||
uint16_t forEachSection(SortedSections const §List, CallbackFnT callback) {
|
||||
uint16_t forEachSection(SortedSections const §List, Procedure<Section const &> auto callback) {
|
||||
uint16_t used = 0;
|
||||
auto section = sectList.sections.begin();
|
||||
auto zeroLenSection = sectList.zeroLenSections.begin();
|
||||
|
||||
Reference in New Issue
Block a user