Skip to content

Commit

Permalink
Relax holder type check
Browse files Browse the repository at this point in the history
  • Loading branch information
rhaschke committed Nov 6, 2020
1 parent 7852e7d commit cde5c11
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions include/pybind11/attr.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,8 @@ struct type_record {
detail::clean_type_id(base_name);
std::string holder_name(holder_type->name());
detail::clean_type_id(holder_name);
// replace all occurences of base_name within holder_name with T
size_t start_pos = 0;
while((start_pos = holder_name.find(base_name, start_pos)) != std::string::npos) {
holder_name.replace(start_pos, base_name.length(), "T");
start_pos += 1;
}
return holder_name;
size_t start_pos = holder_name.find(base_name);
return holder_name.substr(0, start_pos-1);
};
std::string holder_name = clean_holder_name(holder_type, this->type);
std::string base_holder_name = clean_holder_name(base_info->holder_type, base_info->cpptype);
Expand Down

0 comments on commit cde5c11

Please sign in to comment.