godotengine / godotengine/godot-cpp

Provide move constructor/assignment operators for better interop with STL

Open
#435 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
2.7k
Forks
809
Avg merge
1d 3h
Merged PRs (30d)
8

Description

Since it's not possible to expose godot's HashMap, OrderedHashMap, Vector, etc. to GDNative without workarounds, I use STL containers when I want a statically typed container while doesn't need to use it directly with godot.

However `String` only has copy constructors, which causes some problems with STL containers:
Generally having only the copy constructor is not a problem, since STL containers can be used with copy-only types. But it becomes problematic when having something like `std::map>` -- as `std::map` requires either both to be movable, or both to be copyable (at least in practice trying to use the former mentioned type causes compile errors on MSVC).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.