#1331 C++11: std::vector::erase const vs non-const iteraror

None
closed
None
5
2014-03-07
2013-08-27
No

Currently SWIG generates C++03 compatible code. It will need to be tweaked to handle the following change:

http://en.cppreference.com/w/cpp/container/vector/erase

iterator erase( iterator pos );
(until C++11)
iterator erase( const_iterator pos );
(since C++11)

I cannot compile GDCM/Swig/Python module in C++11 since it leads to:

/home/mathieu/Perso/gdcm-clang-libc++/Wrapping/Python/gdcmswigPYTHON_wrap.cxx:86444:20: error: no matching member function for call to 'erase'
result = (arg1)->erase(arg2);
~~~~~~~~^~~~~

Ps: obviously I cannot mix C++03 and C++11 since they are incomatible.

Discussion

  • Mathieu Malaterre

    I think the following should be handled too:

                                       ^
    

    /home/mathieu/Perso/gdcm-clang-libc++/Wrapping/Python/gdcmswigPYTHON_wrap.cxx:86906:20: error: no matching member function for call to 'insert'
    result = (arg1)->insert(arg2,(std::vector< enum gdcm::ECharSet >::value_type const &)*arg3);
    ~~~~~~~~^~~~~~

     
  • Mathieu Malaterre

    And maybe this one:

    /home/mathieu/Perso/gdcm-clang-libc++/Wrapping/Python/gdcmswigPYTHON_wrap.cxx:4894:9: warning: destination for this 'memset' call is a pointer to dynamic
    class 'gdcm::File'; vtable pointer will be overwritten [-Wdynamic-class-memaccess]
    memset(v_def,0,sizeof(Type));

     
  • William Fulton

    William Fulton - 2014-03-07
    • status: open --> closed
    • assigned_to: William Fulton
    • Group: -->
     
  • William Fulton

    William Fulton - 2014-03-07

    This was fixed in SWIG-2.0.12.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks