make sure right overload of create is called to make the target table.

This commit is contained in:
ThePhD 2018-01-30 21:05:08 -05:00
parent 165b387ddb
commit 49d99d1b48

View File

@ -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);
}