io@piefed.blahaj.zone to Programmer Humor@programming.devEnglish · 3 days agoNaN Postingpiefed.cdn.blahaj.zoneimagemessage-square14fedilinkarrow-up1459arrow-down13file-text
arrow-up1456arrow-down1imageNaN Postingpiefed.cdn.blahaj.zoneio@piefed.blahaj.zone to Programmer Humor@programming.devEnglish · 3 days agomessage-square14fedilinkfile-text
minus-squarezerofk@lemmy.ziplinkfedilinkarrow-up2·2 days ago#include <cmath> #include <iostream> #include <numbers> int main() { decltype ( NAN ) f { std::numbers::pi }; std::cout << f << std::endl; }
minus-squaremarcos@lemmy.worldlinkfedilinkarrow-up2·2 days agoDude, after forcing -std=c++20, the compiler still can’t find a reference for std::ostream::operator<<(float)… Do I have to link with some non-standard library? There doesn’t seem to have any numbers.a included with gcc.
minus-squarezerofk@lemmy.ziplinkfedilinkarrow-up3·edit-22 days agoWeird, it should be standard C++20. Hope are you invoking gcc? godbolt link: https://godbolt.org/z/6Tn4Kcjrs Edit: be sure to call g++, not gcc.
#include <cmath> #include <iostream> #include <numbers> int main() { decltype ( NAN ) f { std::numbers::pi }; std::cout << f << std::endl; }Dude, after forcing
-std=c++20, the compiler still can’t find a reference forstd::ostream::operator<<(float)…Do I have to link with some non-standard library? There doesn’t seem to have any
numbers.aincluded with gcc.Weird, it should be standard C++20. Hope are you invoking gcc?
godbolt link: https://godbolt.org/z/6Tn4Kcjrs
Edit: be sure to call g++, not gcc.
Oh, that’s right, I was using gcc.