From ef4d07bab028bfd0cc41d53cf9fbb3e377de8fc5 Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Mon, 18 Oct 2004 00:20:00 +0000 Subject: [PATCH] fixes for noconst types and size_t git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6417 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/std/std_common.i | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/Lib/std/std_common.i b/Lib/std/std_common.i index e67d9bb24..945e5e74a 100644 --- a/Lib/std/std_common.i +++ b/Lib/std/std_common.i @@ -28,15 +28,20 @@ %} -%apply size_t { std::size_t }; -%apply const size_t& { const std::size_t& }; -%apply ptrdiff_t { std::ptrdiff_t } -%apply const ptrdiff_t& { const std::ptrdiff_t& } - %fragment("StdTraitsCommon","header") %{ namespace swig { + template + struct noconst_traits { + typedef Type noconst_type; + }; + + template + struct noconst_traits { + typedef Type noconst_type; + }; + /* type categories */ @@ -50,7 +55,7 @@ namespace swig { template inline const char* type_name() { - return traits::type_name(); + return traits::noconst_type >::type_name(); } template @@ -84,16 +89,6 @@ namespace swig { static std::string name = make_ptr_name(swig::type_name()); return name.c_str(); } - }; - - template - struct noconst_traits { - typedef Type noconst_type; - }; - - template - struct noconst_traits { - typedef Type noconst_type; }; template