[Rivet] inRange trouble

Hendrik Hoeth hendrik.hoeth at cern.ch
Thu Sep 22 12:48:06 BST 2011


Thus spake Andy Buckley (andy.buckley at ed.ac.uk):

> So what was wrong with inRange(<T1>,<T2>,<T3>) and specialising on
> int, int, int -- you said "ambiguity"?

Then the templated version is picked up by a case with different integer
lengths, and fuzzyLessEquals throws up:

../../include/Rivet/Math/MathUtils.hh: In function 'bool Rivet::inRange(NUM1, NUM2, NUM3, Rivet::RangeBoundary, Rivet::RangeBoundary) [with NUM1 = long unsigned int, NUM2 = int, NUM3 = long unsigned int]':
../../include/Rivet/Projections/JetShape.hh:115:   instantiated from here
../../include/Rivet/Math/MathUtils.hh:114: error: call of overloaded 'fuzzyLessEquals(long unsigned int&, long unsigned int&)' is ambiguous
../../include/Rivet/Math/MathUtils.hh:76: note: candidates are: bool Rivet::fuzzyLessEquals(double, double, double)
../../include/Rivet/Math/MathUtils.hh:87: note:                 bool Rivet::fuzzyLessEquals(long int, long int, double)
../../include/Rivet/Math/MathUtils.hh:116: error: call of overloaded 'fuzzyGtrEquals(long unsigned int&, int&)' is ambiguous
../../include/Rivet/Math/MathUtils.hh:57: note: candidates are: bool Rivet::fuzzyGtrEquals(double, double, double)
../../include/Rivet/Math/MathUtils.hh:68: note:                 bool Rivet::fuzzyGtrEquals(long int, long int, double)
../../include/Rivet/Math/MathUtils.hh:118: error: call of overloaded 'fuzzyLessEquals(long unsigned int&, long unsigned int&)' is ambiguous
../../include/Rivet/Math/MathUtils.hh:76: note: candidates are: bool Rivet::fuzzyLessEquals(double, double, double)
../../include/Rivet/Math/MathUtils.hh:87: note:                 bool Rivet::fuzzyLessEquals(long int, long int, double)
../../include/Rivet/Math/MathUtils.hh:118: error: call of overloaded 'fuzzyGtrEquals(long unsigned int&, int&)' is ambiguous
../../include/Rivet/Math/MathUtils.hh:57: note: candidates are: bool Rivet::fuzzyGtrEquals(double, double, double)
../../include/Rivet/Math/MathUtils.hh:68: note:                 bool Rivet::fuzzyGtrEquals(long int, long int, double)


-- 
A man without a dream in his heart already has one foot in the grave.


More information about the Rivet mailing list