COIN-OR::LEMON - Graph Library

Opened 9 years ago

Closed 9 years ago

#209 closed defect (fixed)

lp_test.cc fails to compile with VS2005

Reported by: ladanyi Owned by: deba
Priority: major Milestone: LEMON 1.1 release
Component: core Version: hg main
Keywords: Cc:
Revision id: efec3c133e74

Description

This is the error message:

------ Build started: Project: lp_test, Configuration: Debug Win32 ------
Compiling...
lp_test.cc
..\..\test\lp_test.cc(55) : error C2664: 'void lemon::LpBase::colUpperBound(lemon::LpBase::Col,lemon::LpBase::Value)' : cannot convert parameter 1 from 'std::vector<_Ty>' to 'lemon::LpBase::Col'
        with
        [
            _Ty=lemon::LpBase::Col
        ]
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
..\..\test\lp_test.cc(56) : error C2664: 'void lemon::LpBase::colBounds(lemon::LpBase::Col,lemon::LpBase::Value,lemon::LpBase::Value)' : cannot convert parameter 1 from 'std::vector<_Ty>' to 'lemon::LpBase::Col'
        with
        [
            _Ty=lemon::LpBase::Col
        ]
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
..\..\test\lp_test.cc(62) : error C2664: 'void lemon::LpBase::colUpperBound(lemon::LpBase::Col,lemon::LpBase::Value)' : cannot convert parameter 1 from 'std::vector<_Ty>' to 'lemon::LpBase::Col'
        with
        [
            _Ty=lemon::LpBase::Col
        ]
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
..\..\test\lp_test.cc(63) : error C2664: 'void lemon::LpBase::colBounds(lemon::LpBase::Col,lemon::LpBase::Value,lemon::LpBase::Value)' : cannot convert parameter 1 from 'std::vector<_Ty>' to 'lemon::LpBase::Col'
        with
        [
            _Ty=lemon::LpBase::Col
        ]
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
..\..\test\lp_test.cc(75) : error C2664: 'void lemon::LpBase::colUpperBound(lemon::LpBase::Col,lemon::LpBase::Value)' : cannot convert parameter 1 from 'std::map<_Kty,_Ty>' to 'lemon::LpBase::Col'
        with
        [
            _Kty=int,
            _Ty=lemon::LpBase::Col
        ]
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
..\..\test\lp_test.cc(76) : error C2664: 'void lemon::LpBase::colBounds(lemon::LpBase::Col,lemon::LpBase::Value,lemon::LpBase::Value)' : cannot convert parameter 1 from 'std::map<_Kty,_Ty>' to 'lemon::LpBase::Col'
        with
        [
            _Kty=int,
            _Ty=lemon::LpBase::Col
        ]
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called

Attachments (1)

ticket209_67d4e07336d7.patch (3.4 KB) - added by jtapolcai 9 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 in reply to: ↑ description ; follow-up: Changed 9 years ago by alpar

Replying to ladanyi:

This is a very mysterious error.

lp.colUpperBound(x,1);

fails to compile when x is and std::vector<LP::Col>, but there is no problem with

lp.colLowerBound(x,1);

The implementation of these functions are exactly the same.

Also, everything is fine with VS2008. (Well, in this respect... :) )

comment:2 in reply to: ↑ 1 Changed 9 years ago by jtapolcai

Moreover if you swap the code lines in lp_base.h related to colUpperBound and colLowerBound

lp.colUpperBound(x,1);

is going to compile and

lp.colLowerBound(x,1);

is not.

Changed 9 years ago by jtapolcai

comment:3 follow-up: Changed 9 years ago by jtapolcai

The attached patch ticket209_67d4e07336d7.patch fixes the bug. The bug and the solution is not too meaningful bug.

comment:4 in reply to: ↑ 3 Changed 9 years ago by alpar

Replying to jtapolcai:

The attached patch ticket209_67d4e07336d7.patch fixes the bug. The bug and the solution is not too meaningful bug.

Could someone have a look at this ticket so that we can put it in the main branch?

comment:5 Changed 9 years ago by alpar

  • Resolution set to fixed
  • Status changed from new to closed

The changeset (with different commit log) is in the main branch now, see [2eb5c8ca2c91].

Note: See TracTickets for help on using tickets.