mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
make sure right overload of create
is called to make the target table.
This commit is contained in:
parent
165b387ddb
commit
49d99d1b48
|
@ -454,7 +454,7 @@ namespace sol {
|
|||
|
||||
template <typename T, bool read_only = true>
|
||||
table new_enum(const string_view& name, std::initializer_list<std::pair<string_view, T>> items) {
|
||||
table target = create(items.size(), 0);
|
||||
table target = create(static_cast<int>(items.size()), static_cast<int>(0));
|
||||
for (const auto& kvp : items) {
|
||||
target.set(kvp.first, kvp.second);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user