From dbdbdd94aa44da8e3213c08cd252549578db17a4 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Fri, 21 Sep 2012 18:04:15 +0000 Subject: Some updates to c++11 warning messages and update docs on alias templates git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-matevz@13847 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Doc/Manual/Cpp0x.html | 46 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 5 deletions(-) (limited to 'Doc/Manual') diff --git a/Doc/Manual/Cpp0x.html b/Doc/Manual/Cpp0x.html index c93121200..ef64fecc1 100644 --- a/Doc/Manual/Cpp0x.html +++ b/Doc/Manual/Cpp0x.html @@ -27,7 +27,7 @@
  • Strongly typed enumerations
  • Double angle brackets
  • Explicit conversion operators -
  • Template typedefs +
  • Alias templates
  • Unrestricted unions
  • Variadic templates
  • New string literals @@ -382,17 +382,53 @@ SWIG target languages, because all use their own facilities (eg. classes Cloneab to achieve particular copy and compare behaviours.

    -

    7.2.15 Template typedefs

    +

    7.2.15 Alias templates

    +

    +The following is an example of an alias template: + +

    +template< typename T1, typename T2, int >
    +class SomeType {
    +  T1 a;
    +  T2 b;
    +  int c;
    +};
    +
    +template< typename T2 >
    +using TypedefName = SomeType<char*, T2, 5>;
    +
    -

    SWIG currently parses the new using name = syntax, but -ignores the definition:

    +

    +These are partially supported as SWIG will parse these and identify them, however, they are ignored as they are not added to the type system. A warning such as the following is issued: +

    + +
    +
    +example.i:13: Warning 342: The 'using' keyword in template aliasing is not fully supported yet.
    +
    +
    + +

    +Similarly for non-template type aliasing: +

     using PFD = void (*)(double); // New introduced syntax
     
    -

    You should still define the typedefs using the old syntax:

    +

    +A warning will be issued: +

    + +
    +
    +example.i:17: Warning 341: The 'using' keyword in type aliasing is not fully supported yet.
    +
    +
    + + +

    The equivalent old style typedefs can be used as a workaround:

     typedef void (*PFD)(double);  // The old style
    -- 
    cgit v1.2.3