COIN-OR::LEMON - Graph Library

Opened 11 years ago

Closed 11 years ago

#444 closed defect (fixed)

Strange bug in ListPath<>

Reported by: Alpar Juttner Owned by: Alpar Juttner
Priority: blocker Milestone: LEMON 1.3 release
Component: core Version: hg main
Keywords: Cc:
Revision id: 38e1d4383262

Description (last modified by Alpar Juttner)

Valgrind report an error on the following code:

    ListPath<ListDigraph> p,q;

The problem seems to be that q=p tries to copy bitwise instead of using the template ListPath<>::operator=() implementation.

Implementing a non-template version solves the problem, but I don't understand why the template version is used.

I fear that this issue may affect other Path structures, or even other tools, too.

Change History (2)

comment:1 Changed 11 years ago by Alpar Juttner

Description: modified (diff)

comment:2 Changed 11 years ago by Alpar Juttner

Resolution: fixed
Status: newclosed

The issue has been fixed in [7440937d154b] and merged to all relevant branches (1.1,1.2,default).

The reason for the problem is the usual utmost stupidity of C++ - the default copy constructor is of higher priority than an explicitly defined template one.

Note: See TracTickets for help on using tickets.