Change c++17 to c++20. Fixed formatting on assignment from double.
This commit is contained in:
1 parent
1c7f961255
commit
bfe5283492
4 files changed
+12
-7
No files matched your search
+11
-6
@@ -3,6 +3,7 @@
|
|||||||
#include "uuid/uuid.h"
|
#include "uuid/uuid.h"
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <format>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
@@ -83,9 +84,11 @@ namespace coreutils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
MString::MString(double value) {
|
MString::MString(double value) {
|
||||||
std::string data = std::to_string(value);
|
std::stringstream temp;
|
||||||
setSize(data.length());
|
temp << std::format("{}", value);
|
||||||
memcpy(this->data, (char *)data.c_str(), data.length());
|
std::string temp2 = temp.str();
|
||||||
|
setSize(temp2.length());
|
||||||
|
memcpy(this->data, (char *)temp2.data(), temp2.length());
|
||||||
cursor = this->data;
|
cursor = this->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,9 +133,11 @@ namespace coreutils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
MString &MString::operator=(double value) {
|
MString &MString::operator=(double value) {
|
||||||
std::string data = std::to_string(value);
|
std::stringstream temp;
|
||||||
setSize(data.length());
|
temp << std::format("{}", value);
|
||||||
memcpy(this->data, (char *)data.c_str(), data.length());
|
std::string temp2 = temp.str();
|
||||||
|
setSize(temp2.length());
|
||||||
|
memcpy(this->data, (char *)temp2.data(), temp2.length());
|
||||||
cursor = this->data;
|
cursor = this->data;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ do
|
|||||||
filename="${file%.*}"
|
filename="${file%.*}"
|
||||||
list="$list $filename.o"
|
list="$list $filename.o"
|
||||||
echo -n "Compiling $filename..."
|
echo -n "Compiling $filename..."
|
||||||
g++ -g -c $file -std=c++17 &
|
g++ -g -c $file -std=c++20 &
|
||||||
if [ $? = '0' ]
|
if [ $? = '0' ]
|
||||||
then
|
then
|
||||||
echo "OK"
|
echo "OK"
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in new issue
Block a user