add operator= to msvc string ()

* add operator= to msvc string
This commit is contained in:
alk 2022-11-22 16:46:03 +03:00 committed by GitHub
parent 9a51843727
commit 4f66b8d8f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions
codegen/src
loader/include/Geode/c++stl

View file

@ -8,12 +8,18 @@ namespace { namespace format_strings {
)GEN";
char const* class_includes = R"GEN(#pragma once
#include <Geode/platform/platform.hpp>
#include <Geode/c++stl/gdstdlib.hpp>
#include <cocos2d.h>
#include <cocos-ext.h>
#include <Geode/GeneratedPredeclare.hpp>
#include <Geode/Enums.hpp>
)GEN";
char const* class_no_includes = R"GEN(#pragma once
#include <Geode/platform/platform.hpp>
)GEN";
char const* class_include_prereq = R"GEN(#include "{file_name}"
@ -79,7 +85,7 @@ std::string generateBindingHeader(Root& root, ghc::filesystem::path const& singl
if (cls.name != "GDString") {
single_output += format_strings::class_includes;
} else {
single_output += "#pragma once\n#include <Geode/platform/platform.hpp>\n";
single_output += format_strings::class_no_includes;
}
for (auto dep : cls.depends) {

View file

@ -43,6 +43,13 @@ namespace gd {
(void)this->winAssign(val.c_str(), val.size());
}
template <class Param>
string& operator=(Params&& param) {
std::string val;
val = std::forward<Params>(param);
(void)this->winAssign(val.c_str(), val.size());
}
~string() {
(void)this->winDtor();
}