asBEHAVE_CONSTRUCT with custom POD string type requires 'const'
gamedev.net
I use RegisterStringFactory to register my own string type, basically something similar to std::string_view.So AS will see them as const string_view after creation.The type is registerd with asOBJ_VALUE | asOBJ_POD | asGetTypeTraits<T>().Now usually I pass my strings to functions by copy.RegisterObjectMethod("obj", "void SetName(string_view)", asMETHOD(obj, SetName, asCALL_THISCALL);->obj.SetName("Jonny"); // works
0 Commentaires ·0 Parts ·32 Vue