#27 A few errors in version 5.4.2


When using the latest version in an own project I run into a few compiler errors. There I detected three errors in total.

1. The template class SeqBase has the overloaded method front() whose implementation is:

seqref<T> front()
return seqref<T>(this, 0);

The template class seqref, however, expects a reference, not a pointer in its constructors. The fixed method then has the missing asterik:

seqref<T> front()
return seqref<T>(*this, 0);

2. The same error with the overloaded method back()

3. The const_iterator class for MapBase has a constructor which accepts a reference:

const_iterator (MapBase<T>* m, bool end = false )

However, this must be a const reference, i.e.

const_iterator (const MapBase<T>* m, bool end = false )

otherwise the methods
const_iterator begin () const and
const_iterator end () const
cause a compiler error.


  • Werner Mayer

    Werner Mayer - 2008-11-24
    • assigned_to: nobody --> barry-scott
  • Nobody/Anonymous

    One addition:

    In the test function test_String() in example.cxx you can add the lines
    Py::Char c7 = r2.front();
    Py::Char c8 = r2.back();
    to get the compiler errors.

    And in the test_Dict() function use this code
    const Py::Dict c;
    for (Py::Dict::const_iterator it = c.begin(); it != c.end(); ++it) {

    to get the error.

  • Barry Alan Scott

    I'll work on fixing for the python 2 and python 3 branches of PyCXX.

  • Barry Alan Scott

    • status: open --> open-accepted
  • Barry Alan Scott

    fix on trunk and branches/pycxx-5-maint
    r158 and r157

  • Barry Alan Scott

    • status: open-accepted --> open-fixed
  • Barry Alan Scott

    • status: open-fixed --> closed-fixed

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

Sign up for the SourceForge newsletter:

No, thanks