feature: Added `explicit` support to header parser
authorVadim Levin <vadim.levin@xperience.ai>
Wed, 15 Apr 2020 11:25:39 +0000 (14:25 +0300)
committerVadim Levin <vadim.levin@xperience.ai>
Wed, 15 Apr 2020 11:25:39 +0000 (14:25 +0300)
- It is safe to remove `explicit` keyword for constructors with 1
argument, because it is C++ specific keyword and does not affect any of
the generated binding.

modules/python/src2/hdr_parser.py

index 780a263..eba7000 100755 (executable)
@@ -430,9 +430,10 @@ class CppHeaderParser(object):
         # filter off some common prefixes, which are meaningless for Python wrappers.
         # note that we do not strip "static" prefix, which does matter;
         # it means class methods, not instance methods
-        decl_str = self.batch_replace(decl_str, [("static inline", ""), ("inline", ""),\
-            ("CV_EXPORTS_W", ""), ("CV_EXPORTS", ""), ("CV_CDECL", ""), ("CV_WRAP ", " "), ("CV_INLINE", ""),
-            ("CV_DEPRECATED", ""), ("CV_DEPRECATED_EXTERNAL", "")]).strip()
+        decl_str = self.batch_replace(decl_str, [("static inline", ""), ("inline", ""), ("explicit ", ""),
+                                                 ("CV_EXPORTS_W", ""), ("CV_EXPORTS", ""), ("CV_CDECL", ""),
+                                                 ("CV_WRAP ", " "), ("CV_INLINE", ""),
+                                                 ("CV_DEPRECATED", ""), ("CV_DEPRECATED_EXTERNAL", "")]).strip()
 
 
         if decl_str.strip().startswith('virtual'):