Skip to content

Commit

Permalink
fix: add template typename to size
Browse files Browse the repository at this point in the history
  • Loading branch information
a-cordier committed Jun 9, 2019
1 parent f40309e commit 555e5e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<char>::size_type size(const char* name) {
auto it = data.find(name);
return it == data.end() ? 0 : it->second.size();
}
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<char>::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;
Expand Down

0 comments on commit 555e5e2

Please sign in to comment.