@@ -1166,24 +1166,28 @@ class smart_pointer_traits(object):
1166
1166
@staticmethod
1167
1167
def is_smart_pointer (type_ ):
1168
1168
"""returns True, if type represents instantiation of
1169
- `boost::shared_ptr`, False otherwise"""
1169
+ `boost::shared_ptr` or `std::shared_ptr` , False otherwise"""
1170
1170
type_ = remove_alias (type_ )
1171
1171
type_ = remove_cv (type_ )
1172
1172
type_ = remove_declarated (type_ )
1173
1173
if not isinstance (type_ ,
1174
1174
(class_declaration .class_declaration_t ,
1175
1175
class_declaration .class_t )):
1176
1176
return False
1177
- if not impl_details .is_defined_in_xxx ('boost' , type_ ):
1177
+ if not (impl_details .is_defined_in_xxx ('boost' , type_ ) or \
1178
+ impl_details .is_defined_in_xxx ('std' , type_ )):
1178
1179
return False
1179
- return type_ .decl_string .startswith ('::boost::shared_ptr<' )
1180
+ return type_ .decl_string .startswith ('::boost::shared_ptr<' ) or \
1181
+ type_ .decl_string .startswith ('::std::shared_ptr<' )
1180
1182
1181
1183
@staticmethod
1182
1184
def value_type (type_ ):
1183
- """returns reference to `boost::shared_ptr` value type"""
1185
+ """returns reference to `boost::shared_ptr` \
1186
+ or `std::shared_ptr` value type"""
1184
1187
if not smart_pointer_traits .is_smart_pointer (type_ ):
1185
1188
raise TypeError (
1186
- 'Type "%s" is not instantiation of boost::shared_ptr' %
1189
+ 'Type "%s" is not an instantiation of \
1190
+ boost::shared_ptr or std::shared_ptr' %
1187
1191
type_ .decl_string )
1188
1192
return internal_type_traits .get_by_name (type_ , "value_type" )
1189
1193
0 commit comments