Skip to content

max(a, b) template function error #23

Description

@andan42
./src/plot/plot_lib.hpp:3915:11: error: no matching function for call to 'max'
          utils::max(1l, rct.p2.y/cell_rows + (rct.p2.y%cell_rows != 0)) }
          ^~~~~~~~~~
./src/plot/plot_lib.hpp:59:24: note: candidate template ignored: deduced conflicting types for parameter 'T' ('long' vs. 'int')
    inline constexpr T max(T a, T b) {
                       ^

Identical error in a few more places.

Fixed by adding this to utils:

template<typename T, typename _T>
    inline constexpr T max(T a, _T b) {
        return (a >= b) ? a : b;
    }

Probably should do this to min() too.

clang++-3.9
-g -MMD -MP -std=c++14

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions