Fixed a problem with const correctness in new
adde std_pair.i functions. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9745 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
ba168b3403
commit
3ccbac69aa
1 changed files with 3 additions and 3 deletions
|
|
@ -106,7 +106,7 @@
|
||||||
struct traits_from<std::pair<T,U> > {
|
struct traits_from<std::pair<T,U> > {
|
||||||
static VALUE _wrap_pair_second( VALUE self )
|
static VALUE _wrap_pair_second( VALUE self )
|
||||||
{
|
{
|
||||||
std::pair<T,U>* p = NULL;
|
std::pair< typename swig::noconst_traits<T >::noconst_type,U>* p = NULL;
|
||||||
swig::asptr( self, &p );
|
swig::asptr( self, &p );
|
||||||
return swig::from( p->second );
|
return swig::from( p->second );
|
||||||
fail:
|
fail:
|
||||||
|
|
@ -115,7 +115,7 @@
|
||||||
|
|
||||||
static VALUE _wrap_pair_second_eq( VALUE self, VALUE arg )
|
static VALUE _wrap_pair_second_eq( VALUE self, VALUE arg )
|
||||||
{
|
{
|
||||||
std::pair<T,U>* p = NULL;
|
std::pair< typename swig::noconst_traits<T >::noconst_type,U>* p = NULL;
|
||||||
swig::asptr( self, &p );
|
swig::asptr( self, &p );
|
||||||
return swig::from( p->second );
|
return swig::from( p->second );
|
||||||
fail:
|
fail:
|
||||||
|
|
@ -124,7 +124,7 @@
|
||||||
|
|
||||||
static VALUE from(const std::pair<T,U>& val) {
|
static VALUE from(const std::pair<T,U>& val) {
|
||||||
VALUE obj = rb_ary_new2(2);
|
VALUE obj = rb_ary_new2(2);
|
||||||
RARRAY_PTR(obj)[0] = swig::from(val.first);
|
RARRAY_PTR(obj)[0] = swig::from< typename swig::noconst_traits<T >::noconst_type>(val.first);
|
||||||
RARRAY_PTR(obj)[1] = swig::from(val.second);
|
RARRAY_PTR(obj)[1] = swig::from(val.second);
|
||||||
RARRAY_LEN(obj) = 2;
|
RARRAY_LEN(obj) = 2;
|
||||||
rb_define_singleton_method(obj, "second",
|
rb_define_singleton_method(obj, "second",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue