From e566c5fa7f4b8af527c9f13f6eabd84bfc38a897 Mon Sep 17 00:00:00 2001
From: William S Fulton
SWIG correctly parses the = delete and = default -keywords. For example:
+SWIG handles explicitly defaulted functions, that is, = default added to a function declaration. Deleted definitions, which are also called deleted functions, have = delete added to the function declaration. +For example:
struct NonCopyable { NonCopyable& operator=(const NonCopyable&) = delete; /* Removes operator= */ - NonCopyable(const NonCopyable&) = delete; /* Removed copy constructor */ - NonCopyable() = default; /* Explicitly allows the empty constructor */ - void *operator new(std::size_t) = delete; /* Removes new NonCopyable */ + NonCopyable(const NonCopyable&) = delete; /* Removed copy constructor */ + NonCopyable() = default; /* Explicitly allows the empty constructor */ + void *operator new(std::size_t) = delete; /* Removes new NonCopyable */ };
This feature is specific to C++ only. The defaulting/deleting is currently ignored, because SWIG -automatically produces wrappers for special constructors and operators specific to the target language.
++Wrappers for deleted functions will not be available in the target language. +Wrappers for defaulted functions will of course be available in the target language. +Explicitly defaulted functions have no direct effect for SWIG wrapping as the declaration is handled +much like any other method declaration parsed by SWIG. +