From 555e5e2d770501161a2d9d16a1cee83bb24c7fa8 Mon Sep 17 00:00:00 2001 From: Antoine Cordier Date: Sun, 9 Jun 2019 11:08:12 +0200 Subject: [PATCH] fix: add template typename to size --- README.md | 2 +- src/main.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5a16170..a5a99d3 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ namespace resources { return it == data.end() ? nullptr : it->second.data(); } - inline std::vector::size_type size(const char* name) { + inline std::vector::size_type size(const char* name) { auto it = data.find(name); return it == data.end() ? 0 : it->second.size(); } diff --git a/src/main.cpp b/src/main.cpp index 155a3c4..9d64271 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -102,7 +102,7 @@ void define_getter(std::ostream &o, std::string map_name, int idt) { } void define_sizeof(std::ostream &o, std::string map_name, int idt) { - indent(o, idt) << "inline std::vector::size_type size(const char* name) {" << std::endl; + indent(o, idt) << "inline std::vector::size_type size(const char* name) {" << std::endl; indent(o, idt + 1) << "auto it = " << map_name << ".find(name);" << std::endl; indent(o, idt + 1) << "return it == " << map_name << ".end() ? 0 : it->second.size();" << std::endl; indent(o, idt) << "}" << std::endl;