Skip to content

model.cc: error: no matching function for call to 'max(long int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)' #4

@barracuda156

Description

@barracuda156
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_ipx/ipx/work/compwrap/cxx/opt/local/bin/g++-mp-12 -std=c++11 -Wall -Wextra -Wno-sign-compare -I/opt/local/include  -O2 -fPIC -Iinclude -Isrc -Ithird_party -I/opt/local/include/basiclu -c src/sparse_matrix.cc -o build/sparse_matrix.o
src/model.cc: In member function 'void ipx::Model::FindDenseColumns()':
src/model.cc:44:35: error: no matching function for call to 'max(long int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)'
   44 |         if (colcount[j] > std::max(40l, 10l*colcount[j-1])) {
      |                           ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /opt/local/include/gcc12/c++/vector:60,
                 from src/model.h:6,
                 from src/model.cc:3:
/opt/local/include/gcc12/c++/bits/stl_algobase.h:254:5: note: candidate: 'template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)'
  254 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/opt/local/include/gcc12/c++/bits/stl_algobase.h:254:5: note:   template argument deduction/substitution failed:
src/model.cc:44:35: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'})
   44 |         if (colcount[j] > std::max(40l, 10l*colcount[j-1])) {
      |                           ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/gcc12/c++/bits/stl_algobase.h:300:5: note: candidate: 'template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  300 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/opt/local/include/gcc12/c++/bits/stl_algobase.h:300:5: note:   template argument deduction/substitution failed:
src/model.cc:44:35: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'})
   44 |         if (colcount[j] > std::max(40l, 10l*colcount[j-1])) {
      |                           ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /opt/local/include/gcc12/c++/algorithm:61,
                 from /opt/local/include/gcc12/c++/valarray:38,
                 from src/ipx_internal.h:10,
                 from src/control.h:10,
                 from src/model.h:7:
/opt/local/include/gcc12/c++/bits/stl_algo.h:5746:5: note: candidate: 'template<class _Tp> _Tp std::max(initializer_list<_Tp>)'
 5746 |     max(initializer_list<_Tp> __l)
      |     ^~~
/opt/local/include/gcc12/c++/bits/stl_algo.h:5746:5: note:   template argument deduction/substitution failed:
src/model.cc:44:35: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   44 |         if (colcount[j] > std::max(40l, 10l*colcount[j-1])) {
      |                           ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/gcc12/c++/bits/stl_algo.h:5756:5: note: candidate: 'template<class _Tp, class _Compare> _Tp std::max(initializer_list<_Tp>, _Compare)'
 5756 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/opt/local/include/gcc12/c++/bits/stl_algo.h:5756:5: note:   template argument deduction/substitution failed:
src/model.cc:44:35: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   44 |         if (colcount[j] > std::max(40l, 10l*colcount[j-1])) {
      |                           ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
make: *** [build/model.o] Error 1
make: *** Waiting for unfinished jobs....

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions