Problem fractions
User BoneMeBurner
Submission Time 2024-07-26 17:41:14
Score 0
Max Time N/A
Max Memory N/A

Compile Error

fractions.cpp: In function ‘bool operator<(Fraction, Fraction)’:
fractions.cpp:9:15: error: no match for ‘operator*’ (operand types are ‘Fraction’ and ‘Fraction’)
9 | return f1 * f2 < f2 * f1;
| ~~ ^ ~~
| | |
| | Fraction
| Fraction
In file included from /usr/include/c++/9/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
from fractions.cpp:1:
/usr/include/c++/9/complex:391:5: note: candidate: ‘template<class _Tp> std::complex<_Tp> std::operator*(const std::complex<_Tp>&, const std::complex<_Tp>&)’
391 | operator*(const complex<_Tp>& __x, const complex<_Tp>& __y)
| ^~~~~~~~
/usr/include/c++/9/complex:391:5: note: template argument deduction/substitution failed:
fractions.cpp:9:17: note: ‘Fraction’ is not derived from ‘const std::complex<_Tp>’