Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#27 A few errors in version 5.4.2

closed-fixed
None
5
2008-11-28
2008-11-24
Werner Mayer
No

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.

Discussion

  • Werner Mayer
    Werner Mayer
    2008-11-24

    • assigned_to: nobody --> barry-scott
     
  • 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.

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

     
    • status: open --> open-accepted
     
  • fix on trunk and branches/pycxx-5-maint
    r158 and r157

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