53
Comments
  • 2
    C++ compares them fine. Just tested:

    @highlight

    {

    int i = 1;

    float f = 2.0;

    qInfo() << bool(i <= f);

    qInfo() << bool(i == f);

    qInfo() << bool(i > f);

    qInfo() << "";

    i = 2;

    qInfo() << bool(i <= f);

    qInfo() << bool(i == f);

    qInfo() << bool(i > f);

    qInfo() << "";

    i = 3;

    qInfo() << bool(i <= f);

    qInfo() << bool(i == f);

    qInfo() << bool(i > f);

    qInfo() << "";

    }
  • 0
  • 0
    @Demolishun really? it's been 5 years since I touched C++ , probably you are right but maybe in the declarative way it doesn't, what about int and string?
  • 1
    @mrtehseen Running code does not lie.

    This fails to compile:

    @highlight

    // i is still 3 here

    std::string s("5");

    qInfo() << bool(s > i);
  • 0
  • 2
    There is no reason you couldn't write an operator() to do this though.
  • 1
    Yeah and get 1000 bugs because you assume how launguage handles those shit cases. C has more control.
  • 0
    *laughing in PHP*
  • 3
    I'm surprised people are even debating on this.

    Python is a loose scripting language, purposefully throwing away efficiency for conviniences.

    C++ is a strict pre-compiled language.

    And no, packaging the interpreter into he binary does not count.
  • 0
    Yep utter crap. This is as stupid as hiring a notary and complaining about all the rules that the local loan shark never complained about...

    @MPKaboose try making a switch with a case null and case 0 see who is laughing now.
Add Comment