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
This commit is contained in:
parent
d25d71bc0f
commit
ef4d07bab0
1 changed files with 11 additions and 16 deletions
|
|
@ -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")
|
%fragment("StdTraitsCommon","header")
|
||||||
%{
|
%{
|
||||||
namespace swig {
|
namespace swig {
|
||||||
|
template <class Type>
|
||||||
|
struct noconst_traits {
|
||||||
|
typedef Type noconst_type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class Type>
|
||||||
|
struct noconst_traits<const Type> {
|
||||||
|
typedef Type noconst_type;
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
type categories
|
type categories
|
||||||
*/
|
*/
|
||||||
|
|
@ -50,7 +55,7 @@ namespace swig {
|
||||||
|
|
||||||
template <class Type>
|
template <class Type>
|
||||||
inline const char* type_name() {
|
inline const char* type_name() {
|
||||||
return traits<Type>::type_name();
|
return traits<typename noconst_traits<Type >::noconst_type >::type_name();
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Type>
|
template <class Type>
|
||||||
|
|
@ -86,16 +91,6 @@ namespace swig {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class Type>
|
|
||||||
struct noconst_traits {
|
|
||||||
typedef Type noconst_type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class Type>
|
|
||||||
struct noconst_traits<const Type> {
|
|
||||||
typedef Type noconst_type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class Type, class Category>
|
template <class Type, class Category>
|
||||||
struct traits_as { };
|
struct traits_as { };
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue