File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3434#else
3535#include < ctype.h>
3636#endif // _WIN32
37+ #include < format>
3738
3839#include < filesystem>
3940
@@ -787,9 +788,7 @@ namespace {
787788
788789 std::filesystem::path MakeRandomSuffix ()
789790 {
790- std::stringstream strs{};
791- strs << " .fitmp" << std::hex << static_cast <uint32_t >(std::rand ());
792- return strs.str ();
791+ return std::format (" .fitmp{:x}" , static_cast <uint32_t >(std::rand ()));
793792 }
794793
795794
Original file line number Diff line number Diff line change 1919// Use at your own risk!
2020// ==========================================================
2121
22+ #include < format>
2223#include " FreeImage.h"
2324#include " Utilities.h"
2425#include " FIRational.h"
@@ -164,11 +165,11 @@ FIBOOL FIRational::isInteger() {
164165
165166// / Convert as "numerator/denominator"
166167std::string FIRational::toString () {
167- std::ostringstream s;
168+ std::string s;
168169 if (isInteger ()) {
169- s << intValue ();
170+ s = std::to_string ( intValue () );
170171 } else {
171- s << _numerator << " / " << _denominator;
172+ s = std::format ( " {}/{} " , _numerator, _denominator) ;
172173 }
173- return s. str () ;
174+ return s;
174175}
You can’t perform that action at this time.
0 commit comments