-
-
Notifications
You must be signed in to change notification settings - Fork 262
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Thanks for creating great cppinsights! It's indeed so insightful! I noticed the operators doesn't expand for the built-in types like int and double, while it works for complex type objects. Here is my code
#include <complex>
using namespace std;
int main () {
int q = 2;
++q;
q--;
q += 2.0;
complex<int> com1{3,4};
complex<int> com2(com1);
com1 += com2;
com1 = com1 + com2;;
return 0;
}
and here is what I get from cppinsights
#include <complex>
using namespace std;
int main()
{
int q = 2;
++q;
q--;
q += 2.0;
complex<int> com1 = std::complex<int>{3, 4};
complex<int> com2 = std::complex<int>(static_cast<const std::complex<int>>(com1));
com1.operator+=(static_cast<const std::complex<int>>(com2));
com1.operator=(std::operator+(static_cast<const std::complex<int>>(com1), static_cast<const std::complex<int>>(com2)));
;
return 0;
}
Also, I guess, in the case of q += 2.0; the static_cast<int> is not shown. Are they real bugs?
Thank you.
Mehdi
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working