From e566c5fa7f4b8af527c9f13f6eabd84bfc38a897 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sat, 16 Nov 2013 00:13:38 +0000 Subject: Add support for parsing C++11 =delete and =default Although this was documented as working, it wasn't implemented %typemap(default) failed without the idstring changes Add some C tests using the C++ keyword delete --- Doc/Manual/CPlusPlus11.html | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'Doc/Manual') diff --git a/Doc/Manual/CPlusPlus11.html b/Doc/Manual/CPlusPlus11.html index 3caec748e..95d748791 100644 --- a/Doc/Manual/CPlusPlus11.html +++ b/Doc/Manual/CPlusPlus11.html @@ -33,7 +33,7 @@
  • New string literals
  • User-defined literals
  • Thread-local storage -
  • Defaulting/deleting of standard functions on C++ objects +
  • Defaulting/deleting of standard functions on C++ objects
  • Type long long int
  • Static assertions
  • Allow sizeof to work on members of classes without an explicit object @@ -739,23 +739,27 @@ A variable will be thread local if accessed from different threads from the targ same way that it will be thread local if accessed from C++ code.

    -

    7.2.21 Defaulting/deleting of standard functions on C++ objects

    +

    7.2.21 Explicitly defaulted functions and deleted functions

    -

    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. +

    7.2.22 Type long long int

    -- cgit v1.2.3