Skip to content

Commit cde5c11

Browse files
committed
Relax holder type check
1 parent 7852e7d commit cde5c11

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

include/pybind11/attr.h

+2-7
Original file line numberDiff line numberDiff line change
@@ -294,13 +294,8 @@ struct type_record {
294294
detail::clean_type_id(base_name);
295295
std::string holder_name(holder_type->name());
296296
detail::clean_type_id(holder_name);
297-
// replace all occurences of base_name within holder_name with T
298-
size_t start_pos = 0;
299-
while((start_pos = holder_name.find(base_name, start_pos)) != std::string::npos) {
300-
holder_name.replace(start_pos, base_name.length(), "T");
301-
start_pos += 1;
302-
}
303-
return holder_name;
297+
size_t start_pos = holder_name.find(base_name);
298+
return holder_name.substr(0, start_pos-1);
304299
};
305300
std::string holder_name = clean_holder_name(holder_type, this->type);
306301
std::string base_holder_name = clean_holder_name(base_info->holder_type, base_info->cpptype);

0 commit comments

Comments
 (0)