IntPoint / double = IntPoint (should be Point)

Several things are wrong with IntPoint:

#include <iostream>
#include <2geom/int-point.h>

int main()
{
    auto result = Geom::IntPoint{230, 231} / 2.3;
    
    static_assert(std::is_same_v<decltype(result), Geom::Point>);
    
    std::cout << result << std::endl;
}

This test program should compile and print (100, 100.4347826086957). However,

  • It doesn't compile, because IntPoint doesn't have an operator<<. As a workaround, we can include <2geom/point.h> to use Point's.

  • It doesn't compile, because the static_assert fails. Changing Point to IntPoint fixes the compile.

  • It prints the wrong answer (115, 115). This is because the 2.3 is getting converted to 2, and then IntPoint / int = IntPoint is getting used.