Update of /cvsroot/pygccxml/source/pygccxml/declarations
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12948/pygccxml/declarations
Modified Files:
__init__.py type_traits.py
Log Message:
adding is_noncopyable to type_traits
Index: type_traits.py
===================================================================
RCS file: /cvsroot/pygccxml/source/pygccxml/declarations/type_traits.py,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** type_traits.py 1 Feb 2006 07:31:38 -0000 1.22
--- type_traits.py 5 Mar 2006 05:41:11 -0000 1.23
***************
*** 657,661 ****
--- 657,675 ----
return __is_convertible_t( source, target ).is_convertible()
+ def is_noncopyable( class_ ):
+ for base_desc in class_.recursive_bases:
+ assert isinstance( base_desc, class_declaration.hierarchy_info_t )
+ if base_desc.related_class.decl_string in ('::boost::noncopyable', '::boost::noncopyable_::noncopyable' ):
+ return True
+ if not has_trivial_copy( base_desc.related_class ):
+ return True
+
+ if not has_trivial_copy( class_ ) \
+ or not has_public_constructor( class_ )\
+ or class_.is_abstract \
+ or ( has_destructor( class_ ) and not has_public_destructor( class_ ) ):
+ return True
+ return False
Index: __init__.py
===================================================================
RCS file: /cvsroot/pygccxml/source/pygccxml/declarations/__init__.py,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** __init__.py 2 Mar 2006 05:53:14 -0000 1.33
--- __init__.py 5 Mar 2006 05:41:11 -0000 1.34
***************
*** 105,108 ****
--- 105,109 ----
from type_traits import is_base_and_derived
from type_traits import is_convertible
+ from type_traits import is_noncopyable
from type_traits import is_unary_operator
***************
*** 134,137 ****
--- 135,139 ----
from decl_factory import decl_factory_t
+ from filters import declaration_matcher_t
from filters import calldef_matcher_t
from filters import namespace_matcher_t
|